metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "_lineposition.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/polar/angularaxis/tickfont/_lineposition.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LinepositionValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(
self,
plotly_name="lineposition",
parent_name="layout.polar.angularaxis.tickfont",
**kwargs,
):
super(LinepositionValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@polar@angularaxis@tickfont@_lineposition.py@.PATH_END.py |
{
"filename": "pinned_memory_metrics_test.py",
"repo_name": "triton-inference-server/server",
"repo_path": "server_extracted/server-main/qa/L0_metrics/pinned_memory_metrics_test.py",
"type": "Python"
} | #!/usr/bin/python
# Copyright 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... | triton-inference-serverREPO_NAMEserverPATH_START.@server_extracted@server-main@qa@L0_metrics@pinned_memory_metrics_test.py@.PATH_END.py |
{
"filename": "ibm.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/numpy/py2/numpy/distutils/fcompiler/ibm.py",
"type": "Python"
} | from __future__ import division, absolute_import, print_function
import os
import re
import sys
import subprocess
from numpy.distutils.fcompiler import FCompiler
from numpy.distutils.exec_command import find_executable
from numpy.distutils.misc_util import make_temp_file
from distutils import log
compilers = ['IBMFC... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@numpy@py2@numpy@distutils@fcompiler@ibm.py@.PATH_END.py |
{
"filename": "_steps.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/indicator/gauge/_steps.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class StepsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(self, plotly_name="steps", parent_name="indicator.gauge", **kwargs):
super(StepsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@indicator@gauge@_steps.py@.PATH_END.py |
{
"filename": "_spikesnap.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/yaxis/_spikesnap.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SpikesnapValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="spikesnap", parent_name="layout.yaxis", **kwargs):
super(SpikesnapValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_n... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@yaxis@_spikesnap.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "esandford/EightBitTransit",
"repo_path": "EightBitTransit_extracted/EightBitTransit-master/setup.py",
"type": "Python"
} | # to run: python setup.py build_ext --inplace
#from setuptools import setup,Extension
import numpy as np
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
#setup(ext_modules=cythonize('EightBitTransit/cGridFunctions.pyx'))
#setup(ext_modules=cythonize('EightB... | esandfordREPO_NAMEEightBitTransitPATH_START.@EightBitTransit_extracted@EightBitTransit-master@setup.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "bradkav/AntiparticleDM",
"repo_path": "AntiparticleDM_extracted/AntiparticleDM-master/results/README.md",
"type": "Markdown"
} | # AntiparticleDM - results
Results generated using the scripts in the `calc` folder.
The results folder have the format `AP_ExptX_YY` where `X` is the experimental ensemble (`A`, `B`, `C` or `D`) and `YY` is the DM mass in GeV. Within each folder, the results are labeled by an index specifying the point in DM-couplin... | bradkavREPO_NAMEAntiparticleDMPATH_START.@AntiparticleDM_extracted@AntiparticleDM-master@results@README.md@.PATH_END.py |
{
"filename": "irtyshII.ipynb",
"repo_name": "j0r1/GRALE2",
"repo_path": "GRALE2_extracted/GRALE2-master/pygrale/doc/source/_static/irtyshII.ipynb",
"type": "Jupyter Notebook"
} | This notebook shows how the model for IrtyshII, see [Free-form grale lens inversion of galaxy clusters with up to 1000 multiple images](https://ui.adsabs.harvard.edu/abs/2020MNRAS.494.3998G/abstract), can be imported as a Grale model. The
cluster itself was modeled using [gravlens/lensmodel](https://www.physics.rutgers... | j0r1REPO_NAMEGRALE2PATH_START.@GRALE2_extracted@GRALE2-master@pygrale@doc@source@_static@irtyshII.ipynb@.PATH_END.py |
{
"filename": "aqua.ipynb",
"repo_name": "nichollsh/AGNI",
"repo_path": "AGNI_extracted/AGNI-main/misc/aqua.ipynb",
"type": "Jupyter Notebook"
} | ```julia
import ScatteredInterpolation
import DelimitedFiles
using Plots
```
```julia
fpath = "../res/realgas/aqua_eos_pt_v1_0.dat"
# Read the file
println("Reading AQUA table at '$fpath'")
data::Array{Float64,2} = DelimitedFiles.readdlm(fpath, Float64; header=false, skipstart=19)
# Define phases
phases = Dict{Inte... | nichollshREPO_NAMEAGNIPATH_START.@AGNI_extracted@AGNI-main@misc@aqua.ipynb@.PATH_END.py |
{
"filename": "_variantsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/icicle/outsidetextfont/_variantsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="variantsrc", parent_name="icicle.outsidetextfont", **kwargs
):
super(VariantsrcValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@icicle@outsidetextfont@_variantsrc.py@.PATH_END.py |
{
"filename": "images_utils.py",
"repo_name": "aabdurrouf/piXedfit",
"repo_path": "piXedfit_extracted/piXedfit-main/piXedfit/piXedfit_images/images_utils.py",
"type": "Python"
} | import numpy as np
from math import pi, pow, sqrt, cos, sin
import sys, os
from astropy.io import fits
from astropy.table import Table
from astropy.cosmology import *
import warnings
warnings.filterwarnings('ignore')
from ..utils.filtering import cwave_filters
__all__ = ["sort_filters", "kpc_per_pixel", "k_lmbd_F... | aabdurroufREPO_NAMEpiXedfitPATH_START.@piXedfit_extracted@piXedfit-main@piXedfit@piXedfit_images@images_utils.py@.PATH_END.py |
{
"filename": "test_load_smah_data.py",
"repo_name": "ArgonneCPAC/diffstar",
"repo_path": "diffstar_extracted/diffstar-main/diffstar/data_loaders/tests/test_load_smah_data.py",
"type": "Python"
} | """
"""
import os
import numpy as np
from ..load_smah_data import load_fit_mah_tpeak
_THIS_DRNAME = os.path.dirname(os.path.abspath(__file__))
def test_load_fit_mah_tpeak():
basename = "subvol_000_diffmah_fits.h5"
data_drn = os.path.join(_THIS_DRNAME, "testing_data")
_res = load_fit_mah_tpeak(basename... | ArgonneCPACREPO_NAMEdiffstarPATH_START.@diffstar_extracted@diffstar-main@diffstar@data_loaders@tests@test_load_smah_data.py@.PATH_END.py |
{
"filename": "_complex.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/optimize/_shgo_lib/_complex.py",
"type": "Python"
} | """Base classes for low memory simplicial complex structures."""
import copy
import logging
import itertools
import decimal
from functools import cache
import numpy as np
from ._vertex import (VertexCacheField, VertexCacheIndex)
class Complex:
"""
Base class for a simplicial complex described as a cache of ... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@optimize@_shgo_lib@_complex.py@.PATH_END.py |
{
"filename": "_tickfont.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattercarpet/marker/colorbar/_tickfont.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self,
plotly_name="tickfont",
parent_name="scattercarpet.marker.colorbar",
**kwargs
):
super(TickfontValidator, self).__init__(
plotly_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattercarpet@marker@colorbar@_tickfont.py@.PATH_END.py |
{
"filename": "testidefix.py",
"repo_name": "idefix-code/idefix",
"repo_path": "idefix_extracted/idefix-master/test/Dust/DustyWave/python/testidefix.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 13 14:45:58 2023
@author: lesurg
"""
import sys
import numpy as np
import argparse
import matplotlib.pyplot as plt
parser = argparse.ArgumentParser()
parser.add_argument("-noplot",
default=False,
help="disabl... | idefix-codeREPO_NAMEidefixPATH_START.@idefix_extracted@idefix-master@test@Dust@DustyWave@python@testidefix.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "janosch314/GWFish",
"repo_path": "GWFish_extracted/GWFish-main/GWFish/__init__.py",
"type": "Python"
} | """
GWFish
=====
GWFish: a GW detector network simulation tool with Fisher-matrix analysis
"""
from __future__ import absolute_import
import sys
from . import modules
from .modules import auxiliary, detection, fishermatrix, waveforms, constants, utilities
if sys.version_info < (3,):
raise ImportError("You ne... | janosch314REPO_NAMEGWFishPATH_START.@GWFish_extracted@GWFish-main@GWFish@__init__.py@.PATH_END.py |
{
"filename": "How it Works - DLE.ipynb",
"repo_name": "NannyML/nannyml",
"repo_path": "nannyml_extracted/nannyml-main/docs/example_notebooks/How it Works - DLE.ipynb",
"type": "Jupyter Notebook"
} | ```python
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_absolute_error
import matplotlib.pyplot as plt
```
```python
np.random.seed(1)
```
```python
size = 10_000
x1 = np.random.uniform(0, 1, size)
x1 = np.asarray([x1]).T
y = 2*x1 + np.random.normal(0, x1) # t... | NannyMLREPO_NAMEnannymlPATH_START.@nannyml_extracted@nannyml-main@docs@example_notebooks@How it Works - DLE.ipynb@.PATH_END.py |
{
"filename": "_borderwidth.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterternary/marker/colorbar/_borderwidth.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BorderwidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="borderwidth",
parent_name="scatterternary.marker.colorbar",
**kwargs,
):
super(BorderwidthValidator, self).__init__(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterternary@marker@colorbar@_borderwidth.py@.PATH_END.py |
{
"filename": "ez_setup.py",
"repo_name": "tardis-sn/tardis",
"repo_path": "tardis_extracted/tardis-main/ez_setup.py",
"type": "Python"
} | #!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... | tardis-snREPO_NAMEtardisPATH_START.@tardis_extracted@tardis-main@ez_setup.py@.PATH_END.py |
{
"filename": "_autocolorscale.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/barpolar/marker/line/_autocolorscale.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class AutocolorscaleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="autocolorscale", parent_name="barpolar.marker.line", **kwargs
):
super(AutocolorscaleValidator, self).__init__(
plotly_name=plotly_name... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@barpolar@marker@line@_autocolorscale.py@.PATH_END.py |
{
"filename": "test_distlib.py",
"repo_name": "eblur/dust",
"repo_path": "dust_extracted/dust-master/astrodust/tests/test_distlib.py",
"type": "Python"
} | """Test the distlib."""
from astrodust import distlib
def test_grain():
assert type(distlib.Grain()) == distlib.Grain
def test_Powlaw():
assert type(distlib.Powerlaw()) == distlib.Powerlaw
def test_DustSpectrum():
assert type(distlib.DustSpectrum()) == distlib.DustSpectrum
def test_MRN_dist():
asse... | eblurREPO_NAMEdustPATH_START.@dust_extracted@dust-master@astrodust@tests@test_distlib.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/choropleth/colorbar/tickfont/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._weight import WeightValidator
from ._variant import VariantValidator
from ._textcase import TextcaseValidator
from ._style import StyleValidator
from ._size import SizeValidator
from ._shadow impor... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@choropleth@colorbar@tickfont@__init__.py@.PATH_END.py |
{
"filename": "mk_map.py",
"repo_name": "HERA-Team/aipy",
"repo_path": "aipy_extracted/aipy-main/scripts/mk_map.py",
"type": "Python"
} | #!/usr/bin/env python
"""
This is a general-purpose script for making faceted, spherical maps (stored in
Healpix FITS format) from individual "flat" maps stored in FITS files.
Author: Aaron Parsons
"""
from __future__ import print_function, division, absolute_import
import sys, numpy as np, os, aipy as a, optparse,... | HERA-TeamREPO_NAMEaipyPATH_START.@aipy_extracted@aipy-main@scripts@mk_map.py@.PATH_END.py |
{
"filename": "_showline.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/ternary/baxis/_showline.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowlineValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="showline", parent_name="layout.ternary.baxis", **kwargs
):
super(ShowlineValidator, self).__init__(
plotly_name=plotly_name,
pare... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@ternary@baxis@_showline.py@.PATH_END.py |
{
"filename": "config.py",
"repo_name": "rasg-affiliates/21cmSense",
"repo_path": "21cmSense_extracted/21cmSense-main/src/py21cmsense/config.py",
"type": "Python"
} | """Some global configuration options for 21cmSense."""
PROGRESS = True # whether to display progress bars for some calculations.
| rasg-affiliatesREPO_NAME21cmSensePATH_START.@21cmSense_extracted@21cmSense-main@src@py21cmsense@config.py@.PATH_END.py |
{
"filename": "vertex.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/integrations/prefect-gcp/prefect_gcp/workers/vertex.py",
"type": "Python"
} | """<!-- # noqa -->
Module containing the custom worker used for executing flow runs as Vertex AI Custom Jobs.
Get started by creating a Cloud Run work pool:
```bash
prefect work-pool create 'my-vertex-pool' --type vertex-ai
```
Then start a Cloud Run worker with the following command:
```bash
prefect worker start ... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@integrations@prefect-gcp@prefect_gcp@workers@vertex.py@.PATH_END.py |
{
"filename": "InlineIncludeParam.py",
"repo_name": "OSSOS/SurveySimulator",
"repo_path": "SurveySimulator_extracted/SurveySimulator-master/fortran/F77/InlineIncludeParam.py",
"type": "Python"
} | #! /usr/bin/env python
"""
Inline the "include 'param.inc'" statements in SurveySubs.f.
"""
def read_file_raw(fichier):
"""
Reads in file 'fichier' and returns a list of lines.
No processing is done on any line.
"""
iter = 0
while True:
try:
f = open(fichier,'r')
exc... | OSSOSREPO_NAMESurveySimulatorPATH_START.@SurveySimulator_extracted@SurveySimulator-master@fortran@F77@InlineIncludeParam.py@.PATH_END.py |
{
"filename": "rebin_powerspectrum.py",
"repo_name": "MP-Gadget/MP-Gadget",
"repo_path": "MP-Gadget_extracted/MP-Gadget-master/tools/rebin_powerspectrum.py",
"type": "Python"
} | """Small module to rebin the power spectrum text files output by MP-Gadget so that each bin
has at least the desired number of modes. """
import numpy as np
def modecount_rebin(kk, pk, modes, minmodes=20, ndesired=200):
"""Rebins a power spectrum so that there are sufficient modes in each bin"""
assert np.all(... | MP-GadgetREPO_NAMEMP-GadgetPATH_START.@MP-Gadget_extracted@MP-Gadget-master@tools@rebin_powerspectrum.py@.PATH_END.py |
{
"filename": "get_DR2_bitweights.py",
"repo_name": "desihub/LSS",
"repo_path": "LSS_extracted/LSS-main/scripts/get_DR2_bitweights.py",
"type": "Python"
} | import numpy as np
import os
import fitsio
import glob
from astropy.table import Table
import LSS.common_tools as common
from LSS.globals import main
from LSS.bitweights import pack_bitweights
import logging
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--prog", choices=['DARK','BRIGHT'])
p... | desihubREPO_NAMELSSPATH_START.@LSS_extracted@LSS-main@scripts@get_DR2_bitweights.py@.PATH_END.py |
{
"filename": "example_circumbinary_planet.py",
"repo_name": "marblestation/posidonius",
"repo_path": "posidonius_extracted/posidonius-master/cases/example_circumbinary_planet.py",
"type": "Python"
} | import posidonius
import numpy as np
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('output_filename', action='store', help='Filename where the initial snapshot will be stored (e.g., universe_integrator.json)')
args = parser.parse_args()
filename = ar... | marblestationREPO_NAMEposidoniusPATH_START.@posidonius_extracted@posidonius-master@cases@example_circumbinary_planet.py@.PATH_END.py |
{
"filename": "image_resolution.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/doc/source/cookbook/image_resolution.py",
"type": "Python"
} | import numpy as np
import yt
# Load the dataset. We'll work with a some Gadget data to illustrate all
# the different ways in which the effective resolution can vary. Specifically,
# we'll use the GadgetDiskGalaxy dataset available at
# http://yt-project.org/data/GadgetDiskGalaxy.tar.gz
# load the data with a ref... | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@doc@source@cookbook@image_resolution.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/histogram2dcontour/colorbar/tickfont/_style.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class StyleValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="style",
parent_name="histogram2dcontour.colorbar.tickfont",
**kwargs,
):
super(StyleValidator, self).__init__(
plotly... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@histogram2dcontour@colorbar@tickfont@_style.py@.PATH_END.py |
{
"filename": "coda_blocks.py",
"repo_name": "neuraloperator/neuraloperator",
"repo_path": "neuraloperator_extracted/neuraloperator-main/neuralop/layers/coda_blocks.py",
"type": "Python"
} | from functools import partial
import logging
import numpy as np
import torch
import torch
import math
from torch import nn
import torch.nn.functional as F
from .fno_block import FNOBlocks
from .spectral_convolution import SpectralConv
einsum_symbols = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
class CODAB... | neuraloperatorREPO_NAMEneuraloperatorPATH_START.@neuraloperator_extracted@neuraloperator-main@neuralop@layers@coda_blocks.py@.PATH_END.py |
{
"filename": "_legendrank.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/surface/_legendrank.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LegendrankValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="legendrank", parent_name="surface", **kwargs):
super(LegendrankValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@surface@_legendrank.py@.PATH_END.py |
{
"filename": "report_appendix.md",
"repo_name": "litebird/litebird_sim",
"repo_path": "litebird_sim_extracted/litebird_sim-master/templates/report_appendix.md",
"type": "Markdown"
} | ## Instrument model objects
{% if entities %}
### Entities
Name | UUID
-------------------- | --------------------------------------------------
{% for obj in entities -%}
{{ obj.name }} | [{{ obj.uuid|string|truncate(9) }}]({{ base_imo_url }}/browse/entities/{{ obj.uuid }}/)
{% endfor -%}
{% endif -%... | litebirdREPO_NAMElitebird_simPATH_START.@litebird_sim_extracted@litebird_sim-master@templates@report_appendix.md@.PATH_END.py |
{
"filename": "nasa.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/utilities/nasa.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.utilities import NasaAPIWrapper
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRE... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@utilities@nasa.py@.PATH_END.py |
{
"filename": "state.py",
"repo_name": "glue-viz/glue",
"repo_path": "glue_extracted/glue-main/glue/viewers/matplotlib/state.py",
"type": "Python"
} | from echo import (CallbackProperty,
SelectionCallbackProperty,
DictCallbackProperty,
keep_in_sync, delay_callback)
from matplotlib.colors import to_rgba
from glue.core.message import LayerArtistUpdatedMessage
from glue.core.state_objects import State
from glue.vi... | glue-vizREPO_NAMEgluePATH_START.@glue_extracted@glue-main@glue@viewers@matplotlib@state.py@.PATH_END.py |
{
"filename": "_coloraxis.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatterpolar/marker/line/_coloraxis.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColoraxisValidator(_plotly_utils.basevalidators.SubplotidValidator):
def __init__(
self, plotly_name="coloraxis", parent_name="scatterpolar.marker.line", **kwargs
):
super(ColoraxisValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatterpolar@marker@line@_coloraxis.py@.PATH_END.py |
{
"filename": "step_sizes.py",
"repo_name": "pymc-devs/pymc",
"repo_path": "pymc_extracted/pymc-main/pymc/step_methods/step_sizes.py",
"type": "Python"
} | # Copyright 2024 The PyMC Developers
#
# 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 ag... | pymc-devsREPO_NAMEpymcPATH_START.@pymc_extracted@pymc-main@pymc@step_methods@step_sizes.py@.PATH_END.py |
{
"filename": "oct_geometry_handler.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/yt/geometry/oct_geometry_handler.py",
"type": "Python"
} | from typing import Optional
import numpy as np
from yt.fields.field_detector import FieldDetector
from yt.geometry.geometry_handler import Index
from yt.utilities.logger import ytLogger as mylog
class OctreeIndex(Index):
"""The Index subclass for oct AMR datasets"""
def _setup_geometry(self):
mylog... | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@yt@geometry@oct_geometry_handler.py@.PATH_END.py |
{
"filename": "test_fullchain.py",
"repo_name": "LSSTDESC/Spectractor",
"repo_path": "Spectractor_extracted/Spectractor-master/tests/test_fullchain.py",
"type": "Python"
} | import matplotlib as mpl
mpl.use('Agg') # must be run first! But therefore requires noqa E402 on all other imports
from scipy.interpolate import interp1d # noqa: E402
from spectractor import parameters # noqa: E402
from spectractor.extractor.images import Image # noqa: E402
from spectractor.extractor.spectrum imp... | LSSTDESCREPO_NAMESpectractorPATH_START.@Spectractor_extracted@Spectractor-master@tests@test_fullchain.py@.PATH_END.py |
{
"filename": "api.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/tpu/api.py",
"type": "Python"
} | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@tpu@api.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "brinckmann/montepython_public",
"repo_path": "montepython_public_extracted/montepython_public-master/montepython/likelihoods/cosmic_clocks_MaStro/__init__.py",
"type": "Python"
} | from montepython.likelihood_class import Likelihood_clocks
class cosmic_clocks_MaStro(Likelihood_clocks):
pass
| brinckmannREPO_NAMEmontepython_publicPATH_START.@montepython_public_extracted@montepython_public-master@montepython@likelihoods@cosmic_clocks_MaStro@__init__.py@.PATH_END.py |
{
"filename": "run_input.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/prefect/input/run_input.py",
"type": "Python"
} | """
This module contains functions that allow sending type-checked `RunInput` data
to flows at runtime. Flows can send back responses, establishing two-way
channels with senders. These functions are particularly useful for systems that
require ongoing data transfer or need to react to input quickly.
real-time interacti... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@input@run_input.py@.PATH_END.py |
{
"filename": "test_data_reload.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/yt/frontends/ytdata/tests/test_data_reload.py",
"type": "Python"
} | import numpy as np
from yt.loaders import load_uniform_grid
from yt.testing import requires_module_pytest
from yt.utilities.on_demand_imports import _h5py as h5py
@requires_module_pytest("h5py")
def test_save_as_data_unit_system(tmp_path):
# This test checks that the file saved with calling save_as_dataset
#... | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@frontends@ytdata@tests@test_data_reload.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "hpparvi/MuSCAT2_transit_pipeline",
"repo_path": "MuSCAT2_transit_pipeline_extracted/MuSCAT2_transit_pipeline-master/README.md",
"type": "Markdown"
} | # MuSCAT2 photometry and transit analysis pipelines
Python-based photometry and transit analysis pipelines for MuSCAT2 developed in collaboration with the [Instituto de Astrofísica de Canarias (IAC)](http://www.iac.es), University of Tokyo (UT), [National Astronomical Observatory of Japan (NAOJ)](http://www.nao.ac.jp)... | hpparviREPO_NAMEMuSCAT2_transit_pipelinePATH_START.@MuSCAT2_transit_pipeline_extracted@MuSCAT2_transit_pipeline-master@README.md@.PATH_END.py |
{
"filename": "BiQuadraticInterpolator.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/src/PYB11/Utilities/BiQuadraticInterpolator.py",
"type": "Python"
} | #-------------------------------------------------------------------------------
# BiQuadraticInterpolator
#-------------------------------------------------------------------------------
from PYB11Generator import *
from XYInterpolator import *
class BiQuadraticInterpolator(XYInterpolator):
"""Encapsulates the a... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@src@PYB11@Utilities@BiQuadraticInterpolator.py@.PATH_END.py |
{
"filename": "_yside.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/grid/_yside.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YsideValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="yside", parent_name="layout.grid", **kwargs):
super(YsideValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@grid@_yside.py@.PATH_END.py |
{
"filename": "extdata.py",
"repo_name": "karllark/measure_extinction",
"repo_path": "measure_extinction_extracted/measure_extinction-master/measure_extinction/extdata.py",
"type": "Python"
} | import warnings
import numpy as np
import astropy.units as u
from astropy.io import fits
from astropy.modeling.powerlaws import PowerLaw1D
from astropy.modeling import Parameter
from astropy.modeling.fitting import LevMarLSQFitter
from scipy.optimize import curve_fit
from scipy import stats
from dust_extinction.conve... | karllarkREPO_NAMEmeasure_extinctionPATH_START.@measure_extinction_extracted@measure_extinction-master@measure_extinction@extdata.py@.PATH_END.py |
{
"filename": "sp_model_manager_threaded.py",
"repo_name": "spacetelescope/specview",
"repo_path": "specview_extracted/specview-master/proto/model_manager/sp_model_manager_threaded.py",
"type": "Python"
} | from __future__ import division
import sys
import numpy as np
import astropy
from astropy.modeling import Parameter, Fittable1DModel, SummedCompositeModel
import astropy.modeling.models as models
import sp_widget
from PyQt4.QtCore import *
from PyQt4.QtGui import *
# Main classes ----------------------------------... | spacetelescopeREPO_NAMEspecviewPATH_START.@specview_extracted@specview-master@proto@model_manager@sp_model_manager_threaded.py@.PATH_END.py |
{
"filename": "ExampleMagneticField.ipynb",
"repo_name": "iAART/aart",
"repo_path": "aart_extracted/aart-main/ExampleMagneticField.ipynb",
"type": "Jupyter Notebook"
} | ```python
from aart_func import *
from params import * # The file params.py contains all the relevant parameters for the simulations
```
<frozen importlib._bootstrap>:219: RuntimeWarning: scipy._lib.messagestream.MessageStream size changed, may indicate binary incompatibility. Expected 56 from C header, got 64 fro... | iAARTREPO_NAMEaartPATH_START.@aart_extracted@aart-main@ExampleMagneticField.ipynb@.PATH_END.py |
{
"filename": "test_outputs.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/yt/frontends/arepo/tests/test_outputs.py",
"type": "Python"
} | from collections import OrderedDict
from yt.frontends.arepo.api import ArepoHDF5Dataset
from yt.testing import (
ParticleSelectionComparison,
assert_allclose_units,
requires_file,
requires_module,
)
from yt.utilities.answer_testing.framework import data_dir_load, requires_ds, sph_answer
bullet_h5 = "A... | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@frontends@arepo@tests@test_outputs.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "SBU-COSMOLIKE/CAMB-Monodromic",
"repo_path": "CAMB-Monodromic_extracted/CAMB-Monodromic-main/camb/tests/__init__.py",
"type": "Python"
} | SBU-COSMOLIKEREPO_NAMECAMB-MonodromicPATH_START.@CAMB-Monodromic_extracted@CAMB-Monodromic-main@camb@tests@__init__.py@.PATH_END.py | |
{
"filename": "test.ipynb",
"repo_name": "spacetelescope/specview",
"repo_path": "specview_extracted/specview-master/proto/specviewer/test.ipynb",
"type": "Jupyter Notebook"
} | ## Abstract
Test of signals
## Environment
```
from specview_signals import *
from signal_slot import *
```
## Library
```
class A(object):
def __init__(self):
self.signals = Signals()
try:
self.signals.add(NewData)
except SignalsExistError:
pass
... | spacetelescopeREPO_NAMEspecviewPATH_START.@specview_extracted@specview-master@proto@specviewer@test.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/funnelarea/title/font/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._sizesrc import SizesrcValidator
from ._size import SizeValidator
from ._familysrc import FamilysrcValidator
from ._family import FamilyValidator
from ._colorsrc import ColorsrcValidator
from ._color import ColorValidator
else:
from _plotly_uti... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@funnelarea@title@font@__init__.py@.PATH_END.py |
{
"filename": "random.py",
"repo_name": "macrocosme/shwirl",
"repo_path": "shwirl_extracted/shwirl-master/shwirl/extern/vispy/visuals/graphs/layouts/random.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Random Graph Layout
====================
This layout positions the nodes at random
"""
import numpy as np
from ..util import _straight_line_vertices, issparse
def rand... | macrocosmeREPO_NAMEshwirlPATH_START.@shwirl_extracted@shwirl-master@shwirl@extern@vispy@visuals@graphs@layouts@random.py@.PATH_END.py |
{
"filename": "rebin_jv.py",
"repo_name": "shihyuntang/igrins_rv",
"repo_path": "igrins_rv_extracted/igrins_rv-master/Engine/rebin_jv.py",
"type": "Python"
} | import numpy as np
from scipy.interpolate import interp1d, splev, splrep
def bin_ndarray(ndarray, new_shape, operation='mean'):
"""
Bins an ndarray in all axes based on the target shape, by summing or
averaging.
Number of output dimensions must match number of input dimensions.
Example
----... | shihyuntangREPO_NAMEigrins_rvPATH_START.@igrins_rv_extracted@igrins_rv-master@Engine@rebin_jv.py@.PATH_END.py |
{
"filename": "flags.py",
"repo_name": "simonsobs/sotodlib",
"repo_path": "sotodlib_extracted/sotodlib-master/sotodlib/tod_ops/flags.py",
"type": "Python"
} | import numpy as np
import scipy.stats as stats
from scipy.signal import find_peaks
## "temporary" fix to deal with scipy>1.8 changing the sparse setup
try:
from scipy.sparse import csr_array
except ImportError:
from scipy.sparse import csr_matrix as csr_array
from so3g.proj import Ranges, RangesMatrix
from .... | simonsobsREPO_NAMEsotodlibPATH_START.@sotodlib_extracted@sotodlib-master@sotodlib@tod_ops@flags.py@.PATH_END.py |
{
"filename": "Tange_2009.py",
"repo_name": "geodynamics/burnman",
"repo_path": "burnman_extracted/burnman-main/burnman/calibrants/Tange_2009.py",
"type": "Python"
} | # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for
# the Earth and Planetary Sciences
# Copyright (C) 2012 - 2024 by the BurnMan team, released under the GNU
# GPL v2 or later.
from burnman.eos.birch_murnaghan import BirchMurnaghanBase as BM3
from burnman.eos.vinet import Vinet
from burnman... | geodynamicsREPO_NAMEburnmanPATH_START.@burnman_extracted@burnman-main@burnman@calibrants@Tange_2009.py@.PATH_END.py |
{
"filename": "v100_x8_mixed_precision.py",
"repo_name": "google/flax",
"repo_path": "flax_extracted/flax-main/examples/imagenet/configs/v100_x8_mixed_precision.py",
"type": "Python"
} | # Copyright 2024 The Flax 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | googleREPO_NAMEflaxPATH_START.@flax_extracted@flax-main@examples@imagenet@configs@v100_x8_mixed_precision.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/cone/colorbar/title/__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"])
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@cone@colorbar@title@__init__.py@.PATH_END.py |
{
"filename": "torch.py",
"repo_name": "xwzhang98/SREmulator",
"repo_path": "SREmulator_extracted/SREmulator-main/map2map/map2map/data/norms/torch.py",
"type": "Python"
} | import torch
def exp(x, undo=False, **kwargs):
if not undo:
torch.exp(x, out=x)
else:
torch.log(x, out=x)
def log(x, eps=1e-8, undo=False, **kwargs):
if not undo:
torch.log(x + eps, out=x)
else:
torch.exp(x, out=x)
def expm1(x, undo=False, **kwargs):
if not undo:
... | xwzhang98REPO_NAMESREmulatorPATH_START.@SREmulator_extracted@SREmulator-main@map2map@map2map@data@norms@torch.py@.PATH_END.py |
{
"filename": "make_data_plots.ipynb",
"repo_name": "sfschen/spinosaurus",
"repo_path": "spinosaurus_extracted/spinosaurus-main/notebooks/make_data_plots.ipynb",
"type": "Jupyter Notebook"
} | ## Data Plots
This notebook performs the fits to data that are shown in the paper.
The data points are taken from simulated halo shapes as measured in Akitsu et al (2023).
```python
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
font = {'family' : 'normal',
'weight' : 'normal',... | sfschenREPO_NAMEspinosaurusPATH_START.@spinosaurus_extracted@spinosaurus-main@notebooks@make_data_plots.ipynb@.PATH_END.py |
{
"filename": "_bordercolorsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/table/hoverlabel/_bordercolorsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BordercolorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="bordercolorsrc", parent_name="table.hoverlabel", **kwargs
):
super(BordercolorsrcValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@table@hoverlabel@_bordercolorsrc.py@.PATH_END.py |
{
"filename": "Animation.py",
"repo_name": "mirochaj/ares",
"repo_path": "ares_extracted/ares-main/ares/analysis/Animation.py",
"type": "Python"
} | """
Animation.py
Author: Jordan Mirocha
Affiliation: UCLA
Created on: Wed Nov 23 09:32:17 PST 2016
Description:
"""
import numpy as np
import matplotlib.pyplot as pl
from .ModelSet import ModelSet
from ..physics import Hydrogen
from ..util.Aesthetics import Labeler
from ..physics.Constants import nu_0_mhz
from .Mu... | mirochajREPO_NAMEaresPATH_START.@ares_extracted@ares-main@ares@analysis@Animation.py@.PATH_END.py |
{
"filename": "test_basic_models.py",
"repo_name": "dmlc/xgboost",
"repo_path": "xgboost_extracted/xgboost-master/tests/python/test_basic_models.py",
"type": "Python"
} | import json
import os
import tempfile
from typing import Optional
import numpy as np
import pytest
import xgboost as xgb
from xgboost import testing as tm
from xgboost.core import Integer
from xgboost.testing.updater import ResetStrategy
dpath = tm.data_dir(__file__)
rng = np.random.RandomState(1994)
class TestMo... | dmlcREPO_NAMExgboostPATH_START.@xgboost_extracted@xgboost-master@tests@python@test_basic_models.py@.PATH_END.py |
{
"filename": "ordinal_regression.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/examples/python/ordinal_regression.py",
"type": "Python"
} | #!/usr/bin/env python
# DO NOT EDIT
# Autogenerated from the notebook ordinal_regression.ipynb.
# Edit the notebook and then sync the output with this file.
#
# flake8: noqa
# DO NOT EDIT
# # Ordinal Regression
import numpy as np
import pandas as pd
import scipy.stats as stats
from statsmodels.miscmodels.ordinal_mo... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@examples@python@ordinal_regression.py@.PATH_END.py |
{
"filename": "util.py",
"repo_name": "adrn/gala",
"repo_path": "gala_extracted/gala-main/gala/dynamics/util.py",
"type": "Python"
} | """ General dynamics utilities. """
# Third-party
import astropy.units as u
import astropy.coordinates as coord
from astropy.utils.misc import isiterable
import numpy as np
from scipy.signal import argrelmax, argrelmin
# This package
from .core import PhaseSpacePosition
from ..util import atleast_2d
__all__ = ['peak... | adrnREPO_NAMEgalaPATH_START.@gala_extracted@gala-main@gala@dynamics@util.py@.PATH_END.py |
{
"filename": "test_ImPACT.py",
"repo_name": "cta-observatory/ctapipe",
"repo_path": "ctapipe_extracted/ctapipe-main/src/ctapipe/reco/tests/test_ImPACT.py",
"type": "Python"
} | import astropy.units as u
import numpy as np
import pytest
from astropy.coordinates import AltAz, Angle, SkyCoord
from numpy.testing import assert_allclose
from ctapipe.containers import (
HillasParametersContainer,
ReconstructedEnergyContainer,
ReconstructedGeometryContainer,
)
from ctapipe.reco.impact im... | cta-observatoryREPO_NAMEctapipePATH_START.@ctapipe_extracted@ctapipe-main@src@ctapipe@reco@tests@test_ImPACT.py@.PATH_END.py |
{
"filename": "prfmodel.py",
"repo_name": "lightkurve/lightkurve",
"repo_path": "lightkurve_extracted/lightkurve-main/src/lightkurve/prf/prfmodel.py",
"type": "Python"
} | """Provides callable models of the Kepler Pixel Response Function (PRF)."""
from __future__ import division, print_function
import math
from astropy.io import fits as pyfits
import numpy as np
import scipy
import scipy.interpolate
from ..utils import channel_to_module_output, plot_image
__all__ = ["KeplerPRF", "Si... | lightkurveREPO_NAMElightkurvePATH_START.@lightkurve_extracted@lightkurve-main@src@lightkurve@prf@prfmodel.py@.PATH_END.py |
{
"filename": "_version.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/yt/_version.py",
"type": "Python"
} | from typing import NamedTuple
from packaging.version import Version
__all__ = [
"__version__",
"version_info",
]
__version__ = "4.3.0" # keep in sync with pyproject.toml
class VersionTuple(NamedTuple):
"""
A minimal representation of the current version number
that can be used downstream to ch... | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@yt@_version.py@.PATH_END.py |
{
"filename": "_connectgaps.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattermapbox/_connectgaps.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ConnectgapsValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="connectgaps", parent_name="scattermapbox", **kwargs
):
super(ConnectgapsValidator, self).__init__(
plotly_name=plotly_name,
pa... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattermapbox@_connectgaps.py@.PATH_END.py |
{
"filename": "_autotypenumbers.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/carpet/aaxis/_autotypenumbers.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class AutotypenumbersValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="autotypenumbers", parent_name="carpet.aaxis", **kwargs
):
super(AutotypenumbersValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@carpet@aaxis@_autotypenumbers.py@.PATH_END.py |
{
"filename": "test_mask_pupil_LUVOIR_A.py",
"repo_name": "ajeldorado/falco-python",
"repo_path": "falco-python_extracted/falco-python-master/tests/unit/test_mask_pupil_LUVOIR_A.py",
"type": "Python"
} | import numpy as np
from falco.mask import falco_gen_pupil_LUVOIR_A_final
from falco.util import pad_crop
def test_translation():
Nbeam = 200
inputs = {"Nbeam": Nbeam}
pupil = falco_gen_pupil_LUVOIR_A_final(inputs)
inputs.update({"xShear": -11/100, "yShear": 19/100})
pupilOffset = falco_gen_pupil... | ajeldoradoREPO_NAMEfalco-pythonPATH_START.@falco-python_extracted@falco-python-master@tests@unit@test_mask_pupil_LUVOIR_A.py@.PATH_END.py |
{
"filename": "jax_utils.py",
"repo_name": "DifferentiableUniverseInitiative/jax_cosmo",
"repo_path": "jax_cosmo_extracted/jax_cosmo-master/jax_cosmo/jax_utils.py",
"type": "Python"
} | import jax.numpy as np
class container(object):
"""
Generic structure to trace a parameterized function
Paramters for the object, i.e. things that need to be traced for autodiff
are stored as a list in self.params
Configuration arguments, i.e. static things that do not need to be traced
are ... | DifferentiableUniverseInitiativeREPO_NAMEjax_cosmoPATH_START.@jax_cosmo_extracted@jax_cosmo-master@jax_cosmo@jax_utils.py@.PATH_END.py |
{
"filename": "_tickangle.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/coloraxis/colorbar/_tickangle.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickangleValidator(_plotly_utils.basevalidators.AngleValidator):
def __init__(
self, plotly_name="tickangle", parent_name="layout.coloraxis.colorbar", **kwargs
):
super(TickangleValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@coloraxis@colorbar@_tickangle.py@.PATH_END.py |
{
"filename": "test_example.py",
"repo_name": "fhstp/soniscope-jupyter",
"repo_path": "soniscope-jupyter_extracted/soniscope-jupyter-main/soniscope_jupyter/tests/test_example.py",
"type": "Python"
} | #!/usr/bin/env python
# coding: utf-8
# Copyright (c) Alexander Rind & the SoniVis team.
# Distributed under the terms of the MIT License (see LICENSE.txt).
import pytest
import pandas as pd
from traitlets.traitlets import TraitError
from ..lens_widget import LensWidget
df = pd.DataFrame({'var1': {0: 1, 1: 2, 2: 3,... | fhstpREPO_NAMEsoniscope-jupyterPATH_START.@soniscope-jupyter_extracted@soniscope-jupyter-main@soniscope_jupyter@tests@test_example.py@.PATH_END.py |
{
"filename": "PINT_observatories.py",
"repo_name": "nanograv/PINT",
"repo_path": "PINT_extracted/PINT-master/docs/examples/PINT_observatories.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_observatories.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattermapbox/hoverlabel/font/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._weightsrc import WeightsrcValidator
from ._weight import WeightValidator
from ._variantsrc import VariantsrcValidator
from ._variant import VariantValidator
from ._textcasesrc import TextcasesrcValidat... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattermapbox@hoverlabel@font@__init__.py@.PATH_END.py |
{
"filename": "array_indexing_manipulations.py",
"repo_name": "astropy/halotools",
"repo_path": "halotools_extracted/halotools-master/halotools/utils/array_indexing_manipulations.py",
"type": "Python"
} | """
"""
from __future__ import division, print_function, absolute_import, unicode_literals
import numpy as np
from astropy.utils.misc import NumpyRNGContext
__all__ = ('calculate_first_idx_unique_array_vals',
'calculate_last_idx_unique_array_vals', 'sum_in_bins',
'random_indices_within_bin', 'calculate_entry_... | astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@halotools@utils@array_indexing_manipulations.py@.PATH_END.py |
{
"filename": "recombination.py",
"repo_name": "federicomarulli/CosmoBolognaLib",
"repo_path": "CosmoBolognaLib_extracted/CosmoBolognaLib-master/External/MGCAMB/pycamb/camb/recombination.py",
"type": "Python"
} | from .baseconfig import CAMB_Structure, dll_import
from ctypes import c_bool, c_int, c_double
# logical
Do21cm = dll_import(c_double, "recombination", "do21cm")
# Do21cm.value = False
# logical
doTmatTspin = dll_import(c_bool, "recombination", "dotmattspin")
# doTmatTspin.value = False
recombination_saha_z = dll_imp... | federicomarulliREPO_NAMECosmoBolognaLibPATH_START.@CosmoBolognaLib_extracted@CosmoBolognaLib-master@External@MGCAMB@pycamb@camb@recombination.py@.PATH_END.py |
{
"filename": "plot_styles.py",
"repo_name": "radis/radis",
"repo_path": "radis_extracted/radis-master/examples/6_Misc/plot_styles.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
=========================
Use different plot themes
=========================
Shows how to customize plot styles, using :py:mod:`seaborn` , :py:mod:`matplotlib`
or `publib <https://github.com/erwanp/publib>`__
Examples
--------
To change it in your user script, set the keys of the ``"plot"... | radisREPO_NAMEradisPATH_START.@radis_extracted@radis-master@examples@6_Misc@plot_styles.py@.PATH_END.py |
{
"filename": "test_explainer_kernel_shap.py",
"repo_name": "rapidsai/cuml",
"repo_path": "cuml_extracted/cuml-main/python/cuml/cuml/tests/explainer/test_explainer_kernel_shap.py",
"type": "Python"
} | #
# Copyright (c) 2020-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | rapidsaiREPO_NAMEcumlPATH_START.@cuml_extracted@cuml-main@python@cuml@cuml@tests@explainer@test_explainer_kernel_shap.py@.PATH_END.py |
{
"filename": "_plugin_helpers.py",
"repo_name": "glue-viz/glue",
"repo_path": "glue_extracted/glue-main/glue/_plugin_helpers.py",
"type": "Python"
} | # The following function is a thin wrapper around iter_entry_points. The reason it
# is in this separate file is that when making the Mac app, py2app doesn't
# support entry points, so we replace this function with a version that has the
# entry points we want hardcoded. If this function was in glue/main.py, the
# refe... | glue-vizREPO_NAMEgluePATH_START.@glue_extracted@glue-main@glue@_plugin_helpers.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "alibaba/TinyNeuralNetwork",
"repo_path": "TinyNeuralNetwork_extracted/TinyNeuralNetwork-main/examples/tracer/README.md",
"type": "Markdown"
} | ## Sample code for using tracer and code generator in TinyNeuralNetwork
[简体中文](README_zh-CN.md)
## Background
It is always hard to get the connections between nodes within a computation graph without calling `torch.jit.trace`. However, if we call the JIT ops, some of nodes in the graph may be removed, which makes it... | alibabaREPO_NAMETinyNeuralNetworkPATH_START.@TinyNeuralNetwork_extracted@TinyNeuralNetwork-main@examples@tracer@README.md@.PATH_END.py |
{
"filename": "amplitude.py",
"repo_name": "light-curve/light-curve-python",
"repo_path": "light-curve-python_extracted/light-curve-python-master/light-curve/light_curve/light_curve_py/features/amplitude.py",
"type": "Python"
} | import numpy as np
from ._base import BaseSingleBandFeature
class Amplitude(BaseSingleBandFeature):
def _eval_single_band(self, t, m, sigma=None):
return 0.5 * np.ptp(m)
@property
def size_single_band(self):
return 1
__all__ = ("Amplitude",)
| light-curveREPO_NAMElight-curve-pythonPATH_START.@light-curve-python_extracted@light-curve-python-master@light-curve@light_curve@light_curve_py@features@amplitude.py@.PATH_END.py |
{
"filename": "yanny.py",
"repo_name": "dstndstn/astrometry.net",
"repo_path": "astrometry.net_extracted/astrometry.net-main/sdss/yanny.py",
"type": "Python"
} | #
# yanny.py
#
# Python library for reading & writing yanny files.
#
# B. A. Weaver, NYU, 2008-10-20
#
# $Id: yanny.py 141452 2012-12-18 00:12:50Z weaver $
#
"""Python library for reading & writing yanny files.
yanny is an object-oriented interface to FTCL/yanny data files following
these specifications_.
The format ... | dstndstnREPO_NAMEastrometry.netPATH_START.@astrometry.net_extracted@astrometry.net-main@sdss@yanny.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "jvanzand/ethraid",
"repo_path": "ethraid_extracted/ethraid-main/setup.py",
"type": "Python"
} | from setuptools import setup, find_packages, Extension
import subprocess
from setuptools.command.build_ext import build_ext as _build_ext
import re
import os
import sys
####################
# ## Extra stuff to profile code using kernprof -l -v file.py after it is compiled
# ## Taken from https://stackoverflow.com/que... | jvanzandREPO_NAMEethraidPATH_START.@ethraid_extracted@ethraid-main@setup.py@.PATH_END.py |
{
"filename": "_box.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/violin/_box.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BoxValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="box", parent_name="violin", **kwargs):
super(BoxValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_clas... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@violin@_box.py@.PATH_END.py |
{
"filename": "flags.py",
"repo_name": "ryanvarley/exodata",
"repo_path": "exodata_extracted/exodata-master/exodata/flags.py",
"type": "Python"
} | """ Contains the flag class, this is desgined to hold types of information about the target. These can be things
entered by the catalogue when assuming values such as 'Temperature calculated' or personal tags like 'Priority Target'
These are designed to be attached to a planet, system, star or binary class in .flags
"... | ryanvarleyREPO_NAMEexodataPATH_START.@exodata_extracted@exodata-master@exodata@flags.py@.PATH_END.py |
{
"filename": "test_fixedwidth.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/io/ascii/tests/test_fixedwidth.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# TEST_UNICODE_LITERALS
import pytest
from ....extern.six.moves import cStringIO as StringIO
from ... import ascii
from ..core import InconsistentTableError
from .common import (assert_equal, assert_almost_equal,
setup_function, tea... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@io@ascii@tests@test_fixedwidth.py@.PATH_END.py |
{
"filename": "_tickvalssrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter3d/marker/colorbar/_tickvalssrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickvalssrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="tickvalssrc",
parent_name="scatter3d.marker.colorbar",
**kwargs,
):
super(TickvalssrcValidator, self).__init__(
plotly... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter3d@marker@colorbar@_tickvalssrc.py@.PATH_END.py |
{
"filename": "context.py",
"repo_name": "lsst-uk/lasair-lsst",
"repo_path": "lasair-lsst_extracted/lasair-lsst-main/tests/unit/pipeline/ingest/context.py",
"type": "Python"
} | """Import at the start of tests so that imported packages get resolved properly.
"""
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../../common')))
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../../common/src')))
sys.path.in... | lsst-ukREPO_NAMElasair-lsstPATH_START.@lasair-lsst_extracted@lasair-lsst-main@tests@unit@pipeline@ingest@context.py@.PATH_END.py |
{
"filename": "_exponentformat.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatterpolar/marker/colorbar/_exponentformat.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ExponentformatValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="exponentformat",
parent_name="scatterpolar.marker.colorbar",
**kwargs
):
super(ExponentformatValidator, self).__init__(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatterpolar@marker@colorbar@_exponentformat.py@.PATH_END.py |
{
"filename": "test_image_rotation.py",
"repo_name": "HITS-AIN/PINK",
"repo_path": "PINK_extracted/PINK-master/python/tests/test_image_rotation.py",
"type": "Python"
} | #!/usr/bin/env python3
"""
PINK test image rotation
"""
__author__ = "Bernd Doser"
__email__ = "bernd.doser@h-its.org"
__license__ = "GPLv3"
import math
import matplotlib.pyplot as plt
import numpy as np
import pink
def main():
""" Main routine of PINK test image rotation """
print('PINK version ', pink.__... | HITS-AINREPO_NAMEPINKPATH_START.@PINK_extracted@PINK-master@python@tests@test_image_rotation.py@.PATH_END.py |
{
"filename": "cube_dim_transcoder.py",
"repo_name": "ratt-ru/montblanc",
"repo_path": "montblanc_extracted/montblanc-master/montblanc/impl/rime/tensorflow/cube_dim_transcoder.py",
"type": "Python"
} | import itertools
import numpy as np
# These are hypercube dimension attributes
DEFAULT_SCHEMA = ['lower_extent', 'upper_extent', 'global_size']
class CubeDimensionTranscoder(object):
"""
Small class for encoding and decoding hypercube dimensions
into/from numpy arrays
>>> import hypercube as hc
... | ratt-ruREPO_NAMEmontblancPATH_START.@montblanc_extracted@montblanc-master@montblanc@impl@rime@tensorflow@cube_dim_transcoder.py@.PATH_END.py |
{
"filename": "JAX_CUDA_HEALPix.ipynb",
"repo_name": "astro-informatics/s2fft",
"repo_path": "s2fft_extracted/s2fft-main/notebooks/JAX_CUDA_HEALPix.ipynb",
"type": "Jupyter Notebook"
} | # __S2FFT CUDA Implementation__
---
[](https://colab.research.google.com/github/astro-informatics/s2fft/blob/main/notebooks/JAX_HEALPix_frontend.ipynb)
```python
import sys
IN_COLAB = 'google.colab' in sys.modules
# Install s2fft and data if ru... | astro-informaticsREPO_NAMEs2fftPATH_START.@s2fft_extracted@s2fft-main@notebooks@JAX_CUDA_HEALPix.ipynb@.PATH_END.py |
{
"filename": "actions.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/prefect/events/actions.py",
"type": "Python"
} | import abc
from typing import Any, Dict, Optional, Union
from uuid import UUID
from pydantic import Field, model_validator
from typing_extensions import Literal, Self, TypeAlias
from prefect._internal.schemas.bases import PrefectBaseModel
from prefect.client.schemas.objects import StateType
class Action(PrefectBase... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@events@actions.py@.PATH_END.py |
{
"filename": "results_rates.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/stats/tests/results/results_rates.py",
"type": "Python"
} | """
Created on Mon May 4 21:21:09 2020
Author: Josef Perktold
License: BSD-3
"""
import numpy as np
from statsmodels.tools.testing import Holder
NA = np.nan
# > pe = poisson.exact(c(60, 30), c(51477.5, 54308.7), tsmethod="minlike",
# midp=FALSE)
# > cat_items(pe, prefix="res.")
res_pexact_con... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@stats@tests@results@results_rates.py@.PATH_END.py |
{
"filename": "FlattenedPowerPotential.py",
"repo_name": "jobovy/galpy",
"repo_path": "galpy_extracted/galpy-main/galpy/potential/FlattenedPowerPotential.py",
"type": "Python"
} | ###############################################################################
# FlattenedPowerPotential.py: Power-law potential that is flattened in the
# potential (NOT the density)
#
# amp
# phi(R,z)= --------- ; m^2 = R^2 ... | jobovyREPO_NAMEgalpyPATH_START.@galpy_extracted@galpy-main@galpy@potential@FlattenedPowerPotential.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.