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

All Samples(42)  |  Call(40)  |  Derive(0)  |  Import(2)

src/g/u/guessit-0.7.1/guessit/language.py   guessit(Download)
    def convert(self, alpha2):
        return str(babelfish.Country(alpha2))
 
    def reverse(self, name):
        # exceptions come first, as they need to override a potential match
    def __init__(self, language, country=None, strict=False):
        language = u(language.strip().lower())
        country = babelfish.Country(country.upper()) if country else None
 
        try:

src/g/u/guessit-HEAD/guessit/language.py   guessit(Download)
    def convert(self, alpha2):
        return str(babelfish.Country(alpha2))
 
    def reverse(self, name):
        # exceptions come first, as they need to override a potential match
    def __init__(self, language, country=None, strict=False):
        language = u(language.strip().lower())
        country = babelfish.Country(country.upper()) if country else None
 
        try:

src/s/i/sickbeard_mp4_automator-HEAD/babelfish/tests.py   sickbeard_mp4_automator(Download)
from unittest import TestCase, TestSuite, TestLoader, TextTestRunner
from pkg_resources import resource_stream  # @UnresolvedImport
from babelfish import (LANGUAGES, Language, Country, Script, language_converters, country_converters,
    LanguageReverseConverter, LanguageConvertError, LanguageReverseError, CountryReverseError)
 
    def test_wrong_country(self):
        self.assertRaises(ValueError, lambda: Country('ZZ'))
 
    def test_eq(self):
        self.assertEqual(Country('US'), Country('US'))
 
    def test_ne(self):
        self.assertNotEqual(Country('GB'), Country('US'))

src/b/a/babelfish-0.5.1/babelfish/tests.py   babelfish(Download)
from unittest import TestCase, TestSuite, TestLoader, TextTestRunner
from pkg_resources import resource_stream  # @UnresolvedImport
from babelfish import (LANGUAGES, Language, Country, Script, language_converters, country_converters,
    LanguageReverseConverter, LanguageConvertError, LanguageReverseError, CountryReverseError)
 
    def test_wrong_country(self):
        self.assertRaises(ValueError, lambda: Country('ZZ'))
 
    def test_eq(self):
        self.assertEqual(Country('US'), Country('US'))
 
    def test_ne(self):
        self.assertNotEqual(Country('GB'), Country('US'))