Returns the object in others which uniquely matches this domain object on the given attributes,
 or nil if there is no unique match. This method returns nil if any attributes value is nil.
541993
def match_unique_object_with_attributes(others, attributes)
      vh = value_hash(attributes)
      return if vh.empty? or vh.size < attributes.size
      matches = others.select do |other|
        self.class == other.class and
          vh.all? { |pa, v| other.matches_attribute_value?(pa, v) }
      end
      matches.first if matches.size == 1
    end
1185473
def get_relationship(self, attribute):
        
        rel = self.__relationships.get(attribute.entity_attr)
        if rel is None:
            rel = LazyDomainRelationship(self, attribute,
                                         direction=
                                            self.relationship_direction)
            self.__relationships[attribute.entity_attr] = rel
        return rel
601637
public static function isUnique($id, $attr, $attr_value)
    {
        $obj = self::first(array($attr => $attr_value));
        return $obj==null || $obj->get(self::getPK()) == $id;
    }
1031211
def get_attributes(excluded)
      attribs = attributes.dup
      attribs.delete_if { |key, value|
        (!excluded.nil? and excluded.include?(key)) or key == "id" }
    end
142187
def matches_attributes?(element) # :api: public
      @attributes.all? do |key, value|
        test_attribute(element.attribute(key.to_s), value)
      end
    end
1069886
def method_missing(id, *args, &block)
      ids = id.to_s
      if instance_variable_defined?(:@attributes)
        return @attributes[id] if @attributes.has_key?(id)
        return @attributes[ids] if @attributes.has_key?(ids)
      end
      raise NoMethodError.new("#{ids} not found", name)
    end
1083342
def get_object(id)
      return nil unless (blob = find_blob(id)) && (obj = blob.read_object(id))
      deserialize(obj)
    end
676366
def non_id_search_attribute_values
      # if there is a secondary key, then search on those attributes.
      # otherwise, search on all attributes.
      key_props = self.class.secondary_key_attributes
      pas = key_props.empty? ? self.class.nondomain_java_attributes : key_props
      # associate the values
      attr_values = pas.to_compact_hash { |pa| send(pa) }
      # if there is no secondary key, then cull empty values
      key_props.empty? ? attr_values.delete_if { |pa, value| value.nil? } : attr_values
    end
410219
def skip_conversion?(obj, attr, value)
      value.nil? || !obj.class.attributes.key?(attr)
    end
1112633
def match(self, ref):
        
        try:
            concept = self[ref]
            if not isinstance(concept, Dimension):
                return [concept]
            return [a for a in concept.attributes]
        except KeyError:
            return []
859254
def get(self, name, default=None, domain=None, path=None):
        
        try:
            return self._find_no_duplicates(name, domain, path)
        except KeyError:
            return default
349969
def match_id(self, el, ids):
        """"""

        found = True
        for i in ids:
            if i != self.get_attribute_by_name(el, 'id', ''):
                found = False
                break
        return found
703942
function getSingle(name) {
    if (instances.length) {
        var match = instances.filter(function(item) {
            return item.name === name;
        });
        if (match.length) {
            return match[0];
        }
    }
    return false;
}
765614
def attribute(namespace, key = nil)
      namespace, key = to_nns namespace, key
      attributes = @attributesByNamespace[namespace]
      return attributes.nil? ? nil : attributes[key]
    end
1164550
def matches? query
      query.reduce(true) do |matches, (key, value)|
        matches = if key == 'tag'
          return false unless tags.present?
          tags.include? value
        else
          attributes[key] == value
        end
      end
    end
461178
def matches(self, other):
        
        if not isinstance(other, Failure):
            return False
        if self.exc_info is None or other.exc_info is None:
            return self._matches(other)
        else:
            return self == other
599802
def get_attribute_ns(namespace, name)
      each_attribute() { |attribute|
        if name == attribute.name &&
          namespace == attribute.namespace()
          return attribute
        end
      }
      nil
    end