Unnamed: 0
int64 0
10k
| nl
stringlengths 3
2.42k
| code
stringlengths 4
3.76k
|
---|---|---|
5,900 |
call the method shell.mainloop.
|
shell . mainloop ( )
|
5,901 |
if value under the 'ENGINE' key of the connection.settings_dict dictionary equals a string 'django.db.backends.dummy',
|
if connection . settings_dict [ 'ENGINE' ] == 'django.db.backends.dummy' :
|
5,902 |
call the function ungettext_lazy with 3 arguments: string 'Ensure this value has at least %(limit_value)d character (it has %(show_value)d),
|
message = ungettext_lazy ( 'Ensure this value has at least %(limit_value)d character (it has %(show_value)d).' , 'Ensure this value has at least %(limit_value)d characters (it has %(show_value)d).' , 'limit_value' )
|
5,903 |
raise an NotImplementedError exception with argument string 'subclasses of Storage must provide an exists() method'.
|
raise NotImplementedError ( 'subclasses of Storage must provide an exists() method' )
|
5,904 |
derive the class HttpResponseRedirectBase from the HttpResponse base class.
|
class HttpResponseRedirectBase ( HttpResponse ) :
|
5,905 |
call the method resolver._reverse_with_prefix with 4 arguments: view, prefix, unpacked list args, unpacked dictionary kwargs,
|
return iri_to_uri ( resolver . _reverse_with_prefix ( view , prefix , * args , ** kwargs ) )
|
5,906 |
from django.utils.timezone import is_aware into default name space.
|
from django . utils . timezone import is_aware
|
5,907 |
if rest is not False, None is considered False,
|
if not rest :
|
5,908 |
return plural.
|
return plural
|
5,909 |
if not,
|
else :
|
5,910 |
import module os.
|
import os
|
5,911 |
commands is an dictionary containing elements: string 'django.core' for every name in the function find_commands return value, called with first element of __path__ as an argument.
|
commands = { name : 'django.core' for name in find_commands ( __path__ [ 0 ] ) }
|
5,912 |
if in_index-th element of bits equals to string 'in',
|
if bits [ in_index ] != 'in' :
|
5,913 |
call the method self.validate_key with argument key.
|
self . validate_key ( key )
|
5,914 |
can_order as can_order, can_delete as can_delete, validate_min as validate_min, validate_max as validate_max, substitute the result for form. substitute model for FormSet.model.
|
FormSet . model = model
|
5,915 |
import module hashlib.
|
import hashlib
|
5,916 |
for every subwidget in the result, yield subwidget, as the result of the generator.
|
yield subwidget
|
5,917 |
raise an NotImplementedError exception with argument string 'subclasses of Storage must provide a delete() method'.
|
raise NotImplementedError ( 'subclasses of Storage must provide a delete() method' )
|
5,918 |
call the method timezone.get_current_timezone, substitute the result for current_timezone.
|
current_timezone = timezone . get_current_timezone ( )
|
5,919 |
if f is an instance of ModelFiled, for every f in opts.virtual_fields, append f to a list, substitute the resulting list for sortable_virtual_fields.
|
sortable_virtual_fields = [ f for f in opts . virtual_fields if isinstance ( f , ModelField ) ]
|
5,920 |
define the function gen_filenames with an argument only_new defaulting to boolean False.
|
def gen_filenames ( only_new = False ) :
|
5,921 |
substitute the result for time_str. if six.PY2 is true,
|
if six . PY2 :
|
5,922 |
substitute NullBooleanSelect for widget.
|
widget = NullBooleanSelect
|
5,923 |
get the value under the key key of the self.cookies dictionary, substitute boolean True for 'secure' key of the returned dictionary.
|
self . cookies [ key ] [ 'secure' ] = True
|
5,924 |
raise an MultiPartParserError with an argument string "Invalid content length: %r", where '%r' is replaced with content_length.
|
raise MultiPartParserError ( "Invalid content length: %r" % content_length )
|
5,925 |
sum best_doublecolon_start and best_doublecolon_len, substitute the result for best_doublecolon_end,
|
best_doublecolon_end = ( best_doublecolon_start + best_doublecolon_len )
|
5,926 |
call the function re.compile with 2 arguments: elements of parts joined into a string, separated with '|',
|
self . regexes [ state ] = re . compile ( "|" . join ( parts ) , re . MULTILINE | re . VERBOSE )
|
5,927 |
return an dictionary containing 1 entry: return value of the function timezone.get_current_timezone_name for 'TIME_ZONE'.
|
return { 'TIME_ZONE' : timezone . get_current_timezone_name ( ) }
|
5,928 |
define the method __init__ with 2 arguments: self and content.
|
def __init__ ( self , content ) :
|
5,929 |
call the method t.nud with an argument self, substitute the result for left.
|
left = t . nud ( self )
|
5,930 |
for every x in sequence of integers from 0 to 7. background is a dictionary created with elements: x appended to a string '4' for value under the key x of color_names dictionary,
|
background = dict ( ( color_names [ x ] , '4%s' % x ) for x in range ( 8 ) )
|
5,931 |
and result of the function force_bytes called with an argument val2, return the result. if not,
|
else :
|
5,932 |
substitute _moved_attributes for _MovedItems._moved_attributes.
|
_MovedItems . _moved_attributes = _moved_attributes
|
5,933 |
python_2_unicode_compatible decorator,
|
@ python_2_unicode_compatible
|
5,934 |
if Exception exception is caught,
|
except Exception :
|
5,935 |
define the method __init__ with 3 arguments: self, unpacked list args and unpacked dictionary kwargs.
|
def __init__ ( self , * args , ** kwargs ) :
|
5,936 |
from django.utils.safestring import mark_safe into default name space.
|
from django . utils . safestring import mark_safe
|
5,937 |
define the function decorator with an argument klass.
|
def decorator ( klass ) :
|
5,938 |
subtract year from integer 2000, substitute the result for delta.
|
delta = 2000 - year
|
5,939 |
call the method self._cache.add with key, value, self.get_backend_timeout(timeout) as arguments.
|
return self . _cache . add ( key , value , self . get_backend_timeout ( timeout ) )
|
5,940 |
return otherwise.
|
return otherwise
|
5,941 |
from django.utils.itercompat import is_iterable into default name space.
|
from django . utils . itercompat import is_iterable
|
5,942 |
call the function six.reraise with 3 arguments: ImportError, instance of ImportError class created with an argument msg,
|
six . reraise ( ImportError , ImportError ( msg ) , sys . exc_info ( ) [ 2 ] )
|
5,943 |
from __future__ import unicode_literals into default name space.
|
from __future__ import unicode_literals
|
5,944 |
if formfield has an attribute 'queryset',
|
if hasattr ( formfield , 'queryset' ) :
|
5,945 |
call the function local, substitute the result for _prefixes.
|
_prefixes = local ( )
|
5,946 |
regex is an empty string.
|
regex = ''
|
5,947 |
call the method threading.RLock, substitute the result for self.mutex.
|
self . mutex = threading . RLock ( )
|
5,948 |
mapped_tokens is an empty list.
|
mapped_tokens = [ ]
|
5,949 |
string "resolve_variable() is deprecated. Use django.template. Variable(path).resolve(context) instead", RemovedInDjango20Warning, and stacklevel set to integer 2. call the method resolve with an argument context, from the instance of Variable class, created with an argument path.
|
return Variable ( path ) . resolve ( context )
|
5,950 |
if self._is_rendered is false.
|
if not self . _is_rendered :
|
5,951 |
define the function media_property with an argument cls.
|
def media_property ( cls ) :
|
5,952 |
call the method fp.write with an argument string '%d\n", with '%d' replaced by os.getpid function return value.
|
fp . write ( "%d\n" % os . getpid ( ) )
|
5,953 |
return result.
|
return result
|
5,954 |
call the function mark_safe with an argument output.
|
return mark_safe ( output )
|
5,955 |
self._validate_unique is boolean True.
|
self . _validate_unique = True
|
5,956 |
call the method chunk.find with an argument bytes string '\r\n\r\n', substitute the result for header_end.
|
header_end = chunk . find ( b'\r\n\r\n' )
|
5,957 |
from django.utils.ipv6 import is_valid_ipv6_address into default name space.
|
from django . utils . ipv6 import is_valid_ipv6_address
|
5,958 |
if safe is true and arg is not equal to string ';',
|
if safe and arg != ';' :
|
5,959 |
if best_doublecolon_start equals integer 0,
|
if best_doublecolon_start == 0 :
|
5,960 |
obj is a string "?".
|
obj = "?"
|
5,961 |
substitute token.source for e.django_template_source.
|
e . django_template_source = token . source
|
5,962 |
import module warnings.
|
import warnings
|
5,963 |
substitute result.queryset for result.queryset.
|
result . queryset = result . queryset
|
5,964 |
define the method clean with an argument self.
|
def clean ( self ) :
|
5,965 |
if value under the 'author_email' key of the item dictionary is not None,
|
if item [ 'author_email' ] is not None :
|
5,966 |
return initial.
|
return initial
|
5,967 |
if CONTEXT_SEPARATOR is contained in result,
|
if CONTEXT_SEPARATOR in result :
|
5,968 |
raise an TemplateDoesNotExist exception with an argument name.
|
raise TemplateDoesNotExist ( name )
|
5,969 |
substitute '%s' in the string '\n%s:\n%s\n', with group_name and formatted, substitute the result for msg.
|
msg += '\n%s:\n%s\n' % ( group_name , formatted )
|
5,970 |
define the method start_serialization with an argument self.
|
def start_serialization ( self ) :
|
5,971 |
code_list is an empty list.
|
code_list = [ ]
|
5,972 |
call the method handler.startElement with 2 arguments: string 'author' and an empty dictionary.
|
handler . startElement ( "author" , { } )
|
5,973 |
use it as an argument for the call to the method self.style.MIGRATE_HEADING, write the result to self.stdout. for every operation in migration.merged_operations,
|
for operation in migration . merged_operations :
|
5,974 |
define the method W with an argument self.
|
def W ( self ) :
|
5,975 |
got_request_exception is a instance of a Signal class, created with an argument providing_args as the list containing string 'request'.
|
got_request_exception = Signal ( providing_args = [ "request" ] )
|
5,976 |
if self.to_field is true,
|
if self . to_field :
|
5,977 |
from django.db.migrations.state import ProjectState into default name space.
|
from django . db . migrations . state import ProjectState
|
5,978 |
call the method match.groups, substitute the result for args.
|
args = match . groups ( )
|
5,979 |
otherwise if t.token_type equals TOKEN_COMMENT,
|
elif t . token_type == TOKEN_COMMENT :
|
5,980 |
decorator function register.filter with an argument is_safe set to boolean True.
|
@ register . filter ( is_safe = True )
|
5,981 |
call the method sys.stderr.write with an argument string " as a FastCGI application, you will need to get flup from\n".
|
sys . stderr . write ( " as a FastCGI application, you will need to get flup from\n" )
|
5,982 |
raise an ValueError with an argument string "'%s.%s' has no field named '%s'.", where '%s' is replaced with,
|
raise ValueError ( "'%s.%s' has no field named '%s'." % ( model . _meta . app_label , model . _meta . object_name , fk_name ) )
|
5,983 |
if ':' is not contained in ip_str.
|
if ':' not in ip_str :
|
5,984 |
raise an TemplateEncodingError exception with an argument "Templates can only be constructed from unicode or UTF-8 strings.".
|
raise TemplateEncodingError ( "Templates can only be constructed " "from unicode or UTF-8 strings." )
|
5,985 |
and format, return the result. derive the class RegexField from the base class CharField class.
|
class RegexField ( CharField ) :
|
5,986 |
_anonymous_ is a list containing one string: '_offset'.
|
_anonymous_ = [ '_offset' ]
|
5,987 |
if s is not an instance of the object Exception,
|
if not isinstance ( s , Exception ) :
|
5,988 |
return the result. call the function force_bytes with arguments value and self._charset, return the result.
|
return force_bytes ( value , self . _charset )
|
5,989 |
if media is true,
|
if media :
|
5,990 |
from django import http into default name space.
|
from django import http
|
5,991 |
return a string '%02d' formated with self.data.month.
|
return '%02d' % self . data . month
|
5,992 |
substitute value under the "_wrapped" key of the self.__dict__ dictionary.
|
self . __dict__ [ "_wrapped" ] = value
|
5,993 |
for every middleware_path in settings.MIDDLEWARE_CLASSES:
|
for middleware_path in settings . MIDDLEWARE_CLASSES :
|
5,994 |
return left.
|
return left
|
5,995 |
if _cookie_encodes_correctly and _cookie_allows_colon_in_names are boolean True,
|
if _cookie_encodes_correctly and _cookie_allows_colon_in_names :
|
5,996 |
return kwargs.
|
return kwargs
|
5,997 |
substitute value under the backend key of settings.CACHES dictionary for conf.
|
conf = settings . CACHES [ backend ]
|
5,998 |
define the method get with 5 arguments, self class instance, key, default set to None and version set to None.
|
def get ( self , key , default = None , version = None ) :
|
5,999 |
call the function calculate_app_template_dirs, substitute the result for app_template_dirs.
|
app_template_dirs = calculate_app_template_dirs ( )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.