'Factory for packages.'

def make_package(self, package_manager=NPM, name=u'foo', description=u'Foo    fooingly.', emails=[u'alice@example.com'], claimed_by=None):

    self.db.run(u'INSERT    INTO    packages    (package_manager,    name,    description,    emails)    VALUES    (%s,    %s,    %s,    %s)    RETURNING    *', (package_manager, name, description, emails))
    package = Package.from_names(NPM, name)
    if claimed_by:
        if (type(claimed_by) is unicode):
            maybe = P(claimed_by)
            claimed_by = (maybe if (maybe is not None) else self.make_owner(claimed_by))
        admin = self.make_admin()
        team = package.get_or_create_linked_team(self.db, claimed_by)
        team.update_review_status(u'approved', admin)
    return package
