Get a resource from the trimesh/resources folder.

    Parameters
    -------------
    name: str, location relative to trimesh/resources

    Returns
    -------------
    resource: str, string of file data
181332
def get_resource(name):
    
    # get the resource
    resource = resource_string('trimesh',
                               os.path.join('resources', name))
    # make sure we return it as a string
    if hasattr(resource, 'decode'):
        return resource.decode('utf-8')
    return resource
590991
@Nullable
  public URL getResource (final String name)
  {
    URL ret = null;

    if (m_aBestCandidate != null)
    {
      ret = m_aBestCandidate.getResource (name);
      if (ret != null)
        return ret;
      m_aBestCandidate = null;
    }

    IClassLoadHelper aLoadHelper = null;

    final Iterator <IClassLoadHelper> iter = m_aLoadHelpers.iterator ();
    while (iter.hasNext ())
    {
      aLoadHelper = iter.next ();
      ret = aLoadHelper.getResource (name);
      if (ret != null)
        break;
    }

    m_aBestCandidate = aLoadHelper;
    return ret;
  }
408124
def open(self, name, mode='r', *args, **kwargs):
        '''  '''
        fname = self.lookup(name)
        if not fname: raise IOError("Resource %r not found." % name)
        return self.opener(fname, mode=mode, *args, **kwargs)
41606
def getfile(data_name, path):
    

    data_source = get_data_object(data_name, use_data_config=False)

    if not data_source:
        if 'output' in data_name:
            floyd_logger.info("Note: You cannot clone the output of a running job. You need to wait for it to finish.")
        sys.exit()

    url = "{}/api/v1/resources/{}/{}?content=true".format(floyd.floyd_host, data_source.resource_id, path)
    fname = os.path.basename(path)
    DataClient().download(url, filename=fname)
    floyd_logger.info("Download finished")
354843
def get_data_filepath(name, environ=None):
    
    dr = data_root(environ)

    if not os.path.exists(dr):
        os.makedirs(dr)

    return os.path.join(dr, name)
31816
def load_name(self, name):
        
        locator = self._make_locator()

        path = locator.find_name(name, self.search_dirs)

        return self.read(path)
1054175
def get_resource_path(name, raise_exception=False):
    

    if not RuntimeGlobals.resources_directories:
        RuntimeGlobals.resources_directories.append(
            os.path.normpath(os.path.join(umbra.__path__[0], Constants.resources_directory)))

    for path in RuntimeGlobals.resources_directories:
        path = os.path.join(path, name)
        if foundations.common.path_exists(path):
            LOGGER.debug("> '{0}' resource path: '{1}'.".format(name, path))
            return path

    if raise_exception:
        raise umbra.exceptions.ResourceExistsError(
            "{0} | No resource file path found for '{1}' name!".format(__name__, name))
1103271
def load_csv_data(resource_name):
    # type: (str) -> List[str]
    
    data_bytes = pkgutil.get_data('clkhash', 'data/{}'.format(resource_name))
    if data_bytes is None:
        raise ValueError("No data resource found with name {}".format(resource_name))
    else:
        data = data_bytes.decode('utf8')
        reader = csv.reader(data.splitlines())
        next(reader, None)  # skip the headers
        return [row[0] for row in reader]
398219
public void getResources(Vector<URL> resources, String name)
  {
    Path path;

    path = getPath(name);

    if (path != null && path.canRead()) {
      try {
        resources.add(path.getNetURL());
      } catch (Exception e) {
      }
    }
  }
836184
def getResourceInst(self, path, environ):
        
        self._count_getResourceInst += 1
        fp = self._locToFilePath(path)
        if not os.path.exists(fp):
            return None

        if os.path.isdir(fp):
            return FolderResource(path, environ, fp)
        return FileResource(path, environ, fp)
1333703
def get_corpus_path(name: str) -> [str, None]:
    
    db = TinyDB(corpus_db_path())
    temp = Query()

    if len(db.search(temp.name == name)) > 0:
        path = get_full_data_path(db.search(temp.name == name)[0]["file"])
        db.close()

        if not os.path.exists(path):
            download(name)

        return path

    return None
632707
def get_resource(resource_name):
    

    resource_path = None
    if hasattr(sys, "frozen"):
        resource_path = os.path.normpath(os.path.join(os.path.dirname(sys.executable), resource_name))
    elif not hasattr(sys, "frozen") and pkg_resources.resource_exists("gns3server", resource_name):
        resource_path = pkg_resources.resource_filename("gns3server", resource_name)
        resource_path = os.path.normpath(resource_path)
    return resource_path
1332827
def get_by_resource(self, resource_uri):
        
        uri = self.URI + self.RESOURCES_PATH + '/' + resource_uri
        return self._client.get(id_or_uri=uri)
1077177
def get_resource_by_key(self, resource_key):
        

        # search for quick_key by default
        lookup_order = ["quick_key", "folder_key"]

        if len(resource_key) == FOLDER_KEY_LENGTH:
            lookup_order = ["folder_key", "quick_key"]

        resource = None

        for lookup_key in lookup_order:
            try:
                if lookup_key == "folder_key":
                    info = self.api.folder_get_info(folder_key=resource_key)
                    resource = Folder(info['folder_info'])
                elif lookup_key == "quick_key":
                    info = self.api.file_get_info(quick_key=resource_key)
                    resource = File(info['file_info'])
            except MediaFireApiError:
                # TODO: Check response code
                pass

            if resource:
                break

        if not resource:
            raise ResourceNotFoundError(resource_key)

        return resource
427513
def get_root_path(self, name):
        
        module = modules.get(name)
        if module is not None and hasattr(module, '__file__'):
            return dirname(abspath(module.__file__))

        # Flask keeps looking at this point. We instead set the root path to None,
        # assume that the user doesn't need resource loading, and raise an error
        # when resolving the resource path.
        return None
34907
def parse_resource(name):
    
    with closing(pkg_resources.resource_stream(__name__, name)) as fp:
        rbytes = fp.read()

    return _load(StringIO(rbytes.decode('utf-8')))
681368
def resource_info(self, resource_name, extended=True):
        

        if extended:
            ret, err = self.visalib.parse_resource_extended(self.session, resource_name)
        else:
            ret, err = self.visalib.parse_resource(self.session, resource_name)

        return ret