docs: def import_formulas(self):
          """
          Import formulas specified in :attr:`parameters`.
  
          :returns: formulas
          :rtype: dict
          """
          # TODO: unit tests!
          # TODO: move this to somewhere else and call it "importy", maybe
          # core.__init__.py since a lot of modules might use it.
          module = self.meta.module  # module read from parameters
          package = getattr(self.meta, 'package', None)  # package read from meta
          name = package + module if package else module  # concat pkg + name
          path = getattr(self.meta, 'path', None)  # path read from parameters
          # import module using module and package
          mod = None
          # SEE ALSO: http://docs.python.org/2/library/imp.html#examples
          try:
              # fast path: see if module was already imported
              mod = sys.modules[name]
          except KeyError:
              try:
                  # import module specified in parameters
                  mod = importlib.import_module(module, package)
              except ImportError as err:
                  if not path:
                      msg = ('%s could not be imported either because it was not '
                             'on the PYTHONPATH or path was not given.')
                      LOGGER.exception(msg, name)
                      raise err
                  else:
                      # import module using path
                      # expand ~, environmental variables and make path absolute
                      if not os.path.isabs(path):
                          path = os.path.expanduser(os.path.expandvars(path))
                          path = os.path.abspath(path)
                      # paths must be a list
                      paths = [path]
                      # imp does not find hierarchical module names, find and load
                      # packages recursively, then load module, see last paragraph
                      # https://docs.python.org/2/library/imp.html#imp.find_module
                      pname = ''  # full dotted name of package to load
                      # traverse namespace
                      while name:
                          # if dot in name get first package
                          if '.' in name:
                              pkg, name = name.split('.', 1)
                          else:
                              pkg, name = name, None  # pkg is the module
                          # Find package or module by name and path
                          fp, filename, desc = imp.find_module(pkg, paths)
                          # full dotted name of package to load
                          pname = pkg if not pname else '%s.%s' % (pname, pkg)
                          LOGGER.debug('package name: %s', pname)
                          # try to load the package or module
                          try:
                              mod = imp.load_module(pname, fp, filename, desc)
                          finally:
                              if fp:
                                  fp.close()
                          # append package paths for imp.find_module
                          if name:
                              paths = mod.__path__
          formulas = {}  # an empty list of formulas
          formula_param = self.parameters  # formulas key
          # FYI: iterating over dictionary is equivalent to iterkeys()
          if isinstance(formula_param, (list, tuple, dict)):
              # iterate through formulas
              for f in formula_param:
                  formulas[f] = getattr(mod, f)
          elif isinstance(formula_param, basestring):
              # only one formula
              # FYI: use basestring to test for str and unicode
              # SEE: http://docs.python.org/2/library/functions.html#basestring
              formulas[formula_param] = getattr(mod, formula_param)
          else:
              # autodetect formulas assuming first letter is f
              formulas = {f: getattr(mod, f) for f in dir(mod) if f[:2] == 'f_'}
          if not len(formulas):
              for f in dir(mod):
                  mod_attr = getattr(mod, f)
                  if inspect.isfunction(mod_attr):
                      formulas[f] = mod_attr
          return formulas