code: def strip_line_magic(cls, line, magics_allowed):
          
          if PYTHON_MAJOR_VERSION == 2: # Python 2
              stripped,magic_kind = cls.strip_line_magic_v2(line)
          else: # Python 3+
              stripped,magic_kind = cls.strip_line_magic_v3(line)
          if line == stripped:
              printd("No line magic pattern match in '%s'" % line)
          if magic_kind and magic_kind not in magics_allowed:
              stripped = "" # If the part after the magic won't work,
                            # just get rid of it
          return stripped
docs: Handles lines that contain get_ipython.run_line_magic() commands