class_docstr: Unit tests for :func:`~networkx.geographical_threshold_graph`
class_docstr_tok: ["Unit","tests","for",":","func",":","`","~networkx.geographical_threshold_graph","`"]
docstr: Tests that pairs of vertices adjacent if and only if their
  distances meet the given threshold.
docstr_tok: ["Tests","that","pairs","of","vertices","adjacent","if","and","only","if","their","distances","meet","the","given","threshold","."]
code: def test_distances(self):
      """Tests that pairs of vertices adjacent if and only if their
      distances meet the given threshold.
      """
      # Use the Euclidean metric and alpha = -2
      # the default according to the documentation.
      G = nx.geographical_threshold_graph(50, 10)
      for u, v in combinations(G, 2):
          # Adjacent vertices must exceed the threshold.
          if v in G[u]:
              assert join(G, u, v, 10, -2, math.dist)
          # Nonadjacent vertices must not exceed the threshold.
          else:
              assert not join(G, u, v, 10, -2, math.dist)
  
imports: import math
  import random
  from itertools import combinations
  import pytest
  import networkx
label_desc: Use image node_id 2 for calling the TestGeographicalThresholdGraph obj's underlying member method code with example usage: obj.test_distances() without return types