code: def main(unused_argv):
      # Setup Beam
  
      # Here, we use a local Beam runner.
      # For a truly distributed calculation, connect to a Beam cluster (e.g.
      # running on some cloud provider).
      runner = fn_api_runner.FnApiRunner()  # Local Beam runner
      with beam.Pipeline(runner=runner) as pipeline:
          # Define the privacy budget available for our computation.
          budget_accountant = pipeline_dp.NaiveBudgetAccountant(
              total_epsilon=1, total_delta=1e-6
          )
  
          # Load and parse input data
          df = pd.read_csv(FLAGS.input_file)
          df.rename(
              inplace=True,
              columns={
                  "VisitorId": "user_id",
                  "Time entered": "enter_time",
                  "Time spent (minutes)": "spent_minutes",
                  "Money spent (euros)": "spent_money",
                  "Day": "day",
              },
          )
          restaraunt_visits_rows = [
              index_row[1] for index_row in df.iterrows()
          ]
          beam_data = pipeline | beam.Create(restaraunt_visits_rows)
  
          # Wrap Beam's PCollection into it's private version
          private_restaraunt_visits = (
              beam_data
              | private_beam.MakePrivate(
                  budget_accountant=budget_accountant,
                  privacy_id_extractor=lambda row: row.user_id,
              )
          )
  
          # Calculate the private sum
          dp_result = private_restaraunt_visits | private_beam.Sum(
              SumParams(
                  noise_kind=pipeline_dp.NoiseKind.GAUSSIAN,
                  max_partitions_contributed=7,
                  max_contributions_per_partition=2,
                  min_value=1,
                  max_value=100,
                  budget_weight=1,
                  partition_extractor=lambda row: row.day,
                  value_extractor=lambda row: row.spent_money,
              )
          )
          budget_accountant.compute_budgets()
  
          # Save the results
          dp_result | beam.io.WriteToText(FLAGS.output_file)
  
      return 0
  
file_path: pipelinedp/examples/restaurant_visits/run_on_beam.py
imports: from absl import app
  from absl import flags
  import apache_beam
  from apache_beam.runners.portability import fn_api_runner
  import pipeline_dp
  from pipeline_dp import private_beam
  from pipeline_dp import SumParams
  import pandas
label_desc: Use image node_id 1 for calling a global function with example usage: main(unused_argv) and returns: int