docs: def fast_maxwell_boltzmann(mass, file_name=None,
                             return_code=False):
      r"""Return a function that returns values of a Maxwell-Boltzmann
      distribution.
  
      >>> from fast import Atom
      >>> mass = Atom("Rb", 87).mass
      >>> f = fast_maxwell_boltzmann(mass)
      >>> print f(0, 273.15+20)
      0.00238221482739
  
      >>> import numpy as np
      >>> v = np.linspace(-600, 600, 101)
      >>> dist = f(v, 273.15+20)
      >>> dv = v[1]-v[0]
      >>> print sum(dist)*dv
      0.999704711134
  
      """
      # We get the mass of the atom.
      code = ""
      code = "def maxwell_boltzmann(v, T):\n"
      code += '    r"""A fast calculation of the'
      code += ' Maxwell-Boltzmann distribution."""\n'
      code += "    if hasattr(v, 'shape'):\n"
      code += "        d = 1\n"
      code += "        m = %s\n" % mass
      code += "        f = np.sqrt(m/2/np.pi/k_B_num/T)**d\n"
      code += "        f = f * np.exp(-m*v**2/2/k_B_num/T)\n"
      code += "        return f\n"
      code += "    elif hasattr(v, '__len__'):\n"
      code += "        d = len(v)\n"
      code += "        m = %s\n" % mass
      code += "        f = np.sqrt(m/2/np.pi/k_B_num/T)**d\n"
      code += "        vsquare = sum([v[i]**2 for i in range(d)])\n"
      code += "        f = f * np.exp(-m*vsquare/2/k_B_num/T)\n"
      code += "        return f\n"
      code += "    else:\n"
      code += "        d = 1\n"
      code += "        m = %s\n" % mass
      code += "        f = np.sqrt(m/2/np.pi/k_B_num/T)**d\n"
      code += "        f = f * np.exp(-m*v**2/2/k_B_num/T)\n"
      code += "        return f\n"
  
      # We write the code to file if provided, and execute it.
      if file_name is not None:
          f = file(file_name+".py", "w")
          f.write(code)
          f.close()
  
      maxwell_boltzmann = code
      if not return_code:
          exec maxwell_boltzmann
  
      return maxwell_boltzmann