parse_size#

Run commands and agent-written programs inside an operating-system boundary. See the guide.

zett_agent.sandbox.session.parse_size(value, name='size')[源代码]#

Turn "512MB", "1.5G" or a byte count into bytes.

K, M, G and T (with or without B or iB, in any case) are powers of 1024, which is how memory is counted everywhere else in this package. A bare number is bytes.

抛出:

SandboxPolicyError -- If the value is not a size.

参数:
  • value (int | str)

  • name (str)

返回类型:

int