class_docstr: :class:`AbstractSampler` is a abstract class, all sampler should inherit from it. This sampler supports returning
  a certain number of random value_ids according to the input key_id, and it also supports to prohibit
  certain key-value pairs by setting used_ids.
  
  Args:
      distribution (str): The string of distribution, which is used for subclass.
  
  Attributes:
      used_ids (numpy.ndarray): The result of :meth:`get_used_ids`.
class_docstr_tok: [":","class",":","`","AbstractSampler","`","is","a","abstract","class",",","all","sampler","should","inherit","from","it",".","This","sampler","supports","returning","a","certain","number","of","random","value_ids","according","to","the","input","key_id",",","and","it","also","supports","to","prohibit","certain","key-value","pairs","by","setting","used_ids",".","Args",":","distribution","(","str",")",":","The","string","of","distribution",",","which","is","used","for","subclass",".","Attributes",":","used_ids","(","numpy.ndarray",")",":","The","result","of",":","meth",":","`","get_used_ids","`","."]
docstr: Set the distribution of sampler.
  
  Args:
      distribution (str): Distribution of the negative items.
docstr_tok: ["Set","the","distribution","of","sampler",".","Args",":","distribution","(","str",")",":","Distribution","of","the","negative","items","."]
code: def set_distribution(self, distribution):
      """Set the distribution of sampler.
  
      Args:
          distribution (str): Distribution of the negative items.
      """
      self.distribution = distribution
      if distribution == "popularity":
          self._build_alias_table()
  
imports: import copy
  import numpy
  from numpy.random import sample
  import torch
  from collections import Counter
label_desc: Use image node_id 2 for calling the AbstractSampler obj's underlying member method code with example usage: obj.set_distribution(distribution) without return types