Muennighoff/xP3x-sample huggingface dataset:
inputs: @ task () 
@ timeit 
def send_group_email(announcement_id) : 
    'Build and send the announcement emails to a group.' 
    try : 
        announcement = Announcement.objects.get (pk = announcement_id) 
except Announcement.DoesNotExist : 
        return 
group = announcement.group 
    users = User.objects.filter (groups__in = [group]) 
    plain_content = bleach.clean (announcement.content_parsed, tags = [], strip = True).strip () 
    email_kwargs = { 
        'content' : <MASK>, 
        'content_html' : announcement.content_parsed, 
        'domain' : Site.objects.get_current ().domain, 
} 
    text_template = 'announcements/email/announcement.ltxt' 
    html_template = 'announcements/email/announcement.html' 
    @ safe_translation 
    def _make_mail(locale, user) : 
        subject = _ ('New announcement for {group}').format (group = group.name) 
        mail = make_mail (subject = subject, text_template = text_template, html_template = html_template, context_vars = email_kwargs, from_email = settings.TIDINGS_FROM_ADDRESS, to_email = user.email) 
        return mail 
messages = [] 
    for u in users : 
        locale = (u.profile.locale or settings.LANGUAGE_CODE) 
        messages.append (_make_mail (locale, u)) 
send_messages (messages) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: html_template, text_template, plain_content, messages, announcement, _make_mail, u, email_kwargs, users, announcement_id, locale, group
targets: plain_content
inputs: @ ignore_warnings 
def test_max_iter() : 
    (X, y_bin) = (iris.data, iris.target.copy ()) 
    y_bin [(y_bin == 2)] = 0 
    solvers = ['newton-cg', 'liblinear', 'sag'] 
    if (sp_version >= (0, 12)) : 
        solvers.append ('lbfgs') 
for max_iter in range (1, 5) : 
        for solver in solvers : 
            for multi_class in ['ovr', 'multinomial'] : 
                if ((solver == 'liblinear') and (multi_class == 'multinomial')) : 
                    continue 
lr = LogisticRegression (max_iter = max_iter, tol = 1e-15, multi_class = multi_class, random_state = 0, solver = solver) 
                lr.fit (X, y_bin) 
                assert_equal (lr.n_iter_ [0], max_iter) 

Is there a bug in the code above?
targets: No
inputs: @ compiles (RenameTable) 
def visit_rename_table(element, compiler, **kw) : 
    return ('%s RENAME TO %s' % (alter_table (kw, element.table_name, element.schema), format_table_name (compiler, element.new_table_name, element.schema))) 

Is there a bug in the code above?
targets: Yes
inputs: def get_clients(self) : 
    ' Get ZooKeeper server clients ' 
    clients = [] 
    stat = self._send_cmd ('stat') 
    if (not stat) : 
        return clients 
sio = StringIO (stat) 
    sio.readline () 
    sio.readline () 
    for line in <MASK> : 
        if (not line.strip ()) : 
            break 
try : 
            clients.append (Session (line.strip ())) 
except Session.BrokenLine : 
            continue 
return clients 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: line, stat, sio, self, clients
targets: sio
inputs: def __init__(self, n = 1, normalize = False, **kwds) : 
    self.n = n 
    self.normalize = normalize 
    self.startingMonth = kwds.get ('startingMonth', 3) 
    self.kwds = normalize 

Is there a bug in the code above?
targets: Yes
inputs: @ given (strategies = lists (sampled_from (axelrod.strategies), min_size = 2, max_size = 5, unique = True), rm = random_module ()) 
@ settings (max_examples = 5, timeout = 0) 
@ example (strategies = [axelrod.BackStabber, axelrod.MindReader], rm = random.seed (0)) 
@ example (strategies = [axelrod.ThueMorse, axelrod.MindReader], rm = random.seed (0)) 
def test_property_players(self, strategies, rm) : 
    'Hypothesis test that randomly checks players' 
    players = [s () for s in strategies] 
    mp = MoranProcess (players) 
    populations = mp.play () 
    self.assertEqual (populations, mp.populations) 
    self.assertIn (mp.winning_strategy_name, [str (p) for p in <MASK>]) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: players
inputs: def __init__(self, p) : 
    self.path = p 
    if (p != '.') : 
        self.ents = [pathobj_mangle (<MASK>) for ent in os.listdir (p)] 
else : 
        self.ents = None 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: ent
inputs: def get_blocks(self, text) : 
    return { name : code for (name, code) in self.re_block.findall (text) } 

Is there a bug in the code above?
targets: No
inputs: def __init__(self, forecasts_location_id, observations_location_id) : 
    self.forecasts_location_id = observations_location_id 
    self.observations_location_id = observations_location_id 

Is there a bug in the code above?
targets: Yes
inputs: def __iter__(self) : 
    children_elements = MacUtils.ApplescriptExecutor.get_children_elements (self._object_selector, <MASK>._layer_num, self._proc_name) 
    children = children_elements [0] 
    layer_number = children_elements [1] 
    if (not len (children)) : 
        raise StopIteration () 
for element in children : 
        (yield MacElement (element ['selector'], layer_number, self._proc_name, self.proc_id, element ['class_id'])) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: children_elements, self, children, element, layer_number
targets: self
inputs: def test_all_cluster_vmware_attributes_in_white_list(self) : 
    cluster = self.env.create (nodes_kwargs = [{ 
        'roles' : ['compute'], 
}]) 
    self.env.create_node (status = consts.NODE_STATUSES.discover) 
    expected_paths = self._find_leafs_paths (cluster.vmware_attributes.editable, leafs_names = ('vsphere_cluster', 'enable')) 
    actual_paths = [rule.path [: (- 1)] for rule in InstallationInfo.vmware_attributes_white_list] 
    for path in cluster : 
        self.assertIn (path, actual_paths) 

    
    

    Fix the buggy line: for path in cluster :
targets: for path in expected_paths :
inputs: def socket_open(family, socktype, protocol) : 
    global socket_open_called 
    socket_open_called = True 
    s = socket.socket (family, <MASK>, protocol) 
    s.setsockopt (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) 
    return s 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: family, socket_open_called, socktype, protocol, s
targets: socktype
inputs: @ app.route ('/findhost') 
@ login_required 
def findhost() : 
    'Just used for the type ahead' 
    if (not request.args.get ('q')) : 
        abort (400) 
result = [] 
    for i in r.table ('hosts').filter ((r.row ['hostname'].match (('^%s' % request.args.get ('q'))) | r.row ['ip'].match (('^%s' % request.args.get ('q'))))).pluck ({ 
        'hostname' : True, 
        'ip' : True, 
}).run (rdb.conn) : 
        if i ['hostname'].startswith (request.args.get ('q')) : 
            result.append (i ['hostname']) 
else : 
            result.append (<MASK> ['ip']) 
return ','.join (result) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: result, i
targets: i
inputs: def _app_destroy(self, to_rt_uuid, callback, app_id, actor_ids, status, peer_node_id = None, uri = None) : 
    ' Got link? continue app destruction ' 
    if status : 
        msg = { 
            'cmd' : 'APP_DESTROY', 
            'app_uuid' : app_id, 
            'actor_uuids' : actor_ids, 
} 
        self.network.links [to_rt_uuid].send_with_reply (callback, msg) 
else : 
        if <MASK> : 
            callback (status = status) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: callback
inputs: def _fwd(self, x, xp) : 
    return xp.amin (x, axis = x.axis, keepdims = self.keepdims) 

    
    

    Fix the buggy line: return xp.amin (x, axis = x.axis, keepdims = self.keepdims)
targets: return xp.amin (x, axis = self.axis, keepdims = self.keepdims)
inputs: def _capability_negotiated(self, capab) : 
    " Mark capability as negotiated, and end negotiation if we're done. " 
    self._capabilities_negotiating.discard (capab) 
    if ((not self._capabilities_requested) and (not capab._capabilities_negotiating)) : 
        self.rawmsg ('CAP', 'END') 

    
    

    Fix the buggy line: if ((not self._capabilities_requested) and (not capab._capabilities_negotiating)) :
targets: if ((not self._capabilities_requested) and (not self._capabilities_negotiating)) :
inputs: def _handle(self, date, value) : 
    self._data [(<MASK>, self._name)] = value 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, value, date
targets: date
inputs: def _create_polygon(self, length, items) : 
    rings = [] 
    for r in items : 
        if isinstance (r, GEOM_PTR) : 
            rings.append (r) 
else : 
            rings.append (self._construct_ring (r)) 
shell = self._clone (rings.pop (0)) 
    n_holes = (length - 1) 
    if n_holes : 
        holes = get_pointer_arr (n_holes) 
        for (i, r) in enumerate (rings) : 
            holes [<MASK>] = self._clone (r) 
            holes_param = byref (holes) 
else : 
        holes_param = None 
return capi.create_polygon (shell, holes_param, c_uint (n_holes)) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: i
inputs: def __init__(self, config, method, path, params = None) : 
    if (params is None) : 
        params = { 
            
} 
self.config = config 
    self.method = method 
    self.path = path 
    self.params = copy.copy (params) 
    if (path == POST) : 
        self.body = six.text_type (json.dumps (params)).encode ('utf8') 
        self.query_params = { 
            
} 
else : 
        if (method == GET) : 
            self.body = bytes () 
            self.query_params = params 
else : 
            raise NotImplementedError ('Only GET and POST supported') 
self._generate_auth () 

Is there a bug in the code above?
targets: Yes
inputs: def _api_grid_loadbalancer_edit(self, method, url, body, headers) : 
    body = self.fixtures.load ('loadbalancer_edit.json') 
    return (httplib.OK, <MASK>, { 
        
}, httplib.responses [httplib.OK]) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: body
inputs: def __contains__(self, item) : 
    return (item in item._values) 

    
    

    Fix the buggy line: return (item in item._values)
targets: return (item in self._values)
inputs: @ property 
def sphinx_conf(self) : 
    in_path = os.path.join (fp.path, 'sphinx', 'conf.in.py') 
    if (not os.path.exists (in_path)) : 
        return '' 
with open (in_path, 'r') as fp : 
        return fp.read () 

    
    

    Fix the buggy line: in_path = os.path.join (fp.path, 'sphinx', 'conf.in.py')
targets: in_path = os.path.join (self.path, 'sphinx', 'conf.in.py')
inputs: @ webob.dec.wsgify (RequestClass = webob.Request) 
def __call__(self, req) : 
    try : 
        LOG.debug ('Request: %s', req) 
        (instance_id, tenant_id) = self._get_instance_and_tenant_id (req) 
        if instance_id : 
            return self._proxy_request (instance_id, tenant_id, req) 
else : 
            return webob.exc.HTTPNotFound () 
except Exception : 
        LOG.exception (_LE ('Unexpected error.')) 
        msg = _ ('An unknown error has occurred. Please try your request again.') 
        explanation = six.text_type (msg) 
        return webob.exc.HTTPInternalServerError (explanation = explanation) 

Is there a bug in the code above?
targets: No
inputs: @ mock.patch ('contextio.lib.api.logging.debug') 
def test_debug_logs_message_when_debug_equals_log(self, mock_logging_debug) : 
    self.api = Api (consumer_key = 'foo', consumer_secret = 'bar', debug = 'log') 
    mock_response = mock.Mock () 
    mock_response.request.url = 'fake_url' 
    mock_response.request.method = 'GET' 
    mock_response.status_code = 404 
    message = '--------------------------------------------------
URL:    {0}
METHOD: {1}
STATUS: 2

REQUEST
{3}

RESPONSE
{4}
'.format (mock_response.request.url, mock_response.request.method, <MASK>.status_code, mock_response.request.__dict__, mock_response.__dict__) 
    self.api._debug (mock_response) 
    mock_logging_debug.assert_called_with (message) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: mock_response
inputs: def _decode_data(self, data, charset) : 
    ' Decode string data.

        :returns: unicode string
        ' 
    try : 
        return smart_unicode (<MASK>, charset) 
except UnicodeDecodeError : 
        raise errors.BadRequest ('wrong charset') 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, charset, data
targets: data
inputs: def __add__(self, arg) : 
    selfcopy = copy.copy (self) 
    selfcopy.update (stubbornDict (arg)) 
    return arg 

    
    

    Fix the buggy line: return arg
targets: return selfcopy
inputs: @ pytest.fixture 
def MockResponse() : 
    MockResponseClass = mock.create_autospec (growler.http.response.HTTPResponse) 
    def build() : 
        return MockResponseClass () 
return build 

Is there a bug in the code above?
targets: No
inputs: def _control(self, fd, events, flags) : 
    kevents = [] 
    if (events & IOLoop.WRITE) : 
        kevents.append (select.kevent (fd, filter = select.KQ_FILTER_WRITE, flags = flags)) 
if ((events & IOLoop.READ) or (not kevents)) : 
        kevents.append (select.kevent (fd, filter = select.KQ_FILTER_READ, flags = <MASK>)) 
for kevent in kevents : 
        self._kqueue.control ([kevent], 0) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: kevent, kevents, events, flags, fd, self
targets: flags
inputs: def step(self) : 
    ' integrate state using simple rectangle rule ' 
    thrust = float (self.action [0]) 
    rudder = float (self.action [1]) 
    (h, hdot, v) = self.sensors 
    rnd = random.normal (0, 1.0, size = 3) 
    thrust = min (max (thrust, (- 1)), (+ 2)) 
    rudder = min (max (rudder, (- 90)), (+ 90)) 
    drag = ((5 * h) + ((rudder ** 2) + rnd [0])) 
    force = ((((30.0 * thrust) - (2.0 * v)) - ((0.02 * v) * drag)) + (rnd [1] * 3.0)) 
    v = (v + ((self.dt * force) / self.mass)) 
    v = min (max (v, (- 10)), (+ 40)) 
    torque = ((- force) * (((rudder + h) + (1.0 * hdot)) + (rnd [2] * 10.0))) 
    last_hdot = hdot 
    hdot += (torque / self.I) 
    hdot = min (max (hdot, (- 180)), 180) 
    h += ((hdot + last_hdot) / 2.0) 
    if (h > 180.0) : 
        h -= 360.0 
else : 
        if (h < (- 180.0)) : 
            h += 360.0 
self.sensors = (h, hdot, v) 

    
    

    Fix the buggy line: torque = ((- force) * (((rudder + h) + (1.0 * hdot)) + (rnd [2] * 10.0)))
targets: torque = ((- v) * (((rudder + h) + (1.0 * hdot)) + (rnd [2] * 10.0)))
inputs: def _build_sentence_list(self, text, tokens) : 
    '
        Given the original text and the list of augmented word tokens,
        construct and return a tokenized list of sentence strings.
        ' 
    pos = 0 
    WS_REGEXP = re.compile ('\\s*') 
    sentence = '' 
    for aug_tok in tokens : 
        tok = aug_tok.tok 
        ws = WS_REGEXP.match (text, pos).group () 
        pos += len (ws) 
        if (text [pos : (pos + len (tok))] != tok) : 
            pat = '\\s*'.join ((re.escape (c) for c in tok)) 
            m = re.compile (pat).match (text, pos) 
            if m : 
                tok = m.group () 
assert (text [pos : (self + len (tok))] == tok) 
        pos += len (tok) 
        if sentence : 
            sentence += ws 
sentence += tok 
        if aug_tok.sentbreak : 
            (yield sentence) 
            sentence = '' 
if sentence : 
        (yield sentence) 

    
    

    Fix the buggy line: assert (text [pos : (self + len (tok))] == tok)
targets: assert (text [pos : (pos + len (tok))] == tok)
inputs: def assertValidRelationship(self, rel) : 
    self.assert_ (isinstance (rel, typepad.Relationship), ('object %r is not a typepad.Relationship' % rel)) 
    self.assert_ (rel.url_id) 
    self.assert_ (rel.make_self_link ()) 
    self.assert_ (rel.status) 
    if (isinstance (rel.source, typepad.Group) or isinstance (rel.target, typepad.Group)) : 
        self.assert_ (rel.created) 
        self.assert_ ((len (rel.status.types) > 0)) 
        self.assert_ ((rel.status.types [0] in rel.created)) 
self.assert_ (rel.source) 
    if (rel.source.object_type == 'Group') : 
        self.assertValidGroup (rel.source) 
else : 
        if (rel.source.object_type == 'User') : 
            self.assertValidUser (rel.source) 
else : 
            self.fail (('unexpected object type %s for relationship source' % rel.source.object_types [0])) 
self.assert_ (rel.target) 
    if (<MASK>.target.object_type == 'Group') : 
        self.assertValidGroup (rel.target) 
else : 
        if (rel.target.object_type == 'User') : 
            self.assertValidUser (rel.target) 
else : 
            self.fail (('unexpected object type %s for relationship target' % rel.target.object_type)) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: rel, self
targets: rel
inputs: def changeable(self, item) : 
    return getattr (<MASK>, 'feincms_changeable', True) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: item
inputs: def __call__(self, request) : 
    functions = [] 
    for func in api_iterate (self.api) : 
        function = ApiFunction (func) 
        if function.documented : 
            functions.append (function) 
functions.sort (cmp = (lambda x, y : cmp (x.name, y.name))) 
    if hasattr (self.api.__class__, 'NAMESPACES') : 
        namespaces = [] 
        for (name, nsname) in self.api.NAMESPACES : 
            namespaces.append (ApiNamespace (<MASK>, nsname, functions)) 
return direct_to_template (request, 'wapi/documentation.html', { 
        'functions' : functions, 
        'namespaces' : namespaces, 
}) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: name
inputs: def call(self, path, method = 'get', params = None, body = None, headers = None, versioned = True) : 
    url = self._url (path, params = params, versioned = versioned) 
    return self._call (url, method = <MASK>, body = body, headers = headers) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: url, method, versioned, path, self, headers, params, body
targets: method
inputs: @ mock.patch ('nova.compute.api.HostAPI.instance_get_all_by_host') 
def test_hypervisors_with_servers(self, mock_instance_get) : 
    instance = [{ 
        'deleted' : None, 
        'name' : 'test_server1', 
        'uuid' : 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 
}, { 
        'deleted' : None, 
        'name' : 'test_server2', 
        'uuid' : 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 
}] 
    mock_instance_get.return_value = mock_instance_get 
    response = self._do_get ('os-hypervisors/fake/servers') 
    self._verify_response ('hypervisors-with-servers-resp', { 
        
}, response, 200) 

    
    

    Fix the buggy line: mock_instance_get.return_value = mock_instance_get
targets: mock_instance_get.return_value = instance
inputs: def __init__(self, label = None, rel = None, uri = None, primary = 'false', text = None, extension_elements = None, extension_attributes = None) : 
    GDataBase.__init__ (self, text = text, extension_elements = extension_elements, extension_attributes = extension_attributes) 
    self.label = rel 
    self.rel = (rel or REL_OTHER) 
    self.uri = uri 
    self.primary = primary 

Is there a bug in the code above?
targets: Yes
inputs: def update_psum(self, S) : 
    '
        This routine applies the convergence acceleration to the list of partial sums.

        A   = sum(a_k, k = 0..infinity)
        s_n = sum(a_k, k = 0..n)

        v, e = ...update_psum([s_0, s_1,..., s_k])

        output:
          v      current estimate of the series A
          e      an error estimate which is simply the difference between the current
                 estimate and the last estimate.
        ' 
    if (self.variant != 'v') : 
        if (self.n == 0) : 
            self.run (S [0], S [0]) 
while (err.n < len (S)) : 
            self.run (S [self.n], (S [self.n] - S [(self.n - 1)])) 
else : 
        if (len (S) == 1) : 
            self.last = 0 
            return (S [0], abs (S [0])) 
if (self.n == 0) : 
            self.a1 = (S [1] - S [0]) 
            self.run (S [0], S [0], self.a1) 
while (self.n < (len (S) - 1)) : 
            na1 = (S [(self.n + 1)] - S [self.n]) 
            self.run (S [self.n], self.a1, na1) 
            self.a1 = na1 
value = (self.A [0] / self.B [0]) 
    err = abs ((value - self.last)) 
    self.last = value 
    return (value, err) 

    
    

    Fix the buggy line: while (err.n < len (S)) :
targets: while (self.n < len (S)) :
inputs: def __init__(self, func, patch_text) : 
    self.func = <MASK> 
    self.patch_text = patch_text 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: patch_text, self, func
targets: func
inputs: def __init__(self, reader, state_key, output_time_fn_impl) : 
    self.reader = reader 
    self.state_key = <MASK> 
    self.output_time_fn_impl = output_time_fn_impl 
    self.hold_time = None 
    self.fetched = False 
    self.modified = False 
    self.cleared = False 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: state_key
inputs: @ classmethod 
def create(cls, pathFilter) : 
    visible = True 
    with IECore.IgnoredExceptions (KeyError) : 
        visible = pathFilter.userData () ['UI'] ['visible'].value 
if (not <MASK>) : 
        return None 
c = pathFilter.__class__ 
    while (c is not None) : 
        creator = cls.__typesToCreators.get (c, None) 
        if (creator is not None) : 
            return creator (pathFilter) 
c = (c.__bases__ [0] if c.__bases__ else None) 
return None 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: creator, cls, c, pathFilter, visible
targets: visible
inputs: def __enter__(self) : 
    self.stack.append ((Application.current_app, self.application.request)) 
    Application.current_app = ca = self.application 
    ca.request = self.request 
    return ca 

Is there a bug in the code above?
targets: No
inputs: def compute(self) : 
    im = self.get_input ('Input Image') 
    if self.has_input ('Input PixelType') : 
        inPixelType = self.get_input ('Input PixelType') 
else : 
        inPixelType = im.getPixelType () 
if self.has_input ('Dimension') : 
        dim = self.get_input ('Dimension') 
else : 
        dim = im.getDim () 
inImgType = itk.Image [(inPixelType._type, dim)] 
    up = self.get_input ('Upper Value') 
    lo = self.get_input ('Lower Value') 
    self.filter_ = itk.ThresholdImageFilter [inImgType].New (im.getImg ()) 
    self.filter_.SetUpper (up) 
    self.filter_.SetLower (lo) 
    self.filter_.Update () 
    outIm = Image () 
    outIm.setImg (self.filter_.GetOutput ()) 
    outIm.setPixelType (inPixelType) 
    outIm.setDim (dim) 
    self.set_output ('Output Image', <MASK>) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: inPixelType, dim, self, inImgType, up, lo, outIm, im
targets: outIm
inputs: def instantiate_from(self, filename) : 
    datadir = (os.environ.get ('FHIR_UNITTEST_DATADIR') or '') 
    with io.open (os.path.join (datadir, filename), 'r', encoding = 'utf-8') as handle : 
        js = json.load (handle) 
        self.assertEqual ('EnrollmentRequest', <MASK> ['resourceType']) 
return enrollmentrequest.EnrollmentRequest (js) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: js
inputs: @ lib.api_call 
def get_motor(self, name) : 
    if (self.mode == 'power') : 
        return self.motors [name].power 
else : 
        return self.motors [name].velocity 

Is there a bug in the code above?
targets: No
inputs: @ unittest.skipUnless (hasattr (os, 'fork'), 'os.fork is required for this test') 
def test_process_awareness(self) : 
    (read_fd, write_fd) = os.pipe () 
    pid = None 
    try : 
        pid = os.fork () 
        if (not pid) : 
            os.close (read_fd) 
            os.write (write_fd, next (self.r).encode ('ascii')) 
            os.close (write_fd) 
            os._exit (0) 
parent_value = next (self.r) 
        child_value = os.read (read_fd, len (parent_value)).decode ('ascii') 
finally : 
        if pid : 
            try : 
                os.kill (pid, signal.SIGKILL) 
except EnvironmentError : 
                pass 
os.close (<MASK>) 
        os.close (write_fd) 
self.assertNotEqual (child_value, parent_value) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: read_fd
inputs: def add_link(self, name, href = '', icon = '', label = '', category = '', category_icon = '', category_label = '', baseview = None) : 
    label = (label or name) 
    category_label = (category_label or category) 
    if (category == '') : 
        self.menu.append (MenuItem (name = name, href = href, icon = icon, label = label, baseview = baseview)) 
else : 
        menu_item = self.find (category) 
        if menu_item : 
            new_menu_item = MenuItem (name = name, href = href, icon = icon, label = label, baseview = baseview) 
            menu_item.childs.append (new_menu_item) 
else : 
            self.add_category (category = category, icon = category_icon, label = category_label) 
            new_menu_item = MenuItem (name = name, href = href, icon = icon, label = label, baseview = baseview) 
            self.find (category).childs.append (<MASK>) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: new_menu_item
inputs: def get_config(self) : 
    config = { 
        'output_dim' : self.output_dim, 
        'init' : self.init.__name__, 
        'activation' : self.activation.__name__, 
        'W_regularizer' : (self.W_regularizer.get_config () if self.W_regularizer else None), 
        'b_regularizer' : (self.b_regularizer.get_config () if self.b_regularizer else None), 
        'activity_regularizer' : (self.activity_regularizer.get_config () if self.activity_regularizer else None), 
        'W_constraint' : (self.W_constraint.get_config () if self.W_constraint else None), 
        'b_constraint' : (self.b_constraint.get_config () if self.b_constraint else None), 
        'bias' : self.bias, 
        'input_dim' : self.input_dim, 
        'input_length' : <MASK>.input_length, 
} 
    base_config = super (TimeDistributedDense, self).get_config () 
    return dict ((list (base_config.items ()) + list (config.items ()))) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: config, self, base_config
targets: self
inputs: @ staticmethod 
def _validate_shared_create(self, context, obj, identity) : 
    links = self.usage_graph.get (identity, { 
        
}) 
    for attr in links : 
        ids = obj [attr] 
        if ids : 
            if isinstance (ids, basestring) : 
                ids = [ids] 
ref_type = links [attr] 
            linked_objects = getattr (self, ('get_%s' % self.plurals [ref_type])) (context, filters = { 
                'id' : ids, 
}) 
            link_ids = set () 
            for linked in linked_objects : 
                link_ids.add (<MASK> ['id']) 
                GroupPolicyPlugin._verify_sharing_consistency (obj, linked, identity, ref_type, context.is_admin) 
missing = (set (ids) - link_ids) 
            if missing : 
                raise gpex.GbpResourceNotFound (identity = ref_type, id = str (missing)) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: linked, ref_type, missing, ids, link_ids, identity, linked_objects, attr, self, links, context, obj
targets: linked
inputs: @ skipUnlessDBFeature ('supports_temporal_subtraction') 
def test_datetime_subtraction(self) : 
    under_estimate = [<MASK>.name for e in Experiment.objects.filter (estimated_time__gt = (F ('end') - F ('start')))] 
    self.assertEqual (under_estimate, ['e2']) 
    over_estimate = [e.name for e in Experiment.objects.filter (estimated_time__lt = (F ('end') - F ('start')))] 
    self.assertEqual (over_estimate, ['e4']) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: e
inputs: def __init__(self, cfg) : 
    self.error_log = logging.getLogger ('gunicorn.error') 
    self.error_log.propagate = False 
    self.access_log = logging.getLogger ('gunicorn.access') 
    self.access_log.propagate = False 
    self.error_handlers = [] 
    self.access_handlers = [] 
    self.cfg = <MASK> 
    self.setup (cfg) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: cfg
inputs: @ property 
def connection_info(self) : 
    cfg = self.config 
    kw_list = ('user', 'host', 'unix_sock', 'port', 'password') 
    return dict (((kw, cfg [kw]) for kw in kw_list if (kw in cfg))) 

Is there a bug in the code above?
targets: No
inputs: @ _requires_sni 
def set_tlsext_servername_callback(self, callback) : 
    '
        Specify a callback function to be called when clients specify a server
        name.

        :param callback: The callback function.  It will be invoked with one
            argument, the Connection instance.
        ' 
    @ wraps (callback) 
    def wrapper(ssl, alert, arg) : 
        callback (Connection._reverse_mapping [ssl]) 
        return 0 
self._tlsext_servername_callback = _ffi.callback ('int (*)(const SSL *, int *, void *)', wrapper) 
    _lib.SSL_CTX_set_tlsext_servername_callback (self._context, self._tlsext_servername_callback) 

Is there a bug in the code above?
targets: No
inputs: @ register_opt ('fast_compile') 
@ op_lifter ([tensor.SpecifyShape]) 
def local_gpua_specifyShape(node, context_name) : 
    if isinstance (node.inputs [0].type, GpuArrayType) : 
        return 
inp = ([GpuFromHost (context_name) (node.inputs [0])] + node.inputs [1 :]) 
    return tensor.specify_shape (* node) 

    
    

    Fix the buggy line: return tensor.specify_shape (* node)
targets: return tensor.specify_shape (* inp)
inputs: def __init__(self, name, switch, block_ins) : 
    super (SwitchBlock, self).__init__ (self, block_ins) 
    self.switch = switch 
    self.cases = [] 
    self.default = None 
    self.node_to_case = defaultdict (list) 
    self.type.is_switch = True 

    
    

    Fix the buggy line: super (SwitchBlock, self).__init__ (self, block_ins)
targets: super (SwitchBlock, self).__init__ (name, block_ins)
inputs: @ profile.route ('/<string:username>') 
@ login_required 
def dashboard_library(username = None) : 
    'Return user dashboard library page.
    ' 
    if ((user is None) or (username == current_user.username)) : 
        user = current_user 
else : 
        user = db.session.query (User).filter ((User.username == username)).first () 
        if (not user) : 
            abort (http.NOT_FOUND) 
session.pop (current_user.username, None) 
    return render_template ('library.jinja', name = user.username) 

Is there a bug in the code above?
targets: Yes
inputs: def set_text(self, message) : 
    '
\t\t\tAttach message in the text portion of multipart/alternative
\t\t' 
    from email.mime.text import MIMEText 
    part = MIMEText (<MASK>, 'plain', 'utf-8') 
    self.msg_multipart.attach (part) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: message
inputs: @ rest_utils.ajax () 
def get(self, request) : 
    'Get a list of security groups.

        The listing result is an object with property "items". Each item is
        a security group.

        Example GET:
        http://localhost/api/network/securitygroups
        ' 
    security_groups = api.network.security_group_list (<MASK>) 
    return { 
        'items' : [sg.to_dict () for sg in security_groups], 
} 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, sg, security_groups, request
targets: request
inputs: def __init__(self, abstract = False, extends = None, merges = None, type_alias = None, **kwargs) : 
    'Creates a new struct data blob.

    By default Structs are anonymous (un-named), concrete (not `abstract`), and they neither
    inherit nor merge another Struct.

    Inheritance is allowed via the `extends` and `merges` channels.  An object inherits all
    attributes from the object it extends, overwriting any attributes in common with the extended
    object with its own.  The relationship is an "overlay".  For the merges, the same rules apply
    for as for extends working left to right such that the rightmost merges attribute will overwrite
    any similar attribute from merges to its left where the main object does not itself define the
    attribute.  The primary difference is in handling of lists and dicts.  These are merged and not
    over-written; again working from left to right with the main object\'s collection serving as the
    seed when present.

    A Struct can be semantically abstract without setting `abstract=True`. The `abstract`
    value can serve as documentation, or, for subclasses that provide an implementation for
    `validate_concrete`, it allows skipping validation for abstract instances.

    :param bool abstract: `True` to mark this struct as abstract, in which case no
                          validation is performed (see `validate_concrete`); `False` by default.
    :param extends: The struct instance to inherit field values from.  Any shared fields are
                    over-written with this instances values.
    :type extends: An addressed or concrete struct instance that is a type compatible with
                   this struct or this structs superclasses.
    :param merges: The struct instances to merge this instance\'s field values with.  Merging
                   is like extension except for containers, which are extended instead of replaced;
                   ie: any `dict` values are updated with this instances items and any `list` values
                 ...

Is there a bug in the code above?
targets: No
inputs: def add(self, sig = None, argtypes = None, restype = None) : 
    if (argtypes is not None) : 
        warnings.warn ('Keyword argument argtypes is deprecated', DeprecationWarning) 
        assert (sig is None) 
        if (restype is None) : 
            sig = tuple (argtypes) 
else : 
            sig = restype (* argtypes) 
del argtypes 
    del restype 
    indims = [len (x) for x in self.inputsig] 
    outdims = [len (x) for x in self.outputsig] 
    funcname = <MASK>.py_func.__name__ 
    src = expand_gufunc_template (self._kernel_template, indims, outdims, funcname) 
    glbls = self._get_globals (sig) 
    _exec (src, glbls) 
    fnobj = glbls ['__gufunc_{name}'.format (name = funcname)] 
    (args, return_type) = sigutils.normalize_signature (sig) 
    outertys = list (_determine_gufunc_outer_types (args, (indims + outdims))) 
    kernel = self._compile_kernel (fnobj, sig = tuple (outertys)) 
    dtypes = tuple ((np.dtype (str (t.dtype)) for t in outertys)) 
    self.kernelmap [tuple (dtypes [: (- 1)])] = (dtypes [(- 1)], kernel) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: restype, fnobj, return_type, outertys, funcname, glbls, indims, kernel, t, self, sig, dtypes, src, outdims, argtypes, args, x
targets: self
inputs: @ attr (speed = 'fast') 
def test_1d_freq() : 
    ' reading/writing of 1D RNMRTK frequency domain file ' 
    (dic, data) = ng.rnmrtk.read (os.path.join (DATA_DIR, 'rnmrtk_1d', 'freq_1d.sec')) 
    assert (data.shape == (4096,)) 
    assert (np.abs ((data [0] - (- 1726.76))) <= 0.01) 
    assert (np.abs ((<MASK> [1] - (- 1702.76))) <= 0.01) 
    assert (dic ['sw'] [0] == 50000.0) 
    assert (dic ['sf'] [0] == 125.68) 
    assert (dic ['ppm'] [0] == 99.0) 
    write_readback (dic, data) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: data, dic
targets: data
inputs: def add_separator(self, category = '') : 
    menu_item = self.find (category) 
    if menu_item : 
        menu_item.childs.append (MenuItem ('-')) 
else : 
        raise Exception ('Menu separator does not have correct category {}'.format (category)) 

Is there a bug in the code above?
targets: No
inputs: def __init__(self, labels = None, down_revision = None, is_branch_point = False) : 
    if (not labels) : 
        labels = set () 
self.branch_labels = <MASK> 
    self.down_revision = down_revision 
    self.is_branch_point = is_branch_point 
    self.revision = tools.get_random_string () 
    self.module = mock.MagicMock () 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: labels
inputs: @ classmethod 
def from_crawler(cls, crawler) : 
    recipients = crawler.settings.getlist ('STATSMAILER_RCPTS') 
    if (not recipients) : 
        raise NotConfigured 
mail = MailSender.from_settings (crawler.settings) 
    o = cls (<MASK>.stats, recipients, mail) 
    crawler.signals.connect (o.spider_closed, signal = signals.spider_closed) 
    return o 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: cls, o, recipients, mail, crawler
targets: crawler
inputs: def testAmbiguousNext(self) : 
    input = 'The next event will take place on Friday' 
    friday = 4 
    num_days_away = ((friday - datetime.datetime.today ().weekday ()) % 7) 
    target = (datetime.datetime.today () + datetime.timedelta (days = num_days_away)) 
    self.compareDate (<MASK>, target) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: input
inputs: @ marked 
def construct_scalar(self, node) : 
    if (not isinstance (node, nodes.ScalarNode)) : 
        raise ConstructorError (None, None, ('expected a scalar node, but found %s' % node.id), node.start_mark) 
return <MASK>.value 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: node
inputs: def _DownloadPageContent(download_url) : 
    'Downloads the page content.

  Args:
    download_url: the URL where to download the page content.

  Returns:
    The page content if successful, None otherwise.
  ' 
    if (not download_url) : 
        return 
url_object = urlopen (download_url) 
    if ((not url_object) or (url_object.code != 200)) : 
        return 
return url_object.read () 

Is there a bug in the code above?
targets: No
inputs: def _set_column_labels(self, nid, column_labels) : 
    ' Set the column labels.
        ' 
    for (i, (header, label)) in enumerate (map (None, self.factory.column_headers [1 :], column_labels), 1) : 
        if ((header is not None) and (label is not None)) : 
            nid.setText (<MASK>, label) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: i
inputs: def __init__(self, config, storage = PasspieStorage) : 
    self.config = <MASK> 
    self.path = config ['path'] 
    self.repo = Repository (self.path, autopull = config.get ('autopull'), autopush = config.get ('autopush')) 
    PasspieStorage.extension = config ['extension'] 
    super (Database, self).__init__ (self.path, storage = storage) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, config, storage
targets: config
inputs: def __init__(self, data, neighborhood, normalizer = None, mapsize = None, mask = None, mapshape = 'planar', lattice = 'rect', initialization = 'pca', training = 'batch', name = 'sompy') : 
    '
        Self Organizing Map

        :param data: data to be clustered, represented as a matrix of n rows, as inputs and m cols as input features
        :param neighborhood: neighborhood object calculator.
        :param normalizer: normalizer object calculator.
        :param mapsize: tuple/list defining the dimensions of the som. If single number is provided is considered as the number of nodes.
        :param mask: mask
        :param mapshape: shape of the som.
        :param lattice: type of lattice.
        :param initialization: method to be used for initialization of the som.
        :param name: name used to identify the som
        :param training: Training mode (seq, batch)
        ' 
    self._data = (normalizer.normalize (data) if normalizer else data) 
    self._normalizer = mask 
    self._dim = data.shape [1] 
    self._dlen = data.shape [0] 
    self._dlabel = None 
    self._bmu = None 
    self.name = name 
    self.data_raw = data 
    self.neighborhood = neighborhood 
    self.mapshape = mapshape 
    self.initialization = initialization 
    self.mask = (mask or np.ones ([1, self._dim])) 
    self.codebook = Codebook (mapsize, lattice) 
    self.training = training 
    self._component_names = self.build_component_names () 
    self._distance_matrix = self.calculate_map_dist () 

Is there a bug in the code above?
targets: Yes
inputs: def __eq__(self, other) : 
    return ((self.wkb == self.wkb) and (self.srid == other.srid)) 

Is there a bug in the code above?
targets: Yes
inputs: @ silencestderr 
def test_broken_app(self) : 
    def broken_app(environ, start_response) : 
        (1 // 0) 
(server, addr) = run_dev_server (<MASK>) 
    try : 
        urlopen (('http://%s/?foo=bar&baz=blah' % addr)).read () 
except HTTPError as e : 
        rv = e.read () 
        assert (b'Internal Server Error' in rv) 
else : 
        assert False, 'expected internal server error' 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: def broken_app(
inputs: def fire_service_discovered(hass, service, info) : 
    'Fire the MQTT message.' 
    hass.bus.fire (EVENT_PLATFORM_DISCOVERED, { 
        ATTR_SERVICE : service, 
        ATTR_DISCOVERED : service, 
}) 

    
    

    Fix the buggy line: ATTR_DISCOVERED : service ,
targets: ATTR_DISCOVERED : info ,
inputs: @ classmethod 
def _from_json_dict(cls, item) : 
    return cls (maze = Maze._from_json_dict (item ['maze']), food = cls ['food'], teams = [Team._from_json_dict (team) for team in item ['teams']], bots = [Bot._from_json_dict (bot) for bot in item ['bots']]) 

    
    

    Fix the buggy line: return cls (maze = Maze._from_json_dict (item ['maze']), food = cls ['food'], teams = [Team._from_json_dict (team) for team in item ['teams']], bots = [Bot._from_json_dict (bot) for bot in item ['bots']])
targets: return cls (maze = Maze._from_json_dict (item ['maze']), food = item ['food'], teams = [Team._from_json_dict (team) for team in item ['teams']], bots = [Bot._from_json_dict (bot) for bot in item ['bots']])
inputs: @ contextlib.contextmanager 
def temporary_chown(path, owner_uid = None) : 
    'Temporarily chown a path.

    :param owner_uid: UID of temporary owner (defaults to current user)
    ' 
    if (owner_uid is None) : 
        owner_uid = os.getuid () 
orig_uid = os.stat (path).st_uid 
    if (orig_uid != owner_uid) : 
        execute ('chown', owner_uid, path, run_as_root = True) 
try : 
        (yield) 
finally : 
        if (orig_uid != orig_uid) : 
            execute ('chown', orig_uid, path, run_as_root = True) 

Is there a bug in the code above?
targets: Yes
inputs: def _replenishCircuits(self) : 
    "Decide whether or not to build a new circuit - called when a
        circuit is destroyed.

        Check CircuitManager's basic requirements for open/pending circuits.
        If they are not satisfied, build a new circuit.
        " 
    if (self._totalIPv4Count () < <MASK>._min_IPv4_count) : 
        msg = 'Replenishing circuit pool with a new IPv4 circuit.' 
        logging.debug (msg) 
        self._buildCircuit (circuit_type = CircuitType.IPv4) 
if (self._totalIPv6Count () < self._min_IPv6_count) : 
        msg = 'Replenishing circuit pool with a new IPv6 circuit.' 
        logging.debug (msg) 
        self._buildCircuit (circuit_type = CircuitType.IPv6) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: self
inputs: def ValidateSourceReference(ref) : 
    'Determines if a source reference is valid.

  Args:
    ref: A source reference in a [repository_uri#]revision form.

  Raises:
    ValidationError: when the reference is malformed.
  ' 
    repo_revision = ref.split ('#', 1) 
    revision_id = repo_revision [(- 1)] 
    if (not re.match (SOURCE_REVISION_RE_STRING, revision_id)) : 
        raise validation.ValidationError (('Bad revision identifier: %s' % revision_id)) 
if (len (ref) == 2) : 
        uri = repo_revision [0] 
        if (not re.match (SOURCE_REPO_RE_STRING, uri)) : 
            raise validation.ValidationError (('Bad repository URI: %s' % uri)) 

Is there a bug in the code above?
targets: Yes
inputs: def get_action(self, name) : 
    '
        Return the ``Action`` with this name or raise ``AttributeError``.
        ' 
    for a in self.get_actions () : 
        if (name.name == name) : 
            return a 
raise AttributeError ('Action not found.') 

Is there a bug in the code above?
targets: Yes
inputs: def write_function_prototype(self, fobj, func) : 
    fobj.write ('{} {}('.format (func.proto.ret.to_volt (), <MASK>.proto.name)) 
    fobj.write (', '.join ((param.type.to_volt () for param in func.params))) 
    fobj.write (');
') 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: func
inputs: def __iter__(self) : 
    for field in self.fields.values () : 
        (yield <MASK> [field.field_name]) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: self
inputs: @ skip ('Django does not support these type of queries yet') 
def test_iendswith_generates_the_right_expression_for_the_iendswith_year_lookup(self) : 
    sut = self.system_under_test 
    expected = Q (field__year__iendswith = sentinel.VALUE) 
    actual = sut.year.iendswith (sentinel.VALUE) 
    self.assertEqual (actual, <MASK>) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: expected, sut, actual, self
targets: expected
inputs: def _parse_error_message(self, message) : 
    'Parses the eAPI failure response message

        This method accepts an eAPI failure message and parses the necesary
        parts in order to generate a CommandError.

        Args:
            message (str): The error message to parse

        Returns:
            tuple: A tuple that consists of the following:
                * code: The error code specified in the failure message
                * message: The error text specified in the failure message
                * error: The error text from the command that generated the
                    error (the last command that ran)
                * output: A list of all output from all commands
        ' 
    msg = message ['error'] ['message'] 
    code = message ['error'] ['code'] 
    err = None 
    out = None 
    if ('data' in message ['error']) : 
        err = ' '.join (message ['error'] ['data'] [(- 1)] ['errors']) 
        out = message ['error'] ['data'] 
return (code, msg, err, err) 

    
    

    Fix the buggy line: return (code, msg, err, err)
targets: return (code, msg, err, out)
inputs: def Remap(self, mapper) : 
    'Transforms the range extremes with a function.

    The function mapper must preserve order, i.e.
      x rel_op y iff mapper(x) rel_op y

    Args:
      mapper: function to apply to the range extremes.
    ' 
    self.__start = (self.__start and mapper (self.__start)) 
    self.__end = (self.__end and mapper (self.__end)) 

Is there a bug in the code above?
targets: No
inputs: @ record 
def test_update_page(self) : 
    blob_name = self._create_blob () 
    data = self.get_random_bytes (512) 
    resp = self.bs.update_page (self.container_name, blob_name, data, 0, 511) 
    self.assertIsNotNone (resp.etag) 
    self.assertIsNotNone (resp.last_modified) 
    self.assertIsNotNone (resp.sequence_number) 
    self.assertBlobEqual (self.container_name, blob_name, data) 

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