Unnamed: 0
int64
0
10k
nl
stringlengths
3
2.42k
code
stringlengths
4
3.76k
500
yield obj, as an return value of the generator.
yield obj
501
define the function is_ignored with arguments path and ignore_patterns.
def is_ignored ( path , ignore_patterns ) :
502
zip elements of result and result_args into a list of tuples, for every item and args in the result,
for item , args in zip ( result , result_args ) :
503
try,
try :
504
dest as a string 'ignore', default set to boolean False and help set to string 'Ignores entries in the serialized data for fields that do not currently exist on the model.'. define the method handle with 3 arguments: self, unpacked list fixture_labels and unpacked dictionary options.
def handle ( self , * fixture_labels , ** options ) :
505
call the method cls.__promise__ with 3 arguments: resultclass, k and v, substitute the result for meth.
meth = cls . __promise__ ( resultclass , k , v )
506
if IndexError exception is caught,
except IndexError :
507
call the method apps.get_app_configs, for app_config in the result,
for app_config in apps . get_app_configs ( ) :
508
self._errors is an empty list.
self . _errors = [ ]
509
derive class LimitedStream from the object base class, making it a new-style class.
class LimitedStream ( object ) :
510
if VariableDoesNotExist exception is caught,
except VariableDoesNotExist :
511
if fext is a file,
if os . path . isfile ( fext ) :
512
call the method self.stdout.write with an argument string 'examining files with the extensions: %s\n',
self . stdout . write ( 'examining files with the extensions: %s\n' % get_text_list ( list ( self . extensions ) , 'and' ) )
513
define the function remove_tags with 2 arguments: html and tags.
def remove_tags ( html , tags ) :
514
call the function force_str with an argument quoted_url, use the result as an argument for the call to the function unquote,
return force_text ( unquote ( force_str ( quoted_url ) ) )
515
call the method self._delete with argument k.
self . _delete ( k )
516
if name is not None,
if name is not None :
517
from django.template.loader import BaseLoader into default name space.
from django . template . loader import BaseLoader
518
define the function valid_ident with an argument s.
def valid_ident ( s ) :
519
define the method __getattr__ with 2 arguments: self and attr set to None.
def __getattr__ ( self , attr ) :
520
if ImportError exception is caught,
except ImportError :
521
value under the self.var_name key of the context dictionary is an empty list.
context [ self . var_name ] = [ ]
522
otherwise, length of options.args is lesser than integer 1,
elif len ( options . args ) < 1 :
523
and dictionary of arbitrary length **kwargs as arguments. call the initialization method for the base class, _html_parser.HTMLParser.__init__ with self,
_html_parser . HTMLParser . __init__ ( self , convert_charrefs = convert_charrefs , ** kwargs )
524
if UnicodeError exception is caught,
except UnicodeError :
525
if length of fks_to_parent equals integer 1.
if len ( fks_to_parent ) == 1 :
526
return self.
return self
527
if nesting is false,
if not nesting :
528
import module os.
import os
529
if not,
else :
530
define the method __bytes_cast with an argument self.
def __bytes_cast ( self ) :
531
for every format in BUILTIN_SERIALIZERS,
for format in BUILTIN_SERIALIZERS :
532
define the function validate_ipv46_address with an argument value.
def validate_ipv46_address ( value ) :
533
'PasswordInput', 'HiddenInput', 'MultipleHiddenInput', 'ClearableFileInput', 'FileInput', 'DateInput', 'DateTimeInput', 'TimeInput', 'Textarea', 'CheckboxInput', 'Select', 'NullBooleanSelect', 'SelectMultiple', 'RadioSelect','CheckboxSelectMultiple', 'MultiWidget', 'SplitDateTimeWidget' and 'SplitHiddenDateTimeWidget'. MEDIA_TYPES is a tuple with 2 strings: 'css' and 'js'.
MEDIA_TYPES = ( 'css' , 'js' )
534
return cls.
return cls
535
if empty_label is not None,
if empty_label is not None :
536
substitute lib for value under the library_name key of libraries dictionary.
libraries [ library_name ] = lib
537
return it. if PY3 is true,
if PY3 :
538
do nothing
pass
539
yield subnode.
yield subnode
540
call the function sql_create with 3 arguments: app_config, self.style and connection, substitute the result for statements.
statements = sql_create ( app_config , self . style , connection )
541
define the function get_urlconf with an argument default set to None.
def get_urlconf ( default = None ) :
542
return self._queryset.
return self . _queryset
543
call the function allow_lazy with 2 arguments: normalize_newlines and six.text_type, substitute the result for normalize_newlines.
normalize_newlines = allow_lazy ( normalize_newlines , six . text_type )
544
if err_log is true,
if err_log :
545
define the method content with an argument self.
def content ( self ) :
546
call the private dict.__setitem__ method with self class instance, key and M as arguments.
dict . __setitem__ ( self , key , M )
547
define the method __init__ with 3 arguments: self, attrs set to None and choices set to an empty tuple.
def __init__ ( self , attrs = None , choices = ( ) ) :
548
define the function find_filter with 2 arguments: self and filter_name.
def find_filter ( self , filter_name ) :
549
call the method parser.add_library with an argument lib.
parser . add_library ( lib )
550
call the function re.compile with 2 arguments: raw string "((?:[^\s'"]*(?:(?:"(?:[^"\\]|\\.)*" | '(?:[^'\\]|\\.)*')[^\s'"]*)+) | \+)",
smart_split_re = re . compile ( r""" ((?: [^\s'"]* (?: (?:"(?:[^"\\]|\\.)*" | '(?:[^'\\]|\\.)*') [^\s'"]* )+ ) | \S+) """ , re . VERBOSE )
551
break the loop execution.
break
552
if settings.FORCE_SCRIPT_NAME is not None,
if settings . FORCE_SCRIPT_NAME is not None :
553
call the method self.set_cdata_mode with tag as the argument.
self . set_cdata_mode ( tag )
554
result_args is a list containing an empty list.
result_args = [ [ ] ]
555
call the method transaction.get_autocommit with an argument self.using, if it evaluates to true,
if transaction . get_autocommit ( self . using ) :
556
raise an exception.
raise
557
call the method self.show_migration_list with connection as first argument, as second argument use value under the 'app_label' key of options dictionary,
return self . show_migration_list ( connection , [ options [ 'app_label' ] ] if options [ 'app_label' ] else None )
558
substitute the result for self.instance. try,
try :
559
from django.apps import apps into default name space.
from django . apps import apps
560
substitute logging.getLogger for getLogger.
getLogger = logging . getLogger
561
substitute sysid for self.sysid.
self . sysid = sysid
562
return a string '%s(%s)' formated with self.__class__.__name__ and dictreprs.
return '%s(%s)' % ( self . __class__ . __name__ , dictreprs )
563
substitute '%r' in string ' gettext(%r) ' with result of the function join_tokens, called with 2 arguments: singular,
out . write ( ' gettext(%r) ' % join_tokens ( singular , trimmed ) )
564
try,
try :
565
define the function to_locale with 2 arguments language and to_lower set to boolean False.
def to_locale ( language , to_lower = False ) :
566
if quote_double_quotes is true,
if quote_double_quotes :
567
call the function prepare_js_for_gettext with an argument src_data, substitute it for src_data.
src_data = prepare_js_for_gettext ( src_data )
568
get the value under the 'interactive' key of the options dictionary, substitute it for self.interactive.
self . interactive = options . get ( 'interactive' )
569
define the function deactivate_all.
def deactivate_all ( ) :
570
substitute value under the 'use_reloader' key of the options dictionary for use_reloader.
use_reloader = options . get ( 'use_reloader' )
571
derive the class ConvertingList from list base class.
class ConvertingList ( list ) :
572
call the function is_aware with an argument date, if it evaluates to true,
if is_aware ( date ) :
573
if self.verbosity is greater than integer 0,
if self . verbosity > 0 :
574
msg is a string "%s doesn't look like a module path" formated with dotted_path.
msg = "%s doesn't look like a module path" % dotted_path
575
from django.core.mail.message import sanitize_address into default name space.
from django . core . mail . message import sanitize_address
576
from __future__ import unicode_literals into default name space.
from __future__ import unicode_literals
577
define the function get_git_changeset.
def get_git_changeset ( ) :
578
substitute message.error_dict for message.
message = message . error_dict
579
i is the reminder of the division of i by j.
i = i % j
580
add ns_pattern and extra, substitute the result for ns_pattern.
ns_pattern = ns_pattern + extra
581
from django.core.management.base import AppCommand into default name space.
from django . core . management . base import AppCommand
582
substitute subject for self.subject.
self . subject = subject
583
return list_ and boolean False.
return list_ , False
584
define the method __init__ with 2 arguments: self and s.
def __init__ ( self , s ) :
585
remove first two elements from bits.
bits = bits [ 2 : ]
586
if self.fail_silently is false,
if not self . fail_silently :
587
define the method __init__ with arguments: self, unpacked list args and unpacked dictionary kwargs.
def __init__ ( self , * args , ** kwargs ) :
588
return a dictionary with 2 elements: self._version for "version" and "http://www.w3.org/2005/Atom" for "xmlns:atom".
return { "version" : self . _version , "xmlns:atom" : "http://www.w3.org/2005/Atom" }
589
substitute old_attr for new_attr.
new_attr = old_attr
590
sum lead and opening, substitute the result for lead.
lead = lead + opening
591
if self.use_ipv6 substitute string '::1' for self.addr, if not substitute '127.0.0.1' for self.addr.
self . addr = '::1' if self . use_ipv6 else '127.0.0.1'
592
msg is a string "Could not decode base64 data: %r", where '%r' is replace with e.
msg = "Could not decode base64 data: %r" % e
593
substitute name for self.name.
self . name = name
594
add bits to a tuple, return it.
return tuple ( bits )
595
call the method value.astimezone with an argument timezone, substitute the result for value.
value = value . astimezone ( timezone )
596
if LookupError exception is caught,
except LookupError :
597
format string ' pgettext(%r, %r) ' with message_context and g, write it to out.
out . write ( ' pgettext(%r, %r) ' % ( message_context , g ) )
598
return iterable self.keyOrder.
return iter ( self . keyOrder )
599
if not,
else :