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

All Samples(16)  |  Call(12)  |  Derive(0)  |  Import(4)
Raised when the program gets into some kind of invalid state

Examples: an invalid type, bad responses from flickr, corrupted files, etc. 

src/p/y/py2FaceR-0.1.1/src/py2facer/lib/flickr.py   py2FaceR(Download)
# pylint: disable=W0232
 
from py2facer.lib.utils import InvalidConfig, InvalidState
import flickrapi
from sqlalchemy.ext.declarative import declarative_base
        def check_and_add(api_result, ghash, email):
            user = api_result.getchildren()
            if len(user) != 1:
                raise InvalidState('Flickr XML response in unexpected format')
            user = user[0]
            if 'nsid' not in user.attrib:
                raise InvalidState('Flickr XML response in unexpected format')
 
        if self.flickr_proxy is None and flickr_proxy is None:
            raise InvalidState('Unable to sync_contacts without a flickr_proxy')
        if flickr_proxy is None:
            flickr_proxy = self.flickr_proxy
 
        if self.flickr_proxy is None and flickr_proxy is None:
            raise InvalidState('Unable to sync_contacts without a flickr_proxy')
        if flickr_proxy is None:
            return self.flickr_proxy

src/p/y/py2FaceR-0.1.1/src/py2facer/lib/image.py   py2FaceR(Download)
 
from PIL import IptcImagePlugin, ExifTags
from py2facer.lib.utils import InvalidConfig, InvalidState
import datetime
import logging
 
            if id in self.__other_id:
                raise InvalidState('A linking ID can only be set once')
            self.__other_id[id] = val
 
                raise InvalidConfig('If any keyword arg is not None, then ALL must not be none')
            if x_pos > self.width or (x_pos + width) > self.width:
                raise InvalidState('Face (%s) in image %s X boundry or boundry+'
                                   'width is > total image width' % (google_id, self))
        self._people.append(Image.ContainedPerson(google_id, x_pos=x_pos, 

src/p/y/py2FaceR-0.1.1/src/py2facer/tests/image.py   py2FaceR(Download)
from py2facer import tests
from py2facer.lib import picasa, image
from py2facer.lib.utils import InvalidState
 
class TestImagePhotoFaces(unittest.TestCase):

src/p/y/py2FaceR-0.1.1/src/py2facer/tests/flickr.py   py2FaceR(Download)
from py2facer.lib.flickr import FlickrContactManager, FlickrContact, DbProxy,\
    FlickrImageManager, FlickrImage
from py2facer.lib.utils import InvalidState
from xml.etree import ElementTree
import flickrapi