Get a resource from a builder name.

    :param type schemacls: waited schema class.
    :param str name: builder name to use.
    :return: resource returned by the right builder.getresource(schema).
434496
def getresource(self, schemacls, name):
    
    return _SCHEMAFACTORY.getresource(schemacls=schemacls, name=name)
280115
def get_property(self, name):
        
        for prop in self.resource.properties:
            if prop.name == name:
                return prop

        raise AttributeError(name)
808472
def get_schema_from_type(resource_type):
    
    for cls_name, cls in class_registry._registry.items():
        try:
            if cls[0].opts.type_ == resource_type:
                return cls[0]
        except Exception:
            pass

    raise Exception("Couldn't find schema for type: {}".format(resource_type))
323762
public URL getResource(String name) {
        for (int i = 0; i < classLoaders.length; i++) {
            URL url = classLoaders[i].getResource(name);
            if (url != null) {
                return url;
            }
        }
        if (getParent() != null) {
            return super.getResource(name);
        } else {
            return null;
        }
    }
1302009
def get(cls, name, service=Service()):
        ''''''
        path = pathjoin(cls.path, name)
        response = service.send(SRequest('GET', path))
        return cls.from_response(response, service=service)
1259907
def get_type(self, name):
        

        # XXX FIXME uhm...how to do all the different types of hidden-services?
        if name.lower() == 'hiddenservices':
            return FilesystemOnionService
        return type(self.parsers[name])
1328631
def build(self, _resource, _cache=True, updatecontent=True, **kwargs):
        
        result = None

        if _cache and _resource in self._schemasbyresource:
            result = self._schemasbyresource[_resource]

        else:
            for builder in self._builders.values():
                try:
                    result = builder.build(_resource=_resource, **kwargs)

                except Exception:
                    pass

                else:
                    break

            if result is None:
                raise ValueError('No builder found for {0}'.format(_resource))

            if _cache:
                self._schemasbyresource[_resource] = result

            if updatecontent:
                from ..utils import updatecontent
                updatecontent(result, updateparents=False)

        return result
824996
def get(provider_name, node_type_name)
      name = "#{provider_name}/#{node_type_name}/"
      response = http_get(resource_url(name))
      format_object(response, TYPE)
    end
318279
private static String readResource(String name) {
        try {
            return IOUtils.toString(AmazonKinesisFirehoseToRedshiftSample.class.getResourceAsStream(name));
        } catch (IOException e) {
            throw new RuntimeException("Failed to read document resource: " + name, e);
        }
    }
655399
def _get_column_by_db_name(cls, name):
        
        return cls._columns.get(cls._db_map.get(name, name))
1339618
def get_resources(name, config):
    
    return tz.get_in(["resources", name], config,
                     tz.get_in(["resources", "default"], config, {}))
965915
def consumer(self, name):
        
        return type(self)(self.database, self.name, self.keys, name)
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')))
895481
def get_resource(self, type: Type[T_Resource], name: str = 'default') -> Optional[T_Resource]:
        
        assert check_argument_types()
        self._check_closed()
        key = (type, name)

        # First check if there's already a matching resource in this context
        resource = self._resources.get(key)
        if resource is not None:
            return resource.value_or_factory

        # Next, check if there's a resource factory available on the context chain
        resource = next((ctx._resource_factories[key] for ctx in self.context_chain
                         if key in ctx._resource_factories), None)
        if resource is not None:
            return resource.generate_value(self)

        # Finally, check parents for a matching resource
        return next((ctx._resources[key].value_or_factory for ctx in self.context_chain
                     if key in ctx._resources), None)
311768
def fetch_by_relname(self, name):
        

        ormclass = self._mapped[name]
        query = self.session.query(ormclass)

        if name != carr_ormclass:

            query = query.filter(
                ormclass.scn_name == self.scn_name)

        if self.version:
            query = query.filter(ormclass.version == self.version)

        # TODO: Naming is not consistent. Change in database required.
        if name == 'Transformer':
            name = 'Trafo'

        df = pd.read_sql(query.statement,
                         self.session.bind,
                         index_col=name.lower() + '_id')
        if name == 'Link':
            df['bus0'] = df.bus0.astype(int)
            df['bus1'] = df.bus1.astype(int)

        if 'source' in df:
            df.source = df.source.map(self.id_to_source())

        return df
182923
private Builder getResourceRequest(final RequestTypeEnum requestType, final RestOperationTypeEnum restOperation) {
        return getRequest(requestType, restOperation, getResourceType().getSimpleName());
    }
873753
def resource(name)
      if @schema['definitions'].has_key?(name)
        ResourceSchema.new(@schema, name)
      else
        raise SchemaError.new("Unknown resource '#{name}'.")
      end
    end