input: Write a python function to get the value of an argument from a request object.
  assert getarg({"args": {b"name": [b"John"]}}, b"name") == b"John"
  assert getarg({"args": {b"name": [b"John"]}}, b"name", type=str) == "John"
  assert getarg({"args": {b"name": [b"John"]}}, b"age", default=25) == 25
  assert getarg({"args": {b"name": [b"John"]}}, b"name", default="Unknown", type=str) == "John"
output: def getarg(request, name, default=None, type=None):
      args = request.get("args", {})
      value = args.get(name, [default])[0]
      if type and value is not None:
          value = type(value)
      return value