Writes a reference
        :param ref_index: Local index (0-based) to the reference
6860
def write_reference(self, ref_index):
        
        self._writeStruct(
            ">BL", 1, (self.TC_REFERENCE, ref_index + self.BASE_REFERENCE_IDX)
        )
1162341
def write_index(self, overwrite: bool = False, mock: bool = False) -> None:
        
        write_if_allowed(self.index_filename, self.index_content(),
                         overwrite=overwrite, mock=mock)
413713
private void writeClassDescriptions(BeanReferences references) throws IOException {
        // write out ref count first, which is the number of instances that are referenced
        output.writeInt(references.getReferences().size());

        // write map of class name to a list of metatype names (which is empty if not a bean)
        List<ClassInfo> classInfos = references.getClassInfoList();
        output.writeMapHeader(classInfos.size());
        for (ClassInfo classInfo : classInfos) {
            // known types parameter is null as we never serialize the class names again
            String className = SerTypeMapper.encodeType(classInfo.type, settings, null, null);
            output.writeString(className);

            output.writeArrayHeader(classInfo.metaProperties.length);
            for (MetaProperty<?> property : classInfo.metaProperties) {
                output.writeString(property.name());
            }
        }
    }
515815
def delete_reference(self, opaque_ref, global_ref=False):
        
        opaque_ref_value = self._get_reference_value(opaque_ref)
        if global_ref:
            del self.global_refs[opaque_ref_value]
        else:
            del self.local_refs[opaque_ref_value]
646150
def pop_refs(self, *refs):
        
        for ref in refs:
            name = ref.name
            count = self.counts[name]
            # Not tracking this ref
            if count < 1:
                continue
            # Someone else is using this ref
            elif count > 1:
                self.counts[name] -= 1
            # Last reference
            else:
                logger.debug("popping last usage of {}".format(ref))
                self.counts[name] -= 1
                if ref.type == "value":
                    del self.attr_values[name]
                else:
                    # Clean up both name indexes
                    path_segment = self.attr_names[name]
                    del self.attr_names[name]
                    del self.name_attr_index[path_segment]
540899
public void addReference(String referenceSource, String referenceName, String referenceUrl) {
        final Reference ref = new Reference();
        ref.setSource(referenceSource);
        ref.setName(referenceName);
        ref.setUrl(referenceUrl);
        this.references.add(ref);
    }
857926
def _add_to_ref(self, rec_curr, line):
        """"""
        # Examples of record lines containing ':' include:
        #   id: GO:0000002
        #   name: mitochondrial genome maintenance
        #   namespace: biological_process
        #   def: "The maintenance of ...
        #   is_a: GO:0007005 ! mitochondrion organization
        if line[:4] == "id: ":
            assert not rec_curr.item_id
            item_id = line[4:]
            rec_curr.item_id = item_id
            rec_curr.id = item_id
        elif line[:8] == "alt_id: ":
            rec_curr.alt_ids.add(line[8:])
        elif line[:6] == "name: ":
            assert not rec_curr.name
            rec_curr.name = line[6:]
        elif line[:11] == "namespace: ":
            assert not rec_curr.namespace
            rec_curr.namespace = line[11:]
        elif line[:6] == "is_a: ":
            rec_curr._parents.add(line[6:].split()[0])
        elif line[:13] == "is_obsolete: " and line[13:] == "true":
            rec_curr.is_obsolete = True
        elif self.optobj and ':' in line:
            self.optobj.update_rec(rec_curr, line)
505016
def reference_id=(reference_id)

      if !reference_id.nil? && reference_id.to_s.length > 40
        fail ArgumentError, "invalid value for 'reference_id', the character length must be smaller than or equal to 40."
      end

      @reference_id = reference_id
    end
1078912
def get_ref(self):
        
        _id = self.id
        if _id is None:
            return None
        else:
            return DBRef(self.collection, _id)
949706
public void setScribeIndex(ScribeIndex index) {
		this.index = index;
		serializer.setScribeIndex(index);
		deserializer.setScribeIndex(index);
	}
1240392
def reference_id(self, reference_id):
        

        if reference_id is None:
            raise ValueError("Invalid value for `reference_id`, must not be `None`")
        if len(reference_id) > 40:
            raise ValueError("Invalid value for `reference_id`, length must be less than `40`")

        self._reference_id = reference_id
65801
def set_reference(self,ref):
    
    self._options = self._options._replace(reference = ref)
360055
def set_target_ref(self, value):
        
        if value is None or not isinstance(value, str):
            raise TypeError("TargetRef is required and must be set to a String")
        else:
            self.__target_ref = value
387518
def _print_refs(self, fobj, refs, total, level=1, minsize=0, minpct=0.1):
        
        lrefs = list(refs)
        lrefs.sort(key=lambda x: x.size)
        lrefs.reverse()
        if level == 1:
            fobj.write('<table>\n')
        for ref in lrefs:
            if ref.size > minsize and (ref.size*100.0/total) > minpct:
                data = dict(level=level,
                            name=trunc(str(ref.name), 128),
                            size=pp(ref.size),
                            pct=ref.size*100.0/total)
                fobj.write(self.refrow % data)
                self._print_refs(fobj, ref.refs, total, level=level+1)
        if level == 1:
            fobj.write("</table>\n")
280497
def insert(cls, index, interceptor):
        
        cls._check(interceptor)
        cls._interceptors.insert(index, interceptor)
403435
def write_ref_for object
      case object
      when nil
        @stream.write_signed_int_32(0)
      when ::Integer
        @stream.write_signed_int_32(object)
      else
        @stream.write_signed_int_32(Position.get(object) + @linker.platform.loaded_at)
      end
    end
100732
def insertReference(self, reference):
        
        models.Reference.create(
            id=reference.getId(),
            referencesetid=reference.getParentContainer().getId(),
            name=reference.getLocalId(),
            length=reference.getLength(),
            isderived=reference.getIsDerived(),
            species=json.dumps(reference.getSpecies()),
            md5checksum=reference.getMd5Checksum(),
            sourceaccessions=json.dumps(reference.getSourceAccessions()),
            sourceuri=reference.getSourceUri())