id stringlengths 28 33 | content stringlengths 14 265k ⌀ | max_stars_repo_path stringlengths 49 55 |
|---|---|---|
crossvul-python_data_bad_742_1 | """Parse (absolute and relative) URLs.
urlparse module is based upon the following RFC specifications.
RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L. Masinter, January 2005.
RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, Decemb... | ./CrossVul/dataset_final_sorted/CWE-255/py/bad_742_1 |
crossvul-python_data_good_5754_0 | # vim:set et sts=4 sw=4:
# -*- coding: utf-8 -*-
#
# ibus-anthy - The Anthy engine for IBus
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2010-2013 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2007-2013 Red Hat, Inc.
#
# This program is free software; you can redistribut... | ./CrossVul/dataset_final_sorted/CWE-255/py/good_5754_0 |
crossvul-python_data_bad_5024_0 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Contains the classes for the global used variables:
- Request
- Response
- Session
"""
from gluon.... | ./CrossVul/dataset_final_sorted/CWE-255/py/bad_5024_0 |
crossvul-python_data_good_744_1 | """Parse (absolute and relative) URLs.
urlparse module is based upon the following RFC specifications.
RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L. Masinter, January 2005.
RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, Decemb... | ./CrossVul/dataset_final_sorted/CWE-255/py/good_744_1 |
crossvul-python_data_good_3792_0 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | ./CrossVul/dataset_final_sorted/CWE-255/py/good_3792_0 |
crossvul-python_data_good_3788_0 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | ./CrossVul/dataset_final_sorted/CWE-255/py/good_3788_0 |
crossvul-python_data_bad_2084_1 | #
# The Python Imaging Library.
# $Id$
#
# the Image class wrapper
#
# partial release history:
# 1995-09-09 fl Created
# 1996-03-11 fl PIL release 0.0 (proof of concept)
# 1996-04-30 fl PIL release 0.1b1
# 1999-07-28 fl PIL release 1.0 final
# 2000-06-07 fl PIL release 1.1
# 2000-10-20 fl PIL release 1.1.1... | ./CrossVul/dataset_final_sorted/CWE-59/py/bad_2084_1 |
crossvul-python_data_bad_2084_3 | #
# The Python Imaging Library.
# $Id$
#
# JPEG (JFIF) file handling
#
# See "Digital Compression and Coding of Continous-Tone Still Images,
# Part 1, Requirements and Guidelines" (CCITT T.81 / ISO 10918-1)
#
# History:
# 1995-09-09 fl Created
# 1995-09-13 fl Added full parser
# 1996-03-25 fl Added hack to use th... | ./CrossVul/dataset_final_sorted/CWE-59/py/bad_2084_3 |
crossvul-python_data_bad_3481_0 | #!/usr/bin/env python
#############################################################################
#
# Run Pyro servers as daemon processes on Unix/Linux.
# This won't work on other operating systems such as Windows.
# Author: Jeff Bauer (jbauer@rubic.com)
# This software is released under the MIT software license.... | ./CrossVul/dataset_final_sorted/CWE-59/py/bad_3481_0 |
crossvul-python_data_good_2836_0 | 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-59/py/good_2836_0 |
crossvul-python_data_bad_2084_2 | #
# The Python Imaging Library.
# $Id$
#
# IPTC/NAA file handling
#
# history:
# 1995-10-01 fl Created
# 1998-03-09 fl Cleaned up and added to PIL
# 2002-06-18 fl Added getiptcinfo helper
#
# Copyright (c) Secret Labs AB 1997-2002.
# Copyright (c) Fredrik Lundh 1995.
#
# See the README file for information on usa... | ./CrossVul/dataset_final_sorted/CWE-59/py/bad_2084_2 |
crossvul-python_data_good_2084_0 | #
# The Python Imaging Library.
# $Id$
#
# EPS file handling
#
# History:
# 1995-09-01 fl Created (0.1)
# 1996-05-18 fl Don't choke on "atend" fields, Ghostscript interface (0.2)
# 1996-08-22 fl Don't choke on floating point BoundingBox values
# 1996-08-23 fl Handle files from Macintosh (0.3)
# 2001-02-17 fl ... | ./CrossVul/dataset_final_sorted/CWE-59/py/good_2084_0 |
crossvul-python_data_bad_2836_0 | 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-59/py/bad_2836_0 |
crossvul-python_data_bad_1711_0 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# and chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2013, Michael Scherer <misc@zarb.org>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gener... | ./CrossVul/dataset_final_sorted/CWE-59/py/bad_1711_0 |
crossvul-python_data_bad_4994_0 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Kevin Carter <kevin.carter@rackspace.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... | ./CrossVul/dataset_final_sorted/CWE-59/py/bad_4994_0 |
crossvul-python_data_good_4994_0 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Kevin Carter <kevin.carter@rackspace.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... | ./CrossVul/dataset_final_sorted/CWE-59/py/good_4994_0 |
crossvul-python_data_bad_2084_0 | #
# The Python Imaging Library.
# $Id$
#
# EPS file handling
#
# History:
# 1995-09-01 fl Created (0.1)
# 1996-05-18 fl Don't choke on "atend" fields, Ghostscript interface (0.2)
# 1996-08-22 fl Don't choke on floating point BoundingBox values
# 1996-08-23 fl Handle files from Macintosh (0.3)
# 2001-02-17 fl ... | ./CrossVul/dataset_final_sorted/CWE-59/py/bad_2084_0 |
crossvul-python_data_good_1710_0 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public ... | ./CrossVul/dataset_final_sorted/CWE-59/py/good_1710_0 |
crossvul-python_data_bad_1710_0 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Maykel Moya <mmoya@speedyrails.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundati... | ./CrossVul/dataset_final_sorted/CWE-59/py/bad_1710_0 |
crossvul-python_data_bad_1711_1 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# and chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# and jail.py (c) 2013, Michael Scherer <misc@zarb.org>
# (c) 2015, Dagobert Michelsen <dam@baltic-online.de>
#
# This file is part of Ansible
#
# Ansible is free software: you... | ./CrossVul/dataset_final_sorted/CWE-59/py/bad_1711_1 |
crossvul-python_data_good_1711_1 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# and chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# and jail.py (c) 2013, Michael Scherer <misc@zarb.org>
# (c) 2015, Dagobert Michelsen <dam@baltic-online.de>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file ... | ./CrossVul/dataset_final_sorted/CWE-59/py/good_1711_1 |
crossvul-python_data_good_2084_3 | #
# The Python Imaging Library.
# $Id$
#
# JPEG (JFIF) file handling
#
# See "Digital Compression and Coding of Continous-Tone Still Images,
# Part 1, Requirements and Guidelines" (CCITT T.81 / ISO 10918-1)
#
# History:
# 1995-09-09 fl Created
# 1995-09-13 fl Added full parser
# 1996-03-25 fl Added hack to use th... | ./CrossVul/dataset_final_sorted/CWE-59/py/good_2084_3 |
crossvul-python_data_good_1711_0 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# and chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2013, Michael Scherer <misc@zarb.org>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it... | ./CrossVul/dataset_final_sorted/CWE-59/py/good_1711_0 |
crossvul-python_data_good_2084_2 | #
# The Python Imaging Library.
# $Id$
#
# IPTC/NAA file handling
#
# history:
# 1995-10-01 fl Created
# 1998-03-09 fl Cleaned up and added to PIL
# 2002-06-18 fl Added getiptcinfo helper
#
# Copyright (c) Secret Labs AB 1997-2002.
# Copyright (c) Fredrik Lundh 1995.
#
# See the README file for information on usa... | ./CrossVul/dataset_final_sorted/CWE-59/py/good_2084_2 |
crossvul-python_data_good_3481_0 | #!/usr/bin/env python
#############################################################################
#
# Run Pyro servers as daemon processes on Unix/Linux.
# This won't work on other operating systems such as Windows.
# Author: Jeff Bauer (jbauer@rubic.com)
# This software is released under the MIT software license.... | ./CrossVul/dataset_final_sorted/CWE-59/py/good_3481_0 |
crossvul-python_data_good_2084_1 | #
# The Python Imaging Library.
# $Id$
#
# the Image class wrapper
#
# partial release history:
# 1995-09-09 fl Created
# 1996-03-11 fl PIL release 0.0 (proof of concept)
# 1996-04-30 fl PIL release 0.1b1
# 1999-07-28 fl PIL release 1.0 final
# 2000-06-07 fl PIL release 1.1
# 2000-10-20 fl PIL release 1.1.1... | ./CrossVul/dataset_final_sorted/CWE-59/py/good_2084_1 |
crossvul-python_data_bad_2234_5 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | ./CrossVul/dataset_final_sorted/CWE-74/py/bad_2234_5 |
crossvul-python_data_bad_2234_1 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | ./CrossVul/dataset_final_sorted/CWE-74/py/bad_2234_1 |
crossvul-python_data_bad_4316_1 | from __future__ import absolute_import
import datetime
import logging
import os
import socket
from socket import error as SocketError, timeout as SocketTimeout
import warnings
from .packages import six
from .packages.six.moves.http_client import HTTPConnection as _HTTPConnection
from .packages.six.moves.http_client imp... | ./CrossVul/dataset_final_sorted/CWE-74/py/bad_4316_1 |
crossvul-python_data_good_4316_1 | from __future__ import absolute_import
import re
import datetime
import logging
import os
import socket
from socket import error as SocketError, timeout as SocketTimeout
import warnings
from .packages import six
from .packages.six.moves.http_client import HTTPConnection as _HTTPConnection
from .packages.six.moves.http_... | ./CrossVul/dataset_final_sorted/CWE-74/py/good_4316_1 |
crossvul-python_data_good_3934_0 | """Small, fast HTTP client library for Python.
Features persistent connections, cache, and Google App Engine Standard
Environment support.
"""
from __future__ import print_function
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = [
"Thomas Broyer ... | ./CrossVul/dataset_final_sorted/CWE-74/py/good_3934_0 |
crossvul-python_data_good_4109_0 | """Module for Trivia cog."""
import asyncio
import math
import pathlib
from collections import Counter
from typing import List, Literal
import io
import yaml
import discord
from redbot.core import Config, commands, checks
from redbot.cogs.bank import is_owner_if_bank_global
from redbot.core.data_manager import cog_da... | ./CrossVul/dataset_final_sorted/CWE-74/py/good_4109_0 |
crossvul-python_data_bad_2223_1 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | ./CrossVul/dataset_final_sorted/CWE-74/py/bad_2223_1 |
crossvul-python_data_bad_2223_0 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | ./CrossVul/dataset_final_sorted/CWE-74/py/bad_2223_0 |
crossvul-python_data_good_3934_1 | # -*- coding: utf-8 -*-
"""Small, fast HTTP client library for Python."""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = [
"Thomas Broyer (t.broyer@ltgt.net)",
"James Antill",
"Xavier Verges Farrero",
"Jonathan Feinberg",
"Blair Za... | ./CrossVul/dataset_final_sorted/CWE-74/py/good_3934_1 |
crossvul-python_data_bad_2234_3 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | ./CrossVul/dataset_final_sorted/CWE-74/py/bad_2234_3 |
crossvul-python_data_good_4621_1 | VERSION = (0, 9, '3b1')
__version__ = '.'.join(map(str, VERSION))
version = lambda: __version__
| ./CrossVul/dataset_final_sorted/CWE-74/py/good_4621_1 |
crossvul-python_data_good_2234_0 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | ./CrossVul/dataset_final_sorted/CWE-74/py/good_2234_0 |
crossvul-python_data_good_2223_0 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | ./CrossVul/dataset_final_sorted/CWE-74/py/good_2223_0 |
crossvul-python_data_bad_4109_0 | """Module for Trivia cog."""
import asyncio
import math
import pathlib
from collections import Counter
from typing import List, Literal
import io
import yaml
import discord
from redbot.core import Config, commands, checks
from redbot.cogs.bank import is_owner_if_bank_global
from redbot.core.data_manager import cog_da... | ./CrossVul/dataset_final_sorted/CWE-74/py/bad_4109_0 |
crossvul-python_data_good_2234_3 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | ./CrossVul/dataset_final_sorted/CWE-74/py/good_2234_3 |
crossvul-python_data_good_2234_5 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | ./CrossVul/dataset_final_sorted/CWE-74/py/good_2234_5 |
crossvul-python_data_bad_3934_1 | # -*- coding: utf-8 -*-
"""Small, fast HTTP client library for Python."""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = [
"Thomas Broyer (t.broyer@ltgt.net)",
"James Antill",
"Xavier Verges Farrero",
"Jonathan Feinberg",
"Blair Za... | ./CrossVul/dataset_final_sorted/CWE-74/py/bad_3934_1 |
crossvul-python_data_good_2234_4 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | ./CrossVul/dataset_final_sorted/CWE-74/py/good_2234_4 |
crossvul-python_data_good_2234_1 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | ./CrossVul/dataset_final_sorted/CWE-74/py/good_2234_1 |
crossvul-python_data_bad_2234_4 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | ./CrossVul/dataset_final_sorted/CWE-74/py/bad_2234_4 |
crossvul-python_data_bad_3934_2 | from __future__ import print_function
import base64
import contextlib
import copy
import email.utils
import functools
import gzip
import hashlib
import httplib2
import os
import random
import re
import shutil
import six
import socket
import ssl
import struct
import sys
import threading
import time
import traceback
imp... | ./CrossVul/dataset_final_sorted/CWE-74/py/bad_3934_2 |
crossvul-python_data_good_4621_2 | import re
from pathlib import Path
from urllib.parse import unquote
import base64
import json, os, requests, time, pytz, pymongo
from shutil import rmtree
from requests.exceptions import ConnectionError
from os.path import join, exists
from django.shortcuts import render
from django.core.serializers import serialize
fr... | ./CrossVul/dataset_final_sorted/CWE-74/py/good_4621_2 |
crossvul-python_data_bad_2234_0 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | ./CrossVul/dataset_final_sorted/CWE-74/py/bad_2234_0 |
crossvul-python_data_bad_2234_2 | # (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com>
# Stephen Fromm <sfromm@gmail.com>
# Brian Coca <briancoca+dev@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | ./CrossVul/dataset_final_sorted/CWE-74/py/bad_2234_2 |
crossvul-python_data_good_2234_2 | # (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com>
# Stephen Fromm <sfromm@gmail.com>
# Brian Coca <briancoca+dev@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | ./CrossVul/dataset_final_sorted/CWE-74/py/good_2234_2 |
crossvul-python_data_bad_4621_2 | from pathlib import Path
from urllib.parse import unquote
import base64
import json, os, requests, time, pytz, pymongo
from shutil import rmtree
from requests.exceptions import ConnectionError
from os.path import join, exists
from django.shortcuts import render
from django.core.serializers import serialize
from django.... | ./CrossVul/dataset_final_sorted/CWE-74/py/bad_4621_2 |
crossvul-python_data_bad_4621_1 | VERSION = (0, 9, '3a3')
__version__ = '.'.join(map(str, VERSION))
version = lambda: __version__
| ./CrossVul/dataset_final_sorted/CWE-74/py/bad_4621_1 |
crossvul-python_data_bad_3934_0 | """Small, fast HTTP client library for Python.
Features persistent connections, cache, and Google App Engine Standard
Environment support.
"""
from __future__ import print_function
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = [
"Thomas Broyer ... | ./CrossVul/dataset_final_sorted/CWE-74/py/bad_3934_0 |
crossvul-python_data_good_2223_1 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | ./CrossVul/dataset_final_sorted/CWE-74/py/good_2223_1 |
crossvul-python_data_good_3934_2 | from __future__ import print_function
import base64
import contextlib
import copy
import email.utils
import functools
import gzip
import hashlib
import httplib2
import os
import random
import re
import shutil
import six
import socket
import ssl
import struct
import sys
import threading
import time
import traceback
imp... | ./CrossVul/dataset_final_sorted/CWE-74/py/good_3934_2 |
crossvul-python_data_good_3895_3 | import operator
from functools import partial
from typing import TYPE_CHECKING, Any, Dict, Iterable, Optional, Tuple
from pypika import Table
from pypika.functions import Upper
from pypika.terms import (
BasicCriterion,
Criterion,
Enum,
Equality,
Term,
ValueWrapper,
basestring,
date,
... | ./CrossVul/dataset_final_sorted/CWE-89/py/good_3895_3 |
crossvul-python_data_bad_4605_0 | from django.contrib.postgres.fields import ArrayField, JSONField
from django.db.models.aggregates import Aggregate
from .mixins import OrderableAggMixin
__all__ = [
'ArrayAgg', 'BitAnd', 'BitOr', 'BoolAnd', 'BoolOr', 'JSONBAgg', 'StringAgg',
]
class ArrayAgg(OrderableAggMixin, Aggregate):
function = 'ARRAY_... | ./CrossVul/dataset_final_sorted/CWE-89/py/bad_4605_0 |
crossvul-python_data_good_4605_1 | from django.db.models.expressions import F, OrderBy
class OrderableAggMixin:
def __init__(self, *expressions, ordering=(), **extra):
if not isinstance(ordering, (list, tuple)):
ordering = [ordering]
ordering = ordering or []
# Transform minus sign prefixed strings into an Orde... | ./CrossVul/dataset_final_sorted/CWE-89/py/good_4605_1 |
crossvul-python_data_bad_2971_0 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#**
#
#########
# trape #
#########
#
# trape depends of this file
# For full copyright information this visit: https://github.com/boxug/trape
#
# Copyright 2017 by boxug / <hey@boxug.com>
#**
import sqlite3
class Database(object):
def __init__(self):
self... | ./CrossVul/dataset_final_sorted/CWE-89/py/bad_2971_0 |
crossvul-python_data_bad_2971_1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#**
#
#########
# trape #
#########
#
# trape depends of this file
# For full copyright information this visit: https://github.com/boxug/trape
#
# Copyright 2017 by boxug / <hey@boxug.com>
#**
import urllib2
from flask import Flask, render_template, session, request, json
f... | ./CrossVul/dataset_final_sorted/CWE-89/py/bad_2971_1 |
crossvul-python_data_good_3895_2 | from pypika import Parameter, functions
from pypika.enums import SqlTypes
from pypika.terms import Criterion
from tortoise import Model
from tortoise.backends.base.executor import BaseExecutor
from tortoise.fields import BigIntField, IntField, SmallIntField
from tortoise.filters import (
Like,
Term,
ValueW... | ./CrossVul/dataset_final_sorted/CWE-89/py/good_3895_2 |
crossvul-python_data_good_2971_2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#**
#
#########
# trape #
#########
#
# trape depends of this file
# For full copyright information this visit: https://github.com/boxug/trape
#
# Copyright 2017 by boxug / <hey@boxug.com>
#**
import time
import urllib2
from flask import Flask, render_template, session, req... | ./CrossVul/dataset_final_sorted/CWE-89/py/good_2971_2 |
crossvul-python_data_bad_3895_2 | from pypika import Parameter, functions
from pypika.enums import SqlTypes
from pypika.terms import Criterion
from tortoise import Model
from tortoise.backends.base.executor import BaseExecutor
from tortoise.fields import BigIntField, Field, IntField, SmallIntField
from tortoise.filters import (
contains,
ends_... | ./CrossVul/dataset_final_sorted/CWE-89/py/bad_3895_2 |
crossvul-python_data_bad_3895_3 | import operator
from functools import partial
from typing import TYPE_CHECKING, Any, Dict, Iterable, Optional, Tuple
from pypika import Table
from pypika.functions import Upper
from pypika.terms import BasicCriterion, Criterion, Equality, Term, ValueWrapper
from tortoise.fields import Field
from tortoise.fields.relat... | ./CrossVul/dataset_final_sorted/CWE-89/py/bad_3895_3 |
crossvul-python_data_bad_2971_2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#**
#
#########
# trape #
#########
#
# trape depends of this file
# For full copyright information this visit: https://github.com/boxug/trape
#
# Copyright 2017 by boxug / <hey@boxug.com>
#**
import time
import urllib2
from flask import Flask, render_template, session, req... | ./CrossVul/dataset_final_sorted/CWE-89/py/bad_2971_2 |
crossvul-python_data_good_2971_1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#**
#
#########
# trape #
#########
#
# trape depends of this file
# For full copyright information this visit: https://github.com/boxug/trape
#
# Copyright 2017 by boxug / <hey@boxug.com>
#**
import urllib2
from flask import Flask, render_template, session, request, json
f... | ./CrossVul/dataset_final_sorted/CWE-89/py/good_2971_1 |
crossvul-python_data_good_2971_0 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#**
#
#########
# trape #
#########
#
# trape depends of this file
# For full copyright information this visit: https://github.com/boxug/trape
#
# Copyright 2017 by boxug / <hey@boxug.com>
#**
import sqlite3
class Database(object):
def __init__(self):
self... | ./CrossVul/dataset_final_sorted/CWE-89/py/good_2971_0 |
crossvul-python_data_good_4605_0 | from django.contrib.postgres.fields import ArrayField, JSONField
from django.db.models import Value
from django.db.models.aggregates import Aggregate
from .mixins import OrderableAggMixin
__all__ = [
'ArrayAgg', 'BitAnd', 'BitOr', 'BoolAnd', 'BoolOr', 'JSONBAgg', 'StringAgg',
]
class ArrayAgg(OrderableAggMixin,... | ./CrossVul/dataset_final_sorted/CWE-89/py/good_4605_0 |
crossvul-python_data_bad_4605_1 | from django.db.models.expressions import F, OrderBy
class OrderableAggMixin:
def __init__(self, expression, ordering=(), **extra):
if not isinstance(ordering, (list, tuple)):
ordering = [ordering]
ordering = ordering or []
# Transform minus sign prefixed strings into an OrderB... | ./CrossVul/dataset_final_sorted/CWE-89/py/bad_4605_1 |
crossvul-python_data_good_4531_0 | # -*- coding: utf-8 -*-
'''
feedgen.entry
~~~~~~~~~~~~~
:copyright: 2013-2020, Lars Kiesow <lkiesow@uos.de>
:license: FreeBSD and LGPL, see license.* for more details.
'''
from datetime import datetime
import dateutil.parser
import dateutil.tz
import warnings
from lxml.etree import CDATA # nosec -... | ./CrossVul/dataset_final_sorted/CWE-776/py/good_4531_0 |
crossvul-python_data_bad_4531_1 | # -*- coding: utf-8 -*-
'''
feedgen.ext.dc
~~~~~~~~~~~~~~~~~~~
Extends the FeedGenerator to add Dubline Core Elements to the feeds.
Descriptions partly taken from
http://dublincore.org/documents/dcmi-terms/#elements-coverage
:copyright: 2013-2017, Lars Kiesow <lkiesow@uos.de>
:license: F... | ./CrossVul/dataset_final_sorted/CWE-776/py/bad_4531_1 |
crossvul-python_data_good_4531_3 | # -*- coding: utf-8 -*-
'''
feedgen.ext.media
~~~~~~~~~~~~~~~~~
Extends the feedgen to produce media tags.
:copyright: 2013-2017, Lars Kiesow <lkiesow@uos.de>
:license: FreeBSD and LGPL, see license.* for more details.
'''
from feedgen.ext.base import BaseEntryExtension, BaseExtension
from feedg... | ./CrossVul/dataset_final_sorted/CWE-776/py/good_4531_3 |
crossvul-python_data_bad_4531_3 | # -*- coding: utf-8 -*-
'''
feedgen.ext.media
~~~~~~~~~~~~~~~~~
Extends the feedgen to produce media tags.
:copyright: 2013-2017, Lars Kiesow <lkiesow@uos.de>
:license: FreeBSD and LGPL, see license.* for more details.
'''
from lxml import etree
from feedgen.ext.base import BaseEntryExtension, ... | ./CrossVul/dataset_final_sorted/CWE-776/py/bad_4531_3 |
crossvul-python_data_bad_4531_2 | # -*- coding: utf-8 -*-
'''
feedgen.ext.geo_entry
~~~~~~~~~~~~~~~~~~~
Extends the FeedGenerator to produce Simple GeoRSS feeds.
:copyright: 2017, Bob Breznak <bob.breznak@gmail.com>
:license: FreeBSD and LGPL, see license.* for more details.
'''
import numbers
import warnings
from lxml import et... | ./CrossVul/dataset_final_sorted/CWE-776/py/bad_4531_2 |
crossvul-python_data_good_4531_1 | # -*- coding: utf-8 -*-
'''
feedgen.ext.dc
~~~~~~~~~~~~~~~~~~~
Extends the FeedGenerator to add Dubline Core Elements to the feeds.
Descriptions partly taken from
http://dublincore.org/documents/dcmi-terms/#elements-coverage
:copyright: 2013-2017, Lars Kiesow <lkiesow@uos.de>
:license: F... | ./CrossVul/dataset_final_sorted/CWE-776/py/good_4531_1 |
crossvul-python_data_bad_4531_0 | # -*- coding: utf-8 -*-
'''
feedgen.entry
~~~~~~~~~~~~~
:copyright: 2013, Lars Kiesow <lkiesow@uos.de>
:license: FreeBSD and LGPL, see license.* for more details.
'''
from datetime import datetime
import dateutil.parser
import dateutil.tz
import warnings
from lxml import etree
from feedgen.compat i... | ./CrossVul/dataset_final_sorted/CWE-776/py/bad_4531_0 |
crossvul-python_data_good_4531_2 | # -*- coding: utf-8 -*-
'''
feedgen.ext.geo_entry
~~~~~~~~~~~~~~~~~~~
Extends the FeedGenerator to produce Simple GeoRSS feeds.
:copyright: 2017, Bob Breznak <bob.breznak@gmail.com>
:license: FreeBSD and LGPL, see license.* for more details.
'''
import numbers
import warnings
from feedgen.ext.ba... | ./CrossVul/dataset_final_sorted/CWE-776/py/good_4531_2 |
crossvul-python_data_good_4204_6 | """
Misc ASCII art
"""
WARNING = r"""
_mBma
sQf "QL
jW( -$g.
jW' -$m,
.y@' _aa. 4m,
.mD` ]QQWQ. 4Q,
_mP` ]QQQQ ?Q/
_QF )WQQ@ ?Qc
<QF QQQF )Qa
jW( QQQf "QL
jW' ]H... | ./CrossVul/dataset_final_sorted/CWE-78/py/good_4204_6 |
crossvul-python_data_good_461_1 | # -*- coding: utf-8 -*-
# Copyright (C) 2017-2018 CIRCL Computer Incident Response Center Luxembourg (smile gie)
# Copyright (C) 2017-2018 Christian Studer
#
# 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... | ./CrossVul/dataset_final_sorted/CWE-78/py/good_461_1 |
crossvul-python_data_bad_3682_0 | import os
import Bcfg2.Server.Plugin
def async_run(prog, args):
pid = os.fork()
if pid:
os.waitpid(pid, 0)
else:
dpid = os.fork()
if not dpid:
os.system(" ".join([prog] + args))
os._exit(0)
class Trigger(Bcfg2.Server.Plugin.Plugin,
Bcfg2.Server.P... | ./CrossVul/dataset_final_sorted/CWE-78/py/bad_3682_0 |
crossvul-python_data_good_3682_0 | import os
import pipes
import Bcfg2.Server.Plugin
from subprocess import Popen, PIPE
class Trigger(Bcfg2.Server.Plugin.Plugin,
Bcfg2.Server.Plugin.Statistics):
"""Trigger is a plugin that calls external scripts (on the server)."""
name = 'Trigger'
__version__ = '$Id'
__author__ = 'bcfg-de... | ./CrossVul/dataset_final_sorted/CWE-78/py/good_3682_0 |
crossvul-python_data_good_4204_5 | #!/usr/bin/env python3
"""
This is the main CLI for lookatme
"""
import click
import logging
import io
import os
import pygments.styles
import sys
import tempfile
import lookatme.tui
import lookatme.log
import lookatme.config
from lookatme.pres import Presentation
from lookatme.schemas import StyleSchema
@click.... | ./CrossVul/dataset_final_sorted/CWE-78/py/good_4204_5 |
crossvul-python_data_good_2926_1 | # Back In Time
# Copyright (C) 2008-2017 Oprea Dan, Bart de Koning, Richard Bailey, 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... | ./CrossVul/dataset_final_sorted/CWE-78/py/good_2926_1 |
crossvul-python_data_bad_4204_3 | """
Defines a calendar extension that overrides code block rendering if the
language type is calendar
"""
import datetime
import calendar
import urwid
from lookatme.exceptions import IgnoredByContrib
def render_code(token, body, stack, loop):
lang = token["lang"] or ""
if lang != "calendar":
raise... | ./CrossVul/dataset_final_sorted/CWE-78/py/bad_4204_3 |
crossvul-python_data_good_4204_7 | """
This module handles loading and using lookatme_contriba modules
Contrib modules are directly used
"""
import contextlib
import lookatme.ascii_art
from lookatme.exceptions import IgnoredByContrib
import lookatme.prompt
from . import terminal
from . import file_loader
CONTRIB_MODULES = []
def validate_exten... | ./CrossVul/dataset_final_sorted/CWE-78/py/good_4204_7 |
crossvul-python_data_good_4204_8 | """
This module defines a built-in contrib module that enables external files to
be included within the slide. This is extremely useful when having source
code displayed in a code block, and then running/doing something with the
source data in a terminal on the same slide.
"""
from marshmallow import fields, Schema
i... | ./CrossVul/dataset_final_sorted/CWE-78/py/good_4204_8 |
crossvul-python_data_bad_4204_8 | """
This module defines a built-in contrib module that enables external files to
be included within the slide. This is extremely useful when having source
code displayed in a code block, and then running/doing something with the
source data in a terminal on the same slide.
"""
from marshmallow import fields, Schema
i... | ./CrossVul/dataset_final_sorted/CWE-78/py/bad_4204_8 |
crossvul-python_data_bad_461_1 | # -*- coding: utf-8 -*-
# Copyright (C) 2017-2018 CIRCL Computer Incident Response Center Luxembourg (smile gie)
# Copyright (C) 2017-2018 Christian Studer
#
# 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... | ./CrossVul/dataset_final_sorted/CWE-78/py/bad_461_1 |
crossvul-python_data_bad_4204_9 | """
This module defines a built-in contrib module that enables terminal embedding
within a slide.
"""
from marshmallow import fields, Schema
import os
import re
import shlex
import signal
import urwid
import yaml
import lookatme.render
from lookatme.exceptions import IgnoredByContrib
import lookatme.config
class ... | ./CrossVul/dataset_final_sorted/CWE-78/py/bad_4204_9 |
crossvul-python_data_good_49_0 | """Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
from os.path import abspath
import fnmatch
import collections
import errno
try:
import zlib
del zlib
_ZLIB_SUPPORTE... | ./CrossVul/dataset_final_sorted/CWE-78/py/good_49_0 |
crossvul-python_data_bad_4204_7 | """
This module handles loading and using lookatme_contriba modules
Contrib modules are directly used
"""
import contextlib
from lookatme.exceptions import IgnoredByContrib
from . import terminal
from . import file_loader
CONTRIB_MODULES = [
terminal,
file_loader,
]
def load_contribs(contrib_names):
... | ./CrossVul/dataset_final_sorted/CWE-78/py/bad_4204_7 |
crossvul-python_data_bad_49_0 | """Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
from os.path import abspath
import fnmatch
import collections
import errno
try:
import zlib
del zlib
_ZLIB_SUPPORTE... | ./CrossVul/dataset_final_sorted/CWE-78/py/bad_49_0 |
crossvul-python_data_bad_4204_6 | 404: Not Found | ./CrossVul/dataset_final_sorted/CWE-78/py/bad_4204_6 |
crossvul-python_data_bad_4204_5 | #!/usr/bin/env python3
"""
This is the main CLI for lookatme
"""
import click
import logging
import io
import os
import pygments.styles
import sys
import tempfile
import lookatme.tui
import lookatme.log
import lookatme.config
from lookatme.pres import Presentation
from lookatme.schemas import StyleSchema
@click.... | ./CrossVul/dataset_final_sorted/CWE-78/py/bad_4204_5 |
crossvul-python_data_bad_2926_1 | # Back In Time
# Copyright (C) 2008-2017 Oprea Dan, Bart de Koning, Richard Bailey, 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... | ./CrossVul/dataset_final_sorted/CWE-78/py/bad_2926_1 |
crossvul-python_data_good_4204_9 | """
This module defines a built-in contrib module that enables terminal embedding
within a slide.
"""
from marshmallow import fields, Schema
import os
import re
import shlex
import signal
import urwid
import yaml
import lookatme.render
from lookatme.exceptions import IgnoredByContrib
import lookatme.config
def us... | ./CrossVul/dataset_final_sorted/CWE-78/py/good_4204_9 |
crossvul-python_data_good_4204_3 | """
Defines a calendar extension that overrides code block rendering if the
language type is calendar
"""
import datetime
import calendar
import urwid
from lookatme.exceptions import IgnoredByContrib
def user_warnings():
"""No warnings exist for this extension. Anything you want to warn the
user about, su... | ./CrossVul/dataset_final_sorted/CWE-78/py/good_4204_3 |
crossvul-python_data_good_1734_1 | ##############################################################################
#
# Copyright (c) 2001 Zope Foundation and Contributors.
#
# 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 SOFTWARE IS PROVIDED "AS I... | ./CrossVul/dataset_final_sorted/CWE-284/py/good_1734_1 |
crossvul-python_data_bad_1734_1 | ##############################################################################
#
# Copyright (c) 2001 Zope Foundation and Contributors.
#
# 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 SOFTWARE IS PROVIDED "AS I... | ./CrossVul/dataset_final_sorted/CWE-284/py/bad_1734_1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.