from typing import List, Union

# from .protobuf import Backend as ProtoBackend
# from .flatbuffers import Backend as FlatBackend
# from .capnproto import Backend as CapnBackend


class Happybuf:
    def __init__(self, schema, backend=None):
        self.b = backend(schema)

    def write(self, f, target, data):
        self.b.write(f, target, data)

    def write_multiple(self, f, target, data: List):
        self.b.write_multiple(f, target, data)

    def read_multiple(self, f, target):
        return self.b.read_multiple(f, target)

8d952fcbe47911b4307368ee21ee5f060326e160
<mask token>


class Happybuf:
    <mask token>
    <mask token>

    def write_multiple(self, f, target, data: List):
        self.b.write_multiple(f, target, data)

    def read_multiple(self, f, target):
        return self.b.read_multiple(f, target)

<mask token>


class Happybuf:

    def __init__(self, schema, backend=None):
        self.b = backend(schema)
    <mask token>

    def write_multiple(self, f, target, data: List):
        self.b.write_multiple(f, target, data)

    def read_multiple(self, f, target):
        return self.b.read_multiple(f, target)

<mask token>


class Happybuf:

    def __init__(self, schema, backend=None):
        self.b = backend(schema)

    def write(self, f, target, data):
        self.b.write(f, target, data)

    def write_multiple(self, f, target, data: List):
        self.b.write_multiple(f, target, data)

    def read_multiple(self, f, target):
        return self.b.read_multiple(f, target)

from typing import List, Union


class Happybuf:

    def __init__(self, schema, backend=None):
        self.b = backend(schema)

    def write(self, f, target, data):
        self.b.write(f, target, data)

    def write_multiple(self, f, target, data: List):
        self.b.write_multiple(f, target, data)

    def read_multiple(self, f, target):
        return self.b.read_multiple(f, target)

from typing import List, Union

# from .protobuf import Backend as ProtoBackend
# from .flatbuffers import Backend as FlatBackend
# from .capnproto import Backend as CapnBackend


class Happybuf:
    def __init__(self, schema, backend=None):
        self.b = backend(schema)

    def write(self, f, target, data):
        self.b.write(f, target, data)

    def write_multiple(self, f, target, data: List):
        self.b.write_multiple(f, target, data)

    def read_multiple(self, f, target):
        return self.b.read_multiple(f, target)
