returns location or -1
328881
public int locate(Attribute attr) {
        List lst;
        int i;
        int max;

        if (attr.symbol < attrs.size()) {
            lst = (List) attrs.get(attr.symbol);
            max = lst.size();
            for (i = 0; i < max; i++) {
                if (attr == lst.get(i)) {
                    return i;
                }
            }
        }
        return -1;
    }
768555
function(arr, o) {
      if (arr.indexOf) return arr.indexOf(o);
      for (var i = 0; i < this.length; i++) if (arr[i] === o) return i;
      return -1;
    }
1035840
public int getLocation(Object value) {
    int		result;
    int		i;
    String	valueStr;

    result = 0;

    valueStr = value.toString();
    for (i = 0; i < width(); i++) {
      if ((getValue(i)).equals(valueStr)) {
	result = ((int) m_Min) + i;
	break;
      }
    }

    return result;
  }
502142
function getPlace() {
      var place = 0;
      while (takenPlaces.indexOf(place) !== -1) {
        place++;
      }
      takenPlaces.push(place);
      return place;
    }
755897
def get_valid_location(location):
    """"""
    # If we're given None, return None
    if location is not None and cellular_components.get(location) is None:
        loc = cellular_components_reverse.get(location)
        if loc is None:
            raise InvalidLocationError(location)
        else:
            return loc
    return location
894300
public static Location location(int start, int end, Strand strand, int length) {
		int min = Math.min(start, end);
		//if this is true then we have a coord on the +ve strand even though Strand could be negative
		boolean isReverse = (min != start);
		if (isReverse) {
			return new SimpleLocation(
					new SimplePoint(start).reverse(length),
					new SimplePoint(end).reverse(length),
					strand);
		}
		return new SimpleLocation(start, end, strand);
	}
1134203
def positionIf(pred, seq):
    
    for i,e in enumerate(seq):
        if pred(e):
            return i
    return -1
1145964
def convertLocation(self, pos):
        
        if isUnspecified(pos):
            return None
        coordLen = pos.split('/')
        if len(coordLen) > 1:
            allLoc = self._createGaAlleleLocation()
            allLoc.start = int(coordLen[0]) - 1
            return allLoc
        return None
935062
public int getLineNumber(Location start) {
        if (mLineNumberTable == null || start.getLocation() < 0) {
            return -1;
        }
        else {
            return mLineNumberTable.getLineNumber(start);
        }
    }
690398
def location(self):
        
        if self._location.lower() == 'n':
            return NEUTRAL
        if self._location.lower() == '@':
            return AWAY
        return HOME
867100
def getOffset(self, loc):
        
        return Location(loc.x - self.x, loc.y - self.y)
84611
function(a, b) {
    a = a.trim().toLowerCase();
    b = b.trim().toLowerCase();

    if (a === b) return 0;
    if (a < b) return 1;

    return -1;
  }
1142853
def pop(self, index=-1):
        
        if index == 0:
            return self._pop_left()
        elif index == -1:
            return self._pop_right()
        else:
            return self._pop_middle(index)
745573
def get_bottomrect_idx(self, pos):
        
        for i, r in enumerate(self.link_bottom_rects):
            if r.Contains(pos):
                return i
        return -1
106975
def rightAt(self, offset=0):
        
        return Location(self.getX() + self.getW() + offset, self.getY() + (self.getH() / 2))
951867
function findStoresInRangeLocation(location, range, callback) {
  range = range || 3;

  geo.reverseGeocode(location, function(err, georesult) {
    if (err) return callback(err);
    findStoresInRange(georesult, range, callback);
  });
}
476942
def get_tile_location(self, x, y):
        """"""
        x1, y1 = self.origin
        x1 += self.BORDER + (self.BORDER + self.cell_width) * x
        y1 += self.BORDER + (self.BORDER + self.cell_height) * y
        return x1, y1