hash
stringlengths
64
64
content
stringlengths
0
1.51M
f36b872b3811034b39e4aae03a19bd6a57d059d9fa30a66e463ceb60e8694f79
from datetime import datetime, timedelta from django import forms from django.conf import settings from django.contrib import messages from django.contrib.admin import FieldListFilter from django.contrib.admin.exceptions import ( DisallowedModelAdminLookup, DisallowedModelAdminToField, ) from django.contrib.admin....
d84253eebc4fdad2789c01cdf3a5d858d08cea547131b74f590aa15535ee4709
import datetime from django.contrib.admin.templatetags.admin_urls import add_preserved_filters from django.contrib.admin.utils import ( display_for_field, display_for_value, get_fields_from_path, label_for_field, lookup_field, ) from django.contrib.admin.views.main import ( ALL_VAR, ORDER_VAR, PAGE_VAR, SE...
2e810e7975aff768b4709d4a788f8d40ca2b3308dee409d0b194d3514e48f73b
import os import sys from unittest import skipIf from django.core.exceptions import SuspiciousFileOperation from django.core.files.base import ContentFile from django.core.files.storage import FileSystemStorage, Storage from django.db.models import FileField from django.test import SimpleTestCase class AWSS3Storage(...
3cb86320418c486cf5740132004c38926a69ec681ebb68c5da5d0d5381c40dc6
# Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. import copy import io import os import pickle import re import shutil import sys import tempfile import threading import time import unittest import warnings from pathlib import Path from unittest import mock, skipIf from ...
c1794388b585159e55a5e43d20fe23427b6ea6dc64fec3b78e42995573288671
import contextlib import os import py_compile import shutil import sys import tempfile import threading import time import types import weakref import zipfile from importlib import import_module from pathlib import Path from subprocess import CompletedProcess from unittest import mock, skip, skipIf import pytz import...
0b161aa8b71037563365f989f9d3b7bd65bcf78fbf401e2a6031bf3b2ca09ff2
import datetime import pickle import sys import unittest from operator import attrgetter from threading import Lock from django.core.exceptions import EmptyResultSet, FieldError from django.db import DEFAULT_DB_ALIAS, connection from django.db.models import Count, Exists, F, Max, OuterRef, Q from django.db.models.expr...
a50ac3fef361be9b9fa2d0a380e235e360266bdff81f733d63cf695082d81f33
import datetime import pickle import unittest import uuid from collections import namedtuple from copy import deepcopy from decimal import Decimal from unittest import mock from django.core.exceptions import FieldError from django.db import DatabaseError, NotSupportedError, connection from django.db.models import ( ...
120204e74cdd7ce476539758309d9b59767d38c443c0c68eaecd09a30b761e87
import datetime import decimal import gettext as gettext_module import os import pickle import re import tempfile from contextlib import contextmanager from importlib import import_module from pathlib import Path from unittest import mock from asgiref.local import Local from django import forms from django.apps impor...
5ed06cef920a0c1aa620ae414cc93acc6022e5f3bda974a23887bb50ff92a9f2
import os from django.core.exceptions import SuspiciousFileOperation from django.core.files.base import ContentFile from django.core.files.storage import FileSystemStorage, Storage from django.db.models import FileField from django.test import SimpleTestCase class AWSS3Storage(Storage): """ Simulate an AWS S...
4d9b73a683a65e4355361d07bbc1b22a5d138da718853f37af0669dbc5df7b93
from datetime import datetime, timedelta, timezone as datetime_timezone import pytz try: import zoneinfo except ImportError: try: from backports import zoneinfo except ImportError: zoneinfo = None from django.conf import settings from django.db.models import ( DateField, DateTimeField...
11e70d792bd2a9ecf0a004e023017903dbbcb9a816806b16262d142e230aa6df
"Database cache backend." import base64 import pickle from datetime import datetime from django.conf import settings from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.db import DatabaseError, connections, models, router, transaction from django.utils import timezone class Options: ...
a20d1e9e1fdc0a7dfe80d797e7ea33f0f6309d13c7eb093238d6987d5bdc7996
# Django documentation build configuration file, created by # sphinx-quickstart on Thu Mar 27 09:06:53 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't picklable (module imports are okay...
1ef6a20cb8fd7dd6911b3c690bb019aee199b4f49fa8e84a689f75b33e0c001f
import re from functools import update_wrapper from weakref import WeakSet from django.apps import apps from django.conf import settings from django.contrib.admin import ModelAdmin, actions from django.contrib.admin.views.autocomplete import AutocompleteJsonView from django.contrib.auth import REDIRECT_FIELD_NAME from...
aa20d14edcf99cda34e0fd843cffb86c41316c6f3c1dd83532c220623129558a
""" A series of tests to establish that the command-line management tools work as advertised - especially with regards to the handling of the DJANGO_SETTINGS_MODULE and default settings.py files. """ import os import re import shutil import socket import subprocess import sys import tempfile import unittest from io imp...
6fd43ec87a3a4e8c2315aa6a1559839d8acc1d560b362381736fd21683e2a5da
import logging from datetime import datetime from django.db.backends.ddl_references import ( Columns, Expressions, ForeignKeyName, IndexName, Statement, Table, ) from django.db.backends.utils import names_digest, split_identifier from django.db.models import Deferrable, Index from django.db.models.sql import Query...
d41609342f6acd917120b7e910df5c45c01cabe6519aad7c6da871dc6387da05
import copy import json import operator import re from functools import partial, reduce, update_wrapper from urllib.parse import quote as urlquote from django import forms from django.conf import settings from django.contrib import messages from django.contrib.admin import helpers, widgets from django.contrib.admin.ch...
2483428c64b612ea76de4460c4b2d64fa8c64b54178342aef9c81b72ca797c6f
from datetime import datetime, timedelta from django import forms from django.conf import settings from django.contrib import messages from django.contrib.admin import FieldListFilter from django.contrib.admin.exceptions import ( DisallowedModelAdminLookup, DisallowedModelAdminToField, ) from django.contrib.admin....
b532b208701195002351b80b7cfa844803e0ba49957b6ae115ce18cd213e5e9b
# Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. import copy import io import os import pickle import re import shutil import sys import tempfile import threading import time import unittest import warnings from pathlib import Path from unittest import mock, skipIf from ...
70a046a812c17e7c8dbf0ec8d34cd6a4c5e3cd8bbcd0615c85460469769bfa5a
import datetime import itertools import unittest from copy import copy from unittest import mock from django.core.exceptions import FieldError from django.core.management.color import no_style from django.db import ( DatabaseError, DataError, IntegrityError, OperationalError, connection, ) from django.db.models im...
b8044fb0b5d79efbaa0b53722a7a9f0812071d6a471935dfcdfc68b16f05e351
#!/usr/bin/env python import argparse import atexit import copy import gc import os import shutil import socket import subprocess import sys import tempfile import warnings try: import django except ImportError as e: raise RuntimeError( 'Django module not found, reference tests/README.rst for instructi...
d020dd83baeab9544dcef25f39637246923cc8c9ea2360fbba979c4b64b53a62
# Django documentation build configuration file, created by # sphinx-quickstart on Thu Mar 27 09:06:53 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't picklable (module imports are okay...
db3dc914cc8aad9d471d9c2e06ad5e24d63fb5ee49ea9df666c608720ad1bad6
import ctypes import faulthandler import io import itertools import logging import multiprocessing import os import pickle import sys import textwrap import unittest from contextlib import contextmanager from importlib import import_module from io import StringIO from django.core.management import call_command from dj...
e21e13bac6152754e37f0c6701a05eaacbcf02b78f810d2df712b92af7142158
import asyncio import difflib import json import logging import posixpath import sys import threading import unittest import warnings from collections import Counter from contextlib import contextmanager from copy import copy, deepcopy from difflib import get_close_matches from functools import wraps from unittest.suit...
7ac84c46ea14fedf43f635f0caad3f8efb5da88f84b00a2486e9f2f72eba079c
""" Syndication feed generation library -- used for generating RSS, etc. Sample usage: >>> from django.utils import feedgenerator >>> feed = feedgenerator.Rss201rev2Feed( ... title="Poynter E-Media Tidbits", ... link="http://www.poynter.org/column.asp?id=31", ... description="A group Weblog by the sharpes...
dcf5ea9b4c26c52b46e23545b6cf222ed9849bd611950a7d31efe3ffcea300df
import datetime import decimal import functools import re import unicodedata from importlib import import_module from django.conf import settings from django.utils import dateformat, numberformat from django.utils.functional import lazy from django.utils.translation import ( check_for_language, get_language, to_lo...
d6138054b7ec4422aa68aa10918a1376ea1cf2db390e9d806ce09ac84cef223d
""" Cross Site Request Forgery Middleware. This module provides a middleware that implements protection against request forgeries from other sites. """ import logging import string from collections import defaultdict from urllib.parse import urlparse from django.conf import settings from django.core.exceptions import...
15e0d95e22bfaaf8a8badf571325d174325932f6c6612e4377bc2cee4e1c894c
""" Field classes. """ import copy import datetime import json import math import operator import os import re import uuid from decimal import Decimal, DecimalException from io import BytesIO from urllib.parse import urlsplit, urlunsplit from django.core import validators from django.core.exceptions import Validation...
381a22f4cc945cbaf00873c2cc7b0dcf8f2eaee887f842175d8d38f4b7c5a6a9
import ipaddress import re import warnings from pathlib import Path from urllib.parse import urlsplit, urlunsplit from django.core.exceptions import ValidationError from django.utils.deconstruct import deconstructible from django.utils.deprecation import RemovedInDjango41Warning from django.utils.encoding import punyc...
85ffb7f2a5ea576158125d70637037210a5a9251aaa6d4de0ca9b68a16101f24
from enum import Enum from django.db.models.expressions import ExpressionList, F from django.db.models.indexes import IndexExpression from django.db.models.query_utils import Q from django.db.models.sql.query import Query from django.utils.version import PY310 __all__ = ['CheckConstraint', 'Deferrable', 'UniqueConstr...
16f247cf154ab3bd8984250037b6fec1589679a9f67b5d5b75c52042f2961ec4
import functools import inspect from functools import partial from django import forms from django.apps import apps from django.conf import SettingsReference, settings from django.core import checks, exceptions from django.db import connection, router from django.db.backends import utils from django.db.models import Q...
eab0fc28937363749166ca583fbfa7b2898657bd0140995a2bbebfe5a26a2fc2
import logging from datetime import datetime from django.db.backends.ddl_references import ( Columns, Expressions, ForeignKeyName, IndexName, Statement, Table, ) from django.db.backends.utils import names_digest, split_identifier from django.db.models import Deferrable, Index from django.db.models.sql import Query...
7f3b1e6516df491e23294a69d838562e8c3071695124c7292f7afde271a52f2d
import os import pathlib from datetime import datetime from urllib.parse import urljoin from django.conf import settings from django.core.exceptions import SuspiciousFileOperation from django.core.files import File, locks from django.core.files.move import file_move_safe from django.core.files.utils import validate_fi...
c28791d372b776d3767c7ac9d5cfc33df8100007cdb52bb5209d6c4cb13244e2
import hashlib import json import os import posixpath import re from urllib.parse import unquote, urldefrag, urlsplit, urlunsplit from django.conf import settings from django.contrib.staticfiles.utils import check_settings, matches_patterns from django.core.exceptions import ImproperlyConfigured from django.core.files...
576f757c05aba49a9cc1428d42d95e1e8f95f7460ab43d3e67ba195b94de1f31
import datetime import decimal import enum import functools import math import os import pathlib import re import sys import uuid from unittest import mock import custom_migration_operations.more_operations import custom_migration_operations.operations from django import get_version from django.conf import SettingsRe...
f637fa13b183af53923ed3f290746a5b5ac333350c56851e4ffd6ed82ebc4284
import os import shutil import sys import tempfile import threading import time import unittest from datetime import datetime, timedelta from io import StringIO from pathlib import Path from urllib.request import urlopen from django.core.cache import cache from django.core.exceptions import SuspiciousFileOperation fro...
69cd0fe3e15080a33ebb9964ca1db5d93873acd8e644de2a2b7aa4dc98967df8
import re from django.conf import settings from django.contrib.sessions.backends.cache import SessionStore from django.core.exceptions import ImproperlyConfigured from django.http import HttpRequest, HttpResponse from django.middleware.csrf import ( CSRF_SESSION_KEY, CSRF_TOKEN_LENGTH, REASON_BAD_ORIGIN, REASO...
52283670b06d79f1f9f64cf586438daebb37c2c64bfaa6e45c08330999a00a16
import os import re import types from datetime import datetime, timedelta from decimal import Decimal from unittest import TestCase, mock from django.core.exceptions import ValidationError from django.core.files.base import ContentFile from django.core.validators import ( BaseValidator, DecimalValidator, EmailVali...
dd657f41b56c04f1a7f5f3fc3963de9c5d95d3f0c5654ef38bf03ea86da5fa22
import os import shutil import sys import tempfile import unittest from io import StringIO from pathlib import Path from unittest import mock from django.conf import settings from django.contrib.staticfiles import finders, storage from django.contrib.staticfiles.management.commands.collectstatic import ( Command a...
7721ee72bddfcb8c11ad353098d3c5a073a2ac37be5502d5211a111a7df5019b
import os from datetime import datetime, timedelta from django.conf import settings from django.contrib.staticfiles.storage import ManifestStaticFilesStorage from django.core.files import storage from django.utils import timezone class DummyStorage(storage.Storage): """ A storage class that implements get_mo...
5108de11949491986ef315c3e556d6c183400f39534350ea32c935f2b94544a0
import contextlib import os import py_compile import shutil import sys import tempfile import threading import time import types import weakref import zipfile from importlib import import_module from pathlib import Path from subprocess import CompletedProcess from unittest import mock, skip, skipIf import pytz import...
84262b494d129e09c63f41f841d0af621fd06c98b493b87eba5d5beb82267590
import logging import os import unittest.loader from argparse import ArgumentParser from contextlib import contextmanager from importlib import import_module from unittest import TestSuite, TextTestRunner, defaultTestLoader, mock from django.db import connections from django.test import SimpleTestCase from django.test...
9a0cfcae68d7575d42fff95d54d8794d9f875b14afb99d397841a809700a8321
import datetime import itertools import unittest from copy import copy from unittest import mock from django.core.exceptions import FieldError from django.core.management.color import no_style from django.db import ( DatabaseError, DataError, IntegrityError, OperationalError, connection, ) from django.db.models im...
af74bc5445d6a1217d782f1e2f7fb97e10334317d54ae9b4dcfbefbb37d29487
from functools import partial from django.db import models from django.db.models.fields.related import ( RECURSIVE_RELATIONSHIP_CONSTANT, ManyToManyDescriptor, RelatedField, create_many_to_many_intermediary_model, ) class CustomManyToManyField(RelatedField): """ Ticket #24104 - Need to have a custom ...
867ae3e5e675f4f8d9f324e88f3018e1bd4d697dbda7a381efadd82a183599a5
import base64 import hashlib import os import shutil import sys import tempfile as sys_tempfile import unittest from io import BytesIO, StringIO from unittest import mock from urllib.parse import quote from django.core.exceptions import SuspiciousFileOperation from django.core.files import temp as tempfile from django...
8480115dab4aa92890127d202b92fa8234c7fc4095da0e603875ecc253e6f1fc
#!/usr/bin/env python import argparse import atexit import copy import gc import os import shutil import socket import subprocess import sys import tempfile import warnings try: import django except ImportError as e: raise RuntimeError( 'Django module not found, reference tests/README.rst for instructi...
9cf3de6d984cdd627d9c2b77f3ac17b2d5e96c7e57a10177669bded84e6382af
""" This is the Django template system. How it works: The Lexer.tokenize() method converts a template string (i.e., a string containing markup with custom template tags) to tokens, which can be either plain text (TokenType.TEXT), variables (TokenType.VAR), or block statements (TokenType.BLOCK). The Parser() class ta...
bd6e78d882e67784caeb0221e46140bcb559ff8abc1a5276a8fbdce5e56ba874
from django.apps.registry import Apps from django.contrib.contenttypes.fields import GenericForeignKey from django.db import models from django.db.migrations.exceptions import InvalidBasesError from django.db.migrations.operations import ( AddField, AlterField, DeleteModel, RemoveField, ) from django.db.migrations....
ff64b902b218a17f1efa92777d89df0631a94d5b96c2102d13027dd974ed487c
import re from django.core.exceptions import ValidationError from django.forms.utils import flatatt, pretty_name from django.forms.widgets import Textarea, TextInput from django.utils.functional import cached_property from django.utils.html import conditional_escape, format_html, html_safe from django.utils.safestring...
2412497608f896b6226df42cf289c5ba5397cc8204afd0fdc0ebc99cc92ba907
import copy import datetime import json import uuid from django.core.exceptions import NON_FIELD_ERRORS from django.core.files.uploadedfile import SimpleUploadedFile from django.core.validators import MaxValueValidator, RegexValidator from django.forms import ( BooleanField, CharField, CheckboxSelectMultiple, Choi...
d97aa6fb5a48bca5fc4520034da782d3400f97b52d2ee72299a6ea1f067b3e20
#!/usr/bin/env python import argparse import atexit import copy import gc import os import shutil import socket import subprocess import sys import tempfile import warnings from pathlib import Path try: import django except ImportError as e: raise RuntimeError( 'Django module not found, reference tests...
4551f206a252d500c6b91ff3a280d13c7778bcab106f9bf869b7d57884859fe5
import ctypes import faulthandler import io import itertools import logging import multiprocessing import os import pickle import sys import textwrap import unittest from contextlib import contextmanager from importlib import import_module from io import StringIO from django.core.management import call_command from dj...
371c38db29af46d92e34a5de7409c595f1b6683a372f3306334a8e84070b9ee0
import json import mimetypes import os import sys from copy import copy from functools import partial from http import HTTPStatus from importlib import import_module from io import BytesIO from urllib.parse import unquote_to_bytes, urljoin, urlparse, urlsplit from asgiref.sync import sync_to_async from django.conf im...
3488c3bb651811749ff413a5831b20f3eb2d0b4460d6f5c0cb961f95ac6bba23
"""Functions to parse datetime objects.""" # We're using regular expressions rather than time.strptime because: # - They provide both validation and parsing. # - They're more flexible for datetimes. # - The date/datetime/time constructors produce friendlier error messages. import datetime from django.utils.regex_hel...
2b7032f22b9b51e245d2c8319d14cd2202dace50ceff4d6810ac6b0bb10a7b38
""" This is the Django template system. How it works: The Lexer.tokenize() method converts a template string (i.e., a string containing markup with custom template tags) to tokens, which can be either plain text (TokenType.TEXT), variables (TokenType.VAR), or block statements (TokenType.BLOCK). The Parser() class ta...
1c8cd1aa62ad71f74e7ae3732b5a8f5d0be2fbb48d817250eb29e46e6093b9e7
""" Cross Site Request Forgery Middleware. This module provides a middleware that implements protection against request forgeries from other sites. """ import logging import string from collections import defaultdict from urllib.parse import urlparse from django.conf import settings from django.core.exceptions import...
f6d82bf69b10b7437539ed632a1100dd1ddd61589d2877c73b63681edfd5629e
""" This module converts requested URLs to callback view functions. URLResolver is the main class here. Its resolve() method takes a URL (as a string) and returns a ResolverMatch object which provides access to all attributes of the resolved URL match. """ import functools import inspect import re import string from i...
30bff2133ce868aa460f17ba28214936e286e73985affb82b53b55945a527ef8
""" Field classes. """ import copy import datetime import json import math import operator import os import re import uuid from decimal import Decimal, DecimalException from io import BytesIO from urllib.parse import urlsplit, urlunsplit from django.core import validators from django.core.exceptions import Validation...
e62853b4685b5c3c465a37c21d5389505ef1d29f35c40d133f39eee020a635a2
""" Form classes """ import copy from django.core.exceptions import NON_FIELD_ERRORS, ValidationError from django.forms.fields import Field, FileField from django.forms.utils import ErrorDict, ErrorList from django.forms.widgets import Media, MediaDefiningClass from django.utils.datastructures import MultiValueDict f...
061e4d578015ead69af26a56c108d2648fb78d6df710b1c4c16ffa6cef8a08a0
import datetime import json import mimetypes import os import re import sys import time from collections.abc import Mapping from email.header import Header from http.client import responses from urllib.parse import quote, urlparse from django.conf import settings from django.core import signals, signing from django.co...
55ad04a3cf8e66baaf89cea5c5c322c8f3c7c25feddf27839a71e50c049b3529
from decimal import Decimal from django.conf import settings from django.template import Library, Node, TemplateSyntaxError, Variable from django.template.base import TokenType, render_value_in_context from django.template.defaulttags import token_kwargs from django.utils import translation from django.utils.safestrin...
6378eaf8842c22c696ca9cc116b8c28a6263fd88d2a6f0c5c1783b3b0b84e922
""" Classes to represent the definitions of aggregate functions. """ from django.core.exceptions import FieldError from django.db.models.expressions import Case, Func, Star, When from django.db.models.fields import IntegerField from django.db.models.functions.mixins import ( FixDurationInputMixin, NumericOutputFiel...
2c6268fc384b5660f508b3ec71f289d9c3b03415f8d314c9134afc2a208b1055
""" The main QuerySet implementation. This provides the public API for the ORM. """ import copy import operator import warnings from itertools import chain import django from django.conf import settings from django.core import exceptions from django.db import ( DJANGO_VERSION_PICKLE_KEY, IntegrityError, NotSuppor...
b8d4c2212a35b5100d1bdd43ae6228ab27b95b15e0e120f672f335a184d2bb49
import copy import inspect import warnings from functools import partialmethod from itertools import chain import django from django.apps import apps from django.conf import settings from django.core import checks from django.core.exceptions import ( NON_FIELD_ERRORS, FieldDoesNotExist, FieldError, MultipleObjects...
114947835b756ab117824e52d4e0b83aea38126732f21ec8ed78b46fcda230f7
import copy import datetime import functools import inspect from decimal import Decimal from uuid import UUID from django.core.exceptions import EmptyResultSet, FieldError from django.db import DatabaseError, NotSupportedError, connection from django.db.models import fields from django.db.models.constants import LOOKU...
c8a998bc71777e26a1bbffa33e19cbba00e62d34d20d41d9022c4e237da0cc68
import itertools import math from copy import copy from django.core.exceptions import EmptyResultSet from django.db.models.expressions import Case, Func, Value, When from django.db.models.fields import ( CharField, DateTimeField, Field, IntegerField, UUIDField, ) from django.db.models.query_utils import RegisterLo...
af379473675e2e78041415ad60f99c434f52a99b61628013d571fc47a874429a
import collections.abc import copy import datetime import decimal import operator import uuid import warnings from base64 import b64decode, b64encode from functools import partialmethod, total_ordering from django import forms from django.apps import apps from django.conf import settings from django.core import checks...
6e1927aba7d5a714d02ac3f8dfd9d4d6f1055ceaa1ee518aaa8a5c16b144159d
""" Create SQL statements for QuerySets. The code in here encapsulates all of the SQL construction so that QuerySets themselves do not have to (and could be backed by things other than SQL databases). The abstraction barrier only works one way: this module has to know all about the internals of models in order to get ...
43d4a3b3027adc4dc17514b60a95466bdf2580685150da534ca95407da5f1b3a
import collections import json import re from functools import partial from itertools import chain from django.core.exceptions import EmptyResultSet, FieldError from django.db import DatabaseError, NotSupportedError from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import F, OrderBy, ...
c6eba8b6e5c5b698017214accf7edc65cc1111bf0a51987bfdeb6609be2ccc98
""" Code to manage the creation and SQL rendering of 'where' constraints. """ from django.core.exceptions import EmptyResultSet from django.utils import tree from django.utils.functional import cached_property # Connection types AND = 'AND' OR = 'OR' class WhereNode(tree.Node): """ An SQL WHERE clause. ...
8bc43383569cc085786d033165e59b63e06bb0cd0630fb72dbbf5b491f395de3
import logging from datetime import datetime from django.db.backends.ddl_references import ( Columns, Expressions, ForeignKeyName, IndexName, Statement, Table, ) from django.db.backends.utils import names_digest, split_identifier from django.db.models import Deferrable, Index from django.db.models.sql import Query...
f46f31d0a4c19875b0035ac2dd5c3e222f93cc3cd26a1b7a9774216159dcbec6
import sys from django.apps import apps from django.core.management.base import BaseCommand from django.db import DEFAULT_DB_ALIAS, connections from django.db.migrations.loader import MigrationLoader from django.db.migrations.recorder import MigrationRecorder class Command(BaseCommand): help = "Shows all availab...
2e75c87d937d7b45e5d006bc85ecb2200b2e7325be3020e3c63ebd1e27ed9c3c
import copy import json import operator import re from functools import partial, reduce, update_wrapper from urllib.parse import quote as urlquote from django import forms from django.conf import settings from django.contrib import messages from django.contrib.admin import helpers, widgets from django.contrib.admin.ch...
280b8b413bed6881589e5c059816061979620faa892be6f3dc789d7253c5dcfa
from django.db.models import Aggregate, FloatField, IntegerField __all__ = [ 'CovarPop', 'Corr', 'RegrAvgX', 'RegrAvgY', 'RegrCount', 'RegrIntercept', 'RegrR2', 'RegrSlope', 'RegrSXX', 'RegrSXY', 'RegrSYY', 'StatAggregate', ] class StatAggregate(Aggregate): output_field = FloatField() def __init__(s...
498a2f0ed0cf9fb8f480435d6e054c643b2476b2d276ad81045a143a8511884a
import datetime import importlib import io import os import sys from unittest import mock from django.apps import apps from django.core.management import CommandError, call_command from django.db import ( ConnectionHandler, DatabaseError, OperationalError, connection, connections, models, ) from django.db.back...
e1775372ebea32b8a6b904f42a64e7cf7fb60e4c9b32769a42ef9a290f22382a
import datetime import itertools import re from importlib import import_module from unittest import mock from urllib.parse import quote, urljoin from django.apps import apps from django.conf import settings from django.contrib.admin.models import LogEntry from django.contrib.auth import ( BACKEND_SESSION_KEY, REDI...
3c489ae7e8f9204f7509431038defb70895f33534652e598d73dd2bde45b5c0a
import re from django.conf import settings from django.contrib.sessions.backends.cache import SessionStore from django.core.exceptions import ImproperlyConfigured from django.http import HttpRequest, HttpResponse from django.middleware.csrf import ( CSRF_ALLOWED_CHARS, CSRF_SESSION_KEY, CSRF_TOKEN_LENGTH, REASON_B...
cae99d136f966c7ea6fb89f917ef6a245336943e0e09709e5eaaa7ebaa3388a3
import datetime import re from decimal import Decimal from django.core.exceptions import FieldError from django.db import connection from django.db.models import ( Avg, Case, Count, DecimalField, DurationField, Exists, F, FloatField, IntegerField, Max, Min, OuterRef, Subquery, Sum, Value, When, ) from django.d...
02a1edd9291176675e065c08b2c9735f5e73a6362b92adf069e1a27e51f37d34
from django.db.models import ( CharField, F, Func, IntegerField, OuterRef, Q, Subquery, Value, ) from django.db.models.fields.json import KeyTextTransform, KeyTransform from django.db.models.functions import Cast, Concat, Substr from django.test.utils import Approximate from . import PostgreSQLTestCase from .model...
a725d92d27636d6830733deda331b7474c3c49c5adcd61a9fcd304d363ee2b67
""" Unit tests for reverse URL lookups. """ import sys import threading from admin_scripts.tests import AdminScriptTestCase from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist from django.http import ( HttpRequest, ...
8585aef625e951bef06a6e3d9d276eb3ab549a8743a23fe70f3eb990d935c2c1
import unittest from datetime import date, datetime, time, timedelta from django.utils.dateparse import ( parse_date, parse_datetime, parse_duration, parse_time, ) from django.utils.timezone import get_fixed_timezone class DateParseTests(unittest.TestCase): def test_parse_date(self): # Valid inputs ...
f3457a14bb5d5b9cc97f2f219011b14b8e682b7d65852b705743a84002388ef8
""" Tests for django test runner """ import unittest from unittest import mock from admin_scripts.tests import AdminScriptTestCase from django import db from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management import call_command from django.core.management....
1bad18ae7716773225501cbb2b6c63a17dba24771eefd301a9acc4727c4e5871
import logging import os import unittest.loader from argparse import ArgumentParser from contextlib import contextmanager from importlib import import_module from unittest import TestSuite, TextTestRunner, defaultTestLoader, mock from django.db import connections from django.test import SimpleTestCase from django.test...
d095b4a83645ef5ce03213591f32b5e6db69359ed7f450f9125ba714721a44d9
""" Testing using the Test Client The test client is a class that can act like a simple browser for testing purposes. It allows the user to compose GET and POST requests, and obtain the response that the server gave to those requests. The server Response objects are annotated with the details of the contexts and temp...
04d25447d6b2229f9f7c34e8284f0c8ae00510601a911bdbb85046011a8fa111
"""Tests related to django.db.backends that haven't been organized.""" import datetime import threading import unittest import warnings from unittest import mock from django.core.management.color import no_style from django.db import ( DEFAULT_DB_ALIAS, DatabaseError, IntegrityError, connection, connections, r...
59b5087b7f09b22cde767d3680c4426151c751ba238dfc42245e376de38d2833
import datetime import itertools import unittest from copy import copy from unittest import mock from django.core.exceptions import FieldError from django.core.management.color import no_style from django.db import ( DatabaseError, DataError, IntegrityError, OperationalError, connection, ) from django.db.models im...
615c5a5c6a228f3f51230a2e3c8e9ef2ff5566a111686067aad5cefe96573e04
import unittest from django.core.checks import Error, Warning from django.core.checks.model_checks import _check_lazy_references from django.db import connection, connections, models from django.db.models.functions import Abs, Lower, Round from django.db.models.signals import post_init from django.test import SimpleTe...
7af04ed78fc469c7a2f8991f5ad98fe6a556477f78341d74cb317de60124c8d6
from django.core.exceptions import FieldError from django.test import TestCase from .models import ( BigChild, Child, ChildProxy, Primary, RefreshPrimaryProxy, Secondary, ShadowChild, ) class AssertionMixin: def assert_delayed(self, obj, num): """ Instances with deferred fields look the s...
4b521392f41f3720666908da03a774cfb4734a8b52427ad52c9db1005a18eeaf
from operator import attrgetter from django.core.exceptions import FieldError, ValidationError from django.db import connection, models from django.db.models.query_utils import DeferredAttribute from django.test import SimpleTestCase, TestCase from django.test.utils import CaptureQueriesContext, isolate_apps from .mo...
5d750af8da6d4ca975e121ebf3f93cd2f3f279b8b77c32272b0a00d8ef6e74bb
from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.core.checks import Error from django.core.exceptions import FieldDoesNotExist, FieldError from django.db import models from django.test import SimpleTestCase ...
24ce14e6830f7d467b029074a60a8826c5c1caec493eca1359b5aedf40ce561d
import copy import datetime import json import uuid from django.core.exceptions import NON_FIELD_ERRORS from django.core.files.uploadedfile import SimpleUploadedFile from django.core.validators import MaxValueValidator, RegexValidator from django.forms import ( BooleanField, CharField, CheckboxSelectMultiple, Choi...
71e7a6098b446495d7e8f042295c4c5260b2771ff6eb5ee714150ee901175f9f
import asyncio import difflib import json import logging import posixpath import sys import threading import unittest import warnings from collections import Counter from contextlib import contextmanager from copy import copy, deepcopy from difflib import get_close_matches from functools import wraps from unittest.suit...
86f6799ce5a6e2a8008a5d861d8474276bc1ece013a0f1e618d43588cac28ae6
"""Functions to parse datetime objects.""" # We're using regular expressions rather than time.strptime because: # - They provide both validation and parsing. # - They're more flexible for datetimes. # - The date/datetime/time constructors produce friendlier error messages. import datetime from django.utils.regex_hel...
cb460e3f76ab2761db6ceb5c5b285fb56735262fb77124531db2fde80e7b3431
""" This is the Django template system. How it works: The Lexer.tokenize() method converts a template string (i.e., a string containing markup with custom template tags) to tokens, which can be either plain text (TokenType.TEXT), variables (TokenType.VAR), or block statements (TokenType.BLOCK). The Parser() class ta...
efc137b99a72be8a79dc2cf5fc1ca20a7a53f3279d5df247b0770848ee6cf922
from django.db import models from django.db.migrations.operations.base import Operation from django.db.migrations.state import ModelState from django.db.migrations.utils import ( field_references, get_references, resolve_relation, ) from django.db.models.options import normalize_together from django.utils.functiona...
5647ebb93756563f99d93bcd1393fa47234d490ecdfa866027d23033e2e97f61
from django.core.exceptions import FieldDoesNotExist from django.db.migrations.utils import ( field_is_referenced, field_references, get_references, ) from django.db.models import NOT_PROVIDED from django.utils.functional import cached_property from .base import Operation class FieldOperation(Operation): def...
54f0773fd2d786dcf4981ea436be6d343a55e4bba4fcf59cb811a1b50942f076
import glob import os import re import sys from functools import total_ordering from itertools import dropwhile import django from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.files.temp import NamedTemporaryFile from django.core.management.base import BaseComman...
60d554243e04dbb8b521a43336e97b7647550fe04d1a031c203d446f65f9d227
import re from django.conf import settings from django.contrib.sessions.backends.cache import SessionStore from django.core.exceptions import ImproperlyConfigured from django.http import HttpRequest, HttpResponse from django.middleware.csrf import ( CSRF_ALLOWED_CHARS, CSRF_SESSION_KEY, CSRF_TOKEN_LENGTH, REASON_B...
5f83caa821613781f814b435b9dcaf816a7b6b6da8d3d0c091c7d9ebc9ab2ce5
from django.db.models import CharField, F, OuterRef, Q, Subquery, Value from django.db.models.fields.json import KeyTextTransform, KeyTransform from django.db.models.functions import Cast, Concat, Substr from django.test.utils import Approximate from . import PostgreSQLTestCase from .models import AggregateTestModel, ...
55b20a1440cd774e30db5aef3f199351fb5dc3d098800bf833ecc49b929408f8
import unittest from datetime import date, datetime, time, timedelta from django.utils.dateparse import ( parse_date, parse_datetime, parse_duration, parse_time, ) from django.utils.timezone import get_fixed_timezone class DateParseTests(unittest.TestCase): def test_parse_date(self): # Valid inputs ...
e2fc03ee2805efcc3d5d9d3abb14dcf7d18ec4b397afb9275e6c8501281f7b6c
import os import re import shutil import tempfile import time import warnings from io import StringIO from pathlib import Path from unittest import mock, skipIf, skipUnless from admin_scripts.tests import AdminScriptTestCase from django.core import management from django.core.management import execute_from_command_li...