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 |
|---|---|---|---|---|---|---|
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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/license... | DecLearn/declearn | declearn/client_sampler/_uniform.py | .py | 6a509e499a6cc03e | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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/license... | DecLearn/declearn | declearn/client_sampler/_weighted.py | .py | 171247d5c110b845 | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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/license... | DecLearn/declearn | declearn/client_sampler/criterion/_api.py | .py | 34b53484fadfeaef | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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/license... | DecLearn/declearn | declearn/client_sampler/criterion/_criteria.py | .py | d1195b3312d9fbc0 | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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/license... | DecLearn/declearn | declearn/communication/api/_client.py | .py | 0a85eed5ef9c3207 | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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/license... | DecLearn/declearn | declearn/communication/api/_server.py | .py | 5b2d9734f1d090fb | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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/license... | DecLearn/declearn | declearn/communication/api/backend/_handler.py | .py | 039cbea881f9ad96 | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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/license... | DecLearn/declearn | declearn/communication/api/backend/actions.py | .py | 96b98e1800a6c478 | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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/license... | DecLearn/declearn | declearn/communication/grpc/_client.py | .py | 3cb2bc073e758412 | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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/license... | DecLearn/declearn | declearn/communication/grpc/_server.py | .py | 893c4d559d40da93 | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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/license... | DecLearn/declearn | declearn/communication/utils/_build.py | .py | b49ea179cd76cfb2 | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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/license... | DecLearn/declearn | declearn/communication/utils/_compression.py | .py | 697bbd8e2366b2a2 | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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/license... | DecLearn/declearn | declearn/communication/utils/_parse.py | .py | e678418905594558 | 7.54 | 11 |
import unittest
import requests
from datetime import datetime, timedelta, timezone
import json
import os
class TestDailyPapers(unittest.TestCase):
"""
TestDailyPapers 클래스:
- 전날의 연구 논문 데이터를 가져오는 API의 응답을 테스트하고,
- 결과를 JSON 파일로 저장하는 테스트 케이스를 구현합니다.
"""
def setUp(self):
"""
setUp ... | jeongiin/hf-daily-paper-korean-autoflow | paper_metadata_download.py | .py | 54f1d5eff448fbb7 | 7.45 | 7 |
# -- coding: utf-8 --
import os
import json
import datetime
import pytz
from tqdm import tqdm
from openai import OpenAI
import re
import time
from tenacity import retry, stop_after_attempt, wait_exponential
# OpenAI API 키를 환경 변수에서 가져오기
api_key = os.getenv('OPENAI_API_KEY')
if not api_key:
raise ValueError("OPENAI... | jeongiin/hf-daily-paper-korean-autoflow | paper_openai_translation.py | .py | e3190a70b17da566 | 7.45 | 7 |
"""
~40,000 distinct ip addresses recorded "downloading a file" in Q1 of 2024
Using http://ip-api.com/batch API, I was able to extract the information of all ~40000 IP addresses.
This information contains city, country, region, etc which is then stored back into snowflake
for analysis
This eventually could be an Airfl... | Sage-Bionetworks/snowflake | analytics/ip_lookup.py | .py | 8c5436f5ee819813 | 7.45 | 7 |
from typing import Any, Optional
import pandas as pd
from great_expectations.core.expectation_configuration import ExpectationConfiguration
from great_expectations.execution_engine import (
PandasExecutionEngine,
SqlAlchemyExecutionEngine,
)
from great_expectations.expectations.expectation import ColumnMapExpe... | Sage-Bionetworks/snowflake | data_validation/gx/plugins/expectations/expect_column_values_to_have_list_members.py | .py | 79af3cbc930446b9 | 7.45 | 7 |
import argparse
from dataclasses import dataclass
from typing import Optional
import pandas as pd
import streamlit
from snowflake.snowpark import Session
from snowflake.snowpark.context import get_active_session
streamlit.set_page_config(layout="wide")
def read_args() -> argparse.Namespace:
"""Parse command-lin... | Sage-Bionetworks/snowflake | sage/governance/streamlit/data_access_dashboard/streamlit_app.py | .py | be6ff89b0aa2ae3b | 7.45 | 7 |
# Google Analytics 4 (GA4)
# IMPORTANT: User-Level and Event-Level Data Retention is only up to 14 months
# Some aggregated data remains available beyond these periods, but detailed user and event data might not
# https://github.com/googleapis/google-cloud-python
import os
import pandas as pd
import logging
from googl... | Sage-Bionetworks/snowflake | sage/nf/streamlit/nf_usage_metrics/toolkit/ga4.py | .py | 8a1069641c42b187 | 7.45 | 7 |
from requests import session
import streamlit as st
from snowflake.snowpark import Session
from snowflake.snowpark.context import get_active_session
@st.cache_resource
def connect_to_snowflake():
"""
Establishes and caches a connection to Snowflake.
This function uses Streamlit's @st.cache_resource decora... | Sage-Bionetworks/snowflake | sage/nf/streamlit/nf_usage_metrics/toolkit/utils.py | .py | 98da337daf550c10 | 7.45 | 7 |
'''
Dependency of PINGMapper: https://github.com/CameronBodine/PINGMapper
Repository: https://github.com/CameronBodine/PINGVerter
PyPi: https://pypi.org/project/pingverter/
Developed by Cameron S. Bodine
###############
Acknowledgments
###############
None of this work would have been possible without the followin... | CameronBodine/PINGVerter | pingverter/sonar_class.py | .py | 122f7abeb85a2012 | 7.5 | 9 |
# Copyright (C) 2024 - 2026 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | ansys/pysam-sysml2 | src/ansys/sam/sysml2/api/ansys_sysml2_api_connector.py | .py | 8c33df6879181f8e | 7.57 | 13 |
# Copyright (C) 2024 - 2026 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | ansys/pysam-sysml2 | src/ansys/sam/sysml2/builder/classes/project_impl.py | .py | 4be2110e51aadab0 | 7.57 | 13 |
# Copyright (C) 2024 - 2026 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | ansys/pysam-sysml2 | src/ansys/sam/sysml2/builder/classes/scripting_project_impl.py | .py | 6ffd572b60ee2f79 | 7.57 | 13 |
# Copyright (C) 2024 - 2026 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | ansys/pysam-sysml2 | src/ansys/sam/sysml2/builder/classes/sysml_util.py | .py | 2447a09b7df522eb | 7.57 | 13 |
# Copyright (C) 2024 - 2026 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | ansys/pysam-sysml2 | src/ansys/sam/sysml2/builder/mapper/mapper.py | .py | 38696858d2163384 | 7.57 | 13 |
# Copyright (C) 2024 - 2026 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | ansys/pysam-sysml2 | src/ansys/sam/sysml2/builder/mapper/scripting_mapper.py | .py | 08e4085231733412 | 7.57 | 13 |
# Copyright (C) 2024 - 2026 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | ansys/pysam-sysml2 | src/ansys/sam/sysml2/builder/mapper/sysml_mapper.py | .py | 8e4694b92c72d1d0 | 7.57 | 13 |
# Copyright (C) 2024 - 2026 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | ansys/pysam-sysml2 | src/ansys/sam/sysml2/builder/sysml2_project_manager.py | .py | 7509c50241514381 | 7.57 | 13 |
# Copyright (C) 2024 - 2026 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | ansys/pysam-sysml2 | src/ansys/sam/sysml2/classes/inherited_element.py | .py | cfac1e72b7c9f2f2 | 7.57 | 13 |
# Copyright (C) 2024 - 2026 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | ansys/pysam-sysml2 | src/ansys/sam/sysml2/classes/sysml_element.py | .py | 5274c0168d5cc035 | 7.57 | 13 |
# Copyright (C) 2024 - 2026 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | ansys/pysam-sysml2 | src/ansys/sam/sysml2/classes/sysml_inherited_element.py | .py | 3f10d2280717b4a4 | 7.57 | 13 |
# Copyright 2025 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/gads_account_dispatcher/main.py | .py | 871c479b9a88d790 | 7.52 | 10 |
"""Unit tests for the gads_video_report_fetcher main module."""
import base64
import io
import json
from typing import Any
from unittest import mock
from gads_video_report_fetcher import main
class MockCloudEvent:
"""Mock CloudEvent object conforming to functions_framework CloudEvent protocol."""
def __init__(... | google-marketing-solutions/video-exclusion-toolbox | src/gads_video_report_fetcher/tests/test_video_report_fetcher_main.py | .py | b8d3a55be77d1ed4 | 8.02 | 10 |
# Copyright 2023 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/google_ads_accounts/main.py | .py | bac11f052734d919 | 7.52 | 10 |
# Copyright 2022 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/google_ads_accounts/utils/pubsub.py | .py | 47a16a04eef6cd97 | 7.52 | 10 |
# Copyright 2024 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/google_ads_excluder/main.py | .py | 306a7f5c867b045f | 7.52 | 10 |
# Copyright 2023 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/google_ads_excluder/utils/gcs.py | .py | ad6c210a3965fd99 | 7.52 | 10 |
# Copyright 2024 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/google_ads_exclusions/main.py | .py | d2e87521df942130 | 7.52 | 10 |
# Copyright 2024 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/google_ads_report_channel/main.py | .py | 0977107ab554bd53 | 7.52 | 10 |
# Copyright 2023 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/google_ads_report_channel/utils/gcs.py | .py | 97f7b9a8d10ee5cd | 7.52 | 10 |
# Copyright 2026 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/vet_common/bq.py | .py | 7b7ea855afba43c5 | 7.52 | 10 |
# Copyright 2026 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/vet_common/logging.py | .py | d5c81948954f3783 | 7.52 | 10 |
# Copyright 2026 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/vet_common/pubsub.py | .py | b0fb35e272e2f619 | 7.52 | 10 |
# Copyright 2026 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/vet_common/tests/test_vet_common.py | .py | ada2e2c99a55a7d9 | 8.02 | 10 |
# Copyright 2024 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/youtube_channel/main.py | .py | 0c08b18715cfc3d4 | 7.52 | 10 |
# Copyright 2023 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/youtube_thumbnails_dispatch/main.py | .py | b4a42013819f754e | 7.52 | 10 |
# Copyright 2025 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/youtube_thumbnails_evaluate_age_dispatcher/main.py | .py | 9301582c0de63119 | 7.52 | 10 |
# Copyright 2023 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/youtube_thumbnails_generate_cropouts/main.py | .py | 1a31f4fe1969c392 | 7.52 | 10 |
# Copyright 2023 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/youtube_thumbnails_identify_objects/main.py | .py | 0fb3605a852e0a87 | 7.52 | 10 |
# Copyright 2023 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-marketing-solutions/video-exclusion-toolbox | src/youtube_video/main.py | .py | 946765b5ab111041 | 7.52 | 10 |
"""File for taking in multiple ancillary files and creating a combined dataset."""
from __future__ import annotations
import json
from collections import namedtuple
from pathlib import Path
import numpy as np
import xarray as xr
from cdflib.xarray import cdf_to_xarray
from imap_data_access import AncillaryFilePath
f... | IMAP-Science-Operations-Center/imap_processing | imap_processing/ancillary/ancillary_dataset_combiner.py | .py | 80d70a040a6a605a | 7.6 | 15 |
"""Contain a data class for CCSDS data."""
from dataclasses import dataclass, fields
@dataclass
class CcsdsData:
"""
Data class for CCSDS header.
Parameters
----------
packet_header : dict
Dictionary of packet headers.
Attributes
----------
VERSION: int
CCSDS Packet ... | IMAP-Science-Operations-Center/imap_processing | imap_processing/ccsds/ccsds_data.py | .py | 66e8507dbbed198f | 7.6 | 15 |
"""
IMAP specific tools for CDF attribute management.
This class should be used in all cases, and should contain any IMAP specific assumptions
or code.
"""
from __future__ import annotations
from pathlib import Path
from sammi.cdf_attribute_manager import CdfAttributeManager
class ImapCdfAttributes(CdfAttributeMa... | IMAP-Science-Operations-Center/imap_processing | imap_processing/cdf/imap_cdf_manager.py | .py | 2b65bfe52cd14f12 | 7.6 | 15 |
"""Various utility functions to support creation of CDF files."""
from __future__ import annotations
import datetime
import logging
import re
import warnings
from pathlib import Path
import imap_data_access
import numpy as np
import pandas as pd
import xarray as xr
from cdflib.logging import logger as cdflib_logger
... | IMAP-Science-Operations-Center/imap_processing | imap_processing/cdf/utils.py | .py | 39368fe1cc1235c9 | 7.6 | 15 |
"""CoDICE Lo Species L1A processing functions."""
import logging
from pathlib import Path
import numpy as np
import xarray as xr
from imap_processing.cdf.imap_cdf_manager import ImapCdfAttributes
from imap_processing.codice import constants
from imap_processing.codice.constants import (
CODICEAPID,
HALF_SPIN... | IMAP-Science-Operations-Center/imap_processing | imap_processing/codice/codice_l1a_lo_species.py | .py | 17804bce18fae03d | 7.1 | 15 |
"""
Perform CoDICE l1b processing.
This module processes CoDICE l1a files and creates L1b data products.
Notes
-----
from imap_processing.codice.codice_l1b import process_codice_l1b
dataset = process_codice_l1b(l1a_filenanme)
"""
import logging
from pathlib import Path
import numpy as np
import xarray as xr
from i... | IMAP-Science-Operations-Center/imap_processing | imap_processing/codice/codice_l1b.py | .py | 112fcdcca3c1ba44 | 7.6 | 15 |
"""
Various classes and functions used throughout CoDICE processing.
This module contains utility classes and functions that are used by various
other CoDICE processing modules.
"""
import json
from collections.abc import Callable
from dataclasses import dataclass
from enum import IntEnum
from pathlib import Path
im... | IMAP-Science-Operations-Center/imap_processing | imap_processing/codice/utils.py | .py | 15584d0f2c3d96d5 | 7.6 | 15 |
"""Utilities for generating ENA maps."""
from __future__ import annotations
import logging
import numpy as np
from numpy.typing import NDArray
logger = logging.getLogger(__name__)
def vectorized_bincount(
indices: NDArray, weights: NDArray | None = None, minlength: int = 0
) -> NDArray:
"""
Vectorized... | IMAP-Science-Operations-Center/imap_processing | imap_processing/ena_maps/utils/map_utils.py | .py | b5d8c363c7e7aa7b | 7.6 | 15 |
"""IMAP utils for spatial binning and az/el grid creation."""
from __future__ import annotations
import typing
import numpy as np
from numpy.typing import NDArray
def build_spatial_bins(
az_spacing_deg: float = 0.5,
el_spacing_deg: float = 0.5,
) -> tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
... | IMAP-Science-Operations-Center/imap_processing | imap_processing/ena_maps/utils/spatial_utils.py | .py | 93a91dc24622c36f | 7.6 | 15 |
"""Decommutate GLOWS CCSDS packets using GLOWS packet definitions."""
from enum import Enum
from pathlib import Path
from imap_processing import imap_module_directory
from imap_processing.ccsds.ccsds_data import CcsdsData
from imap_processing.glows import __version__
from imap_processing.glows.l0.glows_l0_data import... | IMAP-Science-Operations-Center/imap_processing | imap_processing/glows/l0/decom_glows.py | .py | 405375d24b2d9431 | 7.6 | 15 |
"""Contains data classes to support GLOWS L0 processing."""
from dataclasses import dataclass, field
from imap_processing.ccsds.ccsds_data import CcsdsData
@dataclass
class GlowsL0:
"""
Data structure for common values across histogram and direct events data.
Attributes
----------
ground_sw_ver... | IMAP-Science-Operations-Center/imap_processing | imap_processing/glows/l0/glows_l0_data.py | .py | b4b94c0d4e46b49d | 7.6 | 15 |
"""Methods for GLOWS Level 1A processing and CDF writing."""
import logging
from itertools import groupby
from pathlib import Path
import numpy as np
import xarray as xr
from imap_processing.cdf.imap_cdf_manager import ImapCdfAttributes
from imap_processing.glows.l0.decom_glows import decom_packets
from imap_process... | IMAP-Science-Operations-Center/imap_processing | imap_processing/glows/l1a/glows_l1a.py | .py | 203cfa3ba446360e | 7.6 | 15 |
"""Methods for processing GLOWS L1B data."""
import dataclasses
import logging
import numpy as np
import xarray as xr
from imap_processing.cdf.imap_cdf_manager import ImapCdfAttributes
from imap_processing.glows import FLAG_LENGTH
from imap_processing.glows.l1b.glows_l1b_data import (
AncillaryExclusions,
An... | IMAP-Science-Operations-Center/imap_processing | imap_processing/glows/l1b/glows_l1b.py | .py | 0bf0c192102e9fe0 | 7.6 | 15 |
"""Module for GLOWS Level 2 processing."""
import dataclasses
import logging
import numpy as np
import xarray as xr
from imap_processing.cdf.imap_cdf_manager import ImapCdfAttributes
from imap_processing.glows import BAD_TIME_FLAG_NAMES, FLAG_LENGTH
from imap_processing.glows.l1b.glows_l1b_data import (
Pipeline... | IMAP-Science-Operations-Center/imap_processing | imap_processing/glows/l2/glows_l2.py | .py | eeb7cd19f2b86086 | 7.6 | 15 |
"""Module for constants and useful shared classes used in GLOWS."""
from dataclasses import dataclass
import numpy as np
@dataclass(frozen=True)
class TimeTuple:
"""
Spacecraft clock time, a float divided into seconds and subseconds.
Attributes
----------
seconds: int
Seconds of clock, ... | IMAP-Science-Operations-Center/imap_processing | imap_processing/glows/utils/constants.py | .py | 14e88ef8d5b6bdc2 | 7.6 | 15 |
# -*- coding: utf-8 -*-
from .Util import SystemSide, TRY_EXEC_FUN
lambda: "By Zero123"
IsServerUser = False
ModDirName = SystemSide.__module__.split(".")[0]
QuModLibsPath = SystemSide.__module__[:SystemSide.__module__.rfind(".")]
class RuntimeService:
_serverSystemList = []
_clientSystemList = []
_server... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/IN.py | .py | d16344358ade3655 | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ...Client import *
from ...Util import TRY_EXEC_FUN, getObjectPathName
from copy import deepcopy
from ...Modules.Services.Client import (
BaseService,
BaseEvent,
serviceBroadcast,
listenServiceEvent,
)
from .SharedRes import (
GL_CUSTOM_QUERY,
JSONRenderData,
GL_... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Include/GL_Render/Client.py | .py | 49f6255dab0cf0b1 | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ...Server import *
from ...Util import TRY_EXEC_FUN
from ...Modules.Services.Server import BaseService, BaseEvent, serviceBroadcast
from .SharedRes import (
GL_OPT_INSTRUCT,
GL_BASE_RES_OPT,
GL_RES_OPT,
JSONRenderData,
GL_MOB_QUERY_KEY,
)
from copy import copy
from time ... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Include/GL_Render/Server.py | .py | 92e3ff0d20746aa1 | 7.56 | 12 |
# -*- coding: utf-8 -*-
lambda: "By Zero123"
lambda: "TIME: 2025/11/22"
from ...IN import ModDirName
GL_MOB_QUERY_KEY = "Q_{}_GL.MOB_QUERY".format(ModDirName)
class GL_CUSTOM_QUERY:
GL_QUERYS = [
] # type: list[str]
""" 全局资源节点 """
class GL_OPT_INSTRUCT:
OTHER = -1
""" 其他操作 """
WRITE = 0
... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Include/GL_Render/SharedRes.py | .py | 009f9ccf13faa472 | 7.56 | 12 |
# -*- coding: utf-8 -*-
import math
from .Util import Math
lambda: "By Zero123"
class Vec3(object):
""" QuMod Vec3向量类 用于描述坐标/向量
PS: Vec3的方法大多是自我操作并返回self的链式设计 如需产生新的对象请使用克隆方法
"""
def __init__(self, x = 0.0, y = 0.0, z = 0.0):
self._tuple = None # type: tuple[float, float, float] | None... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Math.py | .py | fbb78161cff72981 | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ...Client import Call, Events
from ..EventsPool.Client import POOL_ListenForEvent, POOL_UnListenForEvent
class CallService:
""" 通信服务封装 (客户端推荐使用) """
_cache = []
@staticmethod
def _init():
POOL_ListenForEvent(Events.OnScriptTickClient, CallService.updateDataPacks)
... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/CallService/Client.py | .py | c120bd64f0dfc6d7 | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ...Server import Call, Events
from ..EventsPool.Server import POOL_ListenForEvent, POOL_UnListenForEvent
class CallService:
""" 通信服务封装 (服务端) """
_delayCacheMap = {} # type: dict[str, list[tuple]]
@staticmethod
def _init():
POOL_ListenForEvent(Events.OnScriptTickSe... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/CallService/Server.py | .py | 38674a3490b06ed0 | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ...Client import ListenForEvent, UnListenForEvent, playerId, levelId, Entity, compFactory
import math
lambda: "QuModLibs 摄像机模块 By Zero123"
class LensAnimType:
NONE = -1
""" 无过渡处理 """
LINEAR = 0
""" 线性动画 """
class LensAnimPositionProcessType:
ABSOLUTE = -1
""" 绝对坐标... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/Camera/Client.py | .py | 35d301e6908ef537 | 7.56 | 12 |
# -*- coding: utf-8 -*-
lambda: "By Zero123"
class BaseClsStoreMeta(type):
"""
数据管理元类
"""
def __setattr__(cls, name, value):
# type: (str, object) -> None
if issubclass(cls, BaseStoreCls) and not name.startswith("__"):
if not type.__getattribute__(cls, "__mInit__"):
... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/DataStore/Core.py | .py | 45b50e94b6f502ca | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ..Services.Globals import TimerLoader
from random import choice
lambda: "行为树 By Zero123"
class QSharedData:
def __init__(self):
self._dataMap = {}
def getValue(self, key, noneValue=None):
return self._dataMap.get(key, noneValue)
def setValue(self, key, value):... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/EntityComps/BehaviorTree.py | .py | 7880459b1148809a | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ...Client import Entity, levelId, compFactory
from ...Util import TRY_EXEC_FUN, UniversalObject
from ...IN import ModDirName
from ..Services.Client import BaseService
from .Globals import (
QUnBindIN,
_QBaseEntityComp,
QEntityCompFlags,
QEntityRuntime,
)
from copy import cop... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/EntityComps/Client.py | .py | e79c85dc65bbe035 | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ...Util import TRY_EXEC_FUN
from ..Services.Globals import TimerLoader
from copy import copy
lambda: "By Zero123"
class QUnBindIN:
""" 组件解除绑定的信息参数 """
GAMEOVER = -2
OTHER = -1
MOB_AUTO_REMOVED = 0
REMOVED_BY_SCRIPT = 1
def __init__(self, state=-1):
self.sta... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/EntityComps/Globals.py | .py | 923246d90295af00 | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ...Server import serverApi, Entity, compFactory
from ...Util import TRY_EXEC_FUN, UniversalObject
from ...IN import ModDirName
from ..Services.Server import BaseService
from .Globals import (
QUnBindIN,
_QBaseEntityComp,
QEntityCompFlags,
QEntityRuntime,
)
from .BehaviorTree... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/EntityComps/Server.py | .py | 28cff274a4d16344 | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ...Client import ListenForEvent
from ...Util import TRY_EXEC_FUN, getObjectPathName
from ..Utils.Container import QOrderedSet
from ..Services.Client import BaseService
lambda: "By Zero123"
# 网易事件监听机制受优先级以及排序影响 在高频率动态监听/取消的环境下对性能造成的压力较高
# EventsPool 用于维护基于哈希的池化事件监听 同时确保了有序顺序
class EventsPo... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/EventsPool/Client.py | .py | 9a2a7d0e7df46906 | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ...Server import ListenForEvent
from ...Util import TRY_EXEC_FUN, getObjectPathName
from ..Utils.Container import QOrderedSet
from ..Services.Server import BaseService
lambda: "By Zero123"
# 网易事件监听机制受优先级以及排序影响 在高频率动态监听/取消的环境下对性能造成的压力较高
# EventsPool 用于维护基于哈希的池化事件监听 同时确保了有序顺序
class EventsPo... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/EventsPool/Server.py | .py | d4ef1f68851f2707 | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ...Client import levelId, playerId, compFactory
from .Globals import (
_ItemBasicInfo,
_ItemData,
_InventoryData,
EnchNBTView,
EnchantType
)
lambda: "物品服务模块 By Zero123"
class ItemBasicInfo(_ItemBasicInfo):
""" 基础物品信息 """
def getArgs(self, itemName, auxValue, isE... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/Items/Client.py | .py | d0ce17b3ce91e431 | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ...Server import compFactory, levelId, _loaderSystem
from ..Services.Server import BaseService
from .Globals import (
_ItemBasicInfo,
_ItemData,
_InventoryData,
EnchNBTView,
EnchantType
)
lambda: "物品服务模块 By Zero123"
class ItemBasicInfo(_ItemBasicInfo):
""" 基础物品信息 ""... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/Items/Server.py | .py | 7d03996c707e4d0a | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ...Client import compFactory, levelId, Entity
from ...Util import TRY_EXEC_FUN
lambda: "By Zero123"
class QFreeModelPool:
""" 自由模型管理池 """
def __init__(self, modelName=""):
self.modelName = modelName
self.freeModel = []
""" 待使用的模型 """
self.usingModel ... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/ModelRender/Client.py | .py | 46b4402fac1ca50c | 7.56 | 12 |
# -*- coding: utf-8 -*-
# import mod.client.extraClientApi as clientApi
from ...Client import compFactory, levelId
from ..EventsPool.Client import POOL_ListenForEvent, POOL_UnListenForEvent
from .Core import *
lambda: "By Tohru"
__all__ = [
"sleepAsync",
"waitEvent",
"Promise",
"asyncRunner",
]
def sl... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/Promise/Client.py | .py | b1f0d538896bf8e4 | 7.56 | 12 |
# -*- coding: utf-8 -*-
# import mod.server.extraServerApi as serverApi
from ...Server import compFactory, levelId
from ..EventsPool.Server import POOL_ListenForEvent, POOL_UnListenForEvent
from .Core import *
lambda: "By Tohru"
__all__ = [
"sleepAsync",
"waitEvent",
"Promise",
"asyncRunner",
]
# leve... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/Promise/Server.py | .py | c71e2096d0c0d9bb | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ...Client import ListenForEvent, UnListenForEvent, _loaderSystem, Events, Call, CallBackKey, playerId
from .Globals import _BaseService, _ServiceManager, _AutoStopService, BaseEvent, BaseBusiness, KeyBusiness, QRequests
lambda: "Service By Zero123"
__all__ = [
"BaseService",
"_serv... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/Services/Client.py | .py | 3a54e8aad93e6a84 | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ...Server import ListenForEvent, UnListenForEvent, _loaderSystem, Events, Call, CallBackKey
from .Globals import _BaseService, _ServiceManager, _AutoStopService, BaseEvent, BaseBusiness, KeyBusiness, QRequests
lambda: "Service By Zero123"
__all__ = [
"BaseService",
"_serviceManager... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/Services/Server.py | .py | adf01ad6a62733d4 | 7.56 | 12 |
# -*- coding: utf-8 -*-
from ...Server import compFactory
from ..EntityComps.Server import QBaseEntityComp
from .Util import SharedBox, _DEFAULT
lambda: "By Zero123"
class ImmuneDamageComp(QBaseEntityComp):
""" 免疫伤害组件 """
def __init__(self):
QBaseEntityComp.__init__(self)
self.sharedBox = Shar... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/SharedAPI/Server.py | .py | dce050270a1ceb6b | 7.56 | 12 |
# -*- coding: utf-8 -*-
lambda: "By Zero123"
_DEFAULT = "default"
class SharedBox:
""" 共享盒子 引用计数 """
def __init__(self, load = lambda: None, unload = lambda: None):
"""
@load 绑定存在引用的执行对象
@unload 绑定无引用的执行对象
"""
self._load = load
self._unload = unload
... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/SharedAPI/Util.py | .py | 8320246f042edd4a | 7.56 | 12 |
# -*- coding: utf-8 -*-
import Queue
from ..Services.Client import BaseService
from ...Util import TRY_EXEC_FUN
@BaseService.Init
class _MAIN_THREAD_SERVER(BaseService):
_TASK_QUEUE = Queue.Queue(maxsize=0)
def onServiceUpdate(self):
BaseService.onServiceUpdate(self)
_TASK_QUEUE = _MAIN_THREAD... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/Thread/Client.py | .py | 1ce8559c38647d41 | 7.56 | 12 |
# -*- coding: utf-8 -*-
import Queue
from ..Services.Server import BaseService
from ...Util import TRY_EXEC_FUN
@BaseService.Init
class _MAIN_THREAD_SERVER(BaseService):
_TASK_QUEUE = Queue.Queue(maxsize=0)
def onServiceUpdate(self):
BaseService.onServiceUpdate(self)
_TASK_QUEUE = _MAIN_THREAD... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/Thread/Server.py | .py | 96963bf4b29debe7 | 7.56 | 12 |
# -*- coding: utf-8 -*-
import threading
import Queue
class QThreadPool:
def __init__(self, maxThreadCount=2, daemon=None):
# type: (int, bool | None) -> None
self.maxThreadCount = maxThreadCount
self.daemon = daemon
self._taskQueue = Queue.Queue(maxsize=0)
self._threadList ... | BitterLemonn/AddOn_Platinum | behavior_pack_Platinum/Script_Platinum/QuModLibs/Modules/Thread/Util.py | .py | aeb8d4bce46579c0 | 7.56 | 12 |
import pkgutil
from pathlib import Path
def scan_package_modules(package_path, package_name):
"""Scan a package and return all its modules"""
modules = []
if not package_path.exists():
return modules
for importer, modname, ispkg in pkgutil.iter_modules([str(package_path)]):
if not ispk... | ArcetriAdaptiveOptics/SPECULA | docs/scripts/generate_api_docs.py | .py | ae2dc9ecf4064d32 | 7.52 | 10 |
import os
import numpy as np
import logging
import functools
from functools import wraps
from specula.log import get_specula_logger, init_logging
cpu_float_dtype_list = [np.float64, np.float32]
cpu_complex_dtype_list = [np.complex128, np.complex64]
array_types = []
gpuEnabled = False
cp = None
xp = None
global_preci... | ArcetriAdaptiveOptics/SPECULA | specula/__init__.py | .py | 023a61502f55e097 | 8.02 | 10 |
import warnings
from copy import copy
from functools import lru_cache
from specula import cp, np, array_types
from specula.base_time_obj import BaseTimeObj
# We use lru_cache() instead of cache() for python 3.8 compatibility
@lru_cache(maxsize=None)
def get_properties(cls):
result = []
classlist = cls.__mro... | ArcetriAdaptiveOptics/SPECULA | specula/base_data_obj.py | .py | a897ef2aa32c8958 | 8.02 | 10 |
from pathlib import Path
from typing import Optional
import yaml
from astropy.io import fits
import specula
from specula.simul import Simul
from specula.log import get_specula_logger
class BaseReplayAnalyser:
"""
Shared replay machinery for classes that recompute results from a past
simulation run by ta... | ArcetriAdaptiveOptics/SPECULA | specula/base_replay_analyser.py | .py | 02a21b04e8e6d03d | 8.02 | 10 |
import os
from astropy.io import fits
from specula.log import get_specula_logger
class CalibManager():
def __init__(self, root_dir):
"""
Initialize the calibration manager object.
Parameters:
root_dir (str): Root path of the calibration tree
"""
super().__init__(... | ArcetriAdaptiveOptics/SPECULA | specula/calib_manager.py | .py | 965e2cf69f10e6bd | 8.02 | 10 |
from astropy.io import fits
import numpy as np
from specula import cpuArray
from specula.base_data_obj import BaseDataObj
class ElectricField(BaseDataObj):
"""
Electric field data object.
This class represents a 2D electric field, storing both amplitude and phase information
for each pixel in a recta... | ArcetriAdaptiveOptics/SPECULA | specula/data_objects/electric_field.py | .py | 81f22e9f6e448358 | 8.02 | 10 |
from specula.data_objects.convolution_kernel import ConvolutionKernel, lgs_map_sh
from astropy.io import fits
class GaussianConvolutionKernel(ConvolutionKernel):
"""
Gaussian Convolution Kernel data object.
This object stores a Gaussian convolution kernel for Shack-Hartmann
wavefront sensing and perf... | ArcetriAdaptiveOptics/SPECULA | specula/data_objects/gaussian_convolution_kernel.py | .py | bbffe27b98efe57f | 8.02 | 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.