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 |
|---|---|---|---|---|---|---|
""" """
import glob
import json
import os
import re
import time
import zipfile
from typing import Any, List, Optional, Sequence, Tuple
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from cfg import BaseCfg
from data_reader import CPSC2021Reader as DR
_BASE_DIR = os.p... | DeepPSP/cpsc2021 | gather_results.py | .py | 3f4bdf9fbabf8313 | 7.62 | 16 |
"""
denoise, mainly concerning the motion artefacts, using naive methods
some of the CPSC2020 records have segments of severe motion artefacts,
such segments should be eliminated from feature computation
Process:
--------
1. detect segments of nearly constant values, and slice these segments out
2. detect motion arte... | DeepPSP/cpsc2021 | signal_processing/ecg_denoise.py | .py | 695f98fe723c4ac0 | 7.62 | 16 |
"""
preprocess of (single lead) ecg signal:
band pass (dep. on purpose?) --> remove baseline (?) --> find rpeaks
--> wave delineation (?, put into several stand alone files)
NOTE:
-----
1. ALL signals are assumed to have units in mV
References:
-----------
[1] https://github.com/PIA-Group/BioSPPy
[2] to add
"... | DeepPSP/cpsc2021 | signal_processing/ecg_preproc.py | .py | ccbb37978cd9b953 | 7.62 | 16 |
"""
R peaks detection using deep learning models for single-lead ECG signal
References:
-----------
[1] Cai, Wenjie, and Danqin Hu. "QRS complex detection using novel deep learning neural networks." IEEE Access (2020).
"""
import math
from itertools import repeat
from numbers import Real
from typing import Sequence, ... | DeepPSP/cpsc2021 | signal_processing/ecg_rpeaks_dl.py | .py | de74167cf690e6ff | 7.62 | 16 |
"""
NOTE:
-----
corresponding model (weight) files can be downloaded at
https://opensz.oss-cn-beijing.aliyuncs.com/ICBEB2020/file/CPSC2019-opensource.zip
References:
-----------
[1] Cai, Wenjie, and Danqin Hu. "QRS complex detection using novel deep learning neural networks." IEEE Access (2020).
[2] to add more
"""
i... | DeepPSP/cpsc2021 | signal_processing/ecg_rpeaks_dl_models/__init__.py | .py | a5b3734877428086 | 7.62 | 16 |
"""
this file is borrowed and modified from wfdb 2.2.1, which is removed in wfdb 3.*.*
source: https://pypi.org/project/wfdb/2.2.1/#files
"""
import numpy as np
import scipy.signal as scisig
# import pdb
# import matplotlib.pyplot as plt
__all__ = [
"PanTompkins",
"pantompkins",
]
class PanTompkins(object... | DeepPSP/cpsc2021 | signal_processing/pantompkins.py | .py | 61e3538b599002e6 | 7.62 | 16 |
""" """
import os
import sys
_BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
"""
copied from the official baseline entry repository
"""
import json
import numpy as np
import peakutils
from scipy import signal
"""
Written by: Xingyao Wang, Chengyu Liu
School of Instrument Sci... | DeepPSP/cpsc2021 | utils/__init__.py | .py | 3b5ca9f11d787d62 | 7.62 | 16 |
"""
auxiliary metrics for the task of qrs detection
References
----------
[1] http://2019.icbeb.org/Challenge.html
"""
import multiprocessing as mp
from numbers import Real
from typing import Dict, Optional, Sequence, Union
import numpy as np
import torch
from torch_ecg.torch_ecg.models.loss import MaskedBCEWithLog... | DeepPSP/cpsc2021 | utils/aux_metrics.py | .py | df394681b8a90910 | 7.62 | 16 |
""" """
import argparse
import glob
import os
import textwrap
from typing import List, Optional, Union
def import_parents(level: int = 1) -> None:
# https://gist.github.com/vaultah/d63cb4c86be2774377aa674b009f759a
import importlib
import sys
from pathlib import Path
global __package__
file =... | DeepPSP/cpsc2021 | utils/scoring_metrics_test.py | .py | 94d0f6a848b8d6b5 | 8.12 | 16 |
"""Models for TechnoVE."""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import Any
class Status(Enum):
"""Describes the status of a TechnoVE station.
Values map to SAE J1772 Control Pilot states and TechnoVE custom states.
The raw API value is a... | Moustachauve/pytechnove | src/technove/models.py | .py | 0a946b533f4181b2 | 7.45 | 7 |
"""Asynchronous Python client for TechnoVE."""
from __future__ import annotations
import asyncio
import json
from dataclasses import dataclass
from typing import Any, Final, Self
import aiohttp
import backoff
from yarl import URL
from .exceptions import (
TechnoVEConnectionError,
TechnoVEConnectionTimeoutEr... | Moustachauve/pytechnove | src/technove/technove.py | .py | 6b891dbddf5dae0c | 7.45 | 7 |
"""Test configuration and fixtures for unimpeded tests."""
import re
import pytest
def strip_csv_response_body(response):
"""Strip large CSV response bodies to only keep first 1000 lines."""
# Check if response has a body
if "body" not in response or "string" not in response["body"]:
return resp... | handley-lab/unimpeded | tests/conftest.py | .py | 993e986ce5311abc | 7.98 | 8 |
"""Tests for the unimpeded command-line entry points."""
import importlib
import re
import sys
from pathlib import Path
from unittest.mock import MagicMock, patch
import pytest
import requests
from unimpeded.cli import (
FILENAME,
download_unimpeded_tutorial,
launch_unimpeded_tutorial,
)
@pytest.fixtur... | handley-lab/unimpeded | tests/test_cli.py | .py | 8facbf9ea70abf73 | 7.98 | 8 |
"""Tests that the declared packaging metadata matches what the code needs."""
import ast
import re
import sys
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parent.parent
PACKAGE = REPO_ROOT / "unimpeded"
#: Import name -> distribution name, where the two differ.
IMPORT_TO_DISTRIBUTION = {"yaml": "pyy... | handley-lab/unimpeded | tests/test_packaging.py | .py | 28f72ba8b819847c | 7.98 | 8 |
"""Tension statistics for nested sampling chains.
Wraps :func:`anesthetic.tension.tension_stats` with the correction for
prior volume discarded during nested sampling, and adds helpers that pull
the required chains straight from the public Zenodo grid.
"""
from functools import cache
import numpy as np
from anesthet... | handley-lab/unimpeded | unimpeded/tension.py | .py | 151ce6b4b1eac6f6 | 7.48 | 8 |
"""Transport typing seam for restgdf (BL-17).
Defines :class:`AsyncHTTPSession`, a :class:`typing.Protocol` that
captures the subset of :class:`aiohttp.ClientSession` behavior restgdf
call sites rely on (``get`` / ``post`` / ``close`` / ``closed``).
Flagged :func:`typing.runtime_checkable` so adapter classes
(resilien... | joshuasundance-swca/restgdf | restgdf/_client/_protocols.py | .py | 5ea2c9a1e19d5971 | 7.45 | 7 |
"""Typed request-payload builder for ArcGIS REST queries.
:class:`QueryOptions` is a frozen dataclass that replaces the
``dict``-based datadict merging previously scattered across
``restgdf.featurelayer`` and ``restgdf.utils.getgdf`` call sites. It is
introduced in Phase 5 of the TDD refactor as an **opt-in** alternat... | joshuasundance-swca/restgdf | restgdf/_client/query_options.py | .py | 0b6e8b5224e2961d | 7.45 | 7 |
"""Shared compatibility helpers for restgdf deprecations.
This module is **internal**: it is deliberately not re-exported from
:mod:`restgdf`'s top-level namespace. It exists so that every
``DeprecationWarning`` emission in the package shares one implementation
with stable ``stacklevel`` semantics. Callers should impo... | joshuasundance-swca/restgdf | restgdf/_compat.py | .py | 30b614f460e867c0 | 7.45 | 7 |
"""Shared drift adapter for pydantic response parsing.
This module defines the two response-model tiers used across the library:
* :class:`PermissiveModel` — ``extra="allow"``, accepts variant payloads, logs
drift. Used for metadata, service, folder, and crawl shapes where ArcGIS
vendor variance is expected. A to... | joshuasundance-swca/restgdf | restgdf/_models/_drift.py | .py | ca394cdad0448452 | 7.45 | 7 |
"""Process-level runtime settings for restgdf (**deprecated shim**).
Since phase-2a BL-18 this module is a *backwards-compatibility shim* over
:mod:`restgdf._config`. The flat :class:`Settings` model and
:func:`get_settings` remain for existing callers but:
* :func:`get_settings` emits a :class:`DeprecationWarning` o... | joshuasundance-swca/restgdf | restgdf/_models/_settings.py | .py | ff6fcd96a7c2f732 | 7.45 | 7 |
"""S-4: Pydantic models for :func:`restgdf.utils.crawl.safe_crawl` output.
``safe_crawl`` aggregates results of a directory crawl and, unlike
``fetch_all_data``, never short-circuits on the first failure. Its return
value is a :class:`CrawlReport` containing:
* :attr:`CrawlReport.services` — a list of :class:`CrawlSe... | joshuasundance-swca/restgdf | restgdf/_models/crawl.py | .py | 2045cc412ebcfe88 | 7.45 | 7 |
"""Credentials and token-session configuration models.
Two pydantic models live here:
* :class:`AGOLUserPass` — ArcGIS Online / Enterprise username + password
credentials. The password field is a :class:`pydantic.SecretStr` so it
is redacted from ``str()`` / ``repr()`` / logs; the literal value is
available via... | joshuasundance-swca/restgdf | restgdf/_models/credentials.py | .py | bf20000a7b44b7c8 | 7.45 | 7 |
"""Pydantic response-envelope models.
Runtime-validated ArcGIS payloads consumed by restgdf, split into two
tiers by design (see :mod:`restgdf._models._drift`):
* Permissive: :class:`FieldSpec`, :class:`ErrorInfo`, :class:`Feature`,
:class:`LayerMetadata`, :class:`ServiceInfo`.
* Strict: :class:`ErrorResponse`.
Su... | joshuasundance-swca/restgdf | restgdf/_models/responses.py | .py | 4c42b592a5e665d1 | 7.45 | 7 |
"""Core-install safe row-shaped dict adapters.
Thin, stable aliases for the row-flattening helpers in
:mod:`restgdf.utils.getgdf`. No heavy dependencies — this module is safe to
import and use on a minimal restgdf install.
See also
--------
:func:`restgdf.compat.as_dict`, :func:`restgdf.compat.as_json_dict`
Plain... | joshuasundance-swca/restgdf | restgdf/adapters/dict.py | .py | 95e92ecd929573d3 | 7.45 | 7 |
"""Geopandas-gated geo-tabular adapters.
Materialize row-shaped dict iterables into a :class:`geopandas.GeoDataFrame`.
The module itself is safe to import on a base restgdf install — the geo
stack (``pandas`` + ``geopandas`` + ``pyogrio``) is loaded lazily via
:func:`restgdf.utils._optional.require_geo_stack` **inside... | joshuasundance-swca/restgdf | restgdf/adapters/geopandas.py | .py | 48a24917d783db8d | 7.45 | 7 |
"""Pandas-gated tabular adapters.
Materialize row-shaped dict iterables into a :class:`pandas.DataFrame`. The
module itself is safe to import on a base restgdf install — pandas is loaded
lazily via :func:`restgdf.utils._optional.require_pandas` **inside** each
adapter function, so importing this module on a pandas-fre... | joshuasundance-swca/restgdf | restgdf/adapters/pandas.py | .py | f4a573f2bc7d1c25 | 7.45 | 7 |
"""Compatibility helpers for the 1.x → 2.x migration.
Downstream code that indexed the legacy dict-based public surface (for
example ``metadata["name"]``, ``crawl_result["services"]``) needs a
short-term way to keep working during its own upgrade window. These
helpers convert the 2.x pydantic models back into plain Py... | joshuasundance-swca/restgdf | restgdf/compat.py | .py | 4ea32b858a3d35ee | 7.45 | 7 |
from typing import TYPE_CHECKING
from restgdf._client._protocols import AsyncHTTPSession
from restgdf._models.crawl import CrawlReport, CrawlServiceEntry
from restgdf._models.responses import LayerMetadata
from restgdf.utils.getinfo import get_metadata
from restgdf.utils.crawl import fetch_all_data, safe_crawl # noqa... | joshuasundance-swca/restgdf | restgdf/directory/directory.py | .py | 85678523633e0f8d | 7.45 | 7 |
"""Canonical exception taxonomy for restgdf 3.0.
This module defines the public exception hierarchy used by every public
entry point in ``restgdf``. All domain-specific exceptions derive from
:class:`RestgdfError` so callers can catch "any restgdf failure" with a
single ``except RestgdfError`` block while still being ... | joshuasundance-swca/restgdf | restgdf/errors.py | .py | 36c56308ac94c0ce | 7.45 | 7 |
"""Per-service-root token-bucket and cooldown registries (BL-52)."""
from __future__ import annotations
import asyncio
import re
import time
from urllib.parse import urlparse
from aiolimiter import AsyncLimiter
# Matches the first ArcGIS "server type" path segment.
_SERVER_TYPE_RE = re.compile(
r"(.*?/(?:Featu... | joshuasundance-swca/restgdf | restgdf/resilience/_limiter.py | .py | 546bff868785e93d | 7.45 | 7 |
"""Stamina-based retry wrapper implementing AsyncHTTPSession (BL-31)."""
from __future__ import annotations
import inspect
from typing import Any
import aiohttp
import stamina
from restgdf._config import ResilienceConfig
from restgdf._logging import build_log_extra, get_logger
from restgdf.errors import (
RateL... | joshuasundance-swca/restgdf | restgdf/resilience/_retry.py | .py | 9f86a2887a958086 | 7.45 | 7 |
"""``RestgdfInstrumentor`` — dynamic subclass of ``AioHttpClientInstrumentor``.
The class is built lazily on first instantiation so that ``import
restgdf.telemetry`` succeeds without any OpenTelemetry packages installed.
If OTel is absent at *construction* time, :class:`~restgdf.errors.OptionalDependencyError`
is rais... | joshuasundance-swca/restgdf | restgdf/telemetry/_instrumentor.py | .py | 19267fdd5da2156e | 7.45 | 7 |
"""Span helpers for restgdf telemetry.
:func:`feature_layer_stream_span` is the async context-manager that opens an
INTERNAL ``feature_layer.stream`` span (R-21). It is *not* wired into
production call-sites by this phase — that happens in phase-4A.
:func:`start_feature_layer_stream_span` is the generator-safe compan... | joshuasundance-swca/restgdf | restgdf/telemetry/_spans.py | .py | 026729c73853b261 | 7.45 | 7 |
"""Low-level utility modules for HTTP transport, pagination, and data helpers.
Most users should interact with :class:`~restgdf.FeatureLayer` and
:class:`~restgdf.Directory` instead of calling these directly.
Submodules are lazily loaded to avoid importing heavy optional
dependencies at package init time.
"""
from __... | joshuasundance-swca/restgdf | restgdf/utils/__init__.py | .py | fdc8f554fc5f7d1b | 7.45 | 7 |
"""Internal helper for emitting ``DeprecationWarning`` from legacy aliases.
Centralizing this helper ensures a consistent message format and that
each legacy name warns in exactly **one** place (no double-wrapping
through re-exports). See Phase 6 of the TDD refactor plan and
``tests/test_deprecations.py``.
"""
from _... | joshuasundance-swca/restgdf | restgdf/utils/_deprecations.py | .py | bf3500d86b028a1b | 7.45 | 7 |
"""Geometry payload helpers for ArcGIS REST query parameters.
Private submodule; public helpers are re-exported by
``restgdf.utils.getinfo`` to preserve stable import paths.
"""
from __future__ import annotations
from collections.abc import Iterable
from collections.abc import Mapping
from collections.abc import Seq... | joshuasundance-swca/restgdf | restgdf/utils/_geometry.py | .py | c3bcea967864f897 | 7.45 | 7 |
"""HTTP defaults for ArcGIS REST helpers.
Private submodule; all public names are re-exported by
``restgdf.utils.getinfo`` to preserve import paths.
"""
from __future__ import annotations
from collections.abc import Mapping
import inspect
from typing import Any, Literal
from urllib.parse import urlencode
import aio... | joshuasundance-swca/restgdf | restgdf/utils/_http.py | .py | 816e91f72874093e | 7.45 | 7 |
"""Pure metadata parsers for ArcGIS REST responses.
Private submodule; all public names are re-exported by
``restgdf.utils.getinfo`` to preserve import paths.
"""
from __future__ import annotations
from collections.abc import Mapping
from re import IGNORECASE, compile
from typing import TYPE_CHECKING, Any, Union
fr... | joshuasundance-swca/restgdf | restgdf/utils/_metadata.py | .py | d61be0c6eba0988f | 7.45 | 7 |
"""Helpers for loading optional pandas/geopandas/pyogrio dependencies."""
from __future__ import annotations
from importlib import import_module
from types import ModuleType
from typing import Any
from restgdf.errors import OptionalDependencyError
GEO_EXTRA = "restgdf[geo]"
GEO_EXTRA_GUIDANCE = (
f"Install `{GE... | joshuasundance-swca/restgdf | restgdf/utils/_optional.py | .py | 466b9b4e5998608b | 7.45 | 7 |
"""Pure pagination planner for ArcGIS REST ``/query`` traversal.
Private submodule. Public symbols (:class:`PaginationPlan`,
:func:`build_pagination_plan`) are re-exported via
:mod:`restgdf.utils.getinfo` to preserve the patch-seam convention used
elsewhere in ``restgdf.utils``.
The planner is pure math: given a feat... | joshuasundance-swca/restgdf | restgdf/utils/_pagination.py | .py | 0d3858872a51ac05 | 7.45 | 7 |
"""Async statistics/aggregation helpers for ArcGIS REST endpoints.
Private submodule; all public names are re-exported by
``restgdf.utils.getinfo`` to preserve import paths.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from restgdf._client._protocols import AsyncHTTPSession
from res... | joshuasundance-swca/restgdf | restgdf/utils/_stats.py | .py | 16ae9b669c0995a2 | 7.45 | 7 |
"""Recursive ArcGIS Server directory crawling and service discovery.
Provides :func:`fetch_all_data` for raw-dict output and :func:`safe_crawl`
for structured :class:`~restgdf.CrawlReport` output with per-stage error
capture.
"""
from __future__ import annotations
import asyncio
from typing import Any
from pydantic... | joshuasundance-swca/restgdf | restgdf/utils/crawl.py | .py | 7b80939039793228 | 7.45 | 7 |
import os
import tempfile
import pytest
from tpv.rules import gateway
# Galaxy's IntegrationTestCase now mixes in UsesCeleryTasks, whose autouse
# fixtures require the celery pytest plugin and a celery_includes fixture.
pytest_plugins = ("celery.contrib.pytest",)
@pytest.fixture(scope="session")
def celery_include... | galaxyproject/total-perspective-vortex | tests/conftest.py | .py | e369e0d42054e08c | 7.13 | 17 |
import os
import unittest
import yaml
from tpv.commands.dumper import TPVConfigDumper
class TestTPVConfigDumper(unittest.TestCase):
"""Unit tests for TPVConfigDumper."""
@staticmethod
def _fixture_path(name):
return os.path.join(os.path.dirname(__file__), f"fixtures/{name}")
def test_dump_... | galaxyproject/total-perspective-vortex | tests/test_dump.py | .py | d1755768bd3198ce | 8.13 | 17 |
import os
import unittest
from galaxy.jobs import JobDestination
from tpv.commands.test import mock_galaxy
from tpv.core.entities import Destination, SchedulingTags, Tag, TagType, Tool
from tpv.core.loader import TPVConfigLoader
from tpv.rules import gateway
class TestEntity(unittest.TestCase):
@staticmethod
... | galaxyproject/total-perspective-vortex | tests/test_entity.py | .py | 67c782aa8d268140 | 7.13 | 17 |
"""Unit tests module for the helper functions"""
import unittest
from types import SimpleNamespace
from unittest.mock import patch
from tpv.commands.test import mock_galaxy
from tpv.core.helpers import (
get_dataset_attributes,
get_input_dataset,
get_input_datasets,
get_input_size,
input_size,
... | galaxyproject/total-perspective-vortex | tests/test_helpers.py | .py | 6a1c06e959b9340f | 8.13 | 17 |
import os
import unittest
from galaxy.jobs.mapper import JobMappingException
from tpv.commands.test import mock_galaxy
from tpv.rules import gateway
class TestMapperDestinations(unittest.TestCase):
@staticmethod
def _map_to_destination(tool, user, datasets, tpv_config_paths):
galaxy_app = mock_gala... | galaxyproject/total-perspective-vortex | tests/test_mapper_destinations.py | .py | fed2a1fc57db4e93 | 7.13 | 17 |
"""Integration tests for the weighted_choice helper in TPV config files."""
import os
import unittest
from unittest.mock import patch
from galaxy.jobs import JobDestination
from tpv.commands.test import mock_galaxy
from tpv.rules import gateway
class TestMapperWeightedChoice(unittest.TestCase):
@staticmethod
... | galaxyproject/total-perspective-vortex | tests/test_mapper_weighted_choice.py | .py | 151cf20c3c10bafd | 8.13 | 17 |
import os
import pathlib
import shutil
import tempfile
import time
import unittest
import responses
from galaxy.jobs.mapper import JobMappingException
from tpv.commands.test import mock_galaxy
from tpv.rules import gateway
class TestScenarios(unittest.TestCase):
@staticmethod
def _map_to_destination(tool, ... | galaxyproject/total-perspective-vortex | tests/test_scenarios.py | .py | 0468df3c759e56f2 | 7.13 | 17 |
import logging
import re
from typing import Any
from pydantic import BaseModel
from tpv.commands import mypychecker
from tpv.core.entities import Entity
from tpv.core.loader import TPVConfigLoader
log = logging.getLogger(__name__)
# Warning codes:
# T101: default inheritance not marked abstract
# T102: entity spec... | galaxyproject/total-perspective-vortex | tpv/commands/linter.py | .py | f418127b6bdd4f56 | 7.63 | 17 |
import ast
import inspect
import logging
import os
import re
import tempfile
import textwrap
from typing import Annotated, Any, get_args, get_origin
import mypy.api
from jinja2 import Environment, FileSystemLoader
from pydantic.fields import FieldInfo
from tpv.core.entities import Entity, TPVFieldMetadata
from tpv.co... | galaxyproject/total-perspective-vortex | tpv/commands/mypychecker.py | .py | 7a18b0b910847400 | 7.63 | 17 |
try:
from galaxy.tool_util.version import parse_version
except ImportError:
# Fallback to an older `packaging` version when Galaxy < 23.1.
# If Galaxy is < 23.1 you need to have `packaging` in <= 21.3
from packaging.version import parse as parse_version
import operator
import random
import re
from coll... | galaxyproject/total-perspective-vortex | tpv/core/helpers.py | .py | 0ca50bd53010b5fb | 7.63 | 17 |
from __future__ import annotations
import ast
import functools
import logging
from collections.abc import Callable
from types import CodeType
from typing import Any, TypeVar, cast
from . import helpers, util
from .entities import Entity, GlobalConfig, TPVConfig
from .evaluator import TPVCodeEvaluator
log = logging.g... | galaxyproject/total-perspective-vortex | tpv/core/loader.py | .py | b1cbfad08035a95c | 7.63 | 17 |
import functools
import logging
import re
from collections.abc import Mapping
from typing import Any, TypeVar, cast
from cachetools import Cache, cached
from galaxy.app import UniverseApplication
from galaxy.jobs import JobDestination, JobWrapper, ResubmitConfigDict
from galaxy.jobs.mapper import JobNotReadyException
... | galaxyproject/total-perspective-vortex | tpv/core/mapper.py | .py | 0b4b0afcae67713b | 7.63 | 17 |
from typing import Literal, TypedDict, get_args
from galaxy.tools import Tool as GalaxyTool
ResourceType = Literal[
"cores_min",
"cores_max",
"ram_min",
"ram_max",
"tmpdir_min",
"tmpdir_max",
"cuda_version_min",
"cuda_compute_capability",
"gpu_memory_min",
"cuda_device_count_mi... | galaxyproject/total-perspective-vortex | tpv/core/resource_requirements.py | .py | f8bea55a3e816a88 | 7.63 | 17 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from src.core.User import User
from src.bonsai.Http import Http
from src.bonsai.ShopProduct import *
from src.logger.Logger import Logger
class Bonsai:
"""Wrapper for the bonsaigarden"""
#BG - Интерфейс за бонсаевата градина
def __init__(self):
self.... | MasterZydra/WurzelimperiumBot | src/bonsai/Bonsai.py | .py | 6af65daf2641d21e | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from src.core.HTTPCommunication import HTTPConnection
from src.logger.Logger import Logger
class Http:
def __init__(self):
self.__http: HTTPConnection = HTTPConnection()
def init(self):
"""Selects bonsaigarden returns JSON content(status, data, in... | MasterZydra/WurzelimperiumBot | src/bonsai/Http.py | .py | cc0073975312eb8e | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from src.core.HTTPCommunication import HTTPConnection
from src.core.HttpUser import Http as HttpUser
from src.logger.Logger import Logger
class Http:
def __init__(self):
self.__http: HTTPConnection = HTTPConnection()
self.__httpUser = HttpUser()
d... | MasterZydra/WurzelimperiumBot | src/bonus/Http.py | .py | d2e0fe72983df865 | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from src.citypark.Http import Http
from src.logger.Logger import Logger
class CityPark:
def __init__(self):
self.__http = Http()
self.__set_park_data(self.__http.init_park())
def __set_park_data(self, content) -> bool:
"""Set the relevant ... | MasterZydra/WurzelimperiumBot | src/citypark/CityPark.py | .py | 2abdb5625ee4cd72 | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Config:
"""Store the configuration for the WurzelBot environment"""
# Write log also into std out
log_to_stdout = False
_instance = None
def __new__(self):
if self._instance is None:
self._instance = super(Config, self).__ne... | MasterZydra/WurzelimperiumBot | src/core/Config.py | .py | 933f5baa132427d9 | 7.04 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 21.03.2017
@author: MrFlamez
'''
from urllib.parse import urlencode
import json, re, httplib2, yaml, i18n
from http.cookies import SimpleCookie
from http import HTTPStatus
from src.core.HttpError import HTTPStateError, JSONError, HTTPRequestError, YAMLError... | MasterZydra/WurzelimperiumBot | src/core/HTTPCommunication.py | .py | d5be0d4b1269e133 | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from src.core.HTTPCommunication import HTTPConnection
from src.core.HttpUser import Http as HttpUser
from src.logger.Logger import Logger
class Http:
def __init__(self):
self.__http: HTTPConnection = HTTPConnection()
self.__httpUser = HttpUse... | MasterZydra/WurzelimperiumBot | src/core/HttpFeature.py | .py | 8e69d4d02be4fbb4 | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import html, re
from src.core.HTTPCommunication import HTTPConnection
from src.core.HttpError import JSONError
from src.logger.Logger import Logger
class Http:
def __init__(self):
self.__http: HTTPConnection = HTTPConnection()
def load_data(self, data_ty... | MasterZydra/WurzelimperiumBot | src/core/HttpUser.py | .py | 11da9af24efb34f9 | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 21.01.2017
@author: MrFlamez
'''
from src.logger.Logger import Logger
import time, i18n
i18n.load_path.append('lang')
class Session:
"""Session represents a PHP session"""
# Session is valid for 2 h (7200 s)
__lifetime = 7200
# Res... | MasterZydra/WurzelimperiumBot | src/core/Session.py | .py | 0e9f5cf69dd9fbef | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from src.core.User import User
from src.garden.Http import Http
from src.logger.Logger import Logger
from src.product.ProductData import ProductData
from src.product.Products import WEEDS, TREE_STUMP, STONE, MOLE, is_booster
import i18n
from collections import Counter, nam... | MasterZydra/WurzelimperiumBot | src/garden/Garden.py | .py | dbdabf20af84ac3b | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from src.core.HTTPCommunication import HTTPConnection
from src.logger.Logger import Logger
from src.product.Product import CATEGORY_ADORNMENTS
from src.product.ProductData import ProductData
from src.product.Products import WEEDS, TREE_STUMP, STONE, MOLE
import json, re, t... | MasterZydra/WurzelimperiumBot | src/garden/Http.py | .py | bcafc16e6c6ee532 | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from src.garden.Garden import Garden
from src.garden.aqua.Http import Http
from src.logger.Logger import Logger
class AquaGarden(Garden):
def __init__(self):
Garden.__init__(self, 101)
self.__httpAqua = Http()
self.__setInnerFields()
s... | MasterZydra/WurzelimperiumBot | src/garden/aqua/AquaGarden.py | .py | 34cb362f2d1fae8d | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from src.core.HTTPCommunication import HTTPConnection
from src.garden.Http import Http as HttpGarden
from src.logger.Logger import Logger
import json, re
class Http:
def __init__(self):
self.__http: HTTPConnection = HTTPConnection()
self.__httpGarden =... | MasterZydra/WurzelimperiumBot | src/garden/aqua/Http.py | .py | cae0b1e849ff297a | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from src.core.User import User
from src.garden.deco.Http import Http
from src.logger.Logger import Logger
class Decogarden1():
"""Wrapper for the Decogarden 1"""
def __init__(self):
self.__http = Http()
def collect(self) -> bool:
data = self.... | MasterZydra/WurzelimperiumBot | src/garden/deco/Decogarden.py | .py | a9353f6085cdbeb8 | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from src.garden.Garden import Garden
from src.garden.herb.Http import Http
from src.logger.Logger import Logger
from src.product.ProductData import ProductData
from src.shop.Shop import Shop
from src.stock.Stock import Stock
class HerbGarden(Garden):
def __init__(self... | MasterZydra/WurzelimperiumBot | src/garden/herb/HerbGarden.py | .py | ba571d2f5d0624ed | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from src.greenhouse.Http import Http
from src.logger.Logger import Logger
class Greenhouse:
"""All important information for the greenhouse"""
def __init__(self):
self.__http = Http()
self.__set_fields(self.__http.init_greenhouse())
self._... | MasterZydra/WurzelimperiumBot | src/greenhouse/Greenhouse.py | .py | 030860d35be4b0e0 | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -
import logging
from pathlib import Path
from src.core.Config import Config
class Logger:
_instance = None
def __new__(self):
if self._instance is None:
self._instance = super(Logger, self).__new__(self)
self._instance.__initClass()
... | MasterZydra/WurzelimperiumBot | src/logger/Logger.py | .py | c98036e0761bf874 | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from src.core.HTTPCommunication import HTTPConnection
from src.logger.Logger import Logger
from lxml import html
import io, re
class Http:
def __init__(self):
self.__http: HTTPConnection = HTTPConnection()
def get_tradeable_products_from_overview(self):
... | MasterZydra/WurzelimperiumBot | src/marketplace/Http.py | .py | 94ff9e9b79c38ba6 | 7.54 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 15.05.2019
@author: MrFlamez
'''
from src.marketplace.Http import Http
class Marketplace:
def __init__(self):
self.__http = Http()
self.__tradeable_product_ids = None
def get_all_tradable_products(self):
"""Returns the IDs... | MasterZydra/WurzelimperiumBot | src/marketplace/Marketplace.py | .py | 9f398784bd2ea609 | 7.54 | 11 |
import re
class Unit:
"""Implementation of SVG units and conversions between them.
Parameters
----------
measure : str
value with unit (for example, '2cm')
"""
per_inch = {"px": 90, "cm": 2.54, "mm": 25.4, "pt": 72.0}
def __init__(self, measure):
try:
self.va... | nipreps/nireports | nireports/_vendored/svgutils/common.py | .py | 12cb24bff4f54e84 | 7.57 | 13 |
#!/usr/bin/env python3
"""SVG definitions designed for easy SVG composing
Features:
* allow for wildcard import
* defines a mini language for SVG composing
* short but readable names
* easy nesting
* method chaining
* no boilerplate code (reading files, extracting objects from svg,
... | nipreps/nireports | nireports/_vendored/svgutils/compose.py | .py | c70715748cf60b4d | 7.57 | 13 |
import codecs
from copy import deepcopy
from io import StringIO
from itertools import starmap
from lxml import etree
from .common import Unit
SVG_NAMESPACE = "http://www.w3.org/2000/svg"
XLINK_NAMESPACE = "http://www.w3.org/1999/xlink"
SVG = f"{{{SVG_NAMESPACE}}}"
XLINK = f"{{{XLINK_NAMESPACE}}}"
NSMAP = {None: SVG_... | nipreps/nireports | nireports/_vendored/svgutils/transform.py | .py | b5073ae6e00915f6 | 7.57 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/assembler/misc.py | .py | 024f96a19dd27a51 | 7.57 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/assembler/report.py | .py | 95105609d5345f2d | 7.57 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/assembler/tests/test_report.py | .py | 3e829080fb6041d7 | 8.07 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/assembler/tools.py | .py | c76db206a30c7f1c | 7.57 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/conftest.py | .py | 09e45f2566582d4b | 8.07 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/interfaces/dmri.py | .py | 4769e9f085490ed2 | 7.57 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/interfaces/fmri.py | .py | 1bffab4882dc472c | 7.57 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/interfaces/mosaic.py | .py | e33026aa4dace99d | 7.57 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/interfaces/nuisance.py | .py | e7cb81e129a27863 | 7.57 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/interfaces/reporting/masks.py | .py | 4fcc08268ae21bb0 | 7.57 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/reportlets/modality/dwi.py | .py | 22a1cf229c335335 | 7.57 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/reportlets/modality/func.py | .py | 52db958bbb03fdc7 | 7.57 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/reportlets/surface.py | .py | 3029f8f3fb5c006e | 7.57 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/reportlets/xca.py | .py | da9ab98a35f99ecd | 7.57 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/tests/conftest.py | .py | 7506cd5618659bde | 8.07 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2024 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/tests/test_dwi.py | .py | fffbd7eecee2130e | 8.07 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2024 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/tests/test_dwi_integration.py | .py | 86535df57454dd0c | 8.07 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2023 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/tests/test_interfaces.py | .py | f35cc4d29b095e43 | 8.07 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/tests/test_interfaces_registration.py | .py | c88b2c2e53822138 | 8.07 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/tests/test_interfaces_segmentation.py | .py | a281b8e064bef84e | 8.07 | 13 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | nipreps/nireports | nireports/tests/test_interfaces_utils.py | .py | 8b4d87c8bc03455d | 7.07 | 13 |
"""Typer command line interface for the documentation lifecycle."""
from __future__ import annotations
import logging
import subprocess
import time
from collections.abc import Callable
from dataclasses import dataclass
from pathlib import Path
from typing import Annotated
import typer
from mkdocs.commands.build impo... | nm-Team/Support | src/nmteam_support/cli.py | .py | 5e01729b0d333a14 | 7.56 | 12 |
"""Contributing-note injection for rendered documents."""
from __future__ import annotations
import re
from nmteam_support.frontmatter import split_frontmatter
from nmteam_support.models import DocEntry
GITHUB_EDIT_BASE = "https://github.com/nm-Team/Support/edit/main/docs/"
# Path prefixes that never receive a con... | nm-Team/Support | src/nmteam_support/contributing.py | .py | c9fb7480ef87be93 | 7.56 | 12 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.