<commit_before>// Copyright 2017 Google Inc. 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.
//

// Author: <EMAIL> (<NAME>)

#include "s2/s2builderutil_closed_set_normalizer.h"

#include <memory>

#include "s2/third_party/absl/memory/memory.h"
#include "s2/s2builder_layer.h"

using absl::make_unique;
using std::shared_ptr;
using std::unique_ptr;
using std::vector;

using EdgeType = S2Builder::EdgeType;
using Graph = S2Builder::Graph;
using GraphOptions = S2Builder::GraphOptions;

using DegenerateEdges = GraphOptions::DegenerateEdges;
using DuplicateEdges = GraphOptions::DuplicateEdges;
using SiblingPairs = GraphOptions::SiblingPairs;

using Edge = Graph::Edge;
using EdgeId = Graph::EdgeId;
using VertexId = Graph::VertexId;

namespace s2builderutil {

ClosedSetNormalizer::ClosedSetNormalizer(
    const Options& options, const vector<GraphOptions>& graph_options_out)
    : options_(options),
      graph_options_out_(graph_options_out),
      graph_options_in_(graph_options_out_),
      sentinel_(std::numeric_limits<VertexId>::max(),
                std::numeric_limits<VertexId>::max()) {
  S2_DCHECK_EQ(graph_options_out_.size(), 3);
  S2_DCHECK(graph_options_out_[0].edge_type() == EdgeType::DIRECTED);
  S2_DCHECK(graph_options_out_[2].edge_type() == EdgeType::DIRECTED);

  // NOTE(ericv): Supporting these options would require some extra code in
  // order to handle undirected edges, and they are not useful for building
  // polylines anyway (they are intended for polygon meshes).
  S2_DCHECK(graph_options_out_[1].sibling_pairs() != SiblingPairs::CREATE);
  S2_DCHECK(graph_options_out_[1].sibling_pairs() != SiblingPairs::REQUIRE);

  // Set the GraphOptions for the input graphs to ensure that (1) they share a
  // common set of vertices, and (2) to ensure that redundant degeneracies are
  // reduced to a single copy each.
  for (int dim = 0; dim < 3; ++dim) {<commit_msg>Remove unused declaration.<commit_after>// Copyright 2017 Google Inc. 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.
//

// Author: <EMAIL> (<NAME>)

#include "s2/s2builderutil_closed_set_normalizer.h"

#include <memory>

#include "s2/third_party/absl/memory/memory.h"
#include "s2/s2builder_layer.h"

using absl::make_unique;
using std::shared_ptr;
using std::unique_ptr;
using std::vector;

using EdgeType = S2Builder::EdgeType;
using Graph = S2Builder::Graph;
using GraphOptions = S2Builder::GraphOptions;

using DegenerateEdges = GraphOptions::DegenerateEdges;
using SiblingPairs = GraphOptions::SiblingPairs;

using Edge = Graph::Edge;
using EdgeId = Graph::EdgeId;
using VertexId = Graph::VertexId;

namespace s2builderutil {

ClosedSetNormalizer::ClosedSetNormalizer(
    const Options& options, const vector<GraphOptions>& graph_options_out)
    : options_(options),
      graph_options_out_(graph_options_out),
      graph_options_in_(graph_options_out_),
      sentinel_(std::numeric_limits<VertexId>::max(),
                std::numeric_limits<VertexId>::max()) {
  S2_DCHECK_EQ(graph_options_out_.size(), 3);
  S2_DCHECK(graph_options_out_[0].edge_type() == EdgeType::DIRECTED);
  S2_DCHECK(graph_options_out_[2].edge_type() == EdgeType::DIRECTED);

  // NOTE(ericv): Supporting these options would require some extra code in
  // order to handle undirected edges, and they are not useful for building
  // polylines anyway (they are intended for polygon meshes).
  S2_DCHECK(graph_options_out_[1].sibling_pairs() != SiblingPairs::CREATE);
  S2_DCHECK(graph_options_out_[1].sibling_pairs() != SiblingPairs::REQUIRE);

  // Set the GraphOptions for the input graphs to ensure that (1) they share a
  // common set of vertices, and (2) to ensure that redundant degeneracies are
  // reduced to a single copy each.
  for (int dim = 0; dim < 3; ++dim) {
{'fraction_non_alphanumeric': 0.10920016576875259, 'fraction_numerical': 0.0128470783257356, 'mean_word_length': 4.787769784172662, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3945632', 'n_tokens_mistral': 1492, 'n_tokens_neox': 1461, 'n_words': 447}