Load an extension. Use %extension --help for more details.
352643
def extension(line, cell=None):
  
  parser = _commands.CommandParser(prog='%extension', description="""
Load an extension into Datalab. Currently only mathjax is supported.
""")
  subparser = parser.subcommand('mathjax', 'Enabled MathJaX support in Datalab.')
  subparser.set_defaults(ext='mathjax')
  parser.set_defaults(func=_extension)
  return _utils.handle_magic_line(line, cell, parser)
1238909
public static ExtensionInfo load(String className, ClassLoader classLoader) {
        try (InputStream input = classLoader.getResourceAsStream(className.replace('.', '/') + ".class")) {
            ExtensionInfo info = new ExtensionInfo(className);
            new ClassReader(input).accept(new ExtensionVisitor(info), ClassReader.SKIP_DEBUG);

            return info;
        } catch (IOException e) {
            log.error(e.getMessage(), e);
            return null;
        }
    }
299013
def bind(self, extension: Extension) -> 'DictMentor':
        
        if not Extension.is_valid_extension(extension):
            raise ValueError("Cannot bind extension due to missing interface requirements")
        self._extensions.append(extension)

        return self
1063997
def add_extension(self, extension):
        
        if extension:
            extension_to_add = os.path.abspath(os.path.expanduser(extension))
            if os.path.exists(extension_to_add):
                self._extension_files.append(extension_to_add)
            else:
                raise IOError("Path to the extension doesn't exist")
        else:
            raise ValueError("argument can not be null")
71765
function loadCurrentVersion (options, context) {
  return new Extension(options, context).read()
    .then(function (response) {
      let version = response.sys.version;

      options.version = version;
      return options;
    });
}
1278839
def loadd(self, ava):
        

        if "attributes" in ava:
            for key, val in ava["attributes"].items():
                self.attributes[key] = val

        try:
            self.tag = ava["tag"]
        except KeyError:
            if not self.tag:
                raise KeyError("ExtensionElement must have a tag")

        try:
            self.namespace = ava["namespace"]
        except KeyError:
            if not self.namespace:
                raise KeyError("ExtensionElement must belong to a namespace")

        try:
            self.text = ava["text"]
        except KeyError:
            pass

        if "children" in ava:
            for item in ava["children"]:
                self.children.append(ExtensionElement(item["tag"]).loadd(item))

        return self
516239
def build_extension(self, ext):
        
        try:
            build_ext.build_ext.build_extension(self, ext)
        except (
            distutils.errors.CCompilerError,
            distutils.errors.DistutilsExecError,
            distutils.errors.DistutilsPlatformError,
            ValueError,
        ):
            raise BuildFailed()
73720
def load(cls, path):
        """"""
        assert os.path.exists(path), "No such file: %r" % path

        (folder, filename) = os.path.split(path)
        (name, extension) = os.path.splitext(filename)

        image = Image(None)
        image._path = path
        image._format = Image.image_format(extension)

        return image
140512
def load(self, file, name=None):
        """"""
        if name is None:
            name = self.format_from_extension(op.splitext(file)[1])
        file_format = self.file_type(name)
        if file_format == 'text':
            return _read_text(file)
        elif file_format == 'json':
            return _read_json(file)
        else:
            load_function = self._formats[name].get('load', None)
            if load_function is None:
                raise IOError("The format must declare a file type or "
                              "load/save functions.")
            return load_function(file)
562703
public function loadExtension(Extension $extension, array $options = [], $safe = false)
    {
        $this->fire('f.extension.load', $extension, $options, $safe);

        return $this;
    }
600170
public <T> void load(ExtensionRepository<T> repository, Class<T> extensionType) {
//		loadExtensionFromPackage(repository, extensionType, getDefaultScanPackage());
//		String customScanPackage = getCustomScanPackage();
//		if (!Strings.isNullOrEmpty(customScanPackage)) {
//			loadExtensionFromPackage(repository, extensionType, customScanPackage);
//		}
		loadMetricsFromSPI(repository, extensionType);
	}
54114
private static Object loadExtension(Extension extension, ClassLoaderPlugin classLoaderPlugin)
   {
      try
      {
         Class<?> c = classLoaderPlugin.loadClass(extension.getClassName(),
               extension.getModuleName(), extension.getModuleSlot());
         return c.newInstance();
      }
      catch (Throwable t)
      {
         log.tracef("Throwable while loading %s using own classloader: %s", extension.getClassName(), t.getMessage());
      }

      return null;
   }
1190038
def join_ext(name, extension):
    
    if extension[0] == EXT:
        ret = name + extension
    else:
        ret = name + EXT + extension
    return ret
478681
def _register_extensions(self, namespace):
        """"""

        # Register any extension classes for this class.
        extmanager = ExtensionManager(
            'extensions.classes.{}'.format(namespace),
            propagate_map_exceptions=True
        )

        if extmanager.extensions:
            extmanager.map(util.register_extension_class, base=self)

        # Register any extension methods for this class.
        extmanager = ExtensionManager(
            'extensions.methods.{}'.format(namespace),
            propagate_map_exceptions=True
        )
        if extmanager.extensions:
            extmanager.map(util.register_extension_method, base=self)
989235
protected function loadExtensions()
    {
        if ($this->extensionsLoaded) {
            return;
        }
        foreach ($this->extensions as $extension) {
            foreach ($extension->getTags() as $tag) {
                if (!$tag instanceof TagInterface) {
                    throw new Html2PdfException('The ExtensionInterface::getTags() method must return an array of TagInterface.');
                }
                $this->addTagObject($tag);
            }
        }

        $this->extensionsLoaded = true;
    }
963029
public static function assumeExtensionLoaded($extension, $message = ''): void
    {
        assumeThat(\extension_loaded($extension), is(true), $message);
    }
233114
async def jsk_load(self, ctx: commands.Context, *extensions: ExtensionConverter):
        

        paginator = commands.Paginator(prefix='', suffix='')

        for extension in itertools.chain(*extensions):
            method, icon = (
                (self.bot.reload_extension, "\N{CLOCKWISE RIGHTWARDS AND LEFTWARDS OPEN CIRCLE ARROWS}")
                if extension in self.bot.extensions else
                (self.bot.load_extension, "\N{INBOX TRAY}")
            )

            try:
                method(extension)
            except Exception as exc:  # pylint: disable=broad-except
                traceback_data = ''.join(traceback.format_exception(type(exc), exc, exc.__traceback__, 1))

                paginator.add_line(
                    f"{icon}\N{WARNING SIGN} `{extension}`\n```py\n{traceback_data}\n```",
                    empty=True
                )
            else:
                paginator.add_line(f"{icon} `{extension}`", empty=True)

        for page in paginator.pages:
            await ctx.send(page)