metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "__init__.py",
"repo_name": "mit-ll/spacegym-kspdg",
"repo_path": "spacegym-kspdg_extracted/spacegym-kspdg-main/src/kspdg/private_src/python3_13/Windows_x86_64/kspdg_envs/__init__.py",
"type": "Python"
} | # Pyarmor 9.0.6 (trial), 000000, non-profits, 2024-12-09T10:19:34.238832
from kspdg.private_src.python3_13.Windows_x86_64.pyarmor_runtime_000000 import __pyarmor__
__pyarmor__(__name__, __file__, b'PY000000\x00\x03\r\x00\xf3\r\r\n\x80\x00\x01\x00\x08\x00\x00\x00\x04\x00\x00\x00@\x00\x00\x00\xa9\x01\x00\x00\x12\t\x04\x0... | mit-llREPO_NAMEspacegym-kspdgPATH_START.@spacegym-kspdg_extracted@spacegym-kspdg-main@src@kspdg@private_src@python3_13@Windows_x86_64@kspdg_envs@__init__.py@.PATH_END.py |
{
"filename": "mms_pgs_make_e_spec.py",
"repo_name": "spedas/pyspedas",
"repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/mms/particles/mms_pgs_make_e_spec.py",
"type": "Python"
} | import numpy as np
# use nansum from bottleneck if it's installed, otherwise use the numpy one
try:
import bottleneck as bn
nansum = bn.nansum
except ImportError:
nansum = np.nansum
def mms_pgs_make_e_spec(data_in):
"""
Builds an energy spectrogram from a simplified particle data structure.
... | spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@mms@particles@mms_pgs_make_e_spec.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "nivha/three_body_integration",
"repo_path": "three_body_integration_extracted/three_body_integration-master/utils.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 30 10:13:41 2017
@author: Niv Haim (Weizmann Institute of Science)
"""
import numpy as np
from numpy.linalg import norm
from numpy import sin, cos, sqrt, cross, arctan2
import numba as nb
# Simulation constants
N = 2e11 # maximum iterations
# Simulation finish reasons... | nivhaREPO_NAMEthree_body_integrationPATH_START.@three_body_integration_extracted@three_body_integration-master@utils.py@.PATH_END.py |
{
"filename": "PINT_walkthrough.py",
"repo_name": "nanograv/PINT",
"repo_path": "PINT_extracted/PINT-master/docs/examples/PINT_walkthrough.py",
"type": "Python"
} | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.16.0
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# %% [ma... | nanogravREPO_NAMEPINTPATH_START.@PINT_extracted@PINT-master@docs@examples@PINT_walkthrough.py@.PATH_END.py |
{
"filename": "mosaic_semaphore_dma.py",
"repo_name": "jax-ml/jax",
"repo_path": "jax_extracted/jax-main/jax/_src/internal_test_util/export_back_compat_test_data/pallas/mosaic_semaphore_dma.py",
"type": "Python"
} | # Copyright 2024 The JAX Authors.
#
# 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 wri... | jax-mlREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@_src@internal_test_util@export_back_compat_test_data@pallas@mosaic_semaphore_dma.py@.PATH_END.py |
{
"filename": "galex_jpegs.py",
"repo_name": "dstndstn/astrometry.net",
"repo_path": "astrometry.net_extracted/astrometry.net-main/net/galex_jpegs.py",
"type": "Python"
} | import os
from astrometry.util.fits import fits_table
from astrometry.util.util import Tan
from astrometry.plot import plotstuff as ps
from astrometry.util.starutil_numpy import *
from astrometry.net.log import *
import numpy as np
def plot_into_wcs(wcsfn, plotfn, wcsext=0, basedir='.', scale=1.0):
wcs = Tan(wc... | dstndstnREPO_NAMEastrometry.netPATH_START.@astrometry.net_extracted@astrometry.net-main@net@galex_jpegs.py@.PATH_END.py |
{
"filename": "ImageAnalysis.ipynb",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/pyqtgraph/examples/notebooks/ImageAnalysis.ipynb",
"type": "Jupyter Notebook"
} | ```python
"""
Demonstrates common image analysis tools.
Many of the features demonstrated here are already provided by the ImageView
widget, but here we present a lower-level approach that provides finer control
over the user interface.
"""
from pyqtgraph.jupyter import GraphicsLayoutWidget
import ipywidgets
from IPyt... | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@pyqtgraph@examples@notebooks@ImageAnalysis.ipynb@.PATH_END.py |
{
"filename": "_value.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/surface/colorbar/tickformatstop/_value.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ValueValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="value",
parent_name="surface.colorbar.tickformatstop",
**kwargs,
):
super(ValueValidator, self).__init__(
plotly_name=plo... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@surface@colorbar@tickformatstop@_value.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "DLR-RM/stable-baselines3",
"repo_path": "stable-baselines3_extracted/stable-baselines3-master/stable_baselines3/__init__.py",
"type": "Python"
} | import os
from stable_baselines3.a2c import A2C
from stable_baselines3.common.utils import get_system_info
from stable_baselines3.ddpg import DDPG
from stable_baselines3.dqn import DQN
from stable_baselines3.her.her_replay_buffer import HerReplayBuffer
from stable_baselines3.ppo import PPO
from stable_baselines3.sac i... | DLR-RMREPO_NAMEstable-baselines3PATH_START.@stable-baselines3_extracted@stable-baselines3-master@stable_baselines3@__init__.py@.PATH_END.py |
{
"filename": "metrics.py",
"repo_name": "ML4GW/aframe",
"repo_path": "aframe_extracted/aframe-main/projects/train/train/metrics.py",
"type": "Python"
} | import itertools
from collections import defaultdict
from typing import Optional
import torch
from torchmetrics import Metric
from torchmetrics.classification import BinaryAUROC
from utils import x_per_y
class TimeSlideAUROC(Metric):
"""
Metric that computes the area under the ROC curve (AUROC)
using ti... | ML4GWREPO_NAMEaframePATH_START.@aframe_extracted@aframe-main@projects@train@train@metrics.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "dpiras/cosmopower-jax",
"repo_path": "cosmopower-jax_extracted/cosmopower-jax-main/cosmopower_jax/trained_models/__init__.py",
"type": "Python"
} | dpirasREPO_NAMEcosmopower-jaxPATH_START.@cosmopower-jax_extracted@cosmopower-jax-main@cosmopower_jax@trained_models@__init__.py@.PATH_END.py | |
{
"filename": "PowerSpectrum.py",
"repo_name": "mirochaj/ares",
"repo_path": "ares_extracted/ares-main/ares/analysis/PowerSpectrum.py",
"type": "Python"
} | import numpy as np
from ..util import labels
import matplotlib.pyplot as pl
from .Global21cm import Global21cm
from ..util.Misc import split_by_sign
from scipy.interpolate import interp1d
from ..physics.Constants import nu_0_mhz
from matplotlib.ticker import ScalarFormatter
from ..analysis.BlobFactory import BlobFactor... | mirochajREPO_NAMEaresPATH_START.@ares_extracted@ares-main@ares@analysis@PowerSpectrum.py@.PATH_END.py |
{
"filename": "misc.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/yt/frontends/exodus_ii/misc.py",
"type": "Python"
} | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@yt@frontends@exodus_ii@misc.py@.PATH_END.py | |
{
"filename": "_marker.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/violin/unselected/_marker.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MarkerValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="marker", parent_name="violin.unselected", **kwargs):
super(MarkerValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@violin@unselected@_marker.py@.PATH_END.py |
{
"filename": "LICENSE.md",
"repo_name": "ifauh/spin4d-data",
"repo_path": "spin4d-data_extracted/spin4d-data-main/LICENSE.md",
"type": "Markdown"
} | GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Pream... | ifauhREPO_NAMEspin4d-dataPATH_START.@spin4d-data_extracted@spin4d-data-main@LICENSE.md@.PATH_END.py |
{
"filename": "common.py",
"repo_name": "drphilmarshall/HumVI",
"repo_path": "HumVI_extracted/HumVI-master/attic/misc/common.py",
"type": "Python"
} | """
Some things that all modules might need.
"""
##========================================================
## Precision cutoff
cutoff = 1e-8
##========================================================
## Current line number
import inspect
def lineno():
return inspect.currentframe().f_back.f_lineno
| drphilmarshallREPO_NAMEHumVIPATH_START.@HumVI_extracted@HumVI-master@attic@misc@common.py@.PATH_END.py |
{
"filename": "CCD.py",
"repo_name": "mtalapinto/moes",
"repo_path": "fideos/optics/CCD.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
def load():
detector_size = 4096
pix_size = 15e-3
return detector_size, pix_size
def mm2pix(ws):
pix_size_arr = np.full(len(ws), 15.e-3)
detector_size_x = 2048.
detector_size_y = 2048.
ws['x'] = -ws['x']
ws['y'] = ws['y'] / pix_size_... | mtalapintoREPO_NAMEmoesPATH_START.@fideos@optics@CCD.py@.PATH_END.py |
{
"filename": "lensing_matching.py",
"repo_name": "dylancromer/maszcal",
"repo_path": "maszcal_extracted/maszcal-main/spec/lensing_matching.py",
"type": "Python"
} | from dataclasses import dataclass
import pytest
import numpy as np
import astropy.units as u
import maszcal.lensing
import maszcal.cosmology
def fake_scattered_lensing_func(rs, zs, mus, *params):
return np.ones(rs.shape[0:1] + mus.shape + zs.shape + (params[0].size,))
def fake_lensing_func(rs, zs, mus, *params)... | dylancromerREPO_NAMEmaszcalPATH_START.@maszcal_extracted@maszcal-main@spec@lensing_matching.py@.PATH_END.py |
{
"filename": "_variantsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/funnel/insidetextfont/_variantsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="variantsrc", parent_name="funnel.insidetextfont", **kwargs
):
super(VariantsrcValidator, self).__init__(
plotly_name=plotly_name,
p... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@funnel@insidetextfont@_variantsrc.py@.PATH_END.py |
{
"filename": "_yref.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/coloraxis/colorbar/_yref.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YrefValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="yref", parent_name="layout.coloraxis.colorbar", **kwargs
):
super(YrefValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@coloraxis@colorbar@_yref.py@.PATH_END.py |
{
"filename": "_len.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter3d/line/colorbar/_len.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="len", parent_name="scatter3d.line.colorbar", **kwargs
):
super(LenValidator, self).__init__(
plotly_name=plotly_name,
parent_name=paren... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter3d@line@colorbar@_len.py@.PATH_END.py |
{
"filename": "_hovertextsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/densitymapbox/_hovertextsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HovertextsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="hovertextsrc", parent_name="densitymapbox", **kwargs
):
super(HovertextsrcValidator, self).__init__(
plotly_name=plotly_name,
par... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@densitymapbox@_hovertextsrc.py@.PATH_END.py |
{
"filename": "compressed.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/astropy/io/fits/hdu/compressed/compressed.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import ctypes
import math
import time
import warnings
import numpy as np
from astropy.io.fits.fitsrec import FITS_rec
from astropy.io.fits.hdu.base import BITPIX2DTYPE, DELAYED
from astropy.io.fits.hdu.compressed._quantization import DITHER_METHODS
from... | astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@io@fits@hdu@compressed@compressed.py@.PATH_END.py |
{
"filename": "mortality.py",
"repo_name": "pyro-ppl/numpyro",
"repo_path": "numpyro_extracted/numpyro-master/examples/mortality.py",
"type": "Python"
} | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
"""
Example: Modelling mortality over space and time
================================================
This example is adapted from [1]. The model in the paper estimates death rates for 6791 small
areas in England for 19 age groups (0,... | pyro-pplREPO_NAMEnumpyroPATH_START.@numpyro_extracted@numpyro-master@examples@mortality.py@.PATH_END.py |
{
"filename": "test_most_remote.py",
"repo_name": "D-arioSpace/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/ipac/irsa/tests/test_most_remote.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import pytest
import numpy as np
import astropy.io.fits as fits
from astropy.table import Table
from astroquery.ipac.irsa import Most
from astroquery.exceptions import InvalidQueryError, NoResultsWarning
# each MOST query is given a PID and a ... | D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@ipac@irsa@tests@test_most_remote.py@.PATH_END.py |
{
"filename": "comparison-signal-noise.py",
"repo_name": "jolideco/jolideco-paper",
"repo_path": "jolideco-paper_extracted/jolideco-paper-main/src/scripts/comparison-signal-noise.py",
"type": "Python"
} | import config
import matplotlib.lines as lines
import numpy as np
import paths
from astropy.io import fits
from astropy.visualization import simple_norm
from matplotlib import pyplot as plt
scenario_titles = {
"D1": {
"name": "spiral1",
"plot": {"max_cut": 10.0, "asinh_a": 0.02},
},
"D2": {... | jolidecoREPO_NAMEjolideco-paperPATH_START.@jolideco-paper_extracted@jolideco-paper-main@src@scripts@comparison-signal-noise.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/tsa/regime_switching/tests/results/__init__.py",
"type": "Python"
} | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@tsa@regime_switching@tests@results@__init__.py@.PATH_END.py | |
{
"filename": "_layerdefaults.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/mapbox/_layerdefaults.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LayerdefaultsValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="layerdefaults", parent_name="layout.mapbox", **kwargs
):
super(LayerdefaultsValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@mapbox@_layerdefaults.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "simonsobs/nextline-rdb",
"repo_path": "nextline-rdb_extracted/nextline-rdb-main/src/nextline_rdb/alembic/models/rev_f3edea6dbde2/tests/__init__.py",
"type": "Python"
} | simonsobsREPO_NAMEnextline-rdbPATH_START.@nextline-rdb_extracted@nextline-rdb-main@src@nextline_rdb@alembic@models@rev_f3edea6dbde2@tests@__init__.py@.PATH_END.py | |
{
"filename": "remove_fstrings.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/pythran/pythran/transformations/remove_fstrings.py",
"type": "Python"
} | """Turns f-strings to format syntax with modulus"""
import gast as ast
from pythran.passmanager import Transformation
from pythran.syntax import PythranSyntaxError
class RemoveFStrings(Transformation, ast.NodeTransformer):
"""Turns f-strings to format syntax with modulus
>>> import gast as ast
>>> from... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@pythran@pythran@transformations@remove_fstrings.py@.PATH_END.py |
{
"filename": "_tickangle.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattergl/marker/colorbar/_tickangle.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickangleValidator(_plotly_utils.basevalidators.AngleValidator):
def __init__(
self, plotly_name="tickangle", parent_name="scattergl.marker.colorbar", **kwargs
):
super(TickangleValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattergl@marker@colorbar@_tickangle.py@.PATH_END.py |
{
"filename": "_hoverlabel.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/violin/_hoverlabel.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Hoverlabel(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "violin"
_path_str = "violin.hoverlabel"
_valid_props = {
"align",
"align... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@violin@_hoverlabel.py@.PATH_END.py |
{
"filename": "_legendgroup.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattergeo/_legendgroup.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LegendgroupValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="legendgroup", parent_name="scattergeo", **kwargs):
super(LegendgroupValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_n... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattergeo@_legendgroup.py@.PATH_END.py |
{
"filename": "rate_limiters.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/core/langchain_core/rate_limiters.py",
"type": "Python"
} | """Interface for a rate limiter and an in-memory rate limiter."""
from __future__ import annotations
import abc
import asyncio
import threading
import time
from typing import (
Optional,
)
from langchain_core._api import beta
@beta(message="Introduced in 0.2.24. API subject to change.")
class BaseRateLimiter(a... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@core@langchain_core@rate_limiters.py@.PATH_END.py |
{
"filename": "partial_tipsy_test.py",
"repo_name": "pynbody/pynbody",
"repo_path": "pynbody_extracted/pynbody-master/tests/partial_tipsy_test.py",
"type": "Python"
} | import numpy as np
import pytest
import pynbody
import pynbody.test_utils
@pytest.fixture(scope='module', autouse=True)
def get_data():
pynbody.test_utils.ensure_test_data_available("gasoline_ahf")
def test_indexing():
f1 = pynbody.load("testdata/gasoline_ahf/g15784.lr.01024")
np.random.seed(1)
for... | pynbodyREPO_NAMEpynbodyPATH_START.@pynbody_extracted@pynbody-master@tests@partial_tipsy_test.py@.PATH_END.py |
{
"filename": "PropertyMaps.py",
"repo_name": "GBTAmmoniaSurvey/GAS",
"repo_path": "GAS_extracted/GAS-master/GAS/PropertyMaps.py",
"type": "Python"
} | import pyspeckit
import astropy.io.fits as fits
import numpy as np
import os
import warnings
from .first_look import trim_edge_cube
from spectral_cube import SpectralCube
from pyspeckit.spectrum.models.ammonia_constants import voff_lines_dict
import astropy.constants as con
import astropy.units as u
import matplotlib.p... | GBTAmmoniaSurveyREPO_NAMEGASPATH_START.@GAS_extracted@GAS-master@GAS@PropertyMaps.py@.PATH_END.py |
{
"filename": "base.py",
"repo_name": "davidharvey1986/pyRRG",
"repo_path": "pyRRG_extracted/pyRRG-master/unittests/bugFixPyRRG/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/base.py",
"type": "Python"
} | from pip._vendor.packaging.utils import canonicalize_name
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import Optional, Sequence, Set
from pip._internal.req.req_install import InstallRequirement
from pip._vendor.packaging.version import _BaseVersion
def f... | davidharvey1986REPO_NAMEpyRRGPATH_START.@pyRRG_extracted@pyRRG-master@unittests@bugFixPyRRG@lib@python3.7@site-packages@pip@_internal@resolution@resolvelib@base.py@.PATH_END.py |
{
"filename": "_variant.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/pie/legendgrouptitle/font/_variant.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="variant", parent_name="pie.legendgrouptitle.font", **kwargs
):
super(VariantValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@pie@legendgrouptitle@font@_variant.py@.PATH_END.py |
{
"filename": "xkcd_rgb.py",
"repo_name": "mwaskom/seaborn",
"repo_path": "seaborn_extracted/seaborn-master/seaborn/colors/xkcd_rgb.py",
"type": "Python"
} | xkcd_rgb = {'acid green': '#8ffe09',
'adobe': '#bd6c48',
'algae': '#54ac68',
'algae green': '#21c36f',
'almost black': '#070d0d',
'amber': '#feb308',
'amethyst': '#9b5fc0',
'apple': '#6ecb3c',
'apple green': '#76cd26',
... | mwaskomREPO_NAMEseabornPATH_START.@seaborn_extracted@seaborn-master@seaborn@colors@xkcd_rgb.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/Pygments/py3/pygments/lexers/__init__.py",
"type": "Python"
} | """
pygments.lexers
~~~~~~~~~~~~~~~
Pygments lexers.
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import types
import fnmatch
from os.path import basename
from pygments.lexers._mapping import LEXERS
from pygme... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@Pygments@py3@pygments@lexers@__init__.py@.PATH_END.py |
{
"filename": "SentencePieceTokenizerOptionsAddVocabFile.md",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/lite/g3doc/api_docs/python/tflite_support/metadata_schema_py_generated/SentencePieceTokenizerOptionsAddVocabFile.md",
"type": "Markdown"
} | page_type: reference
<link rel="stylesheet" href="/site-assets/css/style.css">
<!-- DO NOT EDIT! Automatically generated file. -->
<div itemscope itemtype="http://developers.google.com/ReferenceObject">
<meta itemprop="name" content="tflite_support.metadata_schema_py_generated.SentencePieceTokenizerOptionsAddVocabFi... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@lite@g3doc@api_docs@python@tflite_support@metadata_schema_py_generated@SentencePieceTokenizerOptionsAddVocabFile.md@.PATH_END.py |
{
"filename": "samples_helpers.py",
"repo_name": "adrn/thejoker",
"repo_path": "thejoker_extracted/thejoker-main/thejoker/samples_helpers.py",
"type": "Python"
} | # Standard library
import os
import warnings
from astropy.io.misc.hdf5 import _encode_mixins, meta_path
# Third-party
from astropy.table.meta import get_header_from_yaml, get_yaml_from_table
from astropy.utils import metadata
from astropy.utils.exceptions import AstropyUserWarning
def _custom_tbl_dtype_compare(dtyp... | adrnREPO_NAMEthejokerPATH_START.@thejoker_extracted@thejoker-main@thejoker@samples_helpers.py@.PATH_END.py |
{
"filename": "aperphotresult.py",
"repo_name": "juanep97/iop4",
"repo_path": "iop4_extracted/iop4-main/iop4lib/db/aperphotresult.py",
"type": "Python"
} | # iop4lib config
import iop4lib.config
iop4conf = iop4lib.Config(config_db=False)
# django imports
from django.db import models
# other imports
import os
import io
import numpy as np
import matplotlib as mplt
import matplotlib.pyplot as plt
from astropy.visualization.mpl_normalize import ImageNormalize
from astropy.... | juanep97REPO_NAMEiop4PATH_START.@iop4_extracted@iop4-main@iop4lib@db@aperphotresult.py@.PATH_END.py |
{
"filename": "thindisk.py",
"repo_name": "ricardoclandim/NIRVANA",
"repo_path": "NIRVANA_extracted/NIRVANA-master/nirvana/models/thindisk.py",
"type": "Python"
} | """
Base class for thin disk models.
.. include common links, assuming primary doc root is up one directory
.. include:: ../include/links.rst
"""
import warnings
from IPython import embed
import numpy as np
from scipy import optimize
from .beam import ConvolveFFTW
from .util import cov_err
from ..data.kinematics i... | ricardoclandimREPO_NAMENIRVANAPATH_START.@NIRVANA_extracted@NIRVANA-master@nirvana@models@thindisk.py@.PATH_END.py |
{
"filename": "TestGradFieldList.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/tests/unit/FieldOperations/TestGradFieldList.py",
"type": "Python"
} | from Spheral import *
from SpheralTestUtilities import *
from SpheralGnuPlotUtilities import *
################################################################################
n1, n2 = 50, 50
rho1, rho2 = 1.0, 1.0
m1, m2 = 0.5*rho1/n1, 0.5*rho2/n2
eps0 = 0.0
epsMultiplier = 1.0
v1, v2 = Vector1d(1.0), Vector1d(-1.0)
x... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@tests@unit@FieldOperations@TestGradFieldList.py@.PATH_END.py |
{
"filename": "kepmsg.py",
"repo_name": "barentsen/dave",
"repo_path": "dave_extracted/dave-master/detrendThis/kepmsg.py",
"type": "Python"
} | #!/usr/bin/env python
import sys, time, string
# -----------------------------------------------------------
# write message to log file and shell
def log(file,message,verbose):
if (verbose):
# print to shell
print (message)
# print to log file
if (file):
output = open(file,'a')
output.write(mes... | barentsenREPO_NAMEdavePATH_START.@dave_extracted@dave-master@detrendThis@kepmsg.py@.PATH_END.py |
{
"filename": "_style.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/indicator/gauge/axis/tickfont/_style.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class StyleValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="style", parent_name="indicator.gauge.axis.tickfont", **kwargs
):
super(StyleValidator, self).__init__(
plotly_name=plotly_name,
p... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@indicator@gauge@axis@tickfont@_style.py@.PATH_END.py |
{
"filename": "config.py",
"repo_name": "huggingface/peft",
"repo_path": "peft_extracted/peft-main/src/peft/tuners/lora/config.py",
"type": "Python"
} | # Copyright 2023-present the HuggingFace Inc. team.
#
# 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... | huggingfaceREPO_NAMEpeftPATH_START.@peft_extracted@peft-main@src@peft@tuners@lora@config.py@.PATH_END.py |
{
"filename": "test_block_reference.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/tests/blocks/test_block_reference.py",
"type": "Python"
} | import asyncio
import warnings
from typing import Type
from uuid import UUID, uuid4
import pydantic
import pytest
from prefect.blocks.core import Block
from prefect.exceptions import ParameterTypeError
from prefect.flows import flow
class TestBlockReference:
class ReferencedBlock(Block):
a: int
... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@tests@blocks@test_block_reference.py@.PATH_END.py |
{
"filename": "_text.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/scene/yaxis/title/_text.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="text", parent_name="layout.scene.yaxis.title", **kwargs
):
super(TextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@scene@yaxis@title@_text.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/layout/slider/currentvalue/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._font import Font
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(__name__, [], ["._font.Font"])
| plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@layout@slider@currentvalue@__init__.py@.PATH_END.py |
{
"filename": "2_inference_per_image.ipynb",
"repo_name": "smsharma/mining-for-substructure-lens",
"repo_path": "mining-for-substructure-lens_extracted/mining-for-substructure-lens-master/notebooks/2_inference_per_image.ipynb",
"type": "Jupyter Notebook"
} | # Evaluate likelihood ratio
```python
import sys, os
sys.path.append('../')
import logging
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.colors import colorConverter
from scipy.stats import norm
from sklearn.metrics import roc_curve
from inference.utils import s_from_r, shuffl... | smsharmaREPO_NAMEmining-for-substructure-lensPATH_START.@mining-for-substructure-lens_extracted@mining-for-substructure-lens-master@notebooks@2_inference_per_image.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "s-ilic/ECLAIR",
"repo_path": "ECLAIR_extracted/ECLAIR-master/likelihoods/BG/BAO/DESI/ELG_Z2/__init__.py",
"type": "Python"
} | import numpy as np
# BAO likelihoods corresponding to the arXiv release on April 5, 2024, see:
# - https://arxiv.org/abs/2404.03000
# - https://arxiv.org/abs/2404.03001
# - https://arxiv.org/abs/2404.03002
# Here: ELG, 1.1 < z < 1.6
class likelihood:
def __init__(self, lkl_input):
self.z = np.array([1.317, 1.31... | s-ilicREPO_NAMEECLAIRPATH_START.@ECLAIR_extracted@ECLAIR-master@likelihoods@BG@BAO@DESI@ELG_Z2@__init__.py@.PATH_END.py |
{
"filename": "_thetasrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatterpolargl/_thetasrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ThetasrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="thetasrc", parent_name="scatterpolargl", **kwargs):
super(ThetasrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatterpolargl@_thetasrc.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "j0r1/GRALE2",
"repo_path": "GRALE2_extracted/GRALE2-master/pygrale/grale/editor/__init__.py",
"type": "Python"
} | import os
import sys
editorDir = os.path.join(os.path.dirname(__file__))
if not editorDir in sys.path:
sys.path.append(editorDir)
| j0r1REPO_NAMEGRALE2PATH_START.@GRALE2_extracted@GRALE2-master@pygrale@grale@editor@__init__.py@.PATH_END.py |
{
"filename": "lax_reference.py",
"repo_name": "jax-ml/jax",
"repo_path": "jax_extracted/jax-main/jax/_src/lax_reference.py",
"type": "Python"
} | # Copyright 2018 The JAX Authors.
#
# 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 wri... | jax-mlREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@_src@lax_reference.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter/legendgrouptitle/font/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="scatter.legendgrouptitle.font", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter@legendgrouptitle@font@_color.py@.PATH_END.py |
{
"filename": "html.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/astropy/io/votable/validator/html.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# STDLIB
import contextlib
import os
import re
from math import ceil
from astropy import online_docs_root
from astropy.io.votable import exceptions
from astropy.utils.xml.writer import XMLWriter, xml_escape
html_header = """<?xml version="1.0" encoding=... | astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@io@votable@validator@html.py@.PATH_END.py |
{
"filename": "resnet_torchvision_custom.py",
"repo_name": "mwalmsley/zoobot",
"repo_path": "zoobot_extracted/zoobot-main/zoobot/pytorch/deprecated/resnet_torchvision_custom.py",
"type": "Python"
} | import logging
import torch
import torchvision
def get_resnet(input_channels, use_imagenet_weights=False, include_top=False, **ignored_kwargs): # only colour supported
# https://pytorch.org/vision/stable/_modules/torchvision/models/resnet.html#resnet50 see here - could paste and adapt for greyscale if needed
... | mwalmsleyREPO_NAMEzoobotPATH_START.@zoobot_extracted@zoobot-main@zoobot@pytorch@deprecated@resnet_torchvision_custom.py@.PATH_END.py |
{
"filename": "radius_hse.py",
"repo_name": "lorenaacuna/GASTLI",
"repo_path": "GASTLI_extracted/GASTLI-main/src/radius_hse.py",
"type": "Python"
} |
import numpy as np
from gastli.fortspec import fort_spec as fs
kB = 1.3806488e-16
amu = 1.66053892e-24
def calc_radius_hydrostatic_equilibrium(temperatures_K,
MMWs_amu,
reference_gravity_cgs,
refer... | lorenaacunaREPO_NAMEGASTLIPATH_START.@GASTLI_extracted@GASTLI-main@src@radius_hse.py@.PATH_END.py |
{
"filename": "pr_checklist.md",
"repo_name": "arviz-devs/arviz",
"repo_path": "arviz_extracted/arviz-main/doc/source/contributing/pr_checklist.md",
"type": "Markdown"
} | (pr_checklist)=
# Pull request checklist
We recommend that your contribution complies with the following guidelines before you submit a pull request:
* If your pull request addresses an issue, please use the pull request title to describe the issue and mention the issue number in the pull request description. This wi... | arviz-devsREPO_NAMEarvizPATH_START.@arviz_extracted@arviz-main@doc@source@contributing@pr_checklist.md@.PATH_END.py |
{
"filename": "implicit_plane.py",
"repo_name": "enthought/mayavi",
"repo_path": "mayavi_extracted/mayavi-master/mayavi/components/implicit_plane.py",
"type": "Python"
} | """A component to manage an implicit plane widget.
"""
# Author: Prabhu Ramachandran <prabhu_r@users.sf.net>
# Copyright (c) 2005-2020, Enthought, Inc.
# License: BSD Style.
# Enthought library imports.
from traits.api import Instance, Bool, Property, Any
from traitsui.api import View, Group, Item, InstanceEditor
from... | enthoughtREPO_NAMEmayaviPATH_START.@mayavi_extracted@mayavi-master@mayavi@components@implicit_plane.py@.PATH_END.py |
{
"filename": "socp.py",
"repo_name": "cvxopt/cvxopt",
"repo_path": "cvxopt_extracted/cvxopt-master/examples/doc/chap8/socp.py",
"type": "Python"
} | # The small SOCP of section 8.5 (Second-order cone programming).
from cvxopt import matrix, solvers
c = matrix([-2., 1., 5.])
G = [ matrix( [[12., 13., 12.], [6., -3., -12.], [-5., -5., 6.]] ) ]
G += [ matrix( [[3., 3., -1., 1.], [-6., -6., -9., 19.], [10., -2., -2., -3.]] ) ]
h = [ matrix( [-12., -3., -2.] )... | cvxoptREPO_NAMEcvxoptPATH_START.@cvxopt_extracted@cvxopt-master@examples@doc@chap8@socp.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "kapteyn-astro/kapteyn",
"repo_path": "kapteyn_extracted/kapteyn-master/setup.py",
"type": "Python"
} | from setuptools import setup, Extension
import sys
sys.path.insert(0, ".")
from kapteyn import __version__ as version
from glob import glob
import sys, os
# from https://github.com/msabramo/cython-test/
# get cython before running setup(..)
#from setuptools.dist import Distribution
#Distribution(dict(setup_requires='... | kapteyn-astroREPO_NAMEkapteynPATH_START.@kapteyn_extracted@kapteyn-master@setup.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/choropleth/selected/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._marker import Marker
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(__name__, [], ["._marker.Marker"])
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@choropleth@selected@__init__.py@.PATH_END.py |
{
"filename": "model_analyzer.md",
"repo_name": "triton-inference-server/server",
"repo_path": "server_extracted/server-main/docs/user_guide/model_analyzer.md",
"type": "Markdown"
} | <!--
# Copyright (c) 2020-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, th... | triton-inference-serverREPO_NAMEserverPATH_START.@server_extracted@server-main@docs@user_guide@model_analyzer.md@.PATH_END.py |
{
"filename": "_step.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/indicator/gauge/_step.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Step(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "indicator.gauge"
_path_str = "indicator.gauge.step"
_valid_props = {"color", "line", "name", "... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@indicator@gauge@_step.py@.PATH_END.py |
{
"filename": "helpers.py",
"repo_name": "karllark/measure_extinction",
"repo_path": "measure_extinction_extracted/measure_extinction-master/measure_extinction/utils/helpers.py",
"type": "Python"
} | import os
__all__ = ["get_full_starfile"]
def get_full_starfile(starname):
"""
Get full path to the DAT file for the specified star
"""
if "dat" not in starname:
fstarname = "%s.dat" % starname
else:
fstarname = starname
if not os.path.isfile(fstarname):
# not an inst... | karllarkREPO_NAMEmeasure_extinctionPATH_START.@measure_extinction_extracted@measure_extinction-master@measure_extinction@utils@helpers.py@.PATH_END.py |
{
"filename": "test_hcongrid.py",
"repo_name": "keflavich/FITS_tools",
"repo_path": "FITS_tools_extracted/FITS_tools-master/FITS_tools/tests/test_hcongrid.py",
"type": "Python"
} | import numpy as np
from astropy.io import fits
from astropy.tests.helper import pytest
try:
import starlink
HAS_STARLINK = True
except ImportError:
HAS_STARLINK = False
header1 = """
SIMPLE = T / conforms to FITS standard
BITPIX = -64 / array data type
NAXIS = ... | keflavichREPO_NAMEFITS_toolsPATH_START.@FITS_tools_extracted@FITS_tools-master@FITS_tools@tests@test_hcongrid.py@.PATH_END.py |
{
"filename": "jsonutils.py",
"repo_name": "xraypy/xraylarch",
"repo_path": "xraylarch_extracted/xraylarch-master/larch/utils/jsonutils.py",
"type": "Python"
} | #!/usr/bin/env python
"""
json utilities for larch objects
"""
import json
import io
import numpy as np
import h5py
from datetime import datetime
from collections import namedtuple
from pathlib import Path, PosixPath
from types import ModuleType
import importlib
import logging
from lmfit import Parameter, Parameters... | xraypyREPO_NAMExraylarchPATH_START.@xraylarch_extracted@xraylarch-master@larch@utils@jsonutils.py@.PATH_END.py |
{
"filename": "test_issue_608.py",
"repo_name": "lucabaldini/ixpeobssim",
"repo_path": "ixpeobssim_extracted/ixpeobssim-main/tests/test_issue_608.py",
"type": "Python"
} | #!/usr/bin/env python
#
# Copyright (C) 2018, the ixpeobssim team.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
#... | lucabaldiniREPO_NAMEixpeobssimPATH_START.@ixpeobssim_extracted@ixpeobssim-main@tests@test_issue_608.py@.PATH_END.py |
{
"filename": "ArrowItem.py",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/pyqtgraph/graphicsItems/ArrowItem.py",
"type": "Python"
} | from math import hypot
from .. import functions as fn
from ..Qt import QtGui, QtWidgets
__all__ = ['ArrowItem']
class ArrowItem(QtWidgets.QGraphicsPathItem):
"""
For displaying scale-invariant arrows.
For arrows pointing to a location on a curve, see CurveArrow
"""
def __init__(sel... | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@pyqtgraph@graphicsItems@ArrowItem.py@.PATH_END.py |
{
"filename": "eisfitresult.py",
"repo_name": "USNavalResearchLaboratory/eispac",
"repo_path": "eispac_extracted/eispac-main/eispac/core/eisfitresult.py",
"type": "Python"
} | import copy
from datetime import datetime
import astropy.units as u
import numpy as np
from scipy.ndimage import shift as shift_img
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
from astropy.nddata import StdDevUncertainty
from eispac import __version__ as eispac_version
import eispac.core.fi... | USNavalResearchLaboratoryREPO_NAMEeispacPATH_START.@eispac_extracted@eispac-main@eispac@core@eisfitresult.py@.PATH_END.py |
{
"filename": "03_Fit.ipynb",
"repo_name": "ywx649999311/EzTao",
"repo_path": "EzTao_extracted/EzTao-master/docs/notebooks/03_Fit.ipynb",
"type": "Jupyter Notebook"
} | ## Fitting
Fitting CARMA models to time series data using __EzTao__ can be done in just one line. We demonstrate how to quickly get reliable best-fit CARMA parameters using the built-in fitting functions. However, you are not bound to the built-in functions; you can use the CARMA kernels to compute the likelihood and ... | ywx649999311REPO_NAMEEzTaoPATH_START.@EzTao_extracted@EzTao-master@docs@notebooks@03_Fit.ipynb@.PATH_END.py |
{
"filename": "train_fns.py",
"repo_name": "alercebroker/ATAT",
"repo_path": "ATAT_extracted/ATAT-main/train_fns.py",
"type": "Python"
} | ''' train_fns.py
Functions for the main loop of training
'''
import torch
def classifier_training_function_SSL(E, config, my_loss, **kwargs):
if config['predict_obj'] == 'lc':
predict_obj = E.predict_lc
elif config['predict_obj'] == 'tab':
predict_obj = E.predict_tab
elif config['predict_obj'] == 'm... | alercebrokerREPO_NAMEATATPATH_START.@ATAT_extracted@ATAT-main@train_fns.py@.PATH_END.py |
{
"filename": "_variant.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/parcats/labelfont/_variant.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="variant", parent_name="parcats.labelfont", **kwargs
):
super(VariantValidator, self).__init__(
plotly_name=plotly_name,
parent_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@parcats@labelfont@_variant.py@.PATH_END.py |
{
"filename": "_opacitysrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/histogram/marker/_opacitysrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OpacitysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="opacitysrc", parent_name="histogram.marker", **kwargs
):
super(OpacitysrcValidator, self).__init__(
plotly_name=plotly_name,
parent... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@histogram@marker@_opacitysrc.py@.PATH_END.py |
{
"filename": "augmentations.py",
"repo_name": "PolymathicAI/AstroCLIP",
"repo_path": "AstroCLIP_extracted/AstroCLIP-main/astroclip/astrodino/data/augmentations.py",
"type": "Python"
} | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the Apache License, Version 2.0
# found in the LICENSE file in the root directory of this source tree.
import logging
from typing import List
import numpy as np
import skimage.filters
import skimage.transform
import torch
from... | PolymathicAIREPO_NAMEAstroCLIPPATH_START.@AstroCLIP_extracted@AstroCLIP-main@astroclip@astrodino@data@augmentations.py@.PATH_END.py |
{
"filename": "recipes_SLITV.py",
"repo_name": "GeminiDRSoftware/GHOSTDR",
"repo_path": "GHOSTDR_extracted/GHOSTDR-master/ghostdr/ghost/recipes/qa/recipes_SLITV.py",
"type": "Python"
} | """
Recipes available to data with tags ['GHOST', 'SLITV'].
Default is "makeProcessedSlit".
"""
recipe_tags = set(['GHOST', 'SLITV'])
def makeProcessedSlit(p):
"""
This recipe processes GHOST science data.
Parameters
----------
p : Primitives object
A primitive set matching the recipe_tags... | GeminiDRSoftwareREPO_NAMEGHOSTDRPATH_START.@GHOSTDR_extracted@GHOSTDR-master@ghostdr@ghost@recipes@qa@recipes_SLITV.py@.PATH_END.py |
{
"filename": "2GC.py",
"repo_name": "IanHeywood/oxkat",
"repo_path": "oxkat_extracted/oxkat-master/setups/2GC.py",
"type": "Python"
} | #!/usr/bin/env python
# ian.heywood@physics.ox.ac.uk
import glob
import json
import os.path as o
import sys
sys.path.append(o.abspath(o.join(o.dirname(sys.modules[__name__].__file__), "..")))
from oxkat import generate_jobs as gen
from oxkat import config as cfg
def main():
USE_SINGULARITY = cfg.USE_SINGULAR... | IanHeywoodREPO_NAMEoxkatPATH_START.@oxkat_extracted@oxkat-master@setups@2GC.py@.PATH_END.py |
{
"filename": "xallarap.py",
"repo_name": "ebachelet/pyLIMA",
"repo_path": "pyLIMA_extracted/pyLIMA-master/pyLIMA/xallarap/xallarap.py",
"type": "Python"
} | import numpy as np
def xallarap_shifts(xallarap_model, time, pyLIMA_parameters, body='primary'):
if xallarap_model[0] == 'Static':
#if body != 'primary':
# separation_1 = pyLIMA_parameters.delta_t0/pyLIMA_parameters.tE
# separation_2 = pyLIMA_parameters.delta_u0
#else:
... | ebacheletREPO_NAMEpyLIMAPATH_START.@pyLIMA_extracted@pyLIMA-master@pyLIMA@xallarap@xallarap.py@.PATH_END.py |
{
"filename": "openmhd3d.py",
"repo_name": "zenitani/OpenMHD",
"repo_path": "OpenMHD_extracted/OpenMHD-master/3D_basic/openmhd3d.py",
"type": "Python"
} | ../visualization/openmhd3d.py | zenitaniREPO_NAMEOpenMHDPATH_START.@OpenMHD_extracted@OpenMHD-master@3D_basic@openmhd3d.py@.PATH_END.py |
{
"filename": "master_node.py",
"repo_name": "icecube/skyllh",
"repo_path": "skyllh_extracted/skyllh-master/skyllh/cluster/master_node.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
import logging
import socket
from skyllh.cluster.commands import (
ACK,
Command,
MSG,
ShutdownCN,
RegisterCN,
receive_command_from_socket,
)
class CNRegistryEntry(object):
"""This class provides an registry entry for a compute node. It holds the
socket to the ... | icecubeREPO_NAMEskyllhPATH_START.@skyllh_extracted@skyllh-master@skyllh@cluster@master_node.py@.PATH_END.py |
{
"filename": "regions.py",
"repo_name": "MESAHub/mesa",
"repo_path": "mesa_extracted/mesa-main/eos/plotter/regions.py",
"type": "Python"
} | #!/usr/bin/env python
import copy
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.colors as colors
plt.style.use('mesa_eos_regions.mplstyle')
def parse(fname):
nY, nX = np.loadtxt(fname, max_rows=1, skiprows=3, unpack=True, dtype=int)
data = np.loadtxt(fname, ski... | MESAHubREPO_NAMEmesaPATH_START.@mesa_extracted@mesa-main@eos@plotter@regions.py@.PATH_END.py |
{
"filename": "stage8.py",
"repo_name": "pyDANDIA/pyDANDIA",
"repo_path": "pyDANDIA_extracted/pyDANDIA-main/pyDANDIA/stage8.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 15 10:53:23 2019
@author: rstreet
"""
import numpy as np
import os
import sys
from astropy.io import fits
from astropy.table import Table, Column, vstack
from pyDANDIA import metadata
from pyDANDIA import logs
from pyDANDIA import phot_db
from pyDANDIA import photometry
i... | pyDANDIAREPO_NAMEpyDANDIAPATH_START.@pyDANDIA_extracted@pyDANDIA-main@pyDANDIA@stage8.py@.PATH_END.py |
{
"filename": "bertotti_kasner.py",
"repo_name": "einsteinpy/einsteinpy",
"repo_path": "einsteinpy_extracted/einsteinpy-main/src/einsteinpy/symbolic/predefined/bertotti_kasner.py",
"type": "Python"
} | from sympy import diag, exp, sin, sqrt, symbols
from einsteinpy.symbolic import constants
from einsteinpy.symbolic.metric import MetricTensor
def BertottiKasner(c=constants.c, k=symbols("k"), lambd=symbols("l")):
"""
Birkhoff's theorem with Λ-term and Bertotti-Kasner space
Phys. Lett. A, 245:363-365, 199... | einsteinpyREPO_NAMEeinsteinpyPATH_START.@einsteinpy_extracted@einsteinpy-main@src@einsteinpy@symbolic@predefined@bertotti_kasner.py@.PATH_END.py |
{
"filename": "f77.py",
"repo_name": "rat-pac/rat-pac",
"repo_path": "rat-pac_extracted/rat-pac-master/python/SCons/Tool/f77.py",
"type": "Python"
} | """engine.SCons.Tool.f77
Tool-specific initialization for the generic Posix f77 Fortran compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2... | rat-pacREPO_NAMErat-pacPATH_START.@rat-pac_extracted@rat-pac-master@python@SCons@Tool@f77.py@.PATH_END.py |
{
"filename": "app_logic.py",
"repo_name": "RozanskiT/suppnet",
"repo_path": "suppnet_extracted/suppnet-main/app_components/app_logic.py",
"type": "Python"
} | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import sys
import os
from scipy.interpolate import UnivariateSpline
from tensorflow.keras.models import load_model
from suppnet.NN_utility import ProcessSpectrum, MinMaxNormalizer
from app_components.interactive_spline import Interactiv... | RozanskiTREPO_NAMEsuppnetPATH_START.@suppnet_extracted@suppnet-main@app_components@app_logic.py@.PATH_END.py |
{
"filename": "test_pwn.py",
"repo_name": "gammapy/gammapy",
"repo_path": "gammapy_extracted/gammapy-main/gammapy/astro/source/tests/test_pwn.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from numpy.testing import assert_allclose
from astropy.units import Quantity
from gammapy.astro.source import PWN
t = Quantity([0, 1, 10, 100, 1000, 10000, 100000], "yr")
pwn = PWN()
def test_PWN_radius():
"""Test SNR luminosity""... | gammapyREPO_NAMEgammapyPATH_START.@gammapy_extracted@gammapy-main@gammapy@astro@source@tests@test_pwn.py@.PATH_END.py |
{
"filename": "_ni_support.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/ndimage/_ni_support.py",
"type": "Python"
} | # Copyright (C) 2003-2005 Peter J. Verveer
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following d... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@ndimage@_ni_support.py@.PATH_END.py |
{
"filename": "test_paths.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/io/tests/test_paths.py",
"type": "Python"
} | """
Ensure that we can use pathlib.Path objects in all relevant IO functions.
"""
from pathlib import Path
import numpy as np
import scipy.io
import scipy.io.wavfile
from scipy._lib._tmpdirs import tempdir
import scipy.sparse
import yatest.common as yc
class TestPaths:
data = np.arange(5).astype(np.int64)
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@io@tests@test_paths.py@.PATH_END.py |
{
"filename": "qif.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/genmod/qif.py",
"type": "Python"
} | import numpy as np
from collections import defaultdict
import statsmodels.base.model as base
from statsmodels.genmod import families
from statsmodels.genmod.generalized_linear_model import GLM
from statsmodels.genmod.families import links
from statsmodels.genmod.families import varfuncs
import statsmodels.regression.li... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@genmod@qif.py@.PATH_END.py |
{
"filename": "amrkdtree_downsampling.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/doc/source/cookbook/amrkdtree_downsampling.py",
"type": "Python"
} | # Using AMRKDTree Homogenized Volumes to examine large datasets
# at lower resolution.
# In this example we will show how to use the AMRKDTree to take a simulation
# with 8 levels of refinement and only use levels 0-3 to render the dataset.
# Currently this cookbook is flawed in that the data that is covered by the
#... | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@doc@source@cookbook@amrkdtree_downsampling.py@.PATH_END.py |
{
"filename": "lax_numpy_einsum_test.py",
"repo_name": "google/jax",
"repo_path": "jax_extracted/jax-main/tests/lax_numpy_einsum_test.py",
"type": "Python"
} | # Copyright 2018 The JAX Authors.
#
# 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 wri... | googleREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@tests@lax_numpy_einsum_test.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "dsavransky/EXOSIMS",
"repo_path": "EXOSIMS_extracted/EXOSIMS-master/EXOSIMS/PostProcessing/__init__.py",
"type": "Python"
} | dsavranskyREPO_NAMEEXOSIMSPATH_START.@EXOSIMS_extracted@EXOSIMS-master@EXOSIMS@PostProcessing@__init__.py@.PATH_END.py | |
{
"filename": "test_get.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/series/indexing/test_get.py",
"type": "Python"
} | import numpy as np
import pytest
import pandas as pd
from pandas import (
DatetimeIndex,
Index,
Series,
date_range,
)
import pandas._testing as tm
def test_get():
# GH 6383
s = Series(
np.array(
[
43,
48,
60,
... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@series@indexing@test_get.py@.PATH_END.py |
{
"filename": "NeuralNetUtilities.py",
"repo_name": "dokester/BayesicFitting",
"repo_path": "BayesicFitting_extracted/BayesicFitting-master/BayesicFitting/source/NeuralNetUtilities.py",
"type": "Python"
} | import numpy as numpy
from astropy import units
import math
from . import Tools
from .Tools import setAttribute as setatt
from .Formatter import formatter as fmt
__author__ = "Do Kester"
__year__ = 2024
__license__ = "GPL3"
__version__ = "3.2.3"
__url__ = "https://www.bayesicfitting.nl"
__status__ = "Alpha"
# * Th... | dokesterREPO_NAMEBayesicFittingPATH_START.@BayesicFitting_extracted@BayesicFitting-master@BayesicFitting@source@NeuralNetUtilities.py@.PATH_END.py |
{
"filename": "event_plotter.py",
"repo_name": "claudiok/clsim",
"repo_path": "clsim_extracted/clsim-master/resources/scripts/MICA/event_plotter.py",
"type": "Python"
} | from __future__ import print_function
from I3Tray import I3Units
from icecube import icetray, dataclasses, dataio
from icecube import clsim
import math
import numpy
#import pylab
#import scipy
#import scipy.interpolate
#import scipy.integrate
import matplotlib
matplotlib.use("PDF")
from mpl_toolkits.axes_grid.anchor... | claudiokREPO_NAMEclsimPATH_START.@clsim_extracted@clsim-master@resources@scripts@MICA@event_plotter.py@.PATH_END.py |
{
"filename": "plottools.py",
"repo_name": "andizq/discminer",
"repo_path": "discminer_extracted/discminer-main/discminer/plottools.py",
"type": "Python"
} | """
plottools module
===========
"""
import os
import copy
import matplotlib
import numpy as np
from math import ceil
import scipy.stats as st
import astropy.units as u
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib.colors import ListedColormap
from collections.abc import Iterable
... | andizqREPO_NAMEdiscminerPATH_START.@discminer_extracted@discminer-main@discminer@plottools.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "gotsunami/Youpi",
"repo_path": "Youpi_extracted/Youpi-master/terapix/reporting/__init__.py",
"type": "Python"
} | import string, types
class ReportFormat(object):
"""
Available report formats
"""
CSV, PDF, HTML, LATEX, PS, TARBALL = ('CSV', 'PDF', 'HTML', 'LaTeX', 'Postscript', 'Tarball',)
@staticmethod
def formats():
return map(lambda x: {'name': x[0], 'ext': x[1]}, (
(ReportFormat.CSV, 'csv'),
(ReportFormat.HTML,... | gotsunamiREPO_NAMEYoupiPATH_START.@Youpi_extracted@Youpi-master@terapix@reporting@__init__.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.