def test_view_setattr_machinery(attr, subset_func, subset_func2):
    # Tests that setting attributes on a view doesn't mess anything up too bad
    adata = gen_adata((10, 10))
    view = adata[subset_func(adata.obs_names), subset_func2(adata.var_names)]

    actual = view.copy()
    setattr(view, attr, getattr(actual, attr))
    assert_equal(actual, view, exact=True)
def _getQUICHeader(self, count):
        if type(count) is not hex:
            try:
                count_id = chr(count)
            except:
                sys.stderr.write("Count must be int or hex.\n")
                return 1
        else:
            count_id = count

        if count > self.max_packets:
            sys.stderr.write("[-]\tCount must be maximum of 255.\n")
            return 1

        header = "\x0c"                     # Public Flags
        header += self.sequence             # Adding CID
        header += count_id                  # Packet Count
        return header