<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_bucket(cls, connection, bucket):
 """Create from bucket object."""

        if bucket is None:
            raise errors.NoContainerException

        # It appears that Amazon does not have a single-shot REST query to
        # determine the number of keys / overall byte size of a bucket.
        return cls(connection, bucket.name)