Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(14)  |  Call(10)  |  Derive(0)  |  Import(4)

src/c/o/cogent-1.5.3/cogent/parse/ebi.py   cogent(Download)
from string import maketrans, strip, rstrip
from pprint import pprint, pformat
from cogent.parse.record_finder import DelimitedRecordFinder,\
    LabeledRecordFinder, is_empty, TailedRecordFinder
from cogent.parse.record import RecordError, FieldError
 
endswith_period = lambda x: x.endswith('.')
period_tail_finder = TailedRecordFinder(endswith_period)
 
 
    lines = labeloff(lines)
    result = []
    for item in period_tail_finder(lines):
        item = ' '.join(item).rstrip('. ')
        if item.startswith('Plasmid'):
    """
    lines = labeloff(lines)
    keyvalues = map(dr_itemparser, period_tail_finder(lines))
    result = pairs_to_dict(keyvalues, 'always_multi_value')
    return result

src/p/y/pycogent-HEAD/cogent/parse/ebi.py   pycogent(Download)
from string import maketrans, strip, rstrip
from pprint import pprint, pformat
from cogent.parse.record_finder import DelimitedRecordFinder,\
    LabeledRecordFinder, is_empty, TailedRecordFinder
from cogent.parse.record import RecordError, FieldError
 
endswith_period = lambda x: x.endswith('.')
period_tail_finder = TailedRecordFinder(endswith_period)
 
 
    lines = labeloff(lines)
    result = []
    for item in period_tail_finder(lines):
        item = ' '.join(item).rstrip('. ')
        if item.startswith('Plasmid'):
    """
    lines = labeloff(lines)
    keyvalues = map(dr_itemparser, period_tail_finder(lines))
    result = pairs_to_dict(keyvalues, 'always_multi_value')
    return result

src/c/o/cogent-1.5.3/tests/test_parse/test_record_finder.py   cogent(Download)
 
from cogent.parse.record import RecordError
from cogent.parse.record_finder import DelimitedRecordFinder, \
    LabeledRecordFinder, LineGrouper, TailedRecordFinder
from cogent.util.unit_test import TestCase, main
    def setUp(self):
        """Define a standard TailedRecordFinder"""
        self.endswith_period = lambda x: x.endswith('.')
        self.period_tail_finder = TailedRecordFinder(self.endswith_period)
 
        self.assertRaises(RecordError, list, f(good+bad))
 
        f2 = TailedRecordFinder(self.endswith_period, strict=False)
        self.assertEqual(list(f2(good+bad)), result + [['abc']])
 

src/p/y/pycogent-HEAD/tests/test_parse/test_record_finder.py   pycogent(Download)
 
from cogent.parse.record import RecordError
from cogent.parse.record_finder import DelimitedRecordFinder, \
    LabeledRecordFinder, LineGrouper, TailedRecordFinder
from cogent.util.unit_test import TestCase, main
    def setUp(self):
        """Define a standard TailedRecordFinder"""
        self.endswith_period = lambda x: x.endswith('.')
        self.period_tail_finder = TailedRecordFinder(self.endswith_period)
 
        self.assertRaises(RecordError, list, f(good+bad))
 
        f2 = TailedRecordFinder(self.endswith_period, strict=False)
        self.assertEqual(list(f2(good+bad)), result + [['abc']])