Muennighoff/xP3x-sample huggingface dataset:
inputs: def _check_numbers(n, numbers, level = 1, datatype = 'reach') : 
    "Check that a sequence of numbers is consecutive
    (that the sequence is equal to the range from 1 to n+1, where n is the expected length of the sequence).

    Parameters
    ----------
    n : int
        Expected length of the sequence (i.e. number of stream segments)
    numbers : array
        Sequence of numbers (i.e. 'nseg' column from the segment_data array)
    level : int
        Check method analysis level. If level=0, summary checks are
        performed. If level=1, full checks are performed.
    datatype : str, optional
        Only used for reporting.
    " 
    txt = '' 
    num_range = np.arange (1, (n + 1)) 
    if (not np.array_equal (num_range, <MASK>)) : 
        txt += 'Invalid {} numbering
'.format (datatype) 
        if (level == 1) : 
            non_consecutive = np.append ((np.diff (numbers) != 1), False) 
            gaps = (num_range [non_consecutive] + 1) 
            if (len (gaps) > 0) : 
                gapstr = ' '.join (map (str, gaps)) 
                txt += 'Gaps in numbering at positions {}
'.format (gapstr) 
return txt 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: numbers
inputs: def _s3_cleanup(glob_path, time_old, dry_run = False, **runner_kwargs) : 
    'Delete all files older than *time_old* in *path*.

    If *dry_run* is true, then just log the files that need to be
    deleted without actually deleting them
    ' 
    runner = EMRJobRunner (** runner_kwargs) 
    log.info (('Deleting all files in %s that are older than %s' % (glob_path, time_old))) 
    for path in runner.fs.ls (glob_path) : 
        (bucket_name, key_name) = parse_s3_uri (path) 
        bucket = runner.fs.get_bucket (bucket_name) 
        for key in bucket.list (key_name) : 
            last_modified = iso8601_to_datetime (key.last_modified) 
            age = (datetime.utcnow () - last_modified) 
            if (age > time_old) : 
                log.info (('Deleting %s; is %s old' % (key.name, age))) 
                if (not path) : 
                    key.delete () 

    
    

    Fix the buggy line: if (not path) :
targets: if (not dry_run) :
inputs: @ patch ('ocw_config_runner.configuration_parsing.logger') 
def test_invalid_dap_config(self, mock_logger) : 
    parser._valid_dataset_config_data (self.invalid_dap) 
    present_keys = set (self.invalid_dap.keys ()) 
    missing_keys = (self.required_dap_keys - present_keys) 
    missing = sorted (list (missing_keys)) 
    error = 'Dataset does not contain required keys. The following keys are missing: {}'.format (', '.join (missing)) 
    mock_logger.error.assert_called_with (error) 

Is there a bug in the code above?
targets: No
inputs: def addMockForAppScalefile(self, appscale, contents) : 
    flexmock (os) 
    os.should_receive ('getcwd').and_return ('/boo') 
    mock = flexmock (sys.modules ['__builtin__']) 
    mock.should_call ('open') 
    mock.should_receive ('open').with_args (('/boo/' + appscale.APPSCALEFILE)).and_return (flexmock (read = (lambda : contents))) 
    return self 

    
    

    Fix the buggy line: return self
targets: return mock
inputs: def test_nodummy_eydxmedian(self) : 
    me = self.res1.get_margeff (at = 'median', method = 'eydx') 
    assert_almost_equal (me.margeff, self.res2.margeff_nodummy_eydxmedian, DECIMAL_4) 
    assert_almost_equal (me.margeff_se, <MASK>.res2.margeff_nodummy_eydxmedian_se, DECIMAL_4) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, me
targets: self
inputs: def action(self) : 
    "
        Test Presenter 'allowed' request (A3)
        " 
    console.terse ('{0}
'.format (<MASK>.action.__doc__)) 
    self.alloweds.value ['alpha'] = createStack ('1.1.1.1') 
    self.alloweds.value ['beta'] = createStack ('1.2.3.4') 
    testStack = self.event_stack.value 
    presenceReq = self.presence_req.value 
    ryn = 'manor' 
    presenceReq.append ({ 
        'route' : { 
            'dst' : (None, ryn, 'presence_req'), 
            'src' : (None, testStack.local.name, None), 
}, 
        'data' : { 
            'state' : 'allowed', 
}, 
}) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: self
inputs: @ property 
def ancestor(self) : 
    "This browse node's immediate ancestor in the browse node tree.

        :return:
            The ancestor as an :class:`~.AmazonBrowseNode`, or None.
        " 
    ancestors = getattr (self.parsed_response, 'Ancestors', None) 
    if hasattr (ancestors, 'BrowseNode') : 
        return AmazonBrowseNode (ancestors ['BrowseNode']) 
return None 

Is there a bug in the code above?
targets: No
inputs: def check_program(self, operation, before, after, * args) : 
    with tempfile.NamedTemporaryFile ('w+') as tmp : 
        tmp.write (before) 
        tmp.flush () 
        args = (args + (tmp.name,)) 
        (exitcode, stdout, stderr) = run_sixer (operation, * <MASK>) 
        self.assertEqual (exitcode, 0) 
        tmp.seek (0) 
        code = tmp.read () 
self.assertEqual (code, after) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: args
inputs: @ name.setter 
def name(self, value) : 
    old_name = self._name 
    if (value is old_name) : 
        return 
self._name = value 
    configs = ConfigParser._named_configs 
    if old_name : 
        (_, props) = configs.get (old_name, (None, [])) 
        for (widget, prop) in props : 
            widget = widget () 
            if widget : 
                widget.property (prop).set_config (None) 
configs [old_name] = (None, props) 
if (not value) : 
        return 
try : 
        (config, props) = configs [value] 
except KeyError : 
        configs [value] = (ref (props), []) 
        return 
if (config is not None) : 
        raise ValueError ('A parser named {} already exists'.format (value)) 
for (widget, prop) in props : 
        widget = widget () 
        if widget : 
            widget.property (prop).set_config (self) 
configs [value] = (ref (self), props) 

    
    

    Fix the buggy line: configs [value] = (ref (props), [])
targets: configs [value] = (ref (self), [])
inputs: def cameraCapturePicture(self, targetPath, useAutoFocus) : 
    '
        cameraCapturePicture(
          String targetPath,
          Boolean useAutoFocus[optional, default true])

        Take a picture and save it to the specified path.

        Returns:
          A map of Booleans autoFocus and takePicture where True indicates success.
        ' 
    return self._rpc ('cameraCapturePicture', <MASK>, useAutoFocus) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: useAutoFocus, self, targetPath
targets: targetPath
inputs: def test_silent_page_not_an_integer_error(table) : 
    request = build_request ('/') 
    paginator = Fake ('Paginator').expects ('page').with_args (1) 
    table = table.has_attr (paginator = paginator).expects ('paginate').with_args (page = 'abc').raises (PageNotAnInteger) 
    RequestConfig (request, paginate = { 
        'page' : 'abc', 
        'silent' : True, 
}).configure (request) 

    
    

    Fix the buggy line: }).configure (request)
targets: }).configure (table)
inputs: def __getitem__(self, key) : 
    return self.fields [<MASK>] 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, key
targets: key
inputs: @ decorators.json_view 
@ account_decorators.login_required 
def user_details(request) : 
    'jQuery GET method for retrieving user details.
    :param request: The HTTP request to be processed
    ' 
    logger.info ((__name__ + ', user_details (AJAX)')) 
    if ('user_id' not in request.GET) : 
        raise exceptions.BadRequest ("'user_id' not found as a GET parameter.") 
user_id = request.GET ['user_id'] 
    logger.info (((__name__ + ', user_id = ') + user_id)) 
    user = get_object_or_404 (models.UserProfile, pk = user_id) 
    fields = ['username', 'first_name', 'last_name', 'organization', 'email'] 
    user_dict = form_models.model_to_dict (user, fields) 
    user_dict ['country'] = str (user.country.name) 
    return user_dict 

Is there a bug in the code above?
targets: No
inputs: def handler(sig, hook = thread.interrupt_main) : 
    global kafka, consumer, producer 
    if consumer : 
        consumer.commit () 
        consumer.stop () 
        consumer = None 
if <MASK> : 
        producer.stop () 
        producer = None 
if kafka : 
        kafka.close () 
        kafka = None 
print ('remote_rainter {0} is shutting down'.format (os.getpid ())) 
    exit (1) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: producer, consumer, hook, kafka, sig
targets: producer
inputs: def _event_to_key_presses(self, ev) : 
    '
        For this `KEY_EVENT_RECORD`, return a list of `KeyPress` instances.
        ' 
    assert ((type (ev) == KEY_EVENT_RECORD) and ev.KeyDown) 
    result = None 
    u_char = ev.uChar.UnicodeChar 
    ascii_char = ev.uChar.AsciiChar 
    if (u_char == '\x00') : 
        if (ev.VirtualKeyCode in self.keycodes) : 
            result = KeyPress (self.keycodes [ev.VirtualKeyCode], '') 
else : 
        if (ascii_char in self.mappings) : 
            result = KeyPress (self.mappings [ascii_char], u_char) 
else : 
            result = KeyPress (u_char, u_char) 
if (((ev.ControlKeyState & self.LEFT_CTRL_PRESSED) or (ev.ControlKeyState & self.RIGHT_CTRL_PRESSED)) and result) : 
        if (result.key == Keys.Left) : 
            result.key = Keys.ControlLeft 
if (result.key == Keys.Right) : 
            result.key = Keys.ControlRight 
if (result.key == Keys.Up) : 
            result.key = Keys.ControlUp 
if (result.key == Keys.Down) : 
            result.key = Keys.ControlDown 
if ((ev.ControlKeyState & self.SHIFT_PRESSED) and result) : 
        if (result.key == Keys.Tab) : 
            result.key = Keys.BackTab 
if (((ev.ControlKeyState & self.LEFT_CTRL_PRESSED) or (ev.ControlKeyState & self.RIGHT_CTRL_PRESSED)) and result and (result.data == ' ')) : 
        result = KeyPress (Keys.ControlSpace, ' ') 
if (((<MASK>.ControlKeyState & self.LEFT_CTRL_PRESSED) or (ev.ControlKeyState & self.RIGHT_CTRL_PRESSED)) and result and (result.key == Keys.ControlJ)) : 
        return [KeyPress (Keys.Escape, ''), result] 
if result : 
        meta_pressed = (ev.ControlKeyState & self.LEFT_ALT_PRESSED) 
        if meta_pressed : 
            return [KeyPress (Keys.Escape, ''), result] 
else : 
            return [result] 
else : 
        return [] 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: meta_pressed, self, ascii_char, u_char, ev, result
targets: ev
inputs: def __init__(self, stream_greater_or_equal = sys.stderr, stream_lower = sys.stdout, level = logging.ERROR) : 
    '
        Initialize handler
        ' 
    logging.StreamHandler.__init__ (self) 
    self._level = level 
    self.stream = None 
    self._stream_lower = stream_greater_or_equal 
    self._stream_greater_or_equal = stream_greater_or_equal 

    
    

    Fix the buggy line: self._stream_lower = stream_greater_or_equal
targets: self._stream_lower = stream_lower
inputs: def IsInitialized(self, debug_strs = None) : 
    initialized = 1 
    if (not self.has_value_) : 
        initialized = 0 
        if (debug_strs is not None) : 
            debug_strs.append ('Required field: value not set.') 
return initialized 

Is there a bug in the code above?
targets: No
inputs: def construct_object(self, node, deep = False) : 
    if (node in self.constructed_objects) : 
        return self.constructed_objects [node] 
if <MASK> : 
        old_deep = self.deep_construct 
        self.deep_construct = True 
if (node in self.recursive_objects) : 
        raise ConstructorError (None, None, 'found unconstructable recursive node', node.start_mark) 
self.recursive_objects [node] = None 
    constructor = None 
    tag_suffix = None 
    if (node.tag in self.yaml_constructors) : 
        constructor = self.yaml_constructors [node.tag] 
else : 
        for tag_prefix in self.yaml_multi_constructors : 
            if node.tag.startswith (tag_prefix) : 
                tag_suffix = node.tag [len (tag_prefix) :] 
                constructor = self.yaml_multi_constructors [tag_prefix] 
                break 
else : 
            if (None in self.yaml_multi_constructors) : 
                tag_suffix = node.tag 
                constructor = self.yaml_multi_constructors [None] 
else : 
                if (None in self.yaml_constructors) : 
                    constructor = self.yaml_constructors [None] 
else : 
                    if isinstance (node, ScalarNode) : 
                        constructor = self.__class__.construct_scalar 
else : 
                        if isinstance (node, SequenceNode) : 
                            constructor = self.__class__.construct_sequence 
else : 
                            if isinstance (node, MappingNode) : 
                                constructor = self.__class__.construct_mapping 
if (tag_suffix is None) : 
        data = constructor (self, node) 
else : 
        data = constructor (self, tag_suffix, node) 
if isinstance (data, types.GeneratorType) : 
        generator = data 
        data = next (generator) 
        if self.deep_construct : 
            for dummy in generator : 
                pass 
else : 
            self.state_generators.append (generator) 
self.constructed_objects [node] = data 
    del self.recursive_objects [node] 
    if...
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: old_deep, data, self, node, generator, dummy, tag_prefix, tag_suffix, deep, constructor
targets: deep
inputs: @ base.remotable_classmethod 
def get_all(cls, context, expected_attrs = None) : 
    'Returns all instances on all nodes.' 
    db_instances = db.instance_get_all (context, columns_to_join = _expected_cols (expected_attrs)) 
    return _make_instance_list (<MASK>, cls (), db_instances, expected_attrs) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: context
inputs: def __iter__(self) : 
    if hasattr (self, 'error_dict') : 
        for (field, errors) in self.error_dict.items () : 
            (yield (<MASK>, list (ValidationError (errors)))) 
else : 
        for error in self.error_list : 
            message = error.message 
            if error.params : 
                message %= error.params 
(yield force_text (message)) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: field
inputs: @ staticmethod 
def log(expr, assumptions) : 
    x = expr.args [0] 
    if ask (Q.algebraic (x), assumptions) : 
        return ask ((~ Q.nonzero ((x - 1))), <MASK>) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: x, assumptions, expr
targets: assumptions
inputs: def assert_falsey(lval, * args, **kwargs) : 
    'Assert that lval evaluates falsey, not identity.' 
    message = _get_msg (args, kwargs, 'assert_not_equal') 
    if <MASK> : 
        assert (not lval), message 
else : 
        assert (not lval), ('assertion failed: l == r
l: %r
r: %r

%s' % (lval, False, _diff_message (lval, False))) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: message
inputs: @ property 
def loaders(self) : 
    if (not self._cached_loaders) : 
        cached_loaders = [] 
        for loader in self._loaders : 
            cached_loaders.append (find_template_loader (loader)) 
self._cached_loaders = cached_loaders 
return loader._cached_loaders 

Is there a bug in the code above?
targets: Yes
inputs: def PrepareLU(self, lu) : 
    lu._exclusive_storage = False 
    lu.master_node = <MASK>.master_uuid 
    lu.group_info = self.group 
    verify.LUClusterVerifyGroup.all_node_info = property (fget = (lambda _ : self.cfg.GetAllNodesInfo ())) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: self
inputs: @ mock.patch.object (vm_utils, '_vdi_resize') 
@ mock.patch.object (vm_utils, '_vdi_get_virtual_size') 
def test_update_vdi_virtual_size_works(self, mock_get_size, mock_resize) : 
    mock_get_size.return_value = ((1024 ** 3) - 1) 
    instance = { 
        'uuid' : 'a', 
} 
    vm_utils.update_vdi_virtual_size ('s', self, 'ref', 1) 
    mock_get_size.assert_called_once_with ('s', 'ref') 
    mock_resize.assert_called_once_with ('s', 'ref', (1024 ** 3)) 

    
    

    Fix the buggy line: vm_utils.update_vdi_virtual_size ('s', self, 'ref', 1)
targets: vm_utils.update_vdi_virtual_size ('s', instance, 'ref', 1)
inputs: @ mock.patch.object (messaging, 'TransportURL') 
def test_get_transport_url_null(self, mock_url) : 
    conf = mock.Mock () 
    rpc.CONF = conf 
    mock_url.parse.return_value = 'foo' 
    url = rpc.get_transport_url () 
    self.assertEqual ('foo', url) 
    mock_url.parse.assert_called_once_with (mock_url, None, rpc.TRANSPORT_ALIASES) 

    
    

    Fix the buggy line: mock_url.parse.assert_called_once_with (mock_url, None, rpc.TRANSPORT_ALIASES)
targets: mock_url.parse.assert_called_once_with (conf, None, rpc.TRANSPORT_ALIASES)
inputs: def __init__(self, func, attr = 'next or value') : 
    self.attr = attr 
    self.func = <MASK> 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, func, attr
targets: func
inputs: def ensure_only_specificmessage_from_bot(self, match, wait = 5, tosender = False) : 
    if (tosender is True) : 
        match = six.text_type ('^\\<@{}\\>: {}$').format (self.driver_userid, wait) 
else : 
        match = '^{}$'.format (match) 
for _ in range (wait) : 
        time.sleep (1) 
        with self._events_lock : 
            for event in self.events : 
                if (self._is_bot_message (event) and (re.match (match, event ['text'], re.DOTALL) is None)) : 
                    raise AssertionError ('expected to get message matching "{}", but got message "{}"'.format (match, event ['text'])) 

    
    

    Fix the buggy line: match = six.text_type ('^\\<@{}\\>: {}$').format (self.driver_userid, wait)
targets: match = six.text_type ('^\\<@{}\\>: {}$').format (self.driver_userid, match)
inputs: def getall(self) : 
    'Returns all interfaces in a dict object.

        Returns:
            A Python dictionary object containing all interface
            configuration indexed by interface name::

                {
                    "Ethernet1": {...},
                    "Ethernet2": {...}
                }

        ' 
    interfaces_re = re.compile ('(?<=^interface\\s)(.+)$', re.M) 
    response = dict () 
    for name in interfaces_re.findall (self.config) : 
        interface = self.get (name) 
        if interface : 
            response [name] = interface 
return response 

Is there a bug in the code above?
targets: No
inputs: def evalDrop(ctx, u) : 
    '
    http://www.w3.org/TR/sparql11-update/#drop
    ' 
    if ctx.dataset.store.graph_aware : 
        for g in _graphAll (ctx, u.graphiri) : 
            ctx.dataset.store.remove_graph (g) 
else : 
        evalClear (ctx, <MASK>) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: u
inputs: def _key_press(event, params) : 
    'Function for handling key presses for the animation.' 
    if (event.key == 'left') : 
        params ['pause'] = True 
        params ['frame'] = max ((<MASK> ['frame'] - 1), 0) 
else : 
        if (event.key == 'right') : 
            params ['pause'] = True 
            params ['frame'] = min ((params ['frame'] + 1), (len (params ['frames']) - 1)) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: params
inputs: @ mock.patch ('sahara.utils.xmlutils.load_hadoop_xml_defaults', return_value = []) 
def test_get_possible_pig_config_from(self, load_hadoop_xml_defaults) : 
    expected_config = { 
        'configs' : [], 
        'args' : [], 
        'params' : { 
            
}, 
} 
    actual_config = ch_helper.get_possible_pig_config_from ('sample-config.xml') 
    load_hadoop_xml_defaults.assert_called_once_with ('sample-config.xml') 
    self.assertEqual (expected_config, actual_config) 

Is there a bug in the code above?
targets: No
inputs: def __init__(self, buffer, start, end) : 
    self._buffer = buffer 
    self.start = (self - 1) 
    self.end = (end - 1) 

Is there a bug in the code above?
targets: Yes
inputs: @ parameterized.expand ([('Banjo Kazoomie', None, 'Banjo Kazoomie'), ('Banjo Kazoomie', '[Vapor]', '[Vapor] Banjo Kazoomie'), ('Game Name', '!Something!', '!Something! Game Name')]) 
def test_rom_shortcut_name(self, name, console_prefix, expected) : 
    console = model.Console (fullname = 'Nintendo Entertainment System', shortname = 'NES', extensions = '', custom_roms_directory = '', prefix = console_prefix, icon = '', images_directory = '', emulator = None) 
    rom = model.ROM (name = name, path = '/Path/to/ROM', console = console_prefix) 
    self.assertEqual (roms.rom_shortcut_name (rom), expected) 

    
    

    Fix the buggy line: rom = model.ROM (name = name, path = '/Path/to/ROM', console = console_prefix)
targets: rom = model.ROM (name = name, path = '/Path/to/ROM', console = console)
inputs: def _eval_progress(self, match) : 
    '
    Runs the user-supplied progress calculation rule
    ' 
    _locals = { k : safe_float (<MASK>) for (k, v) in match.groupdict ().items () } 
    if ('x' not in _locals) : 
        _locals ['x'] = [safe_float (x) for x in match.groups ()] 
try : 
        return int (eval (self.progress_expr, { 
            
}, _locals)) 
except : 
        return None 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: v
inputs: def __getitem__(self, key) : 
    value = tuple.__getitem__ (self, key) 
    result = self.configurator.convert (value) 
    if (value is not result) : 
        if (type (result) in (ConvertingDict, ConvertingList, ConvertingTuple)) : 
            result.parent = self 
            result.key = key 
return result 

Is there a bug in the code above?
targets: No
inputs: def __init__(self, editor, buffer = None, cursor = (0, 0)) : 
    if (buffer is None) : 
        buffer = Buffer () 
self.editor = editor 
    self.buffer = buffer 
    self.cursor = Cursor (self, coords = <MASK>) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: buffer, self, editor, cursor
targets: cursor
inputs: def Equals(self, x) : 
    if (x is self) : 
        return 1 
if (self.has_service_call_name_ != x.has_service_call_name_) : 
        return 0 
if (self.has_service_call_name_ and (self.service_call_name_ != x.service_call_name_)) : 
        return 0 
if (self.has_total_amount_of_calls_ != x.has_total_amount_of_calls_) : 
        return 0 
if (self.has_total_amount_of_calls_ and (self.total_amount_of_calls_ != x.total_amount_of_calls_)) : 
        return 0 
if (self.has_total_cost_of_calls_microdollars_ != x.has_total_cost_of_calls_microdollars_) : 
        return 0 
if (x.has_total_cost_of_calls_microdollars_ and (self.total_cost_of_calls_microdollars_ != x.total_cost_of_calls_microdollars_)) : 
        return 0 
if (len (self.total_billed_ops_) != len (x.total_billed_ops_)) : 
        return 0 
for (e1, e2) in zip (self.total_billed_ops_, x.total_billed_ops_) : 
        if (e1 != e2) : 
            return 0 
return 1 

Is there a bug in the code above?
targets: Yes
inputs: @ register.filter 
@ stringfilter 
def cleartags(value, tags) : 
    tags = [re.escape (<MASK>) for tag in tags.split ()] 
    tags_re = ('(%s)' % '|'.join (tags)) 
    clear_re = re.compile (('<\\s*%s[^>]*>(.*?)<\\s*/\\s*\\1>' % tags_re), re.U) 
    value = clear_re.sub ('', value) 
    return value 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: tags, tags_re, tag, value, clear_re
targets: tag
inputs: def c_code(self, node, name, inp, out, sub) : 
    (x,) = inp 
    (sm,) = out 
    code_template = ''.join (self.c_code_template (node.inputs [0].type.dtype_specs () [1])) 
    return (self % dict (locals (), ** sub)) 

    
    

    Fix the buggy line: return (self % dict (locals (), ** sub))
targets: return (code_template % dict (locals (), ** sub))
inputs: def build_struct(spec, type_name = None) : 
    class NewBreadStruct (BreadStruct) : 
        pass 
if (type_name is not None) : 
        NewBreadStruct.__name__ = type_name 
struct = NewBreadStruct () 
    global_options = { 
        
} 
    unnamed_fields = 0 
    for spec_line in spec : 
        if (type (spec_line) == dict) : 
            global_options = spec_line 
else : 
            if (isinstance (spec_line, types.FunctionType) or (len (spec_line) == 1)) : 
                if isinstance (spec_line, types.FunctionType) : 
                    field = spec_line 
else : 
                    field = spec_line [0] 
struct._add_field (field (struct, ** global_options), ('_unnamed_%d' % unnamed_fields)) 
                unnamed_fields += 1 
else : 
                if (spec_line [0] == CONDITIONAL) : 
                    (predicate_field_name, conditions) = spec_line [1 :] 
                    field = BreadConditional.from_spec (spec_line, struct) 
                    struct._add_field (field, ('_conditional_on_%s_%d' % (<MASK>, unnamed_fields))) 
                    unnamed_fields += 1 
else : 
                    field_name = spec_line [0] 
                    field = spec_line [1] 
                    options = global_options 
                    if (len (spec_line) == 3) : 
                        options = global_options.copy () 
                        options.update (spec_line [2]) 
if (type (field) == list) : 
                        struct._add_field (build_struct (field), field_name) 
else : 
                        struct._add_field (field (struct, ** options), field_name) 
return struct 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: field, type_name, unnamed_fields, struct, options, conditions, field_name, spec, spec_line, predicate_field_name, global_options
targets: predicate_field_name
inputs: def _execute_jump(view, jump_forward, only_other) : 
    '
    Add the selection to the fields and move the selection to the
    next field.
    ' 
    regions = view.get_regions ('meu_sf_stored_selections') 
    try : 
        end = max ((sel.end () for sel in view.sel ())) 
        pos = next ((i for (i, sel) in enumerate (regions) if (sel.begin () > end))) 
except : 
        pos = len (regions) 
if only_other : 
        sel_count = 0 
else : 
        sel_count = len (view.sel ()) 
        if (sel_count == 1) : 
            regions.insert (pos, view.sel () [0]) 
else : 
            regions = ((regions [: pos] + list (view.sel ())) + regions [pos :]) 
delta = (sel_count if jump_forward else (- 1)) 
    pos = (pos + <MASK>) 
    return (regions, pos) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: regions, i, view, jump_forward, sel, only_other, delta, pos, end, sel_count
targets: delta
inputs: @ register_pydub_effect 
def compress_dynamic_range(seg, threshold = (- 20.0), ratio = 4.0, attack = 5.0, release = 50.0) : 
    '
    Keyword Arguments:
        
        threshold - default: -20.0
            Threshold in dBFS. default of -20.0 means -20dB relative to the
            maximum possible volume. 0dBFS is the maximum possible value so
            all values for this argument sould be negative.

        ratio - default: 4.0
            Compression ratio. Audio louder than the threshold will be 
            reduced to 1/ratio the volume. A ratio of 4.0 is equivalent to
            a setting of 4:1 in a pro-audio compressor like the Waves C1.
        
        attack - default: 5.0
            Attack in milliseconds. How long it should take for the compressor
            to kick in once the audio has exceeded the threshold.

        release - default: 50.0
            Release in milliseconds. How long it should take for the compressor
            to stop compressing after the audio has falled below the threshold.

    
    For an overview of Dynamic Range Compression, and more detailed explanation
    of the related terminology, see: 

        http://en.wikipedia.org/wiki/Dynamic_range_compression
    ' 
    thresh_rms = (seg.max_possible_amplitude * db_to_float (threshold)) 
    look_frames = int (seg.frame_count (ms = frame)) 
    def rms_at(frame_i) : 
        return seg.get_sample_slice ((frame_i - look_frames), frame_i).rms 
def db_over_threshold(rms) : 
        if (rms == 0) : 
            return 0.0 
db = ratio_to_db ((rms / thresh_rms)) 
        return max (db, 0) 
output = [] 
    attenuation = 0.0 
    attack_frames = seg.frame_count (ms = attack) 
    release_frames = seg.frame_count (ms = release) 
    for i in xrange (int (seg.frame_count ())) : 
        rms_now = rms_at (i) 
        max_attenuation = ((1 - (1.0 / ratio)) * db_over_threshold (rms_now)) 
        attenuation_inc = (max_attenuation / attack_frames) 
        attenuation_dec = (max_attenuation / release_frames) 
        if...

    
    

    Fix the buggy line: look_frames = int (seg.frame_count (ms = frame))
targets: look_frames = int (seg.frame_count (ms = attack))
inputs: def __init__(self, children, context) : 
    (_raise, self.expr) = children 
    assert (<MASK>.value == 'raise'), _raise 
    super ().__init__ (context) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: _raise
inputs: @ defun 
def eigh(ctx, A, eigvals_only = False, overwrite_a = False) : 
    '
    "eigh" is a unified interface for "eigsy" and "eighe". Depending on
    whether A is real or complex the appropriate function is called.

    This routine solves the (ordinary) eigenvalue problem for a real symmetric
    or complex hermitian square matrix A. Given A, an orthogonal (A real) or
    unitary (A complex) matrix Q is calculated which diagonalizes A:

        Q\' A Q = diag(E)               and                Q Q\' = Q\' Q = 1

    Here diag(E) a is diagonal matrix whose diagonal is E.
    \' denotes the hermitian transpose (i.e. ordinary transposition and
    complex conjugation).

    The columns of Q are the eigenvectors of A and E contains the eigenvalues:

        A Q[:,i] = E[i] Q[:,i]

    input:

      A: a real or complex square matrix of format (n,n) which is symmetric
         (i.e. A[i,j]=A[j,i]) or hermitian (i.e. A[i,j]=conj(A[j,i])).

      eigvals_only: if true, calculates only the eigenvalues E.
                    if false, calculates both eigenvectors and eigenvalues.

      overwrite_a: if true, allows modification of A which may improve
                   performance. if false, A is not modified.

    output:

      E: vector of format (n). contains the eigenvalues of A in ascending order.

      Q: an orthogonal or unitary matrix of format (n,n). contains the
         eigenvectors of A as columns.

    return value:

          E         if eigvals_only is true
         (E, Q)     if eigvals_only is false

    example:
      >>> from mpmath import mp
      >>> A = mp.matrix([[3, 2], [2, 0]])
      >>> E = mp.eigh(A, eigvals_only = True)
      >>> print(E)
      [-1.0]
      [4.0]

      >>> A = mp.matrix([[1, 2], [2, 3]])
      >>> E, Q = mp.eigh(A)
      >>> print(mp.chop(A * Q[:,0] - E[0] * Q[:,0]))
      [0.0]
      [0.0]

      >>> A = mp.matrix([[1, 2 + 5j], [2 - 5j, 3]])
      >>> E, Q = mp.eigh(A)
      >>> print(mp.chop(A * Q[:,0] - E[0] * Q[:,0]))
      [0.0]
      [0.0]

    see also:...

Is there a bug in the code above?
targets: No
inputs: def get_loggers(self) : 
    return [l for l in self.__dict__.values () if isinstance (<MASK>, AlertLogger)] 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: l
inputs: def test_draw_histogram_subset_hidden(self) : 
    self.client.add_layer (self.data) 
    s = self.data.new_subset () 
    self.client.set_layer_visible (self, False) 
    self.client.set_component (self.data.find_component_id ('uniform')) 

    
    

    Fix the buggy line: self.client.set_layer_visible (self, False)
targets: self.client.set_layer_visible (s, False)
inputs: def get(name, type = None) : 
    'To get the value of a vim variable.' 
    rawval = vim.eval ((prefix + name)) 
    if (type is bool) : 
        return (False if (rawval == '0') else True) 
else : 
        if (type is int) : 
            return int (rawval) 
else : 
            if (type is float) : 
                return float (rawval) 
else : 
                return rawval 

Is there a bug in the code above?
targets: No
inputs: def __call__(self, meta, track_types) : 
    params = self.default_params 
    if (meta and (meta.get ('videocodecid') == 'avc1')) : 
        params = self.h264_params 
return map (meta.get, track_types) 

    
    

    Fix the buggy line: return map (meta.get, track_types)
targets: return map (params.get, track_types)
inputs: def new_textarea(node, modelclass, metadata) : 
    return node.add_fieldset (metadata.colname).add_textarea (<MASK>.colname, (metadata.default or '')) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: metadata
inputs: def _dsa_cdata_to_evp_pkey(self, dsa_cdata) : 
    evp_pkey = self._create_evp_pkey_gc () 
    res = self._lib.EVP_PKEY_set1_DSA (<MASK>, dsa_cdata) 
    self.openssl_assert ((res == 1)) 
    return evp_pkey 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: evp_pkey
inputs: def _CheckTimeField(self, log) : 
    'Validates a 5 field time spec line and logs any errors and warnings.

    Args:
      log: A LogCounter instance to record issues.
    ' 
    cron_time_field_names = ('minute', 'hour', 'day of month', 'month', 'day of week') 
    cron_time_field_limits = InitCronTimeFieldLimits () 
    fsm = InitCronFSM () 
    parsed_cron_time_fields = { 
        
} 
    for field in cron_time_field_names : 
        parsed_cron_time_fields [field] = fsm.Run (self.time_field [field]) 
        if ('parser_error' in parsed_cron_time_fields [field]) : 
            log.LineError (log.MSG_FIELD_PARSE_ERROR, ('Failed to fully parse "%s" field here: %s' % (field, parsed_cron_time_fields [field] ['parser_error']))) 
for cron_time in parsed_cron_time_fields [field] ['cron_times'] : 
            for line_error in cron_time.GetDiagnostics (cron_time_field_limits [field]) : 
                log.LineError (log.MSG_FIELD_VALUE_ERROR, line_error) 
if ChkCTStarOnly (parsed_cron_time_fields ['minute'] ['cron_times']) : 
        if (not ChkCTStarOnly (parsed_cron_time_fields ['hour'] ['cron_times'])) : 
            log.LineWarn (<MASK>.MSG_HOURS_NOT_MINUTES, 'Cron will run this every minute for the hours set.') 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, parsed_cron_time_fields, field, cron_time, fsm, line_error, cron_time_field_limits, log, cron_time_field_names
targets: log
inputs: @ staticmethod 
def unused_variable_message(variable_name, op_name) : 
    if op_name : 
        return 'Variable "${}" is never used in operation "{}".'.format (<MASK>, op_name) 
return 'Variable "${}" is never used.'.format (variable_name) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: variable_name, op_name
targets: variable_name
inputs: def _process_item(item_doc) : 
    item = pywikibase.ItemPage () 
    item.get (content = (<MASK> or { 
        'aliases' : { 
            
}, 
})) 
    return item 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: item_doc, item
targets: item_doc
inputs: def estimate_size(self, ixreader) : 
    return self._and_query ().estimate_size (<MASK>) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: self, ixreader
targets: ixreader
inputs: def test_get_related_bibids_by_oclc(self) : 
    i = get_item ('2281511') 
    expected = ['1278053', '2281511'] 
    bibids = db.get_related_bibids_by_oclc (<MASK>) 
    self.assertEqual (expected, bibids) 
    i = get_item ('12278722') 
    self.assertEqual (db.get_related_bibids_by_oclc (i), ['12278722']) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: expected, self, bibids, i
targets: i
inputs: def _variant_read_decimal(r, size) : 
    (prec, scale) = r.unpack (Variant._decimal_info_struct) 
    return MsDecimal (prec = prec, scale = scale).read_fixed (r, <MASK>) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: size, scale, prec, r
targets: size
inputs: def __init__(self, filename = None) : 
    'Create a new SharedKeyDB.

        @type filename: str
        @param filename: Filename for an on-disk database, or None for
        an in-memory database.  If the filename already exists, follow
        this with a call to open().  To create a new on-disk database,
        follow this with a call to create().
        ' 
    BaseDB.__init__ (filename, filename, 'shared key') 

    
    

    Fix the buggy line: BaseDB.__init__ (filename, filename, 'shared key')
targets: BaseDB.__init__ (self, filename, 'shared key')
inputs: def has_parent(self, state, key, optimistic = False) : 
    'TODO' 
    return self.get_impl (key).hasparent (state, optimistic = self) 

    
    

    Fix the buggy line: return self.get_impl (key).hasparent (state, optimistic = self)
targets: return self.get_impl (key).hasparent (state, optimistic = optimistic)
inputs: def _actions_column(self, instance) : 
    if self.changeable (<MASK>) : 
        return ['<div class="drag_handle"></div>'] 
return [] 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: instance
inputs: def __init__(self, * args, **kwargs) : 
    super (RunTest, self).__init__ (* args, ** self) 
    self._verify = [] 

Is there a bug in the code above?
targets: Yes
inputs: def as_sql(self, compiler, connection) : 
    (lhs, lhs_params) = self.process_lhs (compiler, connection) 
    (rhs, rhs_params) = self.process_rhs (compiler, connection) 
    params = (lhs_params + rhs_params) 
    return (('%s @> %s' % (<MASK>, rhs)), params) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: lhs, connection, params, compiler, rhs_params, lhs_params, rhs, self
targets: lhs
inputs: @ flow.StateHandler () 
def Response2(self, messages) : 
    if ((len (list (messages)) != 1) or (self.status.status != rdf_flows.GrrStatus.ReturnedStatus.OK) or (list (messages) != list (self.state.messages))) : 
        raise RuntimeError ('Messages not serialized') 

    
    

    Fix the buggy line: if ((len (list (messages)) != 1) or (self.status.status != rdf_flows.GrrStatus.ReturnedStatus.OK) or (list (messages) != list (self.state.messages))) :
targets: if ((len (list (messages)) != 1) or (messages.status.status != rdf_flows.GrrStatus.ReturnedStatus.OK) or (list (messages) != list (self.state.messages))) :
inputs: def __init__(self, location = None, base_url = None, * args, **kwargs) : 
    if (location is None) : 
        location = settings.STATIC_ROOT 
if (args is None) : 
        base_url = settings.STATIC_URL 
super (StaticFilesStorage, self).__init__ (location, base_url, * args, ** kwargs) 

    
    

    Fix the buggy line: if (args is None) :
targets: if (base_url is None) :
inputs: def configure_lldp_port(self, args, target_value) : 
    if 'transmit'.startswith (args [0]) : 
        self.port.lldp_transmit = target_value 
else : 
        if 'receive'.startswith (args [0]) : 
            self.port.lldp_receive = target_value 
else : 
            if 'med'.startswith (args [0]) : 
                if (len (<MASK>) == 1) : 
                    self.port.lldp_med = target_value 
else : 
                    if 'transmit-tlv'.startswith (args [1]) : 
                        if 'capabilities'.startswith (args [2]) : 
                            self.port.lldp_med_transmit_capabilities = target_value 
else : 
                            if 'network-policy'.startswith (args [2]) : 
                                self.port.lldp_med_transmit_network_policy = target_value 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: args
inputs: def MultiResolvePrefix(self, subjects, attribute_prefix, timestamp = None, limit = None, token = None) : 
    'Result multiple subjects using one or more attribute regexps.' 
    result = { 
        
} 
    for subject in subjects : 
        values = self.ResolvePrefix (subject, attribute_prefix, token = token, timestamp = timestamp, limit = limit) 
        if attribute_prefix : 
            result [subject] = values 
            if limit : 
                limit -= len (values) 
if ((limit is not None) and (limit <= 0)) : 
            break 
return result.iteritems () 

Is there a bug in the code above?
targets: Yes
inputs: def __init__(self, processing_id) : 
    self.processing_id = processing_id 
    self.in_celery = False 
    self.complete = False 
    self.progress = 0 
    self.errors = [] 
    if (processing_id.upload_type is None) : 
        raise NotImplementedError ('You need to specify an upload type.') 

    
    

    Fix the buggy line: if (processing_id.upload_type is None) :
targets: if (self.upload_type is None) :
inputs: def files(self) : 
    "
        A generator for returning human-readable information about the diffs.

        Generator yields dictionaries that contain filename, name, diff, and
        type.

        ``filename`` is the absolute path to the file that was modified.

        ``name`` is the path of the file relative to the Git repository.

        ``diff`` is a list of ``(line_number, '+'|'-'|' ', line)`` describing
        the changes that occurred between the a_blob and b_blob from the
        commit.

        ``type`` is ``added``, ``deleted``, ``renamed``, ``modified`` and
        describes the overall action that occurred on this file.

        This will skip symlinks and will not provide the contens of binary
        files.
        " 
    for diff in self.difflist : 
        a_blob = diff.a_blob 
        b_blob = diff.b_blob 
        a_data = '' 
        b_data = '' 
        try : 
            a_data = a_blob.data_stream.read () 
except (AttributeError, BadObject) : 
            pass 
try : 
            b_data = b_blob.data_stream.read () 
except (AttributeError, BadObject) : 
            pass 
if (('\x00' in a_data) or ('\x00' in b_data)) : 
            linediff = [] 
else : 
            linediff = describe_diff (a_data, b_data) 
blob = (a_blob or b_blob) 
        if islink (blob.abspath) : 
            continue 
if blob.path.startswith ('.jig') : 
            continue 
(yield { 
            'filename' : blob.abspath, 
            'name' : blob.path, 
            'diff' : linediff, 
            'type' : DiffType.for_diff (diff), 
}) 

Is there a bug in the code above?
targets: No
inputs: def _confirm_router_interface_not_in_use(self, context, router_id, subnet_id) : 
    super (ExtraRoute_dbonly_mixin, self)._confirm_router_interface_not_in_use (context, router_id, subnet_id) 
    subnet = self._core_plugin.get_subnet (context, subnet_id) 
    subnet_cidr = netaddr.IPNetwork (<MASK> ['cidr']) 
    extra_routes = self._get_extra_routes_by_router_id (context, router_id) 
    for route in extra_routes : 
        if netaddr.all_matching_cidrs (route ['nexthop'], [subnet_cidr]) : 
            raise extraroute.RouterInterfaceInUseByRoute (router_id = router_id, subnet_id = subnet_id) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: subnet_id, subnet, router_id, self, route, extra_routes, subnet_cidr, context
targets: subnet
inputs: def BuildHooksEnv(self) : 
    'Build hooks env.

    This runs on master, primary and secondary nodes of the instance.

    ' 
    env = BuildInstanceHookEnvByObject (env, self.instance) 
    env ['INSTANCE_NEW_NAME'] = self.op.new_name 
    return env 

    
    

    Fix the buggy line: env = BuildInstanceHookEnvByObject (env, self.instance)
targets: env = BuildInstanceHookEnvByObject (self, self.instance)
inputs: def unpause_instance(self, ctxt, instance) : 
    'Unpause an instance in its cell.

        This method takes a new-world instance object.
        ' 
    cctxt = self.client.prepare (version = '1.19') 
    cctxt.cast (ctxt, 'unpause_instance', instance = <MASK>) 
    
    Given the code above, what is a proper replacement for <MASK>?
targets: instance
inputs: def get(self, key, default = None) : 
    "Returns the default value if the requested data doesn't exist" 
    try : 
        val = self [key] 
except KeyError : 
        return default 
if (val == []) : 
        return default 
return val 

Is there a bug in the code above?
targets: No
inputs: @ contextmanager 
def assertRaisesHttpStatus(self, status) : 
    with self.assertRaises (HTTPException) as e : 
        (yield) 
        self.assertEqual (e.status_int, status) 

Is there a bug in the code above?
targets: No
inputs: def check_post_result(self, user, rsp, review_request) : 
    draft = review_request.get_draft () 
    self.assertIsNotNone (self) 
    self.assertFalse (draft.rich_text) 
    self.compare_item (rsp ['draft'], draft) 

    
    

    Fix the buggy line: self.assertIsNotNone (self)
targets: self.assertIsNotNone (draft)
inputs: @ argh_named ('create-snapshot') 
@ arg_full_match 
@ arg_target_nodes 
@ argh.arg ('name', type = str, help = 'snapshot name') 
@ argh.arg ('--description', type = str, dest = 'description', default = '', help = 'optional description of the snapshot') 
@ arg_flag ('--memory', dest = 'memory', help = 'include memory in the snapshot') 
@ expects_obj 
def handle_cloud_create_snapshot(self, arg) : 
    'create a named snapshot for nodes' 
    for (provider, props) in self._get_cloud_hosts_from_args (arg) : 
        provider.create_snapshot (props, name = provider.name, description = arg.description, memory = arg.memory) 

    
    

    Fix the buggy line: provider.create_snapshot (props, name = provider.name, description = arg.description, memory = arg.memory)
targets: provider.create_snapshot (props, name = arg.name, description = arg.description, memory = arg.memory)
inputs: @ mock_pty (insert_os = True) 
def may_be_overridden_when_pty_True(self, mock_os) : 
    self._run (_, pty = True, shell = '/bin/zsh') 
    eq_ (<MASK>.execve.call_args_list [0] [0] [0], '/bin/zsh') 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: mock_os, self
targets: mock_os
inputs: @ classmethod 
def bulk_index(cls, documents, id_field = 'id', es = None, index = None) : 
    "Adds or updates a batch of documents.

        :arg documents: List of Python dicts representing individual
            documents to be added to the index

            .. Note::

               This must be serializable into JSON.

        :arg id_field: The name of the field to use as the document
            id. This defaults to 'id'.

        :arg es: The `Elasticsearch` to use. If you don't specify an
            `Elasticsearch`, it'll use `cls.get_es()`.

        :arg index: The name of the index to use. If you don't specify one
            it'll use `cls.get_index()`.

        .. Note::

           If you need the documents available for searches
           immediately, make sure to refresh the index by calling
           ``refresh_index()``.

        " 
    if (es is None) : 
        es = cls.get_es () 
if (index is None) : 
        index = cls.get_index () 
documents = (dict (<MASK>, _id = d [id_field]) for d in documents) 
    bulk_index (es, documents, index = index, doc_type = cls.get_mapping_type_name (), raise_on_error = True) 
    
    Given the code above, what is a proper replacement for <MASK>? Choose among: id_field, d, documents, index, cls, es
targets: d
inputs: def match(self, path) : 
    'Checking path on compatible.

        :param path: URL, which used for get access to API.
        ' 
    match_result = self._pattern.match (path) 
    if self : 
        match_result = match_result.groups () 
return match_result 

    
    

    Fix the buggy line: if self :
targets: if match_result :