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 |
|---|---|---|---|---|---|---|
"""
IIB module for building a file based catalog for a bundle
"""
import argparse
import logging
import os
import time
from datetime import datetime, timedelta
from typing import Any, Dict, List, Tuple, Optional
from operatorcert import iib, utils
from operatorcert.logger import setup_logger
from operatorcert.utils i... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/add_fbc_fragments_to_index.py | .py | 94be88800bb0b583 | 7.63 | 17 |
"""Configure test suite for given operator by adding/removing labels"""
import argparse
import logging
import os
import re
from typing import Any, Dict
from github import Auth, Github
from operatorcert.github import add_or_remove_labels
from operatorcert.logger import setup_logger
from operatorcert.utils import get_r... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/apply_test_waivers.py | .py | 4fcf06a3697c4505 | 8.13 | 17 |
"""Create a fragment image dockerfile and build fragment image."""
import argparse
import json
import logging
import shutil
import tempfile
from pathlib import Path
from operatorcert import buildah, opm
from operatorcert.logger import setup_logger
from operatorcert.utils import SplitArgs
LOGGER = logging.getLogger("... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/build_fragment_images.py | .py | d6d988d0f8a426f2 | 7.63 | 17 |
"""Create a catalog image dockerfile and build catalog image."""
import argparse
import logging
import os
import tempfile
from pathlib import Path
from typing import Any
import yaml
from operatorcert import buildah, opm
from operatorcert.logger import setup_logger
from operatorcert.operator_repo import Bundle, Repo
... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/build_scratch_catalog.py | .py | 0ca452af59144f31 | 7.63 | 17 |
#!/usr/bin/env python3
"""
Perform bulk re-triggering of an operator pipeline on a given list of PRs.
The re-triggering of the pipeline against a PR is performed by applying the
appropriate label to the PR and waiting for the pipeline to apply a success
or failure label.
The list of PRs to process must be provided in... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/bulk_retrigger.py | .py | 07a05ab26146f35a | 7.63 | 17 |
"""Check certification project identifiers for affected operators."""
import argparse
import logging
import sys
from pathlib import Path
from operatorcert.logger import setup_logger
from operatorcert.operator_repo.utils import load_yaml
from operatorcert.utils import SplitArgs
LOGGER = logging.getLogger("operator-ce... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/certification_project_check.py | .py | 0d45331eebe70072 | 7.63 | 17 |
"""
The CLI interface for uploading files to Github gists.
"""
import argparse
import json
import logging
import os
import urllib
from pathlib import Path
from typing import Any, List, Iterator
from github import Auth, Gist, Github, InputFileContent, IssueComment
from operatorcert.logger import setup_logger
from oper... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/create_github_gist.py | .py | 95aa7ae7c975af28 | 7.63 | 17 |
"""Download the test results and logs from the CI pipeline."""
import argparse
from operatorcert import download_test_results
from operatorcert.logger import setup_logger
from operatorcert.utils import store_results
def setup_argparser() -> argparse.ArgumentParser: # pragma: no cover
"""
Setup argument par... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/download_test_results.py | .py | 34f6939de2e59c2d | 8.13 | 17 |
"""Onboard operator to File-based catalog (FBC) migration tool"""
import argparse
import logging
import os
from typing import Any, Dict, Optional
import requests
import yaml
from operatorcert.logger import setup_logger
from operatorcert.operator_repo import Operator, Repo
from operatorcert.operator_repo.exceptions im... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/fbc_onboarding.py | .py | 655df2a8f7a86639 | 7.63 | 17 |
"""Get the Certification Project related data"""
import argparse
import logging
from urllib.parse import urljoin
from operatorcert import pyxis
from operatorcert.logger import setup_logger
from operatorcert.utils import store_results
LOGGER = logging.getLogger("operator-cert")
def setup_argparser() -> argparse.Arg... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/get_cert_project_related_data.py | .py | 1f9ccd939827677b | 7.63 | 17 |
"""
Script for adding a comment to a pull request or an issue.
It can take either a filename or a comment as input and can
post the comment back to GitHub accordingly.
"""
import argparse
import logging
import sys
import urllib.parse
from requests import HTTPError
from operatorcert import github
from operatorcert.log... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/github_add_comment.py | .py | 81f2ac97e4bc3a28 | 7.63 | 17 |
"""
Script for editing a labels in a pull request.
"""
import argparse
import logging
import os
from github import Auth, Github
from operatorcert.github import add_or_remove_labels
from operatorcert.logger import setup_logger
LOGGER = logging.getLogger("operator-cert")
def setup_argparser() -> argparse.ArgumentPar... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/github_labels.py | .py | bd4baae6cd88dc48 | 7.63 | 17 |
"""
CLI utility to wait on pull request labels conditionally.
"""
import argparse as ap
import logging
import os
import re
import sys
import time
from enum import Enum
from github import Auth, Github
from github.GithubException import GithubException
from github.PullRequest import PullRequest
from github.Repository i... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/github_wait_labels.py | .py | 0c052825e7437bec | 7.63 | 17 |
"""Hydra checklist entrypoint""" ""
import argparse
import logging
import sys
from typing import Any, Dict
from operatorcert import hydra
from operatorcert.logger import setup_logger
LOGGER = logging.getLogger("operator-cert")
def setup_argparser() -> Any: # pragma: no cover
"""
Setup argument parser
... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/hydra_checklist.py | .py | 38ddf81791e05063 | 7.63 | 17 |
"""
IIB module for building a index images for a bundle
"""
import argparse
import logging
import os
from typing import Any, Dict, List, Optional
from operatorcert import iib, utils
from operatorcert.logger import setup_logger
LOGGER = logging.getLogger("operator-cert")
def setup_argparser() -> argparse.ArgumentPa... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/index.py | .py | 6d4b549f6befc1a4 | 7.63 | 17 |
"""
Integration tests for the operator-pipelines project
"""
import argparse
import logging
import sys
from pathlib import Path
from operatorcert.integration.runner import run_integration_tests
LOGGER = logging.getLogger("operator-cert")
def parse_args() -> argparse.Namespace:
"""
Parse command line argume... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/integration_tests.py | .py | d1fbfd4117f0a112 | 8.13 | 17 |
"""
Tool automating invalidation of older versions of Preflight in Pyxis based on
rules in https://issues.redhat.com/browse/ISV-4964.
"""
from datetime import datetime, timedelta
from typing import Any
import sys
import argparse as ap
from dataclasses import dataclass
import urllib.parse
import json
import logging
imp... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/invalidate_preflight_versions.py | .py | ae0474ec712ccfe1 | 7.63 | 17 |
"""Link pull request to test results"""
import argparse
import logging
from typing import Any
from urllib.parse import urljoin
from operatorcert import pyxis
from operatorcert.logger import setup_logger
LOGGER = logging.getLogger("operator-cert")
def setup_argparser() -> Any: # pragma: no cover
"""
Setup ... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/link_pull_request.py | .py | ba62cd6fb2058e8b | 7.63 | 17 |
"""OpenShift version info entrypoint."""
import argparse
import json
import logging
import pathlib
from operatorcert import ocp_version_info
from operatorcert.logger import setup_logger
from operatorcert.operator_repo import Repo
LOGGER = logging.getLogger("operator-cert")
def setup_argparser() -> argparse.Argumen... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/ocp_version_info.py | .py | d14024e68d06ac96 | 7.63 | 17 |
"""Generate a markdown summary for a Tekton PipelineRun."""
import argparse
import logging
from typing import Any
from operatorcert.logger import setup_logger
from operatorcert.tekton import PipelineRun
LOGGER = logging.getLogger("operator-cert")
def parse_args() -> Any: # pragma: no cover
"""
Create an a... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/pipelinerun_summary.py | .py | 6d3c4715ec34d5f0 | 7.63 | 17 |
"""Parse and filter preflight results for community."""
import argparse
import json
import logging
from typing import Any, Dict, List, Optional
from operatorcert.logger import setup_logger
from operatorcert.operator_repo import Repo as OperatorRepo
from operatorcert.utils import SplitArgs
LOGGER = logging.getLogger(... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/preflight_result_filter.py | .py | f390bc9f9b574f69 | 7.63 | 17 |
"""Publish image and related collections in Pyxis"""
import argparse
import logging
import sys
from typing import Any
from operatorcert import pyxis
from operatorcert.logger import setup_logger
LOGGER = logging.getLogger("isv-sre-tools")
def setup_argparser() -> Any:
"""
Setup argument parser for this scri... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/publish_pyxis_image.py | .py | 91473b44e03605d6 | 7.63 | 17 |
"""Reserve operator name for given combination of association and operator name"""
import argparse
import logging
import sys
from typing import Any
from urllib.parse import urljoin
from operatorcert import pyxis
from operatorcert.logger import setup_logger
LOGGER = logging.getLogger("operator-cert")
def setup_argp... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/reserve_operator_name.py | .py | e8a4477b9028d203 | 7.63 | 17 |
"""
IIB module for removing operators from an index images
"""
import argparse
import logging
import os
from typing import Any, Dict, List, Optional
from operatorcert import iib, utils
from operatorcert.logger import setup_logger
LOGGER = logging.getLogger("operator-cert")
def setup_argparser() -> argparse.Argumen... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/rm_operator_from_index.py | .py | 29944463c59cbde7 | 7.63 | 17 |
"""
Script for setting the cert project status
"""
import argparse
import logging
from typing import Any
from urllib.parse import urljoin
from operatorcert import pyxis
from operatorcert.logger import setup_logger
LOGGER = logging.getLogger("operator-cert")
def setup_argparser() -> argparse.ArgumentParser: # prag... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/set_cert_project_repository.py | .py | 0f12386dc36f98c3 | 7.63 | 17 |
"""Set github status for a commit"""
import argparse
import logging
from typing import Any
from urllib.parse import urljoin
from operatorcert import get_repo_and_org_from_github_url, github
from operatorcert.logger import setup_logger
LOGGER = logging.getLogger("operator-cert")
def setup_argparser() -> argparse.Ar... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/set_github_status.py | .py | b33aa117bc0ae251 | 7.63 | 17 |
"""Static test for operator bundle."""
import argparse
import json
import logging
from typing import Any, Dict, List, Optional
from operatorcert.logger import setup_logger
from operatorcert.operator_repo import OperatorCatalogList, Repo
from operatorcert.operator_repo.checks import Fail, run_suite
from operatorcert.u... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/static_tests.py | .py | 0fb26c652d4605de | 8.13 | 17 |
"""
Script for updating the cert project status
"""
import argparse
import logging
from datetime import datetime, timezone
from typing import Any
from urllib.parse import urljoin
from operatorcert import pyxis
from operatorcert.logger import setup_logger
from operatorcert.utils import store_results
LOGGER = logging.... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/update_cert_project_status.py | .py | 1fcd637f1b89140a | 7.63 | 17 |
"""Upload artifacts to Pyxis API"""
import argparse
import base64
import json
import logging
import os
from pathlib import Path
from typing import Any, Dict, List
from urllib.parse import urljoin
import magic
from operatorcert import pyxis
from operatorcert.logger import setup_logger
from operatorcert.redact import s... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/upload_artifacts.py | .py | 5c62396a8bf5f032 | 7.63 | 17 |
"""Upload signature to Pyxis"""
import argparse
import json
import logging
from typing import Any
from urllib.parse import urljoin, urlparse
from requests.exceptions import HTTPError
from operatorcert import pyxis
from operatorcert.logger import setup_logger
LOGGER = logging.getLogger("operator-cert")
def setup_a... | redhat-openshift-ecosystem/operator-pipelines | operatorcert/entrypoints/upload_signature.py | .py | b41804569bd06cf8 | 7.63 | 17 |
"""
Pay to conditions
In this puzzle program, the solution is ignored. The reveal of the puzzle
returns a fixed list of conditions. This roughly corresponds to OP_SECURETHEBAG
in bitcoin.
This is a pretty useless most of the time. But some (most?) solutions
require a delegated puzzle program, so in those cases, this ... | Chia-Network/hsms | hsms/puzzles/p2_conditions.py | .py | 176f16be1249fd63 | 7.48 | 8 |
from dataclasses import dataclass
from types import GenericAlias
from typing import (
Callable,
get_origin,
get_args,
Optional,
Type,
TypeVar,
Generic,
)
Gtype = type | GenericAlias
T = TypeVar("T")
SimpleTypeLookup = dict[Type, T]
CompoundLookup = dict[Type, Callable[[Type, tuple[Type, .... | Chia-Network/hsms | hsms/util/type_tree.py | .py | b2a13b79d1116792 | 7.48 | 8 |
from typing import Any, Callable, Dict, List, Tuple, TypeVar
from clvm_rs import Program
K = TypeVar("K")
T = TypeVar("T")
V = TypeVar("V")
def transform_dict(program, dict_transformer_f):
"""
Transform elements of the dict d using the xformer (also a dict,
where the keys match the keys in d and the va... | Chia-Network/hsms | tests/legacy/clvm_serialization.py | .py | 8560348327aa20ad | 7.98 | 8 |
import zlib
from tests.generate import se_generate, bytes32_generate, uint256_generate
from chia_base.core import Coin, CoinSpend, SpendBundle
from chia_base.cbincode.util import from_bytes, to_bytes
from hsms.core.signing_hints import SumHint, PathHint
from hsms.core.unsigned_spend import UnsignedSpend
from hsms.de... | Chia-Network/hsms | tests/test_lifecycle.py | .py | 9b3aa2e8fdced71a | 7.98 | 8 |
#!/usr/bin/env runaiida
import sys
import time
#from re import S
from aiida.plugins import DataFactory, WorkflowFactory
#!/usr/bin/env runaiida
from aiida import orm
from aiida.engine import submit
from aiida_common_workflows.common import ElectronicType, RelaxType, SpinType
from aiida_common_workflows.plugins import... | aiidateam/acwf-verification-scripts | 2-submit/launch_calculations_qe.py | .py | b33fcf8e03000722 | 7.52 | 10 |
#!/usr/bin/env runaiida
# The version of the script will be placed in the json file containing the results.
# We should change this number anytime this script or `eos_utils.eosfit_31_adapted` is modified.
import sys
import json
import os
import tqdm
import numpy as np
from collections import Counter
from eos_utils.e... | aiidateam/acwf-verification-scripts | 3-analyze/get_results.py | .py | ebe502c463d2d177 | 7.52 | 10 |
#!/usr/bin/env python
import json
import os
import sys
import numpy as np
import pylab as pl
import tqdm
from quantities_for_comparison import birch_murnaghan, get_volume_scaling_to_formula_unit
def get_plugin_name():
file_name = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
os.pardi... | aiidateam/acwf-verification-scripts | 3-analyze/outputs/generate_plots.py | .py | 8b9311fd88bcfb58 | 7.52 | 10 |
import numpy as np
def get_num_atoms_in_formula_unit(configuration):
"""Return the number ot atoms per formula unit.
For unaries, it's the number in the primitive cell: 1 for SC, BCC, FCC; 2 for diamond.
"""
mapping = {
'XO': 2,
'XO2': 3,
'X2O': 3,
'X2O3': 5,
'X... | aiidateam/acwf-verification-scripts | 3-analyze/outputs/quantities_for_comparison.py | .py | b25f65cfc95c58e8 | 7.52 | 10 |
#!/usr/bin/env python
import json
import os
import sys
import numpy as np
import pylab as pl
from scipy.optimize import curve_fit
import tqdm
import acwf_paper_plots.quantities_for_comparison as qc
# Adapt this factor to change the zoom on the x axis
# The default zoom is obtained from the standard deviation of the ... | aiidateam/acwf-verification-scripts | acwf_paper_plots/plots/main/histograms_ae_codes/generate_paper_histos_ae_all_materials.py | .py | 67f40480ae1a7754 | 7.52 | 10 |
#!/usr/bin/env python
import json
import os
import sys
import numpy as np
import pylab as pl
import tqdm
from acwf_paper_plots.eosfit_31_adapted import BM, echarge
from acwf_paper_plots.quantities_for_comparison import birch_murnaghan
EXPECTED_SCRIPT_VERSION = '0.0.3'
RESIDUALS_THRESHOLD = 1.e-3
DATA_FOLDER = "../... | aiidateam/acwf-verification-scripts | acwf_paper_plots/plots/supplementary/TS_contribution_fleur/generate_TS_plots.py | .py | eae32ff62297f103 | 7.52 | 10 |
"""
Created by Temuulen
Everything about managing Projects
"""
import json
import os
import sqlite3
import tempfile
from datetime import datetime
from pathlib import Path
from flask import Blueprint
from flask import current_app as app
from flask import jsonify, request
bp = Blueprint("projects", __name__)
@bp.rou... | aewindle110/DroneWQ | app/backend/projects.py | .py | 4f26539de38215c2 | 7.59 | 14 |
#!/usr/bin/env python3
"""
Post-process Sphinx documentation after apidoc generation.
This script:
1. Removes micasense references from RST files
2. Removes empty 'Module contents' sections
3. Copies processed files to docs/source/api/ for building
"""
import re
import shutil
from pathlib import Path
PRIMARY_DEMO_FI... | aewindle110/DroneWQ | docs/post_process_docs.py | .py | 73fded4017e3e138 | 7.59 | 14 |
import logging
import multiprocessing as mp
from concurrent.futures import ProcessPoolExecutor
from pathlib import Path
from tqdm import tqdm
from dronewq.lw_methods.blackpixel import Blackpixel
from dronewq.lw_methods.mobley_rho import Mobley_rho
from dronewq.masks.std_masking import StdMasking
from dronewq.masks.th... | aewindle110/DroneWQ | src/dronewq/core/pipeline.py | .py | ac76c4210770a050 | 7.59 | 14 |
import contextily as cx
import numpy as np
import rasterio
import rasterio.transform
from cartopy.mpl.gridliner import LATITUDE_FORMATTER, LONGITUDE_FORMATTER
from matplotlib.axes import Axes
from matplotlib.image import AxesImage
from pyproj import Transformer
from rioxarray import open_rasterio
from xyzservices impor... | aewindle110/DroneWQ | src/dronewq/core/plot_map.py | .py | 1b71eb61181e7e3f | 7.59 | 14 |
import concurrent.futures
import logging
import multiprocessing as mp
from functools import partial
from pathlib import Path
import numpy as np
import rasterio
from rasterio.windows import Window
from tqdm import tqdm
from dronewq.utils.settings import settings
from dronewq.utils.utils import get_sorted_filepaths
lo... | aewindle110/DroneWQ | src/dronewq/core/wq_calc.py | .py | 93e632ecc73a34ca | 7.59 | 14 |
import logging
import os
import numpy as np
import pandas as pd
from dronewq.micasense import imageset
from dronewq.utils.data_types import Base_Compute_Method, Image
from dronewq.utils.settings import settings
logger = logging.getLogger(__name__)
class Panel_ed(Base_Compute_Method):
"""
Calculate remote s... | aewindle110/DroneWQ | src/dronewq/ed_methods/panel_ed.py | .py | 974382ec72c751b5 | 7.59 | 14 |
import logging
import random
from pathlib import Path
import numpy as np
import rasterio
from numpy.polynomial import Polynomial
from dronewq.utils.data_types import Base_Compute_Method, Image
from dronewq.utils.settings import settings
logger = logging.getLogger(__name__)
BANDS = 5
class Hedley(Base_Compute_Meth... | aewindle110/DroneWQ | src/dronewq/lw_methods/hedley.py | .py | 43da668297e15cee | 7.59 | 14 |
import logging
from pathlib import Path
import numpy as np
from dronewq.utils.data_types import Base_Compute_Method, Image
from dronewq.utils.images import load_imgs
logger = logging.getLogger(__name__)
class StdMasking(Base_Compute_Method):
"""
Mask sun glint pixels using statistical threshold based on NI... | aewindle110/DroneWQ | src/dronewq/masks/std_masking.py | .py | acc415be17309444 | 7.59 | 14 |
import logging
import numpy as np
from dronewq.utils.data_types import Base_Compute_Method, Image
logger = logging.getLogger(__name__)
class ThresholdMasking(Base_Compute_Method):
"""
Mask contaminated pixels using fixed reflectance thresholds.
This function identifies and masks pixels contaminated by... | aewindle110/DroneWQ | src/dronewq/masks/threshold_masking.py | .py | adead28f852cc4a0 | 7.59 | 14 |
# ruff: noqa: T201 (print)
# ruff: noqa: S603 (untrusted subprocess input)
# ruff: noqa: PYI024 (typing.NamedTuple instead of collections)
# """Make a bash script to copy the files across to S3"""
import csv
import json
import re
import subprocess
import sys
from collections import Counter, namedtuple
from pathlib i... | nationalarchives/ds-find-caselaw-docs | utilities/spreadsheet_docx/copy_from_bailii_s3.py | .py | b3f11fbf88398a5b | 7.62 | 16 |
# 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, software
# distributed under the... | stackmon/cloudmon | cloudmon/cli/combined.py | .py | 0941361aa3898aa5 | 7.5 | 9 |
# 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, software
# distributed under the... | stackmon/cloudmon | cloudmon/cli/epmon.py | .py | 2eb1eb0508ba845d | 7.5 | 9 |
# 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, software
# distributed under the... | stackmon/cloudmon | cloudmon/cli/globalmon.py | .py | 3fa74aa129aa6184 | 7.5 | 9 |
# 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, software
# distributed under the... | stackmon/cloudmon | cloudmon/cli/grafana.py | .py | fb082c30a0040a3a | 7.5 | 9 |
# 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, software
# distributed under the... | stackmon/cloudmon | cloudmon/plugin/epmon.py | .py | 3faf752cac182612 | 7.5 | 9 |
# 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, software
# distributed under the... | stackmon/cloudmon | cloudmon/service/status_dashboard.py | .py | 3d533187eb3a8d10 | 7.5 | 9 |
# -*- coding: utf-8 -*-
# Copyright 2010-2011 OpenStack Foundation
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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
#
# htt... | stackmon/cloudmon | cloudmon/tests/unit/base.py | .py | a74918409db446b5 | 8 | 9 |
# 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, software
# distributed under the... | stackmon/cloudmon | cloudmon/utils.py | .py | 593ae25e6eba14fe | 7.5 | 9 |
from __future__ import annotations
from urllib.parse import urlparse
from docutils import nodes
from sphinx.util.docutils import ReferenceRole
from sphinx_new_tab_link.core import add_icon_to_reference
class IconLinkRole(ReferenceRole):
"""Role to create a external link with an icon.
Of course, opened in ... | ftnext/sphinx-new-tab-link | src/sphinx_new_tab_link/roles.py | .py | 683b7c9db3dfebfe | 7.57 | 13 |
# https://github.com/ftnext/sphinx-new-tab-link/issues/11
import types
from sphinx.writers.html import HTMLTranslator
class StartTagMixin:
def starttag(self, *args, **kwargs):
return super().starttag(*args, **kwargs)
def setup(app):
app.set_translator("html", HTMLTranslator)
translator_class =... | ftnext/sphinx-new-tab-link | tests/roots/test-dynamic-class/extensions/custom_translator.py | .py | e168b1154e703f1d | 7.07 | 13 |
# imports
import os
import requests
from typing import List
# TODO: improve
from graphql_queries import *
# TODO: what is error handling?
# constants # TODO: move to a config file (or something) <= copilot suggested this last part
ORG = "dbt-labs"
PROJECT_NAME = "Core triage"
PROJECT_NUM = 22
# core team name
CORE_T... | dbt-labs/actions | scripts/core-triage/project.py | .py | d5aad9b6f54a79fa | 7.62 | 16 |
#
# SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0
#
"""Detect ARMv7 vs ARMv7 Legacy wheel basename clashes under a merged tree.
Used after downloading per-arch ``wheels-repaired-*`` artifacts into separate
subdirectories (``merge-multiple: false``). The same `... | espressif/idf-python-wheels | check_wheel_collisions.py | .py | fde8340da3c711a7 | 7.57 | 13 |
#!/usr/bin/env python3
#
# SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0
#
"""Download source distributions listed in sdist_requirements.txt into downloaded_wheels/."""
from __future__ import annotations
import subprocess
import sys
import tempfile
from path... | espressif/idf-python-wheels | download_sdists.py | .py | ff4d77fa87306cf1 | 7.57 | 13 |
#!/usr/bin/env python3
#
# SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0
#
"""Compute and emit sdist requirements for the Espressif PyPI simple index (PEP 503).
Packages in the assembled IDF dependency tree that have **no buildable wheel path** for **at least ... | espressif/idf-python-wheels | emit_sdist_requirements.py | .py | e829d6ec8729d020 | 7.57 | 13 |
#!/usr/bin/env python3
#
# SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0
#
"""Run native_import_guard.yaml import probes (used by cryptography spike / CI)."""
from __future__ import annotations
import argparse
import subprocess
import sys
from pathlib import... | espressif/idf-python-wheels | scripts/run_native_import_probe.py | .py | 7747b74a21fa6a0b | 7.57 | 13 |
# SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import json
import sys
from datetime import datetime
import requests
from dateutil.relativedelta import relativedelta
from _helper_functions import print_color
try:
IDF_VERSIONS_TXT = str(sys.argv[1])
excep... | espressif/idf-python-wheels | supported_versions.py | .py | 87b606b147a5b4ad | 7.57 | 13 |
#
# SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0
#
import tempfile
import unittest
from pathlib import Path
import check_wheel_collisions as cwc
class TestCheckWheelCollisions(unittest.TestCase):
def test_no_collision_unique_basenames(self) -> None:
... | espressif/idf-python-wheels | test_check_wheel_collisions.py | .py | fe9b18c65bf7dacf | 8.07 | 13 |
#
# SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import annotations
import tempfile
import unittest
from pathlib import Path
from unittest.mock import patch
from packaging.requirements import Requirement
from packaging.utils import canoni... | espressif/idf-python-wheels | test_emit_sdist_requirements.py | .py | 417d555002c0c47f | 8.07 | 13 |
#
# SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import annotations
import unittest
from _helper_functions import native_import_guard_by_name
class TestNativeImportGuard(unittest.TestCase):
def test_loads_cryptography_fallback(self) ... | espressif/idf-python-wheels | test_native_import_guard.py | .py | 46060596cf4a8238 | 7.07 | 13 |
#
# SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import annotations
import tempfile
import unittest
from pathlib import Path
from verify_s3_sdists import _load_requirement_lines
from verify_s3_sdists import verify_sdists_on_s3
class Tes... | espressif/idf-python-wheels | test_verify_s3_sdists.py | .py | 9e0b52bd8c509e59 | 7.07 | 13 |
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
"""
Test wheel installation script for CI workflows.
This script finds and installs wheels compatible with the current Python version,
verifying that wheel files are valid and platform-compa... | espressif/idf-python-wheels | test_wheels_install.py | .py | 005c930ad7c0601e | 8.07 | 13 |
#
# SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0
#
"""This script uploads wheel files from the downloaded wheels directory to S3 bucket.
- argument S3 bucket
"""
import os
import re
import sys
import boto3
from colorama import Fore
from _helper_functi... | espressif/idf-python-wheels | upload_wheels.py | .py | 4addd53d442dd533 | 7.57 | 13 |
#!/usr/bin/env python3
#
# SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0
#
"""Verify PEP 503 sdists exist on S3 for packages in sdist_requirements.txt."""
from __future__ import annotations
import re
import sys
from pathlib import Path
import boto3
from co... | espressif/idf-python-wheels | verify_s3_sdists.py | .py | 7ac627c4a8b129fe | 7.57 | 13 |
#
# SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0
#
"""Verify S3 wheels against exclude_list.yaml.
Checks all wheels on S3, extracting Python version from wheel filename
to evaluate python_version markers correctly.
"""
from __future__ import annotations
imp... | espressif/idf-python-wheels | verify_s3_wheels.py | .py | 59efc746b693d47a | 7.57 | 13 |
from datetime import datetime, timezone
from enum import Enum
from typing import Any, Dict, List, Optional, Tuple, Union
from pynamodb.attributes import Attribute, MapAttribute
from pynamodb.indexes import GlobalSecondaryIndex, LocalSecondaryIndex
from pynamodb.models import Model
from pynamodb_utils.attributes impor... | micmurawski/pynamodb-utils | src/pynamodb_utils/utils.py | .py | 332d0ab2abc83d63 | 7.45 | 7 |
"""This module provides access to remediated benchmark system inputs ready for use
with the OpenFE toolkit.
"""
from pathlib import Path
from dataclasses import dataclass
import yaml
import logging
# Get logger for this module - will inherit configuration from parent
logger = logging.getLogger(__name__)
__all__ = [
... | OpenFreeEnergy/openfe-benchmarks | openfe_benchmarks/data/_benchmark_systems.py | .py | 030c910fcf6f8a5f | 7.57 | 13 |
import io
import json
import pathlib
import zipfile
import click
import pandas as pd
import requests
from gufe.tokenization import JSON_HANDLER
from openff.toolkit import Molecule
from openff.units import unit
# Experimental data from the SepTop SI on Zenodo.
BAUMANN_ET_AL_DOI = "https://doi.org/10.1021/acs.jctc.3c00... | OpenFreeEnergy/openfe-benchmarks | openfe_benchmarks/data/data_generation/generate_septop_bace_ref_data.py | .py | a385eb6d6d600f6a | 7.57 | 13 |
import pathlib
import json
import bz2
from gufe.tokenization import JSON_HANDLER
from cinnabar import plotting
from openfe_benchmarks.scripts._results_utils import build_femap_from_relative_results
RESULTS_FILE = "../results/2026-03-18-openmm-840-qa-testing/computational_results.json"
OUTPUT_DIR = "outputs"
def _l... | OpenFreeEnergy/openfe-benchmarks | openfe_benchmarks/scripts/_example_plot_rbfe.py | .py | a22f3a79e3405ce9 | 7.57 | 13 |
"""Plot ASFEs, only for cinnabar >= 0.6.1, which is not compatible with current env"""
import pathlib
import json
import bz2
from gufe.tokenization import JSON_HANDLER
from cinnabar import plotting
from openfe_benchmarks.scripts._results_utils import build_femap_from_absolute_results
RESULTS_FILE = "../results/2026... | OpenFreeEnergy/openfe-benchmarks | openfe_benchmarks/scripts/_no_test_example_plot_asfe.py | .py | 4f51a8a1b943cae2 | 8.07 | 13 |
from collections import defaultdict
import json
import numpy as np
from gufe.tokenization import JSON_HANDLER
from openff.units import unit
from cinnabar import FEMap
from openfe_benchmarks.data._benchmark_systems import get_benchmark_data_system
def _asfe_result_key(result: dict) -> str:
"""Build a consistent ... | OpenFreeEnergy/openfe-benchmarks | openfe_benchmarks/scripts/_results_utils.py | .py | f72cfed71e8b7801 | 7.57 | 13 |
import json
import click
from gufe.tokenization import JSON_HANDLER
from gufe import AlchemicalNetwork, ProteinComponent
from openff.units import unit
import pathlib
from cinnabar import FEMap
from collections import defaultdict
import numpy as np
import zstandard as zstd
from openfecli.commands.gather import _get_name... | OpenFreeEnergy/openfe-benchmarks | openfe_benchmarks/scripts/generate_results_local.py | .py | 74b1e1ac579db145 | 7.57 | 13 |
import logging
from rdkit import Chem
from openff.toolkit.utils.toolkit_registry import ToolkitRegistry
from openff.toolkit.utils.toolkits import RDKitToolkitWrapper
import openfe
logger = logging.getLogger(__name__)
toolkit_registry = ToolkitRegistry([RDKitToolkitWrapper()])
def setup_file_logger(log_file, level=... | OpenFreeEnergy/openfe-benchmarks | openfe_benchmarks/scripts/utils.py | .py | 011331edc45fef63 | 7.57 | 13 |
"""
Tests for the benchmark systems module.
"""
import pytest
import json
import logging
from gufe.tokenization import JSON_HANDLER
from openff.units import unit
from openfe import ProteinComponent, LigandNetwork
from openfe_benchmarks.data import (
BenchmarkData,
BenchmarkIndex,
get_benchmark_data_syste... | OpenFreeEnergy/openfe-benchmarks | openfe_benchmarks/tests/test_benchmark_data.py | .py | ab5582a7e21d758d | 8.07 | 13 |
"""
Tests for BenchmarkIndex class and benchmark system validation.
"""
import pytest
from pathlib import Path
from openfe_benchmarks.data import (
BenchmarkIndex,
)
_BASE_DIR = Path(__file__).resolve().parent.parent / "data" / "benchmark_systems"
# Each entry is (tag, [candidate_files], [exceptions]).
# For ta... | OpenFreeEnergy/openfe-benchmarks | openfe_benchmarks/tests/test_benchmark_index.py | .py | d92f0123ec59825a | 8.07 | 13 |
"""
Import tests
"""
import sys
from pathlib import Path
def test_benchmark_imported():
"""Sample test, will always pass so long as import statement worked"""
assert "openfe_benchmarks" in sys.modules
def test_yaml_files_contain_no_todos():
"""Ensure no YAML files in the repository still contain TODO m... | OpenFreeEnergy/openfe-benchmarks | openfe_benchmarks/tests/test_import.py | .py | 0b59abf61a57c36b | 8.07 | 13 |
"""Run each `_example*.py` as a standalone script.
This test discovers example files in `openfe_benchmarks/scripts`, executes
each with `runpy.run_path(..., run_name="__main__")` in an isolated
process (120s timeout), and fails if the script raises or times out. The
test performs no output validation or cleanup.
"""
... | OpenFreeEnergy/openfe-benchmarks | openfe_benchmarks/tests/test_scripts.py | .py | 0d7bde561da79b36 | 8.07 | 13 |
"""API Utils module for commonmeta-py"""
from __future__ import annotations
from datetime import datetime as date
import jwt
import requests
from furl import furl
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
from .base_utils import dig
from .doi_utils import doi_a... | front-matter/commonmeta-py | commonmeta/api_utils.py | .py | 0b8c14d85af3143f | 7.65 | 19 |
"""Author utils module for commonmeta-py"""
from __future__ import annotations
import re
from nameparser import HumanName
from .base_utils import compact, parse_attributes, presence, scrub, unique, wrap
from .constants import (
COMMONMETA_CONTRIBUTOR_ROLES,
)
from .utils import (
first,
format_name_iden... | front-matter/commonmeta-py | commonmeta/author_utils.py | .py | 78f1956931955e96 | 7.65 | 19 |
"""Optional Rust backend for commonmeta-py.
The corpus-scale operations - bulk import of annual data files, the local SQLite
store, Parquet and archive output - are implemented in commonmeta-rs and exposed
through its PyO3 module, `commonmeta_rs`. None of them exist in pure Python.
They ship as an optional extra::
... | front-matter/commonmeta-py | commonmeta/backend.py | .py | b47d1e0890ad8c8b | 7.65 | 19 |
from __future__ import annotations
import importlib.metadata
import time
import click
import orjson as json
from commonmeta import Metadata, MetadataList # __version__
from commonmeta.api_utils import update_ghost_post_via_api
from commonmeta.backend import (
BACKEND_PYTHON_SUPPORTED,
BackendError,
requ... | front-matter/commonmeta-py | commonmeta/cli.py | .py | dd6ec0b71f5bd531 | 7.65 | 19 |
"""Date utils for commonmeta-py"""
from __future__ import annotations
import datetime
from datetime import datetime as dt
from edtf import Date, DateAndTime, parse_edtf
from edtf.parser.edtf_exceptions import EDTFParseException
from .base_utils import compact
def _dateparser():
"""dateparser, imported on firs... | front-matter/commonmeta-py | commonmeta/date_utils.py | .py | 14a1e099b65a295e | 7.65 | 19 |
"""Doi utils for commonmeta-py"""
from __future__ import annotations
import os
import re
import base32_lib as base32
import requests
from furl import furl
from .backend import backend_available, require_backend, resolve_db_path
from .base_utils import compact
def validate_doi(doi: str | None) -> str | None:
"... | front-matter/commonmeta-py | commonmeta/doi_utils.py | .py | aa5bcf172050a738 | 7.65 | 19 |
"""codemeta reader for commonmeta-py"""
from __future__ import annotations
import requests
from ..author_utils import get_authors
from ..base_utils import compact, presence, sanitize, wrap
from ..constants import (
SO_TO_CM_TRANSLATIONS,
Commonmeta,
)
from ..utils import (
dict_to_spdx,
from_schema_o... | front-matter/commonmeta-py | commonmeta/readers/codemeta_reader.py | .py | e94621ea6fe0c6a3 | 7.65 | 19 |
"""crossref reader for commonmeta-py"""
from __future__ import annotations
from xml.parsers.expat import ExpatError
import requests
from requests.exceptions import ConnectionError, ReadTimeout
from ..api_utils import COMMONMETA_USER_AGENT
from ..author_utils import get_authors
from ..base_utils import (
compact... | front-matter/commonmeta-py | commonmeta/readers/crossref_reader.py | .py | 13a0f8460fc24ac9 | 7.65 | 19 |
"""datacite_xml reader for Commonmeta"""
from __future__ import annotations
from collections import defaultdict
import requests
from ..author_utils import get_authors
from ..base_utils import (
compact,
dig,
first,
omit,
parse_attributes,
presence,
sanitize,
wrap,
)
from ..constants ... | front-matter/commonmeta-py | commonmeta/readers/datacite_xml_reader.py | .py | ddd16189819a3f80 | 7.65 | 19 |
"""OpenAlex reader for commonmeta-py"""
from __future__ import annotations
from requests.exceptions import ConnectionError, ReadTimeout
from ..api_utils import COMMONMETA_USER_AGENT, http
from ..author_utils import get_authors
from ..base_utils import (
compact,
dig,
presence,
sanitize,
unique,
... | front-matter/commonmeta-py | commonmeta/readers/openalex_reader.py | .py | b5921f90a02228d2 | 7.65 | 19 |
"""ORCID reader for Commonmeta.
Reads ORCID 3.0 JSON and returns a commonmeta *person* entity. Accepts both the
full ``/record`` response - identity under ``person`` plus employments and
educations under ``activities-summary``, which become affiliations - and the
leaner ``/person`` response (identity only, no activiti... | front-matter/commonmeta-py | commonmeta/readers/orcid_reader.py | .py | a2ca6688679b88cb | 7.65 | 19 |
"""ORCID XML reader for Commonmeta.
Reads a full ORCID *record* XML - the shape found in the bulk summaries dumps
and served by the ORCID API's record endpoint - and returns a commonmeta
*person* entity.
Unlike the person JSON read by :mod:`commonmeta.readers.orcid_reader`, a record
carries employments and educations... | front-matter/commonmeta-py | commonmeta/readers/orcid_xml_reader.py | .py | 025672edf0f68fce | 7.65 | 19 |
"""ROR reader for Commonmeta.
Reads a `ROR v2 API <https://ror.readme.io/v2/docs/data-structure>`_ record and
returns a commonmeta *organization* entity. The inverse is
:mod:`commonmeta.writers.ror_writer`.
"""
from __future__ import annotations
import requests
from ..base_utils import compact, presence, wrap
from ... | front-matter/commonmeta-py | commonmeta/readers/ror_reader.py | .py | bc9602754f1996f2 | 7.65 | 19 |
"""schema_org reader for commonmeta-py"""
from __future__ import annotations
from datetime import datetime
import orjson as json
import requests
from bs4 import BeautifulSoup
from requests.exceptions import ConnectionError
from ..author_utils import get_authors
from ..base_utils import (
compact,
dig,
f... | front-matter/commonmeta-py | commonmeta/readers/schema_org_reader.py | .py | 0dbb076b1a5b5c80 | 7.65 | 19 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.