Unnamed: 0
int64
0
10k
nl
stringlengths
3
2.42k
code
stringlengths
4
3.76k
200
call the function date with 2 arguments: result of the call to the function datetime.now with an argument tz set to tzinfo,
return date ( datetime . now ( tz = tzinfo ) , self . format_string )
201
if data is None,
if data is None :
202
match is None.
match = None
203
ModelFormMetaclass and BaseModelForm. do nothing.
pass
204
call the function handle_m2m with an argument relobj.
handle_m2m ( relobj )
205
if i is smaller than result of the method self.initial_form_count and key 'instance' is not contained in kwargs,
if i < self . initial_form_count ( ) and 'instance' not in kwargs :
206
derive the class EscapeData from object base class.
class EscapeData ( object ) :
207
get the value under the 'exclude' key of the options dictionary, substitute it for exclude.
exclude = options . get ( 'exclude' )
208
define the method data with an argument self.
def data ( self ) :
209
from IPython.frontend.terminal.ipapp import TerminalIPythonApp into default namespace.
from IPython . frontend . terminal . ipapp import TerminalIPythonApp
210
request_repr is a string "unavailable".
request_repr = "unavailable"
211
return integer 1.
return 1
212
value under the 'feed_url' key of the self.feed dictionary for 'href'. if value under the 'language' key of the self.feed dictionary is not None,
if self . feed [ 'language' ] is not None :
213
from threading import local into default name space.
from threading import local
214
call the method token.split_contents, substitute the result for bits.
bits = token . split_contents ( )
215
from django.conf import settings into default name space.
from django . conf import settings
216
call the function force_text with an argument s, strip the result of whitespaces from both ends,
s = force_text ( s ) . strip ( ) . replace ( ' ' , '_' )
217
define the method indent with argument self and level.
def indent ( self , level ) :
218
if root is true,
if root :
219
raise a ValueError exception with an argument string "JSON can't represent timezone-aware times.".
raise ValueError ( "JSON can't represent timezone-aware times." )
220
yield key and value under the key key of self dictionary.
yield key , self [ key ]
221
if type of result is ConvertingDict, ConvertingList or ConvertingTuple,
if type ( result ) in ( ConvertingDict , ConvertingList , ConvertingTuple ) :
222
initialize the object of a InMemoryUploadedFile class with arguments: file set to self.file, field_name set to self.field_name,
return InMemoryUploadedFile ( file = self . file , field_name = self . field_name , name = self . file_name , content_type = self . content_type , size = file_size , charset = self . charset , content_type_extra = self . content_type_extra )
223
call the function timedelta with an argument seconds set to negative _time.timezone, substitute the result for self.STDOFFSET.
self . STDOFFSET = timedelta ( seconds = - _time . timezone )
224
from django.conf import settings into default name space.
from django . conf import settings
225
substitute format for self.format if format is true, if not self.format is None.
self . format = format if format else None
226
call the file.__exit__ method on self with exc, value and tb as the arguments.
self . file . __exit__ ( exc , value , tb )
227
substitute form.instance for obj.
obj = form . instance
228
if can_fail is true,
if can_fail :
229
call the function exec_ with an argument string """def reraise(tp, value, tb=None): raise tp, value, tb""".
exec_ ( """def reraise(tp, value, tb=None): raise tp, value, tb """ )
230
define the function salted_hmac with 3 arguments: key_salt, value and secret set to None.
def salted_hmac ( key_salt , value , secret = None ) :
231
convert name to lower case if it equals to string 'from' or 'to,
if name . lower ( ) in ( 'from' , 'to' ) :
232
if ret equals to integer 0, return boolean True, otherwise return boolean False.
return ( ret == 0 )
233
if first element of data_list is contained in self.empty_values,
if data_list [ 0 ] in self . empty_values :
234
substitute self.__class__ for response._handler_class.
response . _handler_class = self . __class__
235
call the method self.end_object with an argument obj.
self . end_object ( obj )
236
substitute the '%s' with table and list containing key, respectively. return default.
return default
237
if self.forms is true,
if self . forms :
238
from django.utils.safestring import mark_safe into default name space.
from django . utils . safestring import mark_safe
239
define the method upload_handlers with arguments: self and upload_handlers.
def upload_handlers ( self , upload_handlers ) :
240
if AttributeError exception is caught,
except AttributeError :
241
substitute state for self.state.
self . state = state
242
divide hits by a floating point number self.per_page, convert its ceiling value to an integer and substitute it for self._num_pages.
self . _num_pages = int ( ceil ( hits / float ( self . per_page ) ) )
243
from django.conf import settings into default name space.
from django . conf import settings
244
define the method __init__ with arguments self, unpacked list args and unpacked dictionary kwargs.
def __init__ ( self , * args , ** kwargs ) :
245
try,
try :
246
define method set_cdata_mode, with self class instance and tag as the arguments.
def set_cdata_mode ( self , tag ) :
247
if instance is None,
if instance is None :
248
return boolean False.
return False
249
append tuple with 2 elements: migration.app_label and migration.name to replaces.
replaces . append ( ( migration . app_label , migration . name ) )
250
if response has an attribute 'render' and response.render is a callable object,
if hasattr ( response , 'render' ) and callable ( response . render ) :
251
write string "Performing system checks...\n\n" to self.stdout stream.
self . stdout . write ( "Performing system checks...\n\n" )
252
define the function extract with 2 arguments path and to_path set to empty string.
def extract ( path , to_path = '' ) :
253
call the method self.build_attrs with an argument attrs, substitute the result for final_attrs.
final_attrs = self . build_attrs ( attrs )
254
define the function construct_instance with 4 arguments: form, instance, fields set to None and exclude set to None.
def construct_instance ( form , instance , fields = None , exclude = None ) :
255
call the function run with 5 arguments: self.addr, self.port converted to an integer, handler, ipv6 set to self.use_ipv6, and threading set to threading.
run ( self . addr , int ( self . port ) , handler , ipv6 = self . use_ipv6 , threading = threading )
256
if self._done is true,
if self . _done :
257
dklen is None.
dklen = None
258
if values has an attribute '__len__',
if not hasattr ( values , '__len__' ) :
259
import module errno.
import errno
260
locales is a difference between the locales and exclude sets.
locales = set ( locales ) - set ( exclude )
261
call the method self.fetch_command with an argument command, call the method run_from_argv on the result with an argument self.argv.
self . fetch_command ( subcommand ) . run_from_argv ( self . argv )
262
import module re.
import re
263
call the self.setup_environ method.
self . setup_environ ( )
264
try,
try :
265
for every locale in locales,
for locale in locales :
266
try,
try :
267
if key exists, substitute it for self.key, if not substitute settings.SECRET_KEY for key.
self . key = key or settings . SECRET_KEY
268
if length of app_labels is greater than integer 1 and primary_keys is true,
if len ( app_labels ) > 1 and primary_keys :
269
if PY3 is true,
if PY3 :
270
return a dictionary with an entry: self.ns for "xmlns".
return { "xmlns" : self . ns }
271
if day_of_year is smaller than or equalt to jan1_weekday subtracted from integer 8 and jan1_weekday is greater than integer 4,
if day_of_year <= ( 8 - jan1_weekday ) and jan1_weekday > 4 :
272
if self.message_context is true,
if self . message_context :
273
if close is True,
if close :
274
define the function dec with an argument func,
def dec ( func ) :
275
return data.
return data
276
substitute _urllib_robotparser_moved_attributes for Module_six_moves_urllib_robotparser._moved_attributes.
Module_six_moves_urllib_robotparser . _moved_attributes = _urllib_robotparser_moved_attributes
277
call the method clear from the base class of the class QueryDict, return the result.
super ( QueryDict , self ) . clear ( )
278
call the function to_python with an argument pk, substitute the result for pk.
pk = to_python ( pk )
279
from itertools import chain into default name space.
from itertools import chain
280
if field is not equal to NON_FIELD_ERRORS and field is not contained in self.fields,
if field != NON_FIELD_ERRORS and field not in self . fields :
281
define the method remove_potfiles with an argument self.
def remove_potfiles ( self ) :
282
if the key doesnt exists substitute self.use_natural_keys for self.use_natural_foreign_keys. remove the 'use_natural_primary_keys' key from the options dictionary and substitute it for self.use_natural_primary_keys,
self . use_natural_primary_keys = options . pop ( 'use_natural_primary_keys' , False )
283
define the method exit_command with an argument self.
def exit_command ( self ) :
284
if max_num is None,
if max_num is None :
285
return settings.LANGUAGE_CODE.
return settings . LANGUAGE_CODE
286
define the function literals with 3 arguments: choices, prefix set to an empty string and suffix set to an empty string.
def literals ( choices , prefix = "" , suffix = "" ) :
287
if self.merge and conflicts are both true,
if self . merge and conflicts :
288
define the method __init__ with 3 arguments: self, unpacked list args and unpacked dictionary kwargs.
def __init__ ( self , * args , ** kwargs ) :
289
if attr is an instance of MovedModule.
if isinstance ( attr , MovedModule ) :
290
evaluates to true, call the function select_template with an argument file_name, substitute the result for t.
t = select_template ( file_name )
291
default string value, substitute it for value. return value if six.PY2 is true, if not return value.encode(ISO_8859_1).decode(UTF_8).
return value if six . PY2 else value . encode ( ISO_8859_1 ) . decode ( UTF_8 )
292
if ch is not equal to a sring '?' or escaped is true,
if ch != '?' or escaped :
293
return errors.
return errors
294
otherwise if domains equals a string django' and, file_ext equals '.py' or file_ext is contained in command.extensions,
elif domain == 'django' and ( file_ext == '.py' or file_ext in command . extensions ) :
295
call the method self.build_attrs with 2 arguments: attrs and name set to name, substitute the result for final_attrs.
final_attrs = self . build_attrs ( attrs , name = name )
296
crate a dictionary with app mapping and from the class Migration, created with arguments: string 'custom' and app,
changes = dict ( ( app , [ Migration ( "custom" , app ) ] ) for app in app_labels )
297
and self.regex.flags equals to other.regex.flags and self.message equals to other.message and self.code equals to other.code, and self.inverse_match equals to other.inverse_match, return the result. define the method __ne__ with arguments self and other.
def __ne__ ( self , other ) :
298
CheckboxInput, Select, NullBooleanSelect, SelectMultiple, DateInput, DateTimeInput, TimeInput, SplitDateTimeWidget, SplitHiddenDateTimeWidget and FILE_INPUT_CONTRADICTION. from django.utils import formats into default name space.
from django . utils import formats
299
substitute whitelist for self.domain_whitelist.
self . domain_whitelist = whitelist