Unnamed: 0
int64
0
10k
nl
stringlengths
3
2.42k
code
stringlengths
4
3.76k
300
call the method result.setlist with 2 arguments: return value of the function copy.deepcopy called with 2 arguments: key and memo,
result . setlist ( copy . deepcopy ( key , memo ) , copy . deepcopy ( value , memo ) )
301
if not,
else :
302
_empty_value is an empty list.
_empty_value = [ ]
303
return output.
return output
304
and absolute value of p, substitute the result for exp. try,
try :
305
if stream_or_string is an instance of bytes,
if isinstance ( stream_or_string , bytes ) :
306
call the self.clear method.
self . clear ( )
307
substitute the result for args and kwargs. return an instance of AssignmentNode class created with 4 arguments: takes_context, args, kwargs and target_var.
return AssignmentNode ( takes_context , args , kwargs , target_var )
308
return _translations dictionary value, under the language key.
return _translations [ language ]
309
if not,
else :
310
for every form in self call the form.as_ul method, join the results in a string, separated by an empty string.
forms = ' ' . join ( form . as_ul ( ) for form in self )
311
call the as_bytes method on the return value of the message.message method append to it '\n' character, use it as the argument for the call to the self.stream.write method.
self . stream . write ( message . message ( ) . as_bytes ( ) + b'\n' )
312
substitute value under the key key of self dictionary for val.
val = self [ key ]
313
if not,
else :
314
from django.utils.functional import allow_lazy into default name space.
from django . utils . functional import allow_lazy
315
raise an TemplateSyntaxError exception with an argument string "Second (optional) argument to %s tag must be 'parsed'",
raise TemplateSyntaxError ( "Second (optional) argument to %s tag" " must be 'parsed'" % bits [ 0 ] )
316
if tags exists and if all elements in the return value of the method checks.tag_exists called with an argument tag,
if tags and any ( not checks . tag_exists ( tag ) for tag in tags ) :
317
and only if self.match is None or return value of the method self.match_re.search called with an argument f is true. append a tuple containing 2 elements: full_file and f to self.choices list.
self . choices . append ( ( full_file , f ) )
318
append loader to loaders.
loaders . append ( loader )
319
remove kwargs dictionary element under the 'method' key, substitute it for method.
method = kwargs . pop ( 'method' )
320
define the method add_arguments with arguments self and parser.
def add_arguments ( self , parser ) :
321
call the method token.split_contents, substitute the result.
bits = token . split_contents ( )
322
raise an AttributeError exception with string "Unable to determine the file's size." as argument.
raise AttributeError ( "Unable to determine the file's size." )
323
derive the class Command from the BaseCommand base class.
class Command ( BaseCommand ) :
324
self.items is an empty list.
self . items = [ ]
325
define the method stringfilter with an argument func.
def stringfilter ( func ) :
326
call the function inline_re.match with an argument t.contents, substitute the result for imatch.
imatch = inline_re . match ( t . contents )
327
define the function gettext with an argument message.
def gettext ( message ) :
328
default set to DEFAULT_DB_ALIAS and help set to string 'Nominates a database onto which to open a shell. Defaults to the "default" database.'. define the method handle with arguments self and unpacked dictionary options.
def handle ( self , ** options ) :
329
sys.stderr is an instance of NullDevice class.
sys . stderr = NullDevice ( )
330
define the method __repr__ with an argument self.
def __repr__ ( self ) :
331
zfile is an instance of GzipFile class, created with 3 arguments: mode set to string 'wb', compresslevel set to integer 6,
zfile = GzipFile ( mode = 'wb' , compresslevel = 6 , fileobj = buf )
332
try,
try :
333
__all__ is an list containing strings: 'activate', 'deactivate', 'override', 'deactivate_all', 'get_language',
__all__ = [ 'activate' , 'deactivate' , 'override' , 'deactivate_all' , 'get_language' , 'get_language_from_request' , 'get_language_info' , 'get_language_bidi' , 'check_for_language' , 'to_locale' , 'templatize' , 'string_concat' , 'gettext' , 'gettext_lazy' , 'gettext_noop' , 'ugettext' , 'ugettext_lazy' , 'ugettext_noop' , 'ngettext' , 'ngettext_lazy' , 'ungettext' , 'ungettext_lazy' , 'pgettext' , 'pgettext_lazy' , 'npgettext' , 'npgettext_lazy' , 'LANGUAGE_SESSION_KEY' , ]
334
for every pk in value,
for pk in value :
335
raise an CommandError exception with an argument string "You can only use --pks option with one model".
raise CommandError ( "You can only use --pks option with one model" )
336
for every sql in index_sql,
for sql in index_sql :
337
if elt is an instance of six.string_types class,
if isinstance ( elt , six . string_types ) :
338
append filename to _error_files.
_error_files . append ( filename )
339
substitute file for filename.
filename = file
340
return value.
return value
341
call the connection.introspection.table_names with tables as argument, store the result in seen_models.
seen_models = connection . introspection . installed_models ( tables )
342
if urlconf_name is true,
if urlconf_name :
343
from django.conf import urls into default name space,
from django . conf import urls
344
substitute the result for value under the NON_FIELD_ERRORS key of the form._errors dictionary. for every field in unique_check,
for field in unique_check :
345
if base_lang is contained in settings.LANGUAGES_BIDI, return boolean True, if not, return boolean False.
return base_lang in settings . LANGUAGES_BIDI
346
convert max_value into an floating point number, substitute it for max_value.
max_value = float ( max_value )
347
return a list containing return values of the function to_py called with an argument val, for every val in value.
return [ to_py ( val ) for val in value ]
348
from django.utils import six and lru_cache into default name space.
from django . utils import six , lru_cache
349
import module warnings.
import warnings
350
return the string 'ValidationError(%s)', replace '%s' with self.
return 'ValidationError(%s)' % self
351
lexer is an instance of JsLexer class.
lexer = JsLexer ( )
352
for every form in self call the form.as_table method, join the results in a string, separated by an empty string.
forms = ' ' . join ( form . as_table ( ) for form in self )
353
call the method self.parse_name with an argument fixture_label, substitute the result for fixture_name, ser_fmt, cmp_fmt, respective.
fixture_name , ser_fmt , cmp_fmt = self . parse_name ( fixture_label )
354
call the method notifier.read_events.
notifier . read_events ( )
355
return an string '0'.
return '0'
356
if pytz is true, substitute pytz.utc for utc, otherwise substitute result of the function UTC for utc.
utc = pytz . utc if pytz else UTC ( )
357
return data.
return data
358
where '%s' is replaced with first element of bits. call the method parser.compile_filter with second element of bits as an argument, substitute the result for viewname.
viewname = parser . compile_filter ( bits [ 1 ] )
359
for every k2 and v2 in v,
for k2 , v2 in v :
360
if domain is true and return value of the function validate_host called with 2 arguments: domain and settings.ALLOWED_HOSTS, evaluates to true,
if domain and validate_host ( domain , settings . ALLOWED_HOSTS ) :
361
append a tuple with 2 elements: f.name and formfield to field_list.
field_list . append ( ( f . name , formfield ) )
362
return host.
return host
363
from io import StringIO into default name space.
from io import StringIO
364
if not,
else :
365
return attrs.
return attrs
366
if host ends with '.', remove the last element from host.
host = host [ : - 1 ] if host . endswith ( '.' ) else host
367
if not,
else :
368
call the method self._coerce with an argument value, return the result.
return self . _coerce ( value )
369
substitute '%s' in string "No changes detected in app '%s'" with the result of the method app_labels.pop, write it to self.stdout.
self . stdout . write ( "No changes detected in app '%s'" % app_labels . pop ( ) )
370
if decimals is greater than digits,
if decimals > digits :
371
if self.no_obsolete is true,
if self . no_obsolete :
372
from django.utils.text import unescape_entities into default name space.
from django . utils . text import unescape_entities
373
define the method __init__ with 5 arguments: self, view_name, args, kwargs and asvar.
def __init__ ( self , view_name , args , kwargs , asvar ) :
374
self._post_render_callbacks is an empty list.
self . _post_render_callbacks = [ ]
375
call the function mark_for_escaping with an argument value, return the result.
return mark_for_escaping ( value )
376
call the method cursor.execute with an argument line.
cursor . execute ( line )
377
from django.core.servers.basehttp import run and get_internal_wsgi_application into default name space.
from django . core . servers . basehttp import run , get_internal_wsgi_application
378
if not,
else :
379
if self.instance.pk is None,
if self . instance . pk is None :
380
convert value into an string, convert the result into an integer and substitute it for value.
value = int ( str ( value ) )
381
call the function re.compile with arguments regex and re.UNICODE, substitute the result for compiled_regex.
compiled_regex = re . compile ( regex , re . UNICODE )
382
logger.propagate is boolean True.
logger . propagate = True
383
define the function request with an argument request.
def request ( request ) :
384
if callback is an callable object,
if callable ( callback ) :
385
from django.conf import settings into default name space.
from django . conf import settings
386
define the method add_arguments with self and parser as arguments.
def add_arguments ( self , parser ) :
387
try,
try :
388
separated by result of the function _ called with an argument string ', ', for every i in list_ without last element, result of the function force_text called with an argument last_word, result of the function force_text called with an argument: last element of list_. call the function allow_lazy with 2 arguments: get_text_list and six.text_type, substitute the result for get_text_list.
get_text_list = allow_lazy ( get_text_list , six . text_type )
389
if m is true,
if m :
390
substitute value under 'warning' key of kwargs dictionary for warning.
warning = kwargs [ 'warning' ]
391
inverse_match set to None and flags set to None. if regex is not None,
if regex is not None :
392
pos is equal to integer 0.
pos = 0
393
raise an Resolver404 exception with an argument dictionary containing 1 entry: path for 'path'.
raise Resolver404 ( { 'path' : path } )
394
if messages is not an instance of the ValidationError class,
if not isinstance ( messages , ValidationError ) :
395
call the method loader.detect_conflicts, substitute the result for conflicts.
conflicts = loader . detect_conflicts ( )
396
if call to the function response.has_header with argument 'Vary' returns boolean True,
if response . has_header ( 'Vary' ) :
397
sup_cls is base class of the class cls.
sup_cls = super ( cls , self )
398
from django.utils.encoding import force_text and filepath_to_uri into default name space.
from django . utils . encoding import force_text , filepath_to_uri
399
help is a string "Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the given model module name(s).".
help = "Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the given model module name(s)."