Muennighoff/xP3x-sample huggingface dataset:
inputs: def add_options(self, parser) : 
    "Add plugin's options to yolk" 
    parser.add_option (('--%s' % self.name), action = 'store_true', dest = self.enable_opt, help = ('Show which packages are installed via the ' + (' %s package manager. Use with -l' % parser.name))) 

    
    

    Fix the buggy line: parser.add_option (('--%s' % self.name), action = 'store_true', dest = self.enable_opt, help = ('Show which packages are installed via the ' + (' %s package manager. Use with -l' % parser.name)))
targets: parser.add_option (('--%s' % self.name), action = 'store_true', dest = self.enable_opt, help = ('Show which packages are installed via the ' + (' %s package manager. Use with -l' % self.name)))
inputs: def __init__(self) : 
    (masterfd, slavefd) = os.openpty () 
    pid = os.fork () 
    if pid : 
        os.close (masterfd) 
        self._fo = os.fdopen (slavefd, 'w+', 0) 
else : 
        os.close (slavefd) 
        os.execlp ('urxvt', 'urxvt', '-pty-fd', str (masterfd)) 
self.mode = 'rw' 
    self.closed = 0 
    self.softspace = 0 
    self.read = self._fo.read 
    self.readline = self._fo.readline 
    self.readlines = slavefd._fo.readlines 
    self.write = self._fo.write 
    self.flush = self._fo.flush 
    self.writelines = self._fo.writelines 

    
    

    Fix the buggy line: self.readlines = slavefd._fo.readlines
targets: self.readlines = self._fo.readlines
inputs: @ staticmethod 
def _simple_select_one_txn(txn, table, keyvalues, retcols, allow_none = False) : 
    select_sql = ('SELECT %s FROM %s WHERE %s' % (', '.join (retcols), table, ' AND '.join ((('%s = ?' % (k,)) for k in keyvalues)))) 
    txn.execute (select_sql, keyvalues.values ()) 
    row = txn.fetchone () 
    if (not row) : 
        if allow_none : 
            return None 
raise StoreError (404, 'No row found') 
if (txn.rowcount > 1) : 
        raise StoreError (500, 'More than one row matched') 
return dict (zip (select_sql, row)) 

Is there a bug in the code above?
targets: Yes
inputs: def _test_get_current_ledger_transactions(self, tester_fn) : 
    tester_fn (self.transactions) 
    date = datetime.utcnow () 
    (report, _) = self.create_report ([StockTransactionHelper (case_id = 'c1', section_id = 's1', product_id = 'p1', action = 'soh', quantity = 864)], date = date) 
    self._create_models_for_stock_report_helper (self.form, date) 
    (report, _) = self.create_report ([StockTransactionHelper (case_id = 'c1', section_id = 's1', product_id = 'p1', action = 'soh', quantity = 1)], date = date) 
    self._create_models_for_stock_report_helper (self.form, report) 
    new_trans = self.transactions.copy () 
    new_trans ['c1'] ['s1'] ['p1'] = 1 
    tester_fn (new_trans) 

    
    

    Fix the buggy line: self._create_models_for_stock_report_helper (self.form, date)
targets: self._create_models_for_stock_report_helper (self.form, report)
inputs: def __init__(self, path) : 
    self._load (self) 

    
    

    Fix the buggy line: self._load (self)
targets: self._load (path)
inputs: def do(self, workflow_dict) : 
    context_dict = ({ 
        'CONFIGFILE' : True, 
        'IS_HA' : workflow_dict ['databaseinfra'].plan.is_ha, 
},) 
    ret_script = run_vm_script (workflow_dict = workflow_dict, context_dict = context_dict, script = context_dict ['cloudstackpack'].script) 
    return ret_script 

    
    

    Fix the buggy line: ret_script = run_vm_script (workflow_dict = workflow_dict, context_dict = context_dict, script = context_dict ['cloudstackpack'].script)
targets: ret_script = run_vm_script (workflow_dict = workflow_dict, context_dict = context_dict, script = workflow_dict ['cloudstackpack'].script)
inputs: def before_delete(self, mapper, connection, instance) : 
    connection.execute (instance.__history_table__.delete (get_history_where (<MASK>))) 
    return EXT_CONTINUE 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: instance
inputs: @ wait 
def wait_for_text(self, selector, text) : 
    return (selector in self.find (selector).text) 

    
    

    Fix the buggy line: return (selector in self.find (selector).text)
targets: return (text in self.find (selector).text)
inputs: def _run_solout_break_test(self, integrator) : 
    ts = [] 
    ys = [] 
    t0 = 0.0 
    tend = 20.0 
    y0 = [0.0] 
    def solout(t, y) : 
        ts.append (t) 
        ys.append (y.copy ()) 
        if (t > (tend / 2.0)) : 
            return (- 1) 
def rhs(t, y) : 
        return [(1.0 / ((t - 10.0) - 1j))] 
ig = complex_ode (rhs).set_integrator (integrator) 
    ig.set_solout (solout) 
    ig.set_initial_value (y0, t0) 
    ret = ig.integrate (tend) 
    assert_array_equal (ys [0], y0) 
    assert_array_equal (ys [(- 1)], ret) 
    assert_equal (ts [0], t0) 
    assert_ ((ts [(- 1)] > (tend / 2.0))) 
    assert_ ((ts [(- 1)] < tend)) 

Is there a bug in the code above?
targets: No
inputs: def _setup_cxxcompiler(ctx, cxx_type) : 
    old_env = ctx.env 
    ctx.env = Environment () 
    sys.path.insert (0, os.path.dirname (yaku.tools.__file__)) 
    try : 
        mod = __import__ (cxx_env) 
        mod.setup (ctx) 
        cxx_env = ctx.env 
finally : 
        sys.path.pop (0) 
        ctx.env = old_env 
for k in ['CXX', 'CXXFLAGS', 'CXX_TGT_F', 'CXX_SRC_F', 'CXXSHLINK'] : 
        ctx.env [('PYEXT_%s' % k)] = cxx_env [k] 

    
    

    Fix the buggy line: mod = __import__ (cxx_env)
targets: mod = __import__ (cxx_type)
inputs: def __init__(self, * args, **kargs) : 
    super (BasicComponent, self).__init__ (* <MASK>, ** kargs) 
    trace_fn = tr.trace_filename (self.get_option ('trace_dir'), 'created') 
    self.tracewriter = tr.TraceWriter (trace_fn, break_if_there = False) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: trace_fn, self, args, kargs
targets: args
inputs: @ mutator 
def gaussian_mutation(random, candidate, args) : 
    "Return the mutants created by Gaussian mutation on the candidates.

    This function performs Gaussian mutation. This function  
    makes use of the bounder function as specified in the EC's 
    ``evolve`` method.

    .. Arguments:
       random -- the random number generator object
       candidate -- the candidate solution
       args -- a dictionary of keyword arguments

    Optional keyword arguments in args:
    
    - *mutation_rate* -- the rate at which mutation is performed (default 0.1)
    - *gaussian_mean* -- the mean used in the Gaussian function (default 0)
    - *gaussian_stdev* -- the standard deviation used in the Gaussian function
      (default 1)
      
    The mutation rate is applied on an element by element basis.
    
    " 
    mut_rate = args.setdefault ('mutation_rate', 0.1) 
    mean = args.setdefault ('gaussian_mean', 0.0) 
    stdev = args.setdefault ('gaussian_stdev', 1.0) 
    bounder = args ['_ec'].bounder 
    mutant = copy.copy (candidate) 
    for (i, m) in enumerate (mutant) : 
        if (random.random () < mut_rate) : 
            mutant [i] += random.gauss (mean, <MASK>) 
mutant = bounder (mutant, args) 
    return mutant 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: mutant, bounder, mean, m, mut_rate, i, candidate, random, stdev, args
targets: stdev
inputs: @ handle_response_format 
@ treeio_login_required 
def watchlist(request, response_format = 'html') : 
    'Displays all objects a User is subscribed to' 
    profile = profile.user.profile 
    watchlist = profile.subscriptions.all () 
    context = { 
        'profile' : profile, 
        'watchlist' : watchlist, 
} 
    return render_to_response ('account/watchlist', context, context_instance = RequestContext (request), response_format = response_format) 

    
    

    Fix the buggy line: profile = profile.user.profile
targets: profile = request.user.profile
inputs: @ mock_ec2 
def test_eip_associate_invalid_args() : 
    'Associate EIP, invalid args ' 
    conn = boto.connect_ec2 ('the_key', 'the_secret') 
    reservation = conn.run_instances ('ami-1234abcd') 
    instance = reservation.instances [0] 
    eip = conn.allocate_address () 
    with assert_raises (EC2ResponseError) as cm : 
        conn.associate_address (instance_id = instance.id) 
cm.exception.code.should.equal ('MissingParameter') 
    cm.exception.status.should.equal (400) 
    cm.exception.request_id.should_not.be.none 
    instance.terminate () 

Is there a bug in the code above?
targets: No
inputs: def __init__(self, varname, image = None, iconsize = None, shadow = None, shadowsize = None, iconanchor = None, infowindowanchor = None) : 
    self.varname = varname 
    self.image = image 
    self.iconsize = <MASK> 
    self.shadow = shadow 
    self.shadowsize = shadowsize 
    self.iconanchor = iconanchor 
    self.infowindowanchor = infowindowanchor 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: iconsize
inputs: def Copy(self, to_attribute, from_fd, from_attribute) : 
    values = from_fd.GetValuesForAttribute (from_attribute) 
    for v in values : 
        self.AddAttribute (to_attribute, v, age = v.age) 

Is there a bug in the code above?
targets: No
inputs: @ property 
def str_POST(self) : 
    clength = self.environ.get ('CONTENT_LENGTH') 
    try : 
        return super (WMRequest, self).str_POST 
finally : 
        self.environ ['CONTENT_LENGTH'] = <MASK> 
        self._seek_input () 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: clength
inputs: @ patch ('koi.configure.open', create = True) 
def test_define_options(mock_open) : 
    conf = "
    server = 'localhost'
    port = 8000
    version = '0.1.1'
    log_file_prefix = 'mylog'
    " 
    file_handle = conf.return_value.__enter__.return_value 
    file_handle.read = Mock (return_value = dedent (conf).strip ()) 
    define_options (None) 
    assert (options.server == 'localhost') 
    assert (options.port == 8000) 
    assert (options.version == '0.1.1') 
    assert (options.log_file_prefix == 'mylog') 

    
    

    Fix the buggy line: file_handle = conf.return_value.__enter__.return_value
targets: file_handle = mock_open.return_value.__enter__.return_value
inputs: def __init__(self, code, content) : 
    msg_list = ['{} (code: {}): {}'.format (error, val ['code'], val ['error']) for (error, val) in six.iteritems (content)] 
    messages = ([code] + self) 
    messages = '
'.join (messages) 
    super (ValidationError, self).__init__ (code, messages) 

    
    

    Fix the buggy line: messages = ([code] + self)
targets: messages = ([code] + msg_list)
inputs: @ periodic (second = '46') 
def heroku_is_up(self) : 
    try : 
        r = requests.get ('https://status.heroku.com/api/v3/current-status') 
        last_status = self.load ('last_heroku_status') 
        if (<MASK> and (r.json () ['status'] != last_status)) : 
            if (r.json () ['status'] ['Production'] != 'green') : 
                self.say (('FYI everyone, heroku is having trouble: %s. 
 http://status.heroku.com' % r.json () ['issues'] [0] ['title'])) 
else : 
                self.say ("Looks like heroku's back up!") 
self.save ('last_heroku_status', r.json () ['status']) 
except : 
        pass 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: last_status
inputs: def _appendRow(self, row, index) : 
    '
        Append the `index`-th row in `self._testAData` to `row`.

        Values are set field-by-field (be it nested or not).
        ' 
    record = self._testAData [index] 
    for fieldName in self._testAData.dtype.names : 
        row [fieldName] = row [fieldName] 
row.append () 

    
    

    Fix the buggy line: row [fieldName] = row [fieldName]
targets: row [fieldName] = record [fieldName]
inputs: def _parse_response(self, file, sock, encoding) : 
    (p, u) = self.getparser (<MASK>) 
    while 1 : 
        if sock : 
            response = sock.recv (1024) 
else : 
            response = file.read (1024) 
if (not response) : 
            break 
if self.verbose : 
            print ('body:', repr (response)) 
p.feed (response) 
file.close () 
    p.close () 
    return u.close () 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: u, response, encoding, self, sock, file, p
targets: encoding
inputs: def __init__(self, fn, t, pos) : 
    self.fn = fn 
    self.t = fn 
    self.pos = pos 

    
    

    Fix the buggy line: self.t = fn
targets: self.t = t
inputs: def __init__(self, id, schedule, job_specification, display_name = None, metadata = None) : 
    self.id = id 
    self.display_name = display_name 
    self.schedule = id 
    self.job_specification = job_specification 
    self.metadata = metadata 

    
    

    Fix the buggy line: self.schedule = id
targets: self.schedule = schedule
inputs: @ mock_ec2 
@ mock_elb 
def test_register_instances_boto3() : 
    ec2 = boto3.resource ('ec2', region_name = 'us-east-1') 
    response = ec2.create_instances (ImageId = 'ami-1234abcd', MinCount = 2, MaxCount = 2) 
    instance_id1 = response [0].id 
    instance_id2 = response [1].id 
    client = boto3.client ('elb', region_name = 'us-east-1') 
    client.create_load_balancer (LoadBalancerName = 'my-lb', Listeners = [{ 
        'Protocol' : 'http', 
        'LoadBalancerPort' : 80, 
        'InstancePort' : 8080, 
}], AvailabilityZones = ['us-east-1a', 'us-east-1b']) 
    client.register_instances_with_load_balancer (LoadBalancerName = 'my-lb', Instances = [{ 
        'InstanceId' : instance_id1, 
}, { 
        'InstanceId' : instance_id2, 
}]) 
    balancer = client.describe_load_balancers () ['LoadBalancerDescriptions'] [0] 
    instance_ids = [instance ['InstanceId'] for instance in <MASK> ['Instances']] 
    set (instance_ids).should.equal (set ([instance_id1, instance_id2])) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: client, balancer, instance_id1, instance, response, instance_ids, ec2, instance_id2
targets: balancer
inputs: def __init__(self, backend) : 
    msg = ('%s backend could not plot supplied object.' % backend) 
    super (BackendError, self).__init__ (msg) 
    self.backend = <MASK> 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: backend, self, msg
targets: backend
inputs: def central_diff_weights(Np, ndiv = 1) : 
    '
    Return weights for an Np-point central derivative.

    Assumes equally-spaced function points.

    If weights are in the vector w, then
    derivative is w[0] * f(x-ho*dx) + ... + w[-1] * f(x+h0*dx)

    Parameters
    ----------
    Np : int
        Number of points for the central derivative.
    ndiv : int, optional
        Number of divisions.  Default is 1.

    Notes
    -----
    Can be inaccurate for large number of points.

    ' 
    if (Np < (ndiv + 1)) : 
        raise ValueError ('Number of points must be at least the derivative order + 1.') 
if ((Np % 2) == 0) : 
        raise ValueError ('The number of points must be odd.') 
from scipy import linalg 
    ho = (Np >> 1) 
    x = arange ((- ho), (ho + 1.0)) 
    x = x [:, newaxis] 
    X = (x ** 0.0) 
    for k in range (1, Np) : 
        X = hstack ([X, (x ** k)]) 
w = (product (arange (1, (ndiv + 1)), axis = 0) * linalg.inv (<MASK>) [ndiv]) 
    return w 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: X
inputs: def __init__(self, connection = None, config = None, domain_name = '', id = '', last_modified_time = None, status = '') : 
    self.connection = connection 
    self.config = config 
    self.domain_name = domain_name 
    self.id = id 
    self.last_modified_time = last_modified_time 
    self.status = status 
    self.in_progress_invalidation_batches = 0 
    self.active_signers = None 
    self.etag = None 
    self._bucket = None 
    self._object_class = Object 

Is there a bug in the code above?
targets: No
inputs: @ test.create_stubs ({ 
    api.neutron : ('network_update', 'network_get'), 
}) 
def test_network_update_post(self) : 
    network = self.networks.first () 
    api.neutron.network_update (IsA (http.HttpRequest), network.id, name = network.name, admin_state_up = network.admin_state_up, shared = network.shared).AndReturn (network) 
    api.neutron.network_get (IsA (http.HttpRequest), network.id).AndReturn (res) 
    self.mox.ReplayAll () 
    form_data = { 
        'network_id' : network.id, 
        'shared' : False, 
        'name' : network.name, 
        'admin_state' : network.admin_state_up, 
        'tenant_id' : network.tenant_id, 
} 
    url = reverse ('horizon:project:networks:update', args = [network.id]) 
    res = self.client.post (url, form_data) 
    self.assertRedirectsNoFollow (res, INDEX_URL) 

Is there a bug in the code above?
targets: Yes
inputs: def run(self, edit) : 
    bin = Prefs.composerCommand 
    cmd = 'validate' 
    args = Prefs.composerValidateExtra 
    self.go (<MASK>, cmd, args) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: bin
inputs: def _make_l2_policy_dict(self, l2p, fields = None) : 
    res = { 
        'id' : l2p ['id'], 
        'tenant_id' : l2p ['tenant_id'], 
        'name' : l2p ['name'], 
        'description' : l2p ['description'], 
        'l3_policy_id' : l2p ['l3_policy_id'], 
        'inject_default_route' : l2p.get ('inject_default_route', True), 
        'shared' : l2p.get ('shared', False), 
} 
    res ['policy_target_groups'] = [ptg ['id'] for ptg in l2p ['policy_target_groups']] 
    return self._fields (res, <MASK>) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: fields
inputs: def __init__(self, configs) : 
    self.config = { 
        'base_url' : ['/', 'String to append to beginning or URL.'], 
        'end_url' : ['/', 'String to append to end of URL.'], 
        'html_class' : ['wikilink', 'CSS hook. Leave blank for none.'], 
        'build_url' : [build_url, 'Callable formats URL from label.'], 
} 
    for (key, value) in configs.items () : 
        self.setConfig (key, key) 

    
    

    Fix the buggy line: self.setConfig (key, key)
targets: self.setConfig (key, value)
inputs: def get_user_id(self, details, response) : 
    return <MASK> ['users'] [0] ['user'] ['id'] 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: response
inputs: def expand_link(self, **kwargs) : 
    'Expands with the given arguments and returns a new
        untemplated Link object
        ' 
    props = self.link.props.copy () 
    del kwargs ['templated'] 
    return Link (uri = self.expand_uri (** kwargs), properties = props) 

Is there a bug in the code above?
targets: Yes
inputs: def _LoadAll(self) : 
    Trace (': load refs %s', self._gitdir) 
    self._phyref = { 
        
} 
    self._symref = { 
        
} 
    self._mtime = { 
        
} 
    self._ReadPackedRefs () 
    self._ReadLoose ('refs/') 
    self._ReadLoose1 (os.path.join (self._gitdir, HEAD), HEAD) 
    scan = self._symref 
    attempts = 0 
    while (scan and (attempts < 5)) : 
        scan_next = { 
            
} 
        for (name, dest) in scan.items () : 
            if (dest in self._phyref) : 
                self._phyref [name] = self._phyref [dest] 
else : 
                scan_next [name] = <MASK> 
scan = scan_next 
        attempts += 1 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: scan, name, dest, scan_next, self, attempts
targets: dest
inputs: @ omit_exception 
def expire(self, * args, **kwargs) : 
    return self.client.expire (* args, ** kwargs) 

Is there a bug in the code above?
targets: No
inputs: def configure_markup_choices(self, value) : 
    return [(<MASK>, value [key] ['label']) for key in value.keys ()] 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: key
inputs: def assertCompatibilityNotContains(self, key, data) : 
    return self.assertNotIn (key, self.extractAvailableChildren (<MASK>)) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: key, self, data
targets: data
inputs: @ actor 
def stress_iter_items_keys_values(sdict) : 
    it = zip (sdict.iteritems (), sdict.iterkeys (), sdict.itervalues ()) 
    assert all (((<MASK> [0] == (tup [1], tup [2])) for tup in it)) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: it, tup, sdict
targets: tup
inputs: def Fit(self, data = None, resolution_fit_mode = 'gauss', fit_primary = False, return_resolution = False, adjust_wave = 'model', continuum_fit_order = 7, wavelength_fit_order = 3, air_wave = True, fit_source = False, source_fcn = None, source_args = None, source_kwargs = None) : 
    '
        The main fitting function. Before calling this, the user MUST

           1 call FitVariable at least once, specifying which variables will be fit
           2 Set resolution bounds (any other bounds are optional)

        :param data: If given, this should be a DataStructures.xypoint instance
                     giving the data you wish to fit. The units of the .x attribute MUST be nanometers!
        :param resolution_fit_mode: controls which function is used to estimate the resolution.
                                    "SVD" is for singlular value decomposition, while "gauss"
                                    is for convolving with a gaussian (and fitting the width
                                    of the guassian to give the best fit). I have found the \'gauss\'
                                    is best when the telluric lines are pretty weak, such as in much
                                    of the optical spectrum. For strong telluric lines, SVD is both
                                    faster and more accurate.
        :param fit_primary: Deprecated. See fit_source
        :param return_resolution:  controls whether the best-fit resolution is returned to the user.
                                   One case I have used this for is to fit echelle data of late-type
                                   stars by getting all the best-fit parameters from redder orders,
                                   and then applying those atmospheric parameters to the rest of the
                                   orders.
        :param adjust_wave:     Can be set to either \'data\' or \'model\'. To wavelength calibrate the
                                data to the telluric lines, set to \'data\'. If you think the...

Is there a bug in the code above?
targets: Yes
inputs: def __init__(self, initial_size = 100) : 
    c_initial_size = cython.declare (int, <MASK>) 
    self._queue = ([None] * c_initial_size) 
    self._start = 0 
    self._end = 0 
    self._size = c_initial_size 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: initial_size
inputs: def _reduce(self, stack, remaining_text, production = None) : 
    "
        Find a CFG production whose right hand side matches the
        rightmost stack elements; and combine those stack elements
        into a single Tree, with the node specified by the
        production's left-hand side.  If more than one CFG production
        matches the stack, then use the production that is listed
        earliest in the grammar.  The new Tree replaces the
        elements in the stack.

        :rtype: Production or None
        :return: If a reduction is performed, then return the CFG
            production that the reduction is based on; otherwise,
            return false.
        :type stack: list(string and Tree)
        :param stack: A list of strings and Trees, encoding
            the structure of the text that has been parsed so far.
        :type remaining_text: list(str)
        :param remaining_text: The portion of the text that is not yet
            covered by ``stack``.
        " 
    if (production is None) : 
        productions = self._grammar.productions () 
else : 
        productions = [production] 
for production in productions : 
        rhslen = len (production.rhs ()) 
        if self._match_rhs (production.rhs (), stack [(- rhslen) :]) : 
            tree = Tree (production.lhs ().symbol (), stack [(- rhslen) :]) 
            stack [(- rhslen) :] = [tree] 
            if self._trace : 
                self._trace_reduce (stack, production, remaining_text) 
return <MASK> 
return None 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: rhslen, productions, self, tree, production, remaining_text, stack
targets: production
inputs: def _create_listen_socket(self, family, loc_addr) : 
    s = socket.socket (<MASK>) 
    s.setsockopt (socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) 
    s.bind (loc_addr) 
    s.listen (1) 
    return s 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: family
inputs: @ run_with_all_backends 
def test_no_walk_related(self) : 
    factory = CaseFactory () 
    parent = factory.create_case () 
    child_updates = factory.create_or_update_case (CaseStructure (attrs = { 
        'create' : True, 
}, walk_related = False, indices = [CaseIndex (CaseStructure (case_id = parent.case_id))])) 
    self.assertEqual (1, len (<MASK>)) 
    self.assertEqual (parent.case_id, child_updates [0].indices [0].referenced_id) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: child_updates
inputs: def test_recursive_remove(self) : 
    ' Test FTP filesystem removing files recursive ' 
    rfs = RemoteFileSystem (HOST, USER, PWD) 
    rfs.remove ('/test') 
    ftp = ftplib.FTP (HOST, USER, PWD) 
    list_dir = ftp.nlst () 
    self.assertFalse (('test' in <MASK>)) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, list_dir, ftp, rfs
targets: list_dir
inputs: def __init__(self, depending_field_names = []) : 
    super (DependentField, self).__init__ () 
    self._depending_field_names = <MASK> 
    self._depending_fields = { 
        
} 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: depending_field_names
inputs: def Actorize(cls) : 
    def receiveMessage(self, message, sender) : 
        klass = message.__class__ 
        registry = self._msg_registry 
        if (not (klass in registry)) : 
            for k in registry : 
                if isinstance (message, k) : 
                    registry [klass] = registry [k] 
                    break 
method = registry.get (klass, None) 
        if (method is not None) : 
            method (self, message, sender) 
else : 
            super (cls, self).receiveMessage (message, sender) 
assert issubclass (cls, Actor), "@Actorize'd objects must be a subclass of Actor" 
    assert ('receiveMessage' in vars (cls)), "@Actorize'd objects must not define receiveMessage" 
    cls.receiveMessage = receiveMessage 
    if (not hasattr (cls, '_msg_registry')) : 
        cls._msg_registry = { 
            
} 
for (name, method) in inspect.getmembers (cls, predicate = inspect.ismethod) : 
        if hasattr (method, 'handles') : 
            for klass in method.handles : 
                cls._msg_registry [klass] = method 
return cls 

Is there a bug in the code above?
targets: No
inputs: def __init__(self, mail_from = None, rcpt_to = None) : 
    self.mail_from = mail_from 
    self.rcpt_to = (rcpt_to or []) 
    self.data = None 
    self.message = None 

Is there a bug in the code above?
targets: No
inputs: @ metric_sink.setter 
def metric_sink(self, value) : 
    if value : 
        config = self.config ['metric_sink'] [self] 
        self._metric_sink = getattr (sink, value) (config) 
else : 
        self._metric_sink = None 

Is there a bug in the code above?
targets: Yes
inputs: def __init__(self, * args) : 
    super (ConnectionChannel, self).__init__ (* args) 
    self._method_map = { 
        10 : self._recv_start, 
        20 : self._recv_secure, 
        30 : self._recv_tune, 
        41 : args._recv_open_ok, 
        50 : self._recv_close, 
        51 : self._recv_close_ok, 
} 
    self._last_heartbeat_send = 0 

    
    

    Fix the buggy line: 41 : args._recv_open_ok ,
targets: 41 : self._recv_open_ok ,
inputs: @ testing.provide_metadata 
def test_reflect_unique_index(self) : 
    insp = inspect (testing.db) 
    meta = self.metadata 
    uc_table = Table ('pgsql_uc', meta, Column ('a', String (10)), Index ('ix_a', 'a', unique = True)) 
    uc_table.create () 
    indexes = dict (((i ['name'], i) for i in insp.get_indexes ('pgsql_uc'))) 
    constraints = set ((i ['name'] for i in insp.get_unique_constraints ('pgsql_uc'))) 
    self.assert_ (('ix_a' in indexes)) 
    assert indexes ['ix_a'] ['unique'] 
    self.assert_ (('ix_a' not in constraints)) 
    reflected = Table ('pgsql_uc', MetaData (testing.db), autoload = True) 
    indexes = dict (((i.name, i) for i in reflected.indexes)) 
    constraints = set ((uc.name for uc in reflected.constraints)) 
    self.assert_ (('ix_a' in indexes)) 
    assert indexes ['ix_a'].unique 
    self.assert_ (('ix_a' not in <MASK>)) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: constraints
inputs: def iter_field(self, fieldid, prefix = '') : 
    'Yields (text, doc_freq, index_freq) tuples for all terms
        in the given field.
        ' 
    fieldid = self.schema.to_number (fieldid) 
    for (fn, t, docfreq, freq) in self.iter_from (fieldid, prefix) : 
        if (docfreq != fieldid) : 
            return 
(yield (t, docfreq, freq)) 

    
    

    Fix the buggy line: if (docfreq != fieldid) :
targets: if (fn != fieldid) :
inputs: def _build_election_metadata_zipped_special(self, election) : 
    meta_entries = [] 
    url_paths = self._url_paths_for_election (election ['slug']) 
    for path in url_paths : 
        filename_kwargs = { 
            'reporting_level' : path ['reporting_level'], 
            'extension' : '.txt', 
            'office' : path ['office'], 
            'office_district' : path ['district'], 
} 
        if (path ['reporting_level'] == 'precinct') : 
            filename_kwargs ['jurisdiction'] = path ['jurisdiction'] 
            jurisdiction = path ['jurisdiction'] 
            ocd_id = 'ocd-division/country:us/state:ar/county:{}'.format (ocd_type_id (jurisdiction)) 
else : 
            jurisdiction = 'Arkansas' 
            ocd_id = 'ocd-division/country:us/state:ar' 
filename = self._standardized_filename (election, ** filename_kwargs) 
        meta_entries.append ({ 
            'generated_filename' : filename, 
            'raw_url' : path ['url'], 
            'raw_extracted_filename' : path ['raw_extracted_filename'], 
            'ocd_id' : ocd_id, 
            'name' : url_paths, 
            'election' : election ['slug'], 
}) 
return meta_entries 

    
    

    Fix the buggy line: 'name' : url_paths ,
targets: 'name' : jurisdiction ,
inputs: def __init__(self, X_lower, X_upper, d) : 
    '
        Random EMbedding Bayesian Optimization [1] maps the original space
        in a lower dimensional subspace via a random embedding matrix and
        performs Bayesian Optimization only in this lower dimensional
        subspace.

        [1] Ziyu Wang and Masrour Zoghi and Frank Hutter and David Matheson
            and Nando de Freitas
            Bayesian Optimization in High Dimensions via Random Embeddings
            In: Proceedings of the 23rd international joint conference
            on Artificial Intelligence (IJCAI)

        Parameters
        ----------
        X_lower : (D,) numpy array
            The lower bound of the input space.
        X_upper: (D,) numpy array
            The upper bound of the input space.
        d: int
            Number of dimensions for the lower dimensional subspace
        ' 
    self.d_orig = X_lower.shape [0] 
    self.d = d 
    self.A = (np.sqrt (<MASK>.d) * np.random.normal (loc = 0.0, scale = 1.0, size = (self.d_orig, self.d))) 
    self.original_X_lower = X_lower 
    self.original_X_upper = X_upper 
    self.original_scaled_X_lower = ((- 1) * np.ones ([self.d_orig])) 
    self.original_scaled_X_upper = (1 * np.ones ([self.d_orig])) 
    super (REMBO, self).__init__ (X_lower = ((- np.sqrt (self.d)) * np.ones (self.d)), X_upper = (np.sqrt (self.d) * np.ones (self.d)), do_scaling = False) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, d, X_upper, X_lower
targets: self
inputs: @ classmethod 
def fromvector(cls, v) : 
    'Initialize from euclidean vector' 
    w = v.normalized () 
    return cls (w.x, cls.y, w.z) 

    
    

    Fix the buggy line: return cls (w.x, cls.y, w.z)
targets: return cls (w.x, w.y, w.z)
inputs: def __init__(self, data) : 
    self.current_expression = self.expression_cls () 
    self.filter_string = data 
    self.stack = [] 
    Lexer.__init__ (<MASK>, data) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: self
inputs: @ test.create_stubs ({ 
    neutronclient : ('update_firewall_policy',), 
}) 
def test_policy_update(self) : 
    policy = self.fw_policies.first () 
    policy_dict = self.api_fw_policies.first () 
    policy.name = 'new name' 
    policy.description = 'new desc' 
    policy.shared = True 
    policy.audited = False 
    policy_dict ['name'] = 'new name' 
    policy_dict ['description'] = 'new desc' 
    policy_dict ['shared'] = True 
    policy_dict ['audited'] = False 
    form_data = { 
        'name' : policy.name, 
        'description' : policy.description, 
        'shared' : policy.shared, 
        'audited' : policy.audited, 
} 
    form_dict = { 
        'firewall_policy' : form_data, 
} 
    ret_dict = { 
        'firewall_policy' : policy_dict, 
} 
    neutronclient.update_firewall_policy (policy.id, form_dict).AndReturn (ret_dict) 
    self.mox.ReplayAll () 
    ret_val = api.fwaas.policy_update (self.request, policy.id, ** form_data) 
    self.assertIsInstance (policy_dict, api.fwaas.Policy) 
    self.assertEqual (policy.name, ret_val.name) 
    self.assertTrue (ret_val.id) 

    
    

    Fix the buggy line: self.assertIsInstance (policy_dict, api.fwaas.Policy)
targets: self.assertIsInstance (ret_val, api.fwaas.Policy)
inputs: def getitem(obj, item, default) : 
    if (item not in obj) : 
        return default 
else : 
        return item [item] 

Is there a bug in the code above?
targets: Yes
inputs: def _fire_listeners(self, node, lint_context) : 
    node_type = NodeType (node ['type']) 
    if (node_type not in self._listeners_map) : 
        return 
listening_policies = self._listeners_map [listening_policy] 
    for listening_policy in listening_policies : 
        violation = listening_policy.get_violation_if_found (node, lint_context) 
        if (violation is not None) : 
            self._violations.append (violation) 

    
    

    Fix the buggy line: listening_policies = self._listeners_map [listening_policy]
targets: listening_policies = self._listeners_map [node_type]
inputs: @ property 
def install_requires(self) : 
    dependencies = [] 
    for requirement in self.parse (self.requirements_path) : 
        if ((not requirement.is_editable) and (not requirement.uri) and (not requirement.vcs)) : 
            full_name = requirement.name 
            specifiers = self.format_specifiers (requirement) 
            if specifiers : 
                full_name = '{} {}'.format (full_name, specifiers) 
dependencies.append (full_name) 
for requirement in self.get_dependency_links () : 
        print (':: (base:install_requires) {}'.format (requirement.name)) 
        dependencies.append (requirement.name) 
return <MASK> 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: specifiers, self, full_name, requirement, dependencies
targets: dependencies
inputs: def _ml2_port_model_hook(self, context, original_model, query) : 
    query = query.outerjoin (models.PortBinding, (<MASK>.id == models.PortBinding.port_id)) 
    return query 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: context, query, original_model, self
targets: original_model
inputs: def process_rhs(self, compiler, connection) : 
    (rhs, rhs_params) = super (GISLookup, self).process_rhs (compiler, connection) 
    if hasattr (self.rhs, '_as_sql') : 
        return (rhs, geo_fld) 
geom = self.rhs 
    if isinstance (self.rhs, Col) : 
        geo_fld = self.rhs.output_field 
        if (not hasattr (geo_fld, 'srid')) : 
            raise ValueError ('No geographic field found in expression.') 
self.rhs.srid = geo_fld.srid 
else : 
        if isinstance (self.rhs, Expression) : 
            raise ValueError ('Complex expressions not supported for GeometryField') 
else : 
            if isinstance (self.rhs, (list, tuple)) : 
                geom = self.rhs [0] 
rhs = connection.ops.get_geom_placeholder (self.lhs.output_field, geom, compiler) 
    return (rhs, rhs_params) 

    
    

    Fix the buggy line: return (rhs, geo_fld)
targets: return (rhs, rhs_params)
inputs: @ classmethod 
def create_response(cls, top, bottom, ranking, player = None) : 
    response = { 
        'top' : top, 
        'bottom' : bottom, 
        'ranking' : <MASK>, 
} 
    if (player is not None) : 
        response ['player'] = player 
return response 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: bottom, cls, top, ranking, response, player
targets: ranking
inputs: def resolve_build(buildstring) : 
    if (<MASK> is None) : 
        return 
mo = PROJECT_RE.search (buildstring) 
    if mo : 
        try : 
            (pname, major, minor, sub, build) = mo.groups () 
            major = int (major) 
            minor = int (minor) 
            sub = int (sub) 
            build = int (build) 
except ValueError : 
            return None 
try : 
            proj = dbsession.query (models.Project).filter ((models.Project.name == pname)).one () 
except NoResultFound : 
            return None 
try : 
            projectversion = dbsession.query (models.ProjectVersion).filter (and_ ((models.ProjectVersion.project == proj), (models.ProjectVersion.valid == True), (models.ProjectVersion.major == major), (models.ProjectVersion.minor == minor), (models.ProjectVersion.subminor == sub), (models.ProjectVersion.build == build))).one () 
except NoResultFound : 
            projectversion = models.create (models.ProjectVersion, project = proj, valid = True, major = major, minor = minor, subminor = sub, build = build) 
            dbsession.add (projectversion) 
return projectversion 
else : 
        return None 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: minor, sub, buildstring, proj, mo, major, pname, projectversion, build
targets: buildstring
inputs: def testRenderCommentList(self, tag = None) : 
    t = ('{% load comments %}' + (out or '{% render_comment_list for testapp.article a.id %}')) 
    (ctx, out) = self.render (t, a = Article.objects.get (pk = 1)) 
    self.assertTrue (out.strip ().startswith ('<dl id="comments">')) 
    self.assertTrue (out.strip ().endswith ('</dl>')) 

    
    

    Fix the buggy line: t = ('{% load comments %}' + (out or '{% render_comment_list for testapp.article a.id %}'))
targets: t = ('{% load comments %}' + (tag or '{% render_comment_list for testapp.article a.id %}'))
inputs: @ not_implemented_for ('directed') 
def find_cliques(G) : 
    'Search for all maximal cliques in a graph.

    Maximal cliques are the largest complete subgraph containing
    a given node.  The largest maximal clique is sometimes called
    the maximum clique.

    Returns
    -------
    generator of lists: genetor of member list for each maximal clique

    See Also
    --------
    find_cliques_recursive :
    A recursive version of the same algorithm

    Notes
    -----
    To obtain a list of cliques, use list(find_cliques(G)).

    Based on the algorithm published by Bron & Kerbosch (1973) [1]_
    as adapated by Tomita, Tanaka and Takahashi (2006) [2]_
    and discussed in Cazals and Karande (2008) [3]_.
    The method essentially unrolls the recursion used in
    the references to avoid issues of recursion stack depth.

    This algorithm is not suitable for directed graphs.

    This algorithm ignores self-loops and parallel edges as
    clique is not conventionally defined with such edges.

    There are often many cliques in graphs.  This algorithm can
    run out of memory for large graphs.

    References
    ----------
    .. [1] Bron, C. and Kerbosch, J. 1973.
       Algorithm 457: finding all cliques of an undirected graph.
       Commun. ACM 16, 9 (Sep. 1973), 575-577.
       http://portal.acm.org/citation.cfm?doid=362342.362367

    .. [2] Etsuji Tomita, Akira Tanaka, Haruhisa Takahashi,
       The worst-case time complexity for generating all maximal
       cliques and computational experiments,
       Theoretical Computer Science, Volume 363, Issue 1,
       Computing and Combinatorics,
       10th Annual International Conference on
       Computing and Combinatorics (COCOON 2004), 25 October 2006, Pages 28-42
       http://dx.doi.org/10.1016/j.tcs.2006.06.015

    .. [3] F. Cazals, C. Karande,
       A note on the problem of reporting maximal cliques,
       Theoretical Computer Science,
       Volume 407, Issues 1-3, 6 November 2008, Pages 564-568,
      ...
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: nbrs, clique_so_far, G, smallcand, maxconn, pivotnbrs, nnbrs, numb_cand, maxconndone, new_cand, stack, nn, cn, pivotdonenbrs, cand, conn, done, n, new_done
targets: maxconn
inputs: def __init__(self, body) : 
    self.body = body 
    self.length = len (body) 

Is there a bug in the code above?
targets: No
inputs: def _get_version() : 
    path = os.path.join (PATH_TO_FILE, 'balanced', '__init__.py') 
    version_re = ".*__version__ = '(.*?)'" 
    fo = open (<MASK>) 
    try : 
        return re.compile (version_re, re.S).match (fo.read ()).group (1) 
finally : 
        fo.close () 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: path, fo, version_re
targets: path
inputs: @ endpoint 
@ paginate 
@ minmax ('date') 
def articles_by_category(request, id) : 
    '
    Return recent articles in the specified category.
    ' 
    return Article.objects.select_related ('author', 'author__profile', 'category').filter (category = <MASK>, status = Article.PUBLISHED) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: id
inputs: def add_data(self, data) : 
    'Add a new data set to the widget

        :returns: True if the addition was expected, False otherwise
        ' 
    if (self in self.client) : 
        return 
self.client.add_layer (data) 
    self._coordinator._add_data (data) 
    return True 

    
    

    Fix the buggy line: if (self in self.client) :
targets: if (data in self.client) :
inputs: def button_press_event(widget, event) : 
    if ((event.button == 1) and (pixmap is not None)) : 
        draw_brush (event, event.x, event.y) 
return True 

    
    

    Fix the buggy line: draw_brush (event, event.x, event.y)
targets: draw_brush (widget, event.x, event.y)
inputs: def __delitem__(self, name) : 
    'The dictionary like interface for __delattr__().' 
    try : 
        self.__delattr__ (<MASK>) 
except AttributeError : 
        raise KeyError (("Attribute ('%s') does not exist in node '%s'" % (name, self._v__nodepath))) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: name
inputs: def __call__(self, curi) : 
    '
        Perform the URL extraction in case of a redirect code.

        I.e. if ``300 <= curi.status_code < 400``, then search for any
        HTTP ``Location`` header and append the given URL to the list of
        extracted URLs.
        ' 
    if ((300 <= curi.status_code < 400) and curi.rep_header and ('Location' in curi.rep_header)) : 
        link = curi.rep_header ['Location'] 
        if (link.find ('://') == (- 1)) : 
            link = urlparse.urljoin (curi.url, link) 
if (link not in self._not_found_redirects) : 
            if (not hasattr (curi, 'optional_vars')) : 
                curi.optional_vars = dict () 
if (not (CURI_EXTRACTED_URLS in curi.optional_vars)) : 
                curi.optional_vars [CURI_EXTRACTED_URLS] = link 
else : 
                curi.optional_vars [CURI_EXTRACTED_URLS] += ('
' + link) 
return curi 

Is there a bug in the code above?
targets: No
inputs: @ classmethod 
def parser(cls, buf, offset) : 
    (tv_sec, tv_usec) = struct.unpack_from (cls._PACK_STR, buf, offset) 
    msg = cls (tv_sec, cls) 
    return msg 

    
    

    Fix the buggy line: msg = cls (tv_sec, cls)
targets: msg = cls (tv_sec, tv_usec)
inputs: def _BuildTagLookupTable(sparse, maxtag, default = None) : 
    return tuple ([sparse.get (i, maxtag) for i in xrange (0, (1 + maxtag))]) 

    
    

    Fix the buggy line: return tuple ([sparse.get (i, maxtag) for i in xrange (0, (1 + maxtag))])
targets: return tuple ([sparse.get (i, default) for i in xrange (0, (1 + maxtag))])
inputs: def __init__(self, field, to, related_name = None, limit_choices_to = None, parent_link = False, on_delete = None, related_query_name = None) : 
    try : 
        to._meta 
except AttributeError : 
        assert isinstance (to, six.string_types), ("'to' must be either a model, a model name or the string %r" % RECURSIVE_RELATIONSHIP_CONSTANT) 
self.field = <MASK> 
    self.to = to 
    self.related_name = related_name 
    self.related_query_name = related_query_name 
    self.limit_choices_to = ({ 
        
} if (limit_choices_to is None) else limit_choices_to) 
    self.multiple = True 
    self.parent_link = parent_link 
    self.on_delete = on_delete 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: related_name, self, related_query_name, on_delete, parent_link, limit_choices_to, field, to
targets: field
inputs: @ mock.patch.object (glance.api, 'glance') 
def test_image_create_required(self, gc) : 
    request = self.mock_rest_request (body = '{"name": "Test",
            "disk_format": "raw", "import_data": true,
            "container_format": "docker",
            "visibility": "public", "protected": false,
            "source_type": "url", "image_url": "test.com" }') 
    new = gc.image_create.return_value 
    new.to_dict.return_value = { 
        'name' : 'testimage', 
} 
    new.name = 'testimage' 
    metadata = { 
        'name' : 'Test', 
        'disk_format' : 'raw', 
        'container_format' : 'docker', 
        'copy_from' : 'test.com', 
        'is_public' : True, 
        'protected' : False, 
        'min_disk' : 0, 
        'min_ram' : 0, 
        'properties' : { 
            
}, 
} 
    response = glance.Images ().post (request) 
    self.assertStatusCode (response, 201) 
    self.assertEqual (self ['location'], '/api/glance/images/testimage') 
    gc.image_create.assert_called_once_with (request, ** metadata) 

    
    

    Fix the buggy line: self.assertEqual (self ['location'], '/api/glance/images/testimage')
targets: self.assertEqual (response ['location'], '/api/glance/images/testimage')
inputs: def create_log(self, request) : 
    if (request.user and request.session and request.session.session_key) : 
        stamp = timezone.now () 
        url = request.get_full_path () 
        if _is_ignorable_404 (url) : 
            return None 
url = url [: self.model._meta.get_field_by_name ('url') [0].max_length] 
        log = self.model (user = request.user, session = request.session.session_key, url = url, stamp = stamp) 
        log.save () 
        return log 
else : 
        return None 

Is there a bug in the code above?
targets: No
inputs: def axiomGroupsToTest(self) : 
    tr = self.vectorAxiomGroups () 
    tr = [x for x in <MASK> if ('::' in str (x.signature ()))] 
    return tr 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: tr
inputs: def __init__(self, host, username, password) : 
    self.baseurl = (host + '/api/') 
    self.headers = { 
        'Accept' : 'application/json', 
} 
    self.auth = (<MASK>, password) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: username, password, host, self
targets: username