Lines Matching refs:cls
108 def from_bytes(cls, data): argument
115 return cls(content_type, version, epoch, sequence_number, length, fragment)
136 def from_bytes(cls, data): argument
165 def from_bytes(cls, data): argument
182 return cls(
208 def from_bytes(cls, data): argument
210 return cls(major, minor)
233 def from_bytes(cls, data): argument
235 random_bytes = bytes(data.read(cls.random_bytes_length))
236 return cls(gmt_unix_time, random_bytes)
259 def from_bytes(cls, ele_cls, subrange, data): argument
260 length = cls._decode_length(subrange, data)
265 return cls(subrange, ele_cls, elements)
268 def _decode_length(cls, subrange, data): argument
269 length_in_byte = cls._calc_length_in_byte(subrange[1])
277 def _encode_length(cls, length, subrange): argument
278 length_in_byte = cls._calc_length_in_byte(subrange[1])
286 def _calc_length_in_byte(cls, ceiling): argument
302 def from_bytes(cls, data): argument
303 return cls(struct.unpack(">B", data.read(1))[0])
318 def from_bytes(cls, data): argument
319 return cls(struct.unpack(">BB", data.read(2)))
339 def from_bytes(cls, data): argument
341 assert method == cls.NULL
342 return cls()
359 def from_bytes(cls, data): argument
362 return cls(extension_type, extension_data)
391 def from_bytes(cls, data): argument
401 return cls(
422 def from_bytes(cls, data): argument
425 return cls(server_version, cookie)
451 def from_bytes(cls, data): argument
460 return cls(
479 def from_bytes(cls, data): argument
480 return cls()
536 def from_bytes(cls, data): argument
539 return cls(AlertLevel(level), AlertDescription(description))
543 return cls(None, None)
558 def from_bytes(cls, data): argument
560 return cls()
577 def from_bytes(cls, data): argument
581 return cls(bytes(data.read(length)))