code: def test_bitwise_6311() -> None:
      df = pl.DataFrame({"col1": [0, 1, 2, 3], "flag": [0, 0, 0, 0]})
  
      assert (
          df.with_columns(
              pl.when((pl.col("col1") < 1) | (pl.col("col1") >= 3))
              .then(pl.col("flag") | 2)  # set flag b0010
              .otherwise(pl.col("flag"))
          ).with_columns(
              pl.when(pl.col("col1") > -1)
              .then(pl.col("flag") | 4)
              .otherwise(pl.col("flag"))
          )
      ).to_dict(as_series=False) == {
          "col1": [0, 1, 2, 3],
          "flag": [6, 4, 4, 6],
      }
  
file_path: polars/py-polars/tests/unit/operations/test_arithmetic.py
imports: from datetime import date, datetime, timedelta
  import numpy
  import pytest
  import polars
  from polars.testing import assert_series_equal
label_desc: Use image node_id 12 for calling a global function with example usage: test_bitwise_6311() without return types