this one is more precise since it uses the chain identifier also
162832
def neighbors2(self, distance, chain_residue, atom = None, resid_list = None):

        #atom = " CA "
        ''''''

        if atom == None:     # consider all atoms
            lines = [line for line in self.atomlines(resid_list) if line[17:20] in allowed_PDB_residues_types]
        else:                # consider only given atoms
            lines = [line for line in self.atomlines(resid_list) if line[17:20] in allowed_PDB_residues_types and line[12:16] == atom]

        shash = spatialhash.SpatialHash(distance)

        for line in lines:
            pos = (float(line[30:38]), float(line[38:46]), float(line[46:54]))
            shash.insert(pos, line[21:26])

        neighbor_list = []
        for line in lines:
            resid = line[21:26]
            if resid == chain_residue:
                pos = (float(line[30:38]), float(line[38:46]), float(line[46:54]))

                for data in shash.nearby(pos, distance):
                    if data[1] not in neighbor_list:
                        neighbor_list.append(data[1])
                neighbor_list.sort()
        return neighbor_list
1133373
public final String getChainIdentity(String separator) throws KSIException {
        StringBuilder identity = new StringBuilder();

        for (int i = chain.size()-1; i >=0 ; i--) {
            AggregationChainLink aggregationChainLink = chain.get(i);
            Identity linkIdentity = aggregationChainLink.getLinkIdentity();
            String id = linkIdentity == null ? "" : linkIdentity.getDecodedClientId();
            if (identity.length() > 0 && id.length() > 0) {
                identity.append(separator);
            }
            identity.append(id);
        }
        return identity.toString();
    }
741984
function getUniqueIdentifier( root, libs, com ) {
  var id = root.attribs.id || ( com.name + ID++ );
  com.attr.id = id;
}
1214695
def get_chain_mapping(self, pdb_name1, pdb_name2):
        ''''''
        raise Exception('Implement. Map pdb_namex to its equivalence class, call get_representative_chain_mapping, and something something.')
        pprint.pprint(self.chain_mapping)

        d = {}
        for pdb1_chain_id, matched_chain_list in self.chain_mapping[(pdb_name1, pdb_name2)].iteritems():
            d[pdb1_chain_id] = matched_chain_list.get_related_chains_ids(pdb_name2)
        return d
667019
def p_scope_identifier(self, p):
        ''
        p[0] = Identifier(p[2], p[1], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
1212456
private Event linkChainIdentifier(Event event) {
        if (event instanceof ChainableEvent) {
            ChainableEvent chainableEvent = (ChainableEvent)event;
            chainableEvent.setChainIdentifier(this.getChainIdentifier());
            return chainableEvent;
        }
        return event;
    }
953446
def chain_id(chain_id: int, chain_class: Type[BaseChain]) -> Type[BaseChain]:
    
    return chain_class.configure(chain_id=chain_id)
1059837
function extractIdentifier(packet) {
  let identifier = identifiers.REELYACTIVE_OUI36 + packet.substr(0,7);

  return {
      identifier: identifier,
      identifierType: identifiers.TYPE_EUI64
  }
}
1032882
function simplifyDivisionChain(node) {
  // check for a chain of division
  const denominatorList = getDenominatorList(node);
  // one for the numerator, and at least two terms in the denominator
  if (denominatorList.length > 2) {
    const numerator = denominatorList.shift();
    // the new single denominator is all the chained denominators
    // multiplied together, in parentheses.
    const denominator = Node.Creator.parenthesis(
      Node.Creator.operator('*', denominatorList));
    const newNode = Node.Creator.operator('/', [numerator, denominator]);
    return Node.Status.nodeChanged(
      ChangeTypes.SIMPLIFY_DIVISION, node, newNode);
  }
  return Node.Status.noChange(node);
}
52037
def tally(self, chain):
        

        value = self._getfunc()

        try:
            self._trace[chain][self._index[chain]] = value.copy()
        except AttributeError:
            self._trace[chain][self._index[chain]] = value
        self._index[chain] += 1
246647
def init_chain(self):
        
        if not self._hasinit:
            self._hasinit = True
            self._devices = []

            self.jtag_enable()
            while True:
                # pylint: disable=no-member
                idcode = self.rw_dr(bitcount=32, read=True,
                                    lastbit=False)()
                if idcode in NULL_ID_CODES: break
                dev = self.initialize_device_from_id(self, idcode)
                if self._debug:
                    print(dev)
                self._devices.append(dev)
                if len(self._devices) >= 128:
                    raise JTAGTooManyDevicesError("This is an arbitrary "
                        "limit to deal with breaking infinite loops. If "
                        "you have more devices, please open a bug")

            self.jtag_disable()

            #The chain comes out last first. Reverse it to get order.
            self._devices.reverse()
31140
private void identifyBonds() {
        IAtomContainer spt = getSpanningTree();
        IRing ring;
        int nBasicRings = 0;
        for (int i = 0; i < totalEdgeCount; i++) {
            if (!bondsInTree[i]) {
                ring = getRing(spt, molecule.getBond(i));
                for (int b = 0; b < ring.getBondCount(); b++) {
                    int m = molecule.indexOf(ring.getBond(b));
                    cb[nBasicRings][m] = 1;
                }
                nBasicRings++;
            }
        }
        bondsAcyclicCount = 0;
        bondsCyclicCount = 0;
        for (int i = 0; i < totalEdgeCount; i++) {
            int s = 0;
            for (int j = 0; j < nBasicRings; j++) {
                s += cb[j][i];
            }
            switch (s) {
                case (0): {
                    bondsAcyclicCount++;
                    break;
                }
                case (1): {
                    bondsCyclicCount++;
                    break;
                }
                default: {
                    bondsCyclicCount++;
                }
            }
        }
        identifiedBonds = true;
    }
1337165
function uniqueIdentifier( ) {
    return Math.floor(Math.random() * 1000000).toString(36).toUpperCase() + (new Date).getTime().toString(36).toUpperCase();
}
181423
private String getChainSpecification(List<Integer> modelNumbers, List<String> chainIds, int subunit) {
		if (onTheFly) {
			if (Collections.max(modelNumbers) > 1) {
				return chainIds.get(subunit) + "&symop=" + (modelNumbers.get(subunit)+1);
			} else {
				// if there is only a single symop, Jmol does not accept the symop syntax
				return chainIds.get(subunit);
			}
		} else {
			return chainIds.get(subunit) + "/" + (modelNumbers.get(subunit)+1);
		}
	}
130888
function(_chain) {
      for(var i = 0, l = _chain.length; i < l; i++) {
        this.mixin(_chain[i]);
      }
    }
183380
def get_representative_chain_mapping(self, representative_id_1, representative_id_2):
        ''''''
        d = {}
        for pdb1_chain_id, matched_chain_list in self.chain_mapping[(representative_id_1, representative_id_2)].iteritems():
            d[pdb1_chain_id] = matched_chain_list.get_related_chains_ids('EC{0}'.format(representative_id_2))
        return d
494414
function ReferencedIdentifier(node, parent, scope, state) {
    // we can't guarantee the purity of arguments
    if (node.name === "arguments") {
      state.deopted = true;
    }

    // is this a referenced identifier and is it referencing the rest parameter?
    if (node.name !== state.name) return;

    if (state.noOptimise) {
      state.deopted = true;
    } else {
      if (this.parentPath.isMemberExpression({ computed: true, object: node })) {
        // if we know that this member expression is referencing a number then we can safely
        // optimise it
        var prop = this.parentPath.get("property");
        if (prop.isBaseType("number")) {
          state.candidates.push(this);
          return;
        }
      }

      // optimise single spread args in calls
      if (this.parentPath.isSpreadElement() && state.offset === 0) {
        var call = this.parentPath.parentPath;
        if (call.isCallExpression() && call.node.arguments.length === 1) {
          state.candidates.push(this);
          return;
        }
      }

      state.references.push(this);
    }
  }