def fake_participant(db, is_admin=False, random_identities=True):
 username = (faker.first_name() + fake_text_id(3))
 ctime = faker.date_time_between('-3y', '-4w')
 try:
  insert_fake_data(db, 'participants', username=username, username_lower=username.lower(), ctime=ctime, is_admin=is_admin, balance=0, anonymous_giving=(random.randrange(5) == 0), balanced_customer_href=faker.uri(), is_suspicious=False, claimed_time=(ctime + datetime.timedelta(days=7)), email_address='{}@example.com'.format(username))
  participant = Participant.from_username(username)
  fake_exchange_route(db, participant)
  if random_identities:
   if (random.randrange(100) < 66):
    fake_participant_identity(participant)
    if (random.randrange(100) < 33):
     fake_participant_identity(participant)
     if (random.randrange(100) < 50):
      fake_participant_identity(participant)
 except IntegrityError:
  return fake_participant(db, is_admin)
 return participant

def fake_participant ( db , is_admin = False , random_identities = True ) : username = ( faker . first_name ( ) + fake_text_id ( 3 ) ) ctime = faker . date_time_between ( '-3y' , '-4w' ) try : insert_fake_data ( db , 'participants' , username = username , username_lower = username . lower ( ) , ctime = ctime , is_admin = is_admin , balance = 0 , anonymous_giving = ( random . randrange ( 5 ) == 0 ) , balanced_customer_href = faker . uri ( ) , is_suspicious = False , claimed_time = ( ctime + datetime . timedelta ( days = 7 ) ) , email_address = '{}@example.com' . format ( username ) ) participant = Participant . from_username ( username ) fake_exchange_route ( db , participant ) if random_identities : if ( random . randrange ( 100 ) < 66 ) : fake_participant_identity ( participant ) if ( random . randrange ( 100 ) < 33 ) : fake_participant_identity ( participant ) if ( random . randrange ( 100 ) < 50 ) : fake_participant_identity ( participant ) except IntegrityError : return fake_participant ( db , is_admin ) return participant
create a fake user .