def fake_team(db, teamowner, teamname=None):
 isapproved = [True, False]
 productorservice = ['Product', 'Service']
 if (teamname is None):
  teamname = (faker.first_name() + fake_text_id(3))
 ctime = (teamowner.ctime + datetime.timedelta(days=7))
 try:
  teamslug = slugize(teamname)
  homepage = ('http://www.example.org/' + fake_text_id(3))
  insert_fake_data(db, 'teams', slug=teamslug, slug_lower=teamslug.lower(), name=teamname, homepage=homepage, ctime=ctime, product_or_service=random.sample(productorservice, 1)[0], onboarding_url=(homepage + '/contributing'), owner=teamowner.username, is_approved=random.sample(isapproved, 1)[0], receiving=0.1, nreceiving_from=3)
 except (IntegrityError, InvalidTeamName):
  return fake_team(db, teamowner)
 return Team.from_slug(teamslug)

def fake_team ( db , teamowner , teamname = None ) : isapproved = [ True , False ] productorservice = [ 'Product' , 'Service' ] if ( teamname is None ) : teamname = ( faker . first_name ( ) + fake_text_id ( 3 ) ) ctime = ( teamowner . ctime + datetime . timedelta ( days = 7 ) ) try : teamslug = slugize ( teamname ) homepage = ( 'http://www.example.org/' + fake_text_id ( 3 ) ) insert_fake_data ( db , 'teams' , slug = teamslug , slug_lower = teamslug . lower ( ) , name = teamname , homepage = homepage , ctime = ctime , product_or_service = random . sample ( productorservice , 1 ) [ 0 ] , onboarding_url = ( homepage + '/contributing' ) , owner = teamowner . username , is_approved = random . sample ( isapproved , 1 ) [ 0 ] , receiving = 0.1 , nreceiving_from = 3 ) except ( IntegrityError , InvalidTeamName ) : return fake_team ( db , teamowner ) return Team . from_slug ( teamslug )
create a fake team .