Return whether or not the field named `name` has a non-default value for the XBlock `block`.

        :param block: block to check
        :type block: :class:`~xblock.core.XBlock`
        :param name: field name
        :type name: str
427515
def has(self, block, name):
        
        try:
            self.get(block, name)
            return True
        except KeyError:
            return False
1234039
def field_name_exist(self, field_name):
        

        fields = self.class_item.get_fields()
        for f in fields:
            if f.name == field_name:
                return True
        return False
616105
def p_namedblock_empty(self, p):
        ''
        p[0] = Block((), p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
1057298
def set(self, name, value, default=False, imported=False):
        
        if name in self.__dict__:
            self.__dict__[name] = value
            return

        if name not in self.settings and self.prefix:
            prefix_name = '%s_%s' % (self.prefix, name)
            if prefix_name in self.settings:
                return  # don't do anything

        if name in self.settings:
            self.settings[name].set(value, default=default, imported=imported)
        elif not imported:
            self.params[name] = value
498932
def get_if_present(self, name, default=None):
        
        if not self.processed_data:
            raise exceptions.FormNotProcessed('The form data has not been processed yet')

        if name in self.field_dict:
            return self[name]

        return default
429302
def _getBlock(self, block_spec):
        
        if block_spec is None:
            return
        if all(c in string.hexdigits for c in block_spec):
            block_spec = block_spec.upper()
            ix = 0
        else:
            ix = 2
        for block in all_blocks:
            if block[ix] == block_spec:
                return block
        raise ValueError('No such block')
815249
private NamedOutputBlockContext findAndRemoveBlock(List<NamedOutputBlockContext> blocks, String name) {

    if(blocks == null) {
      return null;
    }

    Iterator<NamedOutputBlockContext> blockIter = blocks.iterator();
    while (blockIter.hasNext()) {
      NamedOutputBlockContext block = blockIter.next();
      String blockName = name(block);
      if(name.equals(blockName)) {
        blockIter.remove();
        return block;
      }
    }

    return null;
  }
769279
def uniq(&block)
      if block
        new(attributes.uniq(&block))
      else
        new(attributes.uniq(&:name))
      end
    end
547654
def set(self, block, name, value):
        
        self._kvs.set(self._key(block, name), value)
862831
public int lookupBlockName(String blockName) {
        Integer blockNoWrapper = blockNameToNoMap.get(blockName.toUpperCase());
        if (blockNoWrapper == null) {
            return -1;
        }
        int blockNo = blockNoWrapper.intValue();
        return blockNo;
    }
99035
def p_namedblock_statement(self, p):
        
        if isinstance(p[1], Decl):
            for r in p[1].list:
                if (not isinstance(r, Reg) and not isinstance(r, Wire)
                    and not isinstance(r, Integer) and not isinstance(r, Real)
                        and not isinstance(r, Parameter) and not isinstance(r, Localparam)):
                    raise ParseError("Syntax Error")
        p[0] = p[1]
        p.set_lineno(0, p.lineno(1))
832637
def get(self, block, name):
        
        return self._kvs.get(self._key(block, name))
1324860
public function block($name, $default = null)
    {
        return isset($this->blocks[$name]) ? $this->blocks[$name] : $default;
    }
389355
public Value check(ILexNameToken name)
	{
		Value v = get(name);

		if (v == null)
		{
			if (outer != null)
			{
				return outer.check(name);
			}
		}

		return v;
	}
809516
def enter_block(self, name):
        """"""
        section = self._get_section(name)
        block = self.current_block = section.new_block()
        self.blocks.append(block)
        return block
729428
def add_block(self, name):
        

        if not self.RE_NAME.match(name):
            raise ValueError(u"Invalid block name '{0}'"
                             .format(common.from_utf8(name)))

        if name in self._block_map:
            raise ValueError(u"Block '{0}' already exists"
                             .format(common.from_utf8(name)))

        # add new block and index mapping
        self._block_map[name] = len(self._ast[2])  # must come first
        option_list = []
        block = [name, option_list]
        self._ast[2].append(block)
701525
def namedb_name_fields_check( name_rec ):
    

    if not name_rec.has_key('name'):
        raise Exception("BUG: name record has no name")

    # extract namespace ID if it's not already there 
    if not name_rec.has_key('namespace_id'):
        name_rec['namespace_id'] = get_namespace_from_name( name_rec['name'] )

    # extract name_hash if it's not already there 
    if not name_rec.has_key('name_hash128'):
        name_rec['name_hash128'] = hash256_trunc128( name_rec['name'] )

    return True