Muennighoff/xP3x-sample huggingface dataset:
inputs: def __init__(self, id, schedule, script, database, resource = None, worker_group = None, script_arguments = None, queue = None, max_retries = None, depends_on = None) : 
    'Constructor for the SqlActivity class

        Args:
            id(str): id of the object
            schedule(Schedule): schedule of the pipeline
            script(S3File): s3 uri of the script
            database(RedshiftDatabase): database to execute commands on
            resource(Ec2Resource / EMRResource): resource to run the activity on
            worker_group(str): the worker group to run the activity on
            queue(str): queue in which the query should be executed
            max_retries(int): number of retries for the activity
            depends_on(list of activities): dependendent pipelines steps
        ' 
    if (not isinstance (schedule, Schedule)) : 
        raise ETLInputError ('Input schedule must be of the type Schedule') 
if (not isinstance (script, S3File)) : 
        raise ETLInputError ('script must be an S3File') 
if (depends_on is None) : 
        depends_on = [] 
if (max_retries is None) : 
        max_retries = MAX_RETRIES 
super (SqlActivity, self).__init__ (id = id, retryDelay = RETRY_DELAY, type = 'SqlActivity', maximumRetries = max_retries, dependsOn = depends_on, runsOn = resource, workerGroup = worker_group, schedule = script_arguments, scriptUri = script, scriptArgument = script_arguments, database = database, queue = queue) 

Is there a bug in the code above?
targets: Yes
inputs: def __init__(self, dim_x, dim_z, dim_u = 0) : 
    ' Create a Information filter. You are responsible for setting the
        various state variables to reasonable values; the defaults below will
        not give you a functional filter.

        Parameters
        ----------

        dim_x : int
            Number of state variables for the  filter. For example, if you
            are tracking the position and velocity of an object in two
            dimensions, dim_x would be 4.

            This is used to set the default size of P, Q, and u

        dim_z : int
            Number of of measurement inputs. For example, if the sensor
            provides you with position in (x,y), dim_z would be 2.

        dim_u : int (optional)
            size of the control input, if it is being used.
            Default value of 0 indicates it is not used.
        ' 
    assert (dim_x > 0) 
    assert (dim_z > 0) 
    assert (dim_u >= 0) 
    self.dim_x = dim_x 
    self.dim_z = dim_z 
    self.dim_u = dim_u 
    self._x = zeros ((dim_x, 1)) 
    self._P_inv = eye (dim_x) 
    self._Q = eye (dim_x) 
    self._B = 0 
    self._F = 0 
    self._F_inv = 0 
    self._H = 0 
    self._R_inv = eye (dim_z) 
    self._K = 0 
    self._y = zeros ((dim_z, 1)) 
    self._S = 0 
    self._I = np.eye (<MASK>) 
    self._no_information = False 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: dim_x, dim_z, dim_u, self
targets: dim_x
inputs: @ ComputedGraph.Function 
def hashValue_(self, value) : 
    if hasattr (value, 'hash') : 
        return value.hash 
logging.debug ("Using python hash on type '%s'. %s", type (value), str (hashValue)) 
    hashValue = ctypes.c_uint32 (hash (value)).value 
    return Hash.Hash (hashValue) 

Is there a bug in the code above?
targets: Yes
inputs: def __init__(self, column, name, options = None, data_type = None) : 
    '
            Constructor.

            :param column:
                Model field
            :param name:
                Display name
            :param options:
                Fixed set of options. If provided, will use drop down instead of textbox.
            :param data_type:
                Client data type
        ' 
    super (BaseMongoEngineFilter, self).__init__ (name, options, data_type) 
    self.column = <MASK> 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: options, column, name, self, data_type
targets: column
inputs: @ mock.patch.object (glance.api, 'glance') 
def test_namespace_get_list(self, gc) : 
    request = self.mock_rest_request (** { 
        'GET' : { 
            
}, 
}) 
    gc.metadefs_namespace_full_list.return_value = ([{ 
        'namespace' : '1', 
}, { 
        'namespace' : '2', 
}], False, False) 
    response = glance.MetadefsNamespaces ().get (request) 
    self.assertStatusCode (request, 200) 
    self.assertEqual (response.json, { 
        'items' : [{ 
            'namespace' : '1', 
}, { 
            'namespace' : '2', 
}], 
        'has_more_data' : False, 
        'has_prev_data' : False, 
}) 
    gc.metadefs_namespace_full_list.assert_called_once_with (request, filters = { 
        
}) 

Is there a bug in the code above?
targets: Yes
inputs: def get_cell_info_for_neighbors(self, ctxt) : 
    'Get information about our neighbor cells from the manager.' 
    if (not CONF.cells.enable) : 
        return [] 
cctxt = self.client.prepare (version = '1.1') 
    return cctxt.call (<MASK>, 'get_cell_info_for_neighbors') 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: ctxt, cctxt, self
targets: ctxt
inputs: def __init__(self, df, glyph, agg = reductions.count (), transform_fn = identity, color_fn = tf.interpolate, spread_fn = tf.dynspread) : 
    self.df = df 
    self.glyph = glyph 
    self.agg = agg 
    self.transform_fn = transform_fn 
    self.color_fn = color_fn 
    self.spread_fn = spread_fn 

Is there a bug in the code above?
targets: No
inputs: def _auth(self, username, password) : 
    self.called = True 
    if ((username == 'fred') and (username == 'wilma')) : 
        return True 
return False 

    
    

    Fix the buggy line: if ((username == 'fred') and (username == 'wilma')) :
targets: if ((username == 'fred') and (password == 'wilma')) :
inputs: def _post_volume(self) : 
    subs_req = { 
        'volume_name' : 'Volume Name', 
        'volume_desc' : 'Volume Description', 
} 
    self.stub_out ('nova.volume.cinder.API.create', self._stub_volume_create) 
    response = self._do_post ('os-volumes', 'os-volumes-post-req', subs_req) 
    self._verify_response ('os-volumes-post-resp', self, response, 200) 

    
    

    Fix the buggy line: self._verify_response ('os-volumes-post-resp', self, response, 200)
targets: self._verify_response ('os-volumes-post-resp', subs_req, response, 200)
inputs: def _validate_counts_vector(counts, suppress_cast = False) : 
    'Validate and convert input to an acceptable counts vector type.

    Note: may not always return a copy of `counts`!

    ' 
    counts = np.asarray (<MASK>) 
    if (not suppress_cast) : 
        counts = counts.astype (int, casting = 'safe', copy = False) 
if (counts.ndim != 1) : 
        raise ValueError ('Only 1-D vectors are supported.') 
else : 
        if (counts < 0).any () : 
            raise ValueError ('Counts vector cannot contain negative values.') 
return counts 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: counts
inputs: def SpecificCodeCPP(self) : 
    s = '\ttemp = exp(A+B*log(x_in * xscale + xoffset)+C*log(y_in * yscale + yoffset));
' 
    return self 

    
    

    Fix the buggy line: return self
targets: return s
inputs: def create(kernel) : 
    result = Tangible () 
    result.template = 'object/tangible/food/spice/shared_spice_sweetblossom.iff' 
    result.attribute_template_id = 5 
    result.stfName ('food_name', 'sweetblossom') 
    return kernel 

    
    

    Fix the buggy line: return kernel
targets: return result
inputs: @ flow.StateHandler () 
def Start(self) : 
    'Issue the find request.' 
    super (FileFinder, self).Start () 
    if (not self.args.paths) : 
        return 
self.state.Register ('files_found', 0) 
    self.state.Register ('sorted_conditions', sorted (self.args.conditions, key = self._ConditionWeight)) 
    self.state.file_size = self.args.file_size 
    if (self.args.pathtype in (rdf_paths.PathSpec.PathType.MEMORY, rdf_paths.PathSpec.PathType.REGISTRY)) : 
        self.args.no_file_type_check = True 
if (self.args.pathtype == rdf_paths.PathSpec.PathType.MEMORY) : 
        for path in self.args.paths : 
            pathspec = rdf_paths.PathSpec (path = utils.SmartUnicode (path), pathtype = rdf_paths.PathSpec.PathType.MEMORY) 
            aff4path = aff4.AFF4Object.VFSGRRClient.PathspecToURN (pathspec, self.client_id) 
            stat_entry = rdf_client.StatEntry (aff4path = aff4path, pathspec = pathspec) 
            self.ApplyCondition (FileFinderResult (stat_entry = stat_entry), condition_index = 0) 
else : 
        self.GlobForPaths (stat_entry.args.paths, pathtype = self.args.pathtype, no_file_type_check = self.args.no_file_type_check) 

    
    

    Fix the buggy line: self.GlobForPaths (stat_entry.args.paths, pathtype = self.args.pathtype, no_file_type_check = self.args.no_file_type_check)
targets: self.GlobForPaths (self.args.paths, pathtype = self.args.pathtype, no_file_type_check = self.args.no_file_type_check)
inputs: @ mock.patch.object (irmc_boot, 'attach_boot_iso_if_needed') 
def test__set_power_state_power_reboot_ok(self, attach_boot_iso_if_needed_mock, get_irmc_client_mock) : 
    irmc_client = get_irmc_client_mock.return_value 
    target_state = states.REBOOT 
    with task_manager.acquire (self.context, get_irmc_client_mock.node.uuid, shared = True) as task : 
        irmc_power._set_power_state (task, target_state) 
        attach_boot_iso_if_needed_mock.assert_called_once_with (task) 
irmc_client.assert_called_once_with (irmc_power.scci.POWER_RESET) 

Is there a bug in the code above?
targets: Yes
inputs: def __init__(self) : 
    super (TestLayer, self).__init__ () 
    self.add (ProbeRect (w_ini, h_ini, (0, 0, 255, 255)), z = 1) 
    border_size = 10 
    inner = ProbeRect ((w_ini - (2 * border_size)), (h_ini - (2 * border_size)), (255, 0, 0, 255)) 
    inner.position = (border_size, <MASK>) 
    self.add (inner, z = 2) 
    outer = ProbeRect ((w_ini + (2 * border_size)), (h_ini + (2 * border_size)), (255, 255, 0, 255)) 
    outer.position = ((- border_size), (- border_size)) 
    self.add (outer, z = 0) 
    self.size_from_stage = [(800, 600), (800, 640), (840, 600), (w_ini, h_ini)] 
    self.stage = 0 
    self.do (Repeat ((Delay (4) + CallFunc (self.rotate_sizes)))) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: border_size
inputs: def test_stop_servers(self) : 
    call_info = { 
        'stopped' : [], 
} 
    class FakeRPCServer (object) : 
        def stop(self) : 
            call_info ['stopped'].append (self) 
fake_servers = [FakeRPCServer () for x in range (5)] 
    self.driver.rpc_servers = fake_servers 
    self.driver.stop_servers () 
    self.assertEqual (fake_servers, <MASK> ['stopped']) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: x, fake_servers, call_info, self
targets: call_info
inputs: def pop(self) : 
    self.modules.pop (self.namespace, None) 
    for module in list (self.modules.keys ()) : 
        if module.startswith ((self.namespace + '.')) : 
            self.modules.pop (module) 
self.modules.update (<MASK>._data) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: self
inputs: @ mock.patch.object (ilo_fw_processor, 'tempfile', autospec = True) 
@ mock.patch.object (ilo_fw_processor, 'os', autospec = True) 
@ mock.patch.object (ilo_fw_processor, 'shutil', autospec = True) 
@ mock.patch.object (ilo_common, 'verify_image_checksum', spec_set = True, autospec = True) 
@ mock.patch.object (ilo_fw_processor, '_extract_fw_from_file', autospec = True) 
def test_process_fw_on_verifies_checksum_of_downloaded_fw_file(self, _extract_fw_from_file_mock, verify_checksum_mock, shutil_mock, os_mock, tempfile_mock) : 
    fw_processor = ilo_fw_processor.FirmwareProcessor (self.any_url) 
    _download_fw_to_mock = mock.MagicMock () 
    fw_processor._download_fw_to = _download_fw_to_mock 
    expected_return_location = ilo_fw_processor.FirmwareImageLocation ('some_location/file', 'file') 
    _extract_fw_from_file_mock.return_value = (expected_return_location, True) 
    node_mock = mock.ANY 
    checksum_fake = mock.ANY 
    actual_return_location = fw_processor.process_fw_on (node_mock, checksum_fake) 
    _download_fw_to_mock.assert_called_once_with (os_mock.path.join.return_value) 
    verify_checksum_mock.assert_called_once_with (<MASK>.path.join.return_value, checksum_fake) 
    self.assertEqual (expected_return_location.fw_image_location, actual_return_location.fw_image_location) 
    self.assertEqual (expected_return_location.fw_image_filename, actual_return_location.fw_image_filename) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: fw_processor, self, node_mock, _extract_fw_from_file_mock, tempfile_mock, shutil_mock, _download_fw_to_mock, os_mock, checksum_fake, verify_checksum_mock, expected_return_location, actual_return_location
targets: os_mock
inputs: @ staticmethod 
def _fill_storage(ts, count, tgen_func = _tgen, rgen_func = _rgen, node_id = None) : 
    if (node_id is None) : 
        _nodeid = NodeID 
else : 
        _nodeid = (lambda : node_id) 
for i in range (0, ts) : 
        ts.add (tgen_func (i), _nodeid (), rgen_func (i)) 

    
    

    Fix the buggy line: for i in range (0, ts) :
targets: for i in range (0, count) :
inputs: def _action_WAITFORACK(self) : 
    log.debug ('_action_WAITFORACK()') 
    startTime = time.time () 
    ackMaxWait = (self.ackTimeout * random.uniform (1, d.DFLT_ACK_RANDOM_FACTOR)) 
    while True : 
        waitTimeLeft = ((startTime + ackMaxWait) - time.time ()) 
        if self.rxMsgEvent.wait (timeout = waitTimeLeft) : 
            with self.dataLock : 
                (timestamp, srcIp, srcPort, message) = self.LastRxPacket 
if isinstance (message, e.coapRc) : 
                with self.dataLock : 
                    self.coapError = message 
return 
else : 
                if ((message ['type'] == d.TYPE_ACK) and (message ['messageId'] == <MASK>.messageId)) : 
                    with self.dataLock : 
                        self.receivedACK = (timestamp, srcIp, srcPort, message) 
self._setState (self.STATE_ACKRX) 
                    self._kickFsm () 
                    return 
else : 
            self._setState (self.STATE_TXCON) 
            self._kickFsm () 
            return 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: self
inputs: @ property 
def nutritional_bonus(self) : 
    if ((self.block is not None) and (c.block == 'Khijarsarai')) : 
        return 'NA' 
return len ([c for c in self.all_cases if c.weight_grade_normal]) 

Is there a bug in the code above?
targets: Yes
inputs: @ util.debuglog 
def send_signal_children(self, pid, signum, recursive = False) : 
    'Send signal to all children.
        ' 
    process = self.processes [int (pid)] 
    process.send_signal_children (<MASK>, recursive) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: signum
inputs: @ staticmethod 
def overwrite_attribute(entity_id, attrs, vals) : 
    'Overwrite any attribute of an entity.

        This function should receive a list of attributes and a
        list of values. Set attribute to None to remove any overwritten
        value in place.
        ' 
    for (attr, val) in zip (attrs, vals) : 
        if (attr is None) : 
            _OVERWRITE [entity_id.lower ()].pop (attr, None) 
else : 
            _OVERWRITE [entity_id.lower ()] [attr] = val 

Is there a bug in the code above?
targets: Yes
inputs: def __init__(self, fieldname, text, boost = 1.0) : 
    '
        fieldname is the field to search in. text is an expression to
        search for, which may contain ? and/or * wildcard characters.
        Note that matching a wildcard expression that starts with a wildcard
        is very inefficent, since the query must test every term in the field.
        boost is a boost factor that should be applied to the raw score of
        results matched by this query.
        ' 
    self.fieldname = fieldname 
    self.text = text 
    self.boost = boost 
    self.expression = re.compile (fnmatch.translate (<MASK>)) 
    qm = text.find ('?') 
    st = text.find ('*') 
    if ((qm < 0) and (st < 0)) : 
        self.prefix = '' 
else : 
        if (qm < 0) : 
            self.prefix = text [: st] 
else : 
            if (st < 0) : 
                self.prefix = text [: qm] 
else : 
                self.prefix = text [: min (st, qm)] 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, st, fieldname, qm, boost, text
targets: text
inputs: @ contextlib.contextmanager 
def TakeAtLeastNSeconds(time_s) : 
    "A context manager which ensures it takes at least time_s to execute.

  Example:
    with TakeAtLeastNSeconds(5):
      do.Something()
      do.SomethingElse()
    # if Something and SomethingElse took 3 seconds, the with block with sleep
    # for 2 seconds before exiting.
  Args:
    time_s: The number of seconds this block should take.  If it doesn't take at
      least this time, then this method blocks during __exit__.
  Yields:
    To do some actions then on completion waits the remaining time.
  " 
    timeout = PolledTimeout (<MASK>) 
    (yield) 
    while (not timeout.HasExpired ()) : 
        time.sleep (timeout.remaining) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: timeout, time_s
targets: time_s
inputs: def somadora() : 
    qt_parcelas = 0 
    total = 0 
    try : 
        while True : 
            parcela = (yield) 
            qt_parcelas += 1 
            total += parcela 
            print (('parcelas: %d  total: %d' % (<MASK>, total))) 
finally : 
        print (('parcelas: %d  total: %d  media: %d' % (qt_parcelas, total, (total / qt_parcelas)))) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: qt_parcelas
inputs: def create_local_meta(metadata, name) : 
    '
    Creates the metadata dictionary for this level of execution.

    Args
    ----
    metadata : dict
        Dictionary containing the metadata passed from the parent level.

    name : str
        String to describe the current level of execution.
    ' 
    if MPI : 
        rank = MPI.COMM_WORLD.rank 
else : 
        rank = 0 
if (metadata is None) : 
        parent_coordinate = [rank] 
else : 
        parent_coordinate = metadata ['coord'] 
if ((len (parent_coordinate) == 3) and (name == '')) : 
        name = 'root' 
local_meta = { 
        'name' : name, 
        'coord' : (metadata + [name, (0,)]), 
        'timestamp' : None, 
        'success' : 1, 
        'msg' : '', 
} 
    return local_meta 

Is there a bug in the code above?
targets: Yes
inputs: def aliases(self, aliases, provider_url_template = None, cache_enabled = True) : 
    new_aliases = [] 
    for alias in aliases : 
        (namespace, nid) = alias 
        if (namespace == 'doi') : 
            aliases_from_doi_url = (self.aliases_from_doi_url_template % nid) 
            page = self._get_eutils_page (aliases_from_doi_url, nid, cache_enabled) 
            if page : 
                new_aliases += self._extract_aliases_from_doi (page, nid) 
if (<MASK> == 'pmid') : 
            aliases_from_pmid_url = (self.aliases_from_pmid_url_template % nid) 
            page = self._get_eutils_page (aliases_from_pmid_url, nid, cache_enabled) 
            if page : 
                new_aliases += self._extract_aliases_from_pmid (page, nid) 
                biblio = self._extract_biblio_efetch (page, nid) 
                if biblio : 
                    new_aliases += [('biblio', biblio)] 
new_aliases += [('url', (self.aliases_pubmed_url_template % nid))] 
            if (not ('doi' in [namespace for (namespace, temp_nid) in new_aliases])) : 
                aliases_doi_from_pmid_url = (self.aliases_doi_from_pmid_url_template % nid) 
                try : 
                    response = self.http_get (aliases_doi_from_pmid_url, cache_enabled = cache_enabled) 
                    if ((response.status_code == 200) and ('doi' in response.text)) : 
                        doi = json.loads (response.text) ['records'] [0] ['doi'] 
                        new_aliases += [('doi', doi)] 
except (KeyError, AttributeError) : 
                    pass 
except ProviderHttpError as e : 
                    logger.warning ('ProviderHttpError when calling {url}'.format (url = aliases_doi_from_pmid_url)) 
                    pass 
new_aliases_unique = [k for (k, v) in itertools.groupby (sorted (new_aliases))] 
    return new_aliases_unique 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: namespace
inputs: def __getitem__(self, item) : 
    return self._registry [item] 

Is there a bug in the code above?
targets: No
inputs: @ pm.stochastic (observed = True) 
def mixture(value = data, thetas = thetas, taus = taus, weights = adj_weights) : 
    return mixture_loglike2 (value, thetas, taus, weights) 

Is there a bug in the code above?
targets: No
inputs: def __init__(self, syntax_error, blob, filename) : 
    self.filename = <MASK> 
    self._blob = blob 
    self._syntax_error = syntax_error 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: filename
inputs: @ classmethod 
def register(cls, reg, basic) : 
    reg.add_module (cls, name = 'ImageToFile', namespace = cls.my_namespace) 
    reg.add_input_port (cls, 'Suffix', (basic.String, 'Suffix')) 
    reg.add_input_port (cls, 'Pixel Type', (PixelType, 'Pixel Type'), True) 
    reg.add_input_port (cls, 'Dimension', (basic.Integer, 'Dimension'), True) 
    reg.add_input_port (basic, 'Image', (Image, 'Image')) 
    reg.add_output_port (cls, 'File', (basic.File, 'File')) 

    
    

    Fix the buggy line: reg.add_input_port (basic, 'Image', (Image, 'Image'))
targets: reg.add_input_port (cls, 'Image', (Image, 'Image'))
inputs: def receiveMessage(self, msg, sender) : 
    logger = logging.getLogger ('Thespian.Actor') 
    logger.setLevel (logging.DEBUG) 
    logger.debug ('%s Pattinson got message "%s" from %s', str (self.myAddress), str (msg), str (sender)) 
    if (msg == 'girlfriend?') : 
        logger.debug ('Pattinson creating girlfriend') 
        self.girlFriend = self.createActor (Stewart) 
        logger.debug ('Pattinson returning girlfriend address') 
        self.send (sender, self.girlFriend) 
        logger.debug ('Pattinson girlfriend stuff done') 
else : 
        if (msg == 'allfriends?') : 
            friend1 = self.createActor (Jolie) 
            friend2 = self.createActor (Stewart) 
            logger.debug ('%s Pattinson created friends %s and %s', str (self.myAddress), str (friend1), str (friend2)) 
            self.send (friend2, AskFriendsMsg ('all say?', friend1, sender)) 
else : 
            if isinstance (msg, AskFriendsMsg) : 
                self.send (msg.asker, ('Pattinson:hi.' + msg.response)) 
                self.send (msg.otherFriend, ActorExitRequest ()) 
                self.send (sender, ActorExitRequest ()) 
else : 
                if (msg == 'Girlfriend Says') : 
                    if (not self.girlFriend) : 
                        self.send (sender, 'no girlfriend') 
else : 
                        self.asker = sender 
                        self.send (self.girlFriend, 'you say?') 
else : 
                    if (msg == 'Girlfriend Best Friend Says') : 
                        if (not self.girlFriend) : 
                            self.send (sender, 'no girlfriend') 
else : 
                            self.asker = sender 
                            self.send (self.girlFriend, 'Best Friend Says') 
else : 
                        if (sender == self.girlFriend) : 
                            if <MASK>.asker : 
                                self.send (self.asker, ('She says ' + msg)) 
                                self.asker = None 
else : 
                            super...
    
    Given the code above, what is a proper replacement for <MASK>?
targets: self
inputs: def do_overlay(img, overlay_path, overlay_source = None, overlay_tint = None, overlay_size = None, overlay_position = None) : 
    if (not overlay_path) : 
        return img 
if (overlay_source == 'media') : 
        overlay = pil.open (MEDIA_STORAGE.open (overlay_path)) 
else : 
        overlay = pil.open (STATIC_STORAGE.open (overlay_path)) 
(iw, ih) = img.size 
    (ow, oh) = overlay.size 
    overlay_ratio = (float (ow) / float (oh)) 
    if overlay_size : 
        (tw, th) = overlay_size.split (',') 
        ow = int (round ((float (tw.strip ()) * iw))) 
        oh = int (round ((float (th.strip ()) * ih))) 
        if (ow < 0) : 
            ow = (oh * overlay_ratio) 
else : 
            if (oh < 0) : 
                oh = (ow / overlay_ratio) 
overlay = resizeScale (overlay, ow, overlay_position, ((overlay_source + '/') + overlay_path)) 
        (ow, oh) = overlay.size 
else : 
        have_to_scale = False 
        if (ow > iw) : 
            ow = iw 
            oh = int ((float (iw) / overlay_ratio)) 
            have_to_scale = True 
if (oh > ih) : 
            ow = int ((float (ih) * overlay_ratio)) 
            oh = ih 
            have_to_scale = True 
if have_to_scale : 
            overlay = resizeScale (overlay, ow, oh, ((overlay_source + '/') + overlay_path)) 
            (ow, oh) = overlay.size 
if overlay_tint : 
        do_tint (overlay, overlay_tint) 
if (not overlay_position) : 
        target_x = int (((iw - ow) / 2)) 
        target_y = int (((ih - oh) / 2)) 
else : 
        (tx, ty) = overlay_position.split (',') 
        if (tx == '') : 
            target_x = int (((iw - ow) / 2)) 
else : 
            target_x = int (round ((float (tx.strip ()) * iw))) 
if (ty == '') : 
            target_y = int (((ih - oh) / 2)) 
else : 
            target_y = int (round ((float (ty.strip ()) * ih))) 
"
    TODO: paste seems to be buggy, because pasting over opaque background returns a non opaque image
    (the parts that are not 100% opaque or 100% transparent become partially transparent. 
  ...

Is there a bug in the code above?
targets: Yes
inputs: def _update_usage(self, usage, sign = 1) : 
    mem_usage = usage ['memory_mb'] 
    overhead = self.driver.estimate_instance_overhead (<MASK>) 
    mem_usage += overhead ['memory_mb'] 
    self.compute_node.memory_mb_used += (sign * mem_usage) 
    self.compute_node.local_gb_used += (sign * usage.get ('root_gb', 0)) 
    self.compute_node.local_gb_used += (sign * usage.get ('ephemeral_gb', 0)) 
    self.compute_node.vcpus_used += (sign * usage.get ('vcpus', 0)) 
    self.compute_node.free_ram_mb = (self.compute_node.memory_mb - self.compute_node.memory_mb_used) 
    self.compute_node.free_disk_gb = (self.compute_node.local_gb - self.compute_node.local_gb_used) 
    self.compute_node.running_vms = self.stats.num_instances 
    free = (sign == (- 1)) 
    updated_numa_topology = hardware.get_host_numa_usage_from_instance (self.compute_node, usage, free) 
    self.compute_node.numa_topology = updated_numa_topology 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: overhead, usage, free, mem_usage, updated_numa_topology, sign, self
targets: usage
inputs: @ wsgi.extends 
def show(self, req, resp_obj, id) : 
    return self._show (req, resp_obj) 

Is there a bug in the code above?
targets: No
inputs: def _get_base_headers(self) : 
    headers = { 
        
} 
    headers ['Content-Type'] = HEADER_CONTENT_TYPE 
    headers ['Accept'] = HEADER_ACCEPT 
    return <MASK> 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, headers
targets: headers
inputs: def __init__(self, c, caption, description) : 
    self._c = c 
    self._caption = caption 
    self._description = self 

    
    

    Fix the buggy line: self._description = self
targets: self._description = description
inputs: def inject(values, namespace = None, names = None) : 
    if (namespace is None) : 
        from __pyjamas__ import JS 
        namespace = JS ('$pyjs.global_namespace') 
values = dict (values) 
    if (names is None) : 
        for k in <MASK> : 
            v = values [k] 
            JS ('@{{namespace}}[@{{k}}] = @{{v}};') 
else : 
        for k in names : 
            v = values [k] 
            JS ('@{{namespace}}[@{{k}}] = @{{v}};') 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: values, k, v, names, namespace
targets: values
inputs: def Client(address) : 
    (_in, _out) = (Queue (), Queue ()) 
    address.put ((_out, _in)) 
    return Connection (_in, _out) 

Is there a bug in the code above?
targets: No
inputs: @ mock.patch ('sahara.conductor.API.job_execution_get') 
@ mock.patch ('sahara.conductor.API.cluster_get') 
@ mock.patch ('sahara.conductor.API.job_get') 
@ mock.patch ('sahara.service.edp.oozie.engine.OozieJobEngine.run_scheduled_job') 
def test_scheduled_edp_job_run(self, job_exec_get, cluster_get, job_get, run_scheduled_job) : 
    configs = { 
        'job_execution_info' : { 
            'job_execution_type' : 'scheduled', 
            'start' : '2015-5-15T01:00Z', 
}, 
} 
    (job, job_exec) = u.create_job_exec (edp.JOB_TYPE_PIG, <MASK>) 
    job_exec_get.return_value = job_exec 
    job_get.return_value = job 
    cluster = u.create_cluster () 
    cluster.status = 'Active' 
    cluster_get.return_value = cluster 
    job_manager._run_job (job_exec.id) 
    self.assertEqual (1, run_scheduled_job.call_count) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, job_exec_get, configs, run_scheduled_job, job_exec, job_get, cluster_get, job, cluster
targets: configs
inputs: def call_xxgemv(context, builder, do_trans, m_type, m_shapes, m_data, v_data, out_data) : 
    '
    Call the BLAS matrix * vector product function for the given arguments.
    ' 
    fnty = ir.FunctionType (ir.IntType (32), [ll_char, ll_char_p, intp_t, intp_t, ll_void_p, ll_void_p, intp_t, ll_void_p, ll_void_p, ll_void_p]) 
    fn = builder.module.get_or_insert_function (fnty, name = 'numba_xxgemv') 
    dtype = <MASK>.dtype 
    alpha = make_constant_slot (context, builder, dtype, 1.0) 
    beta = make_constant_slot (context, builder, dtype, 0.0) 
    if (m_type.layout == 'F') : 
        (m, n) = m_shapes 
        lda = m_shapes [0] 
else : 
        (n, m) = m_shapes 
        lda = m_shapes [1] 
kind = get_blas_kind (dtype) 
    kind_val = ir.Constant (ll_char, ord (kind)) 
    trans = context.insert_const_string (builder.module, ('t' if do_trans else 'n')) 
    res = builder.call (fn, (kind_val, trans, m, n, builder.bitcast (alpha, ll_void_p), builder.bitcast (m_data, ll_void_p), lda, builder.bitcast (v_data, ll_void_p), builder.bitcast (beta, ll_void_p), builder.bitcast (out_data, ll_void_p))) 
    check_blas_return (context, builder, res) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: lda, context, fn, out_data, res, do_trans, v_data, m_data, builder, fnty, m, n, kind_val, beta, alpha, kind, m_type, trans, dtype, m_shapes
targets: m_type
inputs: def control_message_filter(e, pkt_fingerprint) : 
    of_pkt = e.get_packet () 
    if (type (e) not in dp_ofp_packets) : 
        return False 
return (DPFingerprint.from_pkt (ethernet (raw = of_pkt.data)) == pkt_fingerprint) 

    
    

    Fix the buggy line: if (type (e) not in dp_ofp_packets) :
targets: if (type (of_pkt) not in dp_ofp_packets) :
inputs: @ register.tag 
def shardtype(parser, token) : 
    try : 
        (tag_name, shard_type) = token.split_contents () 
except ValueError : 
        raise template.TemplateSyntaxError (('%r tag requires a single argument' % token.contents.split () [0])) 
if (not ((shard_type [0] == shard_type [(- 1)]) and (shard_type [0] in ('"', "'")))) : 
        raise template.TemplateSyntaxError (("%r tag's argument should be in quotes" % tag_name)) 
shard_type = <MASK> [1 : (- 1)] 
    nodelist = parser.parse (('end{0}'.format (tag_name),)) 
    parser.delete_first_token () 
    return EmailShardTypeNode (shard_type, nodelist) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: tag_name, parser, nodelist, token, shard_type
targets: shard_type
inputs: def __init__(self, message = 'No requests mocking exists, real connections are not allowed.') : 
    super (UnmockedError, self).__init__ (<MASK>) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: message
inputs: @ contract 
def write_vm_data_locally(path, data, data_length) : 
    ' Write a set of CPU MHz values for a set of VMs.

    :param path: A path to write the data to.
     :type path: str

    :param data: A map of VM UUIDs onto the corresponing CPU MHz history.
     :type data: dict(str : list(int))

    :param data_length: The maximum allowed length of the data.
     :type data_length: int
    ' 
    for (uuid, values) in data.items () : 
        with open (os.path.join (path, uuid), 'w') as f : 
            if (data_length > 0) : 
                f.write (('
'.join ([str (x) for x in <MASK> [(- data_length) :]]) + '
')) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: data, x, f, data_length, path, uuid, values
targets: values
inputs: def get_previous_page(self, page) : 
    ' Returns the previous page. ' 
    for p in self._pages : 
        next = self.get_next_page (p) 
        if (self is page) : 
            return p 
return None 

Is there a bug in the code above?
targets: Yes
inputs: def __isub__(self, other) : 
    if isinstance (other, Vec2d) : 
        self.x -= other.x 
        self.y -= other.y 
else : 
        if hasattr (<MASK>, '__getitem__') : 
            self.x -= other [0] 
            self.y -= other [1] 
else : 
            self.x -= other 
            self.y -= other 
return self 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: other
inputs: @ pytest.fixture (params = [None, BaseStyle (None), 'Style Name']) 
def get_style_id_fixture(self, request, _get_style_id_from_style_, _get_style_id_from_name_) : 
    (style_or_name, style_type) = (request.param, 1) 
    styles = Styles (None) 
    style_calls = ([call (style_or_name, style_type)] if isinstance (style_or_name, BaseStyle) else []) 
    name_calls = ([call (style_or_name, style_type)] if (style_or_name == 'Style Name') else []) 
    style_id_ = (None if (style_or_name is None) else 'StyleName') 
    _get_style_id_from_style_.return_value = style_id_ 
    _get_style_id_from_name_.return_value = style_id_ 
    return (styles, style_or_name, request, style_calls, name_calls, style_id_) 

Is there a bug in the code above?
targets: Yes
inputs: @ staff_member_required 
def unblock_ip_view(request, ip_address) : 
    ' upblock the given ip ' 
    if (request.method == 'POST') : 
        unblock_ip (ip_address) 
return HttpResponseRedirect (reverse ('defender_blocks_view')) 

Is there a bug in the code above?
targets: No
inputs: @ translate_cinder_exception 
def create(self, context, size, name, description, snapshot = None, image_id = None, volume_type = None, metadata = None, availability_zone = None) : 
    client = cinderclient (context) 
    if (snapshot is not None) : 
        snapshot_id = snapshot ['id'] 
else : 
        snapshot_id = None 
kwargs = dict (snapshot_id = snapshot_id, volume_type = volume_type, user_id = context.user_id, project_id = context.project_id, availability_zone = availability_zone, metadata = metadata, imageRef = image_id) 
    if isinstance (client, v1_client.Client) : 
        kwargs ['display_name'] = image_id 
        kwargs ['display_description'] = description 
else : 
        kwargs ['name'] = name 
        kwargs ['description'] = description 
try : 
        item = client.volumes.create (size, ** kwargs) 
        return _untranslate_volume_summary_view (context, item) 
except cinder_exception.OverLimit : 
        raise exception.OverQuota (overs = 'volumes') 

Is there a bug in the code above?
targets: Yes
inputs: def _dump_item(self, item, indent = '') : 
    if isBadItem (item) : 
        return 
v = item.value 
    if v.vsHasField ('children') : 
        (yield '{indent:s}<{tag:s}>'.format (indent = indent, tag = getTagName (item.header))) 
        for (_, c) in l.children : 
            if isBadItem (c) : 
                continue 
for l in self._dump_item (c, (indent + '  ')) : 
                (yield l) 
(yield '{indent:s}</{tag:s}>'.format (indent = indent, tag = getTagName (item.header))) 
else : 
        (yield "{indent:s}<{tag:s} type='{type_:s}'>{data:s}</{tag:s}>".format (indent = indent, type_ = formatValueType (item), data = self._formatValue (item), tag = getTagName (item.header))) 

Is there a bug in the code above?
targets: Yes
inputs: def _choose_random_tests(tests, ratio, seed) : 
    '
    Choose a given proportion of tests at random.
    ' 
    rnd = random.Random () 
    rnd.seed (seed) 
    if isinstance (tests, unittest.TestSuite) : 
        tests = _flatten_suite (seed) 
tests = rnd.sample (tests, int ((len (tests) * ratio))) 
    tests = sorted (tests, key = (lambda case : case.id ())) 
    return unittest.TestSuite (tests) 

    
    

    Fix the buggy line: tests = _flatten_suite (seed)
targets: tests = _flatten_suite (tests)
inputs: @ mock.patch.object (settings._wrapped, 'OPTIPNG_PATH', None) 
@ mock.patch.object (kitsune.upload.tasks.subprocess, 'call') 
def test_compress_no_compression_software(self, call) : 
    'compress_image does not fail when no compression software.' 
    image = self._uploaded_image () 
    compress_image (image, 'file') 
    assert (not image.called) 

    
    

    Fix the buggy line: assert (not image.called)
targets: assert (not call.called)
inputs: def test_cell_delete(self) : 
    call_info = self._stub_rpc_method ('call', 'fake_response') 
    result = self.cells_rpcapi.cell_delete (self.fake_context, 'cell_name') 
    expected_args = { 
        'cell_name' : 'cell_name', 
} 
    self._check_result (call_info, 'cell_delete', expected_args, version = '1.13') 
    self.assertEqual ('fake_response', call_info) 

    
    

    Fix the buggy line: self.assertEqual ('fake_response', call_info)
targets: self.assertEqual ('fake_response', result)
inputs: def _make_status(self) : 
    line = self._responseline 
    try : 
        [version, status, reason] = line.split (None, 2) 
except ValueError : 
        try : 
            [version, status] = line.split (None, 1) 
            reason = '' 
except ValueError : 
            raise BadStatusLineError (line) 
try : 
        status = int (status) 
        if ((status < 100) or (status > 999)) : 
            raise BadStatusLine (status) 
except ValueError : 
        raise BadStatusLineError (line) 
try : 
        version = float (version.split ('/') [1]) 
except (IndexError, ValueError) : 
        version = 0.9 
reason = reason.strip () 
    reason = (reason or httputils.STATUSCODES.get (status, '')) 
    self._responseline = None 
    return ResponseLine (version, status, reason) 

    
    

    Fix the buggy line: raise BadStatusLine (status)
targets: raise BadStatusLine (line)
inputs: def __init__(self, message, code = None) : 
    self.raw_message = message 
    if isinstance (message, list) : 
        message = ', '.join ((m for m in message if m)) 
super (ChefError, self).__init__ (message) 
    self.code = code 

Is there a bug in the code above?
targets: No
inputs: @ property 
def git_xml(self) : 
    git_xml_path = os.path.join (self.worktree.dot_qi, 'git.xml') 
    if (not os.path.exists (self)) : 
        with open (git_xml_path, 'w') as fp : 
            fp.write ('<git />') 
return git_xml_path 

    
    

    Fix the buggy line: if (not os.path.exists (self)) :
targets: if (not os.path.exists (git_xml_path)) :
inputs: @ pytest.mark.parametrize ('task_name,timeout', [('tests.instances.mul', 20), ('tests.instances.add', 300), ('tests.instances.add2', 70), ('tests.instances.add3', 80)]) 
def test_instances(task_name, timeout) : 
    manager_class = _select_manager (celery.backend.__class__.__name__) 
    manager_instance = list () 
    task = celery.tasks [task_name] 
    original_exit = manager_class.__exit__ 
    def new_exit(self, * _) : 
        manager_instance.append (self) 
        return original_exit (self, * _) 
setattr (manager_class, '__exit__', new_exit) 
    task.apply_async (args = (4, 4)).get () 
    setattr (manager_class, '__exit__', task) 
    assert (timeout == manager_instance [0].timeout) 

Is there a bug in the code above?
targets: Yes
inputs: @ manager.option ('-s', '--source', dest = 'source', default = 'data/serialized_dump.txt', required = False, help = 'Restore fixture from dump') 
def restore(source = 'data/serialized_dump.txt') : 
    print ('Start importing data') 
    with open (source, 'rb') as f : 
        data = json.loads (f.readline ()) 
for model_data in data : 
        try : 
            restored = loads (model_data, db.metadata, db.session) 
except AttributeError as e : 
            print ('Table does not exist: {}'.format (data)) 
            continue 
if restored : 
            print ('Importing {} table...'.format (restored [0].__table__.name)) 
for item in restored : 
            db.session.merge (item) 
db.session.commit () 
print ('Done') 

Is there a bug in the code above?
targets: Yes
inputs: def __init__(self, label = '', validators = None, tooltip = '', explanation_file = '', **kwargs) : 
    super (TextField, self).__init__ (label, validators, ** kwargs) 
    self.tooltip = Tooltip (self.id, self.short_name, tooltip) 
    self.explanation = Explanation (label.id, self.short_name, explanation_file) 

Is there a bug in the code above?
targets: Yes
inputs: def __init__(self, * names, **kwargs) : 
    self.names = set (<MASK>) 
    self.default = kwargs.get ('default', None) 
    self.value = None 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: names
inputs: def test_retry(monkeypatch) : 
    mock_sleep_time = [0] 
    def mock_sleep(seconds) : 
        mock_sleep_time [0] += seconds 
monkeypatch.setattr (time, 'sleep', <MASK>) 
    hit = [0] 
    tries = 5 
    delay = 1 
    backoff = 2 
    @ retry (tries = tries, delay = delay, backoff = backoff) 
    def f() : 
        hit [0] += 1 
        (1 / 0) 
with pytest.raises (ZeroDivisionError) : 
        f () 
assert (hit [0] == tries) 
    assert (mock_sleep_time [0] == sum (((delay * (backoff ** i)) for i in range ((tries - 1))))) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: def mock_sleep(
inputs: def test_cycle_undirected_weighted(self) : 
    G = nx.Graph () 
    G.add_edge (1, 2, { 
        'weight' : 1, 
}) 
    grc = nx.global_reaching_centrality 
    assert_equal (grc (self, weight = 'weight', normalized = False), 0) 

    
    

    Fix the buggy line: assert_equal (grc (self, weight = 'weight', normalized = False), 0)
targets: assert_equal (grc (G, weight = 'weight', normalized = False), 0)
inputs: def add_derivation(self, derived_target, derived_products) : 
    self.derivations.add (derived_target) 
    self.products_total += <MASK> 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: derived_products
inputs: @ property 
def tags(self) : 
    ' Yields a list of all the token tags as they appeared when the word was parsed.
            For example: ["was", "VBD", "B-VP", "O", "VP-1", "A1", "be"]
        ' 
    (ch, I, O, B) = (self.chunk, (INSIDE + '-'), OUTSIDE, (BEGIN + '-')) 
    tags = [OUTSIDE for i in range (len (self.sentence.token))] 
    for (i, tag) in enumerate (self.sentence.token) : 
        if (tag == WORD) : 
            tags [i] = encode_entities (self.string) 
else : 
            if ((tag == POS) and self.type) : 
                tags [i] = self.type 
else : 
                if ((tag == CHUNK) and ch and ch.type) : 
                    tags [i] = ((((self == ch [0]) and B) or I) + ch.type) 
else : 
                    if ((tag == PNP) and self.pnp) : 
                        tags [i] = ((((self == self.pnp [0]) and B) or I) + 'PNP') 
else : 
                        if ((tag == REL) and ch and (len (I.relations) > 0)) : 
                            tags [i] = ['-'.join ([str (x) for x in ([ch.type] + list (reversed (r))) if x]) for r in ch.relations] 
                            tags [i] = '*'.join (tags [i]) 
else : 
                            if ((tag == ANCHOR) and ch) : 
                                tags [i] = (ch.anchor_id or OUTSIDE) 
else : 
                                if (tag == LEMMA) : 
                                    tags [i] = encode_entities ((self.lemma or '')) 
else : 
                                    if (tag in self.custom_tags) : 
                                        tags [i] = (self.custom_tags.get (tag) or OUTSIDE) 
return tags 

Is there a bug in the code above?
targets: Yes
inputs: def fit(self, X, y, sample_weight = None, neighbours_matrix = None) : 
    'Build a boosted classifier from the training set (X, y).
        Parameters
        ----------
        X : array-like of shape = [n_samples, n_features]
            The training input samples.

        y : array-like of shape = [n_samples]
            The target values (integers that correspond to classes).

        sample_weight : array-like of shape = [n_samples], optional
            Sample weights. If None, the sample weights are initialized to
            ``1 / n_samples``.

        neighbours_matrix: array-like of shape [n_samples, n_neighbours],
            each row contains indices of signal neighbours
            (neighbours should be computed for background too),
            if None, this matrix is computed.

        Returns
        -------
        self : object
            Returns self.
        ' 
    if (self.smoothing < 0) : 
        raise ValueError ('Smoothing must be non-negative') 
if (not isinstance (self.base_estimator, BaseEstimator)) : 
        raise TypeError ('estimator must be a subclass of BaseEstimator') 
if (self.n_estimators <= 0) : 
        raise ValueError ('n_estimators must be greater than zero.') 
if (self.learning_rate <= 0) : 
        raise ValueError ('learning_rate must be greater than zero') 
if (self.algorithm not in ('SAMME', 'SAMME.R')) : 
        raise ValueError (('algorithm %s is not supported' % self.algorithm)) 
if (self.algorithm == 'SAMME.R') : 
        if (not hasattr (self.base_estimator, 'predict_proba')) : 
            raise TypeError ("uBoostBDT with algorithm='SAMME.R' requires that the weak learner have a predict_proba method.
Please change the base estimator or set algorithm='SAMME' instead.") 
assert np.in1d (y, [0, 1]).all (), 'only two-class classification is implemented' 
    self.signed_uniform_label = ((2 * self.uniform_label) - 1) 
    if (neighbours_matrix is not None) : 
        assert (np.shape (neighbours_matrix) == (len (X), self.n_neighbors)), 'Wrong shape of...
    
    Given the code above, what is a proper replacement for <MASK>?
targets: self
inputs: def __init__(self, num_available) : 
    self.num_available = <MASK> 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: num_available, self
targets: num_available
inputs: def __init__(self, var, nodelist_true, nodelist_false = None) : 
    (self.nodelist_true, self.nodelist_false) = (nodelist_true, nodelist_false) 
    self.var = var 

Is there a bug in the code above?
targets: No
inputs: def _checkMetadataPrefix(self, metadataPrefix) : 
    if (<MASK> not in self.config.metadata_prefixes) : 
        raise oaipmh.error.CannotDisseminateFormatError 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, metadataPrefix
targets: metadataPrefix