repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/face_utils/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:22.420782 | # import the necessary packages
from .helpers import FACIAL_LANDMARKS_68_IDXS
from .helpers import FACIAL_LANDMARKS_5_IDXS
from .helpers import FACIAL_LANDMARKS_IDXS
from .helpers import rect_to_bb
from .helpers import shape_to_np
from .helpers import visualize_facial_landmarks
from .facealigner import FaceAligner
|
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/feature/dense.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:23.170641 | import cv2
class DENSE:
def __init__(self, step=6, radius=.5):
self.step = step
self.radius = radius
def detect(self, img):
# initialize our list of keypoints
kps = []
# loop over the height and with of the image, taking a `step`
# in each direction
for... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/feature/helpers.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:23.359557 | # import the necesasry packages
import cv2
def corners_to_keypoints(corners):
"""function to take the corners from cv2.GoodFeaturesToTrack and return cv2.KeyPoints"""
if corners is None:
keypoints = []
else:
keypoints = [cv2.KeyPoint(kp[0][0], kp[0][1], 1) for kp in corners]
return key... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/feature/gftt.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:23.472071 | import cv2
from .helpers import corners_to_keypoints
class GFTT:
def __init__(self, maxCorners=0, qualityLevel=0.01, minDistance=1,
mask=None, blockSize=3, useHarrisDetector=False, k=0.04):
self.maxCorners = maxCorners
self.qualityLevel = qualityLevel
self.minDistance = mi... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/face_utils/helpers.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:23.473209 | # import the necessary packages
from collections import OrderedDict
import numpy as np
import cv2
# define a dictionary that maps the indexes of the facial
# landmarks to specific face regions
#For dlib’s 68-point facial landmark detector:
FACIAL_LANDMARKS_68_IDXS = OrderedDict([
("mouth", (48, 68)),
("inner_mouth"... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/feature/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:23.475079 | from .helpers import corners_to_keypoints
from .factories import FeatureDetector_create
from .factories import DescriptorExtractor_create
from .factories import DescriptorMatcher_create
from .dense import DENSE
from .gftt import GFTT
from .harris import HARRIS
from .rootsift import RootSIFT
|
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/io/tempfile.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:23.476407 | # import the necessary packages
import uuid
import os
class TempFile:
def __init__(self, basePath="./", ext=".jpg"):
# construct the file path
self.path = "{base_path}/{rand}{ext}".format(base_path=basePath, rand=str(uuid.uuid4()),
ext=ext)
def cleanup(self):
# remove the file
os.remove(self.path) |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/feature/factories.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:23.477405 | from ..convenience import is_cv2
import cv2
from .dense import DENSE
from .gftt import GFTT
from .harris import HARRIS
from .rootsift import RootSIFT
if is_cv2():
def FeatureDetector_create(method):
method = method.upper()
if method == "DENSE":
return DENSE()
elif method == "GFT... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/feature/rootsift.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:23.562275 | # import the necessary packages
from __future__ import absolute_import
import numpy as np
import cv2
from ..convenience import is_cv2
class RootSIFT:
def __init__(self):
# initialize the SIFT feature extractor for OpenCV 2.4
if is_cv2():
self.extractor = cv2.DescriptorExtractor_create("SIFT")
# otherwise in... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/feature/harris.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:24.022101 | import cv2
import numpy as np
from .helpers import corners_to_keypoints
class HARRIS:
def __init__(self, blockSize=2, apertureSize=3, k=0.1, T=0.02):
self.blockSize = blockSize
self.apertureSize = apertureSize
self.k = k
self.T = T
def detect(self, img):
# convert our ... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/meta.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:24.069651 | # author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# import the necessary packages
from __future__ import print_function
import cv2
import re
def find_function(name, pretty_print=True, module=None):
# if the module is None, initialize it to to the root `cv2`
# library
if module is None:
modu... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/paths.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:24.228141 | # import the necessary packages
import os
image_types = (".jpg", ".jpeg", ".png", ".bmp", ".tif", ".tiff")
def list_images(basePath, contains=None):
# return the set of files that are valid
return list_files(basePath, validExts=image_types, contains=contains)
def list_files(basePath, validExts=None, contai... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/object_detection.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:24.258453 | # import the necessary packages
import numpy as np
def non_max_suppression(boxes, probs=None, overlapThresh=0.3):
# if there are no boxes, return an empty list
if len(boxes) == 0:
return []
# if the bounding boxes are integers, convert them to floats -- this
# is important since we'll be doing a bunch of divisi... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/video/filevideostream.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:24.378157 | # import the necessary packages
from threading import Thread
import sys
import cv2
import time
# import the Queue class from Python 3
if sys.version_info >= (3, 0):
from queue import Queue
# otherwise, import the Queue class for Python 2.7
else:
from Queue import Queue
class FileVideoStream:
def __init__(self, p... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/video/count_frames.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:24.380595 | # import the necessary packages
from ..convenience import is_cv3
import cv2
def count_frames(path, override=False):
# grab a pointer to the video file and initialize the total
# number of frames read
video = cv2.VideoCapture(path)
total = 0
# if the override flag is passed in, revert to the manual
# method of c... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/text.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:24.385122 | import cv2
def put_text(img, text, org, font_face, font_scale, color, thickness=1, line_type=8, bottom_left_origin=False):
"""Utility for drawing text with line breaks
:param img: Image.
:param text: Text string to be drawn.
:param org: Bottom-left corner of the first line of the text string in the i... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/video/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:24.393151 | # import the necessary packages
from .count_frames import count_frames
from .fps import FPS
from .videostream import VideoStream
from .webcamvideostream import WebcamVideoStream
from .filevideostream import FileVideoStream |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/perspective.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:24.422814 | # author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# import the necessary packages
from scipy.spatial import distance as dist
import numpy as np
import cv2
def order_points(pts):
# sort the points based on their x-coordinates
xSorted = pts[np.argsort(pts[:, 0]), :]
# grab the left-mo... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/video/fps.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:24.457773 | # import the necessary packages
import datetime
class FPS:
def __init__(self):
# store the start time, end time, and total number of frames
# that were examined between the start and end intervals
self._start = None
self._end = None
self._numFrames = 0
def start(self):
# start the timer
self._start = ... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/video/videostream.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:24.631204 | # import the necessary packages
from .webcamvideostream import WebcamVideoStream
class VideoStream:
def __init__(self, src=0, usePiCamera=False, resolution=(320, 240),
framerate=32, **kwargs):
# check to see if the picamera module should be used
if usePiCamera:
# only import the picamera packages unless we a... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/video/pivideostream.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:24.670691 | # import the necessary packages
from picamera.array import PiRGBArray
from picamera import PiCamera
from threading import Thread
import cv2
class PiVideoStream:
def __init__(self, resolution=(320, 240), framerate=32, **kwargs):
# initialize the camera
self.camera = PiCamera()
# set camera parameters
self.cam... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | imutils/video/webcamvideostream.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:24.823518 | # import the necessary packages
from threading import Thread
import cv2
class WebcamVideoStream:
def __init__(self, src=0, name="WebcamVideoStream"):
# initialize the video camera stream and read the first frame
# from the stream
self.stream = cv2.VideoCapture(src)
(self.grabbed, self.frame) = self.stream.rea... |
PyImageSearch/imutils | https://github.com/PyImageSearch/imutils | null | null | null | null | 4,594 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:24.833884 | from distutils.core import setup
setup(
name='imutils',
packages=['imutils', 'imutils.video', 'imutils.io', 'imutils.feature', 'imutils.face_utils'],
version='0.5.4',
description='A series of convenience functions to make basic image processing functions such as translation, rotation, resizing, skeleto... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/management/commands/receipts_text.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:27.277673 | import csv
import lzma
import os
from concurrent.futures import ThreadPoolExecutor
from bulk_update.helper import bulk_update
from jarbas.core.management.commands import LoadCommand
from jarbas.chamber_of_deputies.models import Reimbursement
class Command(LoadCommand):
help = 'Load Serenata de Amor receipts tex... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/celery.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:27.291572 | import logging
import os
from celery import Celery
from celery.schedules import crontab
from django.conf import settings
logger = logging.getLogger('celery')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'jarbas.settings')
app = Celery('jarbas')
app.config_from_object('django.conf:settings', namespace='CELERY')
a... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | contrib/update/cleanup.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:27.309235 | from os import getenv
from dopy.manager import DoManager
NAME = "serenata-update"
def destroy_droplet(manager):
droplet_id = None
for droplet in manager.all_active_droplets():
if droplet["name"] == NAME:
droplet_id = droplet["id"]
break
if not droplet_id:
print(... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/app.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:27.310684 | from django.apps import AppConfig
class ChamberOfDeputiesConfig(AppConfig):
name = 'jarbas.chamber_of_deputies'
verbose_name = 'Câmara dos Deputados - Cota para Exercício da Atividade Parlamentar'
|
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/management/commands/receipts.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:27.312335 | from concurrent import futures
from time import sleep
from bulk_update.helper import bulk_update
from django.core.management.base import BaseCommand
from requests.exceptions import ConnectionError
from jarbas.chamber_of_deputies.models import Reimbursement
class Command(BaseCommand):
help = 'Fetch receipts URLs... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/fields.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:27.318386 | import json
from rows import fields
class FloatField(fields.FloatField):
@classmethod
def deserialize(cls, value, *args, **kwargs):
try: # Rows cannot convert values such as '14,96' to float
value = float(value.replace(',', '.'))
except:
pass
return super(Flo... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/management/commands/reimbursements.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:28.749643 | from csv import DictReader
from jarbas.core.management.commands import LoadCommand
from jarbas.chamber_of_deputies.models import Reimbursement
from jarbas.chamber_of_deputies.tasks import serialize
class Command(LoadCommand):
help = 'Load Serenata de Amor reimbursements dataset'
BATCH_SIZE = 4096
def ad... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/management/commands/socialmedia.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:28.750789 | import csv
import os
from jarbas.core.management.commands import LoadCommand
from jarbas.chamber_of_deputies.models import SocialMedia
class Command(LoadCommand):
help = 'Load congresspeople social media accounts'
count = 0
def handle(self, *args, **options):
self.path = options['dataset']
... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/management/commands/update.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:28.751962 | from csv import DictReader, DictWriter
from pathlib import Path
from urllib.request import urlretrieve
from django.core.management import call_command
from django.core.management.base import BaseCommand
from jarbas.chamber_of_deputies.models import Reimbursement, Tweet
class Command(BaseCommand):
help = (
... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/management/commands/tweets.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:28.753528 | import logging
import re
import twitter
from django.conf import settings
from django.core.management.base import BaseCommand
from jarbas.chamber_of_deputies.models import Reimbursement, Tweet
class Command(BaseCommand):
help = 'Find out and save links to @RosieDaSerenata tweets'
def __init__(self, *args, *... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/management/commands/suspicions.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:28.755599 | import csv
import lzma
import os
from concurrent.futures import ThreadPoolExecutor
from bulk_update.helper import bulk_update
from django.core.exceptions import ObjectDoesNotExist
from jarbas.core.management.commands import LoadCommand
from jarbas.chamber_of_deputies.models import Reimbursement
class Command(LoadCo... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/management/commands/searchvector.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:29.423843 | from django.core.management.base import BaseCommand
from django.contrib.postgres.search import SearchVector
from tqdm import tqdm
from jarbas.chamber_of_deputies.models import Reimbursement
class Command(BaseCommand):
BATCH_SIZE = 4096
def add_arguments(self, parser):
parser.add_argument('--silent... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/management/commands/tweet.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:29.633776 | from django.core.management.base import BaseCommand
from jarbas.chamber_of_deputies.twitter import Twitter
class Command(BaseCommand):
help = 'Tweet the next suspicion at @RosieDaSerenata account'
def add_arguments(self, parser):
parser.add_argument(
'--fake',
action='store_t... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/migrations/0004_alter_field_names_following_toolbox_renamings.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:29.856938 | from django.contrib.postgres.fields import ArrayField
from django.db import migrations, models
def convert_reimbursement_numbers_to_array(apps, schema_editor):
Reimbursement = apps.get_model("chamber_of_deputies", "Reimbursement")
for record in Reimbursement.objects.all():
record.numbers = record.reim... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/serializers.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:30.673613 | import re
from rest_framework import serializers
from jarbas.chamber_of_deputies.models import Reimbursement
from jarbas.core.models import Company
class ReimbursementSerializer(serializers.ModelSerializer):
all_numbers = serializers.SerializerMethodField()
document_value = serializers.SerializerMethodFiel... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/models.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:30.675894 | from django.contrib.postgres.fields import ArrayField, JSONField
from django.contrib.postgres.indexes import GinIndex
from django.contrib.postgres.search import SearchVectorField
from django.db import models
from requests import head
from jarbas.chamber_of_deputies.querysets import ReimbursementQuerySet
class Social... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tests/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:30.677245 | from datetime import date
from random import randrange
from django.utils import timezone
from jarbas.chamber_of_deputies.models import Tweet
suspicions = {
'over_monthly_subquota': {'is_suspect': True, 'probability': 1.0}
}
sample_reimbursement_data = dict(
applicant_id=13,
batch_number=9,
cnpj_cpf=... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/querysets.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:30.704063 | import re
from functools import reduce
from django.db import models
from django.db.models import Q
from django.db.models import F
from django.contrib.postgres.search import SearchQuery
from django.contrib.postgres.search import SearchRank
class ReimbursementQuerySet(models.QuerySet):
def same_day_as(self, docum... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tasks.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:30.705415 | from itertools import chain
from jarbas.chamber_of_deputies.fields import ArrayField, DateAsStringField, FloatField, IntegerField
from jarbas.chamber_of_deputies.models import Reimbursement
INTEGERS = (
'applicant_id',
'batch_number',
'congressperson_document',
'congressperson_id',
'document_id',
... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tests/test_receipts_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:30.877637 | from unittest.mock import Mock, call, patch
from django.test import TestCase
from django.db.models import QuerySet
from requests.exceptions import ConnectionError
from jarbas.chamber_of_deputies.management.commands.receipts import Command
class TestCommandHandler(TestCase):
@patch('jarbas.chamber_of_deputies.m... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tests/test_applicant_view.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:30.879423 | from json import loads
from django.core.cache import cache
from django.shortcuts import resolve_url
from django.test import TestCase
from jarbas.chamber_of_deputies.models import Reimbursement
from jarbas.chamber_of_deputies.tests import sample_reimbursement_data
class TestApplicant(TestCase):
def setUp(self):... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tests/test_receipt_class.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:30.907955 | from unittest.mock import patch
from django.test import TestCase
from requests.exceptions import ConnectionError
from jarbas.chamber_of_deputies.models import Receipt
class TestReceipt(TestCase):
def setUp(self):
self.receipt = Receipt(1970, 13, 42, 1)
self.electronic_receipt = Receipt(1970, 13... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tests/test_receipts_text_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:31.090450 | from io import StringIO
from unittest.mock import Mock, call, patch
from django.test import TestCase
from jarbas.chamber_of_deputies.management.commands.receipts_text import Command
from jarbas.chamber_of_deputies.models import Reimbursement
class TestCommand(TestCase):
def setUp(self):
self.command = ... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tests/test_reimbursement_model.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:31.493075 | from unittest.mock import patch
from django.db.utils import IntegrityError
from django.test import TestCase
from requests.exceptions import ConnectionError
from jarbas.chamber_of_deputies.models import Reimbursement
from jarbas.chamber_of_deputies.tests import sample_reimbursement_data
class TestReimbursement(TestC... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tests/test_same_day_view.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:32.106456 | from json import loads
from django.shortcuts import resolve_url
from django.test import TestCase
from jarbas.chamber_of_deputies.models import Reimbursement
from jarbas.core.models import Company
from jarbas.chamber_of_deputies.tests import sample_reimbursement_data
from jarbas.core.tests import sample_company_data
f... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tests/test_suspicions_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:32.311995 | from io import StringIO
from unittest.mock import Mock, call, patch
from django.test import TestCase
from jarbas.chamber_of_deputies.management.commands.suspicions import Command
from jarbas.chamber_of_deputies.models import Reimbursement
class TestCommand(TestCase):
def setUp(self):
self.command = Com... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tests/test_subquota_view.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:32.312852 | from json import loads
from django.core.cache import cache
from django.shortcuts import resolve_url
from django.test import TestCase
from jarbas.chamber_of_deputies.models import Reimbursement
from jarbas.chamber_of_deputies.tests import sample_reimbursement_data
class TestSubquota(TestCase):
def setUp(self):
... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tests/test_serializers.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:32.341440 | from django.test import TestCase
from jarbas.chamber_of_deputies.serializers import clean_cnpj_cpf
class TestCleanCnpjCpf(TestCase):
def test_should_return_cnpj_cpf_without_mask(self):
self.assertEqual('12345678901234', clean_cnpj_cpf('12.345.678/9012-34'))
self.assertEqual('12345678901234', clea... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tests/test_searchvector_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:32.517632 | from django.test import TestCase
from mixer.backend.django import mixer
from jarbas.chamber_of_deputies.management.commands.searchvector import Command
from jarbas.chamber_of_deputies.models import Reimbursement
class TestCommandHandler(TestCase):
def test_handler(self):
mixer.cycle(3).blend(Reimburseme... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tests/test_tweet_model.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:32.518315 | from django.test import TestCase
from mixer.backend.django import mixer
from jarbas.chamber_of_deputies.models import Tweet
class TestTweet(TestCase):
def setUp(self):
self.tweet = mixer.blend(Tweet, reimbursement__search_vector=None, status=42)
def test_ordering(self):
mixer.blend(Tweet, r... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tests/test_tweets_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:32.721177 | from collections import namedtuple
from itertools import permutations
from unittest.mock import MagicMock, PropertyMock, patch
from django.test import TestCase
from mixer.backend.django import mixer
from jarbas.chamber_of_deputies.models import Reimbursement, Tweet
from jarbas.chamber_of_deputies.management.commands.... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tests/test_reimbursement_task.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:33.813437 | from datetime import date
from django.test import TestCase
from jarbas.chamber_of_deputies.models import Reimbursement
from jarbas.chamber_of_deputies.tasks import serialize
class TestCreateOrUpdateTask(TestCase):
def setUp(self):
self.data = {
'applicant_id': '13',
'batch_numbe... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tests/test_reimbursements_command.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:33.813875 | import os
from datetime import date
from unittest.mock import Mock, PropertyMock, call, patch
from django.conf import settings
from django.test import TestCase
from jarbas.chamber_of_deputies.management.commands.reimbursements import Command
from jarbas.chamber_of_deputies.models import Reimbursement
class TestComm... |
okfn-brasil/serenata-de-amor | https://github.com/okfn-brasil/serenata-de-amor | null | null | null | null | 4,590 | null | null | mit | null | null | null | null | null | null | null | jarbas/chamber_of_deputies/tests/test_reimbursement_view.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:33.893805 | from json import loads
from unittest.mock import patch
from urllib.parse import urlencode
from django.core.management import call_command
from django.shortcuts import resolve_url
from django.test import TestCase
from freezegun import freeze_time
from mixer.backend.django import mixer
from jarbas.chamber_of_deputies.t... |
phodal/awesome-iot | https://github.com/phodal/awesome-iot | null | null | null | null | 4,585 | null | null | mit | null | null | null | null | null | null | null | toc.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:36.603205 | #!/usr/bin/env python
#
# Sebastian Raschka 2014-2015
#
# Python script that inserts a table of contents
# into markdown documents and creates the required
# internal links.
#
# For more information about how internal links
# in HTML and Markdown documents work, please see
#
# Creating a table of contents with interna... |
phodal/awesome-iot | https://github.com/phodal/awesome-iot | null | null | null | null | 4,585 | null | null | mit | null | null | null | null | null | null | null | metadata.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:36.790091 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# by Erik Osheim
#
# Reads README.md, and writes a README.md.new. If the format of
# README.md changes, this script may need modifications.
#
# Currently it rewrites each section, doing the following:
# 1. alphabetizing
# 2. querying GitHub for stars and days since acti... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | enforcer/dal/supabase_dal.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.059571 | import base64
import binascii
import json
import logging
import os
import threading
from datetime import datetime, timezone, timedelta
from typing import Dict, Optional, List
import yaml
from enforcer.dal.robusta_config import RobustaConfig, RobustaToken
from supabase import create_client
from supabase.lib.client_opti... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | conftest.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.061082 | # Make sure pytest loads the asyncio plugin so `async def` tests run.
pytest_plugins = ("pytest_asyncio",)
|
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | enforcer/model.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.066946 | import logging
from typing import Optional, Dict, Any, List
from pydantic import BaseModel
class PodOwner(BaseModel):
kind: str
name: str
namespace: str
class RsOwner(BaseModel):
rs_name: str
namespace: str
owner_name: str
owner_kind: str
deletion_ts: Optional[float] = None
class ... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | enforcer/resources/kubernetes_resource_loader.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.070512 | import os
import logging
from typing import List
from enforcer.env_vars import DISCOVERY_MAX_BATCHES, DISCOVERY_BATCH_SIZE
from kubernetes import client
from kubernetes.client import V1ReplicaSetList
from kubernetes import config
from enforcer.model import RsOwner
if os.getenv("KUBERNETES_SERVICE_HOST"):
config.... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | enforcer/env_vars.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.074137 | import os
ROBUSTA_CONFIG_PATH = os.environ.get("ROBUSTA_CONFIG_PATH", "/etc/robusta/config/active_playbooks.yaml")
ROBUSTA_ACCOUNT_ID = os.environ.get("ROBUSTA_ACCOUNT_ID", "")
STORE_URL = os.environ.get("STORE_URL", "")
STORE_API_KEY = os.environ.get("STORE_API_KEY", "")
STORE_EMAIL = os.environ.get("STORE_EMAIL", ""... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | enforcer/dal/robusta_config.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.076506 | from typing import List, Dict
from pydantic import BaseModel
class RobustaConfig(BaseModel):
sinks_config: List[Dict[str, Dict]]
global_config: dict
class RobustaToken(BaseModel):
store_url: str
api_key: str
account_id: str
email: str
password: str
|
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | enforcer/params_utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.080721 | import logging
import os
import re
from typing import Dict, Optional
from pydantic.types import SecretStr
def get_env_replacement(value: str) -> Optional[str]:
env_values = re.findall(r"{{[ ]*env\.(.*)[ ]*}}", value)
if env_values:
env_var_value = os.environ.get(env_values[0].strip(), None)
i... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | enforcer/patch_manager.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.083133 | import copy
import logging
from typing import Dict, Any, List, Optional
from enforcer.model import ContainerRecommendation
from enforcer.env_vars import UPDATE_THRESHOLD, EXCLUDED_CONTAINERS
logger = logging.getLogger()
REQ = "requests"
LIM = "limits"
CPU = "cpu"
MEM = "memory"
def to_cpu_num(cpu_str: Optional[str]... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | enforcer/metrics.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.094652 | from prometheus_client import Counter, Histogram, Gauge
# Prometheus metrics
pod_admission_mutations = Counter(
"krr_pod_admission_mutations_total",
"Total pod admission mutations",
["mutated", "reason"], # labels: 'true' or 'false', reason for success/failure
)
replicaset_admissions = Counter(
"krr_... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | enforcer/enforcer_main.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.095911 | import sys
import os
# Add parent directory to Python path so we can import enforcer modules
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from enforcer.utils import add_custom_certificate
ADDITIONAL_CERTIFICATE: str = os.environ.get("CERTIFICATE", "")
if add_custom_certificate(ADD... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | enforcer/resources/owner_store.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.646839 | import logging
import threading
import time
from typing import Dict, Any, Optional, List
from enforcer.env_vars import REPLICA_SET_CLEANUP_INTERVAL, REPLICA_SET_DELETION_WAIT
from enforcer.metrics import rs_owners_size
from enforcer.model import PodOwner, RsOwner
from enforcer.resources.kubernetes_resource_loader impo... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | enforcer/resources/recommendation_store.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.701127 | import logging
import threading
from typing import Dict, Optional, Tuple
from enforcer.dal.supabase_dal import SupabaseDal
from enforcer.env_vars import SCAN_RELOAD_INTERVAL
from enforcer.model import WorkloadRecommendation, ContainerRecommendation
class RecommendationStore:
def __init__(self, dal: SupabaseDal)... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | examples/custom_formatter.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.719747 | # This is an example on how to create your own custom formatter
from __future__ import annotations
import robusta_krr
from robusta_krr.api import formatters
from robusta_krr.api.models import Result
# This is a custom formatter
# It will be available to the CLI as `my_formatter`
# Rich console will be enabled in th... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | enforcer/utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.720432 | import base64
import os
import certifi
CUSTOM_CERTIFICATE_PATH = "/tmp/custom_ca.pem"
def append_custom_certificate(custom_ca: str) -> None:
with open(certifi.where(), "ab") as outfile:
outfile.write(base64.b64decode(custom_ca))
os.environ["WEBSOCKET_CLIENT_CA_BUNDLE"] = certifi.where()
def creat... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | examples/custom_severity_calculator.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.730295 | # This is an example on how to create your own custom formatter
from __future__ import annotations
from typing import Optional
import robusta_krr
from robusta_krr.api.models import ResourceType, Severity, register_severity_calculator
@register_severity_calculator(ResourceType.CPU)
def percentage_severity_calculato... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | krr.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.731654 | import os
from robusta_krr.common.ssl_utils import add_custom_certificate
ADDITIONAL_CERTIFICATE: str = os.environ.get("CERTIFICATE", "")
if add_custom_certificate(ADDITIONAL_CERTIFICATE):
print("added custom certificate")
# DO NOT ADD ANY CODE ABOVE THIS
# ADDING IMPORTS BEFORE ADDING THE CUSTOM CERTS MIGHT IN... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | examples/custom_strategy.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.740473 | # This is an example on how to create your own custom strategy
import pydantic as pd
import robusta_krr
from robusta_krr.api.models import K8sObjectData, MetricsPodData, ResourceRecommendation, ResourceType, RunResult
from robusta_krr.api.strategies import BaseStrategy, StrategySettings
from robusta_krr.core.integrat... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/api/models.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.755077 | from robusta_krr.core.abstract.strategies import MetricsPodData, PodsTimeData, ResourceRecommendation, RunResult
from robusta_krr.core.models.allocations import RecommendationValue, ResourceAllocations, ResourceType
from robusta_krr.core.models.objects import K8sObjectData, PodData
from robusta_krr.core.models.result i... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/api/formatters.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:39.756176 | from robusta_krr.core.abstract.formatters import find, list_available, register
__all__ = ["register", "find", "list_available"]
|
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/api/strategies.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:40.266336 | from robusta_krr.core.abstract.strategies import BaseStrategy, StrategySettings
__all__ = ["BaseStrategy", "StrategySettings"]
|
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/abstract/metrics.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:40.317590 | import datetime
from abc import ABC, abstractmethod
from robusta_krr.core.abstract.strategies import PodsTimeData
from robusta_krr.core.models.objects import K8sObjectData
class BaseMetric(ABC):
"""
This abstraction is done for a future use.
Currently we only scrape metrics from Prometheus,
but in th... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/abstract/formatters.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:40.319519 | from __future__ import annotations
from typing import Any, Callable, Optional
from robusta_krr.core.models.result import Result
FormatterFunc = Callable[[Result], Any]
FORMATTERS_REGISTRY: dict[str, FormatterFunc] = {}
# NOTE: Here asterisk is used to make the argument `rich_console` keyword-only
# This is ... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/common/ssl_utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:40.356598 | import base64
import os
import certifi
CUSTOM_CERTIFICATE_PATH = "/tmp/custom_ca.pem"
def append_custom_certificate(custom_ca: str) -> None:
with open(certifi.where(), "ab") as outfile:
outfile.write(base64.b64decode(custom_ca))
os.environ["WEBSOCKET_CLIENT_CA_BUNDLE"] = certifi.where()
def creat... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/abstract/strategies.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:40.368103 | from __future__ import annotations
import abc
import datetime
from textwrap import dedent
from typing import TYPE_CHECKING, Annotated, Generic, Literal, Optional, Sequence, TypeVar, get_args
import numpy as np
import pydantic as pd
from numpy.typing import NDArray
from robusta_krr.core.models.result import K8sObject... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/integrations/kubernetes/config_patch.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:40.378326 | # NOTE: This is a workaround for the issue described here:
# https://github.com/kubernetes-client/python/pull/1863
from __future__ import annotations
from typing import Optional
from kubernetes.client import configuration
from kubernetes.config import kube_config
class KubeConfigLoader(kube_config.KubeConfigLoader... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/integrations/kubernetes/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:40.384291 | import asyncio
import logging
import re
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor
from typing import Any, Awaitable, Callable, Iterable, Optional, Union, Literal
from kubernetes import client, config # type: ignore
from kubernetes.client import ApiException
from kubernetes.... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/integrations/openshift/token.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:40.396698 | from typing import Optional
from robusta_krr.core.models.config import settings
# NOTE: This one should be mounted if openshift is enabled (done by Robusta Runner)
TOKEN_LOCATION = "/var/run/secrets/kubernetes.io/serviceaccount/token"
def load_token() -> Optional[str]:
if not settings.openshift:
return ... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/integrations/prometheus/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:41.252821 | from .loader import PrometheusMetricsLoader
from .metrics_service.prometheus_metrics_service import PrometheusDiscovery, PrometheusNotFound
from .prometheus_utils import ClusterNotSpecifiedException
|
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/integrations/prometheus/metrics/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:41.254936 | from .base import PrometheusMetric
from .cpu import CPUAmountLoader, CPULoader, PercentileCPULoader
from .memory import MaxMemoryLoader, MemoryAmountLoader, MemoryLoader, MaxOOMKilledMemoryLoader
|
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/integrations/prometheus/loader.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:41.256496 | from __future__ import annotations
import datetime
import logging
from concurrent.futures import ThreadPoolExecutor
from typing import TYPE_CHECKING, Optional, Dict, Any
from kubernetes import config as k8s_config
from kubernetes.client.api_client import ApiClient
from kubernetes.client.exceptions import ApiException... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/integrations/prometheus/metrics_service/mimir_metrics_service.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:41.425807 | from typing import Optional
from kubernetes.client import ApiClient
from prometrix import MetricsNotFound
from robusta_krr.utils.service_discovery import MetricsServiceDiscovery
from .prometheus_metrics_service import PrometheusMetricsService
class MimirMetricsDiscovery(MetricsServiceDiscovery):
def find_metri... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/integrations/prometheus/metrics_service/prometheus_metrics_service.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:41.427179 | import asyncio
import logging
import os
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime, timedelta
from typing import Iterable, List, Optional, Dict, Any
from kubernetes.client import ApiClient
from prometheus_api_client import PrometheusApiClientException
from prometrix import Promethe... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/integrations/prometheus/metrics_service/thanos_metrics_service.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:41.437517 | from typing import Optional
from kubernetes.client import ApiClient
from prometrix import MetricsNotFound, ThanosMetricsNotFound
from robusta_krr.utils.service_discovery import MetricsServiceDiscovery
from .prometheus_metrics_service import PrometheusMetricsService
class ThanosMetricsDiscovery(MetricsServiceDiscov... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/integrations/prometheus/metrics/memory.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:41.467158 | from robusta_krr.core.models.objects import K8sObjectData
from .base import PrometheusMetric, QueryType
class MemoryLoader(PrometheusMetric):
"""
A metric loader for loading memory usage metrics.
"""
query_type: QueryType = QueryType.QueryRange
def get_query(self, object: K8sObjectData, duratio... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/integrations/prometheus/prometheus_utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:42.815798 | from __future__ import annotations
from typing import TYPE_CHECKING
import boto3
from prometrix import AWSPrometheusConfig, CoralogixPrometheusConfig, PrometheusConfig, VictoriaMetricsPrometheusConfig
from robusta_krr.core.models.config import settings
if TYPE_CHECKING:
from robusta_krr.core.integrations.promet... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/integrations/prometheus/metrics_service/victoria_metrics_service.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:42.961554 | from typing import Optional
from kubernetes.client import ApiClient
from prometrix import MetricsNotFound, VictoriaMetricsNotFound
from robusta_krr.utils.service_discovery import MetricsServiceDiscovery
from .prometheus_metrics_service import PrometheusMetricsService
class VictoriaMetricsDiscovery(MetricsServiceDi... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/models/allocations.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:42.962796 | from __future__ import annotations
import enum
import math
from typing import Literal, Optional, TypeVar, Union
import pydantic as pd
from kubernetes.client.models import V1Container
from robusta_krr.utils import resource_units
class ResourceType(str, enum.Enum):
"""The type of resource.
Just add new type... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/runner.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:43.442088 | import asyncio
import logging
import math
import os
import sys
import time
import warnings
from concurrent.futures import ThreadPoolExecutor
from typing import Optional, Union, List
from datetime import timedelta, datetime
from prometrix import PrometheusNotFound
from rich.console import Console
from slack_sdk import W... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/formatters/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:43.542981 | from .json import json
from .pprint import pprint
from .table import table
from .yaml import yaml
from .csv import csv
from .csv_raw import csv_raw
from .html import html
|
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/formatters/csv.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:43.613698 | import csv
import io
import itertools
import logging
from typing import Any
from robusta_krr.core.abstract import formatters
from robusta_krr.core.models.allocations import NONE_LITERAL, format_diff, format_recommendation_value
from robusta_krr.core.models.config import settings
from robusta_krr.core.models.result imp... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/models/config.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:47.030393 | from __future__ import annotations
import logging
import sys
from typing import Any, Literal, Optional, Union
import pydantic as pd
from kubernetes import config
from kubernetes.config.config_exception import ConfigException
from rich.console import Console
from rich.logging import RichHandler
from robusta_krr.core.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.