MCPcopy Create free account
hub / github.com/apache/fory / create_sample

Function create_sample

benchmarks/python/benchmark.py:299–329  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

297
298
299def create_sample() -> Sample:
300 return Sample(
301 int_value=123,
302 long_value=1230000,
303 float_value=12.345,
304 double_value=1.234567,
305 short_value=12345,
306 char_value=ord("!"),
307 boolean_value=True,
308 int_value_boxed=321,
309 long_value_boxed=3210000,
310 float_value_boxed=54.321,
311 double_value_boxed=7.654321,
312 short_value_boxed=32100,
313 char_value_boxed=ord("$"),
314 boolean_value_boxed=False,
315 int_array=int32_array([-1234, -123, -12, -1, 0, 1, 12, 123, 1234]),
316 long_array=int64_array(
317 [-123400, -12300, -1200, -100, 0, 100, 1200, 12300, 123400]
318 ),
319 float_array=float32_array(
320 [-12.34, -12.3, -12.0, -1.0, 0.0, 1.0, 12.0, 12.3, 12.34]
321 ),
322 double_array=float64_array(
323 [-1.234, -1.23, -12.0, -1.0, 0.0, 1.0, 12.0, 1.23, 1.234]
324 ),
325 short_array=int32_array([-1234, -123, -12, -1, 0, 1, 12, 123, 1234]),
326 char_array=int32_array([ord(c) for c in "asdfASDF"]),
327 boolean_array=bool_array([True, False, False, True]),
328 string="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
329 )
330
331
332def create_media_content() -> MediaContent:

Callers 2

create_sample_listFunction · 0.70
create_benchmark_dataFunction · 0.70

Calls 6

int32_arrayFunction · 0.85
int64_arrayFunction · 0.85
float32_arrayFunction · 0.85
float64_arrayFunction · 0.85
bool_arrayFunction · 0.85
SampleClass · 0.70

Tested by

no test coverage detected