<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Primitive generators
This notebook contains tests for tohu's primitive generators.
Step1:  Constant
Constant simply returns the same, constant value every time.
Step2:  Boolean
Boolean returns either True or False, optionally with different probabilities.
Step3:  Integer
Integer returns a random integer between low and high (both inclusive).
Step4:  Float
Float returns a random float between low and high (both inclusive).
Step5:  HashDigest
HashDigest returns hex strings representing hash digest values (or alternatively raw bytes).
HashDigest hex strings (uppercase)
Step6:  HashDigest hex strings (lowercase)
Step7:  HashDigest byte strings
Step8:  FakerGenerator
FakerGenerator gives access to any of the methods supported by the faker module. Here are a couple of examples.
Example
Step9:  Example
<ASSISTANT_TASK:>
Python Code:
import tohu
from tohu.v5.primitive_generators import *
from tohu.v5.utils import print_generated_sequence
print(f'Tohu version: {tohu.__version__}')
Explanation: Primitive generators
This notebook contains tests for tohu's primitive generators.
End of explanation
g = Constant('quux')
print_generated_sequence(g, num=10, seed=12345)
Explanation: Constant
Constant simply returns the same, constant value every time.
End of explanation
g1 = Boolean()
g2 = Boolean(p=0.8)
print_generated_sequence(g1, num=20, seed=12345)
print_generated_sequence(g2, num=20, seed=99999)
Explanation: Boolean
Boolean returns either True or False, optionally with different probabilities.
End of explanation
g = Integer(low=100, high=200)
print_generated_sequence(g, num=20, seed=12345)
Explanation: Integer
Integer returns a random integer between low and high (both inclusive).
End of explanation
g = Float(low=2.3, high=4.2)
print_generated_sequence(g, num=10, sep='\n', fmt='.12f', seed=12345)
Explanation: Float
Float returns a random float between low and high (both inclusive).
End of explanation
g = HashDigest(length=6)
print_generated_sequence(g, num=10, seed=12345)
Explanation: HashDigest
HashDigest returns hex strings representing hash digest values (or alternatively raw bytes).
HashDigest hex strings (uppercase)
End of explanation
g = HashDigest(length=6, uppercase=False)
print_generated_sequence(g, num=10, seed=12345)
Explanation: HashDigest hex strings (lowercase)
End of explanation
g = HashDigest(length=10, as_bytes=True)
print_generated_sequence(g, num=5, seed=12345, sep='\n')
Explanation: HashDigest byte strings
End of explanation
g = FakerGenerator(method='name')
print_generated_sequence(g, num=8, seed=12345)
Explanation: FakerGenerator
FakerGenerator gives access to any of the methods supported by the faker module. Here are a couple of examples.
Example: random names
End of explanation
g = FakerGenerator(method='address')
print_generated_sequence(g, num=8, seed=12345, sep='\n---\n')
Explanation: Example: random addresses
End of explanation
<END_TASK>