Function _write_arrays
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
def _write_arrays(array_gen: Iterable[Tuple[Array, Any]], outbytes: IO[bytes]):
def get_dimensions_from_array(value):
if isinstance(value, np.ndarray) or isinstance(value, list):
Function _read_header
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
def _read_header(
inbytes: IO[bytes],
) -> Tuple[str, List[Definition], Optional[Description], Data]:
word_gen = _gen_words(inbytes)
version = next(word_gen)
Function _gen_real_lines
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def _gen_real_lines(inbytes: IO[bytes]) -> Generator[str, None, None]:
"""No comments and stripped lines."""
while True:
line = inbytes.readline().decode(ENCODING)
if not line: