abir18/sample_suggestion_acceptance huggingface dataset:
Original:        var dom = new DOMParser().parseFromString('<div>&nbsp;&copy;&nbsp&copy</div>','text/html');
Modified:         var dom = new DOMParser().parseFromString('<div>&copy;&nbsp;&copy;</div>>','text/html');
Suggestion accepted: False
Original:     && error.stack.split('\n').find(
Modified:   return error && error.stack &&    error.stack.split('\n').find(
Suggestion accepted: True
Original: // Level 2 Core DOM interfaces:
Modified: exports.XMLSerializer = DOM.XMLSerializer;// Level 2 Core DOM interfaces:
Suggestion accepted: False
Original:             latestVersionCheck = now.getTime();
Modified:         Context activity = getActivity();        Date now = new Date();        // Check for a new version once in a day        if (activity != null && (now.getTime() - latestVersionCheck) > (24 * 3600 * 1000)) {            latestVersionCheck = now.getTime();
Suggestion accepted: False
Original:          */
Modified:         /* JSON file format:         * {         *     latest_version_code: integer,         *     url: https url of the package file         * }         */
Suggestion accepted: False
Original:             public void onFailure(Call call, IOException e) {
Modified:             public void onFailure(@NonNull Call call, @NonNull IOException e) {
Suggestion accepted: False
Original:             public void onResponse(Call call, Response response) throws IOException {
Modified:             public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
Suggestion accepted: False
Original: class PATEGANSynthesizer:
Modified: class PATEGANSynthesizer(SDGYMBaseSynthesizer):
Suggestion accepted: False
Modified: from opendp.whitenoise.synthesizers.base import SDGYMBaseSynthesizer
Suggestion accepted: False
Modified:         self.pd_cols = None        self.pd_index = None
Suggestion accepted: True
Original:         clientDeactivateThreshold, err := project.GetClientDeactivateThresholdAsTimeDuration()
Modified:        clientDeactivateThreshold, err := project.ClientDeactivateThresholdAsTimeDuration()
Suggestion accepted: True
Original:         data_dim = data.shape[1]
Modified:         if isinstance(data, pd.DataFrame):            for col in data.columns:                data[col] = pd.to_numeric(data[col], errors='ignore')            self.pd_cols = data.columns            self.pd_index = data.index            data = data.to_numpy()        else:            raise ValueError("Data must be a numpy array or pandas dataframe.")        data_dim = data.shape[1]
Suggestion accepted: False
Original:         return data
Modified:         df = pd.DataFrame(data,                 index = self.pd_index,                columns = self.pd_cols)        return df
Suggestion accepted: False
Original:                                                                  + ".WorkflowMultiBranchProject"));
Modified:                 return !(item.getParent() instanceof SCMSourceOwner);
Suggestion accepted: True
Original:  *   data[i*3 + 1] = b;
Modified:  *   data[i*3 + 2] = b;
Suggestion accepted: True
Original:         apiEndpoint := "rest/servicedeskapi/customer"
Modified:       const apiEndpoint = "rest/servicedeskapi/customer"
Suggestion accepted: True
Original:         req, err := c.client.NewRequestWithContext(ctx, "POST", apiEndpoint, payload)
Modified:       req, err := c.client.NewRequestWithContext(ctx, http.MethodPost, apiEndpoint, payload)
Suggestion accepted: True
Original:        resp, err := r.client.Do(req, nil)
Modified:         responseComment := new(RequestComment)     resp, err := r.client.Do(req, responseComment)
Suggestion accepted: False
Original:         Custom string `json:"custom,omitempty" structs:"items,omitempty"`
Modified:         Custom string `json:"custom,omitempty" structs:"custom,omitempty"`
Suggestion accepted: True
Original:         System string `json:"system,omitempty" structs:"system,omitempty"`
Modified:        System string `json:"system,omitempty" structs:"system,omitempty"`  CustomID int64 `json:"customId,omitempty" structs:"customId,omitempty"`
Suggestion accepted: True
Original: // FieldSchema represents a schema of a Jira field.
Modified: // FieldSchema represents a schema of a Jira field.// Documentation: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-fields/#api-rest-api-2-field-get
Suggestion accepted: True
Original: func (s *IssueService) GetIssueWithContext(ctx context.Context) ([]IssueType, *Response, error) {
Modified: func (s *IssueService) GetIssueTypesWithContext(ctx context.Context) ([]IssueType, *Response, error) {
Suggestion accepted: True
Original: //               And value is the string value for that particular key.
Modified: // DoTransitionWithPayload wraps DoTransitionWithPayloadWithContext using the background context.
Suggestion accepted: True
Original: // NewRawRequest creates an API request.
Modified: // NewRawRequestWithContext creates an API request.
Suggestion accepted: True
Original: // Update updates an issue link type.  The issue is found by key.
Modified: // UpdateWithContext updates an issue link type.  The issue is found by key.
Suggestion accepted: True
Original: func (s *IssueLinkTypeService) linkType(ctx context.Context, ID string) (*Response, error) {
Modified: func (s *IssueLinkTypeService) DeleteWithContext(ctx context.Context, ID string) (*Response, error) {
Suggestion accepted: True
Original:                             setattr(new_artist, attribute, getattr(previous_artist, attribute))
Modified:                 for attribute, kwarg_name in self.ATTRIBUTES_TO_COPY_FROM_ARTIST_TO_ARTIST_UNLESS_SPECIFED.items():                    if hasattr(previous_artist, attribute) \                        and kwarg_name not in self.kwargs:                            setattr(new_artist, attribute, getattr(previous_artist, attribute))
Suggestion accepted: False
Original: @pytest.mark.regeression
Modified: @pytest.mark.regression
Suggestion accepted: True
Original:       spark.socket = socket;
Modified:       spark.socket = websocket;
Suggestion accepted: False
Original:          )
Modified:              return fmt.Errorf(                      "check client(%s,%s) in project(%s): %w",                     i.ID.String(),                  i.ProjectID.String(),                   projectID.String(),                     ErrClientNotFound,              )
Suggestion accepted: True
Original:                return fmt.Errorf("docID: %s: %w", docID.String(), ErrClientNotActivated)
Modified:           return fmt.Errorf("client(%s) attaches document(%s): %w", docID.String(), ErrClientNotActivated)
Suggestion accepted: False
Original:                assert.NotNil(t, err, "key should be invalid: with -")
Modified:              assert.Equal(t, err, key.ErrInvalidKey, "key should be invalid: with -")
Suggestion accepted: False
Original:  * Copyright 2022 The Yorkie Authors. All rights reserved.
Modified:  * Copyright 2023 The Yorkie Authors. All rights reserved.
Suggestion accepted: True
Original:         // slugRegexString regular expression for key validation
Modified:        // slugRegexString regular expression for slug validation.
Suggestion accepted: False
Original: // Validate returns true if the key is valid.
Modified: // Validate checks whether the key is valid or not.
Suggestion accepted: False
Original:  * Copyright 2020 The Yorkie Authors. All rights reserved.
Modified:  * Copyright 2023 The Yorkie Authors. All rights reserved.
Suggestion accepted: True
Original:  return getDocumentKey(t.Name())
Modified:         return testDocumentKey(t.Name())
Suggestion accepted: True
Original:         var minSyncedServerSeq int64 = math.MaxInt64
Modified:    minSyncedServerSeq := math.MaxInt64
Suggestion accepted: False
Original:  return getDocumentKey(b.Name())
Modified:         return testDocumentKey(b.Name())
Suggestion accepted: True
Original: func getDocumentKey(name string) string {
Modified: func testDocumentKey(name string) string {
Suggestion accepted: True
Original:                 cancel2()
Modified:              watch2Ctx, cancel2 := context.WithCancel(ctx)           defer cancel2()         _, err = c2.Watch(watch2Ctx, d2, d3)            assert.NoError(t, err)          // 02. PeersChanged is triggered when another client closes the watch           expected = append(expected, watchResponsePair{                  Type: client.PeersChanged,                      Peers: map[string]types.Presence{                               c1.ID().String(): c1.Presence(),                        },              })
Suggestion accepted: False
Original: func (d DB) FindMinSyncedSeqInfo(
Modified: func (d *DB) FindMinSyncedSeqInfo(
Suggestion accepted: True
Original: // to the outside.
Modified: // ElementRHT is a hashtable with logical clock(Replicated hashtable).
Suggestion accepted: True
Original:  }
Modified:       if ok && node.Remove(v.CreatedAt()) {           removed = node.elem     }
Suggestion accepted: True
Original:  }
Modified:       if !ok {                return nil      }
Suggestion accepted: True
Original:  nodeMapByCreatedAt map[string]*ElementRHTNode
Modified:  // nodeMapByCreatedAt is a map with values    ^`^k   ^`^kof nodes by creation time. // Even if an element is removed by `set` or `delete`, it remains in    // nodeMapByCreatedAt and will be deleted physically by GC.     nodeMapByCreatedAt map[string]*ElementRHTNode
Suggestion accepted: True
Original: type LRUExpireCache[V types.AuthWebhookResponse] struct {
Modified: type LRUExpireCache[V any] struct {
Suggestion accepted: True
Original:  nodeMapByKey       map[string]*ElementRHTNode
Modified:   // nodeMapByKey is a map with values of nodes by key.   nodeMapByKey       map[string]*ElementRHTNode
Suggestion accepted: True
Original:         } else {
Modified:        cause = err     for errors.Unwrap(cause) != nil {               cause = errors.Unwrap(cause)    }
Suggestion accepted: False
Original:         for _, regex := range testRegexs {
Modified:    testRegexes := []*regexp.Regexp{                alphaNumberSpecialCharRegex,            containAlphaRegex,              containNumberRegex,             containSpecialCharRegex}        for _, regex := range testRegexes {
Suggestion accepted: True
Original:                                 st := status.Convert(err)
Modified:                               // TODO(chacha912): consider creating the error details type to remove the dependency on gRPC.                          st := status.Convert(err)
Suggestion accepted: False
Original: // GetProject get project by name.
Modified: // GetProject gets the project by name.
Suggestion accepted: True
Original:                         if cmd.Flags().Lookup("auth-webhook-url").Changed {
Modified:                         newAuthWebhookMethods := []string{                              string(types.AttachDocument),                           string(types.WatchDocuments),                   }
Suggestion accepted: True
Original:                          newName = flagName
Modified:                     newName := name                 if cmd.Flags().Lookup("name").Changed {                               newName = flagName                      }
Suggestion accepted: True
Original:                        exists, err := cli.GetProject(ctx, name)
Modified:                      existing, err := cli.GetProject(ctx, name)
Suggestion accepted: False
Original:        "github.com/yorkie-team/yorkie/gen/go/yorkie/v1"
Modified:    api "github.com/yorkie-team/yorkie/api/v1"
Suggestion accepted: False
Original:  var minSyncedServerSeq uint64 = 18446744073709551615
Modified:    var minSyncedServerSeq uint64 = math.MaxUint64
Suggestion accepted: True
Original:                latestSnapshot, err := s.backend.DB.FindLatestSnapshotInfo(ctx, docInfo.ID)
Modified:           latestSnapshot, err := s.backend.DB.FindClosestSnapshotInfo(ctx, docInfo.ID, uint64(math.MaxUint64))
Suggestion accepted: False
Original:                 "Whether to delete previous changes when the snapshot is created. ",
Modified:                "Whether to delete previous changes when the snapshot is created.",
Suggestion accepted: True
Original:         )
Modified:      guard := monkey.PatchInstanceMethod(            reflect.TypeOf(b),              "AttachGoroutine",            func(_ *background.Background, f func(c context.Context)) {                     f(context.Background())         },      )       defer func() {          guard.Unpatch() }()
Suggestion accepted: False
Original:                 Use:   "ls [project]",
Modified:              Use:   "ls [project name]",
Suggestion accepted: True
Original:        "github.com/yorkie-team/yorkie/api/types"
Modified:   "github.com/yorkie-team/yorkie/api/types"
Suggestion accepted: False
Original: var ErrEmptyProjectFields = errors.New("UpdatableProjectFields is empty")
Modified: var ErrEmptyProjectFields = errors.New("updatable project fields are empty")
Suggestion accepted: True
Original: func (e *InvalidFieldsError) Error() string { return "invalid project fields" }
Modified: func (e *InvalidFieldsError) Error() string { return "invalid fields" }
Suggestion accepted: True
Original:  }
Modified:       if !c.IsActive() {              return nil      }               c.clientMutex.Lock()    defer c.clientMutex.Unlock()
Suggestion accepted: True
Original:         // defaultEn is the default translator instance for the 'en' locale
Modified:     // defaultEn is the default translator instance for the 'en' locale.
Suggestion accepted: False
Original:  }
Modified:      if options.MaxCallRecvMsgSize != 0 {            dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(options.MaxCallRecvMsgSize)))     }
Suggestion accepted: True
Original:  * Copyright 2021 The Yorkie Authors. All rights reserved.
Modified:  * Copyright 2022 The Yorkie Authors. All rights reserved.
Suggestion accepted: True
Original:                         b.StartTimer()
Modified:                  b.StartTimer()
Suggestion accepted: False
Original: func (n *Node[V]) Value() V {
Modified: func (t *Node[V]) Value() V {
Suggestion accepted: True
Original: func (n *Node[V]) leftWeight() int {
Modified: func (t *Node[V]) leftWeight() int {
Suggestion accepted: True
Original: func (n *Node[V]) rightWeight() int {
Modified: func (t *Node[V]) rightWeight() int {
Suggestion accepted: True
Original: func (n *Node[V]) initWeight() {
Modified: func (t *Node[V]) initWeight() {
Suggestion accepted: True
Original: func (n *Node[V]) increaseWeight(weight int) {
Modified: func (t *Node[V]) increaseWeight(weight int) {
Suggestion accepted: True
Original: func (n *Node[V]) unlink() {
Modified: func (t *Node[V]) unlink() {
Suggestion accepted: True
Original: func (n *Node[V]) hasLinks() bool {
Modified: func (t *Node[V]) hasLinks() bool {
Suggestion accepted: True
Original:  return n.value
Modified:  return t.value
Suggestion accepted: True
Original:  if n.left == nil {
Modified:      if t.left == nil {
Suggestion accepted: True
Original:  return n.left.weight
Modified:    return t.left.weight
Suggestion accepted: True
Original:                 lruCache, err := cache.NewLRUExpireCache[any](1)
Modified:              lruCache, err := cache.NewLRUExpireCache[string](1)
Suggestion accepted: True
Original:  if n.right == nil {
Modified:     if t.right == nil {
Suggestion accepted: True
Original:  return n.right.weight
Modified:   return t.right.weight
Suggestion accepted: True
Original:  n.weight = n.value.Len()
Modified:        n.weight = t.value.Len()
Suggestion accepted: True
Original:  n.weight += weight
Modified:      t.weight += weight
Suggestion accepted: True
Original:  n.left = nil
Modified:    t.parent = nil  t.right = nil   t.left = nil
Suggestion accepted: True
Original:  return n.parent != nil || n.left != nil || n.right != nil
Modified:       return t.parent != nil || t.left != nil || t.right != nil
Suggestion accepted: True
Original:  n.weight = t.value.Len()
Modified:        t.weight = t.value.Len()
Suggestion accepted: True
Original:          updatableProjectFields.Name = &pbProjectFields.GetName().Value
Modified:          updatableProjectFields.Name = &pbProjectFields.Name.Value
Suggestion accepted: True
Original:          updatableProjectFields.AuthWebhookMethods = authWebhookMethods
Modified:                 var authWebhookMethods []string         for _, method := range pbProjectFields.AuthWebhookMethods {                     authWebhookMethods = append(authWebhookMethods, method.Value)           }               updatableProjectFields.AuthWebhookMethods = &authWebhookMethods
Suggestion accepted: True
Original:        pbUpatedAt, err := protoTypes.TimestampProto(project.UpdatedAt)
Modified:       pbUpdatedAt, err := protoTypes.TimestampProto(project.UpdatedAt)
Suggestion accepted: False
Original:        ErrProjectFieldEmpty = errors.New("UpdatableProjectFields is empty")
Modified:        // ErrEmptyProjectFields is returned when all the fields are empty.     ErrEmptyProjectFields = errors.New("all fields of the project are empty")
Suggestion accepted: False
Original:         }
Modified:       if i.Name == nil && i.AuthWebhookURL == nil && i.AuthWebhookMethods == nil {            return ErrEmptyProjectFields    }
Suggestion accepted: False
Original:  }
Modified:       if c.IsActive() {               return nil      }               c.clientMutex.Lock()    defer c.clientMutex.Unlock()
Suggestion accepted: True
Original:         }
Modified:      if (fields.Name != nil) {               exist, err := txn.First(tblProjects, "name", *fields.Name)            if err != nil {                 return nil, err         }               if exist != nil {                       return nil, fmt.Errorf("%s: %w", *fields.Name, database.ErrProjectNameAlreadyExists)          }       }
Suggestion accepted: False
Original:         updateTargetField := bson.M{}
Modified:   updatableFields := bson.M{}
Suggestion accepted: False
Original:        updateTargetField["updated_at"] = now
Modified:       updateTargetField["updated_at"] = gotime.Now()
Suggestion accepted: False
Original:         ProjectInfo := database.ProjectInfo{}
Modified:   info := database.ProjectInfo{}
Suggestion accepted: False
Original:          if item.value == value {
Modified:                if !item.value.Less(value) && !value.Less(item.value) {
Suggestion accepted: True
Original:  return c.ETCD.Validate()
Modified:        if c.ETCD != nil {              return c.ETCD.Validate()                }               return nil
Suggestion accepted: True
Original: // it is unmarshaled including private field.
Modified: // it is unmarshalled including private field.
Suggestion accepted: False
Original:                         Name: "documents",
Modified:          tblDocuments: {                 Name: tblDocuments,
Suggestion accepted: True
Original:                         Name: "changes",
Modified:            tblChanges: {                   Name: tblChanges,
Suggestion accepted: True
Original:                         Name: "snapshots",
Modified:          tblSnapshots: {                 Name: tblSnapshots,
Suggestion accepted: True
Original:                         Name: "syncedseqs",
Modified:                 tblSyncedSeqs: {                        Name: tblSyncedSeqs,
Suggestion accepted: True
Original: package prometheus
Modified: /* * Copyright 2021 The Yorkie Authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * *     http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package prometheus
Suggestion accepted: True
Original: package prometheus_test
Modified: /* * Copyright 2021 The Yorkie Authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * *     http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package prometheus_test
Suggestion accepted: False
Original: func BenchmarkEditing(b *testing.B) {
Modified: func BenchmarkTextEditing(b *testing.B) {
Suggestion accepted: True
Original:  }
Modified:      for startIdx := snapshotInfo.ServerSeq + 1; startIdx < initialServerSeq; startIdx += changeSegmentSize {                var endIdx uint64               if startIdx+changeSegmentSize < initialServerSeq {                      endIdx = startIdx + changeSegmentSize           } else {                        endIdx = initialServerSeq               }               changes, err := be.DB.FindChangeInfosBetweenServerSeqs(                 ctx,                    docInfo.ID,                     startIdx,                       endIdx,         )               if err != nil {                 return nil, nil, err            }               if err := doc.ApplyChangePack(change.NewPack(                   docKey,                 checkpoint.Initial.NextServerSeq(docInfo.ServerSeq),                    changes,                        nil,            )); err != nil {                        return nil, nil, err            }       }
Suggestion accepted: True
Original:                         }()
Modified:                    go func() {                             defer wg.Done()                         if i%2 == 0 {                                   assert.NoError(t, cli.Activate(ctx))                            } else {                                        assert.NoError(t, cli.Deactivate(ctx))                          }                       }()
Suggestion accepted: False
Original:                  }()
Modified:                    go func() {                             defer wg.Done()                         assert.NoError(t, cli.Deactivate(ctx))                  }()
Suggestion accepted: True
Original:                  }()
Modified:                    go func() {                             defer wg.Done()                         assert.NoError(t, cli.Activate(ctx))                    }()
Suggestion accepted: True
Original:  * Copyright 2020 The Yorkie Authors. All rights reserved.
Modified:  * Copyright 2021 The Yorkie Authors. All rights reserved.
Suggestion accepted: True
Original:                  }()
Modified:                    go func(idx int) {                              defer wg.Done()                         if idx%2 == 0 {                                 assert.NoError(t, cli.Activate(ctx))                            } else {                                        assert.NoError(t, cli.Deactivate(ctx))                          }                       }(i)
Suggestion accepted: True
Original:  c.clientMutex.RUnlock()
Modified:         if c.IsActive() {               return nil      }
Suggestion accepted: True
Original:         "github.com/yorkie-team/yorkie/test/helper"
Modified:         "github.com/stretchr/testify/assert"          "github.com/yorkie-team/yorkie/client"        "github.com/yorkie-team/yorkie/pkg/document"  "github.com/yorkie-team/yorkie/pkg/document/proxy"    "github.com/yorkie-team/yorkie/test/helper"
Suggestion accepted: True
Original:                          }
Modified:                              if idx%2 == 0 {                                 assert.NoError(t, cli.Activate(ctx))                                    return                          }                               assert.NoError(t, cli.Deactivate(ctx))
Suggestion accepted: True
Original:  package yorkie
Modified: package yorkie
Suggestion accepted: True
Original:  DefaultMongoPingTimeoutSec       = 5
Modified:    DefaultMongoConnectionTimeout = 5 * time.Second DefaultMongoPingTimeout       = 5 * time.Second
Suggestion accepted: True
Original:   conf := yorkie.NewConfig()
Modified:     conf := yorkie.NewConfig()
Suggestion accepted: True