Calculate a footprint of a string

@param stringToFootprint The string for which the footprint is calculated
@return The footprint calculated
762595
public static String footprint(String stringToFootprint) {
		try {
			MessageDigest md = MessageDigest.getInstance("SHA-1");
			return byteArrayToHexString(md.digest(stringToFootprint.getBytes()));
		}
		catch (NoSuchAlgorithmException nsae) {
			LOGGER.warn("Unable to calculate the footprint for string [{}].", stringToFootprint);
			return null;
		}	
	}
368246
protected final String getFingerprint(Description description) {
        return TestResultDataUtils.getFingerprint(description.getTestClass(), description.getMethodName());
    }
816793
public final static boolean isMailAddress(String str)
    {
        int atIndex = str.indexOf('@');
        if ( atIndex == -1 ) {
            return false;
        }
        
        if ( ! StringUtil.isLetterOrNumeric(str, 0, atIndex) ) {
            return false;
        }
        
        int ptIndex, ptStart = atIndex + 1;
        while ( (ptIndex = str.indexOf('.', ptStart)) > 0 ) {
            if ( ptIndex == ptStart ) {
                return false;
            }
            
            if ( ! StringUtil.isLetterOrNumeric(str, ptStart, ptIndex) ) {
                return false;
            }
            
            ptStart = ptIndex + 1;
        }
        
        if ( ptStart < str.length() 
                && ! StringUtil.isLetterOrNumeric(str, ptStart, str.length()) ) {
            return false;
        }
        
        return true;
    }
206469
def find_stringy_lines(tree: ast.AST, first_line_no: int) -> Set[int]:
    
    str_footprints = set()
    for node in ast.walk(tree):
        if isinstance(node, ast.Str):
            str_footprints.update(build_footprint(node, first_line_no))
    return str_footprints
872040
@Override
    public void printStackTrace(PrintWriter pw) {
        if ( getCause() != null ) {
            String superString = getLocalMessage();
            synchronized (pw) {
                pw.print(superString);
                pw.print((superString.endsWith(".") ?
                          " Caused by " : ". Caused by "));
                getCause().printStackTrace( pw );
            }
        } else {
            super.printStackTrace( pw );
        }
    }
948320
private int getStackOffset(@NonNull StackTraceElement[] trace) {
    checkNotNull(trace);

    for (int i = MIN_STACK_OFFSET; i < trace.length; i++) {
      StackTraceElement e = trace[i];
      String name = e.getClassName();
      if (!name.equals(LoggerPrinter.class.getName()) && !name.equals(Logger.class.getName())) {
        return --i;
      }
    }
    return -1;
  }
283944
public static String printStackTrace(Throwable t) {
        return t == null ? PcConstants.NA : ExceptionUtils.getStackTrace(t);

    }
90897
public static String extractBasePath(String targetTmpPath, String tmpSuffix)
    {
        int lastIndex = targetTmpPath.lastIndexOf(tmpSuffix);
        String result = targetTmpPath.substring(0, lastIndex);
        return result;
    }
1008592
public java.lang.String getUfsFingerprint() {
    java.lang.Object ref = ufsFingerprint_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      if (bs.isValidUtf8()) {
        ufsFingerprint_ = s;
      }
      return s;
    }
  }
788172
private static Pattern importStringToPattern(String s, Processor p, Log log) {
        if (isValidImportString(s)) {
            return validImportStringToPattern(s);
        } else {
            log.warning("proc.malformed.supported.string", s, p.getClass().getName());
            return noMatches; // won't match any valid identifier
        }
    }
123041
protected function getClassFootprint(ClassScanner $class)
    {
        $footprint = new ClassFootprint();

        if ($class->isInterface()) {
            $footprint->setType(ClassFootprint::TYPE_INTERFACE);
        } elseif ($class->isTrait()) {
            $footprint->setType(ClassFootprint::TYPE_TRAIT);
        }

        $footprint->setParent($class->getParentClass());

        foreach ($class->getConstants(false) as $constant) {
            $footprint->addConstant($constant->getName(), $constant->getValue());
        }

        foreach ($class->getInterfaces() as $interface) {
            $footprint->addInterface($interface);
        }

        return $footprint;
    }
677330
private List<int[]> getPairPositionList(byte[] fingerprint) {

        int numFrames = FingerprintManager.getNumFrames(fingerprint);

        // table for paired frames
        byte[] pairedFrameTable = new byte[numFrames / anchorPointsIntervalLength + 1]; // each second has numAnchorPointsPerSecond pairs only
        // end table for paired frames

        List<int[]> pairList = new LinkedList<>();
        List<int[]> sortedCoordinateList = getSortedCoordinateList(fingerprint);

        for (int[] anchorPoint : sortedCoordinateList) {
            int anchorX = anchorPoint[0];
            int anchorY = anchorPoint[1];
            int numPairs = 0;

            for (int[] aSortedCoordinateList : sortedCoordinateList) {

                if (numPairs >= maxPairs) {
                    break;
                }

                if (isReferencePairing && pairedFrameTable[anchorX
                                / anchorPointsIntervalLength] >= numAnchorPointsPerInterval) {
                    break;
                }

                int targetX = aSortedCoordinateList[0];
                int targetY = aSortedCoordinateList[1];

                if (anchorX == targetX && anchorY == targetY) {
                    continue;
                }

                // pair up the points
                int x1, y1, x2, y2; // x2 always >= x1
                if (targetX >= anchorX) {
                    x2 = targetX;
                    y2 = targetY;
                    x1 = anchorX;
                    y1 = anchorY;
                } else {
                    x2 = anchorX;
                    y2 = anchorY;
                    x1 = targetX;
                    y1 = targetY;
                }

                // check target zone
                if ((x2 - x1) > maxTargetZoneDistance) {
                    continue;
                }
                // end check target zone

                // check filter bank zone
                if (!(y1 / bandwidthPerBank == y2 / bandwidthPerBank)) {
                    continue; // same filter bank should have equal value
                }
                // end check filter bank zone

                int pairHashcode = (x2 - x1) * numFrequencyUnits * numFrequencyUnits + y2 * numFrequencyUnits + y1;

                // stop list applied on sample pairing only
                if (!isReferencePairing && stopPairTable.containsKey(pairHashcode)) {
                    numPairs++; // no reservation
                    continue; // escape this point only
                }
                // end stop list applied on sample pairing only

                // pass all rules
                pairList.add(new int[] {pairHashcode, anchorX});
                pairedFrameTable[anchorX / anchorPointsIntervalLength]++;
                numPairs++;
                // end pair up the points
            }
        }

        return pairList;
    }
1355017
public static String getStringAfter(final String src, final String toSearch, final int start) {
		final int ind = src.indexOf(toSearch, start);
		if (ind == -1)
			return "";
		return src.substring(ind + toSearch.length());
	}
1242313
def _calc_footprint(self):
        """"""
        corners = [self.corner(corner) for corner in self.corner_types()]
        coords = []
        for corner in corners:
            shape = corner.get_shape(corner.crs)
            coords.append([shape.x, shape.y])

        shp = Polygon(coords)
        #  TODO use GeoVector.from_bounds
        self._footprint = GeoVector(shp, self.crs)
        return self._footprint
255377
private boolean checkAtTin(final String ptin) {
    final int checkSum = ptin.charAt(8) - '0';
    final int sum = ptin.charAt(0) - '0' + squareSum((ptin.charAt(1) - '0') * 2) //
        + ptin.charAt(2) - '0' + squareSum((ptin.charAt(3) - '0') * 2) //
        + ptin.charAt(4) - '0' + squareSum((ptin.charAt(5) - '0') * 2) //
        + ptin.charAt(6) - '0' + squareSum((ptin.charAt(7) - '0') * 2);
    final int calculatedCheckSum = (80 - sum) % 10;
    return checkSum == calculatedCheckSum;
  }
1266010
public static String getThumbprint(final X509Certificate cert) throws CertificateEncodingException {

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

		byte[] rawOctets = cert.getEncoded();

		SHA1Digest digest = new SHA1Digest();

		byte[] digestOctets = new byte[digest.getDigestSize()];

		digest.update(rawOctets, 0, rawOctets.length);

		digest.doFinal(digestOctets, 0);

		return new String(Base64.encode(digestOctets));
	}
928303
def footprint(self, nside=None):
        
        if nside is None:
            nside = self.nside_pixel
        elif nside < self.nside_catalog: 
            raise Exception('Requested nside=%i is less than catalog_nside'%nside)
        elif nside > self.nside_pixel:
            raise Exception('Requested nside=%i is greater than pixel_nside'%nside)
        pix = np.arange(hp.nside2npix(nside), dtype=int)
        map = self.inFootprint(pix,nside)
        return map