Unnamed: 0
int64
0
10k
nl
stringlengths
3
2.42k
code
stringlengths
4
3.76k
100
bitwise shift integer 1 to the left by 31 spaces, substitute integer 1 from the result, convert the result to a integer, substitute it for MAXSIZE.
MAXSIZE = int ( ( 1 << 31 ) - 1 )
101
add params to extra_params dictionary.
extra_params . update ( params )
102
self.field.choice_cache is a list containing results of the method self.choice called with an argument obj,
self . field . choice_cache = [ self . choice ( obj ) for obj in self . queryset . all ( ) ]
103
update defaults dictionary with kwargs.
defaults . update ( kwargs )
104
matches is boolean True,
matches = True
105
derive the class EmailMultiAlternatives from the EmailMessage base class.
class EmailMultiAlternatives ( EmailMessage ) :
106
call the function get_commands, substitute it for commands.
commands = get_commands ( )
107
define the method get_connection with arguments self and fail_silently set to boolean False.
def get_connection ( self , fail_silently = False ) :
108
if not,
else :
109
from functools import update_wrapper.
from functools import update_wrapper
110
get is a string '<could not parse>'.
get = '<could not parse>'
111
if not,
else :
112
from django.template.base import Variable, Library and VariableDoesNotExist into default name space.
from django . template . base import Variable , Library , VariableDoesNotExist
113
define the function reset_translation.
def reset_translations ( ) :
114
try,
try :
115
define the method regex with an argument self.
def regex ( self ) :
116
return settings.TEMPLATE_STRING_IF_INVALID.
return settings . TEMPLATE_STRING_IF_INVALID
117
call the method tag.groups, substitute the result for closing_tag, tagname and self_closing, respectively.
closing_tag , tagname , self_closing = tag . groups ( )
118
return settings.LANGUAGE_CODE.
return settings . LANGUAGE_CODE
119
from django.template.base import TemplateDoesNotExist into default name space.
from django . template . base import TemplateDoesNotExist
120
get the value under the key key of the self.find_template_cache dictionary, substitute it for result.
result = self . find_template_cache [ key ]
121
result of the function force_text with an argument option_label, return the result. define the method render_options with 3 arguments: self, choices and selected_choices.
def render_options ( self , choices , selected_choices ) :
122
derive the class Command from the BaseCommand base class.
class Command ( BaseCommand ) :
123
for every f in opts.local_fields that has an 'post_create_sql' attribute, append f to a list, substitute the resulting list for post_sql_fields.
post_sql_fields = [ f for f in opts . local_fields if hasattr ( f , 'post_create_sql' ) ]
124
substitute self.max_value for the value under the 'max' key of the attrs dictionary.
attrs [ 'max' ] = self . max_value
125
convert filename to lowercase, use the result as an argument for the call to the function os.path.splitext,
base , tail_ext = os . path . splitext ( filename . lower ( ) )
126
define the method empty_variable with 2 arguments: self and token.
def empty_variable ( self , token ) :
127
raise an TypeError exception with an argument string 'Level not an integer or a valid string: %r' formated with level.
raise TypeError ( 'Level not an integer or a ' 'valid string: %r' % level )
128
get the value under the self key of the context.render_context dictionary, substitute it for cycle_iter.
cycle_iter = context . render_context [ self ]
129
flush the output buffer of the self.stdout object.
self . stdout . flush ( )
130
derive the class SerializationError from the Exception base class.
class SerializationError ( Exception ) :
131
call the BaseCache initialization method __init__ with 3 arguments self, list of arguments args and dictionary of arguments kwargs.
BaseCache . __init__ ( self , * args , ** kwargs )
132
define the method render with 4 arguments: self, name, value and attrs set to None.
def render ( self , name , value , attrs = None ) :
133
assign it to value under the string ".moves.urllib_robotparser" appended to __name__ key of the sys.modules dictionary, and to value under the string ".moves.urllib.robotparser" appended to __name__ key of the sys.modules dictionary. derive class Module_six_moves_urllib from the types.ModuleType base class.
class Module_six_moves_urllib ( types . ModuleType ) :
134
substitute '%s' in string '%s %s' with the elements of value converted into a tuple, substitute the result for value.
value = '%s %s' % tuple ( value )
135
delete Trans.
del Trans
136
and integer 60, substitute the result for timezone. divide timezone by integer 60, substitute the quotient of the division for hour and reminder for minute.
hour , minute = divmod ( timezone , 60 )
137
call the method value.encode with an argument self._charset, use the result as an argument for the call to the bytes function,
return bytes ( value . encode ( self . _charset ) )
138
break from the loop execution,
break
139
convert tagname to lowercase, substitute it for tagname.
tagname = tagname . lower ( )
140
if self.is_bound is false,
if not self . is_bound :
141
if not,
else :
142
call the get_script_name function with environ as argument, substitute the result for script_name.
script_name = get_script_name ( environ )
143
if domain equals a string 'djangojs' and file_ext is contained in command.extensions,
if domain == 'djangojs' and file_ext in command . extensions :
144
return value.
return value
145
with an argument i, append the result to a list, substitute the resulting list for forms. return forms.
return forms
146
use the global variable _serializers.
global _serializers
147
substitute ending for self.ending.
self . ending = ending
148
get value under the BLOCK_CONTEXT_KEY key of context.render_context dictionary, substitute it for block_context.
block_context = context . render_context . get ( BLOCK_CONTEXT_KEY )
149
derive the class VariableDoesNotExist form the base class Exception.
class VariableDoesNotExist ( Exception ) :
150
if fp is an instance of file and data is an instance of unicode and fp.encoding is not None,
if ( isinstance ( fp , file ) and isinstance ( data , unicode ) and fp . encoding is not None ) :
151
call the function _load_serializers.
_load_serializers ( )
152
define the method changed_data with an argument self.
def changed_data ( self ) :
153
and ip_address_validator_map converted to a list, respectively. call the re.compile function with an argument raw string '^[\d,]+$', substitute the result for comma_separated_int_list_re.
comma_separated_int_list_re = re . compile ( '^[\d,]+$' )
154
define the method __init__ with arguments: self and options set to None.
def __init__ ( self , options = None ) :
155
if elt is an instance of NonCapture class,
if isinstance ( elt , NonCapture ) :
156
append decimals to parts.
parts . append ( decimals )
157
call the serializer function, call the dumps method on the result with an argument obj, substitute result for data.
data = serializer ( ) . dumps ( obj )
158
evaluate the method self._cache.decr with key and negative delta as arguments, return the result.
return self . _cache . decr ( key , - delta )
159
substitute nodelist_true and nodelist_false for self.nodelist_true and self.nodelist_false, respectively.
self . nodelist_true , self . nodelist_false = nodelist_true , nodelist_false
160
for every label in labels,
for label in labels :
161
derive class InvalidCacheBackendError from the ImproperlyConfigured base class.
class InvalidCacheBackendError ( ImproperlyConfigured ) :
162
if result is not None,
if result is not None :
163
define the method __init__ with 6 arguments: self, name, old_mod, new_mod, old_attr set to None, new_attr set to None.
def __init__ ( self , name , old_mod , new_mod , old_attr = None , new_attr = None ) :
164
status_code is an integer 405.
status_code = 405
165
self.second is None.
self . second = None
166
call the method f.save_form_data with 2 arguments: instance and value under the f.name key of cleaned_data dictionary.
f . save_form_data ( instance , cleaned_data [ f . name ] )
167
get the 'value' attribute of the _urlconfs, if it exists return it, otherwise return defaults.
return getattr ( _urlconfs , "value" , default )
168
raise an exception of class NotImplementedError, with string 'subclasses of BaseCache must provide a get() method' as argument.
raise NotImplementedError ( 'subclasses of BaseCache must provide a get() method' )
169
substitute tempfile.gettempdir for gettempdir.
gettempdir = tempfile . gettempdir
170
define the method __init__ with 2 arguments: self and attrs set to None.
def __init__ ( self , attrs = None ) :
171
paths is a list containing results of the function force_text called with an argument p, for every p in paths.
paths = [ force_text ( p ) for p in paths ]
172
from unittest import import everything.
from unittest import *
173
read chunk_size bytes from file and store it in data.
data = file . read ( chunk_size )
174
for every dirpath, dirnames and locale_filenames in directory tree starting at the basedir directory.
for dirpath , dirnames , locale_filenames in os . walk ( basedir ) :
175
for every obj in result of the method self.queryset.all. for every choice in self.field.choice_cache,
for choice in self . field . choice_cache :
176
if ValueError, TypeError or ValidationError exception is caught,
except ( ValueError , TypeError , ValidationError ) :
177
_meth_self is a string "__self__".
_meth_self = "__self__"
178
append it to the string " Target specific migration: ", use it as the argument for the call to the self.style.MIGRATE_LABEL method, call the self.stdout.write method with previous return value as an argument. if run_syncdb and executor.loader.unmigrated_apps is true,
if run_syncdb and executor . loader . unmigrated_apps :
179
raise an exception.
raise
180
define the method __getitem__ with 2 arguments: self and idx.
def __getitem__ ( self , idx ) :
181
self.cookies is an instance of SimpleCookie class created with self.cookies as an argument.
self . cookies = SimpleCookie ( self . cookies )
182
define the method __init__ with 4 arguments: self, form, field and name.
def __init__ ( self , form , field , name ) :
183
call the method match.groupdict, substitute the result for kw.
kw = match . groupdict ( )
184
define the method __bool__ with an argument self.
def __bool__ ( self ) :
185
if InvalidTemplateLibrary, renamed to e, exception is caught,
except InvalidTemplateLibrary as e :
186
define the function F with an argument i.
def F ( i ) :
187
if 'media' is not contained in attrs,
if 'media' not in attrs :
188
if LookupError exception is caught,
except LookupError :
189
if initial is None,
if initial is None :
190
from django.utils import iri_to_uri, force_bytes, force_text to the default name space.
from django . utils . encoding import iri_to_uri , force_bytes , force_text
191
derive the class StreamingBuffer from the object base class.
class StreamingBuffer ( object ) :
192
call the method e.encode with an argument string "latin-1".
return s . encode ( "latin-1" )
193
return boolean False,
return False
194
for every code in tuple with 2 elements: lang_code and generic_lang_code,
for code in ( lang_code , generic_lang_code ) :
195
try,
try :
196
if language_code is not containsed in self._app_dict
if language_code not in self . _app_dict :
197
subtract length of the ext from the integer 255, take first elements of the name list up to the previous result index,
name = name [ : 255 - len ( ext ) ] + ext
198
matches is boolean False.
matches = False
199
substitute value under idx key of dictionary d for d.
d = d [ idx ]