repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
pfnet-research/nips17-adversarial-attack | https://github.com/pfnet-research/nips17-adversarial-attack/blob/b10f37d9d315c3c5367a575765d56ea6505f85f1/fcn_models/pre/conv.py | fcn_models/pre/conv.py | import chainer.functions as F
import chainer.initializers as I
import chainer.links as L
from .tf_loadable_chain import TFLoadableChain
class ConvBnRelu(TFLoadableChain):
def __init__(self, depth, ksize, stride=1, pad=0, initialW=I.HeNormal()):
super(ConvBnRelu, self).__init__()
with self.init_s... | python | MIT | b10f37d9d315c3c5367a575765d56ea6505f85f1 | 2026-01-05T07:11:45.954179Z | false |
pfnet-research/nips17-adversarial-attack | https://github.com/pfnet-research/nips17-adversarial-attack/blob/b10f37d9d315c3c5367a575765d56ea6505f85f1/fcn_models/pre/tf_loadable_chain.py | fcn_models/pre/tf_loadable_chain.py | import chainer
import chainer.links as L
class TFLoadableChain(chainer.Chain):
"""Chain class that support load_tf_checkpoint() method."""
def __init__(self, final_layer_name=''):
super(TFLoadableChain, self).__init__()
self.final_layer_name = final_layer_name
def load_tf_checkpoint(sel... | python | MIT | b10f37d9d315c3c5367a575765d56ea6505f85f1 | 2026-01-05T07:11:45.954179Z | false |
pfnet-research/nips17-adversarial-attack | https://github.com/pfnet-research/nips17-adversarial-attack/blob/b10f37d9d315c3c5367a575765d56ea6505f85f1/fcn_models/pre/__init__.py | fcn_models/pre/__init__.py | python | MIT | b10f37d9d315c3c5367a575765d56ea6505f85f1 | 2026-01-05T07:11:45.954179Z | false | |
pfnet-research/nips17-adversarial-attack | https://github.com/pfnet-research/nips17-adversarial-attack/blob/b10f37d9d315c3c5367a575765d56ea6505f85f1/fcn_models/pre/inception_resnet_v2.py | fcn_models/pre/inception_resnet_v2.py | try:
from tensorflow.python import pywrap_tensorflow
_tf_import_error = None
except ImportError as e:
_tf_import_error = e
import chainer
from chainer import cuda
import chainer.functions as F
import chainer.initializers as I
import chainer.links as L
import numpy as np
from .conv import ConvBnRelu
from ... | python | MIT | b10f37d9d315c3c5367a575765d56ea6505f85f1 | 2026-01-05T07:11:45.954179Z | false |
pfnet-research/nips17-adversarial-attack | https://github.com/pfnet-research/nips17-adversarial-attack/blob/b10f37d9d315c3c5367a575765d56ea6505f85f1/datasets/test_image_dataset.py | datasets/test_image_dataset.py | import chainer
import cv2
import numpy as np
class TestImageDataset(chainer.dataset.DatasetMixin):
'''Resize, flip and crop only'''
def __init__(self, paths, crop_size, mean=None):
self.paths = paths
self.crop_size = crop_size
self.mean = mean
def __len__(self):
return l... | python | MIT | b10f37d9d315c3c5367a575765d56ea6505f85f1 | 2026-01-05T07:11:45.954179Z | false |
pfnet-research/nips17-adversarial-attack | https://github.com/pfnet-research/nips17-adversarial-attack/blob/b10f37d9d315c3c5367a575765d56ea6505f85f1/datasets/__init__.py | datasets/__init__.py | from .test_image_dataset import TestImageDataset
| python | MIT | b10f37d9d315c3c5367a575765d56ea6505f85f1 | 2026-01-05T07:11:45.954179Z | false |
pfnet-research/nips17-adversarial-attack | https://github.com/pfnet-research/nips17-adversarial-attack/blob/b10f37d9d315c3c5367a575765d56ea6505f85f1/multi_fcn_training/__init__.py | multi_fcn_training/__init__.py | from .train_harness import *
| python | MIT | b10f37d9d315c3c5367a575765d56ea6505f85f1 | 2026-01-05T07:11:45.954179Z | false |
pfnet-research/nips17-adversarial-attack | https://github.com/pfnet-research/nips17-adversarial-attack/blob/b10f37d9d315c3c5367a575765d56ea6505f85f1/multi_fcn_training/train_harness.py | multi_fcn_training/train_harness.py | import chainer
import random
def pad_299_to_320(x_299):
x_320 = chainer.functions.pad(x_299, ((0, 0), (0, 0), (10, 11), (10, 11)), 'constant', constant_values=128)
return x_320
def perturbate_non_targeted(x_299, fcn, magnitude):
assert (isinstance(magnitude, int) and 4 <= magnitude <= 16)
x_320 = p... | python | MIT | b10f37d9d315c3c5367a575765d56ea6505f85f1 | 2026-01-05T07:11:45.954179Z | false |
numberly/flask2postman | https://github.com/numberly/flask2postman/blob/418c847455b08af83752e630d2bfc5d8111e301b/flask2postman.py | flask2postman.py | #!/usr/bin/env python
from __future__ import print_function
import re
import os
import site
import sys
from importlib import import_module
from time import time
from uuid import uuid4
__version__ = "1.4.4"
methods_order = ["GET", "POST", "PUT", "PATCH", "DELETE", "COPY", "HEAD",
"OPTIONS", "LINK", "... | python | MIT | 418c847455b08af83752e630d2bfc5d8111e301b | 2026-01-05T07:11:49.164123Z | false |
numberly/flask2postman | https://github.com/numberly/flask2postman/blob/418c847455b08af83752e630d2bfc5d8111e301b/setup.py | setup.py | from setuptools import setup
from flask2postman import __version__
with open('README.rst') as file:
long_description = file.read()
setup(
name='flask2postman',
version=__version__,
license='MIT',
author='Guillaume Gelin',
author_email='ramnes@1000mercis.com',
url='https://github.com/number... | python | MIT | 418c847455b08af83752e630d2bfc5d8111e301b | 2026-01-05T07:11:49.164123Z | false |
numberly/flask2postman | https://github.com/numberly/flask2postman/blob/418c847455b08af83752e630d2bfc5d8111e301b/example.py | example.py | from flask import Flask, Blueprint
app = Flask(__name__)
@app.route("/foo", methods=["GET"])
def get_foo():
"""Get some foo.
Returns:
A string containing a nice foo.
"""
return "foo"
@app.route("/foo/<int:id>", methods=["PATCH"])
def patch_foo(id):
return "", 200
@app.route("/bar", m... | python | MIT | 418c847455b08af83752e630d2bfc5d8111e301b | 2026-01-05T07:11:49.164123Z | false |
superfell/json2apex | https://github.com/superfell/json2apex/blob/e9299829bd9c48c923838683dec4ba8481fc58e2/integration-test/beatbox.py | integration-test/beatbox.py | """beatbox: Makes the salesforce.com SOAP API easily accessible."""
from __future__ import print_function
from beatbox_six import PY3, BytesIO, http_client, text_type, urlparse, xrange
import gzip
import datetime
import xmltramp
from xmltramp import islst
from xml.sax.saxutils import XMLGenerator
from xml.sax.saxutils... | python | MIT | e9299829bd9c48c923838683dec4ba8481fc58e2 | 2026-01-05T07:11:49.129177Z | false |
superfell/json2apex | https://github.com/superfell/json2apex/blob/e9299829bd9c48c923838683dec4ba8481fc58e2/integration-test/beatbox_six.py | integration-test/beatbox_six.py | """Simplified "six" package for Beatbox and Python >= 2.7 or >= 3.3"""
# It is in a setarate module because some checkers can report that
# something is not a valid code in Python 2 or 3 respectively.
import sys
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
from io import BytesIO
if PY3:
from bui... | python | MIT | e9299829bd9c48c923838683dec4ba8481fc58e2 | 2026-01-05T07:11:49.129177Z | false |
superfell/json2apex | https://github.com/superfell/json2apex/blob/e9299829bd9c48c923838683dec4ba8481fc58e2/integration-test/xmltramp.py | integration-test/xmltramp.py | """xmltramp: Make XML documents easily accessible."""
import re
from beatbox_six import python_2_unicode_compatible, StringIO, text_type, xrange
from xml.sax.handler import EntityResolver, DTDHandler, ContentHandler, ErrorHandler
from xml.sax import make_parser
from xml.sax.handler import feature_namespaces
__version... | python | MIT | e9299829bd9c48c923838683dec4ba8481fc58e2 | 2026-01-05T07:11:49.129177Z | false |
superfell/json2apex | https://github.com/superfell/json2apex/blob/e9299829bd9c48c923838683dec4ba8481fc58e2/integration-test/tests.py | integration-test/tests.py | # End to End test runner for JSON2Apex, it'll post test json payloads to a locally running
# instance of json2apex, and then validate that they compile file on salesforce
import sys
import beatbox
import xmltramp
import datetime
import zipfile
import os
import urllib
from beatbox_six import BytesIO, http_client
sf = ... | python | MIT | e9299829bd9c48c923838683dec4ba8481fc58e2 | 2026-01-05T07:11:49.129177Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/main.py | main.py | # Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
# Modified for DyTox by Arthur Douillard
import argparse
import copy
import datetime
import json
import os
import statistics
import time
import warnings
from pathlib import Path
import yaml
from continual.pod import _local_pod
import numpy as np
impo... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | true |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/convert_memory.py | convert_memory.py | """
Use this script in case you saved rehearsal memory on a computer A, but then want
to resume training, using those rehearsal samples, on a computer B.
Because for ImageNet we save the path, which may be different on each computer.
"""
import sys
import glob
import os
import shutil
import numpy as np
memory_path ... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/datasets.py | continual/datasets.py | # Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
import json
import os
import warnings
from continuum import ClassIncremental
from continuum.datasets import CIFAR100, ImageNet100, ImageFolderDataset
from timm.data import create_transform
from timm.data.constants import IMAGENET_DEFAULT_MEAN, IMAGENE... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/vit.py | continual/vit.py | """ Vision Transformer (ViT) in PyTorch
A PyTorch implement of Vision Transformers as described in
'An Image Is Worth 16 x 16 Words: Transformers for Image Recognition at Scale' - https://arxiv.org/abs/2010.11929
The official jax code is released and available at https://github.com/google-research/vision_transformer
... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/rehearsal.py | continual/rehearsal.py | import copy
import numpy as np
import torch
class Memory:
def __init__(self, memory_size, nb_total_classes, rehearsal, fixed=True, modes=1):
self.memory_size = memory_size
self.nb_total_classes = nb_total_classes
self.rehearsal = rehearsal
self.fixed = fixed
self.modes = m... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/pod.py | continual/pod.py | import torch
from torch.nn import functional as F
def pod_loss(feats, old_feats, scales=[1], normalize=True):
loss = 0.
assert len(feats) == len(old_feats)
for feat, old_feat in zip(feats, old_feats):
emb = _local_pod(feat, scales)
old_emb = _local_pod(old_feat, scales)
if norma... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/dytox.py | continual/dytox.py | import copy
import torch
from timm.models.layers import trunc_normal_
from torch import nn
from continual.cnn import resnet18
import continual.utils as cutils
from continual.convit import ClassAttention, Block
class ContinualClassifier(nn.Module):
"""Your good old classifier to do continual."""
def __init__... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/samplers.py | continual/samplers.py | # Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
import torch
import torch.distributed as dist
import math
import continual.utils as utils
class RASampler(torch.utils.data.Sampler):
"""Sampler that restricts data loading to a subset of the dataset for distributed,
with repeated augmentatio... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/utils.py | continual/utils.py | # Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
"""
Misc functions, including distributed helpers.
Mostly copy-paste from torchvision references.
"""
import io
import os
import time
from collections import defaultdict, deque
import datetime
import warnings
import torch
from torch import nn
import ... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/misc.py | continual/misc.py | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false | |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/losses.py | continual/losses.py | # Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
"""
Implements the knowledge distillation loss
"""
import torch
from torch import nn
from torch.nn import functional as F
class DistillationLoss(torch.nn.Module):
"""
This module wraps a standard criterion and adds an extra knowledge distilla... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/factory.py | continual/factory.py | import torch
from continual import convit, dytox, samplers, vit
from continual.cnn import (InceptionV3, resnet18, resnet34, resnet50,
resnext50_32x4d, seresnet18, vgg16, vgg16_bn,
wide_resnet50_2, resnet18_scs, resnet18_scs_max, resnet18_scs_avg, resnet_rebuffi)
... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/sam.py | continual/sam.py | import torch
class SAM:
"""SAM, ASAM, and Look-SAM
Modified version of: https://github.com/davda54/sam
Only Look-SAM has been added.
It speeds up SAM quite a lot but the alpha needs to be tuned to reach same performance.
"""
def __init__(self, base_optimizer, model_without_ddp, rho=0.05, ada... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/scaler.py | continual/scaler.py | import torch
from timm.utils import dispatch_clip_grad
class ContinualScaler:
state_dict_key = "amp_scaler"
def __init__(self, disable_amp):
self._scaler = torch.cuda.amp.GradScaler(enabled=not disable_amp)
def __call__(
self, loss, optimizer, model_without_ddp, clip_grad=None, clip_mod... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/__init__.py | continual/__init__.py | from continual import rehearsal
from continual import classifier
from continual import vit
from continual import convit
from continual import utils
from continual import scaler
from continual import cnn
from continual import factory
from continual import sam
from continual import samplers
from continual import mixup
fr... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/convit.py | continual/convit.py | # Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the CC-by-NC license found in the
# LICENSE file in the root directory of this source tree.
#
'''These modules are adapted from those of timm, see
https://github.com/rwightman/pytorch-image-models/blob/master/tim... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/mixup.py | continual/mixup.py | """ Mixup and Cutmix
Papers:
mixup: Beyond Empirical Risk Minimization (https://arxiv.org/abs/1710.09412)
CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features (https://arxiv.org/abs/1905.04899)
Code Reference:
CutMix: https://github.com/clovaai/CutMix-PyTorch
Hacked together by / Co... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/classifier.py | continual/classifier.py | import torch
from torch import nn
from torch.nn import functional as F
class Classifier(nn.Module):
def __init__(self, embed_dim, nb_total_classes, nb_base_classes, increment, nb_tasks, bias=True, complete=True, cosine=False, norm=True):
super().__init__()
self.embed_dim = embed_dim
self.... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/engine.py | continual/engine.py | # Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
"""
Train and eval functions used in main.py
"""
import json
import os
import math
from typing import Iterable, Optional
import torch
from timm.data import Mixup
from timm.utils import accuracy
from timm.loss import SoftTargetCrossEntropy
from torch.n... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/cnn/abstract.py | continual/cnn/abstract.py | from torch import nn
import continual.utils as cutils
class AbstractCNN(nn.Module):
def reset_classifier(self):
self.head.reset_parameters()
def get_internal_losses(self, clf_loss):
return {}
def end_finetuning(self):
pass
def begin_finetuning(self):
pass
def e... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/cnn/resnet_scs.py | continual/cnn/resnet_scs.py | #from .utils import load_state_dict_from_url
from typing import Any, Callable, List, Optional, Type, Union
import torch
import torch.nn as nn
from torch.nn import functional as F
from continual.cnn import AbstractCNN
from torch import Tensor
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/cnn/inception.py | continual/cnn/inception.py | """ inceptionv3 in pytorch
[1] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, Zbigniew Wojna
Rethinking the Inception Architecture for Computer Vision
https://arxiv.org/abs/1512.00567v3
"""
import torch
import torch.nn as nn
from continual.cnn import AbstractCNN
class BasicConv2d(n... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/cnn/vgg.py | continual/cnn/vgg.py | import torch
import torch.nn as nn
#from .utils import load_state_dict_from_url
from typing import Union, List, Dict, Any, cast
from continual.cnn import AbstractCNN
__all__ = [
'VGG', 'vgg11', 'vgg11_bn', 'vgg13', 'vgg13_bn', 'vgg16', 'vgg16_bn',
'vgg19_bn', 'vgg19',
]
model_urls = {
'vgg11': 'https://... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/cnn/resnet.py | continual/cnn/resnet.py | #from .utils import load_state_dict_from_url
from typing import Any, Callable, List, Optional, Type, Union
import torch
import torch.nn as nn
from torch.nn import functional as F
from continual.cnn import AbstractCNN
from torch import Tensor
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/cnn/resnet_rebuffi.py | continual/cnn/resnet_rebuffi.py | """Pytorch port of the resnet used for CIFAR100 by iCaRL.
https://github.com/srebuffi/iCaRL/blob/master/iCaRL-TheanoLasagne/utils_cifar100.py
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
from continual.cnn import AbstractCNN
class DownsampleStride(nn.Module):
... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/cnn/__init__.py | continual/cnn/__init__.py | from continual.cnn.abstract import AbstractCNN
from continual.cnn.inception import InceptionV3
from continual.cnn.senet import legacy_seresnet18 as seresnet18
from continual.cnn.resnet import (
resnet18, resnet34, resnet50, resnext50_32x4d, wide_resnet50_2
)
from continual.cnn.resnet_scs import resnet18_scs, resnet... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
arthurdouillard/dytox | https://github.com/arthurdouillard/dytox/blob/4da25c13ef34e827e5361f78dcda08811a413c74/continual/cnn/senet.py | continual/cnn/senet.py |
from continual.cnn import AbstractCNN
"""
SEResNet implementation from Cadene's pretrained models
https://github.com/Cadene/pretrained-models.pytorch/blob/master/pretrainedmodels/models/senet.py
Additional credit to https://github.com/creafz
Original model: https://github.com/hujie-frank/SENet
ResNet code gently b... | python | Apache-2.0 | 4da25c13ef34e827e5361f78dcda08811a413c74 | 2026-01-05T07:11:49.861100Z | false |
nlitsme/youtube_tool | https://github.com/nlitsme/youtube_tool/blob/234400e6d53b97381f35e1f43c8005be5b028fb0/setup.py | setup.py | from setuptools import setup
setup(
name = "youtube_tool",
version = "1.0.11",
entry_points = {
'console_scripts': ['yttool=yttool:main'],
},
py_modules=['yttool'],
author = "Willem Hengeveld",
author_email = "itsme@xs4all.nl",
description = "Extract information from youtube vide... | python | MIT | 234400e6d53b97381f35e1f43c8005be5b028fb0 | 2026-01-05T07:11:51.002577Z | false |
nlitsme/youtube_tool | https://github.com/nlitsme/youtube_tool/blob/234400e6d53b97381f35e1f43c8005be5b028fb0/yttool.py | yttool.py | #!/usr/bin/env python3
"""
A tool for extracting useful information from youtube video's, like comments, or subtitles.
Author: Willem Hengeveld <itsme@xs4all.nl>
"""
import urllib.request
import urllib.parse
import http.cookiejar
import re
import json
import sys
import html
import datetime
from collections import de... | python | MIT | 234400e6d53b97381f35e1f43c8005be5b028fb0 | 2026-01-05T07:11:51.002577Z | true |
nlitsme/youtube_tool | https://github.com/nlitsme/youtube_tool/blob/234400e6d53b97381f35e1f43c8005be5b028fb0/ytdump.py | ytdump.py | """
A tool for investigating youtube json dictionaries.
This tries to pretty print the rather complex json dictionaries youtube uses.
You can pass the json either through stdin, pass it as a string on the commandline,
or as a filename on the commandline.
Author: Willem Hengeveld <itsme@xs4all.nl>
"""
import json
imp... | python | MIT | 234400e6d53b97381f35e1f43c8005be5b028fb0 | 2026-01-05T07:11:51.002577Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/example_plugins/__init__.py | example_plugins/__init__.py | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false | |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/example_plugins/src/register_plugins.py | example_plugins/src/register_plugins.py | from typing import Any, Sequence, Type
from osprey.engine.udf.base import UDFBase
from osprey.worker.adaptor.plugin_manager import hookimpl_osprey
from osprey.worker.lib.config import Config
from osprey.worker.lib.storage.labels import LabelsServiceBase
from osprey.worker.sinks.sink.output_sink import BaseOutputSink, ... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/example_plugins/src/services/labels_service.py | example_plugins/src/services/labels_service.py | from contextlib import contextmanager
from typing import Any, Generator
from osprey.engine.language_types.entities import EntityT
from osprey.worker.lib.osprey_shared.labels import EntityLabels
from osprey.worker.lib.osprey_shared.logging import get_logger
from osprey.worker.lib.storage.labels import LabelsServiceBase... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/example_plugins/src/udfs/ban_user.py | example_plugins/src/udfs/ban_user.py | from dataclasses import dataclass
from typing import List, Self, cast
from osprey.engine.executor.custom_extracted_features import CustomExtractedFeature
from osprey.engine.executor.execution_context import ExecutionContext
from osprey.engine.language_types.effects import EffectBase, EffectToCustomExtractedFeatureBase... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/example_plugins/src/udfs/text_contains.py | example_plugins/src/udfs/text_contains.py | import re
from osprey.engine.executor.execution_context import ExecutionContext
from osprey.engine.udf.arguments import ArgumentsBase
from osprey.engine.udf.base import UDFBase
class TextContainsArguments(ArgumentsBase):
text: str
phrase: str
case_sensitive = False
class TextContains(UDFBase[TextContai... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/conftest.py | osprey_worker/src/osprey/worker/conftest.py | from typing import Any, Generator
import pytest
from osprey.worker.lib.config import Config
from osprey.worker.lib.singletons import CONFIG
# Make Config.configure idempotent for the duration of the test session.
# This prevents "already been bound" errors when multiple fixtures or helpers
# call configure_from_env(... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/__init__.py | osprey_worker/src/osprey/worker/__init__.py | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false | |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/adaptor/constants.py | osprey_worker/src/osprey/worker/adaptor/constants.py | OSPREY_ADAPTOR = 'osprey_plugin'
| python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/adaptor/__init__.py | osprey_worker/src/osprey/worker/adaptor/__init__.py | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false | |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/adaptor/plugin_manager.py | osprey_worker/src/osprey/worker/adaptor/plugin_manager.py | from __future__ import annotations
from functools import lru_cache
from typing import TYPE_CHECKING, Any, List, Type, TypeVar
import pluggy
from osprey.engine.ast_validator import ValidatorRegistry
from osprey.engine.executor.execution_context import Action
from osprey.engine.executor.udf_execution_helpers import Has... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/adaptor/hookspecs/__init__.py | osprey_worker/src/osprey/worker/adaptor/hookspecs/__init__.py | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false | |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/adaptor/hookspecs/osprey_hooks.py | osprey_worker/src/osprey/worker/adaptor/hookspecs/osprey_hooks.py | from __future__ import annotations
from typing import TYPE_CHECKING, Any, Sequence, Type
import pluggy
from osprey.engine.ast_validator.base_validator import BaseValidator
from osprey.engine.executor.execution_context import Action
from osprey.engine.udf.base import UDFBase
from osprey.worker.adaptor.constants import... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/_stdlibplugin/sink_register.py | osprey_worker/src/osprey/worker/_stdlibplugin/sink_register.py | from typing import List, Sequence
from kafka import KafkaProducer
from osprey.worker.adaptor.plugin_manager import bootstrap_execution_result_store, hookimpl_osprey
from osprey.worker.lib.config import Config
from osprey.worker.sinks.sink.kafka_output_sink import KafkaOutputSink
from osprey.worker.sinks.sink.output_si... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/_stdlibplugin/validator_regsiter.py | osprey_worker/src/osprey/worker/_stdlibplugin/validator_regsiter.py | from typing import Sequence, Type
from osprey.engine.ast_validator.base_validator import BaseValidator
from osprey.engine.ast_validator.validators.feature_name_to_entity_type_mapping import FeatureNameToEntityTypeMapping
from osprey.engine.ast_validator.validators.imports_must_not_have_cycles import ImportsMustNotHave... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/_stdlibplugin/udf_register.py | osprey_worker/src/osprey/worker/_stdlibplugin/udf_register.py | from typing import Any, Sequence, Type
from osprey.engine.stdlib.udfs.domain_chopper import DomainChopper
from osprey.engine.stdlib.udfs.domain_tld import DomainTld
from osprey.engine.stdlib.udfs.email_domain import EmailDomain, EmailSubdomain
from osprey.engine.stdlib.udfs.email_local_part import EmailLocalPart
from ... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/_stdlibplugin/storage_register.py | osprey_worker/src/osprey/worker/_stdlibplugin/storage_register.py | from typing import Optional
from osprey.worker.adaptor.plugin_manager import hookimpl_osprey
from osprey.worker.lib.config import Config
from osprey.worker.lib.storage.stored_execution_result import ExecutionResultStore, StoredExecutionResultMinIO
@hookimpl_osprey(trylast=True)
def register_execution_result_store(co... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/_stdlibplugin/__init__.py | osprey_worker/src/osprey/worker/_stdlibplugin/__init__.py | # Imports needed to work with the plugin system - if you modify this make sure to also modify the pyproject.toml file
from osprey.worker._stdlibplugin.sink_register import register_output_sinks
from osprey.worker._stdlibplugin.storage_register import register_execution_result_store
from osprey.worker._stdlibplugin.udf_... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/__init__.py | osprey_worker/src/osprey/worker/ui_api/__init__.py | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false | |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/cli.py | osprey_worker/src/osprey/worker/ui_api/osprey/cli.py | # ruff: noqa: E402
from osprey.worker.lib.patcher import patch_all # isort: skip
patch_all() # please ensure this occurs before *any* other imports !
import os # noqa: E402
from datetime import datetime, timedelta
from typing import Dict, Optional, TextIO
import click # noqa: E402
import simplejson as json
from ... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/conftest.py | osprey_worker/src/osprey/worker/ui_api/osprey/conftest.py | # ruff: noqa: E402
from os.path import abspath, dirname
from sys import path
project_root = dirname(dirname(dirname(abspath(__file__))))
path.append(project_root)
from osprey.worker.lib.patcher import patch_all # isort: skip
patch_all(patch_gevent=False, patch_ddtrace=False)
import os
import textwrap
from typing i... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/__init__.py | osprey_worker/src/osprey/worker/ui_api/osprey/__init__.py | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false | |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/singletons.py | osprey_worker/src/osprey/worker/ui_api/osprey/singletons.py | from osprey.worker.lib.publisher import PubSubPublisher
from osprey.worker.lib.singleton import Singleton
from osprey.worker.lib.singletons import CONFIG
from .lib.druid_client_holder import DruidClientHolder
DRUID: Singleton[DruidClientHolder] = Singleton(DruidClientHolder)
def _init_analytics_publisher() -> PubSu... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/app.py | osprey_worker/src/osprey/worker/ui_api/osprey/app.py | # ruff: noqa: E402
from __future__ import absolute_import
import ddtrace
from osprey.worker.lib.singletons import ENGINE
from osprey.worker.lib.storage.bulk_action_files import get_bulk_action_file_manager
from werkzeug.exceptions import HTTPException
ddtrace.patch_all(gevent=True)
from http import HTTPStatus
from t... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/validators/entities.py | osprey_worker/src/osprey/worker/ui_api/osprey/validators/entities.py | from datetime import datetime
from typing import List, Optional, Type
from flask import Request
from osprey.engine.language_types.entities import EntityT
from osprey.worker.lib.osprey_shared.labels import LabelStatus
from osprey.worker.ui_api.osprey.lib.druid import TimeseriesDruidQuery
from osprey.worker.ui_api.ospre... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/validators/events.py | osprey_worker/src/osprey/worker/ui_api/osprey/validators/events.py | from datetime import datetime
from typing import List, Optional
from osprey.worker.ui_api.osprey.lib.druid import TopNDruidQuery
class BulkLabelTopNRequest(TopNDruidQuery):
excluded_entities: List[str] = []
expected_entities: int
no_limit: bool
label_name: str
label_status: str
label_reason: ... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/validators/__init__.py | osprey_worker/src/osprey/worker/ui_api/osprey/validators/__init__.py | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false | |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/saved_queries.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/saved_queries.py | from http.client import BAD_REQUEST, NO_CONTENT
from typing import Any
from flask import Blueprint, Response, abort, jsonify, request
from osprey.worker.lib.storage.queries import Query, SavedQuery, SortOrder
from osprey.worker.ui_api.osprey.lib.abilities import (
CanCreateAndEditSavedQueries,
CanViewSavedQuer... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/entities.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/entities.py | from typing import Any
from flask import Blueprint, abort, jsonify
from osprey.worker.lib.osprey_shared.labels import EntityLabelMutation, EntityLabelMutationsResult
from osprey.worker.lib.singletons import LABELS_PROVIDER
from osprey.worker.ui_api.osprey.lib.abilities import (
CanMutateEntities,
CanMutateLabe... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/bulk_actions.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/bulk_actions.py | from typing import Any
from flask import Blueprint, abort, jsonify
from osprey.worker.lib.storage.bulk_action_task import BulkActionJob
from osprey.worker.ui_api.osprey.lib.abilities import CanBulkAction, require_ability
from osprey.worker.ui_api.osprey.lib.decorators import require_multipart_form_data
from osprey.wor... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/events.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/events.py | import csv
import logging
import tempfile
from http.client import NOT_FOUND
from typing import Any, Dict, List, Optional, Set
from flask import Blueprint, Response, abort, jsonify
from osprey.worker.lib.storage.stored_execution_result import (
bootstrap_execution_result_storage_service,
)
from osprey.worker.ui_api... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/abilities.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/abilities.py | from typing import Any, Mapping
from flask import Blueprint, abort, redirect
from osprey.worker.lib.storage.temporary_ability_token import ConsumptionResult, TemporaryAbilityToken
from osprey.worker.ui_api.osprey.lib.abilities import Ability
from osprey.worker.ui_api.osprey.lib.auth import get_current_user, get_curren... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/config.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/config.py | from typing import Any, Dict, List, Set
import typing_inspect
from flask import Blueprint
from osprey.engine.stdlib.configs.labels_config import LabelInfo, LabelsConfig
from osprey.engine.udf.type_helpers import to_display_str
from osprey.worker.lib.osprey_engine import FeatureLocation, OspreyEngine
from osprey.worker... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/rules_visualizer.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/rules_visualizer.py | from datetime import datetime
from typing import Any, List
from flask import Blueprint, jsonify
from osprey.engine.executor.execution_visualizer import RenderedDigraph, render_graph
from osprey.worker.lib.singletons import ENGINE
from osprey.worker.sinks.sink.output_sink_utils.models import OspreyRulesVisualizerGenGra... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/__init__.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/__init__.py | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false | |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/queries.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/queries.py | from http.client import BAD_REQUEST
from typing import Any, Optional
from flask import Blueprint, Response, abort, jsonify, request
from osprey.engine.ast_validator.validation_context import ValidationFailed
from osprey.worker.lib.storage.queries import Query, SortOrder
from ..lib.auth import get_current_user_email
f... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/docs.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/docs.py | from collections import defaultdict
from typing import Any, List, Optional, Sequence
from flask import Blueprint
from osprey.engine.udf.base import MethodSpec
from osprey.worker.adaptor.plugin_manager import bootstrap_ast_validators, bootstrap_udfs
from osprey.worker.lib.osprey_engine import FeatureLocation
from ospre... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/bulk_history.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/bulk_history.py | from http.client import NOT_FOUND
from typing import Any
from flask import Blueprint, Response, abort, jsonify
from osprey.worker.lib.storage.bulk_label_task import BulkLabelTask
from osprey.worker.ui_api.osprey.lib.abilities import CanBulkLabel, require_ability
blueprint = Blueprint('bulk_history', __name__)
DEFAUL... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_entities.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_entities.py | import json
from unittest import mock
import pytest
from flask import Flask, Response, url_for
from flask.testing import FlaskClient
from osprey.worker.lib.osprey_shared.labels import LabelStatus
from osprey.worker.lib.singleton import Singleton
from osprey.worker.lib.singletons import LABELS_PROVIDER
from osprey.work... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_config.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_config.py | import json
import pytest
from flask import Response, url_for
from flask.testing import FlaskClient
_rules_source = """
UserId = Entity(type='User', id=1)
GuildId = Entity(type='Guild', id=1)
"""
_ui_config_raw = {
'external_links': {
'User': 'https://test.example.com/users/{entity_id}',
'Guild':... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_abilities.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_abilities.py | from flask import Flask, Response, url_for
from flask.testing import FlaskClient
from osprey.worker.lib.storage.temporary_ability_token import TemporaryAbilityToken
from osprey.worker.ui_api.osprey.lib.abilities import CanViewLabelsForEntity
def test_create_and_consume_temporary_ability_tokens(app: Flask, client: 'Fl... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_saved_queries.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_saved_queries.py | # import json
# from http.client import NO_CONTENT, OK
# from random import choice
# from typing import Any, Mapping, Optional
# import pytest
# from faker import Faker
# from flask import Flask, Response, url_for
# from flask.testing import FlaskClient
# from osprey.worker.lib.storage.queries import Query, SavedQuer... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_queries.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_queries.py | import json
from faker import Faker
from flask import Flask, Response, url_for
from flask.testing import FlaskClient
from osprey.worker.lib.snowflake import Snowflake
fake = Faker()
def test_create_query_record(app: Flask, client: 'FlaskClient[Response]') -> None:
start = fake.past_datetime().isoformat()
en... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/__init__.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/__init__.py | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false | |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_bulk_history.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_bulk_history.py | import json
from datetime import datetime
from unittest.mock import Mock, patch
import pytest
from flask import Flask, Response, url_for
from flask.testing import FlaskClient
from osprey.worker.lib.osprey_shared.labels import LabelStatus
from osprey.worker.lib.storage.bulk_label_task import BulkLabelTask
config_a = {... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_bulk_actions.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_bulk_actions.py | import json
import pytest
from flask import Flask, Response, url_for
from flask.testing import FlaskClient
config_a = {
'main.sml': '',
'config.yaml': json.dumps({'acl': {'users': {'local-dev@localhost': {'abilities': []}}}}),
}
config_b = {
'main.sml': '',
'config.yaml': json.dumps(
{'acl': ... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_events.py | osprey_worker/src/osprey/worker/ui_api/osprey/views/tests/test_events.py | import json
from datetime import datetime
from operator import itemgetter
from typing import Any, Dict, Mapping
from unittest import mock
import pytest
from flask import Flask, Response, url_for
from flask.testing import FlaskClient
from osprey.worker.ui_api.osprey.lib.druid import (
BaseDruidQuery,
PaginatedS... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/lib/druid.py | osprey_worker/src/osprey/worker/ui_api/osprey/lib/druid.py | import base64
import json
import logging
import math
from datetime import datetime, timedelta, timezone
from enum import Enum
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence, Union
from osprey.engine.query_language import parse_query_to_validated_ast
from osprey.engine.query_language.ast_druid_tr... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/lib/users.py | osprey_worker/src/osprey/worker/ui_api/osprey/lib/users.py | from __future__ import annotations
from collections import defaultdict
from typing import Any, Dict, List, Mapping, Optional, Type
from osprey.worker.lib.singletons import ENGINE
from osprey.worker.lib.sources_config.subkeys.acl_config import AclConfig
from osprey.worker.ui_api.osprey.lib.abilities import Ability, Ab... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/lib/druid_client_holder.py | osprey_worker/src/osprey/worker/ui_api/osprey/lib/druid_client_holder.py | from typing import Optional
from osprey.worker.lib.config import Config
from osprey.worker.lib.singletons import CONFIG
from pydruid.client import PyDruid
class DruidClientHolder:
def __init__(self) -> None:
self._client: Optional[PyDruid] = None
self._datasource: Optional[str] = None
CON... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/lib/audit.py | osprey_worker/src/osprey/worker/ui_api/osprey/lib/audit.py | import json
from flask import Response, request
from osprey.worker.lib.snowflake import generate_snowflake
from osprey.worker.lib.storage.access_audit_log import AccessAuditLog
from werkzeug.datastructures import Headers
# To handle case insensitivity, ensure these are normalized to lower case.
_AUDIT_HEADERS_DISALLO... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/lib/decorators.py | osprey_worker/src/osprey/worker/ui_api/osprey/lib/decorators.py | import functools
from flask import abort, request
def require_multipart_form_data(func):
"""
Decorator that validates the request has multipart/form-data content type.
This decorator ensures that POST, PUT, and PATCH requests use the correct
content type for file uploads. Returns HTTP 400 if the con... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/lib/abilities.py | osprey_worker/src/osprey/worker/ui_api/osprey/lib/abilities.py | from __future__ import annotations
from abc import ABC, abstractmethod
from dataclasses import asdict
from functools import wraps
from typing import TYPE_CHECKING, Any, Callable, ClassVar, Dict, Generic, Optional, Set, Type, TypeVar, Union
from flask import abort
from osprey.worker.ui_api.osprey.lib.druid import Base... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/lib/__init__.py | osprey_worker/src/osprey/worker/ui_api/osprey/lib/__init__.py | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false | |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/lib/marshal.py | osprey_worker/src/osprey/worker/ui_api/osprey/lib/marshal.py | from abc import ABC
from functools import wraps
from http import HTTPStatus
from typing import Any, Callable, Type, TypeVar
from flask import Request, abort, jsonify, request
from pydantic import ValidationError
from sentry_sdk import capture_exception
from typing_extensions import Protocol
T = TypeVar('T', bound='Ma... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
roostorg/osprey | https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/worker/ui_api/osprey/lib/auth.py | osprey_worker/src/osprey/worker/ui_api/osprey/lib/auth.py | from __future__ import annotations
from typing import Dict
from flask import Flask, request
from osprey.worker.lib.osprey_shared.logging import get_logger
from osprey.worker.ui_api.osprey.lib.users import User
logger = get_logger(__name__)
def set_dummy_claim() -> None:
set_claims({'email': request.headers.get... | python | Apache-2.0 | 5c1f999c156b420043be7efdd472c8e31096bfb5 | 2026-01-05T07:11:51.519046Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.