Return attribute

 @param [Symbol] key The attribute name
 @param [Symbol, Relation::Name] src The source relation (for merged schemas)

 @raise KeyError

 @api public
182789
def [](key, src = name.to_sym)
      attr =
        if count_index[key].equal?(1)
          name_index[key]
        else
          source_index[src][key]
        end

      unless attr
        raise(KeyError, "#{key.inspect} attribute doesn't exist in #{src} schema")
      end

      attr
    end
523097
def _reference_keys(self, reference):
        
        if not isinstance(reference, six.string_types):
            raise TypeError(
                'When using ~ to reference dynamic attributes ref must be a str. a {0} was provided.'.format(type(reference).__name__)
            )

        if '~' in reference:
            reference = reference[1:]

            scheme = self._scheme_references.get(reference)
            if not scheme:
                # TODO: need to create nice error here as well and print pretty message.
                raise LookupError(
                    "Was unable to find {0} in the scheme references. "
                    "available references {1}".format(reference, ', '.join(self._scheme_references.keys()))
                )

            return scheme['keys']
        else:
            raise AttributeError('references must start with ~. Please update {0} and retry.'.format(reference))
1051632
function (Schema, key) {
		if (!this.KEY_SCHEMA_REG_EXP.test(key)) {
			throw new Error('invalid schema key format. must be match with ' + this.KEY_SCHEMA_REG_EXP.source);
		}

		var schema = new Schema();

		key.replace(this.KEY_SCHEMA_REG_EXP, this._patchFormat(schema));

		return schema;
	}
107354
def template(keys = :term)
      tmpl = columns.map do |column|
        next unless attribute = attribute_for(column)
        [attribute.send(keys), entity.send(keys)]
      end.compact
      return tmpl.compact unless entity.is_core
      entity.extensions.each do |xtn|
        tmpl << xtn.model_get.template(keys)
      end
      tmpl
    end
279440
function attr(key, val) {
  var i, attrs, map = {};
  if(!this.length || key !== undefined && !Boolean(key)) {
    return this;
  }

  if(key === undefined && val === undefined) {
    // no args, get all attributes for first element as object
    attrs = this.dom[0].attributes;
    // convert NamedNodeMap to plain object
    for(i = 0;i < attrs.length;i++) {
      // NOTE: nodeValue is deprecated, check support for `value` in IE9!
      map[attrs[i].name] = attrs[i].value;
    }
    return map;
  }else if(typeof key === 'string' && !val) {
    // delete attribute on all matched elements
    if(val === null) {
      this.each(function(el) {
        el.removeAttribute(key);
      })
      return this;
    }
    // get attribute for first matched elements
    return this.dom[0].getAttribute(key);
  // handle object map of attributes
  }else {
    this.each(function(el) {
      if(typeof key === 'object') {
        for(var z in key) {
          if(key[z] === null) {
            el.removeAttribute(z);
            continue;
          }
          el.setAttribute(z, key[z]);
        }
      }else{
        el.setAttribute(key, val);
      }
    });
  }
  return this;
}
263972
def from_key(key):
    
    model = get_model_from_key(key)
    if model is None:
        raise BadKeyError
    try:
        _, id = key.split(':', 2)
        id = int(id)
    except ValueError, TypeError:
        raise BadKeyError
    return model.objects.get_by_id(id)
721466
def buffer_key(key, opts)
      # covert keys to strings, as sorting a Hash with Symbol keys fails on
      # Ruby 1.8.x.
      opts = opts.inject({}) do |result, (k, v)|
        result[k.to_s] = v
        result
      end
      "#{key.to_s}:#{opts.sort.flatten.join(':')}"
    end
865462
public static SObject of(String key, File file, String... attrs) {
        SObject sobj = of(key, $.requireNotNull(file));
        Map<String, String> map = C.Map(attrs);
        sobj.setAttributes(map);
        return sobj;
    }
1299355
public String getAttr(String key) {
        String val = (String) dynamicAttrs.get(key);
        return val == null ? staticAttrs.get(key) : val;
    }
1192761
public Object getAttribute(String key) {

        if (m_attributes == null) {
            return null;
        }
        return m_attributes.get(key);
    }
1346112
function(key, context) {
        var first, keys, subkey;
        if (typeof context === "undefined" || context === null) {
            context = this;
        }
        if (key.indexOf(".") > -1) {
            keys = key.split(".");
            first = keys.shift();
            subkey = keys.join(".");
            return this._attr_get(keys.join("."), context[first]);
        } else {
            return context[key];
        }
    }
206361
function (key, scope) {
                var value = this.get(key, scope);
                if (key && this.schema[key]) {
                    for (var i = 0; i < this.transformers.length; i++) {
                        value = this.transformers[i].transformValue(key, value, this.schema[key]);
                    }
                }
                return value;
            }
430842
private static String getAttribute(NamedNodeMap atts, String key) {
        Node node = atts.getNamedItem(key);
        return (node == null) ? null : node.getNodeValue();
    }
1078201
def lookup_schema(schema_key)
      lookup_time = Time.now.getutc
      if schema_key.is_a?(String)
        schema_key = SchemaKey.parse_key(schema_key)
      end
      failures = []

      cache_result = @cache[schema_key]
      if not cache_result.nil?
        if not @cacheTtl.nil?
          store_time = cache_result[1]
          time_diff = (lookup_time - store_time).round
          if time_diff >= @cacheTtl
            @cache.delete(schema_key)
            cache_result = nil
          else
            return cache_result[0]
          end
        else
          return cache_result[0]
        end
      end

      if cache_result.nil?          # Fetch from every registry
        for registry in prioritize_repos(schema_key, @registries) do
          begin
            lookup_result = registry.lookup_schema(schema_key)
          rescue StandardError => e
            failures.push(Registries::LookupFailure.new(registry.config.name, e))
          else
            if lookup_result.nil?
              failures.push(Registries::NotFound.new(registry.config.name))
            else
              break
            end
          end
        end

        if lookup_result.nil?
          raise Registries::ResolverError.new(failures, schema_key)
        else
          store_time = Time.now.getutc
          @cache[schema_key] = [lookup_result, store_time]
          lookup_result
        end
      end
    end
159755
def relation
      return unless @builder
      return unless @builder.object
      return unless @builder.object.relations
      relation = @builder.object.relations[attribute_name.to_s]
      raise "Relation #{attribute_name} not found" unless relation
      relation
    end
42696
def get_attribute_id(self, attribute_key):
    

    attribute = self.attribute_key_map.get(attribute_key)
    has_reserved_prefix = attribute_key.startswith(RESERVED_ATTRIBUTE_PREFIX)

    if attribute:
      if has_reserved_prefix:
        self.logger.warning(('Attribute %s unexpectedly has reserved prefix %s; using attribute ID '
                             'instead of reserved attribute name.' % (attribute_key, RESERVED_ATTRIBUTE_PREFIX)))

      return attribute.id

    if has_reserved_prefix:
      return attribute_key

    self.logger.error('Attribute "%s" is not in datafile.' % attribute_key)
    self.error_handler.handle_error(exceptions.InvalidAttributeException(enums.Errors.INVALID_ATTRIBUTE_ERROR))
    return None
817731
static String getDDBKey(Map<String, AttributeValue> key) {
        return key.get(ROW_KEY_ATTR_NAME).getS();
    }