This attribute defines whether a breeding male's current location is the same as the breeding cage.

        This attribute is used to color breeding table entries such that male mice which are currently in a different cage can quickly be identified.
512279
def male_breeding_location_type(self):
        """"""
        if int(self.Male.all()[0].Cage) == int(self.Cage):
            type = "resident breeder"
        else:
            type = "non-resident breeder"
        return type
353068
private void assumeTableDefaults(Cell aCell) {
        
        if (aCell.getBorder() == Rectangle.UNDEFINED) {
            aCell.setBorder(defaultCell.getBorder());
        }
        if (aCell.getBorderWidth() == Rectangle.UNDEFINED) {
            aCell.setBorderWidth(defaultCell.getBorderWidth());
        }
        if (aCell.getBorderColor() == null) {
            aCell.setBorderColor(defaultCell.getBorderColor());
        }
        if (aCell.getBackgroundColor() == null) {
            aCell.setBackgroundColor(defaultCell.getBackgroundColor());
        }
        if (aCell.getHorizontalAlignment() == Element.ALIGN_UNDEFINED) {
            aCell.setHorizontalAlignment(defaultCell.getHorizontalAlignment());
        }
        if (aCell.getVerticalAlignment() == Element.ALIGN_UNDEFINED) {
            aCell.setVerticalAlignment(defaultCell.getVerticalAlignment());
        }
    }
217338
public boolean equivalent(Element otherElement, boolean logging) {
		if (eventable.getElement().equals(otherElement)) {
			if (logging) {
				LOGGER.info("Element equal");
			}
			return true;
		}

		if (eventable.getElement().equalAttributes(otherElement)) {
			if (logging) {
				LOGGER.info("Element attributes equal");
			}
			return true;
		}

		if (eventable.getElement().equalId(otherElement)) {
			if (logging) {
				LOGGER.info("Element ID equal");
			}
			return true;
		}

		if (!eventable.getElement().getText().equals("")
				&& eventable.getElement().equalText(otherElement)) {

			if (logging) {
				LOGGER.info("Element text equal");
			}

			return true;
		}

		return false;
	}
159904
def is_merged_cell_drawn(self, key):
        

        row, col, tab = key

        # Is key not merged? --> False
        cell_attributes = self.code_array.cell_attributes

        top, left, __ = cell_attributes.get_merging_cell(key)

        # Case 1: Top left cell of merge is visible
        # --> Only top left cell returns True
        top_left_drawn = \
            row == top and col == left and \
            self.IsVisible(row, col, wholeCellVisible=False)

        # Case 2: Leftmost column is visible
        # --> Only top visible leftmost cell returns True

        left_drawn = \
            col == left and \
            self.IsVisible(row, col, wholeCellVisible=False) and \
            not self.IsVisible(row-1, col, wholeCellVisible=False)

        # Case 3: Top row is visible
        # --> Only left visible top cell returns True

        top_drawn = \
            row == top and \
            self.IsVisible(row, col, wholeCellVisible=False) and \
            not self.IsVisible(row, col-1, wholeCellVisible=False)

        # Case 4: Top row and leftmost column are invisible
        # --> Only top left visible cell returns True

        middle_drawn = \
            self.IsVisible(row, col, wholeCellVisible=False) and \
            not self.IsVisible(row-1, col, wholeCellVisible=False) and \
            not self.IsVisible(row, col-1, wholeCellVisible=False)

        return top_left_drawn or left_drawn or top_drawn or middle_drawn
33947
public boolean isInEqualLocation(Node node2) {
        if (!isNewNode() && !node2.isNewNode()) {
            return getBeginLine() == node2.getBeginLine() && getBeginColumn() == node2.getBeginColumn()
                    && getEndLine() == node2.getEndLine() && getEndColumn() == node2.getEndColumn();
        }
        return false;
    }
832308
function(colorStop) {
			colorStop = normalizeSpace(colorStop);
			
			// find color declaration
			// first, try complex color declaration, like rgb(0,0,0)
			var color = null;
			colorStop = colorStop.replace(/^(\w+\(.+?\))\s*/, function(str, c) {
				color = c;
				return '';
			});
			
			if (!color) {
				// try simple declaration, like yellow, #fco, #ffffff, etc.
				var parts = colorStop.split(' ');
				color = parts[0];
				colorStop = parts[1] || '';
			}
			
			var result = {
				color: color
			};
			
			if (colorStop) {
				// there's position in color stop definition
				colorStop.replace(/^(\-?[\d\.]+)([a-z%]+)?$/, function(str, pos, unit) {
					result.position = pos;
					if (~pos.indexOf('.')) {
						unit = '';
					} else if (!unit) {
						unit = '%';
					}
					
					if (unit) {
						result.unit = unit;
					}
				});
			}
			
			return result;
		}
477974
def get_br(self):
        """"""

        cell_below = CellBorders(self.cell_attributes,
                                 *self.cell.get_below_key_rect())
        return cell_below.get_r()
1241867
function colorChanged(elem) {
		var color = elem.getAttribute('stroke');

		$.each(mtypes, function(i, pos) {
			var marker = getLinked(elem, 'marker-'+pos);
			if (!marker) {return;}
			if (!marker.attributes.se_type) {return;} // not created by this extension
			var ch = marker.lastElementChild;
			if (!ch) {return;}
			var curfill = ch.getAttribute('fill');
			var curstroke = ch.getAttribute('stroke');
			if (curfill && curfill != 'none') {ch.setAttribute('fill', color);}
			if (curstroke && curstroke != 'none') {ch.setAttribute('stroke', color);}
		});
	}
764609
function() {
    var sMode = this.get("selectionMode");
    var oTrigger = {};
    var oTriggerCell, oTriggerRecord, nTriggerRecordIndex, elTriggerRow, nTriggerTrIndex;

    // Cell mode
    if((sMode == "cellblock") || (sMode == "cellrange") || (sMode == "singlecell")) {
        oTriggerCell = this.getLastSelectedCell();
        // No selected cells found
        if(!oTriggerCell) {
            return null;
        }
        else {
            oTriggerRecord = this.getRecord(oTriggerCell.recordId);
            nTriggerRecordIndex = this.getRecordIndex(oTriggerRecord);
            elTriggerRow = this.getTrEl(oTriggerRecord);
            nTriggerTrIndex = this.getTrIndex(elTriggerRow);

            // Selected cell not found on this page
            if(nTriggerTrIndex === null) {
                return null;
            }
            else {
                oTrigger.record = oTriggerRecord;
                oTrigger.recordIndex = nTriggerRecordIndex;
                oTrigger.el = this.getTdEl(oTriggerCell);
                oTrigger.trIndex = nTriggerTrIndex;
                oTrigger.column = this.getColumn(oTriggerCell.columnKey);
                oTrigger.colKeyIndex = oTrigger.column.getKeyIndex();
                oTrigger.cell = oTriggerCell;
                return oTrigger;
            }
        }
    }
    // Row mode
    else {
        oTriggerRecord = this.getLastSelectedRecord();
        // No selected rows found
        if(!oTriggerRecord) {
                return null;
        }
        else {
            // Selected row found, but is it on current page?
            oTriggerRecord = this.getRecord(oTriggerRecord);
            nTriggerRecordIndex = this.getRecordIndex(oTriggerRecord);
            elTriggerRow = this.getTrEl(oTriggerRecord);
            nTriggerTrIndex = this.getTrIndex(elTriggerRow);

            // Selected row not found on this page
            if(nTriggerTrIndex === null) {
                return null;
            }
            else {
                oTrigger.record = oTriggerRecord;
                oTrigger.recordIndex = nTriggerRecordIndex;
                oTrigger.el = elTriggerRow;
                oTrigger.trIndex = nTriggerTrIndex;
                return oTrigger;
            }
        }
    }
}
838086
function(){
		var cell = this.getcell();
		if(cell.isnull || cell.is51cell() || cell===this.mouseCell){ return;}
		if(this.inputData===null){ this.decIC(cell);}

		this.mouseCell = cell;
		var clist = cell.room.clist;
		for(var i=0;i<clist.length;i++){
			var cell2 = clist[i];
			if(this.inputData===1 || cell2.qsub!==3){
				(this.inputData===1?cell2.setShade:cell2.clrShade).call(cell2);
				cell2.setQsub(this.inputData===2?1:0);
			}
		}
		clist.draw();
	}
1349188
def _process_qtls_genomic_location(
            self, raw, txid, build_id, build_label, common_name, limit=None):
        
        if self.test_mode:
            graph = self.testgraph
        else:
            graph = self.graph
        model = Model(graph)
        line_counter = 0
        geno = Genotype(graph)
        # assume that chrs get added to the genome elsewhere

        taxon_curie = 'NCBITaxon:' + txid
        eco_id = self.globaltt['quantitative trait analysis evidence']
        LOG.info("Processing QTL locations for %s from %s", taxon_curie, raw)
        with gzip.open(raw, 'rt', encoding='ISO-8859-1') as tsvfile:
            reader = csv.reader(tsvfile, delimiter="\t")
            for row in reader:
                line_counter += 1
                if re.match(r'^#', ' '.join(row)):
                    continue

                (chromosome, qtl_source, qtl_type, start_bp, stop_bp, frame, strand,
                 score, attr) = row
                example = '''
Chr.Z   Animal QTLdb    Production_QTL  33954873      34023581...
QTL_ID=2242;Name="Spleen percentage";Abbrev="SPLP";PUBMED_ID=17012160;trait_ID=2234;
trait="Spleen percentage";breed="leghorn";"FlankMarkers=ADL0022";VTO_name="spleen mass";
MO_name="spleen weight to body weight ratio";Map_Type="Linkage";Model="Mendelian";
Test_Base="Chromosome-wise";Significance="Significant";P-value="<0.05";F-Stat="5.52";
Variance="2.94";Dominance_Effect="-0.002";Additive_Effect="0.01
                '''
                str(example)
                # make dictionary of attributes
                # keys are:
                # QTL_ID,Name,Abbrev,PUBMED_ID,trait_ID,trait,FlankMarkers,
                # VTO_name,Map_Type,Significance,P-value,Model,
                # Test_Base,Variance, Bayes-value,PTO_name,gene_IDsrc,peak_cM,
                # CMO_name,gene_ID,F-Stat,LOD-score,Additive_Effect,
                # Dominance_Effect,Likelihood_Ratio,LS-means,Breed,
                # trait (duplicate with Name),Variance,Bayes-value,
                # F-Stat,LOD-score,Additive_Effect,Dominance_Effect,
                # Likelihood_Ratio,LS-means

                # deal with poorly formed attributes
                if re.search(r'"FlankMarkers";', attr):
                    attr = re.sub(r'FlankMarkers;', '', attr)
                attr_items = re.sub(r'"', '', attr).split(";")
                bad_attrs = set()
                for attributes in attr_items:
                    if not re.search(r'=', attributes):
                        # remove this attribute from the list
                        bad_attrs.add(attributes)

                attr_set = set(attr_items) - bad_attrs
                attribute_dict = dict(item.split("=") for item in attr_set)

                qtl_num = attribute_dict.get('QTL_ID')
                if self.test_mode and int(qtl_num) not in self.test_ids:
                    continue
                # make association between QTL and trait based on taxon

                qtl_id = common_name + 'QTL:' + str(qtl_num)
                model.addIndividualToGraph(qtl_id, None, self.globaltt['QTL'])
                geno.addTaxon(taxon_curie, qtl_id)

                #
                trait_id = 'AQTLTrait:' + attribute_dict.get('trait_ID')

                # if pub is in attributes, add it to the association
                pub_id = None
                if 'PUBMED_ID' in attribute_dict.keys():
                    pub_id = attribute_dict.get('PUBMED_ID')
                    if re.match(r'ISU.*', pub_id):
                        pub_id = 'AQTLPub:' + pub_id.strip()
                        reference = Reference(graph, pub_id)
                    else:
                        pub_id = 'PMID:' + pub_id.strip()
                        reference = Reference(
                            graph, pub_id, self.globaltt['journal article'])
                    reference.addRefToGraph()

                # Add QTL to graph
                assoc = G2PAssoc(
                    graph, self.name, qtl_id, trait_id,
                    self.globaltt['is marker for'])
                assoc.add_evidence(eco_id)
                assoc.add_source(pub_id)
                if 'P-value' in attribute_dict.keys():
                    scr = re.sub(r'<', '', attribute_dict.get('P-value'))
                    if ',' in scr:
                        scr = re.sub(r',', '.', scr)
                    if scr.isnumeric():
                        score = float(scr)
                        assoc.set_score(score)

                assoc.add_association_to_graph()
                # TODO make association to breed
                # (which means making QTL feature in Breed background)

                # get location of QTL
                chromosome = re.sub(r'Chr\.', '', chromosome)
                chrom_id = makeChromID(chromosome, taxon_curie, 'CHR')

                chrom_in_build_id = makeChromID(chromosome, build_id, 'MONARCH')
                geno.addChromosomeInstance(
                    chromosome, build_id, build_label, chrom_id)
                qtl_feature = Feature(graph, qtl_id, None, self.globaltt['QTL'])
                if start_bp == '':
                    start_bp = None
                qtl_feature.addFeatureStartLocation(
                    start_bp, chrom_in_build_id, strand,
                    [self.globaltt['FuzzyPosition']])
                if stop_bp == '':
                    stop_bp = None
                qtl_feature.addFeatureEndLocation(
                    stop_bp, chrom_in_build_id, strand,
                    [self.globaltt['FuzzyPosition']])
                qtl_feature.addTaxonToFeature(taxon_curie)
                qtl_feature.addFeatureToGraph()

                if not self.test_mode and limit is not None and line_counter > limit:
                    break

        # LOG.warning("Bad attribute flags in this file")  # what does this even mean??
        LOG.info("Done with QTL genomic mappings for %s", taxon_curie)
        return
1029838
function() {
			var c = this.canvas;

			var radius = this.r;
			var x = this.size / 2;

			var stopIndex = 0; // The index of the current color
			var stop = this.stops[stopIndex], prevStop;

			var diff, t, sameColor;

			c.rotate(-90, this.size / 2, this.size / 2);

			for (var i = 0; i < 360; i += 0.5) {
				if (i / 360 + ε >= stop.pos) {
					// Switch color stop
					do {
						prevStop = stop;

						stopIndex++;
						stop = this.stops[stopIndex];
					} while (
						stop && stop !== prevStop && stop.pos === prevStop.pos
					);

					if (!stop) {
						break;
					}

					sameColor =
						prevStop.color + '' === stop.color + '' &&
						prevStop !== stop;

					diff = prevStop.color.map(function(c, i){
						return stop.color[i] - c;
					});
				}

				t = (i / 360 - prevStop.pos) / (stop.pos - prevStop.pos);

				var interpolated = sameColor ?
					stop.color :
					diff.map(function (d, i){
						var ret = d * t + prevStop.color[i];

						return i < 3 ? ret & 255 : ret;
					});

				var path = new _.CanvasKit.SkPath();

				path.moveTo(x, x);

				var angle = Math.min(360 * deg, i * deg);
				var θ;

				if (sameColor) {
					θ = 360 * (stop.pos - prevStop.pos);

					i += θ - 0.5;
				}
				else {
					θ = 0.5;
				}

				var endAngle = angle + θ * deg;

				endAngle = Math.min(360 * deg, endAngle);

				// 0.02: To prevent moire

				var arc = endAngle - angle;

				path.arc(
					x, x,
					radius,
					arc >= 2 * deg ? angle : angle - 0.02, endAngle
				);

				var paint = new _.CanvasKit.SkPaint();
				paint.setStyle(_.CanvasKit.PaintStyle.Fill);
				paint.setColor(_.CanvasKit.Color(...interpolated, 1.0));

				c.drawPath(path, paint);
				
				this.surface.flush();

				path.delete();
				paint.delete();
			}
		}
534423
function() {
				that.debug.groupStart( 'mouseNear' ); // %REMOVE_LINE%

				updateSize( that, this );
				var offset = that.holdDistance,
					size = this.size;

				// Determine neighborhood by element dimensions and offsets.
				if ( size && inBetween( that.mouse.y, size.top - offset, size.bottom + offset ) && inBetween( that.mouse.x, size.left - offset, size.right + offset ) ) {
					that.debug.logEnd( 'Mouse is near.' ); // %REMOVE_LINE%
					return true;
				}

				that.debug.logEnd( 'Mouse isn\'t near.' ); // %REMOVE_LINE%
				return false;
			}
684763
function Color(x, y, z, m) {
      var me, _ref2;
      me = this;
      if (!(x != null) && !(y != null) && !(z != null) && !(m != null)) {
        x = [255, 0, 255];
      }
      if (type(x) === "array" && x.length === 3) {
        if (m == null) m = y;
        _ref2 = x, x = _ref2[0], y = _ref2[1], z = _ref2[2];
      }
      if (type(x) === "string") {
        m = 'hex';
      } else {
        if (m == null) m = 'rgb';
      }
      if (m === 'rgb') {
        me.rgb = [x, y, z];
      } else if (m === 'hsl') {
        me.rgb = Color.hsl2rgb(x, y, z);
      } else if (m === 'hsv') {
        me.rgb = Color.hsv2rgb(x, y, z);
      } else if (m === 'hex') {
        me.rgb = Color.hex2rgb(x);
      } else if (m === 'lab') {
        me.rgb = Color.lab2rgb(x, y, z);
      } else if (m === 'csl') {
        me.rgb = Color.csl2rgb(x, y, z);
      } else if (m === 'hsi') {
        me.rgb = Color.hsi2rgb(x, y, z);
      }
    }
534770
def add_castle(self, position):
        
        if self.has_moved or self.in_check(position):
            return

        if self.color == color.white:
            rook_rank = 0
        else:
            rook_rank = 7

        castle_type = {
            notation_const.KING_SIDE_CASTLE: {
                "rook_file": 7,
                "direction": lambda king_square, times: king_square.shift_right(times)
            },
            notation_const.QUEEN_SIDE_CASTLE: {
                "rook_file": 0,
                "direction": lambda king_square, times: king_square.shift_left(times)
            }
        }
        for castle_key in castle_type:
            castle_dict = castle_type[castle_key]
            castle_rook = position.piece_at_square(Location(rook_rank, castle_dict["rook_file"]))
            if self._rook_legal_for_castle(castle_rook) and \
                    self._empty_not_in_check(position, castle_dict["direction"]):
                yield self.create_move(castle_dict["direction"](self.location, 2), castle_key)
668230
private boolean isRed(MtasRBTreeNode n) {
    if (n == null) {
      return false;
    }
    return n.color == MtasRBTreeNode.RED;
  }
956479
def equality(self, other):
        
        # Compare specified attributes for equality
        cname = self.__class__.__name__
        for aname in self.attributes:
            try:
                attr1 = getattr(self, aname)
                attr2 = getattr(other, aname)
            except AttributeError as error:
                logging.debug("%s.%s: %s", cname, aname, error)
                return False
            self.log(attr1, attr2, '==', cname=cname, aname=aname)
            eql = (attr1 == attr2)
            self.log(attr1, attr2, '==', cname=cname, aname=aname, result=eql)
            if not eql:
                return False

        return True