def __init__(self, doc, version, seeds):
    '\n        Initialize a policy object from its database document.\n\n        :param dict doc: A database document.\n        :param str version: The version number of Starbelly that created the\n            policy.\n        :param list seeds: A list of seed URLs, used for computing costs for\n            crawled links.\n        '
    if (doc['name'].strip() == ''):
        _invalid('Policy name cannot be blank')
    self.authentication = PolicyAuthentication(doc['authentication'])
    if ('captcha_solver' in doc):
        self.captcha_solver = CaptchaSolver(doc['captcha_solver'])
    else:
        self.captcha_solver = None
    self.limits = PolicyLimits(doc['limits'])
    self.mime_type_rules = PolicyMimeTypeRules(doc['mime_type_rules'])
    self.proxy_rules = PolicyProxyRules(doc['proxy_rules'])
    self.robots_txt = PolicyRobotsTxt(doc['robots_txt'])
    self.url_normalization = PolicyUrlNormalization(doc['url_normalization'])
    self.url_rules = PolicyUrlRules(doc['url_rules'], seeds)
    self.user_agents = PolicyUserAgents(doc['user_agents'], version)
Initialize a policy object from its database document.

:param dict doc: A database document.
:param str version: The version number of Starbelly that created the
    policy.
:param list seeds: A list of seed URLs, used for computing costs for
    crawled links.
def __init__(self, doc, version, seeds):
    '\n        Initialize a policy object from its database document.\n\n        :param dict doc: A database document.\n        :param str version: The version number of Starbelly that created the\n            policy.\n        :param list seeds: A list of seed URLs, used for computing costs for\n            crawled links.\n        '
    if (doc['name'].strip() == ):
        _invalid('Policy name cannot be blank')
    self.authentication = PolicyAuthentication(doc['authentication'])
    if ('captcha_solver' in doc):
        self.captcha_solver = CaptchaSolver(doc['captcha_solver'])
    else:
        self.captcha_solver = None
    self.limits = PolicyLimits(doc['limits'])
    self.mime_type_rules = PolicyMimeTypeRules(doc['mime_type_rules'])
    self.proxy_rules = PolicyProxyRules(doc['proxy_rules'])
    self.robots_txt = PolicyRobotsTxt(doc['robots_txt'])
    self.url_normalization = PolicyUrlNormalization(doc['url_normalization'])
    self.url_rules = PolicyUrlRules(doc['url_rules'], seeds)
    self.user_agents = PolicyUserAgents(doc['user_agents'], version)