code: def from_randomness(randomness: RandomnessPrimitive) -> ulid.ULID:
      
      if isinstance(randomness, (int, float)):
          randomness = int(randomness).to_bytes(10, byteorder='big')
      elif isinstance(randomness, str):
          randomness = base32.decode_randomness(randomness)
      elif isinstance(randomness, memoryview):
          randomness = randomness.tobytes()
      elif isinstance(randomness, ulid.Randomness):
          randomness = randomness.bytes
      elif isinstance(randomness, ulid.ULID):
          randomness = randomness.randomness().bytes
  
      if not isinstance(randomness, (bytes, bytearray)):
          raise ValueError('Expected int, float, str, memoryview, Randomness, ULID, '
                           'bytes, or bytearray; got {}'.format(type(randomness).__name__))
  
      length = len(randomness)
      if length != 10:
          raise ValueError('Expects randomness to be 80 bits; got {} bytes'.format(length))
  
      timestamp = int(time.time() * 1000).to_bytes(6, byteorder='big')
      return ulid.ULID(timestamp + randomness)
docs: Create a new :class:`~ulid.ulid.ULID` instance using the given randomness value of a supported type.
  
      The following types are supported for randomness values:
  
      * :class:`~int`
      * :class:`~float`
      * :class:`~str`
      * :class:`~memoryview`
      * :class:`~ulid.ulid.Randomness`
      * :class:`~ulid.ulid.ULID`
      * :class:`~bytes`
      * :class:`~bytearray`
  
      :param randomness: Random bytes
      :type randomness: See docstring for types
      :return: ULID using new timestamp and given randomness
      :rtype: :class:`~ulid.ulid.ULID`
      :raises ValueError: when the value is an unsupported type
      :raises ValueError: when the value is a string and cannot be Base32 decoded
      :raises ValueError: when the value is or was converted to something 80 bits