Skip to content

Instantly share code, notes, and snippets.

@ylashin
Created September 3, 2022 10:29
Show Gist options
  • Save ylashin/aef8856182b53d67041b9f5b09909751 to your computer and use it in GitHub Desktop.
Save ylashin/aef8856182b53d67041b9f5b09909751 to your computer and use it in GitHub Desktop.
def find_stats_for_records_matching_x_or_y(files, x, y):
files_scanned = 0
false_positives = 0
for k in files.keys():
file = files[k]
if not ((file.minx <= x and file.maxx >= x) or (file.miny <= y and file.maxy >=y)):
continue
files_scanned += 1
for item in file.items:
if item.x != x and item.y != y:
false_positives += 1
print(f"files_scanned : {files_scanned}")
print(f"false_positives: {false_positives}")
find_stats_for_records_matching_x_or_y(linear_organised_files, 2, 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment