text stringlengths 185 73.3k | repo stringlengths 7 100 | path stringlengths 4 146 | language stringclasses 7
values | hash stringlengths 16 16 | score float64 7 8.5 | stars int64 0 237k |
|---|---|---|---|---|---|---|
# Copyright (c) 2026 Centre National d'Etudes Spatiales (CNES).
#
# This file is part of PANDORA_MCCNN
#
# https://github.com/CNES/Pandora_MCCNN
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | CNES/Pandora_MCCNN | tests/performance_tests/test_cost_volume.py | .py | ac87df795205f1c4 | 7.12 | 16 |
# Copyright (c) 2026 Centre National d'Etudes Spatiales (CNES).
#
# This file is part of PANDORA_MCCNN
#
# https://github.com/CNES/Pandora_MCCNN
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | CNES/Pandora_MCCNN | tests/performance_tests/test_dataset_generator.py | .py | 82cc3ec7fdaab385 | 7.12 | 16 |
# Copyright (c) 2026 Centre National d'Etudes Spatiales (CNES).
#
# This file is part of PANDORA_MCCNN
#
# https://github.com/CNES/Pandora_MCCNN
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | CNES/Pandora_MCCNN | tests/performance_tests/test_inference_engine.py | .py | 48335f66edfd0a25 | 8.12 | 16 |
# Copyright (c) 2026 Centre National d'Etudes Spatiales (CNES).
#
# This file is part of PANDORA_MCCNN
#
# https://github.com/CNES/Pandora_MCCNN
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | CNES/Pandora_MCCNN | tests/test_memory_sampler.py | .py | 849cceae0910da64 | 7.12 | 16 |
#!/usr/bin/env python3
"""Shared helpers for deterministic Karmada Agent Skills scenarios."""
import json
from pathlib import Path
def load_scenario(path: str) -> dict:
data = json.loads(Path(path).read_text(encoding="utf-8"))
if not isinstance(data, dict) or not isinstance(data.get("id"), str):
rais... | karmada-io/community | skills/evals/scripts/lib/scenario.py | .py | 5a374504dc1c61d0 | 7.12 | 16 |
#!/usr/bin/env python3
"""Find the first unsupported propagation stage from supplied evidence."""
import argparse
from lib.scenario import emit, load_scenario
STAGES = ("policyClaim", "binding", "scheduling", "work", "execution", "status")
def evaluate(data: dict) -> dict:
evidence = data.get("evidence", {})
... | karmada-io/community | skills/evals/scripts/run_propagation_scenario.py | .py | 6e132e997cf2b95d | 7.62 | 16 |
"""Platform compatibility."""
# pylint: skip-file
from typing import Tuple, cast
import platform
import re
import struct
import sys
# Jython does not have this attribute
try:
from socket import SOL_TCP
except ImportError: # pragma: no cover
from socket import IPPROTO_TCP as SOL_TCP # noqa
RE_NUM = re.com... | Azure/azure-iot-hub-python | src/azure/iot/hub/_pyamqp/_platform.py | .py | e8acbadb871b7c7b | 7.64 | 18 |
from sqlalchemy_iris import LONGVARCHAR, LONGVARBINARY, BIT, TINYINT, DOUBLE
from sqlalchemy_iris.types import (
IRISBoolean, IRISDate, IRISDateTime, IRISTime, IRISTimeStamp,
IRISListBuild, IRISVector
)
# Import IRISUniqueIdentifier only if using SQLAlchemy 2.x
try:
from sqlalchemy_iris.types import IRISUn... | caretdev/sqlalchemy-iris | tests/test_alembic.py | .py | 788857daafaba900 | 7.09 | 14 |
"""holoscrape main entry point.
Polls configured indexers for live streams and dispatches scrapers for
each new stream. Supports two backends:
- tmux (default): each scraper runs in its own tmux pane
- subprocess (--no-tmux): each scraper runs as a child process
Usage:
python main.py # tmux mode ... | dannylty/holoscrape | main.py | .py | dc68689870833964 | 7.5 | 9 |
"""Configuration loading and validation for holoscrape.
Reads a JSON config file (path resolved from $HOLOSCRAPE_CONFIG, CWD, or
project root) and supplements with environment variables. All optional
fields have sensible defaults so a minimal config still works.
"""
import json
import logging
import os
from dataclass... | dannylty/holoscrape | modules/config.py | .py | a63bd325c67206e4 | 7.5 | 9 |
"""Abstract base class for stream indexers.
An indexer is responsible for discovering currently-live streams and
returning their metadata as a list of dicts.
"""
from abc import ABC, abstractmethod
from typing import Any
from ..config import ConfigHandler
class Indexer(ABC):
"""Base class for all stream indexe... | dannylty/holoscrape | modules/indexer/base.py | .py | 5caa33f797af8f96 | 7.5 | 9 |
"""Holodex API indexer.
Queries the Holodex v2 API for live streams, optionally filtering by
organisation and channel name substring. Replaces the previous separate
HolodexIndexer and NijisanjiIndexer classes.
"""
import logging
from typing import Any
import requests
from ..config import ConfigHandler, IndexerConfi... | dannylty/holoscrape | modules/indexer/holodex.py | .py | 0687dc735dd23d21 | 7.5 | 9 |
"""Logging for holoscrape.
Creates per-video log files with rotation support. Each logger gets its own
dedicated handler (no reliance on `logging.basicConfig` which only configures
the root logger once per process).
Supports plain-text and JSON output formats.
"""
import json
import logging
import os
from logging.ha... | dannylty/holoscrape | modules/logger/base.py | .py | fe34002410a2fbcb | 7.5 | 9 |
"""Abstract base class for stream/chat writers.
A writer receives either individual chat messages (`process`) or stream
metadata (`process_stream`) and persists them to some backend.
"""
import logging
from abc import ABC, abstractmethod
from typing import Any, Optional
from ..config import ConfigHandler
from ..logg... | dannylty/holoscrape | modules/writer/base.py | .py | aa7680d1b755e76a | 7.5 | 9 |
"""MySQL database writer.
Buffers chat messages and flushes them in batches to a sharded MySQL table.
The shard is determined by a hash of the video ID.
"""
import hashlib
import logging
from random import randint
from socket import gethostname
from typing import Any, Optional
import mysql.connector
from ..config i... | dannylty/holoscrape | modules/writer/database.py | .py | 33f7fd3d13797ff1 | 7.5 | 9 |
"""Filesystem writer.
Writes chat messages to plain-text files (one per video) and stream
metadata to JSON files. Files are flushed periodically to balance
throughput against data loss on crash.
"""
import json
import logging
import os
from typing import Any, Optional
from ..config import ConfigHandler
from .base im... | dannylty/holoscrape | modules/writer/filesystem.py | .py | e0a30b0e10142757 | 7.5 | 9 |
#!/usr/bin/env python3
"""Generate init.sql for holoscrape's sharded MySQL schema.
Usage:
python resources/generate_init_sql.py [--nshards 30] [--table chat_tab] [--stream-table stream_tab]
"""
import argparse
import sys
TEMPLATE = """\
-- holoscrape database schema
-- Generated by generate_init_sql.py
-- Shards... | dannylty/holoscrape | resources/generate_init_sql.py | .py | cb23d116f67a9eac | 7.5 | 9 |
"""Live YouTube chat scraper.
Connects to a live YouTube stream via pytchat and dispatches each chat
message to the configured writers. Handles reconnection with exponential
backoff, and stops cleanly when the stream ends or is set to replay.
"""
import logging
import signal
import sys
import time
from typing import ... | dannylty/holoscrape | scrape.py | .py | a7758e2ecff96c55 | 7.5 | 9 |
"""Tests for the logging module.
Verifies that:
- INFO messages actually appear in the log file (regression test for the
old basicConfig bug).
- Different video_ids get separate log files.
- Log directory is created if missing.
- JSON format works.
"""
import json
import logging
import os
import pytest
import mod... | dannylty/holoscrape | tests/test_logger.py | .py | 72867365cd27b64f | 8 | 9 |
"""Tests for the Scraper class (pytchat mocked)."""
import time
from types import SimpleNamespace
from unittest.mock import MagicMock, patch
import pytest
import modules.logger.base as logger_mod
from modules.config import ConfigHandler
from scrape import Scraper
class _FakeConfig:
def __init__(self, log_path:... | dannylty/holoscrape | tests/test_scraper.py | .py | 226212b76f7ff13b | 8 | 9 |
"""Tests for the FilesystemWriter."""
import json
import os
from types import SimpleNamespace
from unittest.mock import MagicMock
import pytest
import modules.logger.base as logger_mod
from modules.config import ConfigHandler
from modules.writer.filesystem import FilesystemWriter
class _FakeConfig:
def __init_... | dannylty/holoscrape | tests/test_writer_fs.py | .py | 7b7ea78c7676b03f | 8 | 9 |
"""Custom attributes utilities."""
from collections import OrderedDict
from collections.abc import Callable, Iterable
from typing import cast, overload, TypeVar, Any
from .types import MagentoEntity, CustomAttributeDict, Product, Customer, Category
T = TypeVar('T')
Item = TypeVar('Item', bound=Category | Customer | ... | Bixoto/PyMagento | magento/attributes.py | .py | 680c9b4f44dab746 | 7.57 | 13 |
from collections.abc import Callable, Iterable, Iterator
from typing import TypeVar, Generic, Any
from api_session import JSONDict
from typing_extensions import Self
from .client import Magento
from .queries import make_field_value_query
from .types import MagentoEntity, Product
BATCH_SIZE = 500
class BatchSaver:
... | Bixoto/PyMagento | magento/batches.py | .py | 6d1d4be86b1dcf8e | 7.57 | 13 |
from datetime import datetime
DATE_ISO_8601_FORMAT = "%Y-%m-%d %H:%M:%S"
def format_datetime(dt: datetime) -> str:
"""Format a datetime for Magento."""
# "2021-07-02 13:19:18.300700" -> "2021-07-02 13:19:18"
return dt.isoformat(sep=" ").split(".", 1)[0]
def parse_datetime(s: str) -> datetime:
"""Pa... | Bixoto/PyMagento | magento/dates.py | .py | 783dedeac1e3dd71 | 7.07 | 13 |
import re
import requests
RE_PARAM = re.compile(r"%([A-Za-z0-9]+)")
__all__ = ('build_exception_text', 'MagentoException', 'MagentoAssertionError')
def build_exception_text(message: str, parameters: dict[str, str] | list[str] | None) -> str:
"""Build the text of an exception given a response payload from Magen... | Bixoto/PyMagento | magento/exceptions.py | .py | a3e4c79cf2c1ad47 | 7.57 | 13 |
from magento.types import Order, Address
__all__ = (
'is_order_on_hold',
'is_order_cash_on_delivery',
'get_order_shipping_address',
)
def is_order_on_hold(order: Order) -> bool:
"""Test if an order is on hold."""
return order["status"] == "holded" or "hold_before_state" in order
def is_order_ca... | Bixoto/PyMagento | magento/order_helpers.py | .py | 584ae194c9f4f481 | 7.57 | 13 |
from collections.abc import Sequence
from typing import Any
__all__ = (
'Query', 'make_search_query', 'make_field_value_query',
)
Query = dict[str, Any] | None
def make_search_query(filter_groups: Sequence[Sequence[tuple[str, Any, str | None]]],
*,
sort_orders: Sequen... | Bixoto/PyMagento | magento/queries.py | .py | 99794cc140ff5238 | 7.57 | 13 |
import sys
from typing import TypedDict, Literal, Any
from api_session import JSONDict
if sys.version_info >= (3, 11):
from typing import NotRequired
else:
# noinspection PyUnreachableCode
from typing_extensions import NotRequired
__all__ = (
'Attribute',
'AttributeSet',
'AttributeStoreLabel'... | Bixoto/PyMagento | magento/types.py | .py | 177a815fb5f94204 | 7.57 | 13 |
import os
import shutil
import base64
import re
import warnings
from unittest import TestCase
from copy import deepcopy
from tempfile import NamedTemporaryFile
import pytest
from testbook import testbook
from matplotlib.testing.compare import compare_images
dir = "examples"
if not os.path.exists(dir):
dir = os.pa... | xsuite/xplt | tests/test_examples.py | .py | 1616d576966a28b5 | 8.1 | 15 |
from numpy.testing import assert_equal
from packaging.version import Version
import xtrack as xt
import xplt.line
def test_nominal_and_effective_order():
def assert_order(*test_params):
"""Check elements for nominal and effective order
Args:
*test_params: tuples with (element, nomina... | xsuite/xplt | tests/test_line.py | .py | 2c15610b9f0ddfda | 8.1 | 15 |
import pytest
import pytest_benchmark
import pytest_benchmark.plugin
from pytest_benchmark.utils import NameWrapper
from pytest_benchmark.fixture import BenchmarkFixture
import numpy as np
from numpy.testing import assert_equal
import xplt.util
@pytest.fixture(scope="function")
def benchmark_ref(request):
# See h... | xsuite/xplt | tests/test_utils.py | .py | 347f389ae9a211fd | 7.1 | 15 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Philipp Niedermayer"
__contact__ = "eltos@outlook.de"
__version__ = "0.12.6"
# expose the following in global namespace
from .colors import *
from .line import *
from .particles import *
from .phasespace import *
from .properties import *
from .timestruc... | xsuite/xplt | xplt/__init__.py | .py | d595b36d467b9e60 | 7.6 | 15 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Matplotlib setup"""
__author__ = "Philipp Niedermayer"
__contact__ = "eltos@outlook.de"
__date__ = "2022-09-06"
import types
import warnings
from .colors import (
cmap_petroff,
cmap_petroff_gradient,
cmap_petroff_bipolar,
cmap_petroff_cyclic,
petr... | xsuite/xplt | xplt/hooks.py | .py | 696b3effdea65061 | 7.6 | 15 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Methods for plotting twiss"""
__author__ = "Philipp Niedermayer"
__contact__ = "eltos@outlook.de"
__date__ = "2022-11-08"
from matplotlib.lines import Line2D
from .util import *
from .base import XManifoldPlot
from .line import KnlPlot
from .properties import Proper... | xsuite/xplt | xplt/twiss.py | .py | 36a54a3e65fdbb46 | 7.6 | 15 |
from collections import defaultdict
from typing import Dict, Set, Optional, List, Any
from dtcli.api import DynatraceAPIClient
class State:
def __init__(self, d):
self.d = d
def __getitem__(self, key):
return self.d[key]
def __contains__(self, key):
return key in self.d
def... | dynatrace-oss/dt-ext-cli | dtcli/delete_extension.py | .py | 7db3336a7ac0566c | 7.63 | 17 |
from pathlib import Path
import typer
# TODO: turn completion to True when implementing completion and somehow merge it with click
app = typer.Typer(hidden=True, add_completion=False)
@app.callback()
def utility_callback():
"""
Former internal scripts outsourced for the greater good.
"""
pass
@app... | dynatrace-oss/dt-ext-cli | dtcli/scripts/utility.py | .py | 2ef1534cbf93799b | 7.63 | 17 |
# Copyright 2021 Dynatrace LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | dynatrace-oss/dt-ext-cli | dtcli/utils.py | .py | d92970bd71a0c441 | 7.63 | 17 |
# Copyright 2021 Dynatrace LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, s... | dynatrace-oss/dt-ext-cli | tests/test_utils.py | .py | 02640d294ee60419 | 7.13 | 17 |
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 6 10:34:45 2023
@author: Alex
"""
import pandas
from orca_parser.ORCAParse import *
class HessianTools(ORCAParse):
def parseHess(self):
for section in self.raw.split("$")[1:]:
section = section.split("\n")
self.content[section[0]] = ... | avanteijlingen/orca_parser | orca_parser/HessianTools.py | .py | 2a3a331f3db19217 | 7.52 | 10 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import ase
from . import ORCAParse
from .ORCAParse import tricky_readin
class NWChemParse(ORCAParse):
def ValidateOutput(self):
"""Validate the NWChem output file."""
self.valid = True
self.clean_stop = False
if "To... | avanteijlingen/orca_parser | orca_parser/NWChemParse.py | .py | 9fe7f330f3b88a5f | 7.52 | 10 |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 14 17:11:35 2024
@author: Alex
"""
from . import ORCAParse
import numpy as np
#### Module for reading Amsterdam Modeling Suite outputs
class ams_parse(ORCAParse):
def ValidateOutput(self):
self.valid = False
if "NORMAL TERMINATION" in self.raw:
... | avanteijlingen/orca_parser | orca_parser/ams_parse.py | .py | f6029f601862b557 | 7.52 | 10 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 14 16:55:00 2024
@author: bwb16179
"""
from . import ORCAParse
import numpy as np
class parse_scan(ORCAParse):
def __init__(self, fname, verbose = False):
super().__init__(fname=fname, verbose=verbose)
def parse_... | avanteijlingen/orca_parser | orca_parser/parse_scan.py | .py | 49791e0ff68ee476 | 7.52 | 10 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/config.py | .py | a9d73a6c42a29590 | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/constraints.py | .py | f971922ffce82139 | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/events_emitter.py | .py | a0f4958fde892a9f | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/events_emitter_eql.py | .py | 3e6de3905fc18a39 | 7.6 | 15 |
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License
# 2.0; you may not use this file except in compliance with the Elastic License
# 2.0.
import eql
from . import ast
from .dsl import ToDsl
from .eql2kql import Eql... | elastic/geneve | geneve/kql/__init__.py | .py | f8d5a37fd741428a | 7.6 | 15 |
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License
# 2.0; you may not use this file except in compliance with the Elastic License
# 2.0.
from collections import defaultdict
from eql import Walker
from .errors impor... | elastic/geneve | geneve/kql/dsl.py | .py | f1a85108fbad6070 | 7.6 | 15 |
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License
# 2.0; you may not use this file except in compliance with the Elastic License
# 2.0.
from eql import EqlError, EqlParseError, EqlCompileError
class KqlParseErro... | elastic/geneve | geneve/kql/errors.py | .py | aa0eeca29136e191 | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/solver/__init__.py | .py | 45a2d71527efffdc | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/solver/group_as.py | .py | b08e4efce445612f | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/solver/group_event.py | .py | 265fae5c57391911 | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/solver/type_boolean.py | .py | f02f09b3dc45aba2 | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/solver/type_date.py | .py | 49dbb9343e9d770f | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/solver/type_ip.py | .py | d49ad84033b3842a | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/solver/type_keyword.py | .py | 7cac49d6d2863b36 | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/solver/type_long.py | .py | e88df93455c6813a | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/stack/__init__.py | .py | 35daf6c315d406dc | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/stack/prober_ecctl.py | .py | 8b61517f79ac1904 | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/stack/prober_elastic.py | .py | f2e8ae5872d1fea0 | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/stack/prober_elastic_package.py | .py | ca3fa9114796d6ca | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/stack/prober_geneve_test_env.py | .py | 62feb6bdc9a1bc5e | 8.1 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/utils/__init__.py | .py | 8e26cd44c09ca1fa | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/utils/ast_dag.py | .py | b9369cb2d37adb06 | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/utils/epr.py | .py | 5b11133a38dc72a9 | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/utils/hdict.py | .py | fe1a982d2545c19c | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/utils/kibana.py | .py | c42b6ad56bdb81f2 | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/utils/resource.py | .py | 67c1d5c393fd31f7 | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/utils/shelllib.py | .py | 0684ec847dd1dce8 | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | geneve/utils/solution_space.py | .py | 0c280b28d8b2a83f | 7.6 | 15 |
#!/usr/bin/env python3
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); ... | elastic/geneve | scripts/check-ruleset-sync.py | .py | 27b2727c739760de | 7.6 | 15 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | elastic/geneve | tests/jupyter.py | .py | 263873aac334b22f | 8.1 | 15 |
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License
# 2.0; you may not use this file except in compliance with the Elastic License
# 2.0.
import unittest
from geneve import kql
class TestEql2Kql(unittest.TestCase)... | elastic/geneve | tests/kuery/test_eql2kql.py | .py | 918b02316f376e59 | 7.1 | 15 |
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License
# 2.0; you may not use this file except in compliance with the Elastic License
# 2.0.
import unittest
from geneve import kql
class LintTests(unittest.TestCase):
... | elastic/geneve | tests/kuery/test_lint.py | .py | 1354ae5f26f58c79 | 7.1 | 15 |
#!/usr/bin/env python3
from ansible.errors import AnsibleFilterError
class FilterModule(object):
def filters(self):
return {
'group_hostvars_by_var':
self.group_hostvars_by_var,
'get_hostvars_by_host':
self.get_hostvars_by_host
}
def group_hostv... | stackhpc/stackhpc-kayobe-config | etc/kayobe/ansible/filter_plugins/filters.py | .py | ecf93cc01e05920c | 7.66 | 20 |
#!/usr/bin/env python3
import json
import re
import subprocess
from pySMART import DeviceList
SMARTMON_ATTRS = {
"airflow_temperature_cel",
"command_timeout",
"current_pending_sector",
"end_to_end_error",
"erase_fail_count",
"g_sense_error_rate",
"hardware_ecc_recovered",
"host_reads_32... | stackhpc/stackhpc-kayobe-config | etc/kayobe/ansible/scripts/generate_fixtures.py | .py | 75b0f05fdb60eb62 | 7.66 | 20 |
#!/usr/bin/env python3
import subprocess
import json
import re
import datetime
import os
from prometheus_client import CollectorRegistry, Gauge, write_to_textfile
from pySMART import DeviceList
SMARTCTL_PATH = "/usr/sbin/smartctl"
SMARTMON_ATTRS = {
"airflow_temperature_cel",
"command_timeout",
"current... | stackhpc/stackhpc-kayobe-config | etc/kayobe/ansible/scripts/smartmon.py | .py | b9c4c5d3fa11c9d7 | 7.66 | 20 |
import glob
import json
import os
import sys
import tempfile
import types
import unittest
import math
CURRENT_DIR = os.path.dirname(__file__)
if CURRENT_DIR not in sys.path:
sys.path.insert(0, CURRENT_DIR)
prometheus_stub = types.ModuleType("prometheus_client")
class DummyCollectorRegistry:
pass
class Dumm... | stackhpc/stackhpc-kayobe-config | etc/kayobe/ansible/scripts/test_smartmon.py | .py | 07f77b3899ee1199 | 8.16 | 20 |
#!/usr/bin/env python3
"""
Script to manage Kolla container image tags.
Background:
In Kolla Ansible each container is deployed using a specific image.
Typically the image is named the same as the container, with underscores
replaced by dashes, however there are some exceptions. Sometimes multiple
containers use the ... | stackhpc/stackhpc-kayobe-config | tools/kolla-images.py | .py | f7f6610cd1764ea1 | 7.66 | 20 |
"""
Configuration management for UAV reflectance extraction pipeline.
Handles loading, parsing, and validating YAML configuration files.
"""
import logging
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import yaml
class AttrDict:
"""A dictionary that allows attribute access to its... | ReneHeim/proj_on_uav | src/oncerco_uav/core/config_object.py | .py | 1dc9c26b3a644627 | 7.42 | 6 |
import concurrent
import glob
import logging
import os
import re
from concurrent.futures import ThreadPoolExecutor
def order_path_list(group):
"""Return a list indexed by plot_id where present, preserving others at the end.
- Safely handles gaps and large plot IDs by using a dict first.
- Keeps non-match... | ReneHeim/proj_on_uav | src/oncerco_uav/core/search.py | .py | dbd5e6103d3fdb70 | 7.42 | 6 |
import logging
import tempfile
from pathlib import Path
from timeit import default_timer as timer
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
import polars as pl
import rasterio as rio
from rasterio.enums import Resampling
from rasterio.warp import calculate_default_tra... | ReneHeim/proj_on_uav | src/oncerco_uav/extract/merge_analysis.py | .py | 52b2b417585b79bf | 7.42 | 6 |
import logging
from collections.abc import Sequence
from itertools import islice
from pathlib import Path
from typing import Optional
import polars as pl
def _read_folder(folder: Path) -> list[pl.DataFrame]:
"""
Reads all Parquet files from a given folder into memory.
Parameters:
-----------
fol... | ReneHeim/proj_on_uav | src/oncerco_uav/filter/data_loader.py | .py | 7db63256ec1671ca | 7.42 | 6 |
import logging
import geopandas as gpd
import polars as pl
from matplotlib import pyplot as plt
from shapely.geometry.point import Point
def spectral_index_expressions() -> list[pl.Expr]:
"""Return the standard spectral-index expressions used by the filtering pipeline."""
soil_adjustment = 0.16
return [
... | ReneHeim/proj_on_uav | src/oncerco_uav/filter/filters.py | .py | 45c3ccc08280b218 | 7.42 | 6 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import glob
import logging
import os
import re
import traceback
from datetime import datetime
from pathlib import Path, PureWindowsPath
from timeit import default_timer as timer
import matplotlib
import numpy as np
import polars as pl
import pysolar as sol... | ReneHeim/proj_on_uav | src/oncerco_uav/pipelines/extract_data.py | .py | bd60e90441c18a59 | 7.42 | 6 |
import itertools
import time
import numpy as np
import polars as pl
from scipy.stats import f as f_dist
from scipy.stats import studentized_range
from statsmodels.stats.multicomp import pairwise_tukeyhsd
def ANOVA_preprocess(df, vza_edges=[0, 20, 40, 60, 80], raa_edges=list(range(-360, 361, 90))):
# Create bin l... | ReneHeim/proj_on_uav | src/oncerco_uav/stats/ANOVA.py | .py | 118bf96848743e57 | 7.42 | 6 |
class Calculator:
def get_calculator(self, cvss):
"""
Returns the CVSS base score, impact sub-score and exploitability sub-score
Args:
cvss (string): A valid CVSSv2 or CVSSv3 vector. Example "CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:H"
"""
response = self.ses... | manuel-sommer/dependencytrack-pywrap | apicomponents/calculator.py | .py | 2c499c69f4b675b8 | 7.52 | 10 |
class CWE:
def get_cwe(self, pageSize=100):
"""
Returns a list of all CWEs
Args:
pageSize (int, optional): size of the page. Defaults to 100.
Returns:
JSON: json object
"""
cwe_list = list()
pageNumber = 1
response = self.se... | manuel-sommer/dependencytrack-pywrap | apicomponents/cwe.py | .py | 382b9ff66263def1 | 7.52 | 10 |
import json
class LDAP:
def list_ldapgroups(self, pageSize=100):
"""
This API performs a pass-thru query to the configured LDAP server. Search criteria results are cached using default Alpine CacheManager policy.
Returns the DNs of all accessible groups within the directory
"""
... | manuel-sommer/dependencytrack-pywrap | apicomponents/ldap.py | .py | 5ecbac6c91cb74fd | 7.52 | 10 |
class License:
def get_list_license(self, pageSize=100):
"""Returns a list of all licenses with complete metadata for each license"""
license_list = list()
pageNumber = 1
response = self.session.get(
self.apicall + "/v1/license", params={"pageSize": pageSize, "pageNumber... | manuel-sommer/dependencytrack-pywrap | apicomponents/license.py | .py | 681ef0a0b32e6c94 | 7.52 | 10 |
class ProjectProperty:
def get_projectproperty(self, uuid):
response = self.session.get(self.apicall + f"/v1/project/{uuid}/property")
if response.status_code == 200:
return response.json()
return (f"Unable to find project, {response.status_code}")
def update_projectproperty... | manuel-sommer/dependencytrack-pywrap | apicomponents/projectProperty.py | .py | 4093da00a2b85edb | 7.52 | 10 |
import json
class Service:
def list_services(self, uuid, pageSize=100):
"""
Returns a list of all services for a given project
Args:
uuid (string): The UUID of the project.
pageSize (int, optional): page size. Defaults to 100.
Returns:
List: l... | manuel-sommer/dependencytrack-pywrap | apicomponents/service.py | .py | 7fe40d6924545dd0 | 7.52 | 10 |
import json
class User:
def get_user_oidc(self):
"""
"""
response = self.session.get(self.apicall + "/v1/user/oidc") # Retuns a list of all OIDC users
if response.status_code == 200:
return response.json()
if response.status_code == 401:
return (f"... | manuel-sommer/dependencytrack-pywrap | apicomponents/user.py | .py | a625ae413337eed1 | 7.52 | 10 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/pydpf-composites | src/ansys/dpf/composites/_composite_model_impl_helpers.py | .py | a2b57442864beb75 | 7.56 | 12 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/pydpf-composites | src/ansys/dpf/composites/_sampling_point_helpers.py | .py | 855b96f4b2d7a5b9 | 7.56 | 12 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/pydpf-composites | src/ansys/dpf/composites/constants.py | .py | 5959ed396fb684f1 | 7.56 | 12 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/pydpf-composites | src/ansys/dpf/composites/failure_criteria/_core_failure.py | .py | 5387a43b424bf2bb | 7.56 | 12 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/pydpf-composites | src/ansys/dpf/composites/failure_criteria/_cuntze.py | .py | 5538fc43ce1318b6 | 7.56 | 12 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/pydpf-composites | src/ansys/dpf/composites/failure_criteria/_face_sheet_wrinkling.py | .py | 41d26d8b6fb9b8c4 | 7.56 | 12 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/pydpf-composites | src/ansys/dpf/composites/failure_criteria/_failure_criterion_base.py | .py | 7662ba3dc069b0c6 | 7.56 | 12 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.