@classmethod<EOL><INDENT>def from_stashy(klass, repository, labor_hours=True):<DEDENT>
<EOL>if not isinstance(repository, dict):<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>project = klass()<EOL>logger.debug(<EOL>'<STR_LIT>',<EOL>repository['<STR_LIT:name>'],<EOL>repository['<STR_LIT>']['<STR_LIT:key>'],<EOL>)<EOL>project['<STR_LIT:name>'] = repository['<STR_LIT:name>']<EOL>clone_urls = [clone['<STR_LIT>'] for clone in repository['<STR_LIT>']['<STR_LIT>']]<EOL>for url in clone_urls:<EOL><INDENT>if url.startswith('<STR_LIT>'):<EOL><INDENT>project['<STR_LIT>'] = url<EOL>break<EOL><DEDENT><DEDENT>description = repository['<STR_LIT>'].get('<STR_LIT:description>', '<STR_LIT>')<EOL>if description:<EOL><INDENT>project['<STR_LIT:description>'] = '<STR_LIT>' % description<EOL><DEDENT>project['<STR_LIT>']['<STR_LIT>'] = None<EOL>web_url = repository['<STR_LIT>']['<STR_LIT>'][<NUM_LIT:0>]['<STR_LIT>']<EOL>public_server = web_url.startswith('<STR_LIT>')<EOL>if repository['<STR_LIT>'] and public_server:<EOL><INDENT>project['<STR_LIT>']['<STR_LIT>'] = '<STR_LIT>'<EOL><DEDENT>if labor_hours:<EOL><INDENT>project['<STR_LIT>'] = labor_hours_from_url(project['<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>project['<STR_LIT>'] = <NUM_LIT:0><EOL><DEDENT>project['<STR_LIT>'] = ['<STR_LIT>']<EOL>project['<STR_LIT>']['<STR_LIT:email>'] = '<STR_LIT>'<EOL>project['<STR_LIT>']['<STR_LIT>'] = repository['<STR_LIT>']['<STR_LIT>'][<NUM_LIT:0>]['<STR_LIT>']<EOL>project['<STR_LIT:status>'] = '<STR_LIT>'<EOL>project['<STR_LIT>'] = repository['<STR_LIT>']<EOL>project['<STR_LIT>'] = repository['<STR_LIT>']['<STR_LIT>'][<NUM_LIT:0>]['<STR_LIT>']<EOL>_prune_dict_null_str(project)<EOL>return project<EOL>
Handles crafting Code.gov Project for Bitbucket Server repositories