id stringlengths 28 33 | content stringlengths 14 265k ⌀ | max_stars_repo_path stringlengths 49 55 |
|---|---|---|
crossvul-python_data_good_2503_0 | import base64
import re
from datetime import datetime
import logging
import ssl
from xml.etree import ElementTree
import iso8601
import six
import recurly
import recurly.errors
from recurly.link_header import parse_link_value
from six.moves import http_client
from six.moves.urllib.parse import urlencode, urlsplit, qu... | ./CrossVul/dataset_final_sorted/CWE-918/py/good_2503_0 |
crossvul-python_data_bad_2503_0 | import base64
import re
from datetime import datetime
import logging
import ssl
from xml.etree import ElementTree
import iso8601
import six
import recurly
import recurly.errors
from recurly.link_header import parse_link_value
from six.moves import http_client
from six.moves.urllib.parse import urlencode, urljoin, url... | ./CrossVul/dataset_final_sorted/CWE-918/py/bad_2503_0 |
crossvul-python_data_good_5581_2 | # -*- coding: utf-8 -*-
#
# SelfTest/Random/__init__.py: Self-test for random number generation modules
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the exten... | ./CrossVul/dataset_final_sorted/CWE-310/py/good_5581_2 |
crossvul-python_data_good_5581_0 | # -*- coding: ascii -*-
#
# FortunaAccumulator.py : Fortuna's internal accumulator
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to ... | ./CrossVul/dataset_final_sorted/CWE-310/py/good_5581_0 |
crossvul-python_data_good_5581_1 | # -*- coding: utf-8 -*-
#
# Random/_UserFriendlyRNG.py : A user-friendly random number generator
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that ... | ./CrossVul/dataset_final_sorted/CWE-310/py/good_5581_1 |
crossvul-python_data_bad_5581_1 | 404: Not Found | ./CrossVul/dataset_final_sorted/CWE-310/py/bad_5581_1 |
crossvul-python_data_good_546_1 | import datetime
import re
import time
import urllib2
from email import encoders
from email.mime.base import MIMEBase
import mailpile.security as security
from mailpile.conn_brokers import Master as ConnBroker
from mailpile.i18n import gettext as _
from mailpile.i18n import ngettext as _n
from mailpile.commands import ... | ./CrossVul/dataset_final_sorted/CWE-310/py/good_546_1 |
crossvul-python_data_good_3658_0 | #
# ElGamal.py : ElGamal encryption/decryption and signatures
#
# Part of the Python Cryptography Toolkit
#
# Originally written by: A.M. Kuchling
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication ... | ./CrossVul/dataset_final_sorted/CWE-310/py/good_3658_0 |
crossvul-python_data_bad_5581_2 | 404: Not Found | ./CrossVul/dataset_final_sorted/CWE-310/py/bad_5581_2 |
crossvul-python_data_good_546_0 | #coding:utf-8
import os
import string
import sys
import time
import re
import StringIO
import tempfile
import threading
import traceback
import select
import pgpdump
import base64
import quopri
from datetime import datetime
from email.parser import Parser
from email.message import Message
from threading import Thread
... | ./CrossVul/dataset_final_sorted/CWE-310/py/good_546_0 |
crossvul-python_data_bad_5581_0 | 404: Not Found | ./CrossVul/dataset_final_sorted/CWE-310/py/bad_5581_0 |
crossvul-python_data_bad_546_0 | #coding:utf-8
import os
import string
import sys
import time
import re
import StringIO
import tempfile
import threading
import traceback
import select
import pgpdump
import base64
import quopri
from datetime import datetime
from email.parser import Parser
from email.message import Message
from threading import Thread
... | ./CrossVul/dataset_final_sorted/CWE-310/py/bad_546_0 |
crossvul-python_data_bad_3699_0 | """Encryption module that uses pycryptopp or pycrypto"""
try:
# Pycryptopp is preferred over Crypto because Crypto has had
# various periods of not being maintained, and pycryptopp uses
# the Crypto++ library which is generally considered the 'gold standard'
# of crypto implementations
from pycrypto... | ./CrossVul/dataset_final_sorted/CWE-310/py/bad_3699_0 |
crossvul-python_data_bad_546_1 | import datetime
import re
import time
import urllib2
from email import encoders
from email.mime.base import MIMEBase
import mailpile.security as security
from mailpile.conn_brokers import Master as ConnBroker
from mailpile.i18n import gettext as _
from mailpile.i18n import ngettext as _n
from mailpile.commands import ... | ./CrossVul/dataset_final_sorted/CWE-310/py/bad_546_1 |
crossvul-python_data_good_3699_0 | """Encryption module that uses pycryptopp or pycrypto"""
try:
# Pycryptopp is preferred over Crypto because Crypto has had
# various periods of not being maintained, and pycryptopp uses
# the Crypto++ library which is generally considered the 'gold standard'
# of crypto implementations
from pycrypto... | ./CrossVul/dataset_final_sorted/CWE-310/py/good_3699_0 |
crossvul-python_data_bad_3658_0 | 404: Not Found | ./CrossVul/dataset_final_sorted/CWE-310/py/bad_3658_0 |
crossvul-python_data_bad_4295_1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyrigt: (c) 2017, Yanis Guenane <yanis+ansible@guenane.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module... | ./CrossVul/dataset_final_sorted/CWE-116/py/bad_4295_1 |
crossvul-python_data_bad_4295_4 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Yanis Guenane <yanis+ansible@guenane.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
modul... | ./CrossVul/dataset_final_sorted/CWE-116/py/bad_4295_4 |
crossvul-python_data_good_4295_4 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Yanis Guenane <yanis+ansible@guenane.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
modul... | ./CrossVul/dataset_final_sorted/CWE-116/py/good_4295_4 |
crossvul-python_data_bad_4295_3 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016-2017, Yanis Guenane <yanis+ansible@guenane.org>
# Copyright: (c) 2017, Markus Teufelberger <mteufelberger+ansible@mgit.at>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import... | ./CrossVul/dataset_final_sorted/CWE-116/py/bad_4295_3 |
crossvul-python_data_bad_4295_6 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016-2017, Yanis Guenane <yanis+ansible@guenane.org>
# Copyright: (c) 2017, Markus Teufelberger <mteufelberger+ansible@mgit.at>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import... | ./CrossVul/dataset_final_sorted/CWE-116/py/bad_4295_6 |
crossvul-python_data_good_4295_1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyrigt: (c) 2017, Yanis Guenane <yanis+ansible@guenane.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module... | ./CrossVul/dataset_final_sorted/CWE-116/py/good_4295_1 |
crossvul-python_data_good_4295_5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Patrick Pichler <ppichler+ansible@mgit.at>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
modu... | ./CrossVul/dataset_final_sorted/CWE-116/py/good_4295_5 |
crossvul-python_data_bad_4295_2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Yanis Guenane <yanis+ansible@guenane.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
modul... | ./CrossVul/dataset_final_sorted/CWE-116/py/bad_4295_2 |
crossvul-python_data_bad_4295_5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Patrick Pichler <ppichler+ansible@mgit.at>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
modu... | ./CrossVul/dataset_final_sorted/CWE-116/py/bad_4295_5 |
crossvul-python_data_good_4295_3 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016-2017, Yanis Guenane <yanis+ansible@guenane.org>
# Copyright: (c) 2017, Markus Teufelberger <mteufelberger+ansible@mgit.at>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import... | ./CrossVul/dataset_final_sorted/CWE-116/py/good_4295_3 |
crossvul-python_data_good_4295_7 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Felix Fontein <felix@fontein.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: x509_c... | ./CrossVul/dataset_final_sorted/CWE-116/py/good_4295_7 |
crossvul-python_data_bad_4295_7 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Felix Fontein <felix@fontein.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: x509_c... | ./CrossVul/dataset_final_sorted/CWE-116/py/bad_4295_7 |
crossvul-python_data_good_4295_6 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016-2017, Yanis Guenane <yanis+ansible@guenane.org>
# Copyright: (c) 2017, Markus Teufelberger <mteufelberger+ansible@mgit.at>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import... | ./CrossVul/dataset_final_sorted/CWE-116/py/good_4295_6 |
crossvul-python_data_good_4295_2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Yanis Guenane <yanis+ansible@guenane.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
modul... | ./CrossVul/dataset_final_sorted/CWE-116/py/good_4295_2 |
crossvul-python_data_bad_4460_0 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
# standard library dependencies
try:
# prefer lxml as it supports XPath
from lxml import etree
except ImportError:
import xml.etree.ElementTree as etree
from operator import attrgetter
import itertools
from petl.comp... | ./CrossVul/dataset_final_sorted/CWE-91/py/bad_4460_0 |
crossvul-python_data_good_4460_0 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
# standard library dependencies
try:
# prefer lxml as it supports XPath
from lxml import etree
except ImportError:
import xml.etree.ElementTree as etree
from operator import attrgetter
import itertools
from petl.comp... | ./CrossVul/dataset_final_sorted/CWE-91/py/good_4460_0 |
crossvul-python_data_good_2494_1 | from __future__ import absolute_import
from django.conf import settings
from django.core.exceptions import ValidationError
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from typing import List, Optional, Set, Text
from zerver.decorator import authenticated_json_p... | ./CrossVul/dataset_final_sorted/CWE-862/py/good_2494_1 |
crossvul-python_data_bad_2494_1 | 404: Not Found | ./CrossVul/dataset_final_sorted/CWE-862/py/bad_2494_1 |
crossvul-python_data_good_3126_0 | """
Slixmpp: The Slick XMPP Library
Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout
This file is part of Slixmpp.
See the file LICENSE for copying permissio
"""
import logging
import slixmpp
from slixmpp.stanza import Message, Iq
from slixmpp.xmlstream.handler import Callback
from slixmpp.xml... | ./CrossVul/dataset_final_sorted/CWE-346/py/good_3126_0 |
crossvul-python_data_good_4367_9 | # SPDX-License-Identifier: EUPL-1.2
# Copyright (C) 2019 - 2020 Dimpact
from decouple import Csv, config as _config, undefined
def config(option: str, default=undefined, *args, **kwargs):
if "split" in kwargs:
kwargs.pop("split")
kwargs["cast"] = Csv()
if default == []:
default... | ./CrossVul/dataset_final_sorted/CWE-346/py/good_4367_9 |
crossvul-python_data_bad_4367_9 | # SPDX-License-Identifier: EUPL-1.2
# Copyright (C) 2019 - 2020 Dimpact
from decouple import Csv, config as _config, undefined
def config(option: str, default=undefined, *args, **kwargs):
if "split" in kwargs:
kwargs.pop("split")
kwargs["cast"] = Csv()
if default is not undefined and default ... | ./CrossVul/dataset_final_sorted/CWE-346/py/bad_4367_9 |
crossvul-python_data_bad_4367_7 | # SPDX-License-Identifier: EUPL-1.2
# Copyright (C) 2019 - 2020 Dimpact
import factory
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: f"user-{n}")
class Meta:
model = "accounts.User"
class SuperUserFactory(UserFactory):
is_staff = True
is_superus... | ./CrossVul/dataset_final_sorted/CWE-346/py/bad_4367_7 |
crossvul-python_data_bad_4367_8 | # SPDX-License-Identifier: EUPL-1.2
# Copyright (C) 2019 - 2020 Dimpact
import datetime
import os
from django.urls import reverse_lazy
import git
import sentry_sdk
from sentry_sdk.integrations import django, redis
# NLX directory urls
from openzaak.config.constants import NLXDirectories
from ...utils.monitoring imp... | ./CrossVul/dataset_final_sorted/CWE-346/py/bad_4367_8 |
crossvul-python_data_bad_3126_0 | """
Slixmpp: The Slick XMPP Library
Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout
This file is part of Slixmpp.
See the file LICENSE for copying permissio
"""
import logging
import slixmpp
from slixmpp.stanza import Message, Iq
from slixmpp.xmlstream.handler import Callback
from slixmpp.xml... | ./CrossVul/dataset_final_sorted/CWE-346/py/bad_3126_0 |
crossvul-python_data_good_4367_8 | # SPDX-License-Identifier: EUPL-1.2
# Copyright (C) 2019 - 2020 Dimpact
import datetime
import os
from django.urls import reverse_lazy
import git
import sentry_sdk
from corsheaders.defaults import default_headers as default_cors_headers
from sentry_sdk.integrations import django, redis
# NLX directory urls
from open... | ./CrossVul/dataset_final_sorted/CWE-346/py/good_4367_8 |
crossvul-python_data_good_4367_7 | # SPDX-License-Identifier: EUPL-1.2
# Copyright (C) 2019 - 2020 Dimpact
import factory
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: f"user-{n}")
password = factory.PostGenerationMethodCall("set_password")
class Meta:
model = "accounts.User"
class S... | ./CrossVul/dataset_final_sorted/CWE-346/py/good_4367_7 |
crossvul-python_data_bad_5731_0 | """ Track relationships between compiled extension functions & code fragments
catalog keeps track of which compiled(or even standard) functions are
related to which code fragments. It also stores these relationships
to disk so they are remembered between Python sessions. When
a = 1
compi... | ./CrossVul/dataset_final_sorted/CWE-269/py/bad_5731_0 |
crossvul-python_data_good_5731_0 | """ Track relationships between compiled extension functions & code fragments
catalog keeps track of which compiled(or even standard) functions are
related to which code fragments. It also stores these relationships
to disk so they are remembered between Python sessions. When
a = 1
compi... | ./CrossVul/dataset_final_sorted/CWE-269/py/good_5731_0 |
crossvul-python_data_good_4366_4 | """
Custom Authenticator to use GitLab OAuth with JupyterHub
"""
import json
import os
import re
import sys
import warnings
from urllib.parse import quote
from tornado.auth import OAuth2Mixin
from tornado import web
from tornado.escape import url_escape
from tornado.httputil import url_concat
from tornado.httpclien... | ./CrossVul/dataset_final_sorted/CWE-863/py/good_4366_4 |
crossvul-python_data_bad_4366_6 | """
Base classes for Custom Authenticator to use OAuth with JupyterHub
Most of the code c/o Kyle Kelley (@rgbkrk)
"""
import base64
import json
import os
from urllib.parse import quote, urlparse
import uuid
from tornado import web
from tornado.auth import OAuth2Mixin
from tornado.log import app_log
from jupyterhub.... | ./CrossVul/dataset_final_sorted/CWE-863/py/bad_4366_6 |
crossvul-python_data_good_4211_1 | import asyncio
import contextlib
import logging
from datetime import datetime, timedelta, timezone
from typing import Dict, List, Optional, Tuple, Union
import discord
from redbot.core import commands, i18n, checks, modlog
from redbot.core.commands import UserInputOptional
from redbot.core.utils import AsyncIter
from ... | ./CrossVul/dataset_final_sorted/CWE-863/py/good_4211_1 |
crossvul-python_data_bad_4094_0 | """
JupyterHub Spawner to spawn user notebooks on a Kubernetes cluster.
This module exports `KubeSpawner` class, which is the actual spawner
implementation that should be used by JupyterHub.
"""
from functools import partial # noqa
from datetime import datetime
import json
import os
import sys
import string
import m... | ./CrossVul/dataset_final_sorted/CWE-863/py/bad_4094_0 |
crossvul-python_data_bad_4366_4 | """
Custom Authenticator to use GitLab OAuth with JupyterHub
"""
import json
import os
import re
import sys
import warnings
from urllib.parse import quote
from tornado.auth import OAuth2Mixin
from tornado import web
from tornado.escape import url_escape
from tornado.httputil import url_concat
from tornado.httpclien... | ./CrossVul/dataset_final_sorted/CWE-863/py/bad_4366_4 |
crossvul-python_data_good_4366_3 | """
Authenticator to use GitHub OAuth with JupyterHub
"""
import json
import os
import re
import string
import warnings
from tornado.auth import OAuth2Mixin
from tornado import web
from tornado.httputil import url_concat
from tornado.httpclient import HTTPRequest, AsyncHTTPClient, HTTPError
from jupyterhub.auth im... | ./CrossVul/dataset_final_sorted/CWE-863/py/good_4366_3 |
crossvul-python_data_good_4094_0 | """
JupyterHub Spawner to spawn user notebooks on a Kubernetes cluster.
This module exports `KubeSpawner` class, which is the actual spawner
implementation that should be used by JupyterHub.
"""
from functools import partial # noqa
from datetime import datetime
import json
import os
import sys
import string
import m... | ./CrossVul/dataset_final_sorted/CWE-863/py/good_4094_0 |
crossvul-python_data_good_4544_0 | from django.core.exceptions import PermissionDenied
import qrcode
import qrcode.image.svg
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.views import SuccessURLAllowedHostsMixin
from django.http import HttpResponse
from django.shortcuts import resolve_url
f... | ./CrossVul/dataset_final_sorted/CWE-863/py/good_4544_0 |
crossvul-python_data_good_4366_2 | """CILogon OAuthAuthenticator for JupyterHub
Uses OAuth 2.0 with cilogon.org (override with CILOGON_HOST)
Caveats:
- For allowed user list /admin purposes, username will be the ePPN by default.
This is typically an email address and may not work as a Unix userid.
Normalization may be required to turn the Jupyter... | ./CrossVul/dataset_final_sorted/CWE-863/py/good_4366_2 |
crossvul-python_data_good_4126_1 | #!/usr/bin/env python
# Copyright 2017, New York University and the TUF contributors
# SPDX-License-Identifier: MIT OR Apache-2.0
"""
<Program Name>
settings.py
<Author>
Vladimir Diaz <vladimir.v.diaz@gmail.com>
<Started>
January 11, 2017
<Copyright>
See LICENSE-MIT OR LICENSE for licensing information.
<... | ./CrossVul/dataset_final_sorted/CWE-863/py/good_4126_1 |
crossvul-python_data_good_2493_1 | from __future__ import absolute_import
from typing import Any, Optional, Tuple, List, Set, Iterable, Mapping, Callable, Dict
from django.utils.translation import ugettext as _
from django.conf import settings
from django.db import transaction
from django.http import HttpRequest, HttpResponse
from zerver.lib.request i... | ./CrossVul/dataset_final_sorted/CWE-863/py/good_2493_1 |
crossvul-python_data_good_4126_0 | #!/usr/bin/env python
# Copyright 2012 - 2017, New York University and the TUF contributors
# SPDX-License-Identifier: MIT OR Apache-2.0
"""
<Program Name>
updater.py
<Author>
Geremy Condra
Vladimir Diaz <vladimir.v.diaz@gmail.com>
<Started>
July 2012. Based on a previous version of this module. (VLAD)
<C... | ./CrossVul/dataset_final_sorted/CWE-863/py/good_4126_0 |
crossvul-python_data_bad_4211_1 | import asyncio
import contextlib
import logging
from datetime import datetime, timedelta, timezone
from typing import Optional, Tuple, Union
import discord
from redbot.core import commands, i18n, checks, modlog
from redbot.core.commands import UserInputOptional
from redbot.core.utils import AsyncIter
from redbot.core.... | ./CrossVul/dataset_final_sorted/CWE-863/py/bad_4211_1 |
crossvul-python_data_good_4366_1 | """
Custom Authenticator to use Bitbucket OAuth with JupyterHub
"""
import json
import urllib
from tornado.auth import OAuth2Mixin
from tornado import web
from tornado.httputil import url_concat
from tornado.httpclient import HTTPRequest, AsyncHTTPClient
from jupyterhub.auth import LocalAuthenticator
from traitlet... | ./CrossVul/dataset_final_sorted/CWE-863/py/good_4366_1 |
crossvul-python_data_bad_4366_2 | """CILogon OAuthAuthenticator for JupyterHub
Uses OAuth 2.0 with cilogon.org (override with CILOGON_HOST)
Caveats:
- For allowed user list /admin purposes, username will be the ePPN by default.
This is typically an email address and may not work as a Unix userid.
Normalization may be required to turn the Jupyter... | ./CrossVul/dataset_final_sorted/CWE-863/py/bad_4366_2 |
crossvul-python_data_good_4098_0 | from collections import defaultdict
from datetime import datetime
from debts import settle
from flask import current_app, g
from flask_sqlalchemy import BaseQuery, SQLAlchemy
from itsdangerous import (
BadSignature,
SignatureExpired,
TimedJSONWebSignatureSerializer,
URLSafeSerializer,
)
import sqlalche... | ./CrossVul/dataset_final_sorted/CWE-863/py/good_4098_0 |
crossvul-python_data_bad_2493_1 | from __future__ import absolute_import
from typing import Any, Optional, Tuple, List, Set, Iterable, Mapping, Callable, Dict
from django.utils.translation import ugettext as _
from django.conf import settings
from django.db import transaction
from django.http import HttpRequest, HttpResponse
from zerver.lib.request i... | ./CrossVul/dataset_final_sorted/CWE-863/py/bad_2493_1 |
crossvul-python_data_bad_4544_0 | import qrcode
import qrcode.image.svg
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.views import SuccessURLAllowedHostsMixin
from django.http import HttpResponse
from django.shortcuts import resolve_url
from django.urls import reverse
from django.utils.dec... | ./CrossVul/dataset_final_sorted/CWE-863/py/bad_4544_0 |
crossvul-python_data_good_4366_6 | """
Base classes for Custom Authenticator to use OAuth with JupyterHub
Most of the code c/o Kyle Kelley (@rgbkrk)
"""
import base64
import json
import os
from urllib.parse import quote, urlparse
import uuid
from tornado import web
from tornado.auth import OAuth2Mixin
from tornado.log import app_log
from jupyterhub.... | ./CrossVul/dataset_final_sorted/CWE-863/py/good_4366_6 |
crossvul-python_data_good_4366_5 | """
Custom Authenticator to use Google OAuth with JupyterHub.
Derived from the GitHub OAuth authenticator.
"""
import os
import json
import urllib.parse
from tornado import gen
from tornado.httpclient import HTTPRequest, AsyncHTTPClient
from tornado.auth import GoogleOAuth2Mixin
from tornado.web import HTTPError
fr... | ./CrossVul/dataset_final_sorted/CWE-863/py/good_4366_5 |
crossvul-python_data_bad_4126_1 | #!/usr/bin/env python
# Copyright 2017, New York University and the TUF contributors
# SPDX-License-Identifier: MIT OR Apache-2.0
"""
<Program Name>
settings.py
<Author>
Vladimir Diaz <vladimir.v.diaz@gmail.com>
<Started>
January 11, 2017
<Copyright>
See LICENSE-MIT OR LICENSE for licensing information.
<... | ./CrossVul/dataset_final_sorted/CWE-863/py/bad_4126_1 |
crossvul-python_data_bad_4098_0 | from collections import defaultdict
from datetime import datetime
from debts import settle
from flask import current_app, g
from flask_sqlalchemy import BaseQuery, SQLAlchemy
from itsdangerous import (
BadSignature,
SignatureExpired,
TimedJSONWebSignatureSerializer,
URLSafeSerializer,
)
import sqlalche... | ./CrossVul/dataset_final_sorted/CWE-863/py/bad_4098_0 |
crossvul-python_data_bad_4126_0 | #!/usr/bin/env python
# Copyright 2012 - 2017, New York University and the TUF contributors
# SPDX-License-Identifier: MIT OR Apache-2.0
"""
<Program Name>
updater.py
<Author>
Geremy Condra
Vladimir Diaz <vladimir.v.diaz@gmail.com>
<Started>
July 2012. Based on a previous version of this module. (VLAD)
<C... | ./CrossVul/dataset_final_sorted/CWE-863/py/bad_4126_0 |
crossvul-python_data_bad_4366_1 | """
Custom Authenticator to use Bitbucket OAuth with JupyterHub
"""
import json
import urllib
from tornado.auth import OAuth2Mixin
from tornado import web
from tornado.httputil import url_concat
from tornado.httpclient import HTTPRequest, AsyncHTTPClient
from jupyterhub.auth import LocalAuthenticator
from traitlet... | ./CrossVul/dataset_final_sorted/CWE-863/py/bad_4366_1 |
crossvul-python_data_bad_4366_5 | """
Custom Authenticator to use Google OAuth with JupyterHub.
Derived from the GitHub OAuth authenticator.
"""
import os
import json
import urllib.parse
from tornado import gen
from tornado.httpclient import HTTPRequest, AsyncHTTPClient
from tornado.auth import GoogleOAuth2Mixin
from tornado.web import HTTPError
fr... | ./CrossVul/dataset_final_sorted/CWE-863/py/bad_4366_5 |
crossvul-python_data_bad_4366_3 | """
Authenticator to use GitHub OAuth with JupyterHub
"""
import json
import os
import re
import string
import warnings
from tornado.auth import OAuth2Mixin
from tornado import web
from tornado.httputil import url_concat
from tornado.httpclient import HTTPRequest, AsyncHTTPClient, HTTPError
from jupyterhub.auth im... | ./CrossVul/dataset_final_sorted/CWE-863/py/bad_4366_3 |
crossvul-python_data_good_1730_0 | # -*- coding: utf-8 -*-
'''
Management of user accounts
===========================
The user module is used to create and manage user settings, users can be set
as either absent or present
.. code-block:: yaml
fred:
user.present:
- fullname: Fred Jones
- shell: /bin/zsh
- home: /hom... | ./CrossVul/dataset_final_sorted/CWE-534/py/good_1730_0 |
crossvul-python_data_bad_1730_0 | 404: Not Found | ./CrossVul/dataset_final_sorted/CWE-534/py/bad_1730_0 |
crossvul-python_data_good_5519_0 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Bottle is a fast and simple micro-framework for small web applications. It
offers request dispatching (Routes) with URL parameter support, templates,
a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and
template engines - all in a single file an... | ./CrossVul/dataset_final_sorted/CWE-93/py/good_5519_0 |
crossvul-python_data_bad_5519_0 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Bottle is a fast and simple micro-framework for small web applications. It
offers request dispatching (Routes) with URL parameter support, templates,
a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and
template engines - all in a single file an... | ./CrossVul/dataset_final_sorted/CWE-93/py/bad_5519_0 |
crossvul-python_data_bad_1501_0 | # -*- coding: utf-8 -*-
'''
Execute chef in server or solo mode
'''
# Import Python libs
import logging
import os
import tempfile
# Import Salt libs
import salt.utils
import salt.utils.decorators as decorators
log = logging.getLogger(__name__)
def __virtual__():
'''
Only load if chef is installed
'''
... | ./CrossVul/dataset_final_sorted/CWE-19/py/bad_1501_0 |
crossvul-python_data_bad_1500_0 | # -*- coding: utf-8 -*-
'''
Wrapper around Server Density API
=================================
.. versionadded:: 2014.7.0
'''
import requests
import json
import logging
from salt.exceptions import CommandExecutionError
log = logging.getLogger(__name__)
def get_sd_auth(val, sd_auth_pillar_name='serverdensity'):
... | ./CrossVul/dataset_final_sorted/CWE-19/py/bad_1500_0 |
crossvul-python_data_bad_1502_0 | # -*- coding: utf-8 -*-
'''
Execute chef in server or solo mode
'''
# Import Python libs
import logging
import os
# Import Salt libs
import salt.utils
import salt.utils.decorators as decorators
log = logging.getLogger(__name__)
def __virtual__():
'''
Only load if chef is installed
'''
if not salt.u... | ./CrossVul/dataset_final_sorted/CWE-19/py/bad_1502_0 |
crossvul-python_data_good_1502_0 | # -*- coding: utf-8 -*-
'''
Execute chef in server or solo mode
'''
# Import Python libs
import logging
import os
import tempfile
# Import Salt libs
import salt.utils
import salt.utils.decorators as decorators
log = logging.getLogger(__name__)
def __virtual__():
'''
Only load if chef is installed
'''
... | ./CrossVul/dataset_final_sorted/CWE-19/py/good_1502_0 |
crossvul-python_data_good_1500_0 | # -*- coding: utf-8 -*-
'''
Wrapper around Server Density API
=================================
.. versionadded:: 2014.7.0
'''
import requests
import json
import logging
import os
import tempfile
from salt.exceptions import CommandExecutionError
log = logging.getLogger(__name__)
def get_sd_auth(val, sd_auth_pillar... | ./CrossVul/dataset_final_sorted/CWE-19/py/good_1500_0 |
crossvul-python_data_good_1501_0 | # -*- coding: utf-8 -*-
'''
Execute chef in server or solo mode
'''
# Import Python libs
import logging
import os
import tempfile
# Import Salt libs
import salt.utils
import salt.utils.decorators as decorators
log = logging.getLogger(__name__)
def __virtual__():
'''
Only load if chef is installed
'''
... | ./CrossVul/dataset_final_sorted/CWE-19/py/good_1501_0 |
crossvul-python_data_good_4113_0 | import discord
from redbot.core.bot import Red
from redbot.core import checks, commands, Config
from redbot.core.i18n import cog_i18n, Translator
from redbot.core.utils._internal_utils import send_to_owners_with_prefix_replaced
from redbot.core.utils.chat_formatting import escape, pagify
from .streamtypes import (
... | ./CrossVul/dataset_final_sorted/CWE-94/py/good_4113_0 |
crossvul-python_data_bad_663_0 | # -*- coding: utf-8 -*-
"""
eve.io.mongo.parser
~~~~~~~~~~~~~~~~~~~
This module implements a Python-to-Mongo syntax parser. Allows the MongoDB
data-layer to seamlessly respond to a Python-like query.
:copyright: (c) 2017 by Nicola Iarocci.
:license: BSD, see LICENSE for more details.
"""
imp... | ./CrossVul/dataset_final_sorted/CWE-94/py/bad_663_0 |
crossvul-python_data_good_3754_4 | # Copyright (c) 2010-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 required by applicable law or agreed to ... | ./CrossVul/dataset_final_sorted/CWE-94/py/good_3754_4 |
crossvul-python_data_bad_3754_3 | # Copyright (c) 2010-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 required by applicable law or agreed to ... | ./CrossVul/dataset_final_sorted/CWE-94/py/bad_3754_3 |
crossvul-python_data_bad_3064_4 | import yaml
try:
from ansible.utils.vault import VaultLib
except ImportError:
# Ansible 2.0 has changed the vault location
from ansible.parsing.vault import VaultLib
class Vault(object):
'''R/W an ansible-vault yaml file'''
def __init__(self, password):
self.password = password
se... | ./CrossVul/dataset_final_sorted/CWE-94/py/bad_3064_4 |
crossvul-python_data_good_3754_3 | # Copyright (c) 2010-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 required by applicable law or agreed to ... | ./CrossVul/dataset_final_sorted/CWE-94/py/good_3754_3 |
crossvul-python_data_good_4111_1 | """ A FastAPI app used to create an OpenAPI document for end-to-end testing """
import json
from datetime import date, datetime
from enum import Enum
from pathlib import Path
from typing import Any, Dict, List, Union
from fastapi import APIRouter, Body, FastAPI, File, Header, Query, UploadFile
from pydantic import Bas... | ./CrossVul/dataset_final_sorted/CWE-94/py/good_4111_1 |
crossvul-python_data_bad_3754_4 | # Copyright (c) 2010-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 required by applicable law or agreed to ... | ./CrossVul/dataset_final_sorted/CWE-94/py/bad_3754_4 |
crossvul-python_data_bad_4111_1 | """ A FastAPI app used to create an OpenAPI document for end-to-end testing """
import json
from datetime import date, datetime
from enum import Enum
from pathlib import Path
from typing import Any, Dict, List, Union
from fastapi import APIRouter, FastAPI, File, Header, Query, UploadFile
from pydantic import BaseModel... | ./CrossVul/dataset_final_sorted/CWE-94/py/bad_4111_1 |
crossvul-python_data_good_3064_4 | import yaml
try:
from ansible.utils.vault import VaultLib
except ImportError:
# Ansible 2.0 has changed the vault location
from ansible.parsing.vault import VaultLib
class Vault(object):
'''R/W an ansible-vault yaml file'''
def __init__(self, password):
self.password = password
se... | ./CrossVul/dataset_final_sorted/CWE-94/py/good_3064_4 |
crossvul-python_data_bad_3064_8 | import sys
import os
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
def _read(fname):
here = os.path.dirname(os.path.abspath(__file__))
return open(os.path.join(here, fname)).read()
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Ar... | ./CrossVul/dataset_final_sorted/CWE-94/py/bad_3064_8 |
crossvul-python_data_bad_4113_0 | import discord
from redbot.core.bot import Red
from redbot.core import checks, commands, Config
from redbot.core.i18n import cog_i18n, Translator
from redbot.core.utils._internal_utils import send_to_owners_with_prefix_replaced
from redbot.core.utils.chat_formatting import escape, pagify
from .streamtypes import (
... | ./CrossVul/dataset_final_sorted/CWE-94/py/bad_4113_0 |
crossvul-python_data_good_663_0 | # -*- coding: utf-8 -*-
"""
eve.io.mongo.parser
~~~~~~~~~~~~~~~~~~~
This module implements a Python-to-Mongo syntax parser. Allows the MongoDB
data-layer to seamlessly respond to a Python-like query.
:copyright: (c) 2017 by Nicola Iarocci.
:license: BSD, see LICENSE for more details.
"""
imp... | ./CrossVul/dataset_final_sorted/CWE-94/py/good_663_0 |
crossvul-python_data_good_3064_8 | import sys
import os
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
def _read(fname):
here = os.path.dirname(os.path.abspath(__file__))
return open(os.path.join(here, fname)).read()
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Ar... | ./CrossVul/dataset_final_sorted/CWE-94/py/good_3064_8 |
crossvul-python_data_bad_997_1 | # -*- coding: utf-8 -*-
"""
werkzeug.debug
~~~~~~~~~~~~~~
WSGI application traceback debugger.
:copyright: 2007 Pallets
:license: BSD-3-Clause
"""
import getpass
import hashlib
import json
import mimetypes
import os
import pkgutil
import re
import sys
import time
import uuid
from itertools import ... | ./CrossVul/dataset_final_sorted/CWE-331/py/bad_997_1 |
crossvul-python_data_good_997_1 | # -*- coding: utf-8 -*-
"""
werkzeug.debug
~~~~~~~~~~~~~~
WSGI application traceback debugger.
:copyright: 2007 Pallets
:license: BSD-3-Clause
"""
import getpass
import hashlib
import json
import mimetypes
import os
import pkgutil
import re
import sys
import time
import uuid
from itertools import ... | ./CrossVul/dataset_final_sorted/CWE-331/py/good_997_1 |
crossvul-python_data_bad_4331_0 | import sys
import ldap # pylint: disable=import-error
from flask import current_app, jsonify, request
from flask_cors import cross_origin
from alerta.auth.utils import create_token, get_customers
from alerta.exceptions import ApiError
from alerta.models.permission import Permission
from alerta.models.user import Use... | ./CrossVul/dataset_final_sorted/CWE-287/py/bad_4331_0 |
crossvul-python_data_good_1224_5 | from typing import Union, Optional, Dict, Any, List
import ujson
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from django.shortcuts import redirect, render
from django.conf import settings
from zerver.decorator import require_realm_admin, require_member_or_admi... | ./CrossVul/dataset_final_sorted/CWE-287/py/good_1224_5 |
crossvul-python_data_bad_3282_0 | #!/usr/bin/python
from k5test import *
# Skip this test if pkinit wasn't built.
if not os.path.exists(os.path.join(plugins, 'preauth', 'pkinit.so')):
skip_rest('PKINIT tests', 'PKINIT module not built')
# Check if soft-pkcs11.so is available.
try:
import ctypes
lib = ctypes.LibraryLoader(ctypes.CDLL).Load... | ./CrossVul/dataset_final_sorted/CWE-287/py/bad_3282_0 |
crossvul-python_data_good_1224_2 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-11-21 01:47
from __future__ import unicode_literals
from django.db import migrations
from typing import Any, List
class Migration(migrations.Migration):
dependencies = [
('zerver', '0253_userprofile_wildcard_mentions_notify'),
('zerver... | ./CrossVul/dataset_final_sorted/CWE-287/py/good_1224_2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.