Did I find the right examples for you? yes no

All Samples(22)  |  Call(12)  |  Derive(0)  |  Import(10)

```from string              import split,atof
from cogent.struct.rna2d import Pairs

__author__ = "Shandy Wikman"
```
```        if count==1 or new_struct(line):#first line or new struct line.
if count > 1:
struct = Pairs(struct).directed()
struct.sort()
```
```                struct.append(pair)
#structs are one(1) based, adjust to zero based
struct = Pairs(struct).directed()
struct.sort()
```

```from string              import split,atof
from cogent.struct.rna2d import Pairs

__author__ = "Shandy Wikman"
```
```        if count==1 or new_struct(line):#first line or new struct line.
if count > 1:
struct = Pairs(struct).directed()
struct.sort()
```
```                struct.append(pair)
#structs are one(1) based, adjust to zero based
struct = Pairs(struct).directed()
struct.sort()
```

```#!/usr/bin/env python

from cogent.struct.rna2d      import Pairs
from cogent.struct.knots      import opt_single_random
```
```            pairs.append(line)

tmp = Pairs(pairs).directed()
tmp.sort()
```

```from string import split
from cogent.struct.rna2d import Pairs

__author__ = "Shandy Wikman"
```
```        if line.startswith('; ******'): #structure part ends
record = False
struct = Pairs(struct).directed()#remove duplicates
struct.sort()
```

```#!/usr/bin/env python

from cogent.struct.rna2d      import Pairs
from cogent.struct.knots      import opt_single_random
```
```            pairs.append(line)

tmp = Pairs(pairs).directed()
tmp.sort()
```

```from string import split
from cogent.struct.rna2d import Pairs

__author__ = "Shandy Wikman"
```
```        if line.startswith('; ******'): #structure part ends
record = False
struct = Pairs(struct).directed()#remove duplicates
struct.sort()
```

```#!/usr/bin/env python

from string import split
from cogent.struct.rna2d  import Pairs,ViennaStructure
```

```#!/usr/bin/env python

from string import split
from cogent.struct.rna2d  import Pairs,ViennaStructure
```

```from cogent.core.alphabet import CharAlphabet
from cogent.struct.rna2d import Pairs
delete_gaps_from_pairs, insert_gaps_in_pairs, gapped_to_ungapped,\
```
```        offset = -1
expected = [(0,20),(1,14),(2,12),(3,10),(4,9),(5,8)]
self.assertEqual(obs_pairs, expected)

```
```        offset = -1
expected = [(0,20),(1,14),(2,12),(3,10),(4,9),(5,8)]
self.assertEqual(obs_pairs, expected)

```

```from cogent.core.alphabet import CharAlphabet
from cogent.struct.rna2d import Pairs
delete_gaps_from_pairs, insert_gaps_in_pairs, gapped_to_ungapped,\
```
```        offset = -1
expected = [(0,20),(1,14),(2,12),(3,10),(4,9),(5,8)]
```        offset = -1