<s>[INST] import random

# Generate a random number between 0 and 1
random.random()

# Generate a random integer between 1 and 10
random.randint(1, 10)

# Generate a random element from a list
random.choice(['apple', 'banana', 'cherry'])

# Generate a random sample of 3 elements from a list
random.sample(['apple', 'banana', 'cherry', 'date', 'elderberry'], 3)

# Generate a random number with a normal distribution
random.gauss(0, 1)

# Generate a random number with a lognormal distribution
random.lognormvariate(0, 1)

# Generate a random number with a von Mises distribution
random.vonmisesvariate(0, 1)

# Generate a selection from a population with weights
random.choices(['apple', 'banana', 'cherry'], weights=[1, 2, 3], k=3)

# Generate a random shuffle of a list
random.shuffle([1, 2, 3, 4, 5])

# Generate a random byte string
random.getrandbits(32)



Can you explain and provide examples of how to use the random library in Python?[/INST]