def __init__(self, shard_spec):
    """
    :param string shard_spec: A string of the form M/N where M, N are ints and 0 <= M < N.
    """
    def ensure_int(s):
      try:
        return int(s)
      except __HOLE__:
        raise self.InvalidShardSpec(shard_spec)

    if shard_spec is None:
      raise self.InvalidShardSpec('None')
    shard_str, _, nshards_str = shard_spec.partition('/')
    self._shard = ensure_int(shard_str)
    self._nshards = ensure_int(nshards_str)

    if self._shard < 0 or self._shard >= self._nshards:
      raise self.InvalidShardSpec(shard_spec)
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/base/hash_utils.py/Sharder.__init__