get an engine from string (engine class without Engine)
337922
def get_engine(name):
    

    name = name.capitalize() + 'Engine'
    if name in globals():
        return globals()[name]

    raise KeyError("engine '%s' does not exist" % name)
902341
public Object convertStringToObject(String string, String version) throws ClassNotFoundException
    {
        if ((string == null) || (string.length() == 0))
            return null;

        Object object  = null;
        try {
            InputStream reader = new ByteArrayInputStream(string.getBytes(BundleConstants.OBJECT_ENCODING));//Constants.STRING_ENCODING));
            ObjectInputStream inStream = new ObjectInputStream(reader);
            object = inStream.readObject();
            reader.close();
            inStream.close();
        } catch (ClassNotFoundException e) {
            if (this.getClassFinder(null) != null)
            {
                String className = null;
                int startClass = e.getMessage().indexOf('\'') + 1;
                int endClass = e.getMessage().indexOf('\'', startClass);
                if (endClass != -1)
                    className = e.getMessage().substring(startClass, endClass);
                object = this.getClassFinder(null).findConvertStringToObject(className, version, string);	// Try to find this class in the obr repos
            }
            if (object == null)
                throw e;
        } catch (IOException e) {
            e.printStackTrace();    // Never
        }

        return object;
    }
654733
def fromstring(cls, string):
        
        parser = etree.XMLParser(remove_blank_text=True)
        root = etree.fromstring(string, parser)
        tree = root.getroottree()

        return cls.fromtree(tree)
1240575
def from_string(cls, string):
        
        items = shlex.split(string, **cls.split_args)
        return cls(items)
149304
protected String extractEngineName(String requestUrl) {

    Matcher matcher = ENGINE_REQUEST_URL_PATTERN.matcher(requestUrl);

    if (matcher.find()) {
      return matcher.group(1);
    } else {
      // any request that does not match a specific engine and is not an /engine request
      // is mapped to the default engine
      return DEFAULT_ENGINE_NAME;
    }
  }
655717
def import_from_string(full_class_name):
        """"""
        s = full_class_name.split('.')
        class_name = s[-1]
        module_name = full_class_name[:-len(class_name)-1]
        module = importlib.import_module(module_name)
        # the class, it's common to spell with k as class is reserved
        klass = getattr(module, class_name)
        return klass
489188
def from_string(cls, serialized):
        """"""
        warnings.warn(
            "SlashSeparatedCourseKey is deprecated! Please use locator.CourseLocator",
            DeprecationWarning,
            stacklevel=2
        )
        return CourseLocator.from_string(serialized)
1037941
def _get_sqla_coltype_class_from_str(coltype: str,
                                     dialect: Dialect) -> Type[TypeEngine]:
    
    # noinspection PyUnresolvedReferences
    ischema_names = dialect.ischema_names
    try:
        return ischema_names[coltype.upper()]
    except KeyError:
        return ischema_names[coltype.lower()]
1242729
def get_import_for_type(t):
    """"""
    t_as_string = to_str(t)
    if not is_identifier(t_as_string):
        # this class expanded into something other than a single identifier
        # we can ignore it.  This is the case when we encounter something
        # like the configman.converter.str_to_classes_in_namespaces
        # InnerClassList.  We can safely ignore these things here.
        return (None, None)
    if '.' in t_as_string:
        parts = t_as_string.split('.')
        return ('.'.join(parts[:-1]), parts[-1])
    else:
        if t_as_string in known_mapping_str_to_type:
            return (None, None)
        return (None, t_as_string)
1131765
private Object convertStringToObject(String string)
    	throws ClassNotFoundException
    {
        if ((string == null) || (string.length() == 0))
            return null;
        try {
            InputStream reader = new ByteArrayInputStream(string.getBytes(BundleConstants.OBJECT_ENCODING));//Constants.STRING_ENCODING));
            ObjectInputStream inStream = new ObjectInputStream(reader);
            Object obj = inStream.readObject();
            reader.close();
            inStream.close();
            return obj;
        } catch (IOException ex)    {
            ex.printStackTrace();   // Never
        }
        return null;
    }
1083480
public static function __getInstance($string)
    {
        $engine = self::detectBank($string);
        $engine->loadString($string);

        return $engine;
    }
451493
function(ext) {
      ext = ext || this.option('view engine');
      if (ext && ext[0] !== '.') {
        ext = '.' + ext;
      }
      return this._.engines.getEngine(ext);
    }
271913
private static NameSpace getEngineNameSpace(ScriptContext scriptContext) {
        Map<String, Object> engineView = new ScriptContextEngineView(scriptContext);
        NameSpace ns = (NameSpace) engineView.get(engineNameSpaceKey);

        if (!engineView.containsKey(engineNameSpaceKey)) {
            // Create a global namespace for the interpreter
            ns = new ExternalNameSpace(null/*parent*/, "javax_script_context", engineView);
            engineView.put(engineNameSpaceKey, ns);
        }

        return ns;
    }
142556
def fromstring(cls, dis_string):
        """"""
        temp = tempfile.NamedTemporaryFile(delete=False)
        temp.write(dis_string)
        temp.close()
        dis_tree = cls(dis_filepath=temp.name)
        os.unlink(temp.name)
        return dis_tree
325193
def import_object_by_string(namespace):
    """"""
    segments = namespace.split('.')
    module = importlib.import_module('.'.join(segments[:-1]))
    return getattr(module, segments[-1])
359763
def _from_string(cls, serialized):
        
        parse = cls.parse_url(serialized)

        if parse['version_guid']:
            parse['version_guid'] = cls.as_object_id(parse['version_guid'])

        return cls(**{key: parse.get(key) for key in cls.KEY_FIELDS})
1062944
def fromstring(cls, ptb_string, namespace='ptb', precedence=False,
                  ignore_traces=True):
        """"""
        temp = tempfile.NamedTemporaryFile(delete=False)
        temp.write(ptb_string)
        temp.close()
        ptb_docgraph = cls(ptb_filepath=temp.name, namespace=namespace,
                           precedence=precedence, ignore_traces=ignore_traces)
        os.unlink(temp.name)
        return ptb_docgraph