abir18/sample_suggestion_acceptance huggingface dataset:
Original: // GossipMessage represents transaction gossiped via P2P network.
Modified: // GossipMessage represents message gossiped via P2P network (e.g. transaction, Block etc).
Suggestion accepted: True
Original: // NewGossip create new, ready to use instance of Gossip.
Modified: // NewGossip creates new, ready to use instance of Gossip.
Suggestion accepted: True
Original:         m.logger.Debug("Block submitted to DA layer!")
Modified:      m.logger.Debug("Submitting Block to DA layer ...")
Suggestion accepted: False
Original:             $cache = function_exists('apcu_fetch') ? new ApcuCache() : new PhpFileCache($cacheDir . '/graphqlite.' . crc32(__DIR__));
Modified:             $cache = function_exists('apcu_enabled') && apcu_enabled() ? new ApcuCache() : new PhpFileCache($cacheDir . '/graphqlite.' . crc32(__DIR__));
Suggestion accepted: False
Original: // initialize tries to load lastState from Store, and if it's not available it reads GenesisDoc.
Modified: // getInitialState tries to load lastState from Store, and if it's not available it reads GenesisDoc.
Suggestion accepted: True
Original:                 return errors.New("invalid lenght of 'InvalidLastHeaderHash'")
Modified:              return errors.New("invalid length of 'InvalidLastHeaderHash'")
Suggestion accepted: False
Original:  // SaveBlock saves block along with it's commit.
Modified:        // SaveBlock saves block along with its commit.
Suggestion accepted: False
Original:  StatusSuccess StatusCode = iota
Modified:         StatusSuccess StatusCode = iota + 1
Suggestion accepted: False
Original:   indexPreffix = [1]byte{2}
Modified:       blockPrefix = [1]byte{1}        indexPrefix = [1]byte{2}
Suggestion accepted: True
Original:   incommingTxCh chan *p2p.Tx
Modified:      incomingTxCh chan *p2p.Tx
Suggestion accepted: True
Original: func makeTestNetowork(t *testing.T, n int, conns map[int][]int, logger log.Logger) testNet {
Modified: func makeTestNetwork(t *testing.T, n int, conns map[int][]int, logger log.Logger) testNet {
Suggestion accepted: False
Original:             '--decimal-format', dest='decimal_format', type=str,
Modified:             '--decimal-format', dest='decimal_format', type=str, default='%.3f',
Suggestion accepted: True
Original:     print(f)
Modified: def format_decimal(d, f='%.3f', grouping=True):
Suggestion accepted: False
Original: class MuatationNamespace
Modified: class MutationNamespace
Suggestion accepted: True
Original: #[Attribute(Attribute::TARGET_METHOD)]
Modified: #[Attribute(Attribute::TARGET_PARAMETER)]
Suggestion accepted: True
Original: // Returns the list of ERLs for the specified version
Modified: // ListERLs returns the list of ERLs for the specified service version.
Suggestion accepted: True
Original:  *   @Attribute("decsription", type = "string"),
Modified:  *   @Attribute("description", type = "string"),
Suggestion accepted: True
Original:             userinfo = {}
Modified:         # Apple has no userinfo endpoint        # but may send some user information via POST in the first request.        #        # References:        # - https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_rest_api/authenticating_users_with_sign_in_with_apple        # - https://developer.apple.com/documentation/sign_in_with_apple/namei        try:            userdata = context.request.get("user", "{}")            userinfo = json.load(userdata)        except Exception as e:            userinfo = {}
Suggestion accepted: False
Original: def _init_authorization_state(provider_config, db_uri, sub_hash_salt, mirror_public):
Modified: def _init_authorization_state(provider_config, db_uri, sub_hash_salt, mirror_public=False):
Suggestion accepted: False
Original:         if "stateless" in config.get("provider") and not config.get("encryption_key"):
Modified:         if (            config.get("provider", {}).get("stateless")            and not config.get("encryption_key")        ):
Suggestion accepted: False
Modified:         self.stateless = StorageBase.type(db_uri) == "stateless"
Suggestion accepted: True
Original:             raise SATOSAConfigurationError("The name " + backend.name + " is taken!")
Modified:             raise SATOSAConfigurationError("The backend name " + backend.name + " is already used.")
Suggestion accepted: False
Original:             raise SATOSAConfigurationError("The name " + frontend.name + " is taken!")
Modified:             raise SATOSAConfigurationError("The frontend name " + frontend.name + " is already used.")
Suggestion accepted: False
Modified:     def _reload_metadata(self, context, config):        """        Reload SAML metadata        """        logger.debug("Reloading metadata")        res = self.idp.reload_metadata(copy.deepcopy(config))        message = "Metadata reload %s" % ("OK" if res else "failed")        status = "200 OK" if res else "500 FAILED"        return Response(message=message, status=status)
Suggestion accepted: False
Original:         return Response(message=message, status=status)
Modified:         config = self.config[SAMLBackend.KEY_SP_CONFIG][SAMLBackend.KEY_METADATA]        return super()._reload_metadata(context, config)
Suggestion accepted: False
Original:         return Response(message=message, status=status)
Modified:         config = self.config[SAMLFrontend.KEY_IDP_CONFIG][SAMLFrontend.KEY_METADATA]        return super()._reload_metadata(context, config)
Suggestion accepted: False
Original:             elif 'clear_input_attributes' in self.config:
Modified:             elif 'replace_subject_id' in self.config:
Suggestion accepted: True
Original:         "pyop >= 3.0.1", # TODO
Modified:         "pyop >= 3.2.0",
Suggestion accepted: False
Original:                     context._http_headers.get('QUERY_STRING'))):
Modified:         target_entity_id = context.get_decoration(Context.KEY_TARGET_ENTITYID)        qs_raw = context._http_headers['QUERY_STRING']        if target_entity_id or not qs_raw:
Suggestion accepted: False
Original:         qs = urllib.parse.parse_qs(context._http_headers['QUERY_STRING'])
Modified:         qs = parse_qs(qs_raw)
Suggestion accepted: True
Original: import urllib
Modified: from urllib.parse import parse_qs
Suggestion accepted: True
Original:             id_token_lifetime=self.config["provider"].get("id_token_lifetime", 600),
Modified:             id_token_lifetime=self.config["provider"].get("id_token_lifetime", 3600),
Suggestion accepted: False
Original:             syn_attributes[attr_name] = list(filter(None, [v.strip().strip(';') for v in re.split("[;\n]+", pystache.render(fmt, context))]))
Modified:             syn_attributes[attr_name] = [                value                for token in re.split("[;\n]+", pystache.render(fmt, context))                for value in [token.strip().strip(';')]                if value            ]
Suggestion accepted: True
Original:         @max_desc_length
Modified:       sig { returns(Integer) }      def self._max_desc_length        @max_desc_length || 80
Suggestion accepted: True
Original:         context.internal_data['target_entity_id'] = entity_id
Modified:         context.decorate(Context.KEY_TARGET_ENTITYID, entity_id)
Suggestion accepted: True
Original:     def _get_backend(self, context:str, entity_id:str) -> str:
Modified:     def _get_backend(self, context:Context, entity_id:str) -> str:
Suggestion accepted: True
Original:         assert isinstance(res, InternalData)
Modified:         expected_backend = rules['default_backend']        ctx, data = decide_service.backend_by_entityid(target_context)        assert ctx.target_backend == expected_backend
Suggestion accepted: False
Original:         entity_id = context.request.get('entityID')
Modified:         entity_id = context.get_decoration(Context.KEY_TARGET_ENTITYID)
Suggestion accepted: False
Original:             raise(ArgumentError, "description must be #{max_desc_length.to_s} characters or less")
Modified:           if desc.size > CommandHelp._max_desc_length            # A limit of 80 characters has been chosen to fit on standard terminal configurations. `long_desc` is            # available when descriptions don't fit nicely in that space. If you're using CLI::Kit for an application            # where you control the runtime environments and know that terminals will have more than 80 columns            # available, you can use             #            #   CLI::Kit::CommandHelp.max_desc_length =            #             # to increase this limit.            raise(ArgumentError, "description must be #{CommandHelp._max_desc_length} characters or less.")
Suggestion accepted: False
Original:       Kernel.raise(e)
Modified:       e.bug!(bug) unless bug.nil?      e.silent!(silent) unless silent.nil?      Kernel.raise(e)
Suggestion accepted: False
Original:   end
Modified:   sig { param(bug: T::Boolean).void }  def bug!    singleton_class.define_method(:bug?) { bug }  end  sig { param(silent: T::Boolean).void }  def silent!    singleton_class.define_method(:silent?) { silent }  end
Suggestion accepted: False
Original:       # rubocop:enable Sorbet/ConstantsFromStrings
Modified:     sig { params(const: Symbol, cmd: String, path: String, lamda_const: T.proc.returns(Gen::Command)).void }    def self.register(const, cmd, path, lamda_const)      autoload(const, path)      Registry.add(lamda_const, cmd)
Suggestion accepted: False
Original:     register :Help, 'help', 'gen/commands/help'
Modified:     register :Help, 'help', 'gen/commands/help', -> { Help }
Suggestion accepted: False
Original:           File.expand_path(@config.get_path('section', 'some-key')))
Modified:         assert_equal(File.expand_path('.test', ENV['HOME']), @config.get_path('section', 'some-key'))
Suggestion accepted: True
Original:           with_env("PATH" => "#{path}#{File::PATH_SEPARATOR}#{ENV['PATH']}") do
Modified:           with_env("PATH" => "#{tmpdir}#{File::PATH_SEPARATOR}#{ENV['PATH']}") do
Suggestion accepted: True
Original:             f.write("#!/bin/sh\n") unless is_windows
Modified:             if is_windows              f.write("@echo off\n")            else              f.write("#!/bin/sh\n")            end
Suggestion accepted: True
Original:       def initialize(path, config: nil, default_section: nil, convert_types: true)
Modified:       def initialize(path = nil, config: nil, default_section: nil, convert_types: true)
Suggestion accepted: False
Original: def fp_to_dict(fp: str) -> dict:
Modified: def fp_to_dict(fp: Path) -> dict:
Suggestion accepted: True
Original:     return d
Modified:     return json.loads(fp.read_text(encoding="utf-8"))
Suggestion accepted: False
Original:         lyr['order'] = i
Modified:     for i, lyr in enumerate(lyrs):        lyr['order'] = i
Suggestion accepted: True
Original:         If both are set, buffer_size must be >= min_buffer_size.
Modified:         If both are set, `buffer_size` must be >= `min_buffer_size`.
Suggestion accepted: True
Original:         min_buffer_size is only used when there is a global buffer size override,
Modified:         `min_buffer_size` is only used when there is a `buffer_size` override.
Suggestion accepted: False
Original:         e.g. if global is set to 0, and layer's min_buffer_size is set to 4, the result is 4.
Modified:         e.g. if global `buffer_size` is set to 0, and layer's `min_buffer_size` is set to 4, the result is 4.
Suggestion accepted: True
Original:         Per layer tileset overrides are allowed for both buffer_size and min_buffer_size.
Modified:         Per layer tileset overrides are allowed for both `buffer_size` and `min_buffer_size`.
Suggestion accepted: True
Original:         Per layer overrides have higher priority than global overrides, but less than ENV var.
Modified:         Per layer `buffer_size` override has a higher priority than a global override, but less than ENV var.        Per layer `min_buffer_size` tileset override has a higher priority than the layer's `min_buffer_size`.        The resulting `min_buffer_size` is used if it is higher that the resulting `buffer_size`.
Suggestion accepted: False
Original:             if all((v in resolved for v in layer.requires.get('layers'))):
Modified:             if all((v in resolved for v in layer.requires_layers)):
Suggestion accepted: True
Original:                 if layer.requires.get('layers'):
Modified:                 if layer.requires_layers:
Suggestion accepted: True
Original:                     mix = list(layer.requires.get('layers')) + [lid]
Modified:                     mix = list(layer.requires_layers) + [lid]
Suggestion accepted: True
Original:         result += f"-- Assert {func} exists\nSELECT '{func}'::regprocedure;\n\n"
Modified:     for table in layer.requires_tables:        result += f"-- Assert {table} exists\nSELECT '{table}'::regclass;\n\n"    for func in layer.requires_functions:        result += f"-- Assert {func} exists\nSELECT '{func}'::regprocedure;\n\n"
Suggestion accepted: True
Original:                 for req in layer.requires.get('layers'):
Modified:                 for req in layer.requires_layers:
Suggestion accepted: True
Original:         else:
Modified:         if not isinstance(requires, dict):            requires['layers'] = requires
Suggestion accepted: False
Original:                     elif any(not isinstance(v, str) or v == "" for v in reqprop):
Modified:                     if any(not isinstance(v, str) or v == "" for v in reqprop):
Suggestion accepted: False
Original:                                         value = source.slice(start,p);
Modified:                                        value = source.slice(start, p);
Suggestion accepted: True
Original:                                tagName = tagName.replace(/[\s<].*/g,'');
Modified:                             end = tagStart + 2 + tagName.length;                            tagName = tagName.replace(/[\s<].*/g,'');
Suggestion accepted: False
Original:         it('ElementTraversal', () => {
Modified:        describe('element traversal', () => {
Suggestion accepted: True
Original:                         expect(aElement.lastElementChild === bElement).toBe(true)
Modified:                       expect(aElement.firstElementChild).toBe(bElement)                       expect(aElement.lastElementChild).toBe(aElement.firstElementChild)
Suggestion accepted: False
Original:                         let dtdEnd = source.indexOf(']>', end);
Modified:                       var nextTagStart = source.indexOf('<', end);                    var dtdEnd = source.indexOf(']>', end);
Suggestion accepted: True
Original:   * @see https://www.w3.org/TR/xml/#AVNormalize
Modified:  * @see https://www.w3.org/TR/xml/#NT-AttValue * @see https://www.w3.org/TR/xml/#AVNormalize
Suggestion accepted: True
Original:         buf.push(' ', qualifiedName, '="', value.replace(/[<&"\t\n\r]/g,_xmlEncoder), '"')
Modified:         buf.push(' ', qualifiedName, '="', value.replace(/[<&"\t\n\r]/g, _xmlEncoder), '"')
Suggestion accepted: True
Original:        it.only('should normalize line breaks', () => {
Modified:       it('should normalize line breaks', () => {
Suggestion accepted: False
Original:                        source.replace(/\n\r/g, '\n'),// https://www.w3.org/TR/xml/#sec-line-ends
Modified:                     source.replace(/\n\r/g, '\n'), // https://www.w3.org/TR/xml/#sec-line-ends
Suggestion accepted: False
Original:         describe('sets Document.doctype', () => {
Modified:     describe('sets Document.doctype', () => {
Suggestion accepted: True
Original:          })
Modified:              })
Suggestion accepted: True
Original:                                 value = source.slice(start,p);
Modified:                                value = source.slice(start, p);
Suggestion accepted: True
Original:                                         var value = source.slice(start,p);
Modified:                                    var value = source.slice(start, p);
Suggestion accepted: True
Original:                 it.only('should properly convert whitespace literals back to character references', () => {
Modified:           it('should properly convert whitespace literals back to character references', () => {
Suggestion accepted: True
Original:                         it('should transform whitespace literals into spaces', () => {
Modified:                describe('containing whitespace', () => {
Suggestion accepted: True
Original:                                 ['&#xA;', '\n'],
Modified:                       it.each([
Suggestion accepted: True
Original:                  )
Modified:                                       const attr = dom.documentElement.attributes.getNamedItem('attr')                                        expect(attr.value).toBe(literal)
Suggestion accepted: True
Original:                         const { errors, parser } = getTestParser()
Modified:             })
Suggestion accepted: True
Original: var sax = require('./sax');
Modified: var dom = require('./dom')var entities = require('./entities');var sax = require('./sax');var DOMImplementation = dom.DOMImplementation;
Suggestion accepted: False
Original: var ParseError = sax.ParseError;
Modified: var ParseError = sax.ParseError;var XMLReader = sax.XMLReader;
Suggestion accepted: False
Original: exports.DOMImplementation = require('./dom').DOMImplementation;
Modified: /** * @deprecated Import/require from main entry point instead */exports.DOMImplementation = dom.DOMImplementation;
Suggestion accepted: False
Original: exports.XMLSerializer = require('./dom').XMLSerializer ;
Modified: /** * @deprecated Import/require from main entry point instead */exports.XMLSerializer = dom.XMLSerializer;
Suggestion accepted: False
Original: exports.XMLSerializer = require('./dom').XMLSerializer
Modified: var dom = require('./dom')exports.DOMImplementation = dom.DOMImplementationexports.XMLSerializer = dom.XMLSerializer
Suggestion accepted: False
Original: const { XMLSerializer } = require('../../lib/dom')
Modified: const { DOMParser, XMLSerializer } = require('../../lib')
Suggestion accepted: False
Original:          var namesTarget = spaceSeparatedTokens(classNames)
Modified:     /**      * The `getElementsByClassName` method of `Document` interface returns an array-like object      * of all child elements which have **all** of the given class name(s).  *       * Warning: This is a live LiveNodeList.         * Changes in the DOM will reflect in the array as the changes occur.    * If an element selected by this array no longer qualifies for the selector,    * it will automatically be removed. Be aware of this for iteration purposes.    *       * @param {string} classNames is a string representing the class name(s) to match; multiple class names are separated by (ASCII-)whitespace      *       * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName         */     getElementsByClassName: function(classNames) {          var spaceSeparatedTokens = function(string) {                   // 5 space characters, as defined in html spec                  return string.split(/[ \t\n\f\r]+/).filter(function(name) {                             return name !== ''                      })              }               var namesTarget = spaceSeparatedTokens(classNames)
Suggestion accepted: True
Original:   * @param {string=} version
Modified:      * @param {string} [version]
Suggestion accepted: True
Original:   * @param {string=} systemId
Modified:     * @param {string} [publicId]    * @param {string} [systemId]
Suggestion accepted: True
Original:         /**
Modified:             /**
Suggestion accepted: False
Original:                 return buf.push(' ',node.name,'="',node.value.replace(/[<&"]/g,_xmlEncoder),'"');
Modified:          return buf.push(' ', node.name, '="', node.value.replace(/[<&"]/g,_xmlEncoder), '"');
Suggestion accepted: True
Original:                        .replace(/[<&]/g,_xmlEncoder)
Modified:                         .replace(/&/g, '&amp;')                 .replace(/</g, '&lt;')
Suggestion accepted: False
Original:      * Meta data for the set of parsed flags, used to detect duplicates
Modified:      * Meta data for the set of parsed flags, used to detect duplicates.
Suggestion accepted: False
Original:                 //not standart
Modified:          //not standard
Suggestion accepted: False
Original:                         .documentElement
Modified:               const root = new DOMParser()                    .parseFromString('<xml/>', 'text/xml')                  .documentElement
Suggestion accepted: False
Original: const DOMParser = require('../../lib/dom-parser').DOMParser
Modified: const { DOMParser } = require('../../lib/dom-parser')
Suggestion accepted: True
Original:                 )
Modified:              const output = new DOMParser().parseFromString(source, 'text/xml').toString()           expect(output).toBe(source)
Suggestion accepted: False
Original: const XML_ERROR_AND_WARNING = '<html disabled><1 1="2"/></body></html>'
Modified: const XML_ERROR_WITH_WARNING = '<html disabled><1 1="2"/></body></html>'const XML_ERROR_NOT_CAUGHT = '<html><body title="1<2"><table&lt;;test</body></body></html>'
Suggestion accepted: False
Original: describe('errorHandle', () => {
Modified: describe('errorHandler', () => {
Suggestion accepted: True
Original:        ETCDUserName  = "username"
Modified:  ETCDUsername  = "username"
Suggestion accepted: False
Original:                                expect({actual: actual ? actual.toString() : actual, errors}).toMatchSnapshot()
Modified:                               const output = actual ? actual.toString() : actual                              if (errors.keys.length() === 0)                                 expect({output}).toMatchSnapshot()                              else                                    expect({errors, output}).toMatchSnapshot()
Suggestion accepted: False
Original:                var doc1 = new DOMParser().parseFromString("<doc1 attr1='1' attr2='a2'>text1<child>text2</child></doc1>",'text/xml');
Modified:               var doc1 = new DOMParser().parseFromString("<doc1 attr1='1' attr2='a2'>text1<child>text2</child></doc1>",'text/xml')
Suggestion accepted: False
Original:                assert(n, doc1s);
Modified:             var n =doc1.cloneNode(true)             assert(n, doc1s)
Suggestion accepted: False
Original:                 doc1.documentElement.appendChild(n);
Modified:           var doc3 = new DOMParser().parseFromString("<doc2 attr='2'><doc1 attr1='1' attr2='a2'>text1<child>text2</child></doc1></doc2>")               var n =doc1.importNode(doc2.documentElement, true)              doc1.documentElement.appendChild(n)
Suggestion accepted: False
Original:                var doc2 = parser.parseFromString('<html><body title="1<2"><table&lt;;test</body></body></html>', 'text/html');
Modified:             parser.parseFromString('<html><body title="1<2"><table&lt;;test</body></body></html>', 'text/html');
Suggestion accepted: False
Original:        assert.strictEqual(dom+'', '<img attr="1" xmlns="http://www.w3.org/1999/xhtml"/>')
Modified:        assert.strictEqual(dom.toString(), '<img attr="1" xmlns="http://www.w3.org/1999/xhtml"/>')
Suggestion accepted: False
Original:        assert(/\n@#\[line\:2,col\:2\]/.test(error.join(' ')),'line,col must record:'+JSON.stringify(error));
Modified:         assert(/\n@#\[line\:2,col\:2\]/.test(error.join(' ')), 'line,col must record: ' + JSON.stringify(error));
Suggestion accepted: False
Original: }).export(module);
Modified:      }}).export(module)
Suggestion accepted: False
Original:         assert(dom+'', '<div xmlns="http://www.w3.org/1999/xhtml">   ^d         ^e         ^f   ^v         ^x   ^b   </div>');
Modified:         var dom = new DOMParser().parseFromString('<div>&Auml;&auml;&Aring;&aring;&AElig;&aelig;&Ouml;&ouml;&Oslash;&oslash;&szlig;&Uuml;&uuml;&euro;</div>','text/html');        // For the future, it may be nicer to use \uxxxx in the assert strings        // rather than pasting in multi-byte UTF-8 Unicode characters        assert(dom+'', '<div xmlns="http://www.w3.org/1999/xhtml">   ^d         ^e         ^f         ^v         ^x         ^=   ^|         ^b   </div>');
Suggestion accepted: True
Original:     'Euro characters': function () {
Modified:     'European entities': function () {
Suggestion accepted: True