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 |
|---|---|---|---|---|---|---|
# SPDX-FileCopyrightText: 2026 Open Source Robotics Foundation, Inc.
# SPDX-License-Identifier: Apache-2.0
"""Pure helpers for emitting CMake dependency information.
Used by :func:`generate.cmake_deps` and the CLI ``--cmake-deps`` path.
"""
from __future__ import annotations
from pathlib import Path
from nodl_gener... | ros-tooling/nodl | nodl_generator_cpp/nodl_generator_cpp/cmake_deps.py | .py | ee846095611cad09 | 7.63 | 17 |
# SPDX-FileCopyrightText: 2026 Open Source Robotics Foundation, Inc.
# SPDX-License-Identifier: Apache-2.0
import re
from dataclasses import dataclass
from pathlib import Path
from nodl_generator_cpp.cmake_deps import (
format_cmake_deps,
generated_filenames,
ros_deps,
)
from nodl_generator_cpp.generated_f... | ros-tooling/nodl | nodl_generator_cpp/nodl_generator_cpp/generate.py | .py | 772d35eb0691c215 | 7.63 | 17 |
# SPDX-FileCopyrightText: 2026 Open Source Robotics Foundation, Inc.
# SPDX-License-Identifier: Apache-2.0
# generated by datamodel-codegen:
# filename: codegen_cpp.schema.yaml
from __future__ import annotations
from enum import Enum
from typing import Optional
try:
from pydantic.v1 import BaseModel, Extra, F... | ros-tooling/nodl | nodl_generator_cpp/nodl_generator_cpp/models.py | .py | 2f57e9b4935d96f4 | 7.63 | 17 |
# SPDX-FileCopyrightText: 2026 Open Source Robotics Foundation, Inc.
# SPDX-License-Identifier: Apache-2.0
"""Convert NoDL parameters to generate_parameter_library format."""
from __future__ import annotations
import json
from pathlib import Path
import yaml
from generate_parameter_library_py.parse_yaml import Gener... | ros-tooling/nodl | nodl_generator_cpp/nodl_generator_cpp/params.py | .py | 747e8ed810ab3267 | 7.63 | 17 |
# SPDX-FileCopyrightText: 2026 Open Source Robotics Foundation, Inc.
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from typing import Optional
from nodl_generator_cpp.models import CodegenCpp
from nodl_generator_cpp.schema import load as load_codegen_cpp
from nodl_schema.loader import Docu... | ros-tooling/nodl | nodl_generator_cpp/nodl_generator_cpp/provenance.py | .py | 29ffffad56fcdb58 | 7.63 | 17 |
# SPDX-FileCopyrightText: 2026 Open Source Robotics Foundation, Inc.
# SPDX-License-Identifier: Apache-2.0
"""Validation and loading of the ``codegen.cpp`` metadata from NoDL documents."""
from __future__ import annotations
import importlib.resources as ir
from typing import Optional
import yaml
from jsonschema.vali... | ros-tooling/nodl | nodl_generator_cpp/nodl_generator_cpp/schema.py | .py | 4ccefc646111a2d0 | 7.63 | 17 |
# SPDX-FileCopyrightText: 2026 Open Source Robotics Foundation, Inc.
# SPDX-License-Identifier: Apache-2.0
"""Shared fixtures for nodl_generator_cpp tests."""
import tempfile
from pathlib import Path
import pytest
from nodl_schema import dump_nodl, resolver_registered
from nodl_schema.composition import Resolver
fr... | ros-tooling/nodl | nodl_generator_cpp/test/conftest.py | .py | 6917b3adce6ad537 | 8.13 | 17 |
# SPDX-FileCopyrightText: 2026 Open Source Robotics Foundation, Inc.
# SPDX-License-Identifier: Apache-2.0
"""Golden-file tests for nodl_generator_cpp.
Each subdirectory under ``golden/`` (except ``includes/``) is a test case:
- ``input.nodl.yaml`` — the root NoDL document
- ``expected/`` — the files the ge... | ros-tooling/nodl | nodl_generator_cpp/test/test_golden.py | .py | 1cc437c5328d9e6c | 8.13 | 17 |
"""Package for ``requests_mock_flask``."""
from __future__ import annotations
import dataclasses
import re
from operator import methodcaller
from types import ModuleType
from typing import TYPE_CHECKING, Any, BinaryIO
from urllib.parse import quote, unquote, urlsplit, urlunsplit
import httpretty
import httpx
import ... | adamtheturtle/requests-mock-flask | src/requests_mock_flask/__init__.py | .py | 834749b4892ac60f | 7.5 | 9 |
"""Tests for ways the helper can be used."""
from http import HTTPStatus
from typing import Final
import httpretty
import httpx
import requests
import requests_mock as req_mock
import responses
import respx
from flask import Flask
from requests_mock_flask import add_flask_app_to_mock
# We use a high timeout to allo... | adamtheturtle/requests-mock-flask | tests/test_usage_patterns.py | .py | d4dc3b3cdac5596a | 7 | 9 |
# Copyright 2020 - 2021 MONAI Consortium
# 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 wri... | MrGiovanni/Eureka | SuPreM/optimizers/lr_scheduler.py | .py | 3f49c029a55cdcd0 | 7.57 | 13 |
#!/usr/local/autopkg/python
#
# Copyright 2025 wycomco GmbH
#
# 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 applicabl... | autopkg/wycomco-recipes | FileZilla/FileZillaURLProvider.py | .py | 7f8de9776c124f2d | 7.48 | 8 |
#!/usr/local/autopkg/python
#
# Copyright 2026 wycomco GmbH
#
# 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 applicabl... | autopkg/wycomco-recipes | SharedProcessors/JamfMultiUploader.py | .py | e17c682a57385e8d | 7.48 | 8 |
#!/usr/local/autopkg/python
# Requires AutoPkg 2.9
#
# Copyright 2026 wycomco GmbH
#
# 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
#
# Unles... | autopkg/wycomco-recipes | SharedProcessors/MunkiAutoStaging.py | .py | 4ffc2f03cc6aac0a | 7.48 | 8 |
#!/usr/local/autopkg/python
"""AutoPkg processor for renaming variables."""
from autopkglib import Processor
__all__ = ["RenameVar"]
class RenameVar(Processor):
"""Substitute a character from a given string
and return the parsed string"""
input_variables = {
"input_var": {
"required... | autopkg/wycomco-recipes | SharedProcessors/RenameVar.py | .py | 072b9a3cae713a59 | 7.48 | 8 |
#!/usr/local/autopkg/python
"""
Copyright 2019 Zack T (mlbz521)
Fixed and ammended by jutonium for wycomco, copyright Aug 2020
Updated to adhere to coding standards by jutonium for wycomco Jan 23
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Li... | autopkg/wycomco-recipes | archicad_updates/ARCHICADUpdatesProcessor.py | .py | eb9942c52584610d | 7.48 | 8 |
import base64
import hashlib
from collections.abc import Callable
from contextlib import contextmanager
from pathlib import Path, PurePath
from flask import current_app, url_for
from werkzeug.datastructures import FileStorage
from google.cloud import storage
from google.cloud.exceptions import GoogleCloudError
from t... | svidela/flask-googlestorage | flask_googlestorage/buckets.py | .py | 28bd5338998364f1 | 7.48 | 8 |
from pathlib import PurePath
from uuid import uuid4
from flask import Flask
from werkzeug.utils import secure_filename
def get_state(app: Flask) -> dict:
"""Gets the extension state for the given application
:param app: The application instance
:returns: The extension state for the given application
... | svidela/flask-googlestorage | flask_googlestorage/utils.py | .py | 1cff1f0a8bd8f260 | 7.48 | 8 |
# irgramd: IRC-Telegram gateway
# utils.py: Helper functions
#
# Copyright (c) 2019 Peter Bui <pbui@bx612.space>
# Copyright (c) 2020-2026 E. Bosch <presidev@AT@gmail.com>
#
# Use of this source code is governed by a MIT style license that
# can be found in the LICENSE file included in this project.
import itertools
i... | prsai/irgramd | utils.py | .py | 87cb91b316e07224 | 7.59 | 14 |
#!/usr/bin/env python
"""
GIA_GSFC_mascons.py
Written by Tyler Sutterley (09/2023)
Calculates GIA equivalent water height corrections for GSFC mascons at the
central points of each mascon
INPUTS:
grace_file: GSFC GRACE/GRACE-FO mascon file to read
COMMAND LINE OPTIONS:
-h, --help: list the command line op... | polargeodesy/model-harmonics | model_harmonics/GIA/GIA_GSFC_mascons.py | .py | 924747beb130214a | 7.62 | 16 |
#!/usr/bin/env python
"""
GIA_spatial_maps.py
Written by Tyler Sutterley (09/2023)
Calculates spatial maps of Glacial Isostatic Adjustment (GIA)
COMMAND LINE OPTIONS:
-h, --help: list the command line options
-l X, --lmax X: maximum spherical harmonic degree
-R X, --radius X: Gaussian smoothing radius (km)... | polargeodesy/model-harmonics | model_harmonics/GIA/GIA_spatial_maps.py | .py | 0e167ac8a2ab5c55 | 7.62 | 16 |
#!/usr/bin/env python
"""
GIA_uplift_ICESat_ATL15.py
Written by Tyler Sutterley (07/2026)
Calculates GIA-induced crustal uplift over polar stereographic grids for
correcting ICESat-2 ATL15 gridded land ice height change data
Calculated directly from GIA spherical harmonics
INPUTS:
ATL15 file(s) to read
COMMAN... | polargeodesy/model-harmonics | model_harmonics/GIA/GIA_uplift_ICESat2_ATL15.py | .py | 57dfc9bfebdea50c | 7.62 | 16 |
#!/usr/bin/env python
"""
ecco_geoid_llc_tiles.py
Written by Tyler Sutterley (07/2026)
Calculates geoid heights for ECCO ocean model LLC tiles using model
coefficients from the GFZ International Centre for Global Earth
Models (ICGEM)
ECCO Version 4, Revision 4
https://ecco.jpl.nasa.gov/drive/files/Version... | polargeodesy/model-harmonics | model_harmonics/OBP/ecco_geoid_llc_tiles.py | .py | b59e4412691b7b0f | 7.62 | 16 |
#!/usr/bin/env python
"""
ecco_llc_tile_harmonics.py
Written by Tyler Sutterley (07/2026)
Reads monthly ECCO ocean bottom pressure anomalies from LLC tiles
and converts to spherical harmonic coefficients
ECCO Version 4, Revision 4
https://ecco.jpl.nasa.gov/drive/files/Version4/Release4/nctiles_monthly
ECCO Ve... | polargeodesy/model-harmonics | model_harmonics/OBP/ecco_llc_tile_harmonics.py | .py | 9f879fe4a30ade14 | 7.62 | 16 |
#!/usr/bin/env python
"""
ecco_mean_llc_tiles.py
Written by Tyler Sutterley (07/2026)
Calculates mean of tiled ocean bottom pressure data from the ECCO ocean model
https://ecco.jpl.nasa.gov/drive/files/Version4/Release4/nctiles_monthly
https://ecco.jpl.nasa.gov/drive/files/Version5/Alpha/nctiles_monthly
Computes the ... | polargeodesy/model-harmonics | model_harmonics/OBP/ecco_mean_llc_tiles.py | .py | 588c4ab9ffb8bef9 | 7.62 | 16 |
#!/usr/bin/env python
"""
ecco_mean_realtime.py
Written by Tyler Sutterley (08/2026)
Reads 12-hour ECCO ocean bottom pressure data from JPL
Calculates multi-annual means on an equirectangular grid
https://ecco.jpl.nasa.gov/drive/files/NearRealTime/Readme
https://ecco.jpl.nasa.gov/drive/files/NearRealTime/Kalma... | polargeodesy/model-harmonics | model_harmonics/OBP/ecco_mean_realtime.py | .py | 14a9df7701e3a6e8 | 7.62 | 16 |
#!/usr/bin/env python
"""
ecco_mean_version4.py
Written by Tyler Sutterley (05/2023)
Calculates mean of ocean bottom pressure data from the ECCO ocean model
https://ecco.jpl.nasa.gov/drive/files/Version4/Release4/interp_monthly/README
https://ecco-group.org/products-ECCO-V4r4.htm
https://ecco-group.org/user-guide-v4r4... | polargeodesy/model-harmonics | model_harmonics/OBP/ecco_mean_version4.py | .py | 22332637b472dd17 | 7.62 | 16 |
#!/usr/bin/env python
"""
ecco_monthly_harmonics.py
Written by Tyler Sutterley (07/2026)
Reads monthly ECCO ocean bottom pressure anomalies and converts to
spherical harmonic coefficients
INPUTS:
ECCO Near Real-Time models
kf080i: Kalman filter analysis
https://ecco.jpl.nasa.gov/drive/files... | polargeodesy/model-harmonics | model_harmonics/OBP/ecco_monthly_harmonics.py | .py | c63ed25731aba007 | 7.62 | 16 |
#!/usr/bin/env python
"""
ecco_read_llc_tiles.py
Written by Tyler Sutterley (07/2026)
Calculates monthly ocean bottom pressure anomalies from ECCO LLC tiles
https://ecco.jpl.nasa.gov/drive/files/Version4/Release4/nctiles_monthly
https://ecco.jpl.nasa.gov/drive/files/Version5/Alpha/nctiles_monthly
Processes the data a... | polargeodesy/model-harmonics | model_harmonics/OBP/ecco_read_llc_tiles.py | .py | ef4a14fee860a7de | 7.62 | 16 |
#!/usr/bin/env python
"""
ecco_read_realtime.py
Written by Tyler Sutterley (08/2026)
Reads 12-hour ECCO ocean bottom pressure data from JPL
Calculates monthly anomalies on an equirectangular grid
https://ecco.jpl.nasa.gov/drive/files/NearRealTime/Readme
https://ecco.jpl.nasa.gov/drive/files/NearRealTime/Kalman... | polargeodesy/model-harmonics | model_harmonics/OBP/ecco_read_realtime.py | .py | 16562b65188b9f3a | 7.62 | 16 |
#!/usr/bin/env python
"""
ecco_read_version4.py
Written by Tyler Sutterley (05/2023)
Calculates monthly ocean bottom pressure anomalies from ECCO Version 4 models
https://ecco.jpl.nasa.gov/drive/files/Version4/Release4/interp_monthly/README
https://ecco-group.org/products-ECCO-V4r4.htm
https://ecco-group.org/user-guid... | polargeodesy/model-harmonics | model_harmonics/OBP/ecco_read_version4.py | .py | 4f2f6cc70e9ba4a6 | 7.62 | 16 |
#!/usr/bin/env python
"""
gebco_ocean_depth.py
Written by Tyler Sutterley (05/2023)
Interpolates GEBCO bathymetry to model grids
GEBCO 2014/2020 Gridded bathymetry data:
https://www.bodc.ac.uk/data/hosted_data_systems/gebco_gridded_bathymetry_data/
INPUTS:
model_file: GEBCO zipped bathymetry file
COMMAND LINE O... | polargeodesy/model-harmonics | model_harmonics/OBP/gebco_ocean_depth.py | .py | 9c2b2d040817bee3 | 7.62 | 16 |
#!/usr/bin/env python
"""
era5_smb_cumulative.py
Written by Tyler Sutterley (03/2023)
Reads ERA5 datafiles to calculate monthly cumulative anomalies
in derived surface mass balance products
ERA5 conversion table for accumulated variables
https://confluence.ecmwf.int/pages/viewpage.action?pageId=197702790
COMMAND ... | polargeodesy/model-harmonics | model_harmonics/SMB/era5_smb_cumulative.py | .py | 1f9fa41d173ee43c | 7.62 | 16 |
#!/usr/bin/env python
"""
era5_smb_harmonics.py
Written by Tyler Sutterley (03/2023)
Reads monthly ERA5 surface mass balance anomalies and
converts to spherical harmonic coefficients
COMMAND LINE OPTIONS:
-D X, --directory X: Working data directory
-m X, --mean X: Year range for mean
-Y X, --year X: Ye... | polargeodesy/model-harmonics | model_harmonics/SMB/era5_smb_harmonics.py | .py | 74e260355051c19b | 7.62 | 16 |
#!/usr/bin/env python
"""
era5_smb_mean.py
Written by Tyler Sutterley (12/2022)
Reads monthly ERA5 datafiles to calculate multi-annual means
of derived surface mass balance products
ERA5 conversion table for accumulated variables
https://confluence.ecmwf.int/pages/viewpage.action?pageId=197702790
COMMAND LINE OPT... | polargeodesy/model-harmonics | model_harmonics/SMB/era5_smb_mean.py | .py | 49809a628f891d40 | 7.62 | 16 |
#!/usr/bin/env python
"""
gemb_smb_cumulative.py
Written by Tyler Sutterley (10/2024)
Calculates cumulative anomalies of GEMB surface mass balance products
CALLING SEQUENCE:
python gemb_smb_cumulative.py --mean 1980 1995 <path_to_gemb_file>
COMMAND LINE OPTIONS:
--mean: Start and end year of mean
-f X, --... | polargeodesy/model-harmonics | model_harmonics/SMB/gemb_smb_cumulative.py | .py | 65f0d7615ff8f809 | 7.62 | 16 |
#!/usr/bin/env python
"""
gemb_smb_harmonics.py
Written by Tyler Sutterley (04/2024)
Read GEMB SMB variables and convert to spherical harmonics
Shifts dates of SMB point masses to mid-month values to correspond with GRACE
CALLING SEQUENCE:
python gemb_smb_harmonics.py --lmax 60 --verbose <path_to_gemb_file>
COMMA... | polargeodesy/model-harmonics | model_harmonics/SMB/gemb_smb_harmonics.py | .py | 732809c509602b5e | 7.62 | 16 |
#!/usr/bin/env python
"""
merra_hybrid_cumulative.py
Written by Tyler Sutterley (02/2023)
Reads MERRA-2 hybrid datafiles to calculate cumulative anomalies in
derived surface mass balance products
MERRA-2 Hybrid model outputs provided by Brooke Medley at GSFC
CALLING SEQUENCE:
python merra_hybrid_cumulative.py ... | polargeodesy/model-harmonics | model_harmonics/SMB/merra_hybrid_cumulative.py | .py | a50bb342a15405bd | 7.62 | 16 |
#!/usr/bin/env python
"""
merra_smb_cumulative.py
Written by Tyler Sutterley (06/2023)
Reads MERRA-2 datafiles to calculate monthly cumulative anomalies
in derived surface mass balance products
From tavgM_2d_int (Vertically Integrated Diagnostics) collection:
PRECCU (convective rain)
PRECLS (large-scale ra... | polargeodesy/model-harmonics | model_harmonics/SMB/merra_smb_cumulative.py | .py | 7edcda95f160ade9 | 7.62 | 16 |
#!/usr/bin/env python
"""
merra_smb_mask.py
Written by Tyler Sutterley (07/2026)
Creates a mask for MERRA-2 land ice data using a set of shapefiles
https://goldsmr4.gesdisc.eosdis.nasa.gov/data/MERRA2_MONTHLY/
M2C0NXASM.5.12.4/1980/MERRA2_101.const_2d_asm_Nx.00000000.nc4
INPUTS:
path to MERRA-2 invariant file... | polargeodesy/model-harmonics | model_harmonics/SMB/merra_smb_mask.py | .py | bd018a73c8cfcf44 | 7.62 | 16 |
#!/usr/bin/env python
"""
merra_smb_mean.py
Written by Tyler Sutterley (06/2023)
Reads monthly MERRA-2 datafiles to calculate multi-annual means
of derived surface mass balance products
From tavgM_2d_int (Vertically Integrated Diagnostics) collection:
PRECCU (convective rain)
PRECLS (large-scale rain)
... | polargeodesy/model-harmonics | model_harmonics/SMB/merra_smb_mean.py | .py | bf0c4db2748a0582 | 7.62 | 16 |
#!/usr/bin/env python
"""
racmo_downscaled_harmonics.py
Written by Tyler Sutterley (06/2025)
Read RACMO surface mass balance products and converts to spherical harmonics
Shifts dates of SMB point masses to mid-month values to correspond with GRACE
COMMAND LINE OPTIONS:
-P X, --product X: RACMO SMB product to calcu... | polargeodesy/model-harmonics | model_harmonics/SMB/racmo_downscaled_harmonics.py | .py | 90ca4fb44524221c | 7.62 | 16 |
#!/usr/bin/env python
"""
racmo_smb_cumulative.py
Written by Tyler Sutterley (07/2026)
Reads RACMO datafiles to calculate cumulative anomalies in derived surface
mass balance products
CALLING SEQUENCE:
python racmo_smb_cumulative.py --product smb --verbose <path_to_racmo_file>
COMMAND LINE OPTIONS:
-P X, ... | polargeodesy/model-harmonics | model_harmonics/SMB/racmo_smb_cumulative.py | .py | b42694c9454005d6 | 7.62 | 16 |
#!/usr/bin/env python
"""
racmo_smb_harmonics.py
Written by Tyler Sutterley (06/2025)
Read RACMO surface mass balance products and converts to spherical harmonics
Shifts dates of SMB point masses to mid-month values to correspond with GRACE
CALLING SEQUENCE:
python racmo_smb_harmonics.py --product smb --verbose <p... | polargeodesy/model-harmonics | model_harmonics/SMB/racmo_smb_harmonics.py | .py | d57f5aaae47dc239 | 7.62 | 16 |
#!/usr/bin/env python
"""
era5_land_mask_arctic.py
Written by Tyler Sutterley (07/2026)
Creates a mask for ERA5-Land data for Greenland, Svalbard, Iceland and
the Russian High Arctic defined by a set of shapefiles
COMMAND LINE OPTIONS:
-D X, --directory X: Working data directory
-F X, --shapefile X: Shape... | polargeodesy/model-harmonics | model_harmonics/TWS/era5_land_mask_arctic.py | .py | d622ff769f992cbc | 7.62 | 16 |
#!/usr/bin/env python
"""
era5_land_mask_permafrost.py
Written by Tyler Sutterley (07/2026)
Creates a mask for ERA5-Land based on the permafrost/surface classification
from the NSIDC Circum-Arctic Map of Permafrost and Ground-Ice Conditions
1: Continuous Permafrost
2: Discontinuous Permafrost
3: Isolated P... | polargeodesy/model-harmonics | model_harmonics/TWS/era5_land_mask_permafrost.py | .py | 8045c78a47531518 | 7.62 | 16 |
#!/usr/bin/env python
"""
era5_land_mean_monthly.py
Written by Tyler Sutterley (04/2025)
Reads monthly ERA5-land datafiles to calculate multi-annual means of
terrestrial water storage from soil moisture, snow water equivalent
and total canopy storage
snow_depth_water_equivalent (sd)
snow_cover (snowc): 0 -- 100 percen... | polargeodesy/model-harmonics | model_harmonics/TWS/era5_land_mean_monthly.py | .py | 35996d488b6899db | 7.62 | 16 |
#!/usr/bin/env python
"""
era5_land_monthly_harmonics.py
Written by Tyler Sutterley (05/2023)
Reads monthly ERA5-Land total water storage anomalies and converts to
spherical harmonic coefficients
snow_depth_water_equivalent (sd)
snow_cover (snowc): 0 -- 100 percent
skin_reservoir_content (src)
volumetric_soil_wat... | polargeodesy/model-harmonics | model_harmonics/TWS/era5_land_monthly_harmonics.py | .py | 3060eac6cc71f372 | 7.62 | 16 |
#!/usr/bin/env python
"""
era5_land_read_monthly.py
Written by Tyler Sutterley (04/2025)
Reads monthly ERA5-land datafiles to calculate anomalies in
terrestrial water storage from soil moisture, snow water equivalent
and total canopy storage
snow_depth_water_equivalent (sd)
snow_cover (snowc): 0 -- 100 percent
skin_re... | polargeodesy/model-harmonics | model_harmonics/TWS/era5_land_read_monthly.py | .py | f073ecc69e9ba8f1 | 7.62 | 16 |
#!/usr/bin/env python
"""
gldas_mask_arctic.py
Written by Tyler Sutterley (07/2026)
Creates a mask for GLDAS data for Greenland, Svalbard, Iceland and the
Russian High Arctic defined by a set of shapefiles
https://ldas.gsfc.nasa.gov/gldas/vegetation-class-mask
COMMAND LINE OPTIONS:
-D X, --directory X: Wo... | polargeodesy/model-harmonics | model_harmonics/TWS/gldas_mask_arctic.py | .py | 6e05f39532e741ed | 7.62 | 16 |
#!/usr/bin/env python
"""
gldas_mask_permafrost.py
Written by Tyler Sutterley (07/2026)
Creates a mask for GLDAS data based on the permafrost/surface classification
from the NSIDC Circum-Arctic Map of Permafrost and Ground-Ice Conditions
1: Continuous Permafrost
2: Discontinuous Permafrost
3: Isolated Perm... | polargeodesy/model-harmonics | model_harmonics/TWS/gldas_mask_permafrost.py | .py | 31c7d58793efed33 | 7.62 | 16 |
#!/usr/bin/env python
"""
gldas_mask_vegetation.py
Written by Tyler Sutterley (07/2026)
Creates a mask for GLDAS data using the GLDAS vegetation type binary files
https://ldas.gsfc.nasa.gov/gldas/GLDASvegetation.php
https://ldas.gsfc.nasa.gov/gldas/vegetation-class-mask
COMMAND LINE OPTIONS:
-D X, --direc... | polargeodesy/model-harmonics | model_harmonics/TWS/gldas_mask_vegetation.py | .py | 30bf8d530b8661dd | 7.62 | 16 |
#!/usr/bin/env python
"""
gldas_mean_monthly.py
Written by Tyler Sutterley (09/2025)
Reads GLDAS monthly datafiles from http://ldas.gsfc.nasa.gov/gldas/
Adding Soil Moisture, snow water equivalent (SWE) and total canopy storage
Calculates the time-averaged grid from a determined range of years
Processes as described ... | polargeodesy/model-harmonics | model_harmonics/TWS/gldas_mean_monthly.py | .py | 1d703371c62157be | 7.62 | 16 |
#!/usr/bin/env python
"""
gldas_read_3hourly.py
Written by Tyler Sutterley (05/2026)
Reads GLDAS 3-hour datafiles from http://ldas.gsfc.nasa.gov/gldas/
Adding Soil Moisture, snow water equivalent (SWE) and total canopy storage
Calculates the 3-hourly anomaly in total water content on a daily basis
Processes as descri... | polargeodesy/model-harmonics | model_harmonics/TWS/gldas_read_3hourly.py | .py | ca2869d0e35a2015 | 7.62 | 16 |
#!/usr/bin/env python
"""
gldas_read_monthly.py
Written by Tyler Sutterley (09/2025)
Reads GLDAS monthly datafiles from http://ldas.gsfc.nasa.gov/gldas/
Adding Soil Moisture, snow water equivalent (SWE) and total canopy storage
Calculates the monthly anomaly in total water content
Processes as described on the GRACE ... | polargeodesy/model-harmonics | model_harmonics/TWS/gldas_read_monthly.py | .py | 4881547d63c9bf17 | 7.62 | 16 |
#!/usr/bin/env python
"""
ref_ellipsoid.py
Written by Tyler Sutterley (12/2022)
Computes parameters for a reference ellipsoid
CALLING SEQUENCE
wgs84 = ref_ellipsoid('WGS84', UNITS='MKS')
INPUT:
refell - reference ellipsoid name
CLK66 = Clarke 1866
GRS67 = Geodetic Reference System 1967 (IAU e... | polargeodesy/geoid-toolkit | geoid_toolkit/datum.py | .py | 8f175ad862270e48 | 7.65 | 19 |
"""
interpolate.py
Written by Tyler Sutterley (07/2026)
Routines to interpolate data from pre-computed spatial grids
PYTHON DEPENDENCIES:
numpy: Scientific Computing Tools For Python
https://www.numpy.org
netCDF4: Python interface to the netCDF C library
https://unidata.github.io/netcdf4-python... | polargeodesy/geoid-toolkit | geoid_toolkit/interpolate.py | .py | a59c0cf5c35f41b4 | 7.65 | 19 |
#!/usr/bin/env python
"""
read_ICGEM_harmonics.py
Written by Tyler Sutterley (08/2026)
Reads the coefficients for a given gravity model file
GFZ International Centre for Global Earth Models (ICGEM)
http://icgem.gfz-potsdam.de/
INPUTS:
model_file: full path to *.gfc file with spherical harmonic coefficients
O... | polargeodesy/geoid-toolkit | geoid_toolkit/read_ICGEM_harmonics.py | .py | c5020733441a63c3 | 7.65 | 19 |
#!/usr/bin/env python
"""
compute_geoid_grids.py
Written by Tyler Sutterley (06/2025)
Computes geoid undulations from a gravity model
COMMAND LINE OPTIONS:
-G X, --gravity X: Gravity model file to use (.gfc format)
-l X, --lmax X: maximum spherical harmonic degree (level of truncation)
-T X, --tide X: tide... | polargeodesy/geoid-toolkit | geoid_toolkit/scripts/compute_geoid_grids.py | .py | aac38ecce14f7c0f | 7.65 | 19 |
#!/usr/bin/env python
"""
compute_geoidal_undulation.py
Written by Tyler Sutterley (08/2026)
Computes geoid undulations from a gravity model for an input file
INPUTS:
csv file with columns for spatial and temporal coordinates
HDF5 file with variables for spatial and temporal coordinates
netCDF4 file with v... | polargeodesy/geoid-toolkit | geoid_toolkit/scripts/compute_geoidal_undulation.py | .py | ee6d54ccd87af7b4 | 7.65 | 19 |
#!/usr/bin/env python
"""
read_EGM2008_geoid_grids.py
Written by Tyler Sutterley (08/2026)
Reads EGM2008 geoid height spatial grids from unformatted binary files
provided by the National Geospatial-Intelligence Agency
Outputs spatial grids as netCDF4 files
NGA Office of Geomatics
https://earth-info.nga.mil/
I... | polargeodesy/geoid-toolkit | geoid_toolkit/scripts/read_EGM2008_geoid_grids.py | .py | fb2b7d2875a88fdc | 7.65 | 19 |
#!/usr/bin/env python
"""
read_ICGEM_geoid_grids.py
Written by Tyler Sutterley (08/2026)
Reads geoid height spatial grids from the GFZ Geoid Calculation Service
http://icgem.gfz-potsdam.de/home
Outputs spatial grids as netCDF4 files
INPUTS:
input geoid height spatial grids (*.gdf)
COMMAND LINE OPTIONS:
-F... | polargeodesy/geoid-toolkit | geoid_toolkit/scripts/read_ICGEM_geoid_grids.py | .py | 0a0c76f6466bc8b9 | 7.65 | 19 |
"""
test_interpolate.py
"""
import pytest
import netCDF4
import numpy as np
import scipy.interpolate
import geoid_toolkit as geoidtk
# parametrize over interpolation methods
@pytest.mark.parametrize('method', ['linear', 'nearest'])
def test_interpolate_geoid(method, model='EGM2008'):
# create a simple grid
d... | polargeodesy/geoid-toolkit | test/test_interpolate.py | .py | d326699ae95f26b1 | 7.15 | 19 |
# Copyright 2020 Microsoft Corporation
#
# 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... | Azure/LinuxPatchExtension | src/core/src/bootstrap/Constants.py | .py | 308dae0b03572ad8 | 7.56 | 12 |
# Copyright 2020 Microsoft Corporation
#
# 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... | Azure/LinuxPatchExtension | src/core/src/bootstrap/Container.py | .py | 840faa76280b946b | 7.56 | 12 |
# Copyright 2020 Microsoft Corporation
#
# 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... | Azure/LinuxPatchExtension | src/core/src/core_logic/MaintenanceWindow.py | .py | 7d7cc81c5af4b8b8 | 7.56 | 12 |
# Copyright 2023 Microsoft Corporation
#
# 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... | Azure/LinuxPatchExtension | src/core/src/core_logic/Stopwatch.py | .py | 8341068313244074 | 7.56 | 12 |
# Copyright 2021 Microsoft Corporation
#
# 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... | Azure/LinuxPatchExtension | src/core/src/core_logic/SystemctlManager.py | .py | 93840b943d4af3e8 | 7.56 | 12 |
# Copyright 2020 Microsoft Corporation
#
# 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... | Azure/LinuxPatchExtension | src/core/src/local_loggers/CompositeLogger.py | .py | bed7af1f891b07db | 7.56 | 12 |
# Copyright 2020 Microsoft Corporation
#
# 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... | Azure/LinuxPatchExtension | src/core/src/local_loggers/FileLogger.py | .py | 1eb25d084ee64d61 | 7.56 | 12 |
# Copyright 2025 Microsoft Corporation
#
# 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... | Azure/LinuxPatchExtension | src/core/src/package_managers/AzL3TdnfPackageManager.py | .py | 0255a609970c4dc8 | 7.56 | 12 |
# Copyright 2023 Microsoft Corporation
#
# 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... | Azure/LinuxPatchExtension | src/core/src/package_managers/UbuntuProClient.py | .py | a0a50e5ec0624abe | 7.56 | 12 |
# Copyright 2020 Microsoft Corporation
#
# 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... | Azure/LinuxPatchExtension | src/core/src/service_interfaces/LifecycleManager.py | .py | cf7711fc09013eb0 | 7.56 | 12 |
# Copyright 2021 Microsoft Corporation
#
# 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... | Azure/LinuxPatchExtension | src/core/src/service_interfaces/LifecycleManagerArc.py | .py | 8ef83e50b531d0a8 | 7.56 | 12 |
# Copyright 2020 Microsoft Corporation
#
# 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... | Azure/LinuxPatchExtension | src/core/src/service_interfaces/LifecycleManagerAzure.py | .py | 0c4e636296318f6c | 7.56 | 12 |
# Copyright 2025 Microsoft Corporation
#
# 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... | Azure/LinuxPatchExtension | src/core/tests/Test_AzL3TdnfPackageManager.py | .py | 1c724d98d621fe2b | 8.06 | 12 |
# Copyright 2020 Microsoft Corporation
#
# 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... | Azure/LinuxPatchExtension | src/core/tests/Test_Bootstrapper.py | .py | f02b8516ca219b1f | 8.06 | 12 |
# Copyright 2020 Microsoft Corporation
#
# 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... | Azure/LinuxPatchExtension | src/core/tests/Test_ConfigurationFactory.py | .py | e85e7e5cd284c675 | 7.06 | 12 |
# SPDX-FileCopyrightText: 2026 Ted Timmons
#
# SPDX-License-Identifier: MIT
"""Test harness reproducing adafruit/Adafruit_CircuitPython_NTP issue #35.
Issue #35: `OverflowError: overflow converting long int to machine word` raised
from `NTP.datetime`. Root cause reported by the filer: the NTP response packet
came bac... | adafruit/Adafruit_CircuitPython_NTP | tests/harness.py | .py | d171e1a759073c2a | 8.06 | 12 |
# SPDX-FileCopyrightText: 2026 Ted Timmons
#
# SPDX-License-Identifier: MIT
"""How far ahead the next sync is scheduled, given the server's poll byte.
The poll field is a single byte taken straight off the wire and used as
`2**poll` seconds until the next sync. RFC 5905 constrains it to
NTP_MINPOLL..NTP_MAXPOLL, but ... | adafruit/Adafruit_CircuitPython_NTP | tests/test_poll_interval.py | .py | e4e688a018faae2b | 8.06 | 12 |
# SPDX-FileCopyrightText: 2026 Ted Timmons
#
# SPDX-License-Identifier: MIT
"""Real-socket tests for issue #35.
test_response_validation.py drives the library through a fake socketpool. These tests use
CPython's actual UDP sockets against a local fake server, to show the two
mechanisms are real socket behaviour and n... | adafruit/Adafruit_CircuitPython_NTP | tests/test_real_sockets.py | .py | 95b1cbb521f51148 | 8.06 | 12 |
package ca.bc.gov.CFMS_java_poc;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public ... | bcgov/GDX-Analytics | examples/CFMS_java_poc/src/test/java/ca/bc/gov/CFMS_poc/AppTest.java | .java | 4dc96291ac0aa873 | 7.04 | 11 |
# -*- coding: utf-8 -*-
''' App Creation
'''
import os
import logging
import atexit
from flask import Flask
from flaskr import dynatrace
from flaskr.dynatrace_middleware import DynatraceWSGIMiddleware
def create_app(test_config=None):
"""Create and configure an instance of the Flask application."""
# init... | Dynatrace/snippets | technologies/python/flask/flaskr/__init__.py | .py | aeb4c74e6d6a47f9 | 7.6 | 15 |
# -*- coding: utf-8 -*-
''' Authentication
'''
import functools
from flask import Blueprint, flash, g, redirect, render_template, request, session, url_for
from werkzeug.security import check_password_hash, generate_password_hash
from flaskr.db import get_db
from flaskr.dynatrace import getdbinfo, getsdk
bp = Blu... | Dynatrace/snippets | technologies/python/flask/flaskr/auth.py | .py | 54daee5510ee298f | 7.6 | 15 |
# -*- coding: utf-8 -*-
''' Blog Implementation
'''
import time
import requests
from flask import Blueprint, flash, g, redirect, render_template, request, url_for
from werkzeug.exceptions import abort
from flaskr.auth import login_required
from flaskr.db import get_db
from flaskr.dynatrace import getdbinfo, getsdk,... | Dynatrace/snippets | technologies/python/flask/flaskr/blog.py | .py | 4c1dd1e3118671b1 | 7.6 | 15 |
# -*- coding: utf-8 -*-
''' Database
'''
import sqlite3
import click
from flask import current_app, g
from flask.cli import with_appcontext
def get_db():
"""Connect to the application's configured database. The connection
is unique for each request and will be reused if this is called
again.
"""
... | Dynatrace/snippets | technologies/python/flask/flaskr/db.py | .py | 248a85b2e339f3d6 | 7.6 | 15 |
# -*- coding: utf-8 -*-
#
# Copyright 2019 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 l... | Dynatrace/snippets | technologies/python/flask/flaskr/dynatrace.py | .py | 6676c47f1732cd40 | 7.6 | 15 |
#
# Copyright 2019 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 writi... | Dynatrace/snippets | technologies/python/flask/flaskr/dynatrace_middleware.py | .py | 5edb86a2b76d3e50 | 7.6 | 15 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019, 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 ... | Dynatrace/snippets | technologies/varnish/monitor-varnish-cache/varnish_metrics.py | .py | f98525d44b935834 | 7.6 | 15 |
# Copyright 2021 Canonical Ltd.
# See LICENSE file for licensing details.
"""# Alertmanager library.
This library is designed to be used by a charm consuming or providing the `alertmanager_dispatch`
relation interface.
This library is published as part of the
[Alertmanager charm](https://charmhub.io/alertmanager-k8s... | canonical/alertmanager-k8s-operator | lib/charms/alertmanager_k8s/v1/alertmanager_dispatch.py | .py | 82d0de7b4350d795 | 7.42 | 6 |
# Copyright 2021 Canonical Ltd.
# See LICENSE file for licensing details.
"""# Karma library.
This library is designed to be used by a charm consuming or providing the karma-dashboard relation.
This library is published as part of the [Karma charm](https://charmhub.io/karma-k8s).
You can file bugs [here](https://git... | canonical/alertmanager-k8s-operator | lib/charms/karma_k8s/v0/karma_dashboard.py | .py | 2c174445313956b4 | 7.42 | 6 |
#!/usr/bin/env python3
# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.
"""Workload manager for alertmanaqger."""
import logging
import os
import re
from typing import Callable, Dict, List, Optional, Tuple
from cosl import JujuTopology
from ops.framework import Object
from ops.model import C... | canonical/alertmanager-k8s-operator | src/alertmanager.py | .py | 7b8eaf7c345d3d79 | 7.42 | 6 |
#!/usr/bin/env python3
# Copyright 2021 Canonical Ltd.
# See LICENSE file for licensing details.
"""Client library for Alertmanager API."""
import json
import logging
import ssl
import time
import urllib.error
import urllib.parse
import urllib.request
from datetime import datetime
from typing import Optional
import ... | canonical/alertmanager-k8s-operator | src/alertmanager_client.py | .py | 917f892392b1a4dd | 7.42 | 6 |
# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.
"""Config builder for charmed alertmanager."""
import logging
from dataclasses import dataclass
from typing import Optional
from urllib.parse import urlparse
import yaml
logger = logging.getLogger(__name__)
class ConfigError(Exception):
... | canonical/alertmanager-k8s-operator | src/config_builder.py | .py | 3c32f68b416865fa | 7.42 | 6 |
#!/usr/bin/env python3
# Copyright 2021 Canonical Ltd.
# See LICENSE file for licensing details.
import os
import socket
import subprocess
from pathlib import Path
import pytest
PYTEST_HTTP_SERVER_PORT = 8000
@pytest.fixture(scope="session")
def httpserver_listen_address():
s = socket.socket(socket.AF_INET, so... | canonical/alertmanager-k8s-operator | tests/integration/conftest.py | .py | 081eca36e9c1e526 | 7.92 | 6 |
#!/usr/bin/env python3
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.
"""A Charm to functionally test the Alertmanager Operator."""
import logging
import typing
from charms.alertmanager_k8s.v0.alertmanager_remote_configuration import (
ConfigReadError,
RemoteConfigurationProvider,
... | canonical/alertmanager-k8s-operator | tests/integration/remote_configuration_tester/src/charm.py | .py | ef18626b5491c086 | 7.92 | 6 |
#!/usr/bin/env python3
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.
"""Integration tests: Alertmanager pod deletion resilience."""
import logging
import subprocess
from pathlib import Path
import jubilant
import pytest
from helpers import ALERTMANAGER_IMAGE, is_alertmanager_up
logger = ... | canonical/alertmanager-k8s-operator | tests/integration/test_kubectl_delete.py | .py | 96c2234df15c2a19 | 7.92 | 6 |
#!/usr/bin/env python3
# Copyright 2026 Canonical Ltd.
# See LICENSE file for licensing details.
"""Integration tests for the logging (log forwarding) relation."""
import logging
from pathlib import Path
import jubilant
import pytest
import requests
from helpers import ALERTMANAGER_IMAGE, get_unit_address
from tenac... | canonical/alertmanager-k8s-operator | tests/integration/test_logging.py | .py | 5e64d1a84c3065ba | 7.92 | 6 |
#!/usr/bin/env python3
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.
"""Integration tests: silence persistence across charm upgrades."""
import logging
from datetime import datetime, timedelta, timezone
from pathlib import Path
import jubilant
import pytest
from helpers import get_unit_ad... | canonical/alertmanager-k8s-operator | tests/integration/test_persistence.py | .py | e18c8d45bce2f475 | 7.92 | 6 |
#!/usr/bin/env python3
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.
"""This test module tests remote configuration support in Alertmanager.
0. Deploy `alertmanager-k8s` and `remote-configuration-tester`.
1. Create `remote-configuration` relation.
2. Verify that the configuration provided ... | canonical/alertmanager-k8s-operator | tests/integration/test_remote_configuration.py | .py | e4c6a26813e017c2 | 7.92 | 6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.