Returns the definition for the given node.

 @param [RubyLint::AST::Node] node
 @return [RubyLint::Definition::RubyObject]
179360
def definition_for_node(node)
      if node.const? and node.children[0]
        definition = ConstantPath.new(node).resolve(current_scope)
      else
        definition = current_scope.lookup(node.type, node.name)
      end

      definition = Definition::RubyObject.create_unknown unless definition

      return definition
    end
1109028
def parse(node)
      case node.name
      when 'moveTo'
        @type = :move
      when 'lnTo'
        @type = :line
      when 'arcTo'
        @type = :arc
      when 'cubicBezTo'
        @type = :cubic_bezier
      when 'quadBezTo'
        @type = :quadratic_bezier
      when 'close'
        @type = :close
      end

      node.xpath('*').each do |node_child|
        case node_child.name
        when 'pt'
          @points << OOXMLCoordinates.parse(node_child)
        end
      end
      self
    end
1344824
public function getDocumentationFromNode($node)
    {
        // Any NamespaceDefinition comments likely apply to the file, not the declaration itself.
        if ($node instanceof Node\Statement\NamespaceDefinition) {
            return null;
        }

        // For properties and constants, set the node to the declaration node, rather than the individual property.
        // This is because they get defined as part of a list.
        $constOrPropertyDeclaration = ParserHelpers\tryGetPropertyDeclaration($node) ?? ParserHelpers\tryGetConstOrClassConstDeclaration($node);
        if ($constOrPropertyDeclaration !== null) {
            $node = $constOrPropertyDeclaration;
        }

        // For parameters, parse the function-like declaration to get documentation for a parameter
        if ($node instanceof Node\Parameter) {
            $variableName = $node->getName();

            $functionLikeDeclaration = ParserHelpers\getFunctionLikeDeclarationFromParameter($node);
            $docBlock = $this->getDocBlock($functionLikeDeclaration);

            $parameterDocBlockTag = $this->tryGetDocBlockTagForParameter($docBlock, $variableName);
            return $parameterDocBlockTag !== null ? $parameterDocBlockTag->getDescription()->render() : null;
        }

        // For everything else, get the doc block summary corresponding to the current node.
        $docBlock = $this->getDocBlock($node);
        if ($docBlock !== null) {
            // check whether we have a description, when true, add a new paragraph
            // with the description
            $description = $docBlock->getDescription()->render();

            if (empty($description)) {
                return $docBlock->getSummary();
            }

            return $docBlock->getSummary() . "\n\n" . $description;
        }
        return null;
    }
465244
def relationship(self, node):
        
        self._check_node(node)
        my_rel = _rel_helper(lhs='us', rhs='them', ident='r', **self.definition)
        q = "MATCH " + my_rel + " WHERE id(them)={them} and id(us)={self} RETURN r LIMIT 1"
        rels = self.source.cypher(q, {'them': node.id})[0]
        if not rels:
            return

        rel_model = self.definition.get('model') or StructuredRel

        return self._set_start_end_cls(rel_model.inflate(rels[0][0]), node)
205578
def parse(node)
      blip_node = node.xpath('a:blip', 'xmlns:a' => 'http://schemas.openxmlformats.org/drawingml/2006/main').first
      return self if blip_node.nil?

      @file_reference = FileReference.new(parent: self).parse(blip_node)
      self
    end
331011
def node(self):
        

        if self.node_class is None:
            raise ValueError("You have to create an ``Item`` by calling ``__init__`` with ``node_class`` argument"
                             " or by decorating a ``Node`` class.")

        node = self.node_class(*self.node_args, **self.node_kwargs)
        node.__item__ = self

        return node
607970
def initial_definitions
      definitions = Definition::RubyObject.new(
        :name          => 'root',
        :type          => :root,
        :instance_type => :instance,
        :inherit_self  => false
      )

      definitions.parents = [
        definitions.constant_proxy('Object', RubyLint.registry)
      ]

      definitions.define_self

      return definitions
    end
196396
def parse(node)
      @fill = PresentationFill.new(parent: self).parse(node)
      @line_join = LineJoin.new(parent: self).parse(node)
      node.attributes.each do |key, value|
        case key
        when 'w'
          @width = OoxmlSize.new(value.value.to_f, :emu)
        when 'algn'
          @align = value_to_symbol(value)
        end
      end

      node.xpath('*').each do |node_child|
        case node_child.name
        when 'headEnd'
          @head_end = LineEnd.new(parent: self).parse(node_child)
        when 'tailEnd'
          @tail_end = LineEnd.new(parent: self).parse(node_child)
        when 'ln'
          return TableCellLine.new(parent: self).parse(node_child)
        end
      end
      self
    end
219155
def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'blip'
          @blip = Blip.new(parent: self).parse(node_child)
        when 'stretch'
          @stretch = Stretch.new(parent: self).parse(node_child)
        end
      end
      self
    end
137734
def _parse_description(self, node):
        # type: (ElementTree.Element) -> EndpointDescription
        
        endpoint = {}
        for prop_node in node.findall(TAG_PROPERTY):
            name, value = self._parse_property(prop_node)
            endpoint[name] = value

        return EndpointDescription(None, endpoint)
673752
def parse(node)
      @type = node.name.to_sym
      case node.name
      when 'blinds', 'checker', 'comb', 'cover', 'pull', 'push', 'randomBar', 'strips', 'wipe', 'zoom', 'warp'
        @direction = value_to_symbol(node.attribute('dir')) if node.attribute('dir')
      when 'cut', 'fade'
        @through_black = option_enabled?(node, 'thruBlk')
      when 'split'
        @direction = value_to_symbol(node.attribute('dir')) if node.attribute('dir')
        @orientation = node.attribute('orient').value.to_sym if node.attribute('orient')
      when 'wheel', 'wheelReverse'
        @spokes = option_enabled?(node, 'spokes')
      end
      self
    end
1113269
def get_size(node)
      case get_node_type(node)
      when :branch
        sizes = node[0,BRANCH_CARDINAL].map {|n| get_size decode_to_node(n) }
        sizes.push(node.last.false? ? 0 : 1)
        sizes.reduce(0, &:+)
      when :extension
        get_size decode_to_node(node[1])
      when :leaf
        1
      when :blank
        0
      end
    end
498327
def translate(self, node):
        
        _translate = self._translate_functions.get(node.operator)
        return _translate(node)
1134312
def def_node(node, indent)
      # Set a namespace for the current node definition and make it a valid ruby
      # method name
      key = "_opulent_definition_#{node[@value].to_s.tr '-', '_'}"


      # If we have attributes set for our defined node, we will need to create
      # an extension parameter which will be o
      if node[@options][:attributes].empty?
        # Call method without any extension
        method_call = "#{key}"

        # Call arguments set to true, in correct order
        arguments = []
        @definitions[node[@value]][@options][:parameters].keys.each do |k|
          arguments << @definitions[
            node[@value]
          ][@options][:parameters][k][@value]
        end
        arguments << '{}'

        if @in_definition
          arguments << "(indent ? indent + #{indent} : #{indent})"
        else
          arguments << indent
        end
        method_call += '(' + arguments.join(', ') + ')'
        method_call += ' do' unless node[@children].empty?

        buffer_eval method_call
      else
        arguments = []

        # Extract node definition arguments in the correct order. If the given
        # key does not exist, set the value to default or true
        @definitions[
          node[@value]
        ][@options][:parameters].keys.each do |k|
          if node[@options][:attributes].key? k
            arguments << node[@options][:attributes].delete(k)[@value]
          else
            arguments << @definitions[
              node[@value]
            ][@options][:parameters][k][@value]
          end
        end

        call_attributes = buffer_attributes_to_hash(
          node[@options][:attributes]
        )

        # If the call node is extended as well, merge the call attributes hash
        # with the extension hash
        if node[@options][:extension]
          # .merge!(var_name)
          call_attributes += '.merge!(' \
                             "#{node[@options][:extension][@value]}" \
                             ')'

          # { |key, value1, value2|
          call_attributes += " { |#{OPULENT_KEY}, " \
                             "#{OPULENT_VALUE}1, #{OPULENT_VALUE}2|"

          # class ? value1 + value2 : value2
          call_attributes += "#{OPULENT_KEY} == :class ? (" \
                             "#{OPULENT_VALUE}1 += " \
                             "#{OPULENT_VALUE}2) : (#{OPULENT_VALUE}2" \
                             ')'

          # }
          call_attributes += '}'
        end

        arguments << call_attributes

        call = "#{key}(#{arguments.join ', '}, #{indent})"
        call += ' do' unless node[@children].empty?

        buffer_eval call
      end

      # Set call node children as block evaluation. Very useful for
      # performance and evaluating them in the parent context
      node[@children].each do |child|
        root child, indent + @settings[:indent]
      end

      # End block
      buffer_eval 'end' unless node[@children].empty?
    end
913850
def node(name)
      assoc = associations[name]
      other = assoc.node
      other.eager_load(assoc)
    end
633318
def match(node)
      raise_unless_xpath!(node)
      pos = node.xpath("descendant::pos").first
      return nil if pos.nil?
      { matched: node.respond_to?(:name) ? node.name : "",
        line: pos["line"].to_i, column: pos["column"].to_i }
    end
217311
@JRubyMethod
    public static IRubyObject node_import(IRubyObject self, IRubyObject node) {
        //             System.err.println("()");
        final Ruby runtime = self.getRuntime();
        final ThreadContext ctx = runtime.getCurrentContext();
        org.yecht.Node n = (org.yecht.Node)node.dataGetStructChecked();
        YAMLExtra x = ((Node)node).x;
        IRubyObject obj = null;
        switch(n.kind) {
        case Str:
            Data.Str dd = (Data.Str)n.data;
            obj = RubyString.newStringShared(runtime, dd.ptr.buffer, dd.ptr.start, dd.len);
            break;
        case Seq:
            Data.Seq ds = (Data.Seq)n.data;
            obj = RubyArray.newArray(runtime, ds.idx);
            for(int i = 0; i < ds.idx; i++) {
                IRubyObject obj2 = (IRubyObject)n.seqRead(i);
                ((RubyArray)obj).store(i, obj2);
            }
            break;
        case Map:
            Data.Map dm = (Data.Map)n.data;
            obj = RubyHash.newHash(runtime);
            RubyClass cMergeKey = x.MergeKey;
            RubyClass cDefaultKey = x.DefaultKey;
            RubyClass cHash = runtime.getHash();
            RubyClass cArray = runtime.getArray();
                
            for(int i = 0; i < dm.idx; i++) {
                IRubyObject k = (IRubyObject)n.mapRead(MapPart.Key, i);
                IRubyObject v = (IRubyObject)n.mapRead(MapPart.Value, i);
                if(null == v) {
                    v = runtime.getNil();
                }
                boolean skip_aset = false;
                    
                if(cMergeKey.isInstance(k)) {
                    if(cHash.isInstance(v)) {
                        IRubyObject dup = v.callMethod(ctx, "dup");
                        dup.callMethod(ctx, "update", obj);
                        obj = dup;
                        skip_aset = true;
                    } else if(cArray.isInstance(v)) {
                        IRubyObject end = ((RubyArray)v).pop(ctx);
                        if(cHash.isInstance(end)) {
                            final IRubyObject dup = end.callMethod(ctx, "dup");
                            v = ((RubyArray)v).reverse();
                            ((RubyArray)v).append(obj);

                            RubyEnumerable.callEach(runtime, ctx, v, new BlockCallback() {
                                    // syck_merge_i
                                    public IRubyObject call(ThreadContext _ctx, IRubyObject[] largs, Block blk) {
                                        IRubyObject entry = largs[0];
                                        IRubyObject tmp = null;
                                        if(!(tmp = TypeConverter.convertToTypeWithCheck(entry, runtime.getHash(), "to_hash")).isNil()) {
                                            dup.callMethod(_ctx, "update", tmp);
                                        }
                                        return runtime.getNil();
                                    }
                                });

                            obj = dup;
                            skip_aset = true;
                        }
                    }
                } else if(cDefaultKey.isInstance(k)) {
                    obj.callMethod(ctx, "default=", v);
                    skip_aset = true;
                }
                    
                if(!skip_aset) {
                    ((RubyHash)obj).fastASet(k, v);
                }
            }
            break;
        }
            
        if(n.type_id != null) {
            obj = self.callMethod(ctx, "transfer", new IRubyObject[]{runtime.newString(n.type_id), obj});
        }

        return obj;
    }