Unnamed: 0
int64
0
10k
nl
stringlengths
3
2.42k
code
stringlengths
4
3.76k
900
if func is None,
if func is None :
901
join trans_bit into a string separated with whitespaces, substitute the result for bit.
bit = ' ' . join ( trans_bit )
902
derive the class ErrorList from the UserList and list base classes.
class ErrorList ( UserList , list ) :
903
call the function force_text with an argument formatstr, use the result as an argument for the call to the method,
for i , piece in enumerate ( re_formatchars . split ( force_text ( formatstr ) ) ) :
904
call the method archive.extract with arguments: filename and tempdir.
archive . extract ( filename , tempdir )
905
from django.core.mail.backends.base import BaseEmailBackend into default name space.
from django . core . mail . backends . base import BaseEmailBackend
906
form._meta.fields is a list created out of form._meta.fields elements.
form . _meta . fields = list ( form . _meta . fields )
907
call the function local, substitute the result _urlconf.
_urlconfs = local ( )
908
raise an exception.
raise
909
substitute last for value under the PREV key of the link dictionary.
link [ PREV ] = last
910
substitute unicode for text_type.
text_type = unicode
911
call the method self.unclosed_block_tag with an argument parse_until.
self . unclosed_block_tag ( parse_until )
912
substitute value under name key of handlers dictionary for handler_config.
handler_config = handlers [ name ]
913
substitute the result for value under the 'microsecond' key of the kw dictionary. remove entry under the 'tzinfo' key of the kw dictionary, substitute it for tzinfo.
tzinfo = kw . pop ( 'tzinfo' )
914
decrement self.waiting_writers by integer 1,
self . waiting_writers -= 1
915
import module os.
import os
916
call the method value.encode with an argument charset.
value . encode ( charset )
917
and help is a string 'Module paths to test; can be modulename, modulename.TestCase or modulename.TestCase.test_method'. call the method parser.add_argument with 5 arguments: string '--noinput', action set to 'store_false', dest set to 'interactive',
parser . add_argument ( '--noinput' , action = 'store_false' , dest = 'interactive' , default = True , help = 'Tells Django to NOT prompt the user for input of any kind.' ) ,
918
allow_files set to boolean True, allow_folders set to boolean False, required set to boolean True, widget set to None, label set to None, initial set to None, help_text set to an empty string, unpacked list args, unpacked dictionary kwargs. substitute path, match and recursive for self.path, self.match and self.recursive.
self . path , self . match , self . recursive = path , match , recursive
919
unpack dictionary kwargs, map it through self.attrs and convert to dictionary, substitute the result for attrs.
attrs = dict ( self . attrs , ** kwargs )
920
append label_output to output.
output . append ( label_output )
921
for every field in return value of the function _parse_date_fmt,
for field in _parse_date_fmt ( ) :
922
raise an ImportError exception.
raise ImportError
923
from __future__ import unicode_literals into default name space.
from __future__ import unicode_literals
924
call the method _isdst with an argument dt from the base class of the class LocalTimezone, return the result.
return super ( LocalTimezone , self ) . _isdst ( dt )
925
increment self.active_writers by 1.
self . active_writers += 1
926
define the method get with 4 arguments, self class instance, key, default set to None and version set to None.
def get ( self , key , default = None , version = None ) :
927
import module mimetypes.
import mimetypes
928
if password is None substitute settings.EMAIL_HOST_PASSWORD for self.username, if not substitute password for self.password.
self . password = settings . EMAIL_HOST_PASSWORD if password is None else password
929
call the function new_method_proxy with an argument bool, substitute the result for __bool__.
__bool__ = new_method_proxy ( bool )
930
if not,
else :
931
if not,
else :
932
get _assertCountEqual attribute of the self object, call the result with 2 arguments: unpacked list args,
return getattr ( self , _assertCountEqual ) ( * args , ** kwargs )
933
raise an base.DeserializationError exception with an argument string "Invalid model identifier: '%s'", where '%s' is replaced with model_identifier.
raise base . DeserializationError ( "Invalid model identifier: '%s'" % model_identifier )
934
where '%s' is replaced with final_path and base_path. return final_path.
return final_path
935
return an empty string.
return ''
936
call the method out.getvalue, return the result.
return out . getvalue ( )
937
call the function post_callback with an argument retval, substitute the result for newretval.
newretval = post_callback ( retval )
938
if not,
else :
939
call the method s.render with 3 arguments: field string formated with name, val and local_attrs, substitute the result for select_html.
select_html = s . render ( field % name , val , local_attrs )
940
call the force_str function with an argument value, substitute the result for value.
value = force_str ( value )
941
derive the class SafeMIMEMultipart from the MIMEMixin and MIMEMultipart base class.
class SafeMIMEMultipart ( MIMEMixin , MIMEMultipart ) :
942
call the method context.render_context.push.
context . render_context . push ( )
943
try,
try :
944
decorator function register.filter with an argument is_safe set to boolean False.
@ register . filter ( is_safe = False )
945
split s into parts by '.', substitute the result for name.
name = s . split ( '.' )
946
and help set to 'Fixture labels.'. call the method parser.add_argument with 5 arguments: string '--database', action set to string 'store', dest as a string 'database',
parser . add_argument ( '--database' , action = 'store' , dest = 'database' , default = DEFAULT_DB_ALIAS , help = 'Nominates a specific database to load ' 'fixtures into. Defaults to the "default" database.' )
947
define the method __init__ with 3 arguments: self, value and text.
def __init__ ( self , value , text ) :
948
define the function add_metaclass with an argument metaclass.
def add_metaclass ( metaclass ) :
949
return boolean False.
return False
950
derive the class Library form the base class object.
class Library ( object ) :
951
if character is not equal to a string '.',
if character != '.' :
952
raise an base.DeserializationError exception with an argument string "<%s> node has invalid model identifier: '%s'",
raise base . DeserializationError ( "<%s> node has invalid model identifier: '%s'" % ( node . nodeName , model_identifier ) )
953
return commands.
return commands
954
if not,
else :
955
call the field.to_python method with field_value, substitute the result for field.name key of the data dictionary.
data [ field . name ] = field . to_python ( field_value )
956
try,
try :
957
derive the class Operator from the base class TokenBase.
class Operator ( TokenBase ) :
958
define the method resolve_expression with 3 arguments: self, obj and context.
def resolve_expression ( self , obj , context ) :
959
derive the class HttpResponseGone from the HttpResponse base class.
class HttpResponseGone ( HttpResponse ) :
960
return an instance of SafeBytes, created with an argument t.
return SafeBytes ( t )
961
if commit is true and form has an attribute 'save_m2m',
if commit and hasattr ( form , 'save_m2m' ) :
962
define the method render with 5 arguments: self, name, value, attrs set to None and choices set to an empty tuple.
def render ( self , name , value , attrs = None , choices = ( ) ) :
963
call the self.get_dum_object method with an argument obj, use the result as an argument for the self.objects.append method.
self . objects . append ( self . get_dump_object ( obj ) )
964
call the function new_method_proxy with an argument operator.ne, substitute the result for __ne__.
__ne__ = new_method_proxy ( operator . ne )
965
return self.
return self
966
substitute length of values for len_values.
len_values = len ( values )
967
self._raw_ipv6 is boolean True.
self . _raw_ipv6 = True
968
if ImportError exception is caught.
except ImportError :
969
return obj.
return obj
970
from .html_parser import HTMLParser and HTMLParseError into default name space.
from . html_parser import HTMLParser , HTMLParseError
971
decorator function register.filter with an argument is_safe set to boolean True.
@ register . filter ( is_safe = True )
972
get the value under the LANGUAGE_SESSION_KEY key of the request.session dictionary, substitute it for lang_code.
lang_code = request . session . get ( LANGUAGE_SESSION_KEY )
973
define the function linenumbers with 2 arguments value and autoescape set to None.
def linenumbers ( value , autoescape = None ) :
974
substitute value for self.value.
self . value = value
975
if self doesnt have '_queryset' attribute,
if not hasattr ( self , '_queryset' ) :
976
substitute new_filenames for filelist.
filelist = new_filenames
977
try,
try :
978
string "%s already exists, overlaying a project or app into an existing directory won't replace conflicting files", where '%s" is replaced with new_path. open old_path file in 'rb' mode, with file descriptor renamed to template_file,
with open ( old_path , 'rb' ) as template_file :
979
import module struc.
import struct
980
from django.utils.six import StringIO into default name space.
from django . utils . six import StringIO
981
return EventHandler.modified_code.
return EventHandler . modified_code
982
substitute takes_context for self.takes_context.
self . takes_context = takes_context
983
from __future__ import absolute_import into default name space.
from __future__ import absolute_import
984
sort the result and substitute it for options. for every option in options,
for option in options :
985
value is None.
value = None
986
try,
try :
987
substitute TemplateDoesNotExist for self.find_template_cache dictionary value under the key key.
self . template_cache [ key ] = TemplateDoesNotExist
988
call the function become_daemon with 2 arguments: our_home_dir set to the value under the 'workdir' key of options dictionary and,
become_daemon ( our_home_dir = options [ "workdir" ] , ** daemon_kwargs )
989
derive the class TemplateSyntaxError form the base class Exception.
class TemplateSyntaxError ( Exception ) :
990
define the method __len__ with an argument self.
def __len__ ( self ) :
991
ns_pattern is an empty string.
ns_pattern = ''
992
month_field is a string '%s_month'.
month_field = '%s_month'
993
if self.parsed is true,
if self . parsed :
994
call the function func with unpacked dictionary kwargs as an argument, substitute the result for translated.
translated = func ( ** kwargs )
995
substitute return value of call to the function _set_response_etag with response as an argument, for response.
response = _set_response_etag ( response )
996
return an empty string.
return ''
997
call the function predicate with an argument item, use it as a key to get results dictionary value, append item to it.
results [ predicate ( item ) ] . append ( item )
998
if attr equals any of the strings "__file__", "__name__" or "__path__" and self.mod is not contained in sys.modules,
if ( attr in ( "__file__" , "__name__" , "__path__" ) and self . mod not in sys . modules ) :
999
extend errors list with e.error_list.
errors . extend ( e . error_list )