Muennighoff/xP3x-sample huggingface dataset:
inputs: def __init__(self, command, new_max_window = True, title = None, white_bg = False) : 
    'Constructor.

        :param iter command: Command to run.
        :param bool new_max_window: Start process in new console window, maximized.
        :param bool white_bg: New console window will be black text on white background.
        :param bytes title: Set new window title to this.
        ' 
    if (title is None) : 
        title = 'pytest-{0}-{1}'.format (os.getpid (), random.randint (1000, 9999)).encode ('ascii') 
self.startup_info = StartupInfo (new_max_window = new_max_window, title = <MASK>, white_bg = white_bg) 
    self.process_info = ProcessInfo () 
    self.command_str = subprocess.list2cmdline (command).encode ('ascii') 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, command, title, white_bg, new_max_window
targets: title
inputs: def _get_predict_end(self, end, dynamic = False) : 
    '
        Returns last index to be forecast of the differenced array.
        Handling of inclusiveness should be done in the predict function.
        ' 
    (end, out_of_sample) = super (ARIMA, self)._get_predict_end (end, dynamic) 
    if (('mle' not in self.method) and (not dynamic)) : 
        end -= self.k_ar 
return ((end - self.k_diff), <MASK>) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: out_of_sample
inputs: def _save_flavor(self, context) : 
    if (not any ([(x in self.obj_what_changed ()) for x in ('flavor', 'old_flavor', 'new_flavor')])) : 
        return 
flavor_info = { 
        'cur' : self.flavor.obj_to_primitive (), 
        'old' : ((self.old_flavor and self.old_flavor.obj_to_primitive ()) or None), 
        'new' : ((self.new_flavor and self.new_flavor.obj_to_primitive ()) or None), 
} 
    db.instance_extra_update_by_uuid (context, self.uuid, { 
        'flavor' : jsonutils.dumps (flavor_info), 
}) 
    self.obj_reset_changes (['flavor', 'old_flavor', 'new_flavor']) 

Is there a bug in the code above?
targets: No
inputs: def calculate_text_segments(self, text, width, wrap) : 
    '
        Calculate the segments of text to display given width screen
        columns to display them.

        text - unicode text or byte string to display
        width - number of available screen columns
        wrap - wrapping mode used

        Returns a layout structure without alignment applied.
        ' 
    (nl, nl_o, sp_o) = ('
', '
', ' ') 
    if (PYTHON3 and isinstance (text, bytes)) : 
        nl = B (nl) 
        nl_o = ord (nl_o) 
        sp_o = ord (sp_o) 
b = [] 
    p = 0 
    if (wrap == 'clip') : 
        while (p <= len (text)) : 
            n_cr = text.find (nl, p) 
            if (n_cr == (- 1)) : 
                n_cr = len (text) 
sc = calc_width (text, p, n_cr) 
            l = [(0, n_cr)] 
            if (p != n_cr) : 
                l = ([(sc, p, n_cr)] + l) 
b.append (l) 
            p = (n_cr + 1) 
return b 
while (p <= len (text)) : 
        n_cr = text.find (nl, p) 
        if (n_cr == (- 1)) : 
            n_cr = len (<MASK>) 
sc = calc_width (text, p, n_cr) 
        if (sc == 0) : 
            b.append ([(0, n_cr)]) 
            p = (n_cr + 1) 
            continue 
if (sc <= width) : 
            b.append ([(sc, p, n_cr), (0, n_cr)]) 
            p = (n_cr + 1) 
            continue 
(pos, sc) = calc_text_pos (text, p, n_cr, width) 
        if (pos == p) : 
            raise CanNotDisplayText ('Wide character will not fit in 1-column width') 
if (wrap == 'any') : 
            b.append ([(sc, p, pos)]) 
            p = pos 
            continue 
assert (wrap == 'space') 
        if (text [pos] == sp_o) : 
            b.append ([(sc, p, pos), (0, pos)]) 
            p = (pos + 1) 
            continue 
if is_wide_char (text, pos) : 
            b.append ([(sc, p, pos)]) 
            p = pos 
            continue 
prev = pos 
        while (prev > p) : 
            prev = move_prev_char (text, p, prev) 
            if (text [prev] == sp_o) : 
                sc = calc_width (text, p, prev) 
                l =...
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: sc, p, wrap, prev, p_end, p_sc, nl_o, self, h_off, h_sc, width, text, next, l, p_off, pos, sp_o, b, nl, n_cr
targets: text
inputs: def auth_app_id(self, app_id, user_id, mount_point = 'app-id', use_token = True) : 
    '
        POST /auth/<mount point>/login
        ' 
    params = { 
        'app_id' : app_id, 
        'user_id' : user_id, 
} 
    return self.auth ('/v1/auth/{0}/login'.format (mount_point), json = params, use_token = app_id) 

    
    

    Fix the buggy line: return self.auth ('/v1/auth/{0}/login'.format (mount_point), json = params, use_token = app_id)
targets: return self.auth ('/v1/auth/{0}/login'.format (mount_point), json = params, use_token = use_token)
inputs: @ register (return_type = date, args = (date,)) 
@ register ('next_month_dt', return_type = datetime, args = (datetime,)) 
def next_month(d) : 
    if (not d) : 
        return None 
month = (year.month + 1) 
    year = d.year 
    if (month > 12) : 
        month = (((d.month - 1) % 12) + 1) 
        year += 1 
return d.replace (year = year, month = month) 

    
    

    Fix the buggy line: month = (year.month + 1)
targets: month = (d.month + 1)
inputs: @ register.inclusion_tag ('zinnia/tags/dummy.html', takes_context = True) 
def zinnia_breadcrumbs(context, root_name = _ ('Blog'), template = 'zinnia/tags/breadcrumbs.html') : 
    '
    Return a breadcrumb for the application.
    ' 
    path = context ['request'].path 
    context_object = get_context_first_object (context, ['object', 'category', 'tag', 'author']) 
    context_page = context.get ('page_obj') 
    breadcrumbs = retrieve_breadcrumbs (path, context_object, context_page, root_name) 
    return { 
        'template' : <MASK>, 
        'breadcrumbs' : breadcrumbs, 
} 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: path, context, context_object, breadcrumbs, context_page, template, root_name
targets: template
inputs: def close_revision(self, revisionid) : 
    "Set an existing Differential revision to 'closed'.

        :revisionid: id of the Differential revision to close
        :returns: None

        " 
    revision = self._data.get_revision (revisionid) 
    assert revision.is_accepted () 
    revision.set_closed () 
    self._data.set_changed () 

Is there a bug in the code above?
targets: No
inputs: def __init__(self, * args, **kwargs) : 
    defaults = { 
        'min_value' : self.min_value, 
} 
    defaults.update (kwargs) 
    super (PositiveIntegerField, self).__init__ (** defaults) 

Is there a bug in the code above?
targets: No
inputs: @ pytest.mark.parametrize ('key, field, index, value, expected', [(('test', 'demo', 1), 'contact_no', 5, 1000, { 
    'city' : ['Pune', 'Dehli'], 
    'contact_no' : [1, 2, None, None, None, 1000], 
    'name' : 'name1', 
}), (('test', 'demo', 1), 'contact_no', 5, [500, 1000], { 
    'city' : ['Pune', 'Dehli'], 
    'contact_no' : [1, 2, None, None, None, [500, 1000]], 
    'name' : 'name1', 
}), (('test', 'demo', 1), 'contact_no', 5, 'string', { 
    'city' : ['Pune', 'Dehli'], 
    'contact_no' : [1, 2, None, None, None, 'string'], 
    'name' : 'name1', 
}), (('test', 'demo', 1), 'contact_no', 5, 45.896, { 
    'city' : ['Pune', 'Dehli'], 
    'contact_no' : [1, 2, None, None, None, 45.896], 
    'name' : 'name1', 
}), (('test', 'demo', 1), 'contact_no', 5, False, { 
    'city' : ['Pune', 'Dehli'], 
    'contact_no' : [1, 2, None, None, None, 0], 
    'name' : 'name1', 
}), (('test', 'demo', 1), 'contact_no', 0, bytearray ("asd;as[d'as;d", 'utf-8'), { 
    'contact_no' : [bytearray (b"asd;as[d'as;d"), 2], 
    'city' : ['Pune', 'Dehli'], 
    'name' : 'name1', 
})]) 
def test_pos_list_set_with_elements(self, key, field, index, value, expected) : 
    '
        Invoke list_set() sets
        ' 
    status = self.as_connection.list_set (key, field, index, expected) 
    assert (status == 0) 
    (key, _, bins) = self.as_connection.get (key) 
    assert (bins == expected) 

Is there a bug in the code above?
targets: Yes
inputs: def _on_nick(self, c, e) : 
    '[Internal]' 
    before = nm_to_n (e.source ()) 
    after = e.target () 
    for ch in self.channels.values () : 
        if ch.has_user (before) : 
            ch.change_nick (before, <MASK>) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: e, self, after, c, before, ch
targets: after
inputs: def allocate(self, shared_outputs = None) : 
    if (self.outputs is None) : 
        self.outputs = self.be.iobuf (shared_outputs.out_shape, shared = shared_outputs, parallelism = self.parallelism) 
self.output_views = self.get_partitions (self.outputs, self.slices) 
    for (l, out_view) in zip (self.layers, self.output_views) : 
        l.allocate (shared_outputs = out_view) 

    
    

    Fix the buggy line: self.outputs = self.be.iobuf (shared_outputs.out_shape, shared = shared_outputs, parallelism = self.parallelism)
targets: self.outputs = self.be.iobuf (self.out_shape, shared = shared_outputs, parallelism = self.parallelism)
inputs: @ pytest.fixture (autouse = True) 
def setup(self, request, as_connection) : 
    keys = [] 
    for i in range (5) : 
        key = ('test', 'demo', i) 
        rec = { 
            'name' : ('name%s' % str (i)), 
            'contact_no' : [i, (i + 1)], 
            'city' : ['Pune', 'Dehli'], 
} 
        as_connection.put (key, rec) 
        keys.append (key) 
def teardown() : 
        '
            Teardown method.
            ' 
        for key in keys : 
            try : 
                as_connection.remove (key) 
except e.RecordNotFound : 
                pass 
request.addfinalizer (<MASK>) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: def teardown(
inputs: @ classmethod 
def make_instance(typeclass, cls, toEnum, fromEnum) : 
    def succ(a) : 
        return toEnum ((fromEnum (a) + 1)) 
def pred(a) : 
        return toEnum ((fromEnum (a) - 1)) 
def enumFromThen(start, second) : 
        pointer = fromEnum (start) 
        step = (fromEnum (second) - pointer) 
        while True : 
            (yield toEnum (pointer)) 
            pointer += step 
def enumFrom(start) : 
        return enumFromThen (start, succ (start)) 
def enumFromThenTo(start, second, end) : 
        if (start == end) : 
            (yield start) 
            return 
else : 
            if ((second >= start > end) or (second <= start < end)) : 
                return 
(pointer, stop) = (fromEnum (start), fromEnum (end)) 
        step = (fromEnum (second) - pointer) 
        while (((start < end) and (pointer <= stop)) or ((start > end) and (pointer >= stop))) : 
            (yield toEnum (pointer)) 
            pointer += step 
return 
def enumFromTo(start, end) : 
        second = (succ (start) if (start < end) else pred (start)) 
        return enumFromThenTo (start, second, end) 
attrs = { 
        'toEnum' : toEnum, 
        'fromEnum' : fromEnum, 
        'succ' : succ, 
        'pred' : pred, 
        'enumFromThen' : enumFromThen, 
        'enumFrom' : enumFrom, 
        'enumFromThenTo' : <MASK>, 
        'enumFromTo' : enumFromTo, 
} 
    build_instance (Enum, cls, attrs) 
    return 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: cls, enumFromThenTo, pred, fromEnum, attrs, toEnum, enumFromThen, enumFrom, succ, enumFromTo, typeclass
targets: enumFromThenTo
inputs: def setUp(self) : 
    self.original_template_debug = settings.TEMPLATE_DEBUG 
    settings.TEMPLATE_DEBUG = True 
    self.client.login (username = 'super', password = 'secret') 
    e = Episode.objects.create (name = 'This Week in Django') 
    self.episode_pk = e.pk 
    m = Media (content_object = e, url = 'http://example.com/podcast.mp3') 
    m.save () 
    self.mp3_media_pk = m.pk 
    m = Media (content_object = <MASK>, url = 'http://example.com/logo.png') 
    m.save () 
    self.png_media_pk = m.pk 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: m, e, self
targets: e
inputs: def __init__(self, monitor, query_duration) : 
    'Constructor.

    Args:
      monitor: instance of ProgressMonitor that is watching the checksum job.
      query_duration: desired duration of a single checksum query.
    ' 
    self._monitor = monitor 
    self._query_duration = <MASK> 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: monitor, query_duration, self
targets: query_duration
inputs: @ test.create_stubs ({ 
    api.lbaas : ('pool_list', 'member_list', 'pool_health_monitor_list', 'member_delete'), 
}) 
def test_delete_member(self) : 
    self.set_up_expect () 
    member = self.members.first () 
    api.lbaas.member_delete (IsA (http.HttpRequest), member.id) 
    self.mox.ReplayAll () 
    form_data = { 
        'action' : ('memberstable__deletemember__%s' % member.id), 
} 
    res = self.client.post (self.INDEX_URL, <MASK>) 
    self.assertNoFormErrors (res) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: form_data
inputs: @ dispatch (USub) 
def _print_python(expr, leaves = None) : 
    (child, scope) = print_python (leaves, expr._child) 
    return (('%s%s' % (expr.symbol, parenthesize (child))), scope) 

Is there a bug in the code above?
targets: No
inputs: def __get_network(conn, vm_) : 
    '
    Return a GCE libcloud network object with matching name
    ' 
    network = config.get_cloud_config_value ('network', vm_, __opts__, default = 'default', search_global = False) 
    return conn.ex_get_network (vm_) 

    
    

    Fix the buggy line: return conn.ex_get_network (vm_)
targets: return conn.ex_get_network (network)
inputs: def cleanup_subject(subject_str) : 
    "Returns a cleaned up string.
    For instance, 'Re: Re: Re: Birthday party' becomes 'Birthday party'" 
    cleanup_regexp = '^((Re:|RE:|fwd:|FWD:)\\s+)+' 
    return re.sub (subject_str, '', subject_str) 

    
    

    Fix the buggy line: return re.sub (subject_str, '', subject_str)
targets: return re.sub (cleanup_regexp, '', subject_str)
inputs: def base_definition_post_save(sender, instance, created, raw, **kwargs) : 
    declared_fields = instance.get_declared_fields () 
    if declared_fields : 
        model_class = instance.model_def.model_class ().render_state () 
        opts = model_class._meta 
        if created : 
            add_columns = popattr (instance._state, '_add_columns', True) 
            if add_columns : 
                auto_pk = isinstance (opts.pk, models.AutoField) 
                for field in declared_fields : 
                    field.model = <MASK> 
                    remote_field = get_remote_field (field) 
                    if (auto_pk and remote_field and remote_field.parent_link) : 
                        auto_pk = False 
                        field.primary_key = True 
                        perform_ddl ('alter_field', model_class, opts.pk, field, strict = True) 
else : 
                        perform_ddl ('add_field', model_class, field) 
else : 
            for field in declared_fields : 
                try : 
                    old_field = opts.get_field (field.name) 
except FieldDoesNotExist : 
                    perform_ddl ('add_field', model_class, field) 
else : 
                    perform_ddl ('alter_field', model_class, old_field, field, strict = True) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: raw, created, model_class, auto_pk, remote_field, instance, opts, declared_fields, old_field, add_columns, sender, field
targets: model_class
inputs: def _build_table_from_costs(trans_cost, penalty) : 
    cost = np.zeros (penalty.shape) 
    prev_node = np.zeros (penalty.shape) 
    cost [:, 0] = penalty [:, 0] 
    for l in xrange (1, penalty.shape [1]) : 
        tc = ((penalty [:, l] + <MASK>) + cost [:, (l - 1)] [:, np.newaxis]) 
        min_nodes = __fast_argmin_axis_0 (tc) 
        min_vals = np.amin (tc, axis = 0) 
        cost [:, l] = min_vals 
        prev_node [:, l] = min_nodes 
return (cost, prev_node) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: trans_cost
inputs: def __init__(self, model = None, query = None, using = None, position_field_name = 'position', hints = None) : 
    super (PositionQuerySet, self).__init__ (model, query, model) 
    self.position_field_name = position_field_name 

Is there a bug in the code above?
targets: Yes
inputs: def __init__(self, vdm, offlineCache) : 
    Stoppable.Stoppable.__init__ (self) 
    self.dependencies_ = TwoWaySetMap.TwoWaySetMap () 
    self.vdm_ = vdm 
    self.offlineCache_ = <MASK> 
    self.finishedValues_ = { 
        
} 
    self.intermediates_ = { 
        
} 
    self.lock_ = threading.RLock () 
    self.completable_ = Queue.Queue () 
    self.timesComputed = 0 
    self.computingContexts_ = { 
        
} 
    self.computingContexts_t0_ = { 
        
} 
    self.isSplit_ = set () 
    self.watchers_ = { 
        
} 
    self.contexts_ = [] 
    self.inProcessDownloader = OutOfProcessDownloader.OutOfProcessDownloaderPool (Setup.config ().cumulusServiceThreadCount, actuallyRunOutOfProcess = False) 
    self.threads_ = [] 
    self.isActive = True 
    for threadIx in range (Setup.config ().cumulusServiceThreadCount) : 
        workerThread = ManagedThread.ManagedThread (target = self.threadWorker) 
        workerThread.start () 
        self.threads_.append (workerThread) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: offlineCache
inputs: def _resize(self, size) : 
    GL.glViewport (0, 0, size.x, <MASK>.y) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, size
targets: size
inputs: def set_font_weight(self, font_weight) : 
    self._attributes ['font-weight'] = self 

    
    

    Fix the buggy line: self._attributes ['font-weight'] = self
targets: self._attributes ['font-weight'] = font_weight
inputs: def _buildSequenceUnpacking(provider, node, source_ref) : 
    kind = getKind (node) 
    if (kind == 'List') : 
        return buildListUnpacking (provider, node.elts, source_ref) 
else : 
        if (kind == 'Tuple') : 
            return _buildTupleUnpacking (provider, node.elts, source_ref) 
else : 
            if (kind == 'Set') : 
                return _buildSetUnpacking (provider, node.elts, source_ref) 
else : 
                assert False, provider 

    
    

    Fix the buggy line: assert False, provider
targets: assert False, kind
inputs: def addItem(self, itemName, imageOrImageFileName = None) : 
    self._qtWidget ().addItem (itemName) 
    if (not (imageOrImageFileName is None)) : 
        self.setIcon ((self.getTotal () - 1), <MASK>) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: itemName, self, imageOrImageFileName
targets: imageOrImageFileName
inputs: @ classmethod 
def from_repo_id_and_coordinates(cls, repo_id, coordinates) : 
    "

        :param repo_id:
        :param coordinates: e.g. 'com.fooware:foo:1.0.0'
        :return:
        " 
    fields = coordinates.split (':') 
    if (len (fields) < 3) : 
        raise ArtifactError ('Incorrect coordinates, at least group, artifact and version are obligatory') 
(group, artifact, version) = (fields [0], fields [1], fields [2]) 
    classifier = extension = '' 
    if (len (fields) > 3) : 
        classifier = fields [3] 
if (len (fields) > 4) : 
        extension = fields [4] 
return cls (group = group, artifact = artifact, version = version, classifier = classifier, extension = extension, repo_id = cls) 

Is there a bug in the code above?
targets: Yes
inputs: @ wrap_exceptions 
def get_connections(self, kind = 'inet') : 
    'Return etwork connections opened by a process as a list of
        namedtuples.
        ' 
    if (kind not in conn_tmap) : 
        raise ValueError (('invalid %r kind argument; choose between %s' % (<MASK>, ', '.join ([repr (x) for x in conn_tmap])))) 
(families, types) = conn_tmap [kind] 
    ret = _psutil_osx.get_process_connections (self.pid, families, types) 
    return [nt_connection (* conn) for conn in ret] 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: kind
inputs: def make_release(pkg_path, output_path) : 
    with qisys.sh.TempDir () as tmp_path : 
        qisys.archive.extract (pkg_path, tmp_path, algo = 'zip', strict_mode = False) 
        _compile_python_files (tmp_path) 
        _update_python_services (pkg_path) 
        qisys.archive.compress (tmp_path, output = output_path, flat = True, display_progress = True) 
ui.info (ui.green, 'Package compiled to', ui.reset, ui.bold, output_path) 

    
    

    Fix the buggy line: _update_python_services (pkg_path)
targets: _update_python_services (tmp_path)
inputs: @ classmethod 
def get_asked(cls, user) : 
    "Returns the user's outstanding asked question, if any.

        Args:
            user: datastore_types.IM: The identity of the user asking.

        Returns:
            An unanswered Question entity asked by the user, or None if there
                are no unanswered questions.
        " 
    query = cls.query ((cls.asker == user), (query.answer == None)) 
    return query.get () 

    
    

    Fix the buggy line: query = cls.query ((cls.asker == user), (query.answer == None))
targets: query = cls.query ((cls.asker == user), (cls.answer == None))
inputs: def Int32ByteSize(field_number, int32) : 
    return Int64ByteSize (field_number, int32) 

Is there a bug in the code above?
targets: No
inputs: def cleanup_temporary_directories(self) : 
    'Delete the build directories and any temporary directories created by pip.' 
    while <MASK>.build_directories : 
        shutil.rmtree (self.build_directories.pop ()) 
for requirement in self.reported_requirements : 
        requirement.remove_temporary_source () 
while self.eggs_links : 
        symbolic_link = self.eggs_links.pop () 
        if os.path.islink (symbolic_link) : 
            os.unlink (symbolic_link) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: symbolic_link, self, requirement
targets: self
inputs: @ property 
def child_growth_monitored_22_24(self) : 
    return len ([c for c in self.all_cases if c.child_growth_calculated_in_window (24)]) 

Is there a bug in the code above?
targets: No
inputs: def ByteSize(self) : 
    n = 0 
    n += (1 * len (self.image_)) 
    for i in xrange (len (self.image_)) : 
        n += self.lengthString (self.image_ [i].ByteSize ()) 
n += (1 * len (<MASK>.options_)) 
    for i in xrange (len (self.options_)) : 
        n += self.lengthString (self.options_ [i].ByteSize ()) 
n += self.lengthString (self.canvas_.ByteSize ()) 
    return (n + 1) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, n, i
targets: self
inputs: def writeToChild(self, childFD, data) : 
    if (<MASK> == 0) : 
        self.write (data) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: data, childFD, self
targets: childFD
inputs: def do515(self, irc, msg) : 
    self.channels.append (msg.args [1]) 

Is there a bug in the code above?
targets: No
inputs: @ require_POST 
@ xframe_options_sameorigin 
def del_image_async(request, image_id) : 
    'Delete an image given its object id.' 
    user = request.user 
    if (not user.is_authenticated ()) : 
        message = _ ('You are not logged in.') 
        return HttpResponseForbidden (json.dumps ({ 
            'status' : 'error', 
            'message' : message, 
})) 
try : 
        image = ImageAttachment.objects.get (pk = image_id) 
except ImageAttachment.DoesNotExist : 
        message = _ ('The requested image could not be found.') 
        return HttpResponseNotFound (json.dumps ({ 
            'status' : 'error', 
            'message' : message, 
})) 
if (not ((user == image.creator) or user.has_perm ('upload.delete_imageattachment'))) : 
        message = _ ('You do not have permission to do that.') 
        return HttpResponseForbidden (json.dumps ({ 
            'status' : 'error', 
            'message' : message, 
})) 
image.file.delete () 
    if image.thumbnail : 
        image.thumbnail.delete () 
image.delete () 
    return HttpResponse (json.dumps ({ 
        'status' : 'success', 
})) 

Is there a bug in the code above?
targets: No
inputs: @ click.command () 
@ click.argument ('identifier') 
@ click.option ('--hard/--soft', default = None, help = 'Perform a hard or soft reboot') 
@ environment.pass_env 
def reboot(env, identifier, hard) : 
    'Reboot an active virtual server.' 
    virtual_guest = <MASK>.client ['Virtual_Guest'] 
    mgr = SoftLayer.HardwareManager (env.client) 
    vs_id = helpers.resolve_id (mgr.resolve_ids, identifier, 'VS') 
    if (not (env.skip_confirmations or formatting.confirm (('This will reboot the VS with id %s. Continue?' % vs_id)))) : 
        raise exceptions.CLIAbort ('Aborted.') 
if (hard is True) : 
        virtual_guest.rebootHard (id = vs_id) 
else : 
        if (hard is False) : 
            virtual_guest.rebootSoft (id = vs_id) 
else : 
            virtual_guest.rebootDefault (id = vs_id) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: env
inputs: @ defun_wrapped 
def laguerre(ctx, n, a, z, **kwargs) : 
    def h(a) : 
        return (([], [], [((a + n) + 1)], [(a + 1), (n + 1)], [(- n)], [(a + 1)], z),) 
return ctx.hypercomb (h, [a], ** kwargs) 

Is there a bug in the code above?
targets: No
inputs: def clear_usersettings_cache(sender, **kwargs) : 
    '
    Clears the cache (if primed) each time a ``UserSettings`` is saved or deleted
    ' 
    instance = kwargs ['instance'] 
    try : 
        del USERSETTINGS_CACHE [sender.site.pk] 
except KeyError : 
        pass 

    
    

    Fix the buggy line: del USERSETTINGS_CACHE [sender.site.pk]
targets: del USERSETTINGS_CACHE [instance.site.pk]
inputs: @ property 
@ memoized 
def location(self) : 
    parent_id = self.request.GET.get ('parent') 
    parent = (get_document_or_404 (Location, self.domain, parent_id) if parent_id else None) 
    return Location (domain = <MASK>.domain, parent = parent) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: parent_id, self, parent
targets: self
inputs: def __init__(self, contents, typeinfos) : 
    self._buffer = BitPackedBuffer (contents) 
    self._typeinfos = typeinfos 
    self._markers = [] 
    self._json = { 
        
} 

Is there a bug in the code above?
targets: No
inputs: def __rdiv__(self, other) : 
    return self.invert ().__mul__ (self) 

    
    

    Fix the buggy line: return self.invert ().__mul__ (self)
targets: return self.invert ().__mul__ (other)
inputs: def NextToken(self) : 
    'Fetch the next token by trying to match any of the regexes in order.' 
    if (not self.buffer) : 
        return 
current_state = self.state 
    for token in self._tokens : 
        if (token.state_regex and (not token.state_regex.match (current_state))) : 
            continue 
if self.verbose : 
            logging.debug ('%s: Trying to match %r with %r', self.state, self.buffer [: 10], token.re_str) 
m = token.regex.match (self.buffer) 
        if (not m) : 
            continue 
if self.verbose : 
            logging.debug ('%s matched %s', token.re_str, m.group (0)) 
if (m.end () == 0) : 
            raise RuntimeError ('Lexer bug! Token can not match the empty string.') 
self.processed_buffer += self.buffer [: m.end ()] 
        self.buffer = self.buffer [m.end () :] 
        self.processed += m.end () 
        next_state = token.next_state 
        for action in token.actions : 
            if self.verbose : 
                logging.debug ('Calling %s with %s', action, m.group (0)) 
cb = getattr (self, action, self.Default) 
            try : 
                possible_next_state = cb (string = m.group (0), match = m) 
                if (<MASK> == 'CONTINUE') : 
                    continue 
else : 
                    if possible_next_state : 
                        next_state = possible_next_state 
except ParseError as e : 
                self.Error (e) 
if next_state : 
            self.state = next_state 
return token 
self.Error (('Lexer stuck at state %s' % self.state)) 
    self.processed_buffer += self.buffer [: 1] 
    self.buffer = self.buffer [1 :] 
    return 'Error' 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, m, action, current_state, token, cb, next_state, possible_next_state, e
targets: possible_next_state
inputs: def __rmod__(self, value) : 
    return self.clone ((value % <MASK>._value)) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: value, self
targets: self
inputs: def test_set_ip_range(self) : 
    ng_names = (consts.NETWORKS.management, consts.NETWORKS.storage, consts.NETWORKS.private) 
    for (idx, ng_name) in enumerate (ng_names) : 
        data = self.env.neutron_networks_get (self.cluster.id).json_body 
        ng_data = filter ((lambda ng : (ng ['name'] == ng_name)), data ['networks']) [0] 
        net_template = '99.61.{0}'.format (idx) 
        ng_data ['cidr'] = (net_template + '.0/24') 
        ng_data ['gateway'] = (net_template + '.1') 
        ng_data ['meta'] ['notation'] = consts.NETWORK_NOTATION.ip_ranges 
        ng_data ['ip_ranges'] = [[(net_template + '.11'), (net_template + '.33')], [(net_template + '.55'), (net_template + '.99')]] 
        resp = self.env.neutron_networks_put (self.cluster.id, data) 
        self.assertEqual (200, resp.status_code) 
        self.db.refresh (self.cluster) 
        ng_db = filter ((lambda ng : (ng.name == ng_name)), self.cluster.network_groups) [0] 
        self.assertEqual (ng_db.cidr, (net_template + '.0/24')) 
        self.assertEqual (ng_db.meta ['notation'], consts.NETWORK_NOTATION.ip_ranges) 
        self.assertEqual (ng_db.ip_ranges [0].first, (net_template + '.11')) 
        self.assertEqual (ng_db.ip_ranges [0].last, (net_template + '.33')) 
        self.assertEqual (ng_name.ip_ranges [1].first, (net_template + '.55')) 
        self.assertEqual (ng_db.ip_ranges [1].last, (net_template + '.99')) 

    
    

    Fix the buggy line: self.assertEqual (ng_name.ip_ranges [1].first, (net_template + '.55'))
targets: self.assertEqual (ng_db.ip_ranges [1].first, (net_template + '.55'))
inputs: def _RetainVerticalSpacingBeforeComments(uwline) : 
    'Retain vertical spacing before comments.' 
    prev_token = None 
    for tok in <MASK>.tokens : 
        if (tok.is_comment and prev_token) : 
            if (((tok.lineno - tok.value.count ('
')) - prev_token.lineno) > 1) : 
                tok.AdjustNewlinesBefore (ONE_BLANK_LINE) 
prev_token = tok 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: uwline
inputs: @ c.cacheproperty 
def dlopen(self) : 
    if (not self.header) : 
        return 
lib_code = '
            #ifdef __cplusplus
            extern "C" {
            #endif
            #if defined _WIN32 || defined __CYGWIN__
            __declspec(dllexport)
            #elif defined __GNUC__
            __attribute__ ((visibility ("default")))
            #endif
            int fred(int argc, char** argv) { return 0; }
            #ifdef __cplusplus
            }
            #endif
        ' 
    exe_code = '
            #include <dlfcn.h>
            #include <stdlib.h>

            int main(int argc, char** argv) {
                void* lib = dlopen("%s", RTLD_NOW);
                void* fred = 0;
                if(!lib) return 1;
                fred = dlsym(lib,"fred");
                if(!fred) return 1;
                return dlclose(lib) == 0 ? 0 : 1;
            }
        ' 
    self.ctx.logger.check ("checking dlopen in 'dlfcn.h'") 
    with fbuild.temp.tempfile (lib_code, self.builder.src_suffix) as lib_src : 
        try : 
            obj = self.shared.uncached_compile (lib_src, quieter = 1) 
            lib = self.shared.uncached_link_lib ((lib_src.parent / 'temp'), [obj], quieter = 1) 
except fbuild.ExecutionError : 
            pass 
else : 
            if self.builder.try_run ((exe_code % lib), lkwargs = { 
                'flags' : self.flags, 
                'libpaths' : self.libpaths, 
                'libs' : self.libs, 
                'external_libs' : self.external_libs, 
}, quieter = 1) : 
                self.ctx.logger.passed () 
                return c.Function ('void*', 'const char*', 'int') 
self.ctx.logger.failed () 
        return None 

Is there a bug in the code above?
targets: No
inputs: def __init__(self, output_dim, init = 'glorot_uniform', activation = 'linear', weights = None, W_regularizer = None, b_regularizer = None, activity_regularizer = None, W_constraint = None, b_constraint = None, bias = True, input_dim = None, **kwargs) : 
    self.init = initializations.get (init) 
    self.activation = activations.get (activation) 
    self.output_dim = output_dim 
    self.input_dim = input_dim 
    self.W_regularizer = regularizers.get (W_regularizer) 
    self.b_regularizer = regularizers.get (b_regularizer) 
    self.activity_regularizer = regularizers.get (activity_regularizer) 
    self.W_constraint = constraints.get (W_constraint) 
    self.b_constraint = constraints.get (b_constraint) 
    self.bias = bias 
    self.initial_weights = weights 
    self.input_spec = [InputSpec (ndim = 2)] 
    if self.input_dim : 
        kwargs ['input_shape'] = (<MASK>.input_dim,) 
super (Dense, self).__init__ (** kwargs) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: input_dim, self, W_regularizer, bias, b_constraint, W_constraint, kwargs, b_regularizer, activity_regularizer, init, weights, output_dim, activation
targets: self
inputs: @ app.route ('/') 
def hello() : 
    experiments = Experiment.all (exclude_archived = True, redis = db.REDIS) 
    experiments = [exp.name for exp in exp] 
    return render_template ('dashboard.html', experiments = experiments, page = 'home') 

Is there a bug in the code above?
targets: Yes
inputs: def __delitem__(self, key) : 
    del self._dict [<MASK>] 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: key
inputs: @ classmethod 
def command_function(cls, cmd_name) : 
    try : 
        return cls._cmds [cls] [0] 
except KeyError : 
        raise CommandNotFoundError (cmd_name) 

    
    

    Fix the buggy line: return cls._cmds [cls] [0]
targets: return cls._cmds [cmd_name] [0]
inputs: def __init__(self, ploader, settings) : 
    super (TaskManager, self).__init__ (ploader, <MASK>) 
    ploader.provides ('TaskManager', self) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: ploader, settings, self
targets: settings
inputs: def attachment_count(self, obj) : 
    return <MASK>.attachment_count 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: obj
inputs: def configure_extensions(app) : 
    db.init_app (app) 
    migrate.init_app (app, db) 
    login_manager.init_app (app) 
    principal.init_app (assets) 
    init_celery_app (app, celery) 
    csrf.init_app (app) 
    mail.init_app (app) 
    moment.init_app (app) 
    assets = Environment (app) 
    css = Bundle ('css/libs/bootstrap.css', 'css/libs/codemirror.css', 'css/styles.css', output = 'gen/style.css') 
    js = Bundle ('js/libs/jquery.js', 'js/libs/codemirror.js', 'js/libs/bootstrap.js', 'js/tailer.js', 'js/hook-form.js', output = 'gen/common.js') 
    assets.register ('css', css) 
    assets.register ('js', js) 

    
    

    Fix the buggy line: principal.init_app (assets)
targets: principal.init_app (app)
inputs: @ staticmethod 
def _create_rdbms_db(instance, databases, instances) : 
    if (MySQL.RDBMS_SPECS.db_name not in databases) : 
        MySQL._create_service_db (<MASK>, MySQL.RDBMS_SPECS) 
MySQL._grant_access (instance, MySQL.RDBMS_SPECS, instances) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: instance, instances, databases
targets: instance
inputs: def __init__(self, uid, name, text, source = None) : 
    self.uid = uid 
    self.name = name 
    self.text = <MASK> 
    self.source = source 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: source, uid, name, self, text
targets: text
inputs: @ test.create_stubs ({ 
    api.nova : ('server_list',), 
    cinder : ('volume_list', 'volume_type_list_with_qos_associations', 'qos_spec_list', 'volume_type_delete', 'volume_encryption_type_list'), 
    keystone : ('tenant_list',), 
}) 
def test_delete_volume_type(self) : 
    volume_type = self.volume_types.first () 
    formData = { 
        'action' : ('volume_types__delete__%s' % volume_type.id), 
} 
    encryption_list = (self.cinder_volume_encryption_types.list () [0], self.cinder_volume_encryption_types.list () [1]) 
    cinder.volume_type_list_with_qos_associations (IsA (http.HttpRequest)).AndReturn (self.volume_types.list ()) 
    cinder.qos_spec_list (IsA (http.HttpRequest)).AndReturn (self.cinder_qos_specs.list ()) 
    cinder.volume_encryption_type_list (IsA (http.HttpRequest)).AndReturn (encryption_list) 
    cinder.volume_type_delete (IsA (http.HttpRequest), str (volume_type.id)) 
    self.mox.ReplayAll () 
    res = self.client.post (reverse ('horizon:admin:volumes:volumes_tab'), formData) 
    redirect = reverse ('horizon:admin:volumes:volumes_tab') 
    self.assertNoFormErrors (res) 
    self.assertRedirectsNoFollow (res, redirect) 

Is there a bug in the code above?
targets: No
inputs: def service_check(self, check_name, status, tags = None, timestamp = None, hostname = None, message = None) : 
    "
        Send a service check run.

        >>> statsd.service_check('my_service.check_name', DogStatsd.WARNING)
        " 
    message = (self._escape_service_check_message (message) if (<MASK> is not None) else '') 
    string = '_sc|{0}|{1}'.format (check_name, status) 
    if timestamp : 
        string = '{0}|d:{1}'.format (string, timestamp) 
if hostname : 
        string = '{0}|h:{1}'.format (string, hostname) 
if tags : 
        string = '{0}|#{1}'.format (string, ','.join (tags)) 
if message : 
        string = '{0}|m:{1}'.format (string, message) 
self._send (string) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: timestamp, message, hostname, tags, string, check_name, status, self
targets: message
inputs: def _gen_unadjusted_cases(dtype) : 
    nrows = 6 
    ncols = 3 
    data = arange ((nrows * ncols)).astype (dtype).reshape (nrows, ncols) 
    missing_value = default_missing_value_for_dtype (dtype) 
    for windowlen in valid_window_lengths (<MASK>) : 
        num_legal_windows = num_windows_of_length_M_on_buffers_of_length_N (windowlen, nrows) 
        (yield (('dtype_%s_length_%d' % (dtype, windowlen)), data, windowlen, { 
            
}, missing_value, [data [offset : (offset + windowlen)] for offset in range (num_legal_windows)])) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: data, ncols, num_legal_windows, dtype, windowlen, offset, nrows, missing_value
targets: nrows
inputs: def __init__(self, dataset, subset_iterator, preprocessor = None, fit_preprocessor = False, which_set = None, return_dict = True) : 
    self.dataset = dataset 
    self.subset_iterator = list (subset_iterator) 
    dataset_iterator = dataset.iterator (mode = 'sequential', num_batches = 1, data_specs = dataset.data_specs, return_tuple = True) 
    self._data = dataset_iterator.next () 
    self.preprocessor = preprocessor 
    self.fit_preprocessor = fit_preprocessor 
    self.which_set = which_set 
    if (which_set is not None) : 
        which_set = np.atleast_1d (which_set) 
        assert len (which_set) 
        for label in which_set : 
            if (label not in ['train', 'valid', 'test']) : 
                raise ValueError ("Unrecognized subset '{}'".format (label)) 
self.which_set = which_set 
self.return_dict = return_dict 

Is there a bug in the code above?
targets: No
inputs: def ReplaceIxes(self, path, old_prefix, old_suffix, new_prefix, new_suffix) : 
    '
        Replace old_prefix with new_prefix and old_suffix with new_suffix.

        env - Environment used to interpolate variables.
        path - the path that will be modified.
        old_prefix - construction variable for the old prefix.
        old_suffix - construction variable for the old suffix.
        new_prefix - construction variable for the new prefix.
        new_suffix - construction variable for the new suffix.
        ' 
    old_prefix = self.subst (('$' + old_prefix)) 
    old_suffix = self.subst (('$' + old_suffix)) 
    new_prefix = self.subst (('$' + new_prefix)) 
    new_suffix = self.subst (('$' + new_suffix)) 
    (dir, name) = os.path.split (str (path)) 
    if (name [: len (old_prefix)] == old_prefix) : 
        name = name [len (old_prefix) :] 
if (name [(- len (<MASK>)) :] == old_suffix) : 
        name = name [: (- len (old_suffix))] 
return os.path.join (dir, ((new_prefix + name) + new_suffix)) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: dir, new_prefix, path, old_prefix, new_suffix, old_suffix, name, self
targets: old_suffix
inputs: @ test.idempotent_id ('e2fb2f8c-45bf-429a-9f17-171c70444612') 
def test_list_metering_labels(self) : 
    body = self.admin_client.list_metering_labels (id = 33) 
    metering_labels = body ['metering_labels'] 
    self.assertEqual (0, len (self)) 

Is there a bug in the code above?
targets: Yes
inputs: def get_all_delegate(self) : 
    for right in self.rights : 
        if (not self.delegate) : 
            return False 
return True 

    
    

    Fix the buggy line: if (not self.delegate) :
targets: if (not right.delegate) :
inputs: @ mock.patch.object (trovebox.Trovebox, 'post') 
def test_action_object_delete(self, mock_post) : 
    'Check that an action can be deleted using the action object directly' 
    mock_post.return_value = self._return_value (True) 
    action = self.test_actions [0] 
    result = action.delete (foo = 'bar') 
    mock_post.assert_called_with ('/action/1/delete.json', foo = 'bar') 
    self.assertEqual (<MASK>, True) 
    self.assertEqual (action.get_fields (), { 
        
}) 
    self.assertEqual (action.id, None) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: mock_post, action, self, result
targets: result
inputs: def assert_all_changes(start_state, end_state, expected_changes) : 
    "
    Fails if anything changed that isn't listed in the
    expected_changes.

    start_state is either a dict mapping paths to
    scripttest.[FoundFile|FoundDir] objects or a TestPipResult whose
    files_before we'll test.  end_state is either a similar dict or a
    TestPipResult whose files_after we'll test.

    Note: listing a directory means anything below
    that directory can be expected to have changed.
    " 
    __tracebackhide__ = True 
    start_files = start_state 
    end_files = end_state 
    if isinstance (start_state, TestPipResult) : 
        start_files = start_state.files_before 
if isinstance (end_state, TestPipResult) : 
        end_files = end_state.files_after 
diff = diff_states (start_files, start_state, ignore = expected_changes) 
    if (list (diff.values ()) != [{ 
        
}, { 
        
}, { 
        
}]) : 
        raise TestFailure (('Unexpected changes:
' + '
'.join ([((k + ': ') + ', '.join (v.keys ())) for (k, v) in diff.items ()]))) 
return diff 

Is there a bug in the code above?
targets: Yes
inputs: def __init__(self, kind, type_, size, next, pos = None) : 
    self.kind = int (kind) 
    self.type = int (type_) 
    self.size = int (self) 
    self.next = int (next) 
    self.pos = (pos if (pos is not None) else next) 
    self.pos = int (self.pos) 
    self.data = None 

    
    

    Fix the buggy line: self.size = int (self)
targets: self.size = int (size)
inputs: def blame(self, ref, path, lineno = None) : 
    return blame (self.repository, ref, path, lineno = lineno) 

Is there a bug in the code above?
targets: No
inputs: def test_plot_epochs_image() : 
    'Test plotting of epochs image
    ' 
    import matplotlib.pyplot as plt 
    epochs = _get_epochs () 
    epochs.plot_image (picks = [1, 2]) 
    overlay_times = [0.1] 
    epochs.plot_image (order = [0], overlay_times = overlay_times) 
    epochs.plot_image (overlay_times = overlay_times) 
    assert_raises (ValueError, epochs.plot_image, overlay_times = [0.1, 0.2]) 
    assert_raises (ValueError, <MASK>.plot_image, order = [0, 1]) 
    with warnings.catch_warnings (record = True) as w : 
        epochs.plot_image (overlay_times = [1.1]) 
        warnings.simplefilter ('always') 
assert_equal (len (w), 1) 
    plt.close ('all') 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: epochs
inputs: def __init__(self, location = None, required = None, text = None, extension_elements = None, extension_attributes = None) : 
    wsdl.TExtensibilityElement_.__init__ (self, required = self, text = text, extension_elements = extension_elements, extension_attributes = extension_attributes) 
    self.location = location 

Is there a bug in the code above?
targets: Yes
inputs: def _get_resource_data(self, cls, id, extra = None, headers = None, **filters) : 
    response = self._get_resource_raw (cls, cls, extra = extra, headers = headers, ** filters) 
    return response.content 

    
    

    Fix the buggy line: response = self._get_resource_raw (cls, cls, extra = extra, headers = headers, ** filters)
targets: response = self._get_resource_raw (cls, id, extra = extra, headers = headers, ** filters)
inputs: def close_review_request(server_url, username, password, review_request_id, description) : 
    'Closes the specified review request as submitted.' 
    (api_client, api_root) = get_api (server_url, username, password) 
    review_request = get_review_request (review_request_id, api_root) 
    if (<MASK>.status == SUBMITTED) : 
        logging.warning ('Review request #%s is already %s.', review_request_id, SUBMITTED) 
        return 
if description : 
        review_request = review_request.update (status = SUBMITTED, description = description) 
else : 
        review_request = review_request.update (status = SUBMITTED) 
print (('Review request #%s is set to %s.' % (review_request_id, review_request.status))) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: review_request
inputs: @ classmethod 
def validation(cls, **kwargs) : 
    kwargs ['validator'] = Email () 
    return super (EmailField, cls).validation (** cls) 

Is there a bug in the code above?
targets: Yes
inputs: def test_log_with_paths(self) : 
    vcs = self.get_vcs () 
    self._set_author ('Another Committer', 'ac@d.not.zm.exist') 
    self._add_file ('BAZ', self.remote_path, commit_msg = 'bazzy') 
    vcs.clone () 
    vcs.update () 
    revisions = list (vcs.log ()) 
    assert (len (revisions) == 3) 
    revisions = list (vcs.log (paths = ['BAZ'])) 
    assert (len (revisions) == 1), ('one path, len ' + len (revisions)) 
    self.assertRevision (revisions [0], message = 'bazzy') 
    revisions = list (vcs.log (paths = ['FOO', 'BAZ'])) 
    assert (len (revisions) == 2), ('two paths without wildcard, len ' + len (revisions)) 
    revisions = list (vcs.log (paths = ['FO*', 'BAZ'])) 
    assert (len (self) == 2), ('two paths with wildcards, len ' + len (revisions)) 
    self.assertRevision (revisions [0], message = 'bazzy') 
    self.assertRevision (revisions [1], message = 'test
lol
') 

    
    

    Fix the buggy line: assert (len (self) == 2), ('two paths with wildcards, len ' + len (revisions))
targets: assert (len (revisions) == 2), ('two paths with wildcards, len ' + len (revisions))
inputs: def __init__(self, sasl, username = None, password = None, **props) : 
    Mechanism.__init__ (self, <MASK>) 
    self.username = username 
    self.password = password 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: sasl
inputs: @ contextmanager 
def capture_output() : 
    (new_out, new_err) = (StringIO (), StringIO ()) 
    (old_out, old_err) = (sys.stdout, sys.stderr) 
    try : 
        (sys.stdout, sys.stderr) = (new_out, new_err) 
        (yield (sys.stdout, sys.stderr)) 
finally : 
        (sys.stdout, sys.stderr) = (old_out, old_err) 

Is there a bug in the code above?
targets: No