Unnamed: 0
int64 0
10k
| nl
stringlengths 3
2.42k
| code
stringlengths 4
3.76k
|
---|---|---|
1,100 | separated with string ', ', substitute '%s' with self.sequence, substitute '%d' with length of self.nodelist_loop, substitute '%s' with reversed_text. define the method __iter__ with an argument self. | def __iter__ ( self ) : |
1,101 | define the method split_contents with an argument self. | def split_contents ( self ) : |
1,102 | call the function lazy with 2 arguments: func and resultclass, call the result with an argument, unpacked dictionary kwargs, | proxy = lazy ( func , resultclass ) ( ** kwargs ) |
1,103 | return boolean False. | return False |
1,104 | slice the path list from the result of the match.end method as the start index to the end, substitute it for new_path. | new_path = path [ match . end ( ) : ] |
1,105 | derive the class ModelForm from the base class in the return value of the method six.with_metaclass, called with 2 arguments: | class ModelForm ( six . with_metaclass ( ModelFormMetaclass , BaseModelForm ) ) : |
1,106 | call the method field.rel.to._default_manager.db_manager with an argument db on the return value call the method get_by_natural_key, | return field . rel . to . _default_manager . db_manager ( db ) . get_by_natural_key ( * value ) . pk |
1,107 | call the os.path.getsize function with argument self.file.name, return the result. | return os . path . getsize ( self . file . name ) |
1,108 | use the result as an argument for the call to the json.dumps function, return the result. define the method as_text with an argument self. | def as_ul ( self ) : |
1,109 | if not, | else : |
1,110 | substitute operator.getitem for indexbytes. | indexbytes = operator . getitem |
1,111 | if not, | else : |
1,112 | for every s_opt in parser.option_list. for every x in slice of cwords from the second element to the element at the cword decremented by 1 index, | prev_opts = [ x . split ( '=' ) [ 0 ] for x in cwords [ 1 : cword - 1 ] ] |
1,113 | call the method app_config.get_models, substitute the result fr model_list. | model_list = app_config . get_models ( ) |
1,114 | otherwise if ch is contained in string "*?+{", | elif ch in "*?+{" : |
1,115 | if resource_string is not None, | if resource_string is not None : |
1,116 | define the method __init__ with 6 arguments: self, dict_ set to None, autoescape set to True, current_app set to None, | def __init__ ( self , dict_ = None , autoescape = True , current_app = None , use_l10n = None , use_tz = None ) : |
1,117 | for every name and var in return value of the function six.iteritems called with an argument self.extra_context. if self.isolated_context is true, | if self . isolated_context : |
1,118 | from django.conf import settings into default name space. | from django . conf import settings |
1,119 | do nothing. | pass |
1,120 | define the method start_index with an argument self. | def start_index ( self ) : |
1,121 | call the function getInnerText with argument k, on the result call the method strip, for every k in keys, append the results to field_value list. | field_value = [ getInnerText ( k ) . strip ( ) for k in keys ] |
1,122 | substitute length for self._remaining. | self . _remaining = length |
1,123 | if default is true and RAISE_ERROR is false, | if default is not RAISE_ERROR : |
1,124 | if mem_args is contained in cache, | if mem_args in cache : |
1,125 | first element of bits and first element of remaining_bits. call the method parser.parse with an argument tuple, with an element string 'endwith', substitute the result for nodelist. | nodelist = parser . parse ( ( 'endwith' , ) ) |
1,126 | evaluate the self.has_key method with key as argument, return the result. | return self . has_key ( key ) |
1,127 | define the method __init__ with 7 arguments: self, data set to None, files set to None, auto_id set to an string 'id_%s', | def __init__ ( self , data = None , files = None , auto_id = 'id_%s' , prefix = None , initial = None , error_class = ErrorList ) : |
1,128 | categories is a list containing the results of the function force_text, called with an argument c, for every c in categories. | categories = [ force_text ( c ) for c in categories ] |
1,129 | from django.utils.functional import curry and Promise into default name space. | from django . utils . functional import curry , Promise |
1,130 | append string '</select>' to output. | output . append ( '</select>' ) |
1,131 | define the method get_many with 3 arguments, self class instance, keys and version set to None. | new_keys = [ self . make_key ( x , version = version ) for x in keys ] |
1,132 | if source is an instance of inst class, | if isinstance ( source , inst ) : |
1,133 | directory_created is an empty dictionary. | directory_created = { } |
1,134 | substitute auto_id for value under the 'id' key of the attrs dictionary. | attrs [ 'id' ] = auto_id |
1,135 | call the method router.db_for_write with argument self.cache_model_class, substitute the result for db. | db = router . db_for_write ( self . cache_model_class ) |
1,136 | if as_ is not equal to string 'as', | if as_ != 'as' : |
1,137 | (?P<filter_name>\w+)(?:%(arg_sep)s(?:(?P<constant_arg>%(constant)s)|(?P<var_arg>[%(var_chars)s]+|%(num)s)))?)", where 'constant' is replaced with constant_string, 'num' with raw string '[-+\.]?\d[\d\.e]*', 'var_chars' with string "\w\.", 'filter_sep' with result of the function re.escape called with an argument FILTER_SEPARATOR, anbd 'arg_sep' with result of the function re.escape called with an argument FILTER_ARGUMENT_SEPARATOR. call the function re.compile with 2 arguments: filter_raw_string and result for bitwise OR on 2 operands re.UNICODE and re.VERBOSE, | filter_re = re . compile ( filter_raw_string , re . UNICODE | re . VERBOSE ) |
1,138 | if not, | else : |
1,139 | label is a string 'label' | label = 'label' |
1,140 | substitute timeout for self.timeout. | self . timeout = timeout |
1,141 | call the method handler.addQuickElement with 3 arguments: string 'category', an empty string and a dictionary with an entry: | handler . addQuickElement ( "category" , "" , { "term" : cat } ) |
1,142 | if self.localize is true, | if self . localize : |
1,143 | derive the class Truncator form the SimpleLazyObject class. | class Truncator ( SimpleLazyObject ) : |
1,144 | where '%s' is replaced with parse_until elements joined into a string, separated with ', '. define the method compile_filter_error with 3 arguments: self, token and e. | def compile_filter_error ( self , token , e ) : |
1,145 | if ImportError, renamed to exc, exception is caught, | except ImportError as exc : |
1,146 | gett self.attr from the module object, return it. | return getattr ( module , self . attr ) |
1,147 | if not, | else : |
1,148 | old_style_list is boolean True. | old_style_list = True |
1,149 | substitute the result for value under the index key of the hextets dictionary. get the value under the index key of the hextets dictionary, if it is false, | if not hextets [ index ] : |
1,150 | call the function urlunsplit with an argument tuple with 4 elements: scheme, netloc, path, query and fragment, substitute the result for url. | url = urlunsplit ( ( scheme , netloc , path , query , fragment ) ) |
1,151 | return boolean False. | return False |
1,152 | call the method self.max_expr.resolve with an argument context, substitute the result for max_value. | max_value = self . max_expr . resolve ( context ) |
1,153 | substitute localize for self.localize. | self . localize = localize |
1,154 | call the method self.iteritems, return list of results. | return list ( self . iteritems ( ) ) |
1,155 | define the function safeseq with an argument value. | def safeseq ( value ) : |
1,156 | get the value under the key 'only' of the options dictionary, if it exists substitute the result for isolated_context, | isolated_context = options . get ( 'only' , False ) |
1,157 | call the method data.encode with 2 arguments: fp.encoding and errors, substitute the result for data. | data = data . encode ( fp . encoding , errors ) |
1,158 | define the method __wrapper__ with 3 arguments: self, unpacked list args and unpacked dictionary kw. | def __wrapper__ ( self , * args , ** kw ) : |
1,159 | define the function escape_quotes with an argument m. | def escape_quotes ( m ) : |
1,160 | finally perform, | finally : |
1,161 | from .. import Warning, register and Tags into default name space. | from . . import Warning , register , Tags |
1,162 | from django.utils.deprecation import RemovedInDjango19Warning into default name space. | from django . utils . deprecation import RemovedInDjango19Warning |
1,163 | do nothing. | pass |
1,164 | raise an exception. | raise |
1,165 | child_nodelists is a tuple with 2 initial elements: strings 'nodelist_true' and 'nodelist_false'. | child_nodelists = ( 'nodelist_true' , 'nodelist_false' ) |
1,166 | if attrvalue is not an empty string, | if attrvalue : |
1,167 | if bcc is true, | if bcc : |
1,168 | get the value under the 'indent' key of self.options dictionary, if it is true, | if self . options . get ( 'indent' ) : |
1,169 | cache is an empty dictionary. | cache = dict ( ) |
1,170 | define the method add with 5 arguments, self, key, value, timeout defaulting to DEFAULT_TIMEOUT and version defaulting to None. | def add ( self , key , value , timeout = DEFAULT_TIMEOUT , version = None ) : |
1,171 | call the method parser.delete_first_token. | parser . delete_first_token ( ) |
1,172 | call the method block_context.pop with an argument self.name, assign the result to push and block. | push = block = block_context . pop ( self . name ) |
1,173 | call the function re.compile with 2 arguments: raw string '<%s(/?>|(\s+[^>]*>))' formated with tags_re and re.U, | starttag_re = re . compile ( r'<%s(/?>|(\s+[^>]*>))' % tags_re , re . U ) |
1,174 | substitute second element of elt for param. | param = elt [ 1 ] |
1,175 | define the method emit_post_migrate with arguments verbosity, interactive and database. | def emit_post_migrate ( verbosity , interactive , database ) : |
1,176 | if ImportError exception is caught, | except ImportError : |
1,177 | append a tuple with 2 entries lang and priority to result. | result . append ( ( lang , priority ) ) |
1,178 | set attr attribute of the self object to value. | setattr ( self , attr , value ) |
1,179 | if not, | else : |
1,180 | return dictionary created out of tuple elements k and printable representation of v, | return dict ( ( k , repr ( v ) ) for k , v in module . __dict__ . items ( ) if not omittable ( k ) ) |
1,181 | format_key is a string 'DATETIME_INPUT_FORMATS'. | format_key = 'DATETIME_INPUT_FORMATS' |
1,182 | derive the class IPAddressField from the base class CharField class. | class IPAddressField ( CharField ) : |
1,183 | return self.__to_language. | return self . __to_language |
1,184 | if not, | else : |
1,185 | special_floats is an list with 3 elements, pos_inf, neg_inf and nan, all converted to strings. | special_floats = [ str ( pos_inf ) , str ( neg_inf ) , str ( nan ) ] |
1,186 | if item_date is true, | if item_date : |
1,187 | open err_log file in append mode with buffering size of the input buffer, substitute the result for sys.stderr. | sys . stderr = open ( err_log , 'a' , buffering ) |
1,188 | set opname attribute of cls object to opfunc. | setattr ( cls , opname , opfunc ) |
1,189 | define the method _should_delete_form with an argument self. | def _should_delete_form ( self , form ) : |
1,190 | call the method urlparse with an argument url, substitute the result for bits. | bits = urlparse ( url ) |
1,191 | import module os. | import os |
1,192 | from django.dispatch import Signal into default name space. | from django . dispatch import Signal |
1,193 | if middle starts with opening, | if middle . startswith ( opening ) : |
1,194 | sum bottom and self.per_page, substitute the result for top. | top = bottom + self . per_page |
1,195 | call the method os.path.splitext with an argument base, substitute the result for base and ext, respectively. | base , ext = os . path . splitext ( base ) |
1,196 | from django.utils.html import format_html, format_html_join and escape into default name space. | from django . utils . html import format_html , format_html_join , escape |
1,197 | call the method self.configure_root with an argument root. | self . configure_root ( root ) |
1,198 | call the method formfield_callback with 2 arguments: f and unpacked dictionary kwargs, substitute the result for formfield. | formfield = formfield_callback ( f , ** kwargs ) |
1,199 | if not, | else : |