code: def _execute_map(cls, ctx, op: "TensorBinCount"):
      input_val = ctx[op.inputs[0].key]
      if op.weights is not None:
          weights_val = ctx[op.weights.key]
          df = pd.DataFrame({"data": input_val, "weights": weights_val})
          res = df.groupby("data")["weights"].sum()
      else:
          res = pd.Series(input_val).groupby(input_val).count()
  
      if res.index.min() < 0:
          raise ValueError(
              "'list' argument must have no negative elements"
          )
  
      left_bound = 0
      for target_idx in range(op.chunk_count):
          right_bound = res.index.searchsorted(
              (1 + target_idx) * op.chunk_size_limit, "left"
          )
          sliced = res.iloc[left_bound:right_bound]
          if len(sliced) > 0:
              ctx[op.outputs[0].key, (target_idx,)] = sliced
          else:
              # ensure all mapper data are inserted context
              ctx[op.outputs[0].key, (target_idx,)] = None
          left_bound = right_bound
  
imports: import itertools
  import functools
  from typing import Optional
  import numpy
  import pandas
  from ...None import opcodes, options, get_context
  from ...core import recursive_tile, OutputType
  from ...core.operand import OperandStage
  from ...serialization.serializables import Int64Field, ReferenceField
  from ...utils import ceildiv, has_unknown_shape
  from ..datasource import tensor
  from ..operands import TensorOperandMixin, TensorMapReduceOperand
label_desc: Use image node_id 5 for calling the TensorBinCount obj's underlying member method code with example usage: obj._execute_map(cls, ctx, op) without return types