Squashed 'third_party/flatbuffers/' changes from 338393f85..e5f331db9

e5f331db9 [TS] Add single-file ts codegen & bazel rule for typescript (#7161)
2f84c6038 Apply Namer to Go code gen (#7150)
d64839651 [Lobster] file_identifier support
777e78d8d [Lobster] support unsigned integer reads
4016c549d Apply Namer to Python code gen (#7146)
40827b21b Fix missing 'break' (#7151)
65a10b6e3 Implement a config based name manager and use it in Rust codegen (#7144)
8db2fef3f [TS] Escape keywords in typescript object names (#7137)
9ed132304 Fix 64-bit numeric enum values in typescript (#7135)
1a4c40566 updated npm to 2.0.6
318594e4b prevent name clash (#7133)
3d903302c [Rust] Add length checks to arrays and vectors. (#7130)
c9571d989 Replaced ToDasherCase with ConvertCase (#7131)
3694b830a Use ConvertCase instead of Make{Upper,Lower,Snake} implementations (#7127)
0471fa807 remove stall reference to version
914344ea9 some minor help edits
b40266c56 Use target_compile_features to target C++11 (#7122)
8a9303d46 update proto tests with alaised enum (#7121)
30c4bf47f Trigger fuzzing CI only on relevant changes (#7120)
46ce45601 remove auto generate code from cmakelists (#7119)
433312c55 add the missing checkNullConditionnal code in the "GenObjApi" function when the field is scalar optional (#7114)
9c52ec374 Add deps attribute to flatbuffer_cc_library (#7107)
70e2f49bf fixed string-json -> strict-json typo
5ac0367ed [TS] Fix generation of reserved words in object api (#7106) (#7115)
5d101afb5 Fix minor typo in WhitePaper.md (#7108)
06f4af11b Go optional scalars (#7104)
57e338f81 explicitly use windows-2019 to unblock ci (#7105)
615616cb5 Change Rust generated file defaults (#7101)
3413c3300 Fixed FlexBuffers verifier fuzzer timing out
69f5660a4 Fixed Parser not checking size of union types vector
d5add9fca Fixed FlexBuffers ToString unquoted non-ident keys
15df50eb7 Remove @ExperimentalUnsignedTypes annotation from kotlin code generator. (#7092)
a94132a45 Swift FlatBufferBuilder.sizedByteArray to ByteBuffer.toArray() (#7093)
48befb6be [TS] Refactor away circular ref (#7099)
b30069133 Add reflection support for python (#7026)
faadbc10e Add CreateVector overload to accept array like (#7095)
ed6ae8d32 explicitly defined std::allocator (#7094)
e910bddbc [JS] Add ".js" suffix to all import statements to generate a browser compatible mjs version. (#7086)
c85fb690f Add Parsing Completed function for Rust (#7084)
c1daa6ba0 rust: Bump thiserror version and remove git dependency (#7080)
4c71c7b02 replace framework include of flatbuffers (#7079)
f5664d33f fix go_test implement error (#7012)
39c8a19ce fixed comparator for native_inline (#7076)
826193ff6 skip generating reflection.fbs in generate_scripts (#7077)
fd0d1ed92 update C++ generator to emit scoped enums in vector of unions (#7075)
424988f30 replaced removed xml tag
b2550dbaa removed BSD-3-Clause license and Zlib licenses (#7073)
a2b238960 Fixed default value of bool in struct for Swift (#7072)
619b78437 one last dart omit local (#7070)
68a766154 more omit type annotations for dart local variables (#7069)
7dac9961f omit type annotations for dart local variables (#7067)
c65c389c6 add xmlns to .Net (#7066)
6446dcf3d Updates swift gen licence for grpc code (#7063)
e090d8da1 Fixed long cast to int in flexbufferbuilder.java (#7059)
bc901436d clang format on codebase (#7058)
240be9b5a attempt to remove appveyor (#7056)
bc366a7f9 Provide a short help text and default in error case (#6992)
14b19d446 Use FindPython3 (#7055)
9e6f17b94 remove BIICODE
c3801ad37 Update readme.md
4f3b24db0 Fixes a bug where bools arent being nil when marked optional (#7051)
1d294a31b Implement Serialize on generated rust types (#7022)
dd8fccfb1 Cmake 3.16 de-facto minimum version (#7049)
7089c9ecd Convert flatbuffers_version_string to inline function (#7046)
43203984f [C++] Support C++ object copies and moves (#5988)
5993338ee [ts] Builder incorrectly serializing empty strings (#7047)
19920db39 Include a SizePrefixed..HasIdentifier for c++. (#6871)
dbbaeac85 Use `${PYTHON_EXECUTABLE}` instead of `py` in cmake (#7042)
028f0fde6 'flattest': Add --test_path option (#7041)
87343631b Added support for clang-cl on windows (CMake) (#7038)
1fbfaf5c5 Fix/cmake build grpc (#7028)
4421375bb Add FlatBuffers::FlatBuffers interface, needed for FetchContent_Declare (#7023)
162ad7a37 Fix comment with line orders - Rust should be last. (#7037)
a0a6c3f8c Use actions/checkout@v2, which fixes security vulnerability. (#7036)
a2d38fbb9 Add --warnings-as-errors to flatc compiler. (#7034)
9ef1524d3 Emit include for bfbs-gen-embed (#7031)
0c9de0352 Upgraded GRPC version to 1.42.0 (#7033)
a783bc926 chore: dart 2.0.5 release changes (#6983)
aff818ceb rust: Allow for usage in no_std environment (#6989)
d7b75417f Make flatbuffer builder deterministic (#6993)
a42e89897 Added verifier alignment checking to table fields (#7018)
96cc2f3ee BuildFlatBuffers.cmake: fix arguments not passed properly to flatc (#7013)
3250a1f8d Add initial C# vector of unions support to the documentation. (#6880)
ace4a37f2 [TS/JS] BigInt implementation (#6998)
f28c2b293 Avoid implicit conversion from float to double. (#7003)
96f3cf690 Rearrange #include directives to pass to compilation with a particular DSP toolchain (#7000)
b3edfdbfb Reverting grpc generated file suffix (#6995)
b8aaccee8 Disable parsing of nested_flatbuffers as bytes by default
2dc8ae774 Enable OSS-Fuzz on CI
5b0d49112 Updated FlexBuffers fuzzer
d8b7041d7 Added alignment checking to FlexBuffers verifier
5a0c3366c FlexBuffers verifier additionally checks for nesting
f8148b8da Made FlexBuffers reuse tracker track types
a22b1b626 Prevent shadow with _{{FIELD_NAME}} (#6991)
4264daadd FlexBuffers fuzzer fixes
3cbc120a0 Refractor Flatc Options (#6987)
8dcd2682c [CMake] Add option for disable universal on OSX (#6990)
b78002ff3 Validate C# json/object-api options (#6985)
c555ee8fa Add .NET test to github workflows (#6982)
b92bb0584 [CMake]: Fix version in pkgconfig file (#6986)
956d11569 re-enabled FlexBuffer JSON in fuzzer
e367ca32a Verifier for FlexBuffers (#6977)
705f27f6e [CMake]: Fix python command for mingw environment (#6984)
5fc87f4c4 Enable --gen-onefile in Python (#6953)
11749095a Make idl_parser deterministic (#6976)
d0cede9c9 Bumping to Version 2.0.5 (#6967)
fcc2bee0b Fix typo in variable name (#6973)
e08da4dea remove Appveyor's Vs2010 and 13 builds (#6969)
18538c401 [TS] Fix reserved words as arguments (#6955) (#6956)
e57f4ab2d Update stale bot version and provide away to exempt issues with the not-stale label (#6968)
deed68db5 missing generated files (#6966)
061d61f3f Lua Generator using IR. (#6940)
cffe0c454 FixedTypedVector: add const to ElementType() and size() (#6965)
fadd40e40 Have grpc include file with correct filename-suffix given to flatc (#6954)
e47dc0e46 Removed test/generate_code.{sh|bat} (#6873)
5c5475479 switched to windows-lastest, removed deadcode (#6948)
4f7f6dc30 Restore FlatBufferBuilder::kFileIdentifierLength. (#6960)
0fadaf391 Enable verifier on nested_flatbuffers
4d0e9a870 Turn off nested FlatBuffers/FlexBuffers for the fuzzer
c05f6783a invalid conditional running genrate_code.py (#6952)
a14f4052c rust: remove needless borrow (#6922)
9e4ca857b Vector Downward GetSize optimization (#6925)
a2b99084b Fix flexbuffers clang-analyzer warning (#6947)
85b4effac test: fix undefined order of functio parameters. (#6946)
790f41154 [cmake] Fix getting version info from tags during the build (#6936)
e89de4411 clang-all (#6941)
256ab3798 WIP: Dart release 2.0 (#6927)
a59288a01 Add benchmarks to Linux CI (#6928)
587bbd49a [C++] Fix compile failure on Object API union construction for struct member (#6923)
a9c341545 Fix integer overflow warnings
8aa18b629 fixed cmp0048 error (#6932)
d727579b6 fuzzers: fix typo in file path (#6931)
97a30171c Added Raw C++ benchmarks (#6924)
0989fc5e5 Added Google benchmarks (and gtests) (#6920)
927175ea2 [Java] lookup by byteArray is giving back wrong entry (#6915)
6748c373b Removal of support for FLATBUFFERS_CPP98_STL (#6918)
3fab0c6ee move [[ ]] to calling sites (#6914)
6c8c29155 [C++] Split flatbuffers.h into separate files (#6868)
fd4ff23da Keep methods with struct name and switch them to default (#6879)
f8b69e330 [Python] Verify EnumDef is not generated in GenUnionCreator (#6903)
c0394bb09 Support `--conform` for vector of unions (#6883)
8433eb108 Typo fixes in comments of flatbuffers.h and flexbuffers.h (#6901)
f2f9380c8 [Java] Prevent generation of enum names when underlying type is long (#6781) (#6895)
e672dabfe [C++] Fix memory leak when using grpc (#6896) (#6897)
9a4ca2764 Output errors / warnings on stderr instead of stdout (#6881)
4c7a9c10d Adds JSON encoding to swift (#6874)
38295a187 [Kotlin] Fix missing escape for struct construction statements (#6877)
31bb0b972 add working directory (#6878)
45e5642e9 Default Arguments for Mutators C++ [Updated] (#6872)
a592f4c89 [Cmake] Add a post build command after flatc to run the new generate_code.py script. (#6866)
b9d43a557 dart - add Packable interface (#6846)
2ece9e25b Bumped package.json to 2.0.4
2dd212637 Fix linker errors on (Free|Open)BSD. (#6860)
f63c130c2 Improves documentation, and adding DocC (#6784)
e2b26ee19 Make and generate_code.sh generate same outputs (#6855)
9d686bf43 Include subdirectories in published npm package (#6850)
1d26daff3 Use ArrayBuffer type for JS flexbuffer's toObject (#6851)
e72e18d9f feat(build): compile "universal" libraries and executables for Mac (#6852)
354d97f6d fixed errant itemgroup element in C# test project (#6854)
6f7a57eaa [C#] Using 'global::' as qualifying_start_ within BaseGenerator (#6767)
90baa1444 Dart: binary lists (typed_data) (#6839)
0a3b017f0 Delete IDLOptions::lang (#6841)
47d35f105 BugFix: Optional enum when it is null (#6835)
8fb8c2ce1 [C#] Use @ for keyword escaping (#6834)
1d063d87c [C++] Let builder accept custom-alloc std::vector (#6814)
338331b55 Changes to support binary schema file loading and parsing (flatc) (#6823)
156a30c75 Move Apple-specific build flags to Clang section (#6802)
550d2f904 Issue error if jsonschema has no root type defined #6821 (#6831)
c3a38242e Fix typos in docs (#6829)
74c3d7eba [C++] Add mutable version of LookupByKey and test (#6826)
db6eae5c4 Add html and latex to gitignore (#6819)
0e9d79c35 [Java] Avoid casting ByteBuffer to Buffer (#6785)
b20c4d3aa [C++] Add GetMutableSizePrefixedRoot and generate GetMutableSizePrefixedXxx functions (#6815)
ae145293c flattests_cpp17 doesn't compile with Visual Studio 2017: warning C4100: 'indent': unreferenced formal parameter (#6811)
e3c76a5cd Dart lints (#6808)
4b9123baf fix parser string=null (#6810)
f89e0b1a6 Refactor idl_gen_rust and Rust generated code to use consistent whitespace (#6809)
273f6084e Fix Rust keyword inconsistency (#6794)
4a0879458 [C#] Remove superfluous semicolon in C# structs (#6791)
d6f51ea16 fix ptr in flatbuffers cpp tutorial (#6787)
067dce6e7 [C#] Handle keywords (#6775)
2ca5f0e72 [C#] Respect command line parameter for file name extension and suffix (#6779)
f20d2253a update Java version to 2.0.3
390d438e2 [Kotlin] Fix CI by changing compiler to Java 11 (#6783)
6fb2c90d9 avoiding even more NoSuchMethod exceptions (#6729)
a7b527d94 java: Use maven profile to target Java 8 bytecode (#6764)
5d77820b3 [C++] Using calculated fields_number for field_names size (#6769)
909ce970a [C++] Use UnPackTo instead of UnPack if pointer exists (#6725)
35e2cac6e Store vtables sorted in Rust builder (#6765)
c39fc9dd9 [C++] Use nullptr instead of 0 in generated headers (#6762)
775c6567d [C++] Fix compiler warning -Wredundant-parens in clang (#6761)
97d9527f6 Dart 2.0 release prep (#6759)
e01205466 [C++] Use proper gRPC C++ API when using MemoryBuffer Slice (#6756)
5235133f3 Dart - make ascii optimization optional in StringReader, same as in writeString() (#6758)
c871df770 Dart - change table building to assert() instead of exceptions (#6754)
a6eeeb3b9 Dart - inline small functions to increase performance (#6755)
3dd02144d [C#] Fix field name struct name collision (#6744) (#6757)
e77926f0e [C#] Add Union Constructor Utility for ObjectAPI. (#6105)
ac2348202 Dart - fixup writeString() return type after previous merges (#6753)
8be8a0a71 [C++] Fix union type handling on object api in C++17 (#6745)
12e341e4f Rework how Rust generated files are laid out (#6731)
c36672d80 Dart - optimize writeString for ASCII (#6736)
2bfc8e9f0 Dart - make writeString() argument non-nullable (#6737)
674a9f2aa fix lints in rust tests (#6743)
016e6aa13 Add a split on ':' to build_defs.bzl (#6742)
65700441d Dart - make vTable fixed size (expect the number of fields when creating) (#6735)
dd5bb55ca Dart - make vTable deduplication optional (#6734)
e8423da1b Dart - regenerate example after recent flatc changes (#6733)
0980e39c9 flexbuffers: Add variant of Blob() that takes a key (#6730)
e73fab27d Dart - store empty vectors instead of NULL (#6728)
92ae532e4 Dart - finish/lowFinish/buffer changes (#6712)
7482b25f8 Remove ubuntu1604 from presubmit.yml (#6715)
3f77dc9a0 Dart - unpack() must use eager list reader (#6723)
838c93b84 Dart - fix flex-builder compilation error (#6722)
089f48a4a Dart - make sure added padding is zeroed, same as in C++ (#6716)
bf3470c16 Fix UB in CreateVectorOfStructs in case of an empty vector: avoid calling memcpy in this case (#6726)
8f8196e13 Fix 6348 (#6717)
8ab35b2a5 Dart - add custom allocator support (#6711)
c0ba2870c Fix typo in docu (#6714)
22498cf3a [C++] add make_span for Array<T,N> (#6663)
bd37e67ac [C++] Fix a -Wdeprecated-copy warning. (#6708)
a6ee33557 Dart null safety (#6696)
71d43f3be Make --bfbs-filenames default to location of first schema file. (#6705)
c8db1ca5d Jsonschema add prop comments (#6617)
962751a6e Improve generated comparisons for tables (#6486)
06fd6d640 Replace filenames in reflection with filenames+includes. (#6703)
acce4ac3f Fix incorrect assertion usage. (#6702)
8fd7861b7 Fix warning about deprecated module: imp (#6362)
c58ae9422 Add the file a symbol is declared in to Reflection (#6613)
2cf7bb796 Intermediate Representation docs (#6685)
4e3a66c14 Dart object API (#6682)
d959e2320 dart - change Builder.reset() to reuse an existing buffer (#6661)
a9fb54088 use improved versioning (#6691)
337eb8b8f update docs - structs can't be roots (#6690)
6415ef05d [Python] [Codegen] Fixes nested structs with underscore names (#6686)
f069396d1 [C++] flatc --cpp-field-case-style option to permit camel-case field names in C++ (#6669)
021177af0 Fix snap version formatting (#6683)
e1e9f9373 [C++/grpc] added hiding of unused variables in the generated code (#6677)
15110094e Fix GitHub Actions CI gcc/clang versions
093badb0a Use unoptimized path for ReadUInt64 for win32 build as the optimized path crashes. (#6681)
752c7b576 avoiding more NoSuchMethod exceptions (#6671)
7c3e267e1 [Java] ObjectAPI implementation (#6521) (#6582)
baaffbaed npm update to 2.0.3 and script fix
4cb3f222b [TS] Fix module reference in package.json (#6676)
eabdbda75 [TS] Generate entry point module (#6674)
bec23700f Prepare for Java 2.0.1 release
12f2eedad Update CI to GCC/Clang 11
221eeb231 Fix typo in C++ doc (#6664)
813d3632e avoiding NoSuchMethod exception (#6658)
d84bccb0c Removed most heap allocations in builder (#6662)
b4e67f9bf Dart test fix (#6660)
54c11932f [Java] Flexbuffers - Negative signed object length (#6651)
fbcb3c423 [TS/JS] Updates the grpc (#6654)
8937dcfd7 Updates go lang support to allow other languages to communicate with it (#6653)
512d5a689 Update readme.md to point to security policy
a92cb5dd7 Create Security.md
d151dcbb9 Revert "[C++] Removed most heap allocations in builder (#6620)" (#6659)
f1884c66f Fix gRPC test to use EndVector without specifying the length. (#6646)
72730ecd8 [C++] Removed most heap allocations in builder (#6620)
fe2bc2b0a Added README for Rust Flatbuffers (before publishing v=2.0) (#6652)
4867c9456 Fixed generation of c++ code with flags (#6637)
ef0eb3701 Ran clang-format-all.sh. Removed default --style=file parameter (#6639)
f83ee1af5 [idl_parser] Check structs and enums do not clash in a namespace (#6562)
a5175c513 Implements verifier and code gen for swift (#6373)
04b10f5a3 Deprecate EnumVal.object (#6612)
c121c0345 Fixed Java gRPC version number dependency
8fd10606c Implement Serialize for flexbuffer::Reader (#6635)
a1730fcea [Swift] Updated cocoapods to 2.0.0 (#6634)
a9a295fec More missing version changes
5c01ad387 Dart generated code update
42ca1b914 Swift/Kotlin generated code version updates
6ed780dbd C++/Rust version changes
3412fab8e C#/Java generated code version updates
8a7d013f8 Updated main version numbers to 2.0
170af5978 [Go] Add missing namespace when using Object API (#6633)
c8c16de16 Fix reverse iterators for Vector and Array (#6626)
4525cd9c5 [Lua] manipulate byte array as string (#6624)
47361baf6 [C++] Fix union copy constructor to work with nested structs (#6552) (#6607)
8a582883a Updates swift generated monster sample file (#6616)
a4bb8f0c2 [Lua] Avoid infinite loop when creating empty string (#6614)
82aed82b8 Added support for Lua 5.1, 5.2 and 5.4 (#6606)
60ff76630 [TS] Remove wrong and obsolete NS prefix use (#6604)
a27c7d809 Fixed LuaJIT when not compiled with COMPAT mode (#6605)
363220823 removed unneeded type prefixing (#6601)
6b44c605b Bump Rust to 0.9.0 (#6610)
d3cd78a87 [Lua] Add LuaJIT support (#6584)
8fa3dfdb5 Introduce new_from_vec in Rust (also fix formatting) (#6599)
29379e8e4 fix typo in CppUsage.md (#6595)
14725d6c3 [Lua] GetRootAs can accept strings. Made Luatest Benchmarks optional (#6593)
16836ff95 Add advance feature indicators to reflection (#6546)
c87179e73 Rust Remove SafeSliceAccess for Arrays, and fix miri. (#6592)
c24031c36 Mark endian_scalar as unsafe. (#6588)
4ccc52c7a [swift] Implements union strings (#6589)
b82fe0738 [Rust] Fix small mistyping (#6585)
1e7f6c8c7 [TS] Commit the generated tests code (#6579)
84714b109 chore: ensure bash is used to generate code (#6577)
1045d7dd4 [Lua] Fix EnforceNumberAndPack for bool type (#6576)
0c7777596 [TS] Remove duplicated build-ts ci (#6575)
c43ba1752 [Rust] Specify Minimum Supported Rust Version (#6573)
da3bb64ef [Rust] Add support for fixed size arrays (#6548)
151900ba9 [Kotlin][FlexBuffers] Add support for Kotlin-iOS (#6564)
c012f29f9 silenced clippy warning (#6565)
df2df21ec [Kotlin] Bump kotlinx.benchmark dependency to 0.3.0 (#6560)
408e4db4a [TS] Add Build TS to CI jobs (#6524)
4d2364f34 [Kotlin][FlexBuffers] Add support for Kotlin-JS (#6554)
261cf3b20 Default-empty vectors of enums (#6505)
cd67261bb [CI] fixes buildkite (#6544)
1aa0c2f6a Limit formatter to pull requests only (#6540)
4133a39df Rust structz (#6539)
1c26d2a1a [Kotlin][FlexBuffers] JSON support for Flexbuffers (#6417)
276b1bc34 [grpc] Support latest version of grpc PoC (#6338)
124654ffc fixed packing structs (#6530)
3b7d1e86b [GO] Tries to add go format to the CI (#6518)
78f0c0d1d [C++] #6501 - Problem when mapping a native type multiple times (#6514)
c992eafb5 [fuzzer] Add `monster_debug` target (#6513)
ef8dd7792 [Swift] Removes allman rule (#6519)
69b329fc8 [flexbuffers, json] Parse `nan` and `inf` (#6512)
6543ba529 fixed packing structs in nested buffers (#6509)
0e453ac35 [idl_parser] Add kTokenNumericConstant token (#6432)
e9b4ae69d Remove `flatbuffers.pc` from the repository (#6508)
fc4fffea4 Bump grpc to 1.0.0 (#6507)
b240ab704 Move Traits struct and Create method out of --cpp-static-reflection. (#6503)
9a4f1f434 Disable x64-specific optimizations for ARM64EC ReadInt64 (#6506)
fac64918d Add --cpp-static-reflection to generate_code.bat. (#6502)
a69815f72 [C++17] Add compile-time reflection for fields. (#6324)
4033ff589 fixed invalid TS call and added test files (#6495)
a08357251 disable clippy (#6494)
5319dedb1 [idl_parser, JSON] Disable parsing of JSON for incomplete schemes (#6493)
bd4e0b30a [idl_parser] Track included files by hash (#6434)
bf9061200 fix for noUncheckedIndexedAccess in ts (#6474)
8142fedd1 Working on a python example plus fixing python grpc code (#6456)
c0be1cb7a [rust] Remove debug code (#6475)
8cccdfba5 Revert "[C#] Fix truncated ArraySegment<byte> if elementSize != 1 (#6462)" (#6488)
cbbbaa61b [C#] Fix truncated ArraySegment<byte> if elementSize != 1 (#6462)
ffc2ef77c [CI] Adds Code Generation tests on Github Actions (#6482)
1da6f4f18 [CMake] generate pkg-config flatbuffers.pc file (#6455)
b5da526e6 [Swift] Moves grpc example to grpc/examples (#6479)
3b5365762 [TS] Moves grpc code to examples folder (#6476)
e2f5438ac Fixes grammer (#6477)
5e3613f73 Fix sample_binary.py to use latest EndVector without a size. (#6478)
e6b911d40 updated JS docs to reflect current status (#6436)
0c7ae5816 [Go] Working on a go example plus fixing go grpc code (#6448)
ae603b977 [Swift] adds support for default vectors and strings (#6461)
7f47718b6 Update Building.md (#6473)
54dc09e8a GetUOffsetT must get value by GetUint32 not GetInt32 (#6072)
334c6be49 Fix a typo in Swift codegen (#6470)
4174c10e7 [rust] Genericize flexbuffer reader (#6450)
a20f606c2 [Swift] Renaming protocols (#6469)
a72a20827 Update swift docs (#6460)
86401e078 Default strings and vectors: Parser + Rust support (#6421)
6af37e672 [CMake] Renames BUILD files (#6457)
1b88655b0 [Build, cmake] Add -Werror override option (#6429)
0b15916e5 [C++]Fix extra char generation for byte type during json schema generation (#6276)
60eed0ca6 Updating working code (#6441)
0f83367f5 JSON schema - tailing double quotes for maximum (#6452)
fee095410 [idl_parser] Validate `force_align` on all possible paths (#6430)
6f3e45eca Implement Rust object API defaults (#6444)
815d3e820 Upgrade swift grpc to alpha 24 (#6439)
76e7a0ff5 [fuzzer] Limit parser_fuzzer execution time (#6431)
6d91096a2 This commit contains the initial implementation of Flexbuffers in Kotlin. The code was ported based (#6387)
13d9e3585 Better python generated code naming (#6336)
6effe431b Rust: remove inner attributes (#6410)
efcbdc769 [Rust] Ensure unions are referenced with the correct path (#6422)
e581013e3 Refactor FieldDef to model presense as an enum rather than 2 bools. (#6420)
0984d4328 [c++] Apply NativeName before WrapInNameSpace in idl_gen_cpp.cpp (#6419)
786f69b24 Formats cpp code (#6349)
1da0a2dfa Rust Object API (#6070)
796ed68fa Clarify that (Flat|Flex)Buffers do not deduplicate vector elements (#6415)
7b1ee31d8 Clarify that FlatBuffers unions do not support scalars (#6416)
4aff1198d Explain how FlatBuffers encodes unions (#6414)
ad3a729f9 dart Builder - expose finished buffer size (#6403)
52e217706 Remove invalid claim that Protocol Buffers does not support unions (#6413)
760c65755 [TS/JS] New gen TS code gen (#6302)
75c859e98 [idl_parser] Improve symbols lookup thru parent namespaces (#6407)
91b0958c4 Search for includes in the directory containg the current file (#6371)
8008dde11 Upgrade Rust dependencies (#6406)
c81cf8249 [TS/JS] New gen TS code gen prequel to preserve history (#6404)
8573108bb Unset FieldDef.optional if its key (#6402)
7abe612b5 [fuzzer] Fix the binary schema loading in the monster_fuzzer (#6396)
408cf5802 Fix Rust UB problems (#6393)
39e115fdb Define Vector::value_type for STL compatibility (#6394)
85719669c [fuzzer] Debug the monster_tets.bfbs on clusterfuzz server (#6392)
809fe49c7 Fix up scripts, fix generated enum value for strong mode, regenerate files (#6389)
41253e574 [go] tests/GoTest.sh: Fix flags.Parse location to work on new go SDKs. (#6388)
08d2ce844 fix Dart Builder._writeString() - always write trailing zero byte (#6390)
a15a8d930 fix Dart Builder.reset() - clear vTables (#6386)
83ce29cc2 [C++, JSON] Fix nullptr access when reading a key with a default value. (#6375)
4363c1d2c Fix generated EndVector. (#6385)
1bf1ec027 Implements type promotion for Java enum  (#6382)
080097653 Delete label_notify.yml
795408115 Disabled PHP CI (#6381)
46545e627 fixed warnings (#6355)
0168178a1 Fix multiple fbs code generation failure (#6365)
82836a62b [idl_parser] Improve stack overflow protection (#6364)
e7430bbeb [idl_parser] Check the range of explicitly set field's id value (#6363)
24dd85fd2 Generate code to encode and decode nested flatbuffers in Python. (#6354)
57f68e289 [Rust] Shared String (#6367)
44cf2bde1 Updates license  date to 2021 (#6378)
be37d4da1 include_prefix support for rust (#6330)
4e79d129c [Swift] Rebuild the way swift handles structs from scratch (#6326)
05192553f Fix typos in usage/comments; Make rust generator respect to --filenam… (#6342)
f2511d7d4 Renaming infinity variables in test.cpp (#6340)
f8b203c9c Add vectorNumElements attribute to Builder for simpler vector creation. (#6328)
8ab7c7e2c [CI] Adds formatter to CI (#6272)
7e0039028 Fix Max CI build path (#6333)
65c415911 Generate nullable properties in C# object-based API for optional scalars. (without -gen-mutable) (#6273)
a9e91116d [Python] Commit some orphan python genfile diffs. (#6325)
80a745d9b Fixed missing ending quotes in labeller (#6327)
9fca5e4f4 Add flatc option to inhibit all warnings #6005 (#6301)
92a806b4e [fuzzer] Rename fuzzing dictionaries for `oss-fuzz` (#6318)
9c9baf6d5 bumprust (#6322)
aafc5dc95 Set default initialSize for Builder to 0 (#6310)
442949bc1 Rust Flatbuffers Verifier (#6269)
9064072e8 Version message should be a "STATUS" to avoid going to stderr. (#6316)
fd4c1b5ff Replace std::string and const char* CreateSharedString with string_view (#6315)
bc7eb8ade [fuzzer] Fix mistakes in the `parser` and `scalar` fuzzers. (#6314)
fc960f367 Add default to offset param of Python generated GetRootAs (#6312)
f437f0f7e [fuzzer] Fix loading of schema in monster_fuzzer (#6308)
7f33cf682 [C++] Switch `flatc` to `--cpp-std c++11` C++ code generator (#6306)
8d9eae9ac [idl_parser] Unify parsing of NaN values read from .fbs and .json files (#6296)
2046bffa4 Moved various language tests from AppVeyor to GitHub Actions (#6300)

git-subtree-dir: third_party/flatbuffers
git-subtree-split: e5f331db998a808f78cf5a4880e6f5d0a321c4d0
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
Change-Id: I37f8aaf007fc86226cfa250169a87807afa64a78
diff --git a/tests/py_test.py b/tests/py_test.py
index 9b31f60..ed966d5 100644
--- a/tests/py_test.py
+++ b/tests/py_test.py
@@ -42,1452 +42,1839 @@
 import MyGame.Example.Stat  # refers to generated code
 import MyGame.Example.Vec3  # refers to generated code
 import MyGame.MonsterExtra  # refers to generated code
-import MyGame.InParentNamespace # refers to generated code
+import MyGame.InParentNamespace  # refers to generated code
 import MyGame.Example.ArrayTable  # refers to generated code
 import MyGame.Example.ArrayStruct  # refers to generated code
 import MyGame.Example.NestedStruct  # refers to generated code
 import MyGame.Example.TestEnum  # refers to generated code
+import monster_test_generated  # the one-file version
+
+
+def create_namespace_shortcut(is_onefile):
+  # Create shortcut from either the one-file format or the multi-file format
+  global _ANY
+  global _COLOR
+  global _MONSTER
+  global _TEST
+  global _STAT
+  global _VEC3
+  global _IN_PARENT_NAMESPACE
+  if is_onefile:
+    print('Testing with the one-file generated code')
+    _ANY = monster_test_generated
+    _COLOR = monster_test_generated
+    _MONSTER = monster_test_generated
+    _TEST = monster_test_generated
+    _STAT = monster_test_generated
+    _VEC3 = monster_test_generated
+    _IN_PARENT_NAMESPACE = monster_test_generated
+  else:
+    print('Testing with multi-file generated code')
+    _ANY = MyGame.Example.Any
+    _COLOR = MyGame.Example.Color
+    _MONSTER = MyGame.Example.Monster
+    _TEST = MyGame.Example.Test
+    _STAT = MyGame.Example.Stat
+    _VEC3 = MyGame.Example.Vec3
+    _IN_PARENT_NAMESPACE = MyGame.InParentNamespace
+
 
 def assertRaises(test_case, fn, exception_class):
-    ''' Backwards-compatible assertion for exceptions raised. '''
+  """ Backwards-compatible assertion for exceptions raised. """
 
-    exc = None
-    try:
-        fn()
-    except Exception as e:
-        exc = e
-    test_case.assertTrue(exc is not None)
-    test_case.assertTrue(isinstance(exc, exception_class))
+  exc = None
+  try:
+    fn()
+  except Exception as e:
+    exc = e
+  test_case.assertTrue(exc is not None)
+  test_case.assertTrue(isinstance(exc, exception_class))
 
 
 class TestWireFormat(unittest.TestCase):
-    def test_wire_format(self):
-        # Verify that using the generated Python code builds a buffer without
-        # returning errors, and is interpreted correctly, for size prefixed
-        # representation and regular:
-        for sizePrefix in [True, False]:
-            for file_identifier in [None, b"MONS"]:
-                gen_buf, gen_off = make_monster_from_generated_code(sizePrefix=sizePrefix, file_identifier=file_identifier)
-                CheckReadBuffer(gen_buf, gen_off, sizePrefix=sizePrefix, file_identifier=file_identifier)
 
-        # Verify that the canonical flatbuffer file is readable by the
-        # generated Python code. Note that context managers are not part of
-        # Python 2.5, so we use the simpler open/close methods here:
-        f = open('monsterdata_test.mon', 'rb')
-        canonicalWireData = f.read()
-        f.close()
-        CheckReadBuffer(bytearray(canonicalWireData), 0, file_identifier=b'MONS')
+  def test_wire_format(self):
+    # Verify that using the generated Python code builds a buffer without
+    # returning errors, and is interpreted correctly, for size prefixed
+    # representation and regular:
+    for sizePrefix in [True, False]:
+      for file_identifier in [None, b'MONS']:
+        gen_buf, gen_off = make_monster_from_generated_code(
+            sizePrefix=sizePrefix, file_identifier=file_identifier)
+        CheckReadBuffer(
+            gen_buf,
+            gen_off,
+            sizePrefix=sizePrefix,
+            file_identifier=file_identifier)
 
-        # Write the generated buffer out to a file:
-        f = open('monsterdata_python_wire.mon', 'wb')
-        f.write(gen_buf[gen_off:])
-        f.close()
+    # Verify that the canonical flatbuffer file is readable by the
+    # generated Python code. Note that context managers are not part of
+    # Python 2.5, so we use the simpler open/close methods here:
+    f = open('monsterdata_test.mon', 'rb')
+    canonicalWireData = f.read()
+    f.close()
+    CheckReadBuffer(bytearray(canonicalWireData), 0, file_identifier=b'MONS')
+
+    # Write the generated buffer out to a file:
+    f = open('monsterdata_python_wire.mon', 'wb')
+    f.write(gen_buf[gen_off:])
+    f.close()
 
 
 class TestObjectBasedAPI(unittest.TestCase):
-    ''' Tests the generated object based API.'''
+  """ Tests the generated object based API."""
 
-    def test_consistenty_with_repeated_pack_and_unpack(self):
-        ''' Checks the serialization and deserialization between a buffer and
+  def test_consistenty_with_repeated_pack_and_unpack(self):
+    """ Checks the serialization and deserialization between a buffer and
+
         its python object. It tests in the same way as the C++ object API test,
-        ObjectFlatBuffersTest in test.cpp. '''
+        ObjectFlatBuffersTest in test.cpp.
+    """
 
-        buf, off = make_monster_from_generated_code()
+    buf, off = make_monster_from_generated_code()
 
-        # Turns a buffer into Python object (T class).
-        monster1 = MyGame.Example.Monster.Monster.GetRootAsMonster(buf, off)
-        monsterT1 = MyGame.Example.Monster.MonsterT.InitFromObj(monster1)
+    # Turns a buffer into Python object (T class).
+    monster1 = _MONSTER.Monster.GetRootAs(buf, off)
+    monsterT1 = _MONSTER.MonsterT.InitFromObj(monster1)
 
-        for sizePrefix in [True, False]:
-            # Re-serialize the data into a buffer.
-            b1 = flatbuffers.Builder(0)
-            if sizePrefix:
-                b1.FinishSizePrefixed(monsterT1.Pack(b1))
-            else:
-                b1.Finish(monsterT1.Pack(b1))
-            CheckReadBuffer(b1.Bytes, b1.Head(), sizePrefix)
+    for sizePrefix in [True, False]:
+      # Re-serialize the data into a buffer.
+      b1 = flatbuffers.Builder(0)
+      if sizePrefix:
+        b1.FinishSizePrefixed(monsterT1.Pack(b1))
+      else:
+        b1.Finish(monsterT1.Pack(b1))
+      CheckReadBuffer(b1.Bytes, b1.Head(), sizePrefix)
 
-        # Deserializes the buffer into Python object again.
-        monster2 = MyGame.Example.Monster.Monster.GetRootAsMonster(b1.Bytes,
-                                                                   b1.Head())
-        # Re-serializes the data into a buffer for one more time.
-        monsterT2 = MyGame.Example.Monster.MonsterT.InitFromObj(monster2)
-        for sizePrefix in [True, False]:
-            # Re-serializes the data into a buffer
-            b2 = flatbuffers.Builder(0)
-            if sizePrefix:
-                b2.FinishSizePrefixed(monsterT2.Pack(b2))
-            else:
-                b2.Finish(monsterT2.Pack(b2))
-            CheckReadBuffer(b2.Bytes, b2.Head(), sizePrefix)
+    # Deserializes the buffer into Python object again.
+    monster2 = _MONSTER.Monster.GetRootAs(b1.Bytes, b1.Head())
+    # Re-serializes the data into a buffer for one more time.
+    monsterT2 = _MONSTER.MonsterT.InitFromObj(monster2)
+    for sizePrefix in [True, False]:
+      # Re-serializes the data into a buffer
+      b2 = flatbuffers.Builder(0)
+      if sizePrefix:
+        b2.FinishSizePrefixed(monsterT2.Pack(b2))
+      else:
+        b2.Finish(monsterT2.Pack(b2))
+      CheckReadBuffer(b2.Bytes, b2.Head(), sizePrefix)
 
-    def test_default_values_with_pack_and_unpack(self):
-        ''' Serializes and deserializes between a buffer with default values (no
+  def test_default_values_with_pack_and_unpack(self):
+    """ Serializes and deserializes between a buffer with default values (no
+
         specific values are filled when the buffer is created) and its python
-        object. '''
-        # Creates a flatbuffer with default values.
-        b1 = flatbuffers.Builder(0)
-        MyGame.Example.Monster.MonsterStart(b1)
-        gen_mon = MyGame.Example.Monster.MonsterEnd(b1)
-        b1.Finish(gen_mon)
+        object.
+    """
+    # Creates a flatbuffer with default values.
+    b1 = flatbuffers.Builder(0)
+    _MONSTER.MonsterStart(b1)
+    gen_mon = _MONSTER.MonsterEnd(b1)
+    b1.Finish(gen_mon)
 
-        # Converts the flatbuffer into the object class.
-        monster1 = MyGame.Example.Monster.Monster.GetRootAsMonster(b1.Bytes,
-                                                                   b1.Head())
-        monsterT1 = MyGame.Example.Monster.MonsterT.InitFromObj(monster1)
+    # Converts the flatbuffer into the object class.
+    monster1 = _MONSTER.Monster.GetRootAs(b1.Bytes, b1.Head())
+    monsterT1 = _MONSTER.MonsterT.InitFromObj(monster1)
 
-        # Packs the object class into another flatbuffer.
-        b2 = flatbuffers.Builder(0)
-        b2.Finish(monsterT1.Pack(b2))
-        monster2 = MyGame.Example.Monster.Monster.GetRootAsMonster(b2.Bytes,
-                                                                   b2.Head())
-        # Checks the default values.
-        self.assertTrue(monster2.Pos() is None)
-        self.assertEqual(monster2.Mana(),150)
-        self.assertEqual(monster2.Hp(), 100)
-        self.assertTrue(monster2.Name() is None)
-        self.assertEqual(monster2.Inventory(0), 0)
-        self.assertEqual(monster2.InventoryAsNumpy(), 0)
-        self.assertEqual(monster2.InventoryLength(), 0)
-        self.assertTrue(monster2.InventoryIsNone())
-        self.assertTrue(monster2.Color() is 8)
-        self.assertEqual(monster2.TestType(), 0)
-        self.assertTrue(monster2.Test() is None)
-        self.assertTrue(monster2.Test4(0) is None)
-        self.assertEqual(monster2.Test4Length(), 0)
-        self.assertTrue(monster2.Test4IsNone())
-        self.assertTrue(monster2.Testarrayofstring(0) is "")
-        self.assertEqual(monster2.TestarrayofstringLength(), 0)
-        self.assertTrue(monster2.TestarrayofstringIsNone())
-        self.assertTrue(monster2.Testarrayoftables(0) is None)
-        self.assertEqual(monster2.TestarrayoftablesLength(), 0)
-        self.assertTrue(monster2.TestarrayoftablesIsNone())
-        self.assertTrue(monster2.Enemy() is None)
-        self.assertEqual(monster2.Testnestedflatbuffer(0), 0)
-        self.assertEqual(monster2.TestnestedflatbufferAsNumpy(), 0)
-        self.assertEqual(monster2.TestnestedflatbufferLength(), 0)
-        self.assertTrue(monster2.TestnestedflatbufferIsNone())
-        self.assertTrue(monster2.Testempty() is None)
-        self.assertTrue(monster2.Testbool() is False)
-        self.assertEqual(monster2.Testhashs32Fnv1(), 0)
-        self.assertEqual(monster2.Testhashu32Fnv1(), 0)
-        self.assertEqual(monster2.Testhashs64Fnv1(), 0)
-        self.assertEqual(monster2.Testhashu64Fnv1(), 0)
-        self.assertEqual(monster2.Testhashs32Fnv1a(), 0)
-        self.assertEqual(monster2.Testhashu32Fnv1a(), 0)
-        self.assertEqual(monster2.Testhashs64Fnv1a(), 0)
-        self.assertEqual(monster2.Testhashu64Fnv1a(), 0)
-        self.assertEqual(monster2.Testarrayofbools(0), 0)
-        self.assertEqual(monster2.TestarrayofboolsAsNumpy(), 0)
-        self.assertEqual(monster2.TestarrayofboolsLength(), 0)
-        self.assertTrue(monster2.TestarrayofboolsIsNone())
-        self.assertEqual(monster2.Testf(), 3.14159)
-        self.assertEqual(monster2.Testf2(), 3.0)
-        self.assertEqual(monster2.Testf3(), 0.0)
-        self.assertTrue(monster2.Testarrayofstring2(0) is "")
-        self.assertEqual(monster2.Testarrayofstring2Length(), 0)
-        self.assertTrue(monster2.Testarrayofstring2IsNone())
-        self.assertTrue(monster2.Testarrayofsortedstruct(0) is None)
-        self.assertEqual(monster2.TestarrayofsortedstructLength(), 0)
-        self.assertTrue(monster2.TestarrayofsortedstructIsNone())
-        self.assertEqual(monster2.Flex(0), 0)
-        self.assertEqual(monster2.FlexAsNumpy(), 0)
-        self.assertEqual(monster2.FlexLength(), 0)
-        self.assertTrue(monster2.FlexIsNone())
-        self.assertTrue(monster2.Test5(0) is None)
-        self.assertEqual(monster2.Test5Length(), 0)
-        self.assertTrue(monster2.Test5IsNone())
-        self.assertEqual(monster2.VectorOfLongs(0), 0)
-        self.assertEqual(monster2.VectorOfLongsAsNumpy(), 0)
-        self.assertEqual(monster2.VectorOfLongsLength(), 0)
-        self.assertTrue(monster2.VectorOfLongsIsNone())
-        self.assertEqual(monster2.VectorOfDoubles(0), 0)
-        self.assertEqual(monster2.VectorOfDoublesAsNumpy(), 0)
-        self.assertEqual(monster2.VectorOfDoublesLength(), 0)
-        self.assertTrue(monster2.VectorOfDoublesIsNone())
-        self.assertTrue(monster2.ParentNamespaceTest() is None)
-        self.assertTrue(monster2.VectorOfReferrables(0) is None)
-        self.assertEqual(monster2.VectorOfReferrablesLength(), 0)
-        self.assertTrue(monster2.VectorOfReferrablesIsNone())
-        self.assertEqual(monster2.SingleWeakReference(), 0)
-        self.assertEqual(monster2.VectorOfWeakReferences(0), 0)
-        self.assertEqual(monster2.VectorOfWeakReferencesAsNumpy(), 0)
-        self.assertEqual(monster2.VectorOfWeakReferencesLength(), 0)
-        self.assertTrue(monster2.VectorOfWeakReferencesIsNone())
-        self.assertTrue(monster2.VectorOfStrongReferrables(0) is None)
-        self.assertEqual(monster2.VectorOfStrongReferrablesLength(), 0)
-        self.assertTrue(monster2.VectorOfStrongReferrablesIsNone())
-        self.assertEqual(monster2.CoOwningReference(), 0)
-        self.assertEqual(monster2.VectorOfCoOwningReferences(0), 0)
-        self.assertEqual(monster2.VectorOfCoOwningReferencesAsNumpy(), 0)
-        self.assertEqual(monster2.VectorOfCoOwningReferencesLength(), 0)
-        self.assertTrue(monster2.VectorOfCoOwningReferencesIsNone())
-        self.assertEqual(monster2.NonOwningReference(), 0)
-        self.assertEqual(monster2.VectorOfNonOwningReferences(0), 0)
-        self.assertEqual(monster2.VectorOfNonOwningReferencesAsNumpy(), 0)
-        self.assertEqual(monster2.VectorOfNonOwningReferencesLength(), 0)
-        self.assertTrue(monster2.VectorOfNonOwningReferencesIsNone())
-        self.assertEqual(monster2.AnyUniqueType(), 0)
-        self.assertTrue(monster2.AnyUnique() is None)
-        self.assertEqual(monster2.AnyAmbiguousType(), 0)
-        self.assertTrue(monster2.AnyAmbiguous() is None)
-        self.assertEqual(monster2.VectorOfEnums(0), 0)
-        self.assertEqual(monster2.VectorOfEnumsAsNumpy(), 0)
-        self.assertEqual(monster2.VectorOfEnumsLength(), 0)
-        self.assertTrue(monster2.VectorOfEnumsIsNone())
+    # Packs the object class into another flatbuffer.
+    b2 = flatbuffers.Builder(0)
+    b2.Finish(monsterT1.Pack(b2))
+    monster2 = _MONSTER.Monster.GetRootAs(b2.Bytes, b2.Head())
+    # Checks the default values.
+    self.assertTrue(monster2.Pos() is None)
+    self.assertEqual(monster2.Mana(), 150)
+    self.assertEqual(monster2.Hp(), 100)
+    self.assertTrue(monster2.Name() is None)
+    self.assertEqual(monster2.Inventory(0), 0)
+    self.assertEqual(monster2.InventoryAsNumpy(), 0)
+    self.assertEqual(monster2.InventoryLength(), 0)
+    self.assertTrue(monster2.InventoryIsNone())
+    self.assertTrue(monster2.Color() is 8)
+    self.assertEqual(monster2.TestType(), 0)
+    self.assertTrue(monster2.Test() is None)
+    self.assertTrue(monster2.Test4(0) is None)
+    self.assertEqual(monster2.Test4Length(), 0)
+    self.assertTrue(monster2.Test4IsNone())
+    self.assertTrue(monster2.Testarrayofstring(0) is '')
+    self.assertEqual(monster2.TestarrayofstringLength(), 0)
+    self.assertTrue(monster2.TestarrayofstringIsNone())
+    self.assertTrue(monster2.Testarrayoftables(0) is None)
+    self.assertEqual(monster2.TestarrayoftablesLength(), 0)
+    self.assertTrue(monster2.TestarrayoftablesIsNone())
+    self.assertTrue(monster2.Enemy() is None)
+    self.assertEqual(monster2.Testnestedflatbuffer(0), 0)
+    self.assertEqual(monster2.TestnestedflatbufferAsNumpy(), 0)
+    self.assertEqual(monster2.TestnestedflatbufferLength(), 0)
+    self.assertTrue(monster2.TestnestedflatbufferIsNone())
+    self.assertTrue(monster2.Testempty() is None)
+    self.assertTrue(monster2.Testbool() is False)
+    self.assertEqual(monster2.Testhashs32Fnv1(), 0)
+    self.assertEqual(monster2.Testhashu32Fnv1(), 0)
+    self.assertEqual(monster2.Testhashs64Fnv1(), 0)
+    self.assertEqual(monster2.Testhashu64Fnv1(), 0)
+    self.assertEqual(monster2.Testhashs32Fnv1a(), 0)
+    self.assertEqual(monster2.Testhashu32Fnv1a(), 0)
+    self.assertEqual(monster2.Testhashs64Fnv1a(), 0)
+    self.assertEqual(monster2.Testhashu64Fnv1a(), 0)
+    self.assertEqual(monster2.Testarrayofbools(0), 0)
+    self.assertEqual(monster2.TestarrayofboolsAsNumpy(), 0)
+    self.assertEqual(monster2.TestarrayofboolsLength(), 0)
+    self.assertTrue(monster2.TestarrayofboolsIsNone())
+    self.assertEqual(monster2.Testf(), 3.14159)
+    self.assertEqual(monster2.Testf2(), 3.0)
+    self.assertEqual(monster2.Testf3(), 0.0)
+    self.assertTrue(monster2.Testarrayofstring2(0) is '')
+    self.assertEqual(monster2.Testarrayofstring2Length(), 0)
+    self.assertTrue(monster2.Testarrayofstring2IsNone())
+    self.assertTrue(monster2.Testarrayofsortedstruct(0) is None)
+    self.assertEqual(monster2.TestarrayofsortedstructLength(), 0)
+    self.assertTrue(monster2.TestarrayofsortedstructIsNone())
+    self.assertEqual(monster2.Flex(0), 0)
+    self.assertEqual(monster2.FlexAsNumpy(), 0)
+    self.assertEqual(monster2.FlexLength(), 0)
+    self.assertTrue(monster2.FlexIsNone())
+    self.assertTrue(monster2.Test5(0) is None)
+    self.assertEqual(monster2.Test5Length(), 0)
+    self.assertTrue(monster2.Test5IsNone())
+    self.assertEqual(monster2.VectorOfLongs(0), 0)
+    self.assertEqual(monster2.VectorOfLongsAsNumpy(), 0)
+    self.assertEqual(monster2.VectorOfLongsLength(), 0)
+    self.assertTrue(monster2.VectorOfLongsIsNone())
+    self.assertEqual(monster2.VectorOfDoubles(0), 0)
+    self.assertEqual(monster2.VectorOfDoublesAsNumpy(), 0)
+    self.assertEqual(monster2.VectorOfDoublesLength(), 0)
+    self.assertTrue(monster2.VectorOfDoublesIsNone())
+    self.assertTrue(monster2.ParentNamespaceTest() is None)
+    self.assertTrue(monster2.VectorOfReferrables(0) is None)
+    self.assertEqual(monster2.VectorOfReferrablesLength(), 0)
+    self.assertTrue(monster2.VectorOfReferrablesIsNone())
+    self.assertEqual(monster2.SingleWeakReference(), 0)
+    self.assertEqual(monster2.VectorOfWeakReferences(0), 0)
+    self.assertEqual(monster2.VectorOfWeakReferencesAsNumpy(), 0)
+    self.assertEqual(monster2.VectorOfWeakReferencesLength(), 0)
+    self.assertTrue(monster2.VectorOfWeakReferencesIsNone())
+    self.assertTrue(monster2.VectorOfStrongReferrables(0) is None)
+    self.assertEqual(monster2.VectorOfStrongReferrablesLength(), 0)
+    self.assertTrue(monster2.VectorOfStrongReferrablesIsNone())
+    self.assertEqual(monster2.CoOwningReference(), 0)
+    self.assertEqual(monster2.VectorOfCoOwningReferences(0), 0)
+    self.assertEqual(monster2.VectorOfCoOwningReferencesAsNumpy(), 0)
+    self.assertEqual(monster2.VectorOfCoOwningReferencesLength(), 0)
+    self.assertTrue(monster2.VectorOfCoOwningReferencesIsNone())
+    self.assertEqual(monster2.NonOwningReference(), 0)
+    self.assertEqual(monster2.VectorOfNonOwningReferences(0), 0)
+    self.assertEqual(monster2.VectorOfNonOwningReferencesAsNumpy(), 0)
+    self.assertEqual(monster2.VectorOfNonOwningReferencesLength(), 0)
+    self.assertTrue(monster2.VectorOfNonOwningReferencesIsNone())
+    self.assertEqual(monster2.AnyUniqueType(), 0)
+    self.assertTrue(monster2.AnyUnique() is None)
+    self.assertEqual(monster2.AnyAmbiguousType(), 0)
+    self.assertTrue(monster2.AnyAmbiguous() is None)
+    self.assertEqual(monster2.VectorOfEnums(0), 0)
+    self.assertEqual(monster2.VectorOfEnumsAsNumpy(), 0)
+    self.assertEqual(monster2.VectorOfEnumsLength(), 0)
+    self.assertTrue(monster2.VectorOfEnumsIsNone())
 
 
 class TestAllMutableCodePathsOfExampleSchema(unittest.TestCase):
-    ''' Tests the object API generated for monster_test.fbs for mutation
+  """ Tests the object API generated for monster_test.fbs for mutation
+
         purposes. In each test, the default values will be changed through the
         object API. We'll then pack the object class into the buf class and read
         the updated values out from it to validate if the values are mutated as
-        expected.'''
+        expected.
+  """
 
-    def setUp(self, *args, **kwargs):
-        super(TestAllMutableCodePathsOfExampleSchema, self).setUp(*args,
-                                                                  **kwargs)
-        # Creates an empty monster flatbuffer, and loads it into the object
-        # class for future tests.
-        b = flatbuffers.Builder(0)
-        MyGame.Example.Monster.MonsterStart(b)
-        self.monsterT = self._create_and_load_object_class(b)
+  def setUp(self, *args, **kwargs):
+    super(TestAllMutableCodePathsOfExampleSchema, self).setUp(*args, **kwargs)
+    # Creates an empty monster flatbuffer, and loads it into the object
+    # class for future tests.
+    b = flatbuffers.Builder(0)
+    _MONSTER.MonsterStart(b)
+    self.monsterT = self._create_and_load_object_class(b)
 
-    def _pack_and_load_buf_class(self, monsterT):
-        ''' Packs the object class into a flatbuffer and loads it into a buf
-        class.'''
-        b = flatbuffers.Builder(0)
-        b.Finish(monsterT.Pack(b))
-        monster = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Bytes,
-                                                                  b.Head())
-        return monster
+  def _pack_and_load_buf_class(self, monsterT):
+    """ Packs the object class into a flatbuffer and loads it into a buf
 
-    def _create_and_load_object_class(self, b):
-        ''' Finishs the creation of a monster flatbuffer and loads it into an
-        object class.'''
-        gen_mon = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(gen_mon)
-        monster = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Bytes,
-                                                                  b.Head())
-        monsterT = MyGame.Example.Monster.MonsterT()
-        monsterT.InitFromObj(monster)
-        return monsterT
+        class.
+    """
+    b = flatbuffers.Builder(0)
+    b.Finish(monsterT.Pack(b))
+    monster = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
+    return monster
 
-    def test_mutate_pos(self):
-        posT = MyGame.Example.Vec3.Vec3T()
-        posT.x = 4.0
-        posT.y = 5.0
-        posT.z = 6.0
-        posT.test1 = 6.0
-        posT.test2 = 7
-        test3T = MyGame.Example.Test.TestT()
-        test3T.a = 8
-        test3T.b = 9
-        posT.test3 = test3T
-        self.monsterT.pos = posT
+  def _create_and_load_object_class(self, b):
+    """ Finishs the creation of a monster flatbuffer and loads it into an
 
-        # Packs the updated values.
-        monster = self._pack_and_load_buf_class(self.monsterT)
+        object class.
+    """
+    gen_mon = _MONSTER.MonsterEnd(b)
+    b.Finish(gen_mon)
+    monster = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
+    monsterT = _MONSTER.MonsterT()
+    monsterT.InitFromObj(monster)
+    return monsterT
 
-        # Checks if values are loaded correctly into the object class.
-        pos = monster.Pos()
+  def test_mutate_pos(self):
+    posT = _VEC3.Vec3T()
+    posT.x = 4.0
+    posT.y = 5.0
+    posT.z = 6.0
+    posT.test1 = 6.0
+    posT.test2 = 7
+    test3T = _TEST.TestT()
+    test3T.a = 8
+    test3T.b = 9
+    posT.test3 = test3T
+    self.monsterT.pos = posT
 
-        # Verifies the properties of the Vec3.
-        self.assertEqual(pos.X(), 4.0)
-        self.assertEqual(pos.Y(), 5.0)
-        self.assertEqual(pos.Z(), 6.0)
-        self.assertEqual(pos.Test1(), 6.0)
-        self.assertEqual(pos.Test2(), 7)
-        t3 = MyGame.Example.Test.Test()
-        t3 = pos.Test3(t3)
-        self.assertEqual(t3.A(), 8)
-        self.assertEqual(t3.B(), 9)
+    # Packs the updated values.
+    monster = self._pack_and_load_buf_class(self.monsterT)
 
-    def test_mutate_mana(self):
-        self.monsterT.mana = 200
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertEqual(monster.Mana(), 200)
+    # Checks if values are loaded correctly into the object class.
+    pos = monster.Pos()
 
-    def test_mutate_hp(self):
-        self.monsterT.hp = 200
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertEqual(monster.Hp(), 200)
+    # Verifies the properties of the Vec3.
+    self.assertEqual(pos.X(), 4.0)
+    self.assertEqual(pos.Y(), 5.0)
+    self.assertEqual(pos.Z(), 6.0)
+    self.assertEqual(pos.Test1(), 6.0)
+    self.assertEqual(pos.Test2(), 7)
+    t3 = _TEST.Test()
+    t3 = pos.Test3(t3)
+    self.assertEqual(t3.A(), 8)
+    self.assertEqual(t3.B(), 9)
 
-    def test_mutate_name(self):
-        self.monsterT.name = "MyMonster"
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertEqual(monster.Name(), b"MyMonster")
+  def test_mutate_mana(self):
+    self.monsterT.mana = 200
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertEqual(monster.Mana(), 200)
 
-    def test_mutate_inventory(self):
-        self.monsterT.inventory = [1, 7, 8]
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertEqual(monster.Inventory(0), 1)
-        self.assertEqual(monster.Inventory(1), 7)
-        self.assertEqual(monster.Inventory(2), 8)
+  def test_mutate_hp(self):
+    self.monsterT.hp = 200
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertEqual(monster.Hp(), 200)
 
-    def test_empty_inventory(self):
-        self.monsterT.inventory = []
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertFalse(monster.InventoryIsNone())
+  def test_mutate_name(self):
+    self.monsterT.name = 'MyMonster'
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertEqual(monster.Name(), b'MyMonster')
 
-    def test_mutate_color(self):
-        self.monsterT.color = MyGame.Example.Color.Color.Red
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertEqual(monster.Color(), MyGame.Example.Color.Color.Red)
+  def test_mutate_inventory(self):
+    self.monsterT.inventory = [1, 7, 8]
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertEqual(monster.Inventory(0), 1)
+    self.assertEqual(monster.Inventory(1), 7)
+    self.assertEqual(monster.Inventory(2), 8)
 
-    def test_mutate_testtype(self):
-        self.monsterT.testType = MyGame.Example.Any.Any.Monster
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertEqual(monster.TestType(), MyGame.Example.Any.Any.Monster)
+  def test_empty_inventory(self):
+    self.monsterT.inventory = []
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertFalse(monster.InventoryIsNone())
 
-    def test_mutate_test(self):
-        testT = MyGame.Example.Monster.MonsterT()
-        testT.hp = 200
-        self.monsterT.test = testT
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        # Initializes a Table from a union field Test(...).
-        table = monster.Test()
+  def test_mutate_color(self):
+    self.monsterT.color = _COLOR.Color.Red
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertEqual(monster.Color(), _COLOR.Color.Red)
 
-        # Initializes a Monster from the Table from the union.
-        test_monster = MyGame.Example.Monster.Monster()
-        test_monster.Init(table.Bytes, table.Pos)
-        self.assertEqual(test_monster.Hp(), 200)
+  def test_mutate_testtype(self):
+    self.monsterT.testType = _ANY.Any.Monster
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertEqual(monster.TestType(), _ANY.Any.Monster)
 
-    def test_mutate_test4(self):
-        test0T = MyGame.Example.Test.TestT()
-        test0T.a = 10
-        test0T.b = 20
-        test1T = MyGame.Example.Test.TestT()
-        test1T.a = 30
-        test1T.b = 40
-        self.monsterT.test4 = [test0T, test1T]
+  def test_mutate_test(self):
+    testT = _MONSTER.MonsterT()
+    testT.hp = 200
+    self.monsterT.test = testT
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    # Initializes a Table from a union field Test(...).
+    table = monster.Test()
 
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        test0 = monster.Test4(0)
-        self.assertEqual(test0.A(), 10)
-        self.assertEqual(test0.B(), 20)
-        test1 = monster.Test4(1)
-        self.assertEqual(test1.A(), 30)
-        self.assertEqual(test1.B(), 40)
+    # Initializes a Monster from the Table from the union.
+    test_monster = _MONSTER.Monster()
+    test_monster.Init(table.Bytes, table.Pos)
+    self.assertEqual(test_monster.Hp(), 200)
 
-    def test_empty_test4(self):
-        self.monsterT.test4 = []
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertFalse(monster.Test4IsNone())
+  def test_mutate_test4(self):
+    test0T = _TEST.TestT()
+    test0T.a = 10
+    test0T.b = 20
+    test1T = _TEST.TestT()
+    test1T.a = 30
+    test1T.b = 40
+    self.monsterT.test4 = [test0T, test1T]
 
-    def test_mutate_testarrayofstring(self):
-        self.monsterT.testarrayofstring = []
-        self.monsterT.testarrayofstring.append("test1")
-        self.monsterT.testarrayofstring.append("test2")
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertEqual(monster.Testarrayofstring(0), b"test1")
-        self.assertEqual(monster.Testarrayofstring(1), b"test2")
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    test0 = monster.Test4(0)
+    self.assertEqual(test0.A(), 10)
+    self.assertEqual(test0.B(), 20)
+    test1 = monster.Test4(1)
+    self.assertEqual(test1.A(), 30)
+    self.assertEqual(test1.B(), 40)
 
-    def test_empty_testarrayofstring(self):
-        self.monsterT.testarrayofstring = []
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertFalse(monster.TestarrayofstringIsNone())
+  def test_empty_test4(self):
+    self.monsterT.test4 = []
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertFalse(monster.Test4IsNone())
 
-    def test_mutate_testarrayoftables(self):
-        monsterT0 = MyGame.Example.Monster.MonsterT()
-        monsterT0.hp = 200
-        monsterT1 = MyGame.Example.Monster.MonsterT()
-        monsterT1.hp = 400
-        self.monsterT.testarrayoftables = []
-        self.monsterT.testarrayoftables.append(monsterT0)
-        self.monsterT.testarrayoftables.append(monsterT1)
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertEqual(monster.Testarrayoftables(0).Hp(), 200)
-        self.assertEqual(monster.Testarrayoftables(1).Hp(), 400)
+  def test_mutate_testarrayofstring(self):
+    self.monsterT.testarrayofstring = []
+    self.monsterT.testarrayofstring.append('test1')
+    self.monsterT.testarrayofstring.append('test2')
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertEqual(monster.Testarrayofstring(0), b'test1')
+    self.assertEqual(monster.Testarrayofstring(1), b'test2')
 
-    def test_empty_testarrayoftables(self):
-        self.monsterT.testarrayoftables = []
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertFalse(monster.TestarrayoftablesIsNone())
+  def test_empty_testarrayofstring(self):
+    self.monsterT.testarrayofstring = []
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertFalse(monster.TestarrayofstringIsNone())
 
-    def test_mutate_enemy(self):
-        monsterT = MyGame.Example.Monster.MonsterT()
-        monsterT.hp = 200
-        self.monsterT.enemy = monsterT
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertEqual(monster.Enemy().Hp(), 200)
+  def test_mutate_testarrayoftables(self):
+    monsterT0 = _MONSTER.MonsterT()
+    monsterT0.hp = 200
+    monsterT1 = _MONSTER.MonsterT()
+    monsterT1.hp = 400
+    self.monsterT.testarrayoftables = []
+    self.monsterT.testarrayoftables.append(monsterT0)
+    self.monsterT.testarrayoftables.append(monsterT1)
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertEqual(monster.Testarrayoftables(0).Hp(), 200)
+    self.assertEqual(monster.Testarrayoftables(1).Hp(), 400)
 
-    def test_mutate_testnestedflatbuffer(self):
-        self.monsterT.testnestedflatbuffer = [8, 2, 4]
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertEqual(monster.Testnestedflatbuffer(0), 8)
-        self.assertEqual(monster.Testnestedflatbuffer(1), 2)
-        self.assertEqual(monster.Testnestedflatbuffer(2), 4)
+  def test_empty_testarrayoftables(self):
+    self.monsterT.testarrayoftables = []
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertFalse(monster.TestarrayoftablesIsNone())
 
-    def test_empty_testnestedflatbuffer(self):
-        self.monsterT.testnestedflatbuffer = []
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertFalse(monster.TestnestedflatbufferIsNone())
+  def test_mutate_enemy(self):
+    monsterT = _MONSTER.MonsterT()
+    monsterT.hp = 200
+    self.monsterT.enemy = monsterT
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertEqual(monster.Enemy().Hp(), 200)
 
-    def test_mutate_testbool(self):
-        self.monsterT.testbool = True
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertTrue(monster.Testbool())
+  def test_mutate_testnestedflatbuffer(self):
+    self.monsterT.testnestedflatbuffer = [8, 2, 4]
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertEqual(monster.Testnestedflatbuffer(0), 8)
+    self.assertEqual(monster.Testnestedflatbuffer(1), 2)
+    self.assertEqual(monster.Testnestedflatbuffer(2), 4)
 
-    def test_mutate_testhashes(self):
-        self.monsterT.testhashs32Fnv1 = 1
-        self.monsterT.testhashu32Fnv1 = 2
-        self.monsterT.testhashs64Fnv1 = 3
-        self.monsterT.testhashu64Fnv1 = 4
-        self.monsterT.testhashs32Fnv1a = 5
-        self.monsterT.testhashu32Fnv1a = 6
-        self.monsterT.testhashs64Fnv1a = 7
-        self.monsterT.testhashu64Fnv1a = 8
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertEqual(monster.Testhashs32Fnv1(), 1)
-        self.assertEqual(monster.Testhashu32Fnv1(), 2)
-        self.assertEqual(monster.Testhashs64Fnv1(), 3)
-        self.assertEqual(monster.Testhashu64Fnv1(), 4)
-        self.assertEqual(monster.Testhashs32Fnv1a(), 5)
-        self.assertEqual(monster.Testhashu32Fnv1a(), 6)
-        self.assertEqual(monster.Testhashs64Fnv1a(), 7)
-        self.assertEqual(monster.Testhashu64Fnv1a(), 8)
+  def test_empty_testnestedflatbuffer(self):
+    self.monsterT.testnestedflatbuffer = []
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertFalse(monster.TestnestedflatbufferIsNone())
 
-    def test_mutate_testarrayofbools(self):
-        self.monsterT.testarrayofbools = []
-        self.monsterT.testarrayofbools.append(True)
-        self.monsterT.testarrayofbools.append(True)
-        self.monsterT.testarrayofbools.append(False)
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertEqual(monster.Testarrayofbools(0), True)
-        self.assertEqual(monster.Testarrayofbools(1), True)
-        self.assertEqual(monster.Testarrayofbools(2), False)
+  def test_mutate_testbool(self):
+    self.monsterT.testbool = True
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertTrue(monster.Testbool())
 
-    def test_empty_testarrayofbools(self):
-        self.monsterT.testarrayofbools = []
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertFalse(monster.TestarrayofboolsIsNone())
+  def test_mutate_testhashes(self):
+    self.monsterT.testhashs32Fnv1 = 1
+    self.monsterT.testhashu32Fnv1 = 2
+    self.monsterT.testhashs64Fnv1 = 3
+    self.monsterT.testhashu64Fnv1 = 4
+    self.monsterT.testhashs32Fnv1a = 5
+    self.monsterT.testhashu32Fnv1a = 6
+    self.monsterT.testhashs64Fnv1a = 7
+    self.monsterT.testhashu64Fnv1a = 8
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertEqual(monster.Testhashs32Fnv1(), 1)
+    self.assertEqual(monster.Testhashu32Fnv1(), 2)
+    self.assertEqual(monster.Testhashs64Fnv1(), 3)
+    self.assertEqual(monster.Testhashu64Fnv1(), 4)
+    self.assertEqual(monster.Testhashs32Fnv1a(), 5)
+    self.assertEqual(monster.Testhashu32Fnv1a(), 6)
+    self.assertEqual(monster.Testhashs64Fnv1a(), 7)
+    self.assertEqual(monster.Testhashu64Fnv1a(), 8)
 
-    def test_mutate_testf(self):
-        self.monsterT.testf = 2.0
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertEqual(monster.Testf(), 2.0)
+  def test_mutate_testarrayofbools(self):
+    self.monsterT.testarrayofbools = []
+    self.monsterT.testarrayofbools.append(True)
+    self.monsterT.testarrayofbools.append(True)
+    self.monsterT.testarrayofbools.append(False)
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertEqual(monster.Testarrayofbools(0), True)
+    self.assertEqual(monster.Testarrayofbools(1), True)
+    self.assertEqual(monster.Testarrayofbools(2), False)
 
-    def test_mutate_vectoroflongs(self):
-        self.monsterT.vectorOfLongs = []
-        self.monsterT.vectorOfLongs.append(1)
-        self.monsterT.vectorOfLongs.append(100)
-        self.monsterT.vectorOfLongs.append(10000)
-        self.monsterT.vectorOfLongs.append(1000000)
-        self.monsterT.vectorOfLongs.append(100000000)
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertEqual(monster.VectorOfLongs(0), 1)
-        self.assertEqual(monster.VectorOfLongs(1), 100)
-        self.assertEqual(monster.VectorOfLongs(2), 10000)
-        self.assertEqual(monster.VectorOfLongs(3), 1000000)
-        self.assertEqual(monster.VectorOfLongs(4), 100000000)
+  def test_empty_testarrayofbools(self):
+    self.monsterT.testarrayofbools = []
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertFalse(monster.TestarrayofboolsIsNone())
 
-    def test_empty_vectoroflongs(self):
-        self.monsterT.vectorOfLongs = []
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertFalse(monster.VectorOfLongsIsNone())
+  def test_mutate_testf(self):
+    self.monsterT.testf = 2.0
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertEqual(monster.Testf(), 2.0)
 
-    def test_mutate_vectorofdoubles(self):
-        self.monsterT.vectorOfDoubles = []
-        self.monsterT.vectorOfDoubles.append(-1.7976931348623157e+308)
-        self.monsterT.vectorOfDoubles.append(0)
-        self.monsterT.vectorOfDoubles.append(1.7976931348623157e+308)
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertEqual(monster.VectorOfDoubles(0), -1.7976931348623157e+308)
-        self.assertEqual(monster.VectorOfDoubles(1), 0)
-        self.assertEqual(monster.VectorOfDoubles(2), 1.7976931348623157e+308)
+  def test_mutate_vectoroflongs(self):
+    self.monsterT.vectorOfLongs = []
+    self.monsterT.vectorOfLongs.append(1)
+    self.monsterT.vectorOfLongs.append(100)
+    self.monsterT.vectorOfLongs.append(10000)
+    self.monsterT.vectorOfLongs.append(1000000)
+    self.monsterT.vectorOfLongs.append(100000000)
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertEqual(monster.VectorOfLongs(0), 1)
+    self.assertEqual(monster.VectorOfLongs(1), 100)
+    self.assertEqual(monster.VectorOfLongs(2), 10000)
+    self.assertEqual(monster.VectorOfLongs(3), 1000000)
+    self.assertEqual(monster.VectorOfLongs(4), 100000000)
 
-    def test_empty_vectorofdoubles(self):
-        self.monsterT.vectorOfDoubles = []
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertFalse(monster.VectorOfDoublesIsNone())
+  def test_empty_vectoroflongs(self):
+    self.monsterT.vectorOfLongs = []
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertFalse(monster.VectorOfLongsIsNone())
 
-    def test_mutate_parentnamespacetest(self):
-        self.monsterT.parentNamespaceTest = MyGame.InParentNamespace.InParentNamespaceT()
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertTrue(isinstance(monster.ParentNamespaceTest(),
-                                   MyGame.InParentNamespace.InParentNamespace))
+  def test_mutate_vectorofdoubles(self):
+    self.monsterT.vectorOfDoubles = []
+    self.monsterT.vectorOfDoubles.append(-1.7976931348623157e+308)
+    self.monsterT.vectorOfDoubles.append(0)
+    self.monsterT.vectorOfDoubles.append(1.7976931348623157e+308)
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertEqual(monster.VectorOfDoubles(0), -1.7976931348623157e+308)
+    self.assertEqual(monster.VectorOfDoubles(1), 0)
+    self.assertEqual(monster.VectorOfDoubles(2), 1.7976931348623157e+308)
 
-    def test_mutate_vectorofEnums(self):
-        self.monsterT.vectorOfEnums = []
-        self.monsterT.vectorOfEnums.append(MyGame.Example.Color.Color.Red)
-        self.monsterT.vectorOfEnums.append(MyGame.Example.Color.Color.Blue)
-        self.monsterT.vectorOfEnums.append(MyGame.Example.Color.Color.Red)
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertEqual(monster.VectorOfEnums(0),
-                         MyGame.Example.Color.Color.Red)
-        self.assertEqual(monster.VectorOfEnums(1),
-                         MyGame.Example.Color.Color.Blue)
-        self.assertEqual(monster.VectorOfEnums(2),
-                         MyGame.Example.Color.Color.Red)
+  def test_empty_vectorofdoubles(self):
+    self.monsterT.vectorOfDoubles = []
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertFalse(monster.VectorOfDoublesIsNone())
 
-    def test_empty_vectorofEnums(self):
-        self.monsterT.vectorOfEnums = []
-        monster = self._pack_and_load_buf_class(self.monsterT)
-        self.assertFalse(monster.VectorOfEnumsIsNone())
+  def test_mutate_parentnamespacetest(self):
+    self.monsterT.parentNamespaceTest = _IN_PARENT_NAMESPACE.InParentNamespaceT(
+    )
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertTrue(
+        isinstance(monster.ParentNamespaceTest(),
+                   _IN_PARENT_NAMESPACE.InParentNamespace))
+
+  def test_mutate_vectorofEnums(self):
+    self.monsterT.vectorOfEnums = []
+    self.monsterT.vectorOfEnums.append(_COLOR.Color.Red)
+    self.monsterT.vectorOfEnums.append(_COLOR.Color.Blue)
+    self.monsterT.vectorOfEnums.append(_COLOR.Color.Red)
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertEqual(monster.VectorOfEnums(0), _COLOR.Color.Red)
+    self.assertEqual(monster.VectorOfEnums(1), _COLOR.Color.Blue)
+    self.assertEqual(monster.VectorOfEnums(2), _COLOR.Color.Red)
+
+  def test_empty_vectorofEnums(self):
+    self.monsterT.vectorOfEnums = []
+    monster = self._pack_and_load_buf_class(self.monsterT)
+    self.assertFalse(monster.VectorOfEnumsIsNone())
 
 
 def CheckReadBuffer(buf, offset, sizePrefix=False, file_identifier=None):
-    ''' CheckReadBuffer checks that the given buffer is evaluated correctly
-        as the example Monster. '''
+  """ CheckReadBuffer checks that the given buffer is evaluated correctly
 
-    def asserter(stmt):
-        ''' An assertion helper that is separated from TestCase classes. '''
-        if not stmt:
-            raise AssertionError('CheckReadBuffer case failed')
-    if file_identifier:
-        # test prior to removal of size_prefix
-        asserter(util.GetBufferIdentifier(buf, offset, size_prefixed=sizePrefix) == file_identifier)
-        asserter(util.BufferHasIdentifier(buf, offset, file_identifier=file_identifier, size_prefixed=sizePrefix))
-        asserter(MyGame.Example.Monster.Monster.MonsterBufferHasIdentifier(buf, offset, size_prefixed=sizePrefix))
-    if sizePrefix:
-        size = util.GetSizePrefix(buf, offset)
-        asserter(size == len(buf[offset:])-4)
-        buf, offset = util.RemoveSizePrefix(buf, offset)
-    if file_identifier:
-        asserter(MyGame.Example.Monster.Monster.MonsterBufferHasIdentifier(buf, offset))
-    else:
-        asserter(not MyGame.Example.Monster.Monster.MonsterBufferHasIdentifier(buf, offset))
-    monster = MyGame.Example.Monster.Monster.GetRootAsMonster(buf, offset)
+        as the example Monster.
+  """
 
-    asserter(monster.Hp() == 80)
-    asserter(monster.Mana() == 150)
-    asserter(monster.Name() == b'MyMonster')
+  def asserter(stmt):
+    """ An assertion helper that is separated from TestCase classes. """
+    if not stmt:
+      raise AssertionError('CheckReadBuffer case failed')
 
-    # initialize a Vec3 from Pos()
-    vec = monster.Pos()
-    asserter(vec is not None)
+  if file_identifier:
+    # test prior to removal of size_prefix
+    asserter(
+        util.GetBufferIdentifier(buf, offset, size_prefixed=sizePrefix) ==
+        file_identifier)
+    asserter(
+        util.BufferHasIdentifier(
+            buf,
+            offset,
+            file_identifier=file_identifier,
+            size_prefixed=sizePrefix))
+    asserter(
+        _MONSTER.Monster.MonsterBufferHasIdentifier(
+            buf, offset, size_prefixed=sizePrefix))
+  if sizePrefix:
+    size = util.GetSizePrefix(buf, offset)
+    asserter(size == len(buf[offset:]) - 4)
+    buf, offset = util.RemoveSizePrefix(buf, offset)
+  if file_identifier:
+    asserter(_MONSTER.Monster.MonsterBufferHasIdentifier(buf, offset))
+  else:
+    asserter(not _MONSTER.Monster.MonsterBufferHasIdentifier(buf, offset))
+  monster = _MONSTER.Monster.GetRootAs(buf, offset)
 
-    # verify the properties of the Vec3
-    asserter(vec.X() == 1.0)
-    asserter(vec.Y() == 2.0)
-    asserter(vec.Z() == 3.0)
-    asserter(vec.Test1() == 3.0)
-    asserter(vec.Test2() == 2)
+  asserter(monster.Hp() == 80)
+  asserter(monster.Mana() == 150)
+  asserter(monster.Name() == b'MyMonster')
 
-    # initialize a Test from Test3(...)
-    t = MyGame.Example.Test.Test()
-    t = vec.Test3(t)
-    asserter(t is not None)
+  # initialize a Vec3 from Pos()
+  vec = monster.Pos()
+  asserter(vec is not None)
 
-    # verify the properties of the Test
-    asserter(t.A() == 5)
-    asserter(t.B() == 6)
+  # verify the properties of the Vec3
+  asserter(vec.X() == 1.0)
+  asserter(vec.Y() == 2.0)
+  asserter(vec.Z() == 3.0)
+  asserter(vec.Test1() == 3.0)
+  asserter(vec.Test2() == 2)
 
-    # verify that the enum code matches the enum declaration:
-    union_type = MyGame.Example.Any.Any
-    asserter(monster.TestType() == union_type.Monster)
+  # initialize a Test from Test3(...)
+  t = _TEST.Test()
+  t = vec.Test3(t)
+  asserter(t is not None)
 
-    # initialize a Table from a union field Test(...)
-    table2 = monster.Test()
-    asserter(type(table2) is flatbuffers.table.Table)
+  # verify the properties of the Test
+  asserter(t.A() == 5)
+  asserter(t.B() == 6)
 
-    # initialize a Monster from the Table from the union
-    monster2 = MyGame.Example.Monster.Monster()
-    monster2.Init(table2.Bytes, table2.Pos)
+  # verify that the enum code matches the enum declaration:
+  union_type = _ANY.Any
+  asserter(monster.TestType() == union_type.Monster)
 
-    asserter(monster2.Name() == b"Fred")
+  # initialize a Table from a union field Test(...)
+  table2 = monster.Test()
+  asserter(type(table2) is flatbuffers.table.Table)
 
-    # iterate through the first monster's inventory:
-    asserter(monster.InventoryLength() == 5)
-    asserter(not monster.InventoryIsNone())
+  # initialize a Monster from the Table from the union
+  monster2 = _MONSTER.Monster()
+  monster2.Init(table2.Bytes, table2.Pos)
 
-    invsum = 0
-    for i in compat_range(monster.InventoryLength()):
-        v = monster.Inventory(i)
-        invsum += int(v)
-    asserter(invsum == 10)
+  asserter(monster2.Name() == b'Fred')
 
+  # iterate through the first monster's inventory:
+  asserter(monster.InventoryLength() == 5)
+  asserter(not monster.InventoryIsNone())
+
+  invsum = 0
+  for i in compat_range(monster.InventoryLength()):
+    v = monster.Inventory(i)
+    invsum += int(v)
+  asserter(invsum == 10)
+
+  for i in range(5):
+    asserter(monster.VectorOfLongs(i) == 10**(i * 2))
+
+  asserter(not monster.VectorOfDoublesIsNone())
+  asserter(([-1.7976931348623157e+308, 0, 1.7976931348623157e+308] == [
+      monster.VectorOfDoubles(i) for i in range(monster.VectorOfDoublesLength())
+  ]))
+
+  try:
+    imp.find_module('numpy')
+    # if numpy exists, then we should be able to get the
+    # vector as a numpy array
+    import numpy as np
+
+    asserter(monster.InventoryAsNumpy().sum() == 10)
+    asserter(monster.InventoryAsNumpy().dtype == np.dtype('uint8'))
+
+    VectorOfLongs = monster.VectorOfLongsAsNumpy()
+    asserter(VectorOfLongs.dtype == np.dtype('int64'))
     for i in range(5):
-        asserter(monster.VectorOfLongs(i) == 10 ** (i * 2))
+      asserter(VectorOfLongs[i] == 10**(i * 2))
 
-    asserter(not monster.VectorOfDoublesIsNone())
-    asserter(([-1.7976931348623157e+308, 0, 1.7976931348623157e+308]
-              == [monster.VectorOfDoubles(i)
-                  for i in range(monster.VectorOfDoublesLength())]))
+    VectorOfDoubles = monster.VectorOfDoublesAsNumpy()
+    asserter(VectorOfDoubles.dtype == np.dtype('float64'))
+    asserter(VectorOfDoubles[0] == np.finfo('float64').min)
+    asserter(VectorOfDoubles[1] == 0.0)
+    asserter(VectorOfDoubles[2] == np.finfo('float64').max)
 
-    try:
-        imp.find_module('numpy')
-        # if numpy exists, then we should be able to get the
-        # vector as a numpy array
-        import numpy as np
+  except ImportError:
+    # If numpy does not exist, trying to get vector as numpy
+    # array should raise NumpyRequiredForThisFeature. The way
+    # assertRaises has been implemented prevents us from
+    # asserting this error is raised outside of a test case.
+    pass
 
-        asserter(monster.InventoryAsNumpy().sum() == 10)
-        asserter(monster.InventoryAsNumpy().dtype == np.dtype('uint8'))
+  asserter(monster.Test4Length() == 2)
+  asserter(not monster.Test4IsNone())
 
-        VectorOfLongs = monster.VectorOfLongsAsNumpy()
-        asserter(VectorOfLongs.dtype == np.dtype('int64'))
-        for i in range(5):
-            asserter(VectorOfLongs[i] == 10 ** (i * 2))
+  # create a 'Test' object and populate it:
+  test0 = monster.Test4(0)
+  asserter(type(test0) is _TEST.Test)
 
-        VectorOfDoubles = monster.VectorOfDoublesAsNumpy()
-        asserter(VectorOfDoubles.dtype == np.dtype('float64'))
-        asserter(VectorOfDoubles[0] == np.finfo('float64').min)
-        asserter(VectorOfDoubles[1] == 0.0)
-        asserter(VectorOfDoubles[2] == np.finfo('float64').max)
+  test1 = monster.Test4(1)
+  asserter(type(test1) is _TEST.Test)
 
-    except ImportError:
-        # If numpy does not exist, trying to get vector as numpy
-        # array should raise NumpyRequiredForThisFeature. The way
-        # assertRaises has been implemented prevents us from
-        # asserting this error is raised outside of a test case.
-        pass
+  # the position of test0 and test1 are swapped in monsterdata_java_wire
+  # and monsterdata_test_wire, so ignore ordering
+  v0 = test0.A()
+  v1 = test0.B()
+  v2 = test1.A()
+  v3 = test1.B()
+  sumtest12 = int(v0) + int(v1) + int(v2) + int(v3)
 
-    asserter(monster.Test4Length() == 2)
-    asserter(not monster.Test4IsNone())
+  asserter(sumtest12 == 100)
 
-    # create a 'Test' object and populate it:
-    test0 = monster.Test4(0)
-    asserter(type(test0) is MyGame.Example.Test.Test)
+  asserter(not monster.TestarrayofstringIsNone())
+  asserter(monster.TestarrayofstringLength() == 2)
+  asserter(monster.Testarrayofstring(0) == b'test1')
+  asserter(monster.Testarrayofstring(1) == b'test2')
 
-    test1 = monster.Test4(1)
-    asserter(type(test1) is MyGame.Example.Test.Test)
-
-    # the position of test0 and test1 are swapped in monsterdata_java_wire
-    # and monsterdata_test_wire, so ignore ordering
-    v0 = test0.A()
-    v1 = test0.B()
-    v2 = test1.A()
-    v3 = test1.B()
-    sumtest12 = int(v0) + int(v1) + int(v2) + int(v3)
-
-    asserter(sumtest12 == 100)
-
-    asserter(not monster.TestarrayofstringIsNone())
-    asserter(monster.TestarrayofstringLength() == 2)
-    asserter(monster.Testarrayofstring(0) == b"test1")
-    asserter(monster.Testarrayofstring(1) == b"test2")
-
-    asserter(monster.TestarrayoftablesIsNone())
-    asserter(monster.TestarrayoftablesLength() == 0)
-    asserter(monster.TestnestedflatbufferIsNone())
-    asserter(monster.TestnestedflatbufferLength() == 0)
-    asserter(monster.Testempty() is None)
+  asserter(monster.TestarrayoftablesIsNone())
+  asserter(monster.TestarrayoftablesLength() == 0)
+  asserter(monster.TestnestedflatbufferIsNone())
+  asserter(monster.TestnestedflatbufferLength() == 0)
+  asserter(monster.Testempty() is None)
 
 
 class TestFuzz(unittest.TestCase):
-    ''' Low level stress/fuzz test: serialize/deserialize a variety of
-        different kinds of data in different combinations '''
+  """ Low level stress/fuzz test: serialize/deserialize a variety of
 
-    binary_type = compat.binary_types[0] # this will always exist
-    ofInt32Bytes = binary_type([0x83, 0x33, 0x33, 0x33])
-    ofInt64Bytes = binary_type([0x84, 0x44, 0x44, 0x44,
-                                0x44, 0x44, 0x44, 0x44])
-    overflowingInt32Val = flatbuffers.encode.Get(flatbuffers.packer.int32,
-                                                 ofInt32Bytes, 0)
-    overflowingInt64Val = flatbuffers.encode.Get(flatbuffers.packer.int64,
-                                                 ofInt64Bytes, 0)
+        different kinds of data in different combinations
+  """
 
-    # Values we're testing against: chosen to ensure no bits get chopped
-    # off anywhere, and also be different from eachother.
-    boolVal = True
-    int8Val = N.Int8Flags.py_type(-127) # 0x81
-    uint8Val = N.Uint8Flags.py_type(0xFF)
-    int16Val = N.Int16Flags.py_type(-32222) # 0x8222
-    uint16Val = N.Uint16Flags.py_type(0xFEEE)
-    int32Val = N.Int32Flags.py_type(overflowingInt32Val)
-    uint32Val = N.Uint32Flags.py_type(0xFDDDDDDD)
-    int64Val = N.Int64Flags.py_type(overflowingInt64Val)
-    uint64Val = N.Uint64Flags.py_type(0xFCCCCCCCCCCCCCCC)
-    # Python uses doubles, so force it here
-    float32Val = N.Float32Flags.py_type(ctypes.c_float(3.14159).value)
-    float64Val = N.Float64Flags.py_type(3.14159265359)
+  binary_type = compat.binary_types[0]  # this will always exist
+  ofInt32Bytes = binary_type([0x83, 0x33, 0x33, 0x33])
+  ofInt64Bytes = binary_type([0x84, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44])
+  overflowingInt32Val = flatbuffers.encode.Get(flatbuffers.packer.int32,
+                                               ofInt32Bytes, 0)
+  overflowingInt64Val = flatbuffers.encode.Get(flatbuffers.packer.int64,
+                                               ofInt64Bytes, 0)
 
-    def test_fuzz(self):
-        return self.check_once(11, 100)
+  # Values we're testing against: chosen to ensure no bits get chopped
+  # off anywhere, and also be different from eachother.
+  boolVal = True
+  int8Val = N.Int8Flags.py_type(-127)  # 0x81
+  uint8Val = N.Uint8Flags.py_type(0xFF)
+  int16Val = N.Int16Flags.py_type(-32222)  # 0x8222
+  uint16Val = N.Uint16Flags.py_type(0xFEEE)
+  int32Val = N.Int32Flags.py_type(overflowingInt32Val)
+  uint32Val = N.Uint32Flags.py_type(0xFDDDDDDD)
+  int64Val = N.Int64Flags.py_type(overflowingInt64Val)
+  uint64Val = N.Uint64Flags.py_type(0xFCCCCCCCCCCCCCCC)
+  # Python uses doubles, so force it here
+  float32Val = N.Float32Flags.py_type(ctypes.c_float(3.14159).value)
+  float64Val = N.Float64Flags.py_type(3.14159265359)
 
-    def check_once(self, fuzzFields, fuzzObjects):
-        testValuesMax = 11 # hardcoded to the number of scalar types
+  def test_fuzz(self):
+    return self.check_once(11, 100)
 
-        builder = flatbuffers.Builder(0)
-        l = LCG()
+  def check_once(self, fuzzFields, fuzzObjects):
+    testValuesMax = 11  # hardcoded to the number of scalar types
 
-        objects = [0 for _ in compat_range(fuzzObjects)]
+    builder = flatbuffers.Builder(0)
+    l = LCG()
 
-        # Generate fuzzObjects random objects each consisting of
-        # fuzzFields fields, each of a random type.
-        for i in compat_range(fuzzObjects):
-            builder.StartObject(fuzzFields)
+    objects = [0 for _ in compat_range(fuzzObjects)]
 
-            for j in compat_range(fuzzFields):
-                choice = int(l.Next()) % testValuesMax
-                if choice == 0:
-                    builder.PrependBoolSlot(int(j), self.boolVal, False)
-                elif choice == 1:
-                    builder.PrependInt8Slot(int(j), self.int8Val, 0)
-                elif choice == 2:
-                    builder.PrependUint8Slot(int(j), self.uint8Val, 0)
-                elif choice == 3:
-                    builder.PrependInt16Slot(int(j), self.int16Val, 0)
-                elif choice == 4:
-                    builder.PrependUint16Slot(int(j), self.uint16Val, 0)
-                elif choice == 5:
-                    builder.PrependInt32Slot(int(j), self.int32Val, 0)
-                elif choice == 6:
-                    builder.PrependUint32Slot(int(j), self.uint32Val, 0)
-                elif choice == 7:
-                    builder.PrependInt64Slot(int(j), self.int64Val, 0)
-                elif choice == 8:
-                    builder.PrependUint64Slot(int(j), self.uint64Val, 0)
-                elif choice == 9:
-                    builder.PrependFloat32Slot(int(j), self.float32Val, 0)
-                elif choice == 10:
-                    builder.PrependFloat64Slot(int(j), self.float64Val, 0)
-                else:
-                    raise RuntimeError('unreachable')
+    # Generate fuzzObjects random objects each consisting of
+    # fuzzFields fields, each of a random type.
+    for i in compat_range(fuzzObjects):
+      builder.StartObject(fuzzFields)
 
-            off = builder.EndObject()
+      for j in compat_range(fuzzFields):
+        choice = int(l.Next()) % testValuesMax
+        if choice == 0:
+          builder.PrependBoolSlot(int(j), self.boolVal, False)
+        elif choice == 1:
+          builder.PrependInt8Slot(int(j), self.int8Val, 0)
+        elif choice == 2:
+          builder.PrependUint8Slot(int(j), self.uint8Val, 0)
+        elif choice == 3:
+          builder.PrependInt16Slot(int(j), self.int16Val, 0)
+        elif choice == 4:
+          builder.PrependUint16Slot(int(j), self.uint16Val, 0)
+        elif choice == 5:
+          builder.PrependInt32Slot(int(j), self.int32Val, 0)
+        elif choice == 6:
+          builder.PrependUint32Slot(int(j), self.uint32Val, 0)
+        elif choice == 7:
+          builder.PrependInt64Slot(int(j), self.int64Val, 0)
+        elif choice == 8:
+          builder.PrependUint64Slot(int(j), self.uint64Val, 0)
+        elif choice == 9:
+          builder.PrependFloat32Slot(int(j), self.float32Val, 0)
+        elif choice == 10:
+          builder.PrependFloat64Slot(int(j), self.float64Val, 0)
+        else:
+          raise RuntimeError('unreachable')
 
-            # store the offset from the end of the builder buffer,
-            # since it will keep growing:
-            objects[i] = off
+      off = builder.EndObject()
 
-        # Do some bookkeeping to generate stats on fuzzes:
-        stats = defaultdict(int)
-        def check(table, desc, want, got):
-            stats[desc] += 1
-            self.assertEqual(want, got, "%s != %s, %s" % (want, got, desc))
+      # store the offset from the end of the builder buffer,
+      # since it will keep growing:
+      objects[i] = off
 
-        l = LCG()  # Reset.
+    # Do some bookkeeping to generate stats on fuzzes:
+    stats = defaultdict(int)
 
-        # Test that all objects we generated are readable and return the
-        # expected values. We generate random objects in the same order
-        # so this is deterministic.
-        for i in compat_range(fuzzObjects):
+    def check(table, desc, want, got):
+      stats[desc] += 1
+      self.assertEqual(want, got, '%s != %s, %s' % (want, got, desc))
 
-            table = flatbuffers.table.Table(builder.Bytes,
-                                            len(builder.Bytes) - objects[i])
+    l = LCG()  # Reset.
 
-            for j in compat_range(fuzzFields):
-                field_count = flatbuffers.builder.VtableMetadataFields + j
-                f = N.VOffsetTFlags.py_type(field_count *
-                                            N.VOffsetTFlags.bytewidth)
-                choice = int(l.Next()) % testValuesMax
+    # Test that all objects we generated are readable and return the
+    # expected values. We generate random objects in the same order
+    # so this is deterministic.
+    for i in compat_range(fuzzObjects):
 
-                if choice == 0:
-                    check(table, "bool", self.boolVal,
-                          table.GetSlot(f, False, N.BoolFlags))
-                elif choice == 1:
-                    check(table, "int8", self.int8Val,
-                          table.GetSlot(f, 0, N.Int8Flags))
-                elif choice == 2:
-                    check(table, "uint8", self.uint8Val,
-                          table.GetSlot(f, 0, N.Uint8Flags))
-                elif choice == 3:
-                    check(table, "int16", self.int16Val,
-                          table.GetSlot(f, 0, N.Int16Flags))
-                elif choice == 4:
-                    check(table, "uint16", self.uint16Val,
-                          table.GetSlot(f, 0, N.Uint16Flags))
-                elif choice == 5:
-                    check(table, "int32", self.int32Val,
-                          table.GetSlot(f, 0, N.Int32Flags))
-                elif choice == 6:
-                    check(table, "uint32", self.uint32Val,
-                          table.GetSlot(f, 0, N.Uint32Flags))
-                elif choice == 7:
-                    check(table, "int64", self.int64Val,
-                          table.GetSlot(f, 0, N.Int64Flags))
-                elif choice == 8:
-                    check(table, "uint64", self.uint64Val,
-                          table.GetSlot(f, 0, N.Uint64Flags))
-                elif choice == 9:
-                    check(table, "float32", self.float32Val,
-                          table.GetSlot(f, 0, N.Float32Flags))
-                elif choice == 10:
-                    check(table, "float64", self.float64Val,
-                          table.GetSlot(f, 0, N.Float64Flags))
-                else:
-                    raise RuntimeError('unreachable')
+      table = flatbuffers.table.Table(builder.Bytes,
+                                      len(builder.Bytes) - objects[i])
 
-        # If enough checks were made, verify that all scalar types were used:
-        self.assertEqual(testValuesMax, len(stats),
-                "fuzzing failed to test all scalar types: %s" % stats)
+      for j in compat_range(fuzzFields):
+        field_count = flatbuffers.builder.VtableMetadataFields + j
+        f = N.VOffsetTFlags.py_type(field_count * N.VOffsetTFlags.bytewidth)
+        choice = int(l.Next()) % testValuesMax
+
+        if choice == 0:
+          check(table, 'bool', self.boolVal,
+                table.GetSlot(f, False, N.BoolFlags))
+        elif choice == 1:
+          check(table, 'int8', self.int8Val, table.GetSlot(f, 0, N.Int8Flags))
+        elif choice == 2:
+          check(table, 'uint8', self.uint8Val,
+                table.GetSlot(f, 0, N.Uint8Flags))
+        elif choice == 3:
+          check(table, 'int16', self.int16Val,
+                table.GetSlot(f, 0, N.Int16Flags))
+        elif choice == 4:
+          check(table, 'uint16', self.uint16Val,
+                table.GetSlot(f, 0, N.Uint16Flags))
+        elif choice == 5:
+          check(table, 'int32', self.int32Val,
+                table.GetSlot(f, 0, N.Int32Flags))
+        elif choice == 6:
+          check(table, 'uint32', self.uint32Val,
+                table.GetSlot(f, 0, N.Uint32Flags))
+        elif choice == 7:
+          check(table, 'int64', self.int64Val,
+                table.GetSlot(f, 0, N.Int64Flags))
+        elif choice == 8:
+          check(table, 'uint64', self.uint64Val,
+                table.GetSlot(f, 0, N.Uint64Flags))
+        elif choice == 9:
+          check(table, 'float32', self.float32Val,
+                table.GetSlot(f, 0, N.Float32Flags))
+        elif choice == 10:
+          check(table, 'float64', self.float64Val,
+                table.GetSlot(f, 0, N.Float64Flags))
+        else:
+          raise RuntimeError('unreachable')
+
+    # If enough checks were made, verify that all scalar types were used:
+    self.assertEqual(testValuesMax, len(stats),
+                     'fuzzing failed to test all scalar types: %s' % stats)
 
 
 class TestByteLayout(unittest.TestCase):
-    ''' TestByteLayout checks the bytes of a Builder in various scenarios. '''
+  """ TestByteLayout checks the bytes of a Builder in various scenarios. """
 
-    def assertBuilderEquals(self, builder, want_chars_or_ints):
-        def integerize(x):
-            if isinstance(x, compat.string_types):
-                return ord(x)
-            return x
+  def assertBuilderEquals(self, builder, want_chars_or_ints):
 
-        want_ints = list(map(integerize, want_chars_or_ints))
-        want = bytearray(want_ints)
-        got = builder.Bytes[builder.Head():] # use the buffer directly
-        self.assertEqual(want, got)
+    def integerize(x):
+      if isinstance(x, compat.string_types):
+        return ord(x)
+      return x
 
-    def test_numbers(self):
-        b = flatbuffers.Builder(0)
-        self.assertBuilderEquals(b, [])
-        b.PrependBool(True)
-        self.assertBuilderEquals(b, [1])
-        b.PrependInt8(-127)
-        self.assertBuilderEquals(b, [129, 1])
-        b.PrependUint8(255)
-        self.assertBuilderEquals(b, [255, 129, 1])
-        b.PrependInt16(-32222)
-        self.assertBuilderEquals(b, [0x22, 0x82, 0, 255, 129, 1]) # first pad
-        b.PrependUint16(0xFEEE)
-        # no pad this time:
-        self.assertBuilderEquals(b, [0xEE, 0xFE, 0x22, 0x82, 0, 255, 129, 1])
-        b.PrependInt32(-53687092)
-        self.assertBuilderEquals(b, [204, 204, 204, 252, 0xEE, 0xFE,
-                                     0x22, 0x82, 0, 255, 129, 1])
-        b.PrependUint32(0x98765432)
-        self.assertBuilderEquals(b, [0x32, 0x54, 0x76, 0x98,
-                                     204, 204, 204, 252,
-                                     0xEE, 0xFE, 0x22, 0x82,
-                                     0, 255, 129, 1])
+    want_ints = list(map(integerize, want_chars_or_ints))
+    want = bytearray(want_ints)
+    got = builder.Bytes[builder.Head():]  # use the buffer directly
+    self.assertEqual(want, got)
 
-    def test_numbers64(self):
-        b = flatbuffers.Builder(0)
-        b.PrependUint64(0x1122334455667788)
-        self.assertBuilderEquals(b, [0x88, 0x77, 0x66, 0x55,
-                                     0x44, 0x33, 0x22, 0x11])
+  def test_numbers(self):
+    b = flatbuffers.Builder(0)
+    self.assertBuilderEquals(b, [])
+    b.PrependBool(True)
+    self.assertBuilderEquals(b, [1])
+    b.PrependInt8(-127)
+    self.assertBuilderEquals(b, [129, 1])
+    b.PrependUint8(255)
+    self.assertBuilderEquals(b, [255, 129, 1])
+    b.PrependInt16(-32222)
+    self.assertBuilderEquals(b, [0x22, 0x82, 0, 255, 129, 1])  # first pad
+    b.PrependUint16(0xFEEE)
+    # no pad this time:
+    self.assertBuilderEquals(b, [0xEE, 0xFE, 0x22, 0x82, 0, 255, 129, 1])
+    b.PrependInt32(-53687092)
+    self.assertBuilderEquals(
+        b, [204, 204, 204, 252, 0xEE, 0xFE, 0x22, 0x82, 0, 255, 129, 1])
+    b.PrependUint32(0x98765432)
+    self.assertBuilderEquals(b, [
+        0x32, 0x54, 0x76, 0x98, 204, 204, 204, 252, 0xEE, 0xFE, 0x22, 0x82, 0,
+        255, 129, 1
+    ])
 
-        b = flatbuffers.Builder(0)
-        b.PrependInt64(0x1122334455667788)
-        self.assertBuilderEquals(b, [0x88, 0x77, 0x66, 0x55,
-                                     0x44, 0x33, 0x22, 0x11])
+  def test_numbers64(self):
+    b = flatbuffers.Builder(0)
+    b.PrependUint64(0x1122334455667788)
+    self.assertBuilderEquals(b,
+                             [0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11])
 
-    def test_1xbyte_vector(self):
-        b = flatbuffers.Builder(0)
-        self.assertBuilderEquals(b, [])
-        b.StartVector(flatbuffers.number_types.Uint8Flags.bytewidth, 1, 1)
-        self.assertBuilderEquals(b, [0, 0, 0]) # align to 4bytes
-        b.PrependByte(1)
-        self.assertBuilderEquals(b, [1, 0, 0, 0])
-        b.EndVector(1)
-        self.assertBuilderEquals(b, [1, 0, 0, 0, 1, 0, 0, 0]) # padding
+    b = flatbuffers.Builder(0)
+    b.PrependInt64(0x1122334455667788)
+    self.assertBuilderEquals(b,
+                             [0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11])
 
-    def test_2xbyte_vector(self):
-        b = flatbuffers.Builder(0)
-        b.StartVector(flatbuffers.number_types.Uint8Flags.bytewidth, 2, 1)
-        self.assertBuilderEquals(b, [0, 0]) # align to 4bytes
-        b.PrependByte(1)
-        self.assertBuilderEquals(b, [1, 0, 0])
-        b.PrependByte(2)
-        self.assertBuilderEquals(b, [2, 1, 0, 0])
-        b.EndVector(2)
-        self.assertBuilderEquals(b, [2, 0, 0, 0, 2, 1, 0, 0]) # padding
+  def test_1xbyte_vector(self):
+    b = flatbuffers.Builder(0)
+    self.assertBuilderEquals(b, [])
+    b.StartVector(flatbuffers.number_types.Uint8Flags.bytewidth, 1, 1)
+    self.assertBuilderEquals(b, [0, 0, 0])  # align to 4bytes
+    b.PrependByte(1)
+    self.assertBuilderEquals(b, [1, 0, 0, 0])
+    b.EndVector()
+    self.assertBuilderEquals(b, [1, 0, 0, 0, 1, 0, 0, 0])  # padding
 
-    def test_1xuint16_vector(self):
-        b = flatbuffers.Builder(0)
-        b.StartVector(flatbuffers.number_types.Uint16Flags.bytewidth, 1, 1)
-        self.assertBuilderEquals(b, [0, 0]) # align to 4bytes
-        b.PrependUint16(1)
-        self.assertBuilderEquals(b, [1, 0, 0, 0])
-        b.EndVector(1)
-        self.assertBuilderEquals(b, [1, 0, 0, 0, 1, 0, 0, 0]) # padding
+  def test_2xbyte_vector(self):
+    b = flatbuffers.Builder(0)
+    b.StartVector(flatbuffers.number_types.Uint8Flags.bytewidth, 2, 1)
+    self.assertBuilderEquals(b, [0, 0])  # align to 4bytes
+    b.PrependByte(1)
+    self.assertBuilderEquals(b, [1, 0, 0])
+    b.PrependByte(2)
+    self.assertBuilderEquals(b, [2, 1, 0, 0])
+    b.EndVector()
+    self.assertBuilderEquals(b, [2, 0, 0, 0, 2, 1, 0, 0])  # padding
 
-    def test_2xuint16_vector(self):
-        b = flatbuffers.Builder(0)
-        b.StartVector(flatbuffers.number_types.Uint16Flags.bytewidth, 2, 1)
-        self.assertBuilderEquals(b, []) # align to 4bytes
-        b.PrependUint16(0xABCD)
-        self.assertBuilderEquals(b, [0xCD, 0xAB])
-        b.PrependUint16(0xDCBA)
-        self.assertBuilderEquals(b, [0xBA, 0xDC, 0xCD, 0xAB])
-        b.EndVector(2)
-        self.assertBuilderEquals(b, [2, 0, 0, 0, 0xBA, 0xDC, 0xCD, 0xAB])
+  def test_1xuint16_vector(self):
+    b = flatbuffers.Builder(0)
+    b.StartVector(flatbuffers.number_types.Uint16Flags.bytewidth, 1, 1)
+    self.assertBuilderEquals(b, [0, 0])  # align to 4bytes
+    b.PrependUint16(1)
+    self.assertBuilderEquals(b, [1, 0, 0, 0])
+    b.EndVector()
+    self.assertBuilderEquals(b, [1, 0, 0, 0, 1, 0, 0, 0])  # padding
 
-    def test_create_ascii_string(self):
-        b = flatbuffers.Builder(0)
-        b.CreateString(u"foo", encoding='ascii')
+  def test_2xuint16_vector(self):
+    b = flatbuffers.Builder(0)
+    b.StartVector(flatbuffers.number_types.Uint16Flags.bytewidth, 2, 1)
+    self.assertBuilderEquals(b, [])  # align to 4bytes
+    b.PrependUint16(0xABCD)
+    self.assertBuilderEquals(b, [0xCD, 0xAB])
+    b.PrependUint16(0xDCBA)
+    self.assertBuilderEquals(b, [0xBA, 0xDC, 0xCD, 0xAB])
+    b.EndVector()
+    self.assertBuilderEquals(b, [2, 0, 0, 0, 0xBA, 0xDC, 0xCD, 0xAB])
 
-        # 0-terminated, no pad:
-        self.assertBuilderEquals(b, [3, 0, 0, 0, 'f', 'o', 'o', 0])
-        b.CreateString(u"moop", encoding='ascii')
-        # 0-terminated, 3-byte pad:
-        self.assertBuilderEquals(b, [4, 0, 0, 0, 'm', 'o', 'o', 'p',
-                                     0, 0, 0, 0,
-                                     3, 0, 0, 0, 'f', 'o', 'o', 0])
+  def test_create_ascii_string(self):
+    b = flatbuffers.Builder(0)
+    b.CreateString(u'foo', encoding='ascii')
 
-    def test_create_utf8_string(self):
-        b = flatbuffers.Builder(0)
-        b.CreateString(u"Цлїςσδε")
-        self.assertBuilderEquals(b, "\x0e\x00\x00\x00\xd0\xa6\xd0\xbb\xd1\x97" \
-            "\xcf\x82\xcf\x83\xce\xb4\xce\xb5\x00\x00")
+    # 0-terminated, no pad:
+    self.assertBuilderEquals(b, [3, 0, 0, 0, 'f', 'o', 'o', 0])
+    b.CreateString(u'moop', encoding='ascii')
+    # 0-terminated, 3-byte pad:
+    self.assertBuilderEquals(b, [
+        4, 0, 0, 0, 'm', 'o', 'o', 'p', 0, 0, 0, 0, 3, 0, 0, 0, 'f', 'o', 'o', 0
+    ])
 
-        b.CreateString(u"フムアムカモケモ")
-        self.assertBuilderEquals(b, "\x18\x00\x00\x00\xef\xbe\x8c\xef\xbe\x91" \
-            "\xef\xbd\xb1\xef\xbe\x91\xef\xbd\xb6\xef\xbe\x93\xef\xbd\xb9\xef" \
-            "\xbe\x93\x00\x00\x00\x00\x0e\x00\x00\x00\xd0\xa6\xd0\xbb\xd1\x97" \
-            "\xcf\x82\xcf\x83\xce\xb4\xce\xb5\x00\x00")
+  def test_create_utf8_string(self):
+    b = flatbuffers.Builder(0)
+    b.CreateString(u'Цлїςσδε')
+    self.assertBuilderEquals(b, '\x0e\x00\x00\x00\xd0\xa6\xd0\xbb\xd1\x97' \
+        '\xcf\x82\xcf\x83\xce\xb4\xce\xb5\x00\x00')
 
-    def test_create_arbitrary_string(self):
-        b = flatbuffers.Builder(0)
-        s = "\x01\x02\x03"
-        b.CreateString(s) # Default encoding is utf-8.
-        # 0-terminated, no pad:
-        self.assertBuilderEquals(b, [3, 0, 0, 0, 1, 2, 3, 0])
-        s2 = "\x04\x05\x06\x07"
-        b.CreateString(s2) # Default encoding is utf-8.
-        # 0-terminated, 3-byte pad:
-        self.assertBuilderEquals(b, [4, 0, 0, 0, 4, 5, 6, 7, 0, 0, 0, 0,
-                                     3, 0, 0, 0, 1, 2, 3, 0])
+    b.CreateString(u'フムアムカモケモ')
+    self.assertBuilderEquals(b, '\x18\x00\x00\x00\xef\xbe\x8c\xef\xbe\x91' \
+        '\xef\xbd\xb1\xef\xbe\x91\xef\xbd\xb6\xef\xbe\x93\xef\xbd\xb9\xef' \
+        '\xbe\x93\x00\x00\x00\x00\x0e\x00\x00\x00\xd0\xa6\xd0\xbb\xd1\x97' \
+        '\xcf\x82\xcf\x83\xce\xb4\xce\xb5\x00\x00')
 
-    def test_create_byte_vector(self):
-        b = flatbuffers.Builder(0)
-        b.CreateByteVector(b"")
-        # 0-byte pad:
-        self.assertBuilderEquals(b, [0, 0, 0, 0])
+  def test_create_arbitrary_string(self):
+    b = flatbuffers.Builder(0)
+    s = '\x01\x02\x03'
+    b.CreateString(s)  # Default encoding is utf-8.
+    # 0-terminated, no pad:
+    self.assertBuilderEquals(b, [3, 0, 0, 0, 1, 2, 3, 0])
+    s2 = '\x04\x05\x06\x07'
+    b.CreateString(s2)  # Default encoding is utf-8.
+    # 0-terminated, 3-byte pad:
+    self.assertBuilderEquals(
+        b, [4, 0, 0, 0, 4, 5, 6, 7, 0, 0, 0, 0, 3, 0, 0, 0, 1, 2, 3, 0])
 
-        b = flatbuffers.Builder(0)
-        b.CreateByteVector(b"\x01\x02\x03")
-        # 1-byte pad:
-        self.assertBuilderEquals(b, [3, 0, 0, 0, 1, 2, 3, 0])
+  def test_create_byte_vector(self):
+    b = flatbuffers.Builder(0)
+    b.CreateByteVector(b'')
+    # 0-byte pad:
+    self.assertBuilderEquals(b, [0, 0, 0, 0])
 
-    def test_create_numpy_vector_int8(self):
-        try:
-            imp.find_module('numpy')
-            # if numpy exists, then we should be able to get the
-            # vector as a numpy array
-            import numpy as np
+    b = flatbuffers.Builder(0)
+    b.CreateByteVector(b'\x01\x02\x03')
+    # 1-byte pad:
+    self.assertBuilderEquals(b, [3, 0, 0, 0, 1, 2, 3, 0])
 
-            # Systems endian:
-            b = flatbuffers.Builder(0)
-            x = np.array([1, 2, -3], dtype=np.int8)
-            b.CreateNumpyVector(x)
-            self.assertBuilderEquals(b, [
-                3, 0, 0, 0,  # vector length
-                1, 2, 256 - 3, 0   # vector value + padding
-            ])
+  def test_create_numpy_vector_int8(self):
+    try:
+      imp.find_module('numpy')
+      # if numpy exists, then we should be able to get the
+      # vector as a numpy array
+      import numpy as np
 
-            # Reverse endian:
-            b = flatbuffers.Builder(0)
-            x_other_endian = x.byteswap().newbyteorder()
-            b.CreateNumpyVector(x_other_endian)
-            self.assertBuilderEquals(b, [
-                3, 0, 0, 0,  # vector length
-                1, 2, 256 - 3, 0   # vector value + padding
-            ])
-        except ImportError:
-            b = flatbuffers.Builder(0)
-            x = 0
-            assertRaises(
-                self,
-                lambda: b.CreateNumpyVector(x),
-                NumpyRequiredForThisFeature)
+      # Systems endian:
+      b = flatbuffers.Builder(0)
+      x = np.array([1, 2, -3], dtype=np.int8)
+      b.CreateNumpyVector(x)
+      self.assertBuilderEquals(
+          b,
+          [
+              3,
+              0,
+              0,
+              0,  # vector length
+              1,
+              2,
+              256 - 3,
+              0  # vector value + padding
+          ])
 
-    def test_create_numpy_vector_uint16(self):
-        try:
-            imp.find_module('numpy')
-            # if numpy exists, then we should be able to get the
-            # vector as a numpy array
-            import numpy as np
+      # Reverse endian:
+      b = flatbuffers.Builder(0)
+      x_other_endian = x.byteswap().newbyteorder()
+      b.CreateNumpyVector(x_other_endian)
+      self.assertBuilderEquals(
+          b,
+          [
+              3,
+              0,
+              0,
+              0,  # vector length
+              1,
+              2,
+              256 - 3,
+              0  # vector value + padding
+          ])
+    except ImportError:
+      b = flatbuffers.Builder(0)
+      x = 0
+      assertRaises(self, lambda: b.CreateNumpyVector(x),
+                   NumpyRequiredForThisFeature)
 
-            # Systems endian:
-            b = flatbuffers.Builder(0)
-            x = np.array([1, 2, 312], dtype=np.uint16)
-            b.CreateNumpyVector(x)
-            self.assertBuilderEquals(b, [
-                3, 0, 0, 0,     # vector length
-                1, 0,           # 1
-                2, 0,           # 2
-                312 - 256, 1,   # 312
-                0, 0            # padding
-            ])
+  def test_create_numpy_vector_uint16(self):
+    try:
+      imp.find_module('numpy')
+      # if numpy exists, then we should be able to get the
+      # vector as a numpy array
+      import numpy as np
 
-            # Reverse endian:
-            b = flatbuffers.Builder(0)
-            x_other_endian = x.byteswap().newbyteorder()
-            b.CreateNumpyVector(x_other_endian)
-            self.assertBuilderEquals(b, [
-                3, 0, 0, 0,     # vector length
-                1, 0,           # 1
-                2, 0,           # 2
-                312 - 256, 1,   # 312
-                0, 0            # padding
-            ])
-        except ImportError:
-            b = flatbuffers.Builder(0)
-            x = 0
-            assertRaises(
-                self,
-                lambda: b.CreateNumpyVector(x),
-                NumpyRequiredForThisFeature)
+      # Systems endian:
+      b = flatbuffers.Builder(0)
+      x = np.array([1, 2, 312], dtype=np.uint16)
+      b.CreateNumpyVector(x)
+      self.assertBuilderEquals(
+          b,
+          [
+              3,
+              0,
+              0,
+              0,  # vector length
+              1,
+              0,  # 1
+              2,
+              0,  # 2
+              312 - 256,
+              1,  # 312
+              0,
+              0  # padding
+          ])
 
-    def test_create_numpy_vector_int64(self):
-        try:
-            imp.find_module('numpy')
-            # if numpy exists, then we should be able to get the
-            # vector as a numpy array
-            import numpy as np
+      # Reverse endian:
+      b = flatbuffers.Builder(0)
+      x_other_endian = x.byteswap().newbyteorder()
+      b.CreateNumpyVector(x_other_endian)
+      self.assertBuilderEquals(
+          b,
+          [
+              3,
+              0,
+              0,
+              0,  # vector length
+              1,
+              0,  # 1
+              2,
+              0,  # 2
+              312 - 256,
+              1,  # 312
+              0,
+              0  # padding
+          ])
+    except ImportError:
+      b = flatbuffers.Builder(0)
+      x = 0
+      assertRaises(self, lambda: b.CreateNumpyVector(x),
+                   NumpyRequiredForThisFeature)
 
-            # Systems endian:
-            b = flatbuffers.Builder(0)
-            x = np.array([1, 2, -12], dtype=np.int64)
-            b.CreateNumpyVector(x)
-            self.assertBuilderEquals(b, [
-                3, 0, 0, 0,                     # vector length
-                1, 0, 0, 0, 0, 0, 0, 0,         # 1
-                2, 0, 0, 0, 0, 0, 0, 0,         # 2
-                256 - 12, 255, 255, 255, 255, 255, 255, 255   # -12
-            ])
+  def test_create_numpy_vector_int64(self):
+    try:
+      imp.find_module('numpy')
+      # if numpy exists, then we should be able to get the
+      # vector as a numpy array
+      import numpy as np
 
-            # Reverse endian:
-            b = flatbuffers.Builder(0)
-            x_other_endian = x.byteswap().newbyteorder()
-            b.CreateNumpyVector(x_other_endian)
-            self.assertBuilderEquals(b, [
-                3, 0, 0, 0,                     # vector length
-                1, 0, 0, 0, 0, 0, 0, 0,         # 1
-                2, 0, 0, 0, 0, 0, 0, 0,         # 2
-                256 - 12, 255, 255, 255, 255, 255, 255, 255   # -12
-            ])
+      # Systems endian:
+      b = flatbuffers.Builder(0)
+      x = np.array([1, 2, -12], dtype=np.int64)
+      b.CreateNumpyVector(x)
+      self.assertBuilderEquals(
+          b,
+          [
+              3,
+              0,
+              0,
+              0,  # vector length
+              1,
+              0,
+              0,
+              0,
+              0,
+              0,
+              0,
+              0,  # 1
+              2,
+              0,
+              0,
+              0,
+              0,
+              0,
+              0,
+              0,  # 2
+              256 - 12,
+              255,
+              255,
+              255,
+              255,
+              255,
+              255,
+              255  # -12
+          ])
 
-        except ImportError:
-            b = flatbuffers.Builder(0)
-            x = 0
-            assertRaises(
-                self,
-                lambda: b.CreateNumpyVector(x),
-                NumpyRequiredForThisFeature)
+      # Reverse endian:
+      b = flatbuffers.Builder(0)
+      x_other_endian = x.byteswap().newbyteorder()
+      b.CreateNumpyVector(x_other_endian)
+      self.assertBuilderEquals(
+          b,
+          [
+              3,
+              0,
+              0,
+              0,  # vector length
+              1,
+              0,
+              0,
+              0,
+              0,
+              0,
+              0,
+              0,  # 1
+              2,
+              0,
+              0,
+              0,
+              0,
+              0,
+              0,
+              0,  # 2
+              256 - 12,
+              255,
+              255,
+              255,
+              255,
+              255,
+              255,
+              255  # -12
+          ])
 
-    def test_create_numpy_vector_float32(self):
-        try:
-            imp.find_module('numpy')
-            # if numpy exists, then we should be able to get the
-            # vector as a numpy array
-            import numpy as np
+    except ImportError:
+      b = flatbuffers.Builder(0)
+      x = 0
+      assertRaises(self, lambda: b.CreateNumpyVector(x),
+                   NumpyRequiredForThisFeature)
 
-            # Systems endian:
-            b = flatbuffers.Builder(0)
-            x = np.array([1, 2, -12], dtype=np.float32)
-            b.CreateNumpyVector(x)
-            self.assertBuilderEquals(b, [
-                3, 0, 0, 0,                     # vector length
-                0, 0, 128, 63,                  # 1
-                0, 0, 0, 64,                    # 2
-                0, 0, 64, 193                   # -12
-            ])
+  def test_create_numpy_vector_float32(self):
+    try:
+      imp.find_module('numpy')
+      # if numpy exists, then we should be able to get the
+      # vector as a numpy array
+      import numpy as np
 
-            # Reverse endian:
-            b = flatbuffers.Builder(0)
-            x_other_endian = x.byteswap().newbyteorder()
-            b.CreateNumpyVector(x_other_endian)
-            self.assertBuilderEquals(b, [
-                3, 0, 0, 0,                     # vector length
-                0, 0, 128, 63,                  # 1
-                0, 0, 0, 64,                    # 2
-                0, 0, 64, 193                   # -12
-            ])
+      # Systems endian:
+      b = flatbuffers.Builder(0)
+      x = np.array([1, 2, -12], dtype=np.float32)
+      b.CreateNumpyVector(x)
+      self.assertBuilderEquals(
+          b,
+          [
+              3,
+              0,
+              0,
+              0,  # vector length
+              0,
+              0,
+              128,
+              63,  # 1
+              0,
+              0,
+              0,
+              64,  # 2
+              0,
+              0,
+              64,
+              193  # -12
+          ])
 
-        except ImportError:
-            b = flatbuffers.Builder(0)
-            x = 0
-            assertRaises(
-                self,
-                lambda: b.CreateNumpyVector(x),
-                NumpyRequiredForThisFeature)
+      # Reverse endian:
+      b = flatbuffers.Builder(0)
+      x_other_endian = x.byteswap().newbyteorder()
+      b.CreateNumpyVector(x_other_endian)
+      self.assertBuilderEquals(
+          b,
+          [
+              3,
+              0,
+              0,
+              0,  # vector length
+              0,
+              0,
+              128,
+              63,  # 1
+              0,
+              0,
+              0,
+              64,  # 2
+              0,
+              0,
+              64,
+              193  # -12
+          ])
 
-    def test_create_numpy_vector_float64(self):
-        try:
-            imp.find_module('numpy')
-            # if numpy exists, then we should be able to get the
-            # vector as a numpy array
-            import numpy as np
+    except ImportError:
+      b = flatbuffers.Builder(0)
+      x = 0
+      assertRaises(self, lambda: b.CreateNumpyVector(x),
+                   NumpyRequiredForThisFeature)
 
-            # Systems endian:
-            b = flatbuffers.Builder(0)
-            x = np.array([1, 2, -12], dtype=np.float64)
-            b.CreateNumpyVector(x)
-            self.assertBuilderEquals(b, [
-                3, 0, 0, 0,                     # vector length
-                0, 0, 0, 0, 0, 0, 240, 63,                  # 1
-                0, 0, 0, 0, 0, 0, 0, 64,                    # 2
-                0, 0, 0, 0, 0, 0, 40, 192                   # -12
-            ])
+  def test_create_numpy_vector_float64(self):
+    try:
+      imp.find_module('numpy')
+      # if numpy exists, then we should be able to get the
+      # vector as a numpy array
+      import numpy as np
 
-            # Reverse endian:
-            b = flatbuffers.Builder(0)
-            x_other_endian = x.byteswap().newbyteorder()
-            b.CreateNumpyVector(x_other_endian)
-            self.assertBuilderEquals(b, [
-                3, 0, 0, 0,                     # vector length
-                0, 0, 0, 0, 0, 0, 240, 63,                  # 1
-                0, 0, 0, 0, 0, 0, 0, 64,                    # 2
-                0, 0, 0, 0, 0, 0, 40, 192                   # -12
-            ])
+      # Systems endian:
+      b = flatbuffers.Builder(0)
+      x = np.array([1, 2, -12], dtype=np.float64)
+      b.CreateNumpyVector(x)
+      self.assertBuilderEquals(
+          b,
+          [
+              3,
+              0,
+              0,
+              0,  # vector length
+              0,
+              0,
+              0,
+              0,
+              0,
+              0,
+              240,
+              63,  # 1
+              0,
+              0,
+              0,
+              0,
+              0,
+              0,
+              0,
+              64,  # 2
+              0,
+              0,
+              0,
+              0,
+              0,
+              0,
+              40,
+              192  # -12
+          ])
 
-        except ImportError:
-            b = flatbuffers.Builder(0)
-            x = 0
-            assertRaises(
-                self,
-                lambda: b.CreateNumpyVector(x),
-                NumpyRequiredForThisFeature)
+      # Reverse endian:
+      b = flatbuffers.Builder(0)
+      x_other_endian = x.byteswap().newbyteorder()
+      b.CreateNumpyVector(x_other_endian)
+      self.assertBuilderEquals(
+          b,
+          [
+              3,
+              0,
+              0,
+              0,  # vector length
+              0,
+              0,
+              0,
+              0,
+              0,
+              0,
+              240,
+              63,  # 1
+              0,
+              0,
+              0,
+              0,
+              0,
+              0,
+              0,
+              64,  # 2
+              0,
+              0,
+              0,
+              0,
+              0,
+              0,
+              40,
+              192  # -12
+          ])
 
-    def test_create_numpy_vector_bool(self):
-        try:
-            imp.find_module('numpy')
-            # if numpy exists, then we should be able to get the
-            # vector as a numpy array
-            import numpy as np
+    except ImportError:
+      b = flatbuffers.Builder(0)
+      x = 0
+      assertRaises(self, lambda: b.CreateNumpyVector(x),
+                   NumpyRequiredForThisFeature)
 
-            # Systems endian:
-            b = flatbuffers.Builder(0)
-            x = np.array([True, False, True], dtype=np.bool)
-            b.CreateNumpyVector(x)
-            self.assertBuilderEquals(b, [
-                3, 0, 0, 0, # vector length
-                1, 0, 1, 0  # vector values + padding
-            ])
+  def test_create_numpy_vector_bool(self):
+    try:
+      imp.find_module('numpy')
+      # if numpy exists, then we should be able to get the
+      # vector as a numpy array
+      import numpy as np
 
-            # Reverse endian:
-            b = flatbuffers.Builder(0)
-            x_other_endian = x.byteswap().newbyteorder()
-            b.CreateNumpyVector(x_other_endian)
-            self.assertBuilderEquals(b, [
-                3, 0, 0, 0, # vector length
-                1, 0, 1, 0  # vector values + padding
-            ])
+      # Systems endian:
+      b = flatbuffers.Builder(0)
+      x = np.array([True, False, True], dtype=np.bool)
+      b.CreateNumpyVector(x)
+      self.assertBuilderEquals(
+          b,
+          [
+              3,
+              0,
+              0,
+              0,  # vector length
+              1,
+              0,
+              1,
+              0  # vector values + padding
+          ])
 
-        except ImportError:
-            b = flatbuffers.Builder(0)
-            x = 0
-            assertRaises(
-                self,
-                lambda: b.CreateNumpyVector(x),
-                NumpyRequiredForThisFeature)
+      # Reverse endian:
+      b = flatbuffers.Builder(0)
+      x_other_endian = x.byteswap().newbyteorder()
+      b.CreateNumpyVector(x_other_endian)
+      self.assertBuilderEquals(
+          b,
+          [
+              3,
+              0,
+              0,
+              0,  # vector length
+              1,
+              0,
+              1,
+              0  # vector values + padding
+          ])
 
-    def test_create_numpy_vector_reject_strings(self):
-        try:
-            imp.find_module('numpy')
-            # if numpy exists, then we should be able to get the
-            # vector as a numpy array
-            import numpy as np
+    except ImportError:
+      b = flatbuffers.Builder(0)
+      x = 0
+      assertRaises(self, lambda: b.CreateNumpyVector(x),
+                   NumpyRequiredForThisFeature)
 
-            # Create String array
-            b = flatbuffers.Builder(0)
-            x = np.array(["hello", "fb", "testing"])
-            assertRaises(
-                self,
-                lambda: b.CreateNumpyVector(x),
-                TypeError)
+  def test_create_numpy_vector_reject_strings(self):
+    try:
+      imp.find_module('numpy')
+      # if numpy exists, then we should be able to get the
+      # vector as a numpy array
+      import numpy as np
 
-        except ImportError:
-            b = flatbuffers.Builder(0)
-            x = 0
-            assertRaises(
-                self,
-                lambda: b.CreateNumpyVector(x),
-                NumpyRequiredForThisFeature)
+      # Create String array
+      b = flatbuffers.Builder(0)
+      x = np.array(['hello', 'fb', 'testing'])
+      assertRaises(self, lambda: b.CreateNumpyVector(x), TypeError)
 
-    def test_create_numpy_vector_reject_object(self):
-        try:
-            imp.find_module('numpy')
-            # if numpy exists, then we should be able to get the
-            # vector as a numpy array
-            import numpy as np
+    except ImportError:
+      b = flatbuffers.Builder(0)
+      x = 0
+      assertRaises(self, lambda: b.CreateNumpyVector(x),
+                   NumpyRequiredForThisFeature)
 
-            # Create String array
-            b = flatbuffers.Builder(0)
-            x = np.array([{"m": 0}, {"as": -2.1, 'c': 'c'}])
-            assertRaises(
-                self,
-                lambda: b.CreateNumpyVector(x),
-                TypeError)
+  def test_create_numpy_vector_reject_object(self):
+    try:
+      imp.find_module('numpy')
+      # if numpy exists, then we should be able to get the
+      # vector as a numpy array
+      import numpy as np
 
-        except ImportError:
-            b = flatbuffers.Builder(0)
-            x = 0
-            assertRaises(
-                self,
-                lambda: b.CreateNumpyVector(x),
-                NumpyRequiredForThisFeature)
+      # Create String array
+      b = flatbuffers.Builder(0)
+      x = np.array([{'m': 0}, {'as': -2.1, 'c': 'c'}])
+      assertRaises(self, lambda: b.CreateNumpyVector(x), TypeError)
 
-    def test_empty_vtable(self):
-        b = flatbuffers.Builder(0)
-        b.StartObject(0)
-        self.assertBuilderEquals(b, [])
-        b.EndObject()
-        self.assertBuilderEquals(b, [4, 0, 4, 0, 4, 0, 0, 0])
+    except ImportError:
+      b = flatbuffers.Builder(0)
+      x = 0
+      assertRaises(self, lambda: b.CreateNumpyVector(x),
+                   NumpyRequiredForThisFeature)
 
-    def test_vtable_with_one_true_bool(self):
-        b = flatbuffers.Builder(0)
-        self.assertBuilderEquals(b, [])
-        b.StartObject(1)
-        self.assertBuilderEquals(b, [])
-        b.PrependBoolSlot(0, True, False)
-        b.EndObject()
-        self.assertBuilderEquals(b, [
-            6, 0,  # vtable bytes
-            8, 0,  # length of object including vtable offset
-            7, 0,  # start of bool value
-            6, 0, 0, 0,  # offset for start of vtable (int32)
-            0, 0, 0,  # padded to 4 bytes
+  def test_empty_vtable(self):
+    b = flatbuffers.Builder(0)
+    b.StartObject(0)
+    self.assertBuilderEquals(b, [])
+    b.EndObject()
+    self.assertBuilderEquals(b, [4, 0, 4, 0, 4, 0, 0, 0])
+
+  def test_vtable_with_one_true_bool(self):
+    b = flatbuffers.Builder(0)
+    self.assertBuilderEquals(b, [])
+    b.StartObject(1)
+    self.assertBuilderEquals(b, [])
+    b.PrependBoolSlot(0, True, False)
+    b.EndObject()
+    self.assertBuilderEquals(
+        b,
+        [
+            6,
+            0,  # vtable bytes
+            8,
+            0,  # length of object including vtable offset
+            7,
+            0,  # start of bool value
+            6,
+            0,
+            0,
+            0,  # offset for start of vtable (int32)
+            0,
+            0,
+            0,  # padded to 4 bytes
             1,  # bool value
         ])
 
-    def test_vtable_with_one_default_bool(self):
-        b = flatbuffers.Builder(0)
-        self.assertBuilderEquals(b, [])
-        b.StartObject(1)
-        self.assertBuilderEquals(b, [])
-        b.PrependBoolSlot(0, False, False)
-        b.EndObject()
-        self.assertBuilderEquals(b, [
-            4, 0,  # vtable bytes
-            4, 0,  # end of object from here
+  def test_vtable_with_one_default_bool(self):
+    b = flatbuffers.Builder(0)
+    self.assertBuilderEquals(b, [])
+    b.StartObject(1)
+    self.assertBuilderEquals(b, [])
+    b.PrependBoolSlot(0, False, False)
+    b.EndObject()
+    self.assertBuilderEquals(
+        b,
+        [
+            4,
+            0,  # vtable bytes
+            4,
+            0,  # end of object from here
             # entry 1 is zero and not stored
-            4, 0, 0, 0,  # offset for start of vtable (int32)
+            4,
+            0,
+            0,
+            0,  # offset for start of vtable (int32)
         ])
 
-    def test_vtable_with_one_int16(self):
-        b = flatbuffers.Builder(0)
-        b.StartObject(1)
-        b.PrependInt16Slot(0, 0x789A, 0)
-        b.EndObject()
-        self.assertBuilderEquals(b, [
-            6, 0,  # vtable bytes
-            8, 0,  # end of object from here
-            6, 0,  # offset to value
-            6, 0, 0, 0,  # offset for start of vtable (int32)
-            0, 0,  # padding to 4 bytes
-            0x9A, 0x78,
+  def test_vtable_with_one_int16(self):
+    b = flatbuffers.Builder(0)
+    b.StartObject(1)
+    b.PrependInt16Slot(0, 0x789A, 0)
+    b.EndObject()
+    self.assertBuilderEquals(
+        b,
+        [
+            6,
+            0,  # vtable bytes
+            8,
+            0,  # end of object from here
+            6,
+            0,  # offset to value
+            6,
+            0,
+            0,
+            0,  # offset for start of vtable (int32)
+            0,
+            0,  # padding to 4 bytes
+            0x9A,
+            0x78,
         ])
 
-    def test_vtable_with_two_int16(self):
-        b = flatbuffers.Builder(0)
-        b.StartObject(2)
-        b.PrependInt16Slot(0, 0x3456, 0)
-        b.PrependInt16Slot(1, 0x789A, 0)
-        b.EndObject()
-        self.assertBuilderEquals(b, [
-            8, 0,  # vtable bytes
-            8, 0,  # end of object from here
-            6, 0,  # offset to value 0
-            4, 0,  # offset to value 1
-            8, 0, 0, 0,  # offset for start of vtable (int32)
-            0x9A, 0x78,  # value 1
-            0x56, 0x34,  # value 0
+  def test_vtable_with_two_int16(self):
+    b = flatbuffers.Builder(0)
+    b.StartObject(2)
+    b.PrependInt16Slot(0, 0x3456, 0)
+    b.PrependInt16Slot(1, 0x789A, 0)
+    b.EndObject()
+    self.assertBuilderEquals(
+        b,
+        [
+            8,
+            0,  # vtable bytes
+            8,
+            0,  # end of object from here
+            6,
+            0,  # offset to value 0
+            4,
+            0,  # offset to value 1
+            8,
+            0,
+            0,
+            0,  # offset for start of vtable (int32)
+            0x9A,
+            0x78,  # value 1
+            0x56,
+            0x34,  # value 0
         ])
 
-    def test_vtable_with_int16_and_bool(self):
-        b = flatbuffers.Builder(0)
-        b.StartObject(2)
-        b.PrependInt16Slot(0, 0x3456, 0)
-        b.PrependBoolSlot(1, True, False)
-        b.EndObject()
-        self.assertBuilderEquals(b, [
-            8, 0,  # vtable bytes
-            8, 0,  # end of object from here
-            6, 0,  # offset to value 0
-            5, 0,  # offset to value 1
-            8, 0, 0, 0,  # offset for start of vtable (int32)
-            0,          # padding
-            1,          # value 1
-            0x56, 0x34,  # value 0
+  def test_vtable_with_int16_and_bool(self):
+    b = flatbuffers.Builder(0)
+    b.StartObject(2)
+    b.PrependInt16Slot(0, 0x3456, 0)
+    b.PrependBoolSlot(1, True, False)
+    b.EndObject()
+    self.assertBuilderEquals(
+        b,
+        [
+            8,
+            0,  # vtable bytes
+            8,
+            0,  # end of object from here
+            6,
+            0,  # offset to value 0
+            5,
+            0,  # offset to value 1
+            8,
+            0,
+            0,
+            0,  # offset for start of vtable (int32)
+            0,  # padding
+            1,  # value 1
+            0x56,
+            0x34,  # value 0
         ])
 
-    def test_vtable_with_empty_vector(self):
-        b = flatbuffers.Builder(0)
-        b.StartVector(flatbuffers.number_types.Uint8Flags.bytewidth, 0, 1)
-        vecend = b.EndVector(0)
-        b.StartObject(1)
-        b.PrependUOffsetTRelativeSlot(0, vecend, 0)
-        b.EndObject()
-        self.assertBuilderEquals(b, [
-            6, 0,  # vtable bytes
-            8, 0,
-            4, 0,  # offset to vector offset
-            6, 0, 0, 0,  # offset for start of vtable (int32)
-            4, 0, 0, 0,
-            0, 0, 0, 0,  # length of vector (not in struct)
+  def test_vtable_with_empty_vector(self):
+    b = flatbuffers.Builder(0)
+    b.StartVector(flatbuffers.number_types.Uint8Flags.bytewidth, 0, 1)
+    vecend = b.EndVector()
+    b.StartObject(1)
+    b.PrependUOffsetTRelativeSlot(0, vecend, 0)
+    b.EndObject()
+    self.assertBuilderEquals(
+        b,
+        [
+            6,
+            0,  # vtable bytes
+            8,
+            0,
+            4,
+            0,  # offset to vector offset
+            6,
+            0,
+            0,
+            0,  # offset for start of vtable (int32)
+            4,
+            0,
+            0,
+            0,
+            0,
+            0,
+            0,
+            0,  # length of vector (not in struct)
         ])
 
-    def test_vtable_with_empty_vector_of_byte_and_some_scalars(self):
-        b = flatbuffers.Builder(0)
-        b.StartVector(flatbuffers.number_types.Uint8Flags.bytewidth, 0, 1)
-        vecend = b.EndVector(0)
-        b.StartObject(2)
-        b.PrependInt16Slot(0, 55, 0)
-        b.PrependUOffsetTRelativeSlot(1, vecend, 0)
-        b.EndObject()
-        self.assertBuilderEquals(b, [
-            8, 0,  # vtable bytes
-            12, 0,
-            10, 0,  # offset to value 0
-            4, 0,  # offset to vector offset
-            8, 0, 0, 0,  # vtable loc
-            8, 0, 0, 0,  # value 1
-            0, 0, 55, 0,  # value 0
-
-            0, 0, 0, 0,  # length of vector (not in struct)
+  def test_vtable_with_empty_vector_of_byte_and_some_scalars(self):
+    b = flatbuffers.Builder(0)
+    b.StartVector(flatbuffers.number_types.Uint8Flags.bytewidth, 0, 1)
+    vecend = b.EndVector()
+    b.StartObject(2)
+    b.PrependInt16Slot(0, 55, 0)
+    b.PrependUOffsetTRelativeSlot(1, vecend, 0)
+    b.EndObject()
+    self.assertBuilderEquals(
+        b,
+        [
+            8,
+            0,  # vtable bytes
+            12,
+            0,
+            10,
+            0,  # offset to value 0
+            4,
+            0,  # offset to vector offset
+            8,
+            0,
+            0,
+            0,  # vtable loc
+            8,
+            0,
+            0,
+            0,  # value 1
+            0,
+            0,
+            55,
+            0,  # value 0
+            0,
+            0,
+            0,
+            0,  # length of vector (not in struct)
         ])
 
-    def test_vtable_with_1_int16_and_2vector_of_int16(self):
-        b = flatbuffers.Builder(0)
-        b.StartVector(flatbuffers.number_types.Int16Flags.bytewidth, 2, 1)
-        b.PrependInt16(0x1234)
-        b.PrependInt16(0x5678)
-        vecend = b.EndVector(2)
-        b.StartObject(2)
-        b.PrependUOffsetTRelativeSlot(1, vecend, 0)
-        b.PrependInt16Slot(0, 55, 0)
-        b.EndObject()
-        self.assertBuilderEquals(b, [
-            8, 0,  # vtable bytes
-            12, 0,  # length of object
-            6, 0,  # start of value 0 from end of vtable
-            8, 0,  # start of value 1 from end of buffer
-            8, 0, 0, 0,  # offset for start of vtable (int32)
-            0, 0,  # padding
-            55, 0,  # value 0
-            4, 0, 0, 0,  # vector position from here
-            2, 0, 0, 0,  # length of vector (uint32)
-            0x78, 0x56,  # vector value 1
-            0x34, 0x12,  # vector value 0
+  def test_vtable_with_1_int16_and_2vector_of_int16(self):
+    b = flatbuffers.Builder(0)
+    b.StartVector(flatbuffers.number_types.Int16Flags.bytewidth, 2, 1)
+    b.PrependInt16(0x1234)
+    b.PrependInt16(0x5678)
+    vecend = b.EndVector()
+    b.StartObject(2)
+    b.PrependUOffsetTRelativeSlot(1, vecend, 0)
+    b.PrependInt16Slot(0, 55, 0)
+    b.EndObject()
+    self.assertBuilderEquals(
+        b,
+        [
+            8,
+            0,  # vtable bytes
+            12,
+            0,  # length of object
+            6,
+            0,  # start of value 0 from end of vtable
+            8,
+            0,  # start of value 1 from end of buffer
+            8,
+            0,
+            0,
+            0,  # offset for start of vtable (int32)
+            0,
+            0,  # padding
+            55,
+            0,  # value 0
+            4,
+            0,
+            0,
+            0,  # vector position from here
+            2,
+            0,
+            0,
+            0,  # length of vector (uint32)
+            0x78,
+            0x56,  # vector value 1
+            0x34,
+            0x12,  # vector value 0
         ])
 
-    def test_vtable_with_1_struct_of_1_int8__1_int16__1_int32(self):
-        b = flatbuffers.Builder(0)
-        b.StartObject(1)
-        b.Prep(4+4+4, 0)
-        b.PrependInt8(55)
-        b.Pad(3)
-        b.PrependInt16(0x1234)
-        b.Pad(2)
-        b.PrependInt32(0x12345678)
-        structStart = b.Offset()
-        b.PrependStructSlot(0, structStart, 0)
-        b.EndObject()
-        self.assertBuilderEquals(b, [
-            6, 0,  # vtable bytes
-            16, 0,  # end of object from here
-            4, 0,  # start of struct from here
-            6, 0, 0, 0,  # offset for start of vtable (int32)
-            0x78, 0x56, 0x34, 0x12,  # value 2
-            0, 0,  # padding
-            0x34, 0x12,  # value 1
-            0, 0, 0,  # padding
+  def test_vtable_with_1_struct_of_1_int8__1_int16__1_int32(self):
+    b = flatbuffers.Builder(0)
+    b.StartObject(1)
+    b.Prep(4 + 4 + 4, 0)
+    b.PrependInt8(55)
+    b.Pad(3)
+    b.PrependInt16(0x1234)
+    b.Pad(2)
+    b.PrependInt32(0x12345678)
+    structStart = b.Offset()
+    b.PrependStructSlot(0, structStart, 0)
+    b.EndObject()
+    self.assertBuilderEquals(
+        b,
+        [
+            6,
+            0,  # vtable bytes
+            16,
+            0,  # end of object from here
+            4,
+            0,  # start of struct from here
+            6,
+            0,
+            0,
+            0,  # offset for start of vtable (int32)
+            0x78,
+            0x56,
+            0x34,
+            0x12,  # value 2
+            0,
+            0,  # padding
+            0x34,
+            0x12,  # value 1
+            0,
+            0,
+            0,  # padding
             55,  # value 0
         ])
 
-    def test_vtable_with_1_vector_of_2_struct_of_2_int8(self):
-        b = flatbuffers.Builder(0)
-        b.StartVector(flatbuffers.number_types.Int8Flags.bytewidth*2, 2, 1)
-        b.PrependInt8(33)
-        b.PrependInt8(44)
-        b.PrependInt8(55)
-        b.PrependInt8(66)
-        vecend = b.EndVector(2)
-        b.StartObject(1)
-        b.PrependUOffsetTRelativeSlot(0, vecend, 0)
-        b.EndObject()
-        self.assertBuilderEquals(b, [
-            6, 0,  # vtable bytes
-            8, 0,
-            4, 0,  # offset of vector offset
-            6, 0, 0, 0,  # offset for start of vtable (int32)
-            4, 0, 0, 0,  # vector start offset
-
-            2, 0, 0, 0,  # vector length
+  def test_vtable_with_1_vector_of_2_struct_of_2_int8(self):
+    b = flatbuffers.Builder(0)
+    b.StartVector(flatbuffers.number_types.Int8Flags.bytewidth * 2, 2, 1)
+    b.PrependInt8(33)
+    b.PrependInt8(44)
+    b.PrependInt8(55)
+    b.PrependInt8(66)
+    vecend = b.EndVector()
+    b.StartObject(1)
+    b.PrependUOffsetTRelativeSlot(0, vecend, 0)
+    b.EndObject()
+    self.assertBuilderEquals(
+        b,
+        [
+            6,
+            0,  # vtable bytes
+            8,
+            0,
+            4,
+            0,  # offset of vector offset
+            6,
+            0,
+            0,
+            0,  # offset for start of vtable (int32)
+            4,
+            0,
+            0,
+            0,  # vector start offset
+            2,
+            0,
+            0,
+            0,  # vector length
             66,  # vector value 1,1
             55,  # vector value 1,0
             44,  # vector value 0,1
             33,  # vector value 0,0
         ])
 
-    def test_table_with_some_elements(self):
-        b = flatbuffers.Builder(0)
-        b.StartObject(2)
-        b.PrependInt8Slot(0, 33, 0)
-        b.PrependInt16Slot(1, 66, 0)
-        off = b.EndObject()
-        b.Finish(off)
+  def test_table_with_some_elements(self):
+    b = flatbuffers.Builder(0)
+    b.StartObject(2)
+    b.PrependInt8Slot(0, 33, 0)
+    b.PrependInt16Slot(1, 66, 0)
+    off = b.EndObject()
+    b.Finish(off)
 
-        self.assertBuilderEquals(b, [
-            12, 0, 0, 0,  # root of table: points to vtable offset
-
-            8, 0,  # vtable bytes
-            8, 0,  # end of object from here
-            7, 0,  # start of value 0
-            4, 0,  # start of value 1
-
-            8, 0, 0, 0,  # offset for start of vtable (int32)
-
-            66, 0,  # value 1
+    self.assertBuilderEquals(
+        b,
+        [
+            12,
+            0,
+            0,
+            0,  # root of table: points to vtable offset
+            8,
+            0,  # vtable bytes
+            8,
+            0,  # end of object from here
+            7,
+            0,  # start of value 0
+            4,
+            0,  # start of value 1
+            8,
+            0,
+            0,
+            0,  # offset for start of vtable (int32)
+            66,
+            0,  # value 1
             0,  # padding
             33,  # value 0
         ])
 
-    def test__one_unfinished_table_and_one_finished_table(self):
-        b = flatbuffers.Builder(0)
-        b.StartObject(2)
-        b.PrependInt8Slot(0, 33, 0)
-        b.PrependInt8Slot(1, 44, 0)
-        off = b.EndObject()
-        b.Finish(off)
+  def test__one_unfinished_table_and_one_finished_table(self):
+    b = flatbuffers.Builder(0)
+    b.StartObject(2)
+    b.PrependInt8Slot(0, 33, 0)
+    b.PrependInt8Slot(1, 44, 0)
+    off = b.EndObject()
+    b.Finish(off)
 
-        b.StartObject(3)
-        b.PrependInt8Slot(0, 55, 0)
-        b.PrependInt8Slot(1, 66, 0)
-        b.PrependInt8Slot(2, 77, 0)
-        off = b.EndObject()
-        b.Finish(off)
+    b.StartObject(3)
+    b.PrependInt8Slot(0, 55, 0)
+    b.PrependInt8Slot(1, 66, 0)
+    b.PrependInt8Slot(2, 77, 0)
+    off = b.EndObject()
+    b.Finish(off)
 
-        self.assertBuilderEquals(b, [
-            16, 0, 0, 0,  # root of table: points to object
-            0, 0,  # padding
-
-            10, 0,  # vtable bytes
-            8, 0,  # size of object
-            7, 0,  # start of value 0
-            6, 0,  # start of value 1
-            5, 0,  # start of value 2
-            10, 0, 0, 0,  # offset for start of vtable (int32)
+    self.assertBuilderEquals(
+        b,
+        [
+            16,
+            0,
+            0,
+            0,  # root of table: points to object
+            0,
+            0,  # padding
+            10,
+            0,  # vtable bytes
+            8,
+            0,  # size of object
+            7,
+            0,  # start of value 0
+            6,
+            0,  # start of value 1
+            5,
+            0,  # start of value 2
+            10,
+            0,
+            0,
+            0,  # offset for start of vtable (int32)
             0,  # padding
             77,  # value 2
             66,  # value 1
             55,  # value 0
-
-            12, 0, 0, 0,  # root of table: points to object
-
-            8, 0,  # vtable bytes
-            8, 0,  # size of object
-            7, 0,  # start of value 0
-            6, 0,  # start of value 1
-            8, 0, 0, 0,  # offset for start of vtable (int32)
-            0, 0,  # padding
+            12,
+            0,
+            0,
+            0,  # root of table: points to object
+            8,
+            0,  # vtable bytes
+            8,
+            0,  # size of object
+            7,
+            0,  # start of value 0
+            6,
+            0,  # start of value 1
+            8,
+            0,
+            0,
+            0,  # offset for start of vtable (int32)
+            0,
+            0,  # padding
             44,  # value 1
             33,  # value 0
         ])
 
-    def test_a_bunch_of_bools(self):
-        b = flatbuffers.Builder(0)
-        b.StartObject(8)
-        b.PrependBoolSlot(0, True, False)
-        b.PrependBoolSlot(1, True, False)
-        b.PrependBoolSlot(2, True, False)
-        b.PrependBoolSlot(3, True, False)
-        b.PrependBoolSlot(4, True, False)
-        b.PrependBoolSlot(5, True, False)
-        b.PrependBoolSlot(6, True, False)
-        b.PrependBoolSlot(7, True, False)
-        off = b.EndObject()
-        b.Finish(off)
+  def test_a_bunch_of_bools(self):
+    b = flatbuffers.Builder(0)
+    b.StartObject(8)
+    b.PrependBoolSlot(0, True, False)
+    b.PrependBoolSlot(1, True, False)
+    b.PrependBoolSlot(2, True, False)
+    b.PrependBoolSlot(3, True, False)
+    b.PrependBoolSlot(4, True, False)
+    b.PrependBoolSlot(5, True, False)
+    b.PrependBoolSlot(6, True, False)
+    b.PrependBoolSlot(7, True, False)
+    off = b.EndObject()
+    b.Finish(off)
 
-        self.assertBuilderEquals(b, [
-            24, 0, 0, 0,  # root of table: points to vtable offset
-
-            20, 0,  # vtable bytes
-            12, 0,  # size of object
-            11, 0,  # start of value 0
-            10, 0,  # start of value 1
-            9, 0,  # start of value 2
-            8, 0,  # start of value 3
-            7, 0,  # start of value 4
-            6, 0,  # start of value 5
-            5, 0,  # start of value 6
-            4, 0,  # start of value 7
-            20, 0, 0, 0,  # vtable offset
-
+    self.assertBuilderEquals(
+        b,
+        [
+            24,
+            0,
+            0,
+            0,  # root of table: points to vtable offset
+            20,
+            0,  # vtable bytes
+            12,
+            0,  # size of object
+            11,
+            0,  # start of value 0
+            10,
+            0,  # start of value 1
+            9,
+            0,  # start of value 2
+            8,
+            0,  # start of value 3
+            7,
+            0,  # start of value 4
+            6,
+            0,  # start of value 5
+            5,
+            0,  # start of value 6
+            4,
+            0,  # start of value 7
+            20,
+            0,
+            0,
+            0,  # vtable offset
             1,  # value 7
             1,  # value 6
             1,  # value 5
@@ -1498,908 +1885,970 @@
             1,  # value 0
         ])
 
-    def test_three_bools(self):
-        b = flatbuffers.Builder(0)
-        b.StartObject(3)
-        b.PrependBoolSlot(0, True, False)
-        b.PrependBoolSlot(1, True, False)
-        b.PrependBoolSlot(2, True, False)
-        off = b.EndObject()
-        b.Finish(off)
+  def test_three_bools(self):
+    b = flatbuffers.Builder(0)
+    b.StartObject(3)
+    b.PrependBoolSlot(0, True, False)
+    b.PrependBoolSlot(1, True, False)
+    b.PrependBoolSlot(2, True, False)
+    off = b.EndObject()
+    b.Finish(off)
 
-        self.assertBuilderEquals(b, [
-            16, 0, 0, 0,  # root of table: points to vtable offset
-
-            0, 0,  # padding
-
-            10, 0,  # vtable bytes
-            8, 0,  # size of object
-            7, 0,  # start of value 0
-            6, 0,  # start of value 1
-            5, 0,  # start of value 2
-            10, 0, 0, 0,  # vtable offset from here
-
+    self.assertBuilderEquals(
+        b,
+        [
+            16,
+            0,
+            0,
+            0,  # root of table: points to vtable offset
+            0,
+            0,  # padding
+            10,
+            0,  # vtable bytes
+            8,
+            0,  # size of object
+            7,
+            0,  # start of value 0
+            6,
+            0,  # start of value 1
+            5,
+            0,  # start of value 2
+            10,
+            0,
+            0,
+            0,  # vtable offset from here
             0,  # padding
             1,  # value 2
             1,  # value 1
             1,  # value 0
         ])
 
-    def test_some_floats(self):
-        b = flatbuffers.Builder(0)
-        b.StartObject(1)
-        b.PrependFloat32Slot(0, 1.0, 0.0)
-        off = b.EndObject()
+  def test_some_floats(self):
+    b = flatbuffers.Builder(0)
+    b.StartObject(1)
+    b.PrependFloat32Slot(0, 1.0, 0.0)
+    off = b.EndObject()
 
-        self.assertBuilderEquals(b, [
-            6, 0,  # vtable bytes
-            8, 0,  # size of object
-            4, 0,  # start of value 0
-            6, 0, 0, 0,  # vtable offset
-
-            0, 0, 128, 63,  # value 0
+    self.assertBuilderEquals(
+        b,
+        [
+            6,
+            0,  # vtable bytes
+            8,
+            0,  # size of object
+            4,
+            0,  # start of value 0
+            6,
+            0,
+            0,
+            0,  # vtable offset
+            0,
+            0,
+            128,
+            63,  # value 0
         ])
 
 
-def make_monster_from_generated_code(sizePrefix = False, file_identifier=None):
-    ''' Use generated code to build the example Monster. '''
+def make_monster_from_generated_code(sizePrefix=False, file_identifier=None):
+  """ Use generated code to build the example Monster. """
 
-    b = flatbuffers.Builder(0)
-    string = b.CreateString("MyMonster")
-    test1 = b.CreateString("test1")
-    test2 = b.CreateString("test2")
-    fred = b.CreateString("Fred")
+  b = flatbuffers.Builder(0)
+  string = b.CreateString('MyMonster')
+  test1 = b.CreateString('test1')
+  test2 = b.CreateString('test2')
+  fred = b.CreateString('Fred')
 
-    MyGame.Example.Monster.MonsterStartInventoryVector(b, 5)
-    b.PrependByte(4)
-    b.PrependByte(3)
-    b.PrependByte(2)
-    b.PrependByte(1)
-    b.PrependByte(0)
-    inv = b.EndVector(5)
+  _MONSTER.MonsterStartInventoryVector(b, 5)
+  b.PrependByte(4)
+  b.PrependByte(3)
+  b.PrependByte(2)
+  b.PrependByte(1)
+  b.PrependByte(0)
+  inv = b.EndVector()
 
-    MyGame.Example.Monster.MonsterStart(b)
-    MyGame.Example.Monster.MonsterAddName(b, fred)
-    mon2 = MyGame.Example.Monster.MonsterEnd(b)
+  _MONSTER.MonsterStart(b)
+  _MONSTER.MonsterAddName(b, fred)
+  mon2 = _MONSTER.MonsterEnd(b)
 
-    MyGame.Example.Monster.MonsterStartTest4Vector(b, 2)
-    MyGame.Example.Test.CreateTest(b, 10, 20)
-    MyGame.Example.Test.CreateTest(b, 30, 40)
-    test4 = b.EndVector(2)
+  _MONSTER.MonsterStartTest4Vector(b, 2)
+  _TEST.CreateTest(b, 10, 20)
+  _TEST.CreateTest(b, 30, 40)
+  test4 = b.EndVector()
 
-    MyGame.Example.Monster.MonsterStartTestarrayofstringVector(b, 2)
-    b.PrependUOffsetTRelative(test2)
-    b.PrependUOffsetTRelative(test1)
-    testArrayOfString = b.EndVector(2)
+  _MONSTER.MonsterStartTestarrayofstringVector(b, 2)
+  b.PrependUOffsetTRelative(test2)
+  b.PrependUOffsetTRelative(test1)
+  testArrayOfString = b.EndVector()
 
-    MyGame.Example.Monster.MonsterStartVectorOfLongsVector(b, 5)
-    b.PrependInt64(100000000)
-    b.PrependInt64(1000000)
-    b.PrependInt64(10000)
-    b.PrependInt64(100)
-    b.PrependInt64(1)
-    VectorOfLongs = b.EndVector(5)
+  _MONSTER.MonsterStartVectorOfLongsVector(b, 5)
+  b.PrependInt64(100000000)
+  b.PrependInt64(1000000)
+  b.PrependInt64(10000)
+  b.PrependInt64(100)
+  b.PrependInt64(1)
+  VectorOfLongs = b.EndVector()
 
-    MyGame.Example.Monster.MonsterStartVectorOfDoublesVector(b, 3)
-    b.PrependFloat64(1.7976931348623157e+308)
-    b.PrependFloat64(0)
-    b.PrependFloat64(-1.7976931348623157e+308)
-    VectorOfDoubles = b.EndVector(3)
+  _MONSTER.MonsterStartVectorOfDoublesVector(b, 3)
+  b.PrependFloat64(1.7976931348623157e+308)
+  b.PrependFloat64(0)
+  b.PrependFloat64(-1.7976931348623157e+308)
+  VectorOfDoubles = b.EndVector()
 
-    MyGame.Example.Monster.MonsterStart(b)
+  _MONSTER.MonsterStart(b)
 
-    pos = MyGame.Example.Vec3.CreateVec3(b, 1.0, 2.0, 3.0, 3.0, 2, 5, 6)
-    MyGame.Example.Monster.MonsterAddPos(b, pos)
+  pos = _VEC3.CreateVec3(b, 1.0, 2.0, 3.0, 3.0, 2, 5, 6)
+  _MONSTER.MonsterAddPos(b, pos)
 
-    MyGame.Example.Monster.MonsterAddHp(b, 80)
-    MyGame.Example.Monster.MonsterAddName(b, string)
-    MyGame.Example.Monster.MonsterAddInventory(b, inv)
-    MyGame.Example.Monster.MonsterAddTestType(b, 1)
-    MyGame.Example.Monster.MonsterAddTest(b, mon2)
-    MyGame.Example.Monster.MonsterAddTest4(b, test4)
-    MyGame.Example.Monster.MonsterAddTestarrayofstring(b, testArrayOfString)
-    MyGame.Example.Monster.MonsterAddVectorOfLongs(b, VectorOfLongs)
-    MyGame.Example.Monster.MonsterAddVectorOfDoubles(b, VectorOfDoubles)
-    mon = MyGame.Example.Monster.MonsterEnd(b)
+  _MONSTER.MonsterAddHp(b, 80)
+  _MONSTER.MonsterAddName(b, string)
+  _MONSTER.MonsterAddInventory(b, inv)
+  _MONSTER.MonsterAddTestType(b, 1)
+  _MONSTER.MonsterAddTest(b, mon2)
+  _MONSTER.MonsterAddTest4(b, test4)
+  _MONSTER.MonsterAddTestarrayofstring(b, testArrayOfString)
+  _MONSTER.MonsterAddVectorOfLongs(b, VectorOfLongs)
+  _MONSTER.MonsterAddVectorOfDoubles(b, VectorOfDoubles)
+  mon = _MONSTER.MonsterEnd(b)
 
-    if sizePrefix:
-        b.FinishSizePrefixed(mon, file_identifier)
-    else:
-        b.Finish(mon, file_identifier)
+  if sizePrefix:
+    b.FinishSizePrefixed(mon, file_identifier)
+  else:
+    b.Finish(mon, file_identifier)
 
-    return b.Bytes, b.Head()
+  return b.Bytes, b.Head()
 
 
 class TestBuilderForceDefaults(unittest.TestCase):
-    """Verify that the builder adds default values when forced."""
+  """Verify that the builder adds default values when forced."""
 
-    test_flags = [N.BoolFlags(), N.Uint8Flags(), N.Uint16Flags(), \
-                  N.Uint32Flags(), N.Uint64Flags(), N.Int8Flags(), \
-                  N.Int16Flags(), N.Int32Flags(), N.Int64Flags(), \
-                  N.Float32Flags(), N.Float64Flags(), N.UOffsetTFlags()]
-    def test_default_force_defaults(self):
-        for flag in self.test_flags:
-            b = flatbuffers.Builder(0)
-            b.StartObject(1)
-            stored_offset = b.Offset()
-            if flag != N.UOffsetTFlags():
-                b.PrependSlot(flag, 0, 0, 0)
-            else:
-                b.PrependUOffsetTRelativeSlot(0, 0, 0)
-            end_offset = b.Offset()
-            b.EndObject()
-            self.assertEqual(0, end_offset - stored_offset)
+  test_flags = [N.BoolFlags(), N.Uint8Flags(), N.Uint16Flags(), \
+                N.Uint32Flags(), N.Uint64Flags(), N.Int8Flags(), \
+                N.Int16Flags(), N.Int32Flags(), N.Int64Flags(), \
+                N.Float32Flags(), N.Float64Flags(), N.UOffsetTFlags()]
 
-    def test_force_defaults_true(self):
-        for flag in self.test_flags:
-            b = flatbuffers.Builder(0)
-            b.ForceDefaults(True)
-            b.StartObject(1)
-            stored_offset = b.Offset()
-            if flag != N.UOffsetTFlags():
-                b.PrependSlot(flag, 0, 0, 0)
-            else:
-                b.PrependUOffsetTRelativeSlot(0, 0, 0)
-            end_offset = b.Offset()
-            b.EndObject()
-            self.assertEqual(flag.bytewidth, end_offset - stored_offset)
+  def test_default_force_defaults(self):
+    for flag in self.test_flags:
+      b = flatbuffers.Builder(0)
+      b.StartObject(1)
+      stored_offset = b.Offset()
+      if flag != N.UOffsetTFlags():
+        b.PrependSlot(flag, 0, 0, 0)
+      else:
+        b.PrependUOffsetTRelativeSlot(0, 0, 0)
+      end_offset = b.Offset()
+      b.EndObject()
+      self.assertEqual(0, end_offset - stored_offset)
+
+  def test_force_defaults_true(self):
+    for flag in self.test_flags:
+      b = flatbuffers.Builder(0)
+      b.ForceDefaults(True)
+      b.StartObject(1)
+      stored_offset = b.Offset()
+      if flag != N.UOffsetTFlags():
+        b.PrependSlot(flag, 0, 0, 0)
+      else:
+        b.PrependUOffsetTRelativeSlot(0, 0, 0)
+      end_offset = b.Offset()
+      b.EndObject()
+      self.assertEqual(flag.bytewidth, end_offset - stored_offset)
 
 
 class TestAllCodePathsOfExampleSchema(unittest.TestCase):
-    def setUp(self, *args, **kwargs):
-        super(TestAllCodePathsOfExampleSchema, self).setUp(*args, **kwargs)
 
-        b = flatbuffers.Builder(0)
-        MyGame.Example.Monster.MonsterStart(b)
-        gen_mon = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(gen_mon)
+  def setUp(self, *args, **kwargs):
+    super(TestAllCodePathsOfExampleSchema, self).setUp(*args, **kwargs)
 
-        self.mon = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Bytes,
-                                                                   b.Head())
+    b = flatbuffers.Builder(0)
+    _MONSTER.MonsterStart(b)
+    gen_mon = _MONSTER.MonsterEnd(b)
+    b.Finish(gen_mon)
 
-    def test_default_monster_pos(self):
-        self.assertTrue(self.mon.Pos() is None)
+    self.mon = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
 
-    def test_nondefault_monster_mana(self):
-        b = flatbuffers.Builder(0)
-        MyGame.Example.Monster.MonsterStart(b)
-        MyGame.Example.Monster.MonsterAddMana(b, 50)
-        mon = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(mon)
+  def test_default_monster_pos(self):
+    self.assertTrue(self.mon.Pos() is None)
 
-        got_mon = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Bytes,
-                                                                  b.Head())
-        self.assertEqual(50, got_mon.Mana())
+  def test_nondefault_monster_mana(self):
+    b = flatbuffers.Builder(0)
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddMana(b, 50)
+    mon = _MONSTER.MonsterEnd(b)
+    b.Finish(mon)
 
-    def test_default_monster_hp(self):
-        self.assertEqual(100, self.mon.Hp())
+    got_mon = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
+    self.assertEqual(50, got_mon.Mana())
 
-    def test_default_monster_name(self):
-        self.assertEqual(None, self.mon.Name())
+  def test_default_monster_hp(self):
+    self.assertEqual(100, self.mon.Hp())
 
-    def test_default_monster_inventory_item(self):
-        self.assertEqual(0, self.mon.Inventory(0))
+  def test_default_monster_name(self):
+    self.assertEqual(None, self.mon.Name())
 
-    def test_default_monster_inventory_length(self):
-        self.assertEqual(0, self.mon.InventoryLength())
-        self.assertTrue(self.mon.InventoryIsNone())
+  def test_default_monster_inventory_item(self):
+    self.assertEqual(0, self.mon.Inventory(0))
 
-    def test_empty_monster_inventory_vector(self):
-        b = flatbuffers.Builder(0)
-        MyGame.Example.Monster.MonsterStartInventoryVector(b, 0)
-        inv = b.EndVector(0)
-        MyGame.Example.Monster.MonsterStart(b)
-        MyGame.Example.Monster.MonsterAddInventory(b, inv)
-        mon = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(mon)
-        mon2 = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Bytes,
-                                                               b.Head())
-        self.assertFalse(mon2.InventoryIsNone())
+  def test_default_monster_inventory_length(self):
+    self.assertEqual(0, self.mon.InventoryLength())
+    self.assertTrue(self.mon.InventoryIsNone())
 
-    def test_default_monster_color(self):
-        self.assertEqual(MyGame.Example.Color.Color.Blue, self.mon.Color())
+  def test_empty_monster_inventory_vector(self):
+    b = flatbuffers.Builder(0)
+    _MONSTER.MonsterStartInventoryVector(b, 0)
+    inv = b.EndVector()
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddInventory(b, inv)
+    mon = _MONSTER.MonsterEnd(b)
+    b.Finish(mon)
+    mon2 = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
+    self.assertFalse(mon2.InventoryIsNone())
 
-    def test_nondefault_monster_color(self):
-        b = flatbuffers.Builder(0)
-        color = MyGame.Example.Color.Color.Red
-        MyGame.Example.Monster.MonsterStart(b)
-        MyGame.Example.Monster.MonsterAddColor(b, color)
-        mon = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(mon)
+  def test_default_monster_color(self):
+    self.assertEqual(_COLOR.Color.Blue, self.mon.Color())
 
-        mon2 = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Bytes,
-                                                               b.Head())
-        self.assertEqual(MyGame.Example.Color.Color.Red, mon2.Color())
+  def test_nondefault_monster_color(self):
+    b = flatbuffers.Builder(0)
+    color = _COLOR.Color.Red
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddColor(b, color)
+    mon = _MONSTER.MonsterEnd(b)
+    b.Finish(mon)
 
-    def test_default_monster_testtype(self):
-        self.assertEqual(0, self.mon.TestType())
+    mon2 = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
+    self.assertEqual(_COLOR.Color.Red, mon2.Color())
 
-    def test_default_monster_test_field(self):
-        self.assertEqual(None, self.mon.Test())
+  def test_default_monster_testtype(self):
+    self.assertEqual(0, self.mon.TestType())
 
-    def test_default_monster_test4_item(self):
-        self.assertEqual(None, self.mon.Test4(0))
+  def test_default_monster_test_field(self):
+    self.assertEqual(None, self.mon.Test())
 
-    def test_default_monster_test4_length(self):
-        self.assertEqual(0, self.mon.Test4Length())
-        self.assertTrue(self.mon.Test4IsNone())
+  def test_default_monster_test4_item(self):
+    self.assertEqual(None, self.mon.Test4(0))
 
-    def test_empty_monster_test4_vector(self):
-        b = flatbuffers.Builder(0)
-        MyGame.Example.Monster.MonsterStartTest4Vector(b, 0)
-        test4 = b.EndVector(0)
-        MyGame.Example.Monster.MonsterStart(b)
-        MyGame.Example.Monster.MonsterAddTest4(b, test4)
-        mon = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(mon)
-        mon2 = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Bytes,
-                                                               b.Head())
-        self.assertFalse(mon2.Test4IsNone())
+  def test_default_monster_test4_length(self):
+    self.assertEqual(0, self.mon.Test4Length())
+    self.assertTrue(self.mon.Test4IsNone())
 
-    def test_default_monster_testarrayofstring(self):
-        self.assertEqual("", self.mon.Testarrayofstring(0))
+  def test_empty_monster_test4_vector(self):
+    b = flatbuffers.Builder(0)
+    _MONSTER.MonsterStartTest4Vector(b, 0)
+    test4 = b.EndVector()
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddTest4(b, test4)
+    mon = _MONSTER.MonsterEnd(b)
+    b.Finish(mon)
+    mon2 = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
+    self.assertFalse(mon2.Test4IsNone())
 
-    def test_default_monster_testarrayofstring_length(self):
-        self.assertEqual(0, self.mon.TestarrayofstringLength())
-        self.assertTrue(self.mon.TestarrayofstringIsNone())
+  def test_default_monster_testarrayofstring(self):
+    self.assertEqual('', self.mon.Testarrayofstring(0))
 
-    def test_empty_monster_testarrayofstring_vector(self):
-        b = flatbuffers.Builder(0)
-        MyGame.Example.Monster.MonsterStartTestarrayofstringVector(b, 0)
-        testarrayofstring = b.EndVector(0)
-        MyGame.Example.Monster.MonsterStart(b)
-        MyGame.Example.Monster.MonsterAddTestarrayofstring(b, testarrayofstring)
-        mon = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(mon)
-        mon2 = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Bytes,
-                                                               b.Head())
-        self.assertFalse(mon2.TestarrayofstringIsNone())
+  def test_default_monster_testarrayofstring_length(self):
+    self.assertEqual(0, self.mon.TestarrayofstringLength())
+    self.assertTrue(self.mon.TestarrayofstringIsNone())
 
-    def test_default_monster_testarrayoftables(self):
-        self.assertEqual(None, self.mon.Testarrayoftables(0))
+  def test_empty_monster_testarrayofstring_vector(self):
+    b = flatbuffers.Builder(0)
+    _MONSTER.MonsterStartTestarrayofstringVector(b, 0)
+    testarrayofstring = b.EndVector()
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddTestarrayofstring(b, testarrayofstring)
+    mon = _MONSTER.MonsterEnd(b)
+    b.Finish(mon)
+    mon2 = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
+    self.assertFalse(mon2.TestarrayofstringIsNone())
 
-    def test_nondefault_monster_testarrayoftables(self):
-        b = flatbuffers.Builder(0)
+  def test_default_monster_testarrayoftables(self):
+    self.assertEqual(None, self.mon.Testarrayoftables(0))
 
-        # make a child Monster within a vector of Monsters:
-        MyGame.Example.Monster.MonsterStart(b)
-        MyGame.Example.Monster.MonsterAddHp(b, 99)
-        sub_monster = MyGame.Example.Monster.MonsterEnd(b)
+  def test_nondefault_monster_testarrayoftables(self):
+    b = flatbuffers.Builder(0)
 
-        # build the vector:
-        MyGame.Example.Monster.MonsterStartTestarrayoftablesVector(b, 1)
-        b.PrependUOffsetTRelative(sub_monster)
-        vec = b.EndVector(1)
+    # make a child Monster within a vector of Monsters:
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddHp(b, 99)
+    sub_monster = _MONSTER.MonsterEnd(b)
 
-        # make the parent monster and include the vector of Monster:
-        MyGame.Example.Monster.MonsterStart(b)
-        MyGame.Example.Monster.MonsterAddTestarrayoftables(b, vec)
-        mon = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(mon)
+    # build the vector:
+    _MONSTER.MonsterStartTestarrayoftablesVector(b, 1)
+    b.PrependUOffsetTRelative(sub_monster)
+    vec = b.EndVector()
 
-        # inspect the resulting data:
-        mon2 = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Output(), 0)
-        self.assertEqual(99, mon2.Testarrayoftables(0).Hp())
-        self.assertEqual(1, mon2.TestarrayoftablesLength())
-        self.assertFalse(mon2.TestarrayoftablesIsNone())
+    # make the parent monster and include the vector of Monster:
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddTestarrayoftables(b, vec)
+    mon = _MONSTER.MonsterEnd(b)
+    b.Finish(mon)
 
-    def test_default_monster_testarrayoftables_length(self):
-        self.assertEqual(0, self.mon.TestarrayoftablesLength())
-        self.assertTrue(self.mon.TestarrayoftablesIsNone())
+    # inspect the resulting data:
+    mon2 = _MONSTER.Monster.GetRootAs(b.Output(), 0)
+    self.assertEqual(99, mon2.Testarrayoftables(0).Hp())
+    self.assertEqual(1, mon2.TestarrayoftablesLength())
+    self.assertFalse(mon2.TestarrayoftablesIsNone())
 
-    def test_empty_monster_testarrayoftables_vector(self):
-        b = flatbuffers.Builder(0)
-        MyGame.Example.Monster.MonsterStartTestarrayoftablesVector(b, 0)
-        testarrayoftables = b.EndVector(0)
-        MyGame.Example.Monster.MonsterStart(b)
-        MyGame.Example.Monster.MonsterAddTestarrayoftables(b, testarrayoftables)
-        mon = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(mon)
-        mon2 = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Bytes,
-                                                               b.Head())
-        self.assertFalse(mon2.TestarrayoftablesIsNone())
+  def test_default_monster_testarrayoftables_length(self):
+    self.assertEqual(0, self.mon.TestarrayoftablesLength())
+    self.assertTrue(self.mon.TestarrayoftablesIsNone())
 
-    def test_default_monster_testarrayoftables_length(self):
-        self.assertEqual(0, self.mon.TestarrayoftablesLength())
+  def test_empty_monster_testarrayoftables_vector(self):
+    b = flatbuffers.Builder(0)
+    _MONSTER.MonsterStartTestarrayoftablesVector(b, 0)
+    testarrayoftables = b.EndVector()
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddTestarrayoftables(b, testarrayoftables)
+    mon = _MONSTER.MonsterEnd(b)
+    b.Finish(mon)
+    mon2 = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
+    self.assertFalse(mon2.TestarrayoftablesIsNone())
 
-    def test_nondefault_monster_enemy(self):
-        b = flatbuffers.Builder(0)
+  def test_default_monster_testarrayoftables_length(self):
+    self.assertEqual(0, self.mon.TestarrayoftablesLength())
 
-        # make an Enemy object:
-        MyGame.Example.Monster.MonsterStart(b)
-        MyGame.Example.Monster.MonsterAddHp(b, 88)
-        enemy = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(enemy)
+  def test_nondefault_monster_enemy(self):
+    b = flatbuffers.Builder(0)
 
-        # make the parent monster and include the vector of Monster:
-        MyGame.Example.Monster.MonsterStart(b)
-        MyGame.Example.Monster.MonsterAddEnemy(b, enemy)
-        mon = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(mon)
+    # make an Enemy object:
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddHp(b, 88)
+    enemy = _MONSTER.MonsterEnd(b)
+    b.Finish(enemy)
 
-        # inspect the resulting data:
-        mon2 = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Bytes,
-                                                               b.Head())
-        self.assertEqual(88, mon2.Enemy().Hp())
+    # make the parent monster and include the vector of Monster:
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddEnemy(b, enemy)
+    mon = _MONSTER.MonsterEnd(b)
+    b.Finish(mon)
 
-    def test_default_monster_testnestedflatbuffer(self):
-        self.assertEqual(0, self.mon.Testnestedflatbuffer(0))
+    # inspect the resulting data:
+    mon2 = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
+    self.assertEqual(88, mon2.Enemy().Hp())
 
-    def test_default_monster_testnestedflatbuffer_length(self):
-        self.assertEqual(0, self.mon.TestnestedflatbufferLength())
-        self.assertTrue(self.mon.TestnestedflatbufferIsNone())
+  def test_default_monster_testnestedflatbuffer(self):
+    self.assertEqual(0, self.mon.Testnestedflatbuffer(0))
 
-    def test_empty_monster_testnestedflatbuffer_vector(self):
-        b = flatbuffers.Builder(0)
-        MyGame.Example.Monster.MonsterStartTestnestedflatbufferVector(b, 0)
-        testnestedflatbuffer = b.EndVector(0)
-        MyGame.Example.Monster.MonsterStart(b)
-        MyGame.Example.Monster.MonsterAddTestnestedflatbuffer(b, testnestedflatbuffer)
-        mon = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(mon)
-        mon2 = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Bytes,
-                                                               b.Head())
-        self.assertFalse(mon2.TestnestedflatbufferIsNone())
+  def test_default_monster_testnestedflatbuffer_length(self):
+    self.assertEqual(0, self.mon.TestnestedflatbufferLength())
+    self.assertTrue(self.mon.TestnestedflatbufferIsNone())
 
-    def test_nondefault_monster_testnestedflatbuffer(self):
-        b = flatbuffers.Builder(0)
+  def test_empty_monster_testnestedflatbuffer_vector(self):
+    b = flatbuffers.Builder(0)
+    _MONSTER.MonsterStartTestnestedflatbufferVector(b, 0)
+    testnestedflatbuffer = b.EndVector()
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddTestnestedflatbuffer(b, testnestedflatbuffer)
+    mon = _MONSTER.MonsterEnd(b)
+    b.Finish(mon)
+    mon2 = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
+    self.assertFalse(mon2.TestnestedflatbufferIsNone())
 
-        MyGame.Example.Monster.MonsterStartTestnestedflatbufferVector(b, 3)
-        b.PrependByte(4)
-        b.PrependByte(2)
-        b.PrependByte(0)
-        sub_buf = b.EndVector(3)
+  def test_nondefault_monster_testnestedflatbuffer(self):
+    b = flatbuffers.Builder(0)
 
-        # make the parent monster and include the vector of Monster:
-        MyGame.Example.Monster.MonsterStart(b)
-        MyGame.Example.Monster.MonsterAddTestnestedflatbuffer(b, sub_buf)
-        mon = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(mon)
+    _MONSTER.MonsterStartTestnestedflatbufferVector(b, 3)
+    b.PrependByte(4)
+    b.PrependByte(2)
+    b.PrependByte(0)
+    sub_buf = b.EndVector()
 
-        # inspect the resulting data:
-        mon2 = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Bytes,
-                                                               b.Head())
-        self.assertEqual(3, mon2.TestnestedflatbufferLength())
-        self.assertFalse(mon2.TestnestedflatbufferIsNone())
-        self.assertEqual(0, mon2.Testnestedflatbuffer(0))
-        self.assertEqual(2, mon2.Testnestedflatbuffer(1))
-        self.assertEqual(4, mon2.Testnestedflatbuffer(2))
-        try:
-            imp.find_module('numpy')
-            # if numpy exists, then we should be able to get the
-            # vector as a numpy array
-            self.assertEqual([0, 2, 4], mon2.TestnestedflatbufferAsNumpy().tolist())
-        except ImportError:
-            assertRaises(self,
-                         lambda: mon2.TestnestedflatbufferAsNumpy(),
-                         NumpyRequiredForThisFeature)
+    # make the parent monster and include the vector of Monster:
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddTestnestedflatbuffer(b, sub_buf)
+    mon = _MONSTER.MonsterEnd(b)
+    b.Finish(mon)
 
-    def test_nondefault_monster_testempty(self):
-        b = flatbuffers.Builder(0)
+    # inspect the resulting data:
+    mon2 = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
+    self.assertEqual(3, mon2.TestnestedflatbufferLength())
+    self.assertFalse(mon2.TestnestedflatbufferIsNone())
+    self.assertEqual(0, mon2.Testnestedflatbuffer(0))
+    self.assertEqual(2, mon2.Testnestedflatbuffer(1))
+    self.assertEqual(4, mon2.Testnestedflatbuffer(2))
+    try:
+      imp.find_module('numpy')
+      # if numpy exists, then we should be able to get the
+      # vector as a numpy array
+      self.assertEqual([0, 2, 4], mon2.TestnestedflatbufferAsNumpy().tolist())
+    except ImportError:
+      assertRaises(self, lambda: mon2.TestnestedflatbufferAsNumpy(),
+                   NumpyRequiredForThisFeature)
 
-        # make a Stat object:
-        MyGame.Example.Stat.StatStart(b)
-        MyGame.Example.Stat.StatAddVal(b, 123)
-        my_stat = MyGame.Example.Stat.StatEnd(b)
-        b.Finish(my_stat)
+  def test_nested_monster_testnestedflatbuffer(self):
+    b = flatbuffers.Builder(0)
 
-        # include the stat object in a monster:
-        MyGame.Example.Monster.MonsterStart(b)
-        MyGame.Example.Monster.MonsterAddTestempty(b, my_stat)
-        mon = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(mon)
+    # build another monster to nest inside testnestedflatbuffer
+    nestedB = flatbuffers.Builder(0)
+    nameStr = nestedB.CreateString('Nested Monster')
+    _MONSTER.MonsterStart(nestedB)
+    _MONSTER.MonsterAddHp(nestedB, 30)
+    _MONSTER.MonsterAddName(nestedB, nameStr)
+    nestedMon = _MONSTER.MonsterEnd(nestedB)
+    nestedB.Finish(nestedMon)
 
-        # inspect the resulting data:
-        mon2 = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Bytes,
-                                                               b.Head())
-        self.assertEqual(123, mon2.Testempty().Val())
+    # write the nested FB bytes
+    sub_buf = _MONSTER.MonsterMakeTestnestedflatbufferVectorFromBytes(
+        b, nestedB.Output())
 
-    def test_default_monster_testbool(self):
-        self.assertFalse(self.mon.Testbool())
+    # make the parent monster and include the bytes of the nested monster
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddTestnestedflatbuffer(b, sub_buf)
+    mon = _MONSTER.MonsterEnd(b)
+    b.Finish(mon)
 
-    def test_nondefault_monster_testbool(self):
-        b = flatbuffers.Builder(0)
-        MyGame.Example.Monster.MonsterStart(b)
-        MyGame.Example.Monster.MonsterAddTestbool(b, True)
-        mon = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(mon)
+    # inspect the resulting data:
+    mon2 = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
+    nestedMon2 = mon2.TestnestedflatbufferNestedRoot()
+    self.assertEqual(b'Nested Monster', nestedMon2.Name())
+    self.assertEqual(30, nestedMon2.Hp())
 
-        # inspect the resulting data:
-        mon2 = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Bytes,
-                                                               b.Head())
-        self.assertTrue(mon2.Testbool())
+  def test_nondefault_monster_testempty(self):
+    b = flatbuffers.Builder(0)
 
-    def test_default_monster_testhashes(self):
-        self.assertEqual(0, self.mon.Testhashs32Fnv1())
-        self.assertEqual(0, self.mon.Testhashu32Fnv1())
-        self.assertEqual(0, self.mon.Testhashs64Fnv1())
-        self.assertEqual(0, self.mon.Testhashu64Fnv1())
-        self.assertEqual(0, self.mon.Testhashs32Fnv1a())
-        self.assertEqual(0, self.mon.Testhashu32Fnv1a())
-        self.assertEqual(0, self.mon.Testhashs64Fnv1a())
-        self.assertEqual(0, self.mon.Testhashu64Fnv1a())
+    # make a Stat object:
+    _STAT.StatStart(b)
+    _STAT.StatAddVal(b, 123)
+    my_stat = _STAT.StatEnd(b)
+    b.Finish(my_stat)
 
-    def test_nondefault_monster_testhashes(self):
-        b = flatbuffers.Builder(0)
-        MyGame.Example.Monster.MonsterStart(b)
-        MyGame.Example.Monster.MonsterAddTesthashs32Fnv1(b, 1)
-        MyGame.Example.Monster.MonsterAddTesthashu32Fnv1(b, 2)
-        MyGame.Example.Monster.MonsterAddTesthashs64Fnv1(b, 3)
-        MyGame.Example.Monster.MonsterAddTesthashu64Fnv1(b, 4)
-        MyGame.Example.Monster.MonsterAddTesthashs32Fnv1a(b, 5)
-        MyGame.Example.Monster.MonsterAddTesthashu32Fnv1a(b, 6)
-        MyGame.Example.Monster.MonsterAddTesthashs64Fnv1a(b, 7)
-        MyGame.Example.Monster.MonsterAddTesthashu64Fnv1a(b, 8)
-        mon = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(mon)
+    # include the stat object in a monster:
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddTestempty(b, my_stat)
+    mon = _MONSTER.MonsterEnd(b)
+    b.Finish(mon)
 
-        # inspect the resulting data:
-        mon2 = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Bytes,
-                                                               b.Head())
-        self.assertEqual(1, mon2.Testhashs32Fnv1())
-        self.assertEqual(2, mon2.Testhashu32Fnv1())
-        self.assertEqual(3, mon2.Testhashs64Fnv1())
-        self.assertEqual(4, mon2.Testhashu64Fnv1())
-        self.assertEqual(5, mon2.Testhashs32Fnv1a())
-        self.assertEqual(6, mon2.Testhashu32Fnv1a())
-        self.assertEqual(7, mon2.Testhashs64Fnv1a())
-        self.assertEqual(8, mon2.Testhashu64Fnv1a())
+    # inspect the resulting data:
+    mon2 = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
+    self.assertEqual(123, mon2.Testempty().Val())
 
-    def test_default_monster_parent_namespace_test(self):
-        self.assertEqual(None, self.mon.ParentNamespaceTest())
+  def test_default_monster_testbool(self):
+    self.assertFalse(self.mon.Testbool())
 
-    def test_nondefault_monster_parent_namespace_test(self):
-        b = flatbuffers.Builder(0)
-        MyGame.InParentNamespace.InParentNamespaceStart(b)
-        parent = MyGame.InParentNamespace.InParentNamespaceEnd(b)
-        MyGame.Example.Monster.MonsterStart(b)
-        MyGame.Example.Monster.MonsterAddParentNamespaceTest(b, parent)
-        mon = MyGame.Example.Monster.MonsterEnd(b)
-        b.Finish(mon)
+  def test_nondefault_monster_testbool(self):
+    b = flatbuffers.Builder(0)
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddTestbool(b, True)
+    mon = _MONSTER.MonsterEnd(b)
+    b.Finish(mon)
 
-        # Inspect the resulting data.
-        monster = MyGame.Example.Monster.Monster.GetRootAsMonster(b.Bytes,
-                                                                  b.Head())
-        self.assertTrue(isinstance(monster.ParentNamespaceTest(),
-                                   MyGame.InParentNamespace.InParentNamespace))
+    # inspect the resulting data:
+    mon2 = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
+    self.assertTrue(mon2.Testbool())
 
-    def test_getrootas_for_nonroot_table(self):
-        b = flatbuffers.Builder(0)
-        string = b.CreateString("MyStat")
+  def test_default_monster_testhashes(self):
+    self.assertEqual(0, self.mon.Testhashs32Fnv1())
+    self.assertEqual(0, self.mon.Testhashu32Fnv1())
+    self.assertEqual(0, self.mon.Testhashs64Fnv1())
+    self.assertEqual(0, self.mon.Testhashu64Fnv1())
+    self.assertEqual(0, self.mon.Testhashs32Fnv1a())
+    self.assertEqual(0, self.mon.Testhashu32Fnv1a())
+    self.assertEqual(0, self.mon.Testhashs64Fnv1a())
+    self.assertEqual(0, self.mon.Testhashu64Fnv1a())
 
-        MyGame.Example.Stat.StatStart(b)
-        MyGame.Example.Stat.StatAddId(b, string)
-        MyGame.Example.Stat.StatAddVal(b, 12345678)
-        MyGame.Example.Stat.StatAddCount(b, 12345)
-        stat = MyGame.Example.Stat.StatEnd(b)
-        b.Finish(stat)
+  def test_nondefault_monster_testhashes(self):
+    b = flatbuffers.Builder(0)
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddTesthashs32Fnv1(b, 1)
+    _MONSTER.MonsterAddTesthashu32Fnv1(b, 2)
+    _MONSTER.MonsterAddTesthashs64Fnv1(b, 3)
+    _MONSTER.MonsterAddTesthashu64Fnv1(b, 4)
+    _MONSTER.MonsterAddTesthashs32Fnv1a(b, 5)
+    _MONSTER.MonsterAddTesthashu32Fnv1a(b, 6)
+    _MONSTER.MonsterAddTesthashs64Fnv1a(b, 7)
+    _MONSTER.MonsterAddTesthashu64Fnv1a(b, 8)
+    mon = _MONSTER.MonsterEnd(b)
+    b.Finish(mon)
 
-        stat2 = MyGame.Example.Stat.Stat.GetRootAsStat(b.Bytes, b.Head())
+    # inspect the resulting data:
+    mon2 = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
+    self.assertEqual(1, mon2.Testhashs32Fnv1())
+    self.assertEqual(2, mon2.Testhashu32Fnv1())
+    self.assertEqual(3, mon2.Testhashs64Fnv1())
+    self.assertEqual(4, mon2.Testhashu64Fnv1())
+    self.assertEqual(5, mon2.Testhashs32Fnv1a())
+    self.assertEqual(6, mon2.Testhashu32Fnv1a())
+    self.assertEqual(7, mon2.Testhashs64Fnv1a())
+    self.assertEqual(8, mon2.Testhashu64Fnv1a())
 
-        self.assertEqual(b"MyStat", stat2.Id())
-        self.assertEqual(12345678, stat2.Val())
-        self.assertEqual(12345, stat2.Count())
+  def test_default_monster_parent_namespace_test(self):
+    self.assertEqual(None, self.mon.ParentNamespaceTest())
+
+  def test_nondefault_monster_parent_namespace_test(self):
+    b = flatbuffers.Builder(0)
+    _IN_PARENT_NAMESPACE.InParentNamespaceStart(b)
+    parent = _IN_PARENT_NAMESPACE.InParentNamespaceEnd(b)
+    _MONSTER.MonsterStart(b)
+    _MONSTER.MonsterAddParentNamespaceTest(b, parent)
+    mon = _MONSTER.MonsterEnd(b)
+    b.Finish(mon)
+
+    # Inspect the resulting data.
+    monster = _MONSTER.Monster.GetRootAs(b.Bytes, b.Head())
+    self.assertTrue(
+        isinstance(monster.ParentNamespaceTest(),
+                   _IN_PARENT_NAMESPACE.InParentNamespace))
+
+  def test_getrootas_for_nonroot_table(self):
+    b = flatbuffers.Builder(0)
+    string = b.CreateString('MyStat')
+
+    _STAT.StatStart(b)
+    _STAT.StatAddId(b, string)
+    _STAT.StatAddVal(b, 12345678)
+    _STAT.StatAddCount(b, 12345)
+    stat = _STAT.StatEnd(b)
+    b.Finish(stat)
+
+    stat2 = _STAT.Stat.GetRootAs(b.Bytes, b.Head())
+
+    self.assertEqual(b'MyStat', stat2.Id())
+    self.assertEqual(12345678, stat2.Val())
+    self.assertEqual(12345, stat2.Count())
 
 
 class TestAllCodePathsOfMonsterExtraSchema(unittest.TestCase):
-    def setUp(self, *args, **kwargs):
-        super(TestAllCodePathsOfMonsterExtraSchema, self).setUp(*args, **kwargs)
 
-        b = flatbuffers.Builder(0)
-        MyGame.MonsterExtra.MonsterExtraStart(b)
-        gen_mon = MyGame.MonsterExtra.MonsterExtraEnd(b)
-        b.Finish(gen_mon)
+  def setUp(self, *args, **kwargs):
+    super(TestAllCodePathsOfMonsterExtraSchema, self).setUp(*args, **kwargs)
 
-        self.mon = MyGame.MonsterExtra.MonsterExtra.GetRootAsMonsterExtra(b.Bytes, b.Head())
+    b = flatbuffers.Builder(0)
+    MyGame.MonsterExtra.Start(b)
+    gen_mon = MyGame.MonsterExtra.End(b)
+    b.Finish(gen_mon)
 
-    def test_default_nan_inf(self):
-        self.assertTrue(math.isnan(self.mon.F1()))
-        self.assertEqual(self.mon.F2(), float("inf"))
-        self.assertEqual(self.mon.F3(), float("-inf"))
+    self.mon = MyGame.MonsterExtra.MonsterExtra.GetRootAs(b.Bytes, b.Head())
 
-        self.assertTrue(math.isnan(self.mon.D1()))
-        self.assertEqual(self.mon.D2(), float("inf"))
-        self.assertEqual(self.mon.D3(), float("-inf"))
+  def test_default_nan_inf(self):
+    self.assertTrue(math.isnan(self.mon.F1()))
+    self.assertEqual(self.mon.F2(), float('inf'))
+    self.assertEqual(self.mon.F3(), float('-inf'))
+
+    self.assertTrue(math.isnan(self.mon.D1()))
+    self.assertEqual(self.mon.D2(), float('inf'))
+    self.assertEqual(self.mon.D3(), float('-inf'))
 
 
 class TestVtableDeduplication(unittest.TestCase):
-    ''' TestVtableDeduplication verifies that vtables are deduplicated. '''
+  """ TestVtableDeduplication verifies that vtables are deduplicated. """
 
-    def test_vtable_deduplication(self):
-        b = flatbuffers.Builder(0)
+  def test_vtable_deduplication(self):
+    b = flatbuffers.Builder(0)
 
-        b.StartObject(4)
-        b.PrependByteSlot(0, 0, 0)
-        b.PrependByteSlot(1, 11, 0)
-        b.PrependByteSlot(2, 22, 0)
-        b.PrependInt16Slot(3, 33, 0)
-        obj0 = b.EndObject()
+    b.StartObject(4)
+    b.PrependByteSlot(0, 0, 0)
+    b.PrependByteSlot(1, 11, 0)
+    b.PrependByteSlot(2, 22, 0)
+    b.PrependInt16Slot(3, 33, 0)
+    obj0 = b.EndObject()
 
-        b.StartObject(4)
-        b.PrependByteSlot(0, 0, 0)
-        b.PrependByteSlot(1, 44, 0)
-        b.PrependByteSlot(2, 55, 0)
-        b.PrependInt16Slot(3, 66, 0)
-        obj1 = b.EndObject()
+    b.StartObject(4)
+    b.PrependByteSlot(0, 0, 0)
+    b.PrependByteSlot(1, 44, 0)
+    b.PrependByteSlot(2, 55, 0)
+    b.PrependInt16Slot(3, 66, 0)
+    obj1 = b.EndObject()
 
-        b.StartObject(4)
-        b.PrependByteSlot(0, 0, 0)
-        b.PrependByteSlot(1, 77, 0)
-        b.PrependByteSlot(2, 88, 0)
-        b.PrependInt16Slot(3, 99, 0)
-        obj2 = b.EndObject()
+    b.StartObject(4)
+    b.PrependByteSlot(0, 0, 0)
+    b.PrependByteSlot(1, 77, 0)
+    b.PrependByteSlot(2, 88, 0)
+    b.PrependInt16Slot(3, 99, 0)
+    obj2 = b.EndObject()
 
-        got = b.Bytes[b.Head():]
+    got = b.Bytes[b.Head():]
 
-        want = bytearray([
-            240, 255, 255, 255,  # == -12. offset to dedupped vtable.
-            99, 0,
-            88,
-            77,
-            248, 255, 255, 255,  # == -8. offset to dedupped vtable.
-            66, 0,
-            55,
-            44,
-            12, 0,
-            8, 0,
-            0, 0,
-            7, 0,
-            6, 0,
-            4, 0,
-            12, 0, 0, 0,
-            33, 0,
-            22,
-            11,
-        ])
+    want = bytearray([
+        240,
+        255,
+        255,
+        255,  # == -12. offset to dedupped vtable.
+        99,
+        0,
+        88,
+        77,
+        248,
+        255,
+        255,
+        255,  # == -8. offset to dedupped vtable.
+        66,
+        0,
+        55,
+        44,
+        12,
+        0,
+        8,
+        0,
+        0,
+        0,
+        7,
+        0,
+        6,
+        0,
+        4,
+        0,
+        12,
+        0,
+        0,
+        0,
+        33,
+        0,
+        22,
+        11,
+    ])
 
-        self.assertEqual((len(want), want), (len(got), got))
+    self.assertEqual((len(want), want), (len(got), got))
 
-        table0 = flatbuffers.table.Table(b.Bytes, len(b.Bytes) - obj0)
-        table1 = flatbuffers.table.Table(b.Bytes, len(b.Bytes) - obj1)
-        table2 = flatbuffers.table.Table(b.Bytes, len(b.Bytes) - obj2)
+    table0 = flatbuffers.table.Table(b.Bytes, len(b.Bytes) - obj0)
+    table1 = flatbuffers.table.Table(b.Bytes, len(b.Bytes) - obj1)
+    table2 = flatbuffers.table.Table(b.Bytes, len(b.Bytes) - obj2)
 
-        def _checkTable(tab, voffsett_value, b, c, d):
-            # vtable size
-            got = tab.GetVOffsetTSlot(0, 0)
-            self.assertEqual(12, got, 'case 0, 0')
+    def _checkTable(tab, voffsett_value, b, c, d):
+      # vtable size
+      got = tab.GetVOffsetTSlot(0, 0)
+      self.assertEqual(12, got, 'case 0, 0')
 
-            # object size
-            got = tab.GetVOffsetTSlot(2, 0)
-            self.assertEqual(8, got, 'case 2, 0')
+      # object size
+      got = tab.GetVOffsetTSlot(2, 0)
+      self.assertEqual(8, got, 'case 2, 0')
 
-            # default value
-            got = tab.GetVOffsetTSlot(4, 0)
-            self.assertEqual(voffsett_value, got, 'case 4, 0')
+      # default value
+      got = tab.GetVOffsetTSlot(4, 0)
+      self.assertEqual(voffsett_value, got, 'case 4, 0')
 
-            got = tab.GetSlot(6, 0, N.Uint8Flags)
-            self.assertEqual(b, got, 'case 6, 0')
+      got = tab.GetSlot(6, 0, N.Uint8Flags)
+      self.assertEqual(b, got, 'case 6, 0')
 
-            val = tab.GetSlot(8, 0, N.Uint8Flags)
-            self.assertEqual(c, val, 'failed 8, 0')
+      val = tab.GetSlot(8, 0, N.Uint8Flags)
+      self.assertEqual(c, val, 'failed 8, 0')
 
-            got = tab.GetSlot(10, 0, N.Uint8Flags)
-            self.assertEqual(d, got, 'failed 10, 0')
+      got = tab.GetSlot(10, 0, N.Uint8Flags)
+      self.assertEqual(d, got, 'failed 10, 0')
 
-        _checkTable(table0, 0, 11, 22, 33)
-        _checkTable(table1, 0, 44, 55, 66)
-        _checkTable(table2, 0, 77, 88, 99)
+    _checkTable(table0, 0, 11, 22, 33)
+    _checkTable(table1, 0, 44, 55, 66)
+    _checkTable(table2, 0, 77, 88, 99)
 
 
 class TestExceptions(unittest.TestCase):
-    def test_object_is_nested_error(self):
-        b = flatbuffers.Builder(0)
-        b.StartObject(0)
-        assertRaises(self, lambda: b.StartObject(0),
-                     flatbuffers.builder.IsNestedError)
 
-    def test_object_is_not_nested_error(self):
-        b = flatbuffers.Builder(0)
-        assertRaises(self, lambda: b.EndObject(),
-                     flatbuffers.builder.IsNotNestedError)
+  def test_object_is_nested_error(self):
+    b = flatbuffers.Builder(0)
+    b.StartObject(0)
+    assertRaises(self, lambda: b.StartObject(0),
+                 flatbuffers.builder.IsNestedError)
 
-    def test_struct_is_not_inline_error(self):
-        b = flatbuffers.Builder(0)
-        b.StartObject(0)
-        assertRaises(self, lambda: b.PrependStructSlot(0, 1, 0),
-                     flatbuffers.builder.StructIsNotInlineError)
+  def test_object_is_not_nested_error(self):
+    b = flatbuffers.Builder(0)
+    assertRaises(self, lambda: b.EndObject(),
+                 flatbuffers.builder.IsNotNestedError)
 
-    def test_unreachable_error(self):
-        b = flatbuffers.Builder(0)
-        assertRaises(self, lambda: b.PrependUOffsetTRelative(1),
-                     flatbuffers.builder.OffsetArithmeticError)
+  def test_struct_is_not_inline_error(self):
+    b = flatbuffers.Builder(0)
+    b.StartObject(0)
+    assertRaises(self, lambda: b.PrependStructSlot(0, 1, 0),
+                 flatbuffers.builder.StructIsNotInlineError)
 
-    def test_create_string_is_nested_error(self):
-        b = flatbuffers.Builder(0)
-        b.StartObject(0)
-        s = 'test1'
-        assertRaises(self, lambda: b.CreateString(s),
-                     flatbuffers.builder.IsNestedError)
+  def test_unreachable_error(self):
+    b = flatbuffers.Builder(0)
+    assertRaises(self, lambda: b.PrependUOffsetTRelative(1),
+                 flatbuffers.builder.OffsetArithmeticError)
 
-    def test_create_byte_vector_is_nested_error(self):
-        b = flatbuffers.Builder(0)
-        b.StartObject(0)
-        s = b'test1'
-        assertRaises(self, lambda: b.CreateByteVector(s),
-                     flatbuffers.builder.IsNestedError)
+  def test_create_string_is_nested_error(self):
+    b = flatbuffers.Builder(0)
+    b.StartObject(0)
+    s = 'test1'
+    assertRaises(self, lambda: b.CreateString(s),
+                 flatbuffers.builder.IsNestedError)
 
-    def test_finished_bytes_error(self):
-        b = flatbuffers.Builder(0)
-        assertRaises(self, lambda: b.Output(),
-                     flatbuffers.builder.BuilderNotFinishedError)
+  def test_create_byte_vector_is_nested_error(self):
+    b = flatbuffers.Builder(0)
+    b.StartObject(0)
+    s = b'test1'
+    assertRaises(self, lambda: b.CreateByteVector(s),
+                 flatbuffers.builder.IsNestedError)
+
+  def test_finished_bytes_error(self):
+    b = flatbuffers.Builder(0)
+    assertRaises(self, lambda: b.Output(),
+                 flatbuffers.builder.BuilderNotFinishedError)
 
 
 class TestFixedLengthArrays(unittest.TestCase):
-    def test_fixed_length_array(self):
-        builder = flatbuffers.Builder(0)
 
-        a = 0.5
-        b = range(0, 15)
-        c = 1
-        d_a = [[1, 2], [3, 4]]
-        d_b = [MyGame.Example.TestEnum.TestEnum.B, \
-                MyGame.Example.TestEnum.TestEnum.C]
-        d_c = [[MyGame.Example.TestEnum.TestEnum.A, \
-                MyGame.Example.TestEnum.TestEnum.B], \
-                [MyGame.Example.TestEnum.TestEnum.C, \
-                 MyGame.Example.TestEnum.TestEnum.B]]
-        d_d = [[-1, 1], [-2, 2]]
-        e = 2
-        f = [-1, 1]
+  def test_fixed_length_array(self):
+    builder = flatbuffers.Builder(0)
 
-        arrayOffset = MyGame.Example.ArrayStruct.CreateArrayStruct(builder, \
-            a, b, c, d_a, d_b, d_c, d_d, e, f)
-
-        # Create a table with the ArrayStruct.
-        MyGame.Example.ArrayTable.ArrayTableStart(builder)
-        MyGame.Example.ArrayTable.ArrayTableAddA(builder, arrayOffset)
-        tableOffset = MyGame.Example.ArrayTable.ArrayTableEnd(builder)
-
-        builder.Finish(tableOffset)
-
-        buf = builder.Output()
-
-        table = MyGame.Example.ArrayTable.ArrayTable.GetRootAsArrayTable(buf, 0)
-
-        # Verify structure.
-        nested = MyGame.Example.NestedStruct.NestedStruct()
-        self.assertEqual(table.A().A(), 0.5)
-        self.assertEqual(table.A().B(), \
-            [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14])
-        self.assertEqual(table.A().C(), 1)
-        self.assertEqual(table.A().D(nested, 0).A(), [1, 2])
-        self.assertEqual(table.A().D(nested, 1).A(), [3, 4])
-        self.assertEqual(table.A().D(nested, 0).B(), \
-            MyGame.Example.TestEnum.TestEnum.B)
-        self.assertEqual(table.A().D(nested, 1).B(), \
-            MyGame.Example.TestEnum.TestEnum.C)
-        self.assertEqual(table.A().D(nested, 0).C(), \
-            [MyGame.Example.TestEnum.TestEnum.A, \
-             MyGame.Example.TestEnum.TestEnum.B])
-        self.assertEqual(table.A().D(nested, 1).C(), \
+    a = 0.5
+    b = range(0, 15)
+    c = 1
+    d_a = [[1, 2], [3, 4]]
+    d_b = [MyGame.Example.TestEnum.TestEnum.B, \
+            MyGame.Example.TestEnum.TestEnum.C]
+    d_c = [[MyGame.Example.TestEnum.TestEnum.A, \
+            MyGame.Example.TestEnum.TestEnum.B], \
             [MyGame.Example.TestEnum.TestEnum.C, \
-             MyGame.Example.TestEnum.TestEnum.B])
-        self.assertEqual(table.A().D(nested, 0).D(), [-1, 1])
-        self.assertEqual(table.A().D(nested, 1).D(), [-2, 2])
-        self.assertEqual(table.A().E(), 2)
-        self.assertEqual(table.A().F(), [-1, 1])
+             MyGame.Example.TestEnum.TestEnum.B]]
+    d_d = [[-1, 1], [-2, 2]]
+    e = 2
+    f = [-1, 1]
+
+    arrayOffset = MyGame.Example.ArrayStruct.CreateArrayStruct(builder, \
+        a, b, c, d_a, d_b, d_c, d_d, e, f)
+
+    # Create a table with the ArrayStruct.
+    MyGame.Example.ArrayTable.Start(builder)
+    MyGame.Example.ArrayTable.AddA(builder, arrayOffset)
+    tableOffset = MyGame.Example.ArrayTable.End(builder)
+
+    builder.Finish(tableOffset)
+
+    buf = builder.Output()
+
+    table = MyGame.Example.ArrayTable.ArrayTable.GetRootAs(buf)
+
+    # Verify structure.
+    nested = MyGame.Example.NestedStruct.NestedStruct()
+    self.assertEqual(table.A().A(), 0.5)
+    self.assertEqual(table.A().B(), \
+        [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14])
+    self.assertEqual(table.A().C(), 1)
+    self.assertEqual(table.A().D(nested, 0).A(), [1, 2])
+    self.assertEqual(table.A().D(nested, 1).A(), [3, 4])
+    self.assertEqual(table.A().D(nested, 0).B(), \
+        MyGame.Example.TestEnum.TestEnum.B)
+    self.assertEqual(table.A().D(nested, 1).B(), \
+        MyGame.Example.TestEnum.TestEnum.C)
+    self.assertEqual(table.A().D(nested, 0).C(), \
+        [MyGame.Example.TestEnum.TestEnum.A, \
+         MyGame.Example.TestEnum.TestEnum.B])
+    self.assertEqual(table.A().D(nested, 1).C(), \
+        [MyGame.Example.TestEnum.TestEnum.C, \
+         MyGame.Example.TestEnum.TestEnum.B])
+    self.assertEqual(table.A().D(nested, 0).D(), [-1, 1])
+    self.assertEqual(table.A().D(nested, 1).D(), [-2, 2])
+    self.assertEqual(table.A().E(), 2)
+    self.assertEqual(table.A().F(), [-1, 1])
 
 
 def CheckAgainstGoldDataGo():
-    try:
-        gen_buf, gen_off = make_monster_from_generated_code()
-        fn = 'monsterdata_go_wire.mon'
-        if not os.path.exists(fn):
-            print('Go-generated data does not exist, failed.')
-            return False
+  try:
+    gen_buf, gen_off = make_monster_from_generated_code()
+    fn = 'monsterdata_go_wire.mon'
+    if not os.path.exists(fn):
+      print('Go-generated data does not exist, failed.')
+      return False
 
-        # would like to use a context manager here, but it's less
-        # backwards-compatible:
-        f = open(fn, 'rb')
-        go_wire_data = f.read()
-        f.close()
+    # would like to use a context manager here, but it's less
+    # backwards-compatible:
+    f = open(fn, 'rb')
+    go_wire_data = f.read()
+    f.close()
 
-        CheckReadBuffer(bytearray(go_wire_data), 0)
-        if not bytearray(gen_buf[gen_off:]) == bytearray(go_wire_data):
-            raise AssertionError('CheckAgainstGoldDataGo failed')
-    except:
-        print('Failed to test against Go-generated test data.')
-        return False
+    CheckReadBuffer(bytearray(go_wire_data), 0)
+    if not bytearray(gen_buf[gen_off:]) == bytearray(go_wire_data):
+      raise AssertionError('CheckAgainstGoldDataGo failed')
+  except:
+    print('Failed to test against Go-generated test data.')
+    return False
 
-    print('Can read Go-generated test data, and Python generates bytewise identical data.')
-    return True
+  print(
+      'Can read Go-generated test data, and Python generates bytewise identical data.'
+  )
+  return True
 
 
 def CheckAgainstGoldDataJava():
-    try:
-        gen_buf, gen_off = make_monster_from_generated_code()
-        fn = 'monsterdata_java_wire.mon'
-        if not os.path.exists(fn):
-            print('Java-generated data does not exist, failed.')
-            return False
-        f = open(fn, 'rb')
-        java_wire_data = f.read()
-        f.close()
+  try:
+    gen_buf, gen_off = make_monster_from_generated_code()
+    fn = 'monsterdata_java_wire.mon'
+    if not os.path.exists(fn):
+      print('Java-generated data does not exist, failed.')
+      return False
+    f = open(fn, 'rb')
+    java_wire_data = f.read()
+    f.close()
 
-        CheckReadBuffer(bytearray(java_wire_data), 0)
-    except:
-        print('Failed to read Java-generated test data.')
-        return False
+    CheckReadBuffer(bytearray(java_wire_data), 0)
+  except:
+    print('Failed to read Java-generated test data.')
+    return False
 
-    print('Can read Java-generated test data.')
-    return True
+  print('Can read Java-generated test data.')
+  return True
 
 
 class LCG(object):
-    ''' Include simple random number generator to ensure results will be the
+  """ Include simple random number generator to ensure results will be the
+
         same cross platform.
-        http://en.wikipedia.org/wiki/Park%E2%80%93Miller_random_number_generator '''
+        http://en.wikipedia.org/wiki/Park%E2%80%93Miller_random_number_generator
+        """
 
-    __slots__ = ['n']
+  __slots__ = ['n']
 
-    InitialLCGSeed = 48271
+  InitialLCGSeed = 48271
 
-    def __init__(self):
-        self.n = self.InitialLCGSeed
+  def __init__(self):
+    self.n = self.InitialLCGSeed
 
-    def Reset(self):
-        self.n = self.InitialLCGSeed
+  def Reset(self):
+    self.n = self.InitialLCGSeed
 
-    def Next(self):
-        self.n = ((self.n * 279470273) % 4294967291) & 0xFFFFFFFF
-        return self.n
+  def Next(self):
+    self.n = ((self.n * 279470273) % 4294967291) & 0xFFFFFFFF
+    return self.n
 
 
 def BenchmarkVtableDeduplication(count):
-    '''
+  """
     BenchmarkVtableDeduplication measures the speed of vtable deduplication
     by creating `prePop` vtables, then populating `count` objects with a
     different single vtable.
 
     When count is large (as in long benchmarks), memory usage may be high.
-    '''
+    """
 
-    for prePop in (1, 10, 100, 1000):
-        builder = flatbuffers.Builder(0)
-        n = 1 + int(math.log(prePop, 1.5))
+  for prePop in (1, 10, 100, 1000):
+    builder = flatbuffers.Builder(0)
+    n = 1 + int(math.log(prePop, 1.5))
 
-        # generate some layouts:
-        layouts = set()
-        r = list(compat_range(n))
-        while len(layouts) < prePop:
-            layouts.add(tuple(sorted(random.sample(r, int(max(1, n / 2))))))
+    # generate some layouts:
+    layouts = set()
+    r = list(compat_range(n))
+    while len(layouts) < prePop:
+      layouts.add(tuple(sorted(random.sample(r, int(max(1, n / 2))))))
 
-        layouts = list(layouts)
+    layouts = list(layouts)
 
-        # pre-populate vtables:
-        for layout in layouts:
-            builder.StartObject(n)
-            for j in layout:
-                builder.PrependInt16Slot(j, j, 0)
-            builder.EndObject()
+    # pre-populate vtables:
+    for layout in layouts:
+      builder.StartObject(n)
+      for j in layout:
+        builder.PrependInt16Slot(j, j, 0)
+      builder.EndObject()
 
-        # benchmark deduplication of a new vtable:
-        def f():
-            layout = random.choice(layouts)
-            builder.StartObject(n)
-            for j in layout:
-                builder.PrependInt16Slot(j, j, 0)
-            builder.EndObject()
-
-        duration = timeit.timeit(stmt=f, number=count)
-        rate = float(count) / duration
-        print(('vtable deduplication rate (n=%d, vtables=%d): %.2f sec' % (
-            prePop,
-            len(builder.vtables),
-            rate))
-        )
-
-
-def BenchmarkCheckReadBuffer(count, buf, off):
-    '''
-    BenchmarkCheckReadBuffer measures the speed of flatbuffer reading
-    by re-using the CheckReadBuffer function with the gold data.
-    '''
-
+    # benchmark deduplication of a new vtable:
     def f():
-        CheckReadBuffer(buf, off)
+      layout = random.choice(layouts)
+      builder.StartObject(n)
+      for j in layout:
+        builder.PrependInt16Slot(j, j, 0)
+      builder.EndObject()
 
     duration = timeit.timeit(stmt=f, number=count)
     rate = float(count) / duration
-    data = float(len(buf) * count) / float(1024 * 1024)
-    data_rate = data / float(duration)
+    print(('vtable deduplication rate (n=%d, vtables=%d): %.2f sec' %
+           (prePop, len(builder.vtables), rate)))
 
-    print(('traversed %d %d-byte flatbuffers in %.2fsec: %.2f/sec, %.2fMB/sec')
-          % (count, len(buf), duration, rate, data_rate))
+
+def BenchmarkCheckReadBuffer(count, buf, off):
+  """
+    BenchmarkCheckReadBuffer measures the speed of flatbuffer reading
+    by re-using the CheckReadBuffer function with the gold data.
+    """
+
+  def f():
+    CheckReadBuffer(buf, off)
+
+  duration = timeit.timeit(stmt=f, number=count)
+  rate = float(count) / duration
+  data = float(len(buf) * count) / float(1024 * 1024)
+  data_rate = data / float(duration)
+
+  print(('traversed %d %d-byte flatbuffers in %.2fsec: %.2f/sec, %.2fMB/sec') %
+        (count, len(buf), duration, rate, data_rate))
 
 
 def BenchmarkMakeMonsterFromGeneratedCode(count, length):
-    '''
+  """
     BenchmarkMakeMonsterFromGeneratedCode measures the speed of flatbuffer
     creation by re-using the make_monster_from_generated_code function for
     generating gold data examples.
-    '''
+    """
 
-    duration = timeit.timeit(stmt=make_monster_from_generated_code,
-                             number=count)
-    rate = float(count) / duration
-    data = float(length * count) / float(1024 * 1024)
-    data_rate = data / float(duration)
+  duration = timeit.timeit(stmt=make_monster_from_generated_code, number=count)
+  rate = float(count) / duration
+  data = float(length * count) / float(1024 * 1024)
+  data_rate = data / float(duration)
 
-    print(('built %d %d-byte flatbuffers in %.2fsec: %.2f/sec, %.2fMB/sec' % \
-           (count, length, duration, rate, data_rate)))
+  print(('built %d %d-byte flatbuffers in %.2fsec: %.2f/sec, %.2fMB/sec' % \
+         (count, length, duration, rate, data_rate)))
 
 
 def backward_compatible_run_tests(**kwargs):
-    if PY_VERSION < (2, 6):
-        sys.stderr.write("Python version less than 2.6 are not supported")
-        sys.stderr.flush()
+  if PY_VERSION < (2, 6):
+    sys.stderr.write('Python version less than 2.6 are not supported')
+    sys.stderr.flush()
+    return False
+
+  # python2.6 has a reduced-functionality unittest.main function:
+  if PY_VERSION == (2, 6):
+    try:
+      unittest.main(**kwargs)
+    except SystemExit as e:
+      if not e.code == 0:
         return False
-
-    # python2.6 has a reduced-functionality unittest.main function:
-    if PY_VERSION == (2, 6):
-        try:
-            unittest.main(**kwargs)
-        except SystemExit as e:
-            if not e.code == 0:
-                return False
-        return True
-
-    # python2.7 and above let us not exit once unittest.main is run:
-    kwargs['exit'] = False
-    kwargs['verbosity'] = 0
-    ret = unittest.main(**kwargs)
-    if ret.result.errors or ret.result.failures:
-        return False
-
     return True
 
+  # python2.7 and above let us not exit once unittest.main is run:
+  kwargs['exit'] = False
+  kwargs['verbosity'] = 0
+  ret = unittest.main(**kwargs)
+  if ret.result.errors or ret.result.failures:
+    return False
+
+  return True
+
+
 def main():
-    import os
-    import sys
-    if not len(sys.argv) == 4:
-       sys.stderr.write('Usage: %s <benchmark vtable count>'
-                        '<benchmark read count> <benchmark build count>\n'
-                        % sys.argv[0])
-       sys.stderr.write('       Provide COMPARE_GENERATED_TO_GO=1   to check'
-                        'for bytewise comparison to Go data.\n')
-       sys.stderr.write('       Provide COMPARE_GENERATED_TO_JAVA=1 to check'
-                        'for bytewise comparison to Java data.\n')
-       sys.stderr.flush()
-       sys.exit(1)
+  import os
+  import sys
+  if not len(sys.argv) == 5:
+    sys.stderr.write('Usage: %s <benchmark vtable count> '
+                     '<benchmark read count> <benchmark build count> '
+                     '<is_onefile>\n' % sys.argv[0])
+    sys.stderr.write('       Provide COMPARE_GENERATED_TO_GO=1   to check'
+                     'for bytewise comparison to Go data.\n')
+    sys.stderr.write('       Provide COMPARE_GENERATED_TO_JAVA=1 to check'
+                     'for bytewise comparison to Java data.\n')
+    sys.stderr.flush()
+    sys.exit(1)
 
-    kwargs = dict(argv=sys.argv[:-3])
+  kwargs = dict(argv=sys.argv[:-4])
 
-    # show whether numpy is present, as it changes the test logic:
-    try:
-        import numpy
-        print('numpy available')
-    except ImportError:
-        print('numpy not available')
+  create_namespace_shortcut(sys.argv[4].lower() == 'true')
 
-    # run tests, and run some language comparison checks if needed:
-    success = backward_compatible_run_tests(**kwargs)
-    if success and os.environ.get('COMPARE_GENERATED_TO_GO', 0) == "1":
-        success = success and CheckAgainstGoldDataGo()
-    if success and os.environ.get('COMPARE_GENERATED_TO_JAVA', 0) == "1":
-        success = success and CheckAgainstGoldDataJava()
+  # show whether numpy is present, as it changes the test logic:
+  try:
+    import numpy
+    print('numpy available')
+  except ImportError:
+    print('numpy not available')
 
-    if not success:
-        sys.stderr.write('Tests failed, skipping benchmarks.\n')
-        sys.stderr.flush()
-        sys.exit(1)
+  # run tests, and run some language comparison checks if needed:
+  success = backward_compatible_run_tests(**kwargs)
+  if success and os.environ.get('COMPARE_GENERATED_TO_GO', 0) == '1':
+    success = success and CheckAgainstGoldDataGo()
+  if success and os.environ.get('COMPARE_GENERATED_TO_JAVA', 0) == '1':
+    success = success and CheckAgainstGoldDataJava()
 
-    # run benchmarks (if 0, they will be a noop):
-    bench_vtable = int(sys.argv[1])
-    bench_traverse = int(sys.argv[2])
-    bench_build = int(sys.argv[3])
-    if bench_vtable:
-        BenchmarkVtableDeduplication(bench_vtable)
-    if bench_traverse:
-        buf, off = make_monster_from_generated_code()
-        BenchmarkCheckReadBuffer(bench_traverse, buf, off)
-    if bench_build:
-        buf, off = make_monster_from_generated_code()
-        BenchmarkMakeMonsterFromGeneratedCode(bench_build, len(buf))
+  if not success:
+    sys.stderr.write('Tests failed, skipping benchmarks.\n')
+    sys.stderr.flush()
+    sys.exit(1)
+
+  # run benchmarks (if 0, they will be a noop):
+  bench_vtable = int(sys.argv[1])
+  bench_traverse = int(sys.argv[2])
+  bench_build = int(sys.argv[3])
+  if bench_vtable:
+    BenchmarkVtableDeduplication(bench_vtable)
+  if bench_traverse:
+    buf, off = make_monster_from_generated_code()
+    BenchmarkCheckReadBuffer(bench_traverse, buf, off)
+  if bench_build:
+    buf, off = make_monster_from_generated_code()
+    BenchmarkMakeMonsterFromGeneratedCode(bench_build, len(buf))
+
 
 if __name__ == '__main__':
-    main()
+  main()