docs: def _force_edge_active(self, seqs: List[List[GridQubit]], edge: EDGE,
                             sample_bool: Callable[[], bool]
                             ) -> List[List[GridQubit]]:
          """Move which forces given edge to appear on some sequence.
  
          Args:
            seqs: List of linear sequences covering chip.
            edge: Edge to be activated.
            sample_bool: Callable returning random bool.
  
          Returns:
            New list of linear sequences with given edge on some of the
            sequences.
          """
  
          n0, n1 = edge
  
          # Make a copy of original sequences.
          seqs = list(seqs)
  
          # Localize edge nodes within current solution.
          i0, j0 = index_2d(seqs, n0)
          i1, j1 = index_2d(seqs, n1)
          s0 = seqs[i0]
          s1 = seqs[i1]
  
          # Handle case when nodes belong to different linear sequences,
          # separately from the case where they belong to a single linear
          # sequence.
          if i0 != i1:
  
              # Split s0 and s1 in two parts: s0 in parts before n0, and after n0
              # (without n0); s1 in parts before n1, and after n1 (without n1).
              part = [s0[:j0], s0[j0 + 1:]], [s1[:j1], s1[j1 + 1:]]
  
              # Remove both sequences from original list.
              del seqs[max(i0, i1)]
              del seqs[min(i0, i1)]
  
              # Choose part of s0 which will be attached to n0, and make sure it
              # can be attached in the end.
              c0 = 0 if not part[0][1] else 1 if not part[0][
                  0] else sample_bool()
              if c0:
                  part[0][c0].reverse()
  
              # Choose part of s1 which will be attached to n1, and make sure it
              # can be attached in the beginning.
              c1 = 0 if not part[1][1] else 1 if not part[1][
                  0] else sample_bool()
              if not c1:
                  part[1][c1].reverse()
  
              # Append newly formed sequence from the chosen parts and new edge.
              seqs.append(part[0][c0] + [n0, n1] + part[1][c1])
  
              # Append the left-overs to the solution, if they exist.
              other = [1, 0]
              seqs.append(part[0][other[c0]])
              seqs.append(part[1][other[c1]])
          else:
              # Swap nodes so that n0 always preceeds n1 on sequence.
              if j0 > j1:
                  j0, j1 = j1, j0
                  n0, n1 = n1, n0
  
              # Split sequence in three parts, without nodes n0 an n1 present:
              # head might end with n0, inner might begin with n0 and end with
              # n1, tail might begin with n1.
              head = s0[:j0]
              inner = s0[j0 + 1:j1]
              tail = s0[j1 + 1:]
  
              # Remove original sequence from sequences list.
              del seqs[i0]
  
              # Either append edge to inner section, or attach it between head
              # and tail.
              if sample_bool():
                  # Append edge either before or after inner section.
                  if sample_bool():
                      seqs.append(inner + [n1, n0] + head[::-1])
                      seqs.append(tail)
                  else:
                      seqs.append(tail[::-1] + [n1, n0] + inner)
                      seqs.append(head)
              else:
                  # Form a new sequence from head, tail, and new edge.
                  seqs.append(head + [n0, n1] + tail)
                  seqs.append(inner)
  
          return [e for e in seqs if e]