Unnamed: 0
int64
0
10k
nl
stringlengths
3
2.42k
code
stringlengths
4
3.76k
5,800
increment i by integer 1,
i += 1
5,801
return fext.
return fext
5,802
skip this loop iteration.
continue
5,803
trans_real._default is None.
trans_real . _default = None
5,804
if regex_match is false,
if not regex_match :
5,805
if length of args is greater than integer 1,
if len ( args ) > 1 :
5,806
call the method self.non_field_errors, substitute the result for top_errors.
top_errors = self . non_field_errors ( )
5,807
_meth_func is a string "im_func".
_meth_func = "im_func"
5,808
call the method self._ordering.sort with an argument key as compare_ordering_key.
self . _ordering . sort ( key = compare_ordering_key )
5,809
try,
try :
5,810
call the function io.open with 3 arguments: self.dirpath and thefile joined into a file path, string 'w',
with io . open ( os . path . join ( self . dirpath , thefile ) , "w" , encoding = 'utf-8' ) as fp :
5,811
define the method open with arguments self, name and mode defaulting to string 'rb'.
def open ( self , name , mode = 'rb' ) :
5,812
define the function parse_cookie with cookie as the argument.
def parse_cookie ( cookie ) :
5,813
define the method attach_alternative with arguments self, content and mimetype.
def attach_alternative ( self , content , mimetype ) :
5,814
return boolean True.
return True
5,815
if errors is true,
if errors :
5,816
substitute self.field.widget for widget.
widget = self . field . widget
5,817
"pulls out all strings marked for translation. It creates (or updates) a message " "file in the conf/locale (in the django tree) or locale (for projects and " "applications) directory.\n\nYou must run this command with one of either the " "--locale, --exclude or --all options.". requires_system_checks is boolean False.
requires_system_checks = False
5,818
call the __init__ method of the base class of the QueryDict class.
super ( QueryDict , self ) . __init__ ( )
5,819
if the key doesnt exists substitute boolean False for self.use_natural_primary_keys. call the method self.start_serialization
self . start_serialization ( )
5,820
define the method render with 2 arguments: self and context.
def render ( self , context ) :
5,821
if ValueError exception is caught.
except ValueError :
5,822
decorator deconstructible,
@ deconstructible
5,823
convert key and default to strings, get the value under the key string key of the environ dictionary, if it does not exists use the,
value = environ . get ( str ( key ) , str ( default ) )
5,824
substitute complain for __imul__.
__imul__ = complain
5,825
define the method __reversed__ with an argument self.
def __reversed__ ( self ) :
5,826
if action equals to string "apply_start",
if action == "apply_start" :
5,827
extend list inner_result with res.
inner_result . extend ( res )
5,828
call the method self.expression.resolve with 2 arguments: context and boolean True, return the result.
return self . expression . resolve ( context , True )
5,829
define the method __iter__ with an argument self.
def __iter__ ( self ) :
5,830
if ValueError exception is caught,
except ValueError :
5,831
return tuple, consisting of first element of t converted to lowercase and True.
return t [ 0 ] . lower ( ) , True
5,832
raise an AttributeError with an argument string "This %s instance has no `content` attribute. "Use `streaming_content` instead.",
raise AttributeError ( "This %s instance has no `content` attribute. " "Use `streaming_content` instead." % self . __class__ . __name__ )
5,833
for p in self.ignore_patterns if p ends with dir_suffix take sliced list p from the start,
norm_patterns = [ p [ : - len ( dir_suffix ) ] if p . endswith ( dir_suffix ) else p for p in self . ignore_patterns ]
5,834
substitute gettext for gettext_noop, gettext_lazy and _.
gettext_noop = gettext_lazy = _ = gettext
5,835
call the method self._create_attachment with an unpacked list attachment as an argument, use the result as an argument for the call to the msg.attach method.
msg . attach ( self . _create_attachment ( * attachment ) )
5,836
define the method get_unique_error_message with 2 arguments: self and unique_check.
def get_unique_error_message ( self , unique_check ) :
5,837
if re.error, renamed to e, is caught,
except re . error as e :
5,838
try,
try :
5,839
if param is contained in unhandled_params,
if param in unhandled_params :
5,840
return self._callback.
return self . _callback
5,841
remove the 'stream' key from the options dictionary and substitute it for self.stream,
self . stream = options . pop ( "stream" , six . StringIO ( ) )
5,842
call the models.Model.save_base method with arguments self.object, using as using and raw set to boolean True.
models . Model . save_base ( self . object , using = using , raw = True )
5,843
call the method self.extra_headers.get with string 'From' and self.from_email as arguments, substitute the result for value under the 'From' key of msg dictionary.
msg [ 'From' ] = self . extra_headers . get ( 'From' , self . from_email )
5,844
raise an ImproperlyConfigured exception with an argument string "Creating a ModelForm without either the 'fields' attribute,
raise ImproperlyConfigured ( "Creating a ModelForm without either the 'fields' attribute " "or the 'exclude' attribute is prohibited; form %s " "needs updating." % name )
5,845
define the method __init__ with 3 arguments: self, filter_expr and nodelist).
def __init__ ( self , filter_expr , nodelist ) :
5,846
if third element of bits equals a string 'parsed',
if bits [ 2 ] == 'parsed' :
5,847
if not,
else :
5,848
raise a ValueError exception with an argument "The protocol '%s' is unknown. Supported: %s", replace '%s' with protocol,
raise ValueError ( "The protocol '%s' is unknown. Supported: %s" % ( protocol , list ( ip_address_validator_map ) ) )
5,849
call the method parser.compile_filter with an argument value, substitute the result for value under the key key of kwargs dictionary.
kwargs [ key ] = parser . compile_filter ( value )
5,850
define the method render with 2 arguments: self and context.
def render ( self , context ) :
5,851
substitute tuple containing 2 elements: sum of p_pattern and prefix, and sub_pattern for value under the namespace key of the namespace dictionary.
namespaces [ namespace ] = ( p_pattern + prefix , sub_pattern )
5,852
from django.utils.encoding import force_str and force_text into default name space.
from django . utils . encoding import force_str , force_text
5,853
derive the class datetime from the real_datetime base class.
class datetime ( real_datetime ) :
5,854
define the method _set with 4 arguments, self class instance, key, value and timeout set to DEFAULT_TIMEOUT.
def _set ( self , key , value , timeout = DEFAULT_TIMEOUT ) :
5,855
if length of bits is not zero,
if len ( bits ) :
5,856
raise an CommandError with an argument string "More than one migration matches '%s' in app '%s'. Please be more specific.",
raise CommandError ( "More than one migration matches '%s' in app '%s'. Please be more specific." % ( migration_name , app_label ) )
5,857
if the key doesnt exists substitute boolean False for self.use_natural_keys. if self.use_natural_keys is true,
if self . use_natural_keys :
5,858
substitute declared_fields for new_class.declared_fields.
new_class . declared_fields = declared_fields
5,859
call the method zipfile.ZipFile.__init___ with the arguments self, unpacked list args and unpacked dictionary kwargs.
zipfile . ZipFile . __init__ ( self , * args , ** kwargs )
5,860
return None.
return None
5,861
get the name key of the data dictionary, if the key exists return it, if not return None.
return data . get ( name , None )
5,862
convert keys of dictionary self.dict into a iterable, return it.
return iter ( self . dict . keys ( ) )
5,863
call the __init__ method from the base class of the class SimpleTemplateResponse, with 3 arguments: an empty string, content_type and status.
super ( SimpleTemplateResponse , self ) . __init__ ( '' , content_type , status )
5,864
from django.utils import six into default name space.
from django . utils import six
5,865
call the self.indent method with integer 0 as an argument.
self . indent ( 0 )
5,866
if value under the 'setting' key of the kwargs dictionary is equal to string 'LANGUAGES' or strnig 'LANGUAGE_CODE',
if kwargs [ 'setting' ] in ( 'LANGUAGES' , 'LANGUAGE_CODE' ) :
5,867
import module os.
import os
5,868
if token.contents doesn not equals a string 'endif', raise an AssertionError exception,
assert token . contents == 'endif'
5,869
define the method url_patterns with an argument self.
def url_patterns ( self ) :
5,870
changeset is None.
changeset = None
5,871
default_error_messages is an dictionary with an entry: return value of the function _ called with an argument string 'Enter a valid date.' for 'invalid'.
default_error_messages = { 'invalid' : _ ( 'Enter a valid date.' ) , }
5,872
substitute type.__init__ for __init__.
__init__ = type . __init__
5,873
try,
try :
5,874
get func_name attribute from the mod object, substitute it for view_func.
view_func = getattr ( mod , func_name )
5,875
get the value under the key key of the self.cookies dictionary, substitute expires for 'expires' key of the returned dictionary.
self . cookies [ key ] [ 'expires' ] = expires
5,876
if value has an attribute '_meta',
if hasattr ( value , '_meta' ) :
5,877
return boolean True, otherwise return boolean False. define the function make_aware with 2 arguments: value and timezone.
def make_aware ( value , timezone ) :
5,878
if e doesnt have an 'django_template_source' attribute,
if not hasattr ( e , 'django_template_source' ) :
5,879
from django.utils.http import http_date to the default name space.
from django . utils . http import http_date
5,880
derive the class CacheClass from the base class LocMemCache.
class CacheClass ( LocMemCache ) :
5,881
default set to False and help set to string'Creates SQL to unapply the migration, rather than to apply it' as arguments. define the method handle with self class instance, list of arguments args and options dictionary as the arguments.
def handle ( self , * args , ** options ) :
5,882
from functools import lru_cache.
from functools import lru_cache
5,883
define the method validate with arguments self and value.
def validate ( self , value ) :
5,884
skip this loop iteration.
continue
5,885
derive the class Command from the base class AppCommand.
class Command ( AppCommand ) :
5,886
if six.PY3 is true,
if six . PY3 :
5,887
mode is a string 'wb' is chunk is instance of the type bytes, otherwise mode is a string 'wt'.
mode = 'wb' if isinstance ( chunk , bytes ) else 'wt'
5,888
substitute next for self.next.
self . next = next
5,889
define the method clear_checkbox_id with 2 arguments: self and name.
def clear_checkbox_id ( self , name ) :
5,890
define the function do_with with 2 arguments: parser and token.
def do_with ( parser , token ) :
5,891
define _get_files method with self class instance as the argument.
def _get_files ( self ) :
5,892
define the method __init__ with self and limit_value as arguments.
def __init__ ( self , limit_value ) :
5,893
return boolean False.
return False
5,894
define the method ipython with an argument self.
def ipython ( self ) :
5,895
append self.form.required_css_class to a whitespace character, append it to the value under the 'class' key of the attrs dictionary.
attrs [ 'class' ] += ' ' + self . form . required_css_class
5,896
with the result renamed to fp, perform the following: call the method fp.write with an arguments src_data.
fp . write ( src_data )
5,897
call the function reverse with 4 arguments: concatenated project_name, character '.' and view_name, args as args, kwargs as kwargs,
url = reverse ( project_name + '.' + view_name , args = args , kwargs = kwargs , current_app = context . current_app )
5,898
replace every occurrence of raw string '\\' in the result with string '\\', return the result. call the function allow_lazy with an argument unescape_string_literal, substitute the result for unescape_string_literal.
unescape_string_literal = allow_lazy ( unescape_string_literal )
5,899
if self.verbosity is greater or equal to integer 2,
if self . verbosity >= 2 :