metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "test_c_tools_timing.py",
"repo_name": "jrenaud90/TidalPy",
"repo_path": "TidalPy_extracted/TidalPy-main/Tests/Test_Old/Test_SetB_Package/test_c_tools_timing.py",
"type": "Python"
} | import numpy as np
import TidalPy
from TidalPy.utilities.conversions.timing import convert_to_hms
def test_convert_hms():
""" Test the convert_to_hms function """
result = convert_to_hms(60.)
assert type(result) == tuple
day, hour, minute, second = result
assert type(day) in [int, np.int32]
... | jrenaud90REPO_NAMETidalPyPATH_START.@TidalPy_extracted@TidalPy-main@Tests@Test_Old@Test_SetB_Package@test_c_tools_timing.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "spacetelescope/jwst",
"repo_path": "jwst_extracted/jwst-main/jwst/combine_1d/tests/__init__.py",
"type": "Python"
} | spacetelescopeREPO_NAMEjwstPATH_START.@jwst_extracted@jwst-main@jwst@combine_1d@tests@__init__.py@.PATH_END.py | |
{
"filename": "cross_trainer_cache_ft_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/data/experimental/kernel_tests/service/cross_trainer_cache_ft_test.py",
"type": "Python"
} | # Copyright 2022 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@data@experimental@kernel_tests@service@cross_trainer_cache_ft_test.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/tools/nuclia/__init__.py",
"type": "Python"
} | from langchain_community.tools.nuclia.tool import NucliaUnderstandingAPI
__all__ = ["NucliaUnderstandingAPI"]
| langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@tools@nuclia@__init__.py@.PATH_END.py |
{
"filename": "dp.md",
"repo_name": "cajohare/AxionLimits",
"repo_path": "AxionLimits_extracted/AxionLimits-master/docs/dp.md",
"type": "Markdown"
} | # Dark photon limits
These plots appeared in the paper [Caputo et al. 2021](https://arxiv.org/abs/2105.04565) so if you use them for whatever reason, please cite this paper too
```
@article{Caputo:2021eaa,
author = "Caputo, Andrea and O'Hare, Ciaran A. J. and Millar, Alexander J. and Vitagliano, Edoardo",
titl... | cajohareREPO_NAMEAxionLimitsPATH_START.@AxionLimits_extracted@AxionLimits-master@docs@dp.md@.PATH_END.py |
{
"filename": "_tickson.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/xaxis/_tickson.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicksonValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="tickson", parent_name="layout.xaxis", **kwargs):
super(TicksonValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@xaxis@_tickson.py@.PATH_END.py |
{
"filename": "_variant.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/sunburst/insidetextfont/_variant.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="variant", parent_name="sunburst.insidetextfont", **kwargs
):
super(VariantValidator, self).__init__(
plotly_name=plotly_name,
p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@sunburst@insidetextfont@_variant.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/histogram/unselected/textfont/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._color import ColorValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._color.ColorValidator"]
)
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@histogram@unselected@textfont@__init__.py@.PATH_END.py |
{
"filename": "JWST_PSF_reconstruction.ipynb",
"repo_name": "sibirrer/psfr",
"repo_path": "psfr_extracted/psfr-main/notebooks/JWST_PSF_reconstruction.ipynb",
"type": "Jupyter Notebook"
} | ```python
import psfr
from psfr.psfr import shift_psf, one_step_psf_estimate
import astropy.io.fits as pyfits
import os
import matplotlib.pyplot as plt
import numpy as np
import copy
import scipy
from scipy.ndimage import interpolation
from lenstronomy.Util import util, kernel_util, image_util
from mpl_toolkits.axes_g... | sibirrerREPO_NAMEpsfrPATH_START.@psfr_extracted@psfr-main@notebooks@JWST_PSF_reconstruction.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "LSSTDESC/CCL",
"repo_path": "CCL_extracted/CCL-master/pyccl/_core/parameters/__init__.py",
"type": "Python"
} | from .parameters_base import *
from .cosmology_params import *
from .fftlog_params import *
| LSSTDESCREPO_NAMECCLPATH_START.@CCL_extracted@CCL-master@pyccl@_core@parameters@__init__.py@.PATH_END.py |
{
"filename": "spec_util.py",
"repo_name": "eelregit/pmwd",
"repo_path": "pmwd_extracted/pmwd-master/pmwd/spec_util.py",
"type": "Python"
} | from functools import partial
import math
from jax import jit, ensure_compile_time_eval
import jax.numpy as jnp
from pmwd.pm_util import fftfreq, fftfwd
@partial(jit, static_argnames=('bins', 'cut_zero', 'cut_nyq', 'dtype', 'int_dtype'))
def powspec(f, spacing, bins=1j/3, g=None, deconv=None, cut_zero=True, cut_nyq... | eelregitREPO_NAMEpmwdPATH_START.@pmwd_extracted@pmwd-master@pmwd@spec_util.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "LSSTDESC/lsstdesc-diffsky",
"repo_path": "lsstdesc-diffsky_extracted/lsstdesc-diffsky-main/lsstdesc_diffsky/tests/__init__.py",
"type": "Python"
} | LSSTDESCREPO_NAMElsstdesc-diffskyPATH_START.@lsstdesc-diffsky_extracted@lsstdesc-diffsky-main@lsstdesc_diffsky@tests@__init__.py@.PATH_END.py | |
{
"filename": "core.py",
"repo_name": "bek0s/gbkfit",
"repo_path": "gbkfit_extracted/gbkfit-master/src/gbkfit/fitting/fitters/emcee/core.py",
"type": "Python"
} |
import abc
from gbkfit.fitting.core import FitParam, FitParams, Fitter
class FitParamDynestySNS(FitParam, abc.ABC):
pass
class FitParamsDynestySNS(FitParams, abc.ABC):
pass
class FitterDynesty(Fitter, abc.ABC):
pass
| bek0sREPO_NAMEgbkfitPATH_START.@gbkfit_extracted@gbkfit-master@src@gbkfit@fitting@fitters@emcee@core.py@.PATH_END.py |
{
"filename": "_dtick.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterpolar/marker/colorbar/_dtick.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class DtickValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(
self, plotly_name="dtick", parent_name="scatterpolar.marker.colorbar", **kwargs
):
super(DtickValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterpolar@marker@colorbar@_dtick.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattermap/marker/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._symbolsrc import SymbolsrcValidator
from ._symbol import SymbolValidator
from ._sizesrc import SizesrcValidator
from ._sizeref import SizerefValidator
from ._sizemode import SizemodeValidator
from ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattermap@marker@__init__.py@.PATH_END.py |
{
"filename": "mag_amp_conversion.py",
"repo_name": "lenstronomy/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/lenstronomy/SimulationAPI/mag_amp_conversion.py",
"type": "Python"
} | from lenstronomy.SimulationAPI.model_api import ModelAPI
import lenstronomy.Util.data_util as data_util
import copy
import numpy as np
class MagAmpConversion(ModelAPI):
"""Class to convert astronomical magnitudes to lenstronomy amplitudes with given
magnitude zero point."""
def __init__(self, kwargs_mode... | lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@lenstronomy@SimulationAPI@mag_amp_conversion.py@.PATH_END.py |
{
"filename": "recipes_DYNAMICWAVECAL.py",
"repo_name": "GeminiDRSoftware/MAROONXDR",
"repo_path": "MAROONXDR_extracted/MAROONXDR-main/maroonxdr/maroonx/recipes/sq/recipes_DYNAMICWAVECAL.py",
"type": "Python"
} | """
Recipes available to data with tags ['MAROONX', 'WAVECAL', 'ETALON']
Default is "reduce".
TODO: add non-default reference to static wavelength solution?
"""
recipe_tags = set(['MAROONX', 'WAVECAL', 'ETALON'])
def makeDynamicWavecal(p):
"""
This recipe will process just etalon spectra to
create a dyna... | GeminiDRSoftwareREPO_NAMEMAROONXDRPATH_START.@MAROONXDR_extracted@MAROONXDR-main@maroonxdr@maroonx@recipes@sq@recipes_DYNAMICWAVECAL.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "magic-sph/magic",
"repo_path": "magic_extracted/magic-master/samples/testRadialOutputs/__init__.py",
"type": "Python"
} | magic-sphREPO_NAMEmagicPATH_START.@magic_extracted@magic-master@samples@testRadialOutputs@__init__.py@.PATH_END.py | |
{
"filename": "womreddening.py",
"repo_name": "msiebert1/UCSC_spectral_pipeline",
"repo_path": "UCSC_spectral_pipeline_extracted/UCSC_spectral_pipeline-master/spectral_reduction/tmath/wombat/womreddening.py",
"type": "Python"
} | def womreddening(hop):
"""redden or deredden with various reddening laws"""
import matplotlib.pyplot as plt
import extinction
from tmath.wombat.inputter_single import inputter_single
from tmath.wombat.inputter import inputter
from tmath.wombat.yesno import yesno
r_v=3.1
print('Redden or ... | msiebert1REPO_NAMEUCSC_spectral_pipelinePATH_START.@UCSC_spectral_pipeline_extracted@UCSC_spectral_pipeline-master@spectral_reduction@tmath@wombat@womreddening.py@.PATH_END.py |
{
"filename": "test_ellipse.py",
"repo_name": "macrocosme/shwirl",
"repo_path": "shwirl_extracted/shwirl-master/shwirl/extern/vispy/visuals/tests/test_ellipse.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Tests for EllipseVisual
All images are of size (100,100) to keep a small file size
"""
from vispy.scene import visuals, transforms
from vispy.testing import (requires_app... | macrocosmeREPO_NAMEshwirlPATH_START.@shwirl_extracted@shwirl-master@shwirl@extern@vispy@visuals@tests@test_ellipse.py@.PATH_END.py |
{
"filename": "account_rights.py",
"repo_name": "mhammond/pywin32",
"repo_path": "pywin32_extracted/pywin32-main/win32/Demos/security/account_rights.py",
"type": "Python"
} | import ntsecuritycon
import win32api
import win32con
import win32file
import win32security
new_privs = (
(
win32security.LookupPrivilegeValue("", ntsecuritycon.SE_SECURITY_NAME),
win32con.SE_PRIVILEGE_ENABLED,
),
(
win32security.LookupPrivilegeValue("", ntsecuritycon.SE_CREATE_PERMA... | mhammondREPO_NAMEpywin32PATH_START.@pywin32_extracted@pywin32-main@win32@Demos@security@account_rights.py@.PATH_END.py |
{
"filename": "kowalski_utils.py",
"repo_name": "virajkaram/emgwcave",
"repo_path": "emgwcave_extracted/emgwcave-main/emgwcave/kowalski_utils.py",
"type": "Python"
} | from penquins import Kowalski
import os
from pathlib import Path
default_projection_kwargs = {
"candidate.jdstarthist": 1,
"candidate.isdiffpos": 1,
"candidate.drb": 1,
"candidate.magpsf": 1,
"candidate.jd": 1,
"candidate.ssdistnr": 1,
"candidate.ssmagnr": 1,
"candidate.distpsnr1": 1,
... | virajkaramREPO_NAMEemgwcavePATH_START.@emgwcave_extracted@emgwcave-main@emgwcave@kowalski_utils.py@.PATH_END.py |
{
"filename": "quickstart.md",
"repo_name": "lsst-uk/lasair-lsst",
"repo_path": "lasair-lsst_extracted/lasair-lsst-main/docs/source/quickstart.md",
"type": "Markdown"
} | ## Quick Start
Lasair is built as a platform to enable scientific discoveries from the dynamic
Universe. Its input is a transient sky survey such as ZTF or LSST, that find changes in
brightness in the night sky, each called an "alert". Such alerts may result
from supernovae, active galaxies, merging neutron stars, ... | lsst-ukREPO_NAMElasair-lsstPATH_START.@lasair-lsst_extracted@lasair-lsst-main@docs@source@quickstart.md@.PATH_END.py |
{
"filename": "score_estimator_test.py",
"repo_name": "sbi-dev/sbi",
"repo_path": "sbi_extracted/sbi-main/tests/score_estimator_test.py",
"type": "Python"
} | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
from __future__ import annotations
from typing import Tuple
import pytest
import torch
from sbi.neural_nets.embedding_nets import CNNEmbedding
from sbi... | sbi-devREPO_NAMEsbiPATH_START.@sbi_extracted@sbi-main@tests@score_estimator_test.py@.PATH_END.py |
{
"filename": "ulimit.py",
"repo_name": "nuc-astro/winnet",
"repo_path": "winnet_extracted/winnet-master/test/ulimit.py",
"type": "Python"
} | #!/usr/bin/env python
t.checklist = { \
'finab.dat' : { 'method':'exists'},
}
t.program = t.basedir + "/bin/winnet"
t.testdir = t.basedir + "/test/" + t.testname
t.logfile = t.testdir + ".log"
t.arcfile = t.testdir + ".tar.gz"
| nuc-astroREPO_NAMEwinnetPATH_START.@winnet_extracted@winnet-master@test@ulimit.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/matplotlib/py2/matplotlib/backends/qt_editor/__init__.py",
"type": "Python"
} | from __future__ import (absolute_import, division, print_function,
unicode_literals)
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@matplotlib@py2@matplotlib@backends@qt_editor@__init__.py@.PATH_END.py |
{
"filename": "ngamma_eq.py",
"repo_name": "nuc-astro/winnet",
"repo_path": "winnet_extracted/winnet-master/bin/movie_script/src_files/ngamma_eq.py",
"type": "Python"
} | import numpy as np
import pandas as pd
from winvn_class import winvn
from numba import jit
class ngamma_eq(object):
def __init__(self, path_winvn="winvne_v2.0.dat"):
"""
Constructor for the class
"""
# Set the paths
self.__path_winvn = path_winvn
# Read the files
... | nuc-astroREPO_NAMEwinnetPATH_START.@winnet_extracted@winnet-master@bin@movie_script@src_files@ngamma_eq.py@.PATH_END.py |
{
"filename": "_wsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/cone/_wsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="wsrc", parent_name="cone", **kwargs):
super(WsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwa... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@cone@_wsrc.py@.PATH_END.py |
{
"filename": "copy_injection_recovery.py",
"repo_name": "ThibeauWouters/TurboPE-BNS",
"repo_path": "TurboPE-BNS_extracted/TurboPE-BNS-main/injections/outdir_TF2/injection_8/copy_injection_recovery.py",
"type": "Python"
} | import os
os.environ['CUDA_VISIBLE_DEVICES'] = "3"
os.environ["XLA_PYTHON_CLIENT_MEM_FRACTION"] = "0.25"
import numpy as np
import argparse
# The following is needed on CIT cluster to avoid an obscure Python error
import psutil
p = psutil.Process()
p.cpu_affinity([0])
# Regular imports
import argparse
import copy
impo... | ThibeauWoutersREPO_NAMETurboPE-BNSPATH_START.@TurboPE-BNS_extracted@TurboPE-BNS-main@injections@outdir_TF2@injection_8@copy_injection_recovery.py@.PATH_END.py |
{
"filename": "gacnn.py",
"repo_name": "ahmedfgad/GeneticAlgorithmPython",
"repo_path": "GeneticAlgorithmPython_extracted/GeneticAlgorithmPython-master/pygad/gacnn/gacnn.py",
"type": "Python"
} | from ..cnn import cnn
import copy
def population_as_vectors(population_networks):
"""
Accepts the population as networks and returns a list holding all weights of the CNN layers of each solution (i.e. network) in the population as a vector.
If the population has 6 solutions (i.e. networks), this function... | ahmedfgadREPO_NAMEGeneticAlgorithmPythonPATH_START.@GeneticAlgorithmPython_extracted@GeneticAlgorithmPython-master@pygad@gacnn@gacnn.py@.PATH_END.py |
{
"filename": "_reversescale.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/surface/_reversescale.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ReversescaleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="reversescale", parent_name="surface", **kwargs):
super(ReversescaleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@surface@_reversescale.py@.PATH_END.py |
{
"filename": "_textfont.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterternary/_textfont.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="textfont", parent_name="scatterternary", **kwargs):
super(TextfontValidator, 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@scatterternary@_textfont.py@.PATH_END.py |
{
"filename": "khatplot.py",
"repo_name": "arviz-devs/arviz",
"repo_path": "arviz_extracted/arviz-main/arviz/plots/backends/matplotlib/khatplot.py",
"type": "Python"
} | """Matplotlib khatplot."""
import warnings
import matplotlib as mpl
from matplotlib import cm
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import to_rgba_array
from ....stats.density_utils import histogram
from ...plot_utils import _scale_fig_size, color_from_dim, set_xticklabels, vector... | arviz-devsREPO_NAMEarvizPATH_START.@arviz_extracted@arviz-main@arviz@plots@backends@matplotlib@khatplot.py@.PATH_END.py |
{
"filename": "thermo.py",
"repo_name": "classULDM/class.SFDM",
"repo_path": "class.SFDM_extracted/class.SFDM-master/scripts/thermo.py",
"type": "Python"
} | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
# import necessary modules
# uncomment to get plots displayed in notebook
#get_ipython().run_line_magic('matplotlib', 'inline')
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from classy import Class
from scipy.optimize import fsolve
from scipy.int... | classULDMREPO_NAMEclass.SFDMPATH_START.@class.SFDM_extracted@class.SFDM-master@scripts@thermo.py@.PATH_END.py |
{
"filename": "definitions.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/yt/frontends/enzo/definitions.py",
"type": "Python"
} | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@frontends@enzo@definitions.py@.PATH_END.py | |
{
"filename": "_spec_helpers.py",
"repo_name": "hgrecco/pint",
"repo_path": "pint_extracted/pint-master/pint/delegates/formatter/_spec_helpers.py",
"type": "Python"
} | """
pint.delegates.formatter._spec_helpers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Convenient functions to deal with format specifications.
:copyright: 2022 by Pint Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import annotations
import fu... | hgreccoREPO_NAMEpintPATH_START.@pint_extracted@pint-master@pint@delegates@formatter@_spec_helpers.py@.PATH_END.py |
{
"filename": "script_example_model+fit_2_lines-checkpoint.ipynb",
"repo_name": "thomasorb/orcs",
"repo_path": "orcs_extracted/orcs-master/docs/.ipynb_checkpoints/script_example_model+fit_2_lines-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | # Modelling and fitting a spectrum with two resolved lines
Based on what we have seen in the example [Modelling and fitting one emission line](./script_example_model+fit_1_line.ipynb) we will model and fit a spectrum with two resolved lines. This example will then be used in [Modelling and fitting two unresolved emiss... | thomasorbREPO_NAMEorcsPATH_START.@orcs_extracted@orcs-master@docs@.ipynb_checkpoints@script_example_model+fit_2_lines-checkpoint.ipynb@.PATH_END.py |
{
"filename": "_variant.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/heatmapgl/legendgrouptitle/font/_variant.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="variant",
parent_name="heatmapgl.legendgrouptitle.font",
**kwargs,
):
super(VariantValidator, self).__init__(
plotl... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@heatmapgl@legendgrouptitle@font@_variant.py@.PATH_END.py |
{
"filename": "mahalanobis_stats.py",
"repo_name": "astro-seanwhy/AstroStats",
"repo_path": "AstroStats_extracted/AstroStats-main/mahalanobis_stats.py",
"type": "Python"
} | """
A python script in implementing a 2-sample, multivariate Mahalanobis Distance signifiance test.
Written by: Haiyang S. Wang, ETH Zurich / University of Copenhagen
Date: 25-04-2024
References:
Mahalanobis, P. C. 1930, J. Proceedings, Asiat. Soc. Bengal, 26, 541
Mardia, K. V., Kent, J. T., & Bibby, J. M. 1979, i... | astro-seanwhyREPO_NAMEAstroStatsPATH_START.@AstroStats_extracted@AstroStats-main@mahalanobis_stats.py@.PATH_END.py |
{
"filename": "ccddata.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/astropy/nddata/ccddata.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""This module implements the base CCDData class."""
import itertools
import numpy as np
from astropy import log
from astropy import units as u
from astropy.io import fits, registry
from astropy.utils.decorators import sharedmethod
from astropy.wcs impo... | astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@nddata@ccddata.py@.PATH_END.py |
{
"filename": "_uirevision.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/yaxis/_uirevision.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class UirevisionValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="uirevision", parent_name="layout.yaxis", **kwargs):
super(UirevisionValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@yaxis@_uirevision.py@.PATH_END.py |
{
"filename": "fitting_workflow.ipynb",
"repo_name": "PetroFit/petrofit",
"repo_path": "petrofit_extracted/petrofit-main/docs/fitting_workflow.ipynb",
"type": "Jupyter Notebook"
} | # Galaxy Modeling
In this section, we demonstrate the basics of light profile modeling on a galaxy using a single component Sérsic profile. We also demonstrate how the `photometry` and `petrosian` PetroFit sub-models can be used to improve the initial guesses of the Sérsic parameters.
**Please note that this is an ex... | PetroFitREPO_NAMEpetrofitPATH_START.@petrofit_extracted@petrofit-main@docs@fitting_workflow.ipynb@.PATH_END.py |
{
"filename": "gtest_shuffle_test.py",
"repo_name": "mattpitkin/tempo2",
"repo_path": "tempo2_extracted/tempo2-master/tests/gtest-1.7.0/test/gtest_shuffle_test.py",
"type": "Python"
} | #!/usr/bin/env python
#
# Copyright 2009 Google Inc. 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, this list of... | mattpitkinREPO_NAMEtempo2PATH_START.@tempo2_extracted@tempo2-master@tests@gtest-1.7.0@test@gtest_shuffle_test.py@.PATH_END.py |
{
"filename": "bexvar.py",
"repo_name": "StingraySoftware/stingray",
"repo_path": "stingray_extracted/stingray-main/stingray/bexvar.py",
"type": "Python"
} | """
Copyright 2020-2022 Johannes Buchner, David Bogensberger
Copyright 2022 Mihir Tripathi and StingraySoftware
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including witho... | StingraySoftwareREPO_NAMEstingrayPATH_START.@stingray_extracted@stingray-main@stingray@bexvar.py@.PATH_END.py |
{
"filename": "filters.py",
"repo_name": "StingraySoftware/stingray",
"repo_path": "stingray_extracted/stingray-main/stingray/filters.py",
"type": "Python"
} | import numpy as np
import warnings
import copy
import numpy as np
import numpy.random as ra
from .utils import njit
from .loggingconfig import setup_logger
__all__ = ["Window1D", "Optimal1D"]
logger = setup_logger()
class Window1D(object):
"""
Make a top hat filter (window function) for power spectrum or ... | StingraySoftwareREPO_NAMEstingrayPATH_START.@stingray_extracted@stingray-main@stingray@filters.py@.PATH_END.py |
{
"filename": "variables_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/kernel_tests/variables/variables_test.py",
"type": "Python"
} | # Copyright 2015 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@kernel_tests@variables@variables_test.py@.PATH_END.py |
{
"filename": "_texttemplate.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/icicle/_texttemplate.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TexttemplateValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="texttemplate", parent_name="icicle", **kwargs):
super(TexttemplateValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@icicle@_texttemplate.py@.PATH_END.py |
{
"filename": "test_subclass.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/simplejson/py2/simplejson/tests/test_subclass.py",
"type": "Python"
} | from unittest import TestCase
import simplejson as json
from decimal import Decimal
class AlternateInt(int):
def __repr__(self):
return 'invalid json'
__str__ = __repr__
class AlternateFloat(float):
def __repr__(self):
return 'invalid json'
__str__ = __repr__
# class AlternateDecim... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@simplejson@py2@simplejson@tests@test_subclass.py@.PATH_END.py |
{
"filename": "list.py",
"repo_name": "davidharvey1986/pyRRG",
"repo_path": "pyRRG_extracted/pyRRG-master/unittests/bugFixPyRRG/lib/python3.7/site-packages/pip/_internal/commands/list.py",
"type": "Python"
} | # The following comment should be removed at some point in the future.
# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
import json
import logging
from pip._vendor import six
from pip._internal.cli import cmdoptions
from pip._internal.cli.req_command import IndexGroupCommand
from pip._inte... | davidharvey1986REPO_NAMEpyRRGPATH_START.@pyRRG_extracted@pyRRG-master@unittests@bugFixPyRRG@lib@python3.7@site-packages@pip@_internal@commands@list.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "DMGW-Goethe/imripy",
"repo_path": "imripy_extracted/imripy-main/src/imripy/halo/__init__.py",
"type": "Python"
} | from .halo import *
from .dm import *
from .baryonic import *
| DMGW-GoetheREPO_NAMEimripyPATH_START.@imripy_extracted@imripy-main@src@imripy@halo@__init__.py@.PATH_END.py |
{
"filename": "grobid.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/document_loaders/grobid.ipynb",
"type": "Jupyter Notebook"
} | # Grobid
GROBID is a machine learning library for extracting, parsing, and re-structuring raw documents.
It is designed and expected to be used to parse academic papers, where it works particularly well. Note: if the articles supplied to Grobid are large documents (e.g. dissertations) exceeding a certain number of el... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@document_loaders@grobid.ipynb@.PATH_END.py |
{
"filename": "timeout.py",
"repo_name": "Astroua/AstroStat_Results",
"repo_path": "AstroStat_Results_extracted/AstroStat_Results-master/jasper/timeout.py",
"type": "Python"
} | from __future__ import with_statement
import signal
from contextlib import contextmanager
'''
http://stackoverflow.com/questions/366682/how-to-limit-execution-time-of-a-function-call-in-python
'''
class TimeoutException(Exception):
pass
@contextmanager
def time_limit(seconds):
def signal_handler(signum, fr... | AstrouaREPO_NAMEAstroStat_ResultsPATH_START.@AstroStat_Results_extracted@AstroStat_Results-master@jasper@timeout.py@.PATH_END.py |
{
"filename": "get_HMF_from_models.py",
"repo_name": "Moyoxkit/cluster-counts",
"repo_path": "cluster-counts_extracted/cluster-counts-main/scripts/get_HMF_from_models.py",
"type": "Python"
} | import numpy as np
from tqdm import tqdm
import h5py as h5
import pickle
from cluster_model import cluster_cosmology_model as ccm
from median_and_scatter_model import median_and_scatter_model
redshifts = np.linspace(0, 2, 41)
FLAM_info = median_and_scatter_model(
"../make_hbt_pickles/hist_and_med_L1000N1800_Y.pkl"... | MoyoxkitREPO_NAMEcluster-countsPATH_START.@cluster-counts_extracted@cluster-counts-main@scripts@get_HMF_from_models.py@.PATH_END.py |
{
"filename": "SampleFileUtil.py",
"repo_name": "JulianBMunoz/21cmvFAST",
"repo_path": "21cmvFAST_extracted/21cmvFAST-master/public_21CMvFAST_MC/Programs/CosmoHammer_21CMMC/util/SampleFileUtil.py",
"type": "Python"
} | #!/usr/bin/env python
import CosmoHammer_21CMMC.constants.Constants as c
import numpy as np
import pickle
class SampleFileUtil(object):
"""
Util for handling sample files
:param filePrefix: the prefix to use
:param master: True if the sampler instance is the master
:param reuseBurnin: True if the burn in data... | JulianBMunozREPO_NAME21cmvFASTPATH_START.@21cmvFAST_extracted@21cmvFAST-master@public_21CMvFAST_MC@Programs@CosmoHammer_21CMMC@util@SampleFileUtil.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "benjaminpope/smearcampaign",
"repo_path": "smearcampaign_extracted/smearcampaign-master/data/lcs/README.md",
"type": "Markdown"
} | # lcs
This folder contains all the light curves from the **Kepler Smear Campaign**.
They are 'combined' in the sense that there are two smear registers: 'virtual' and 'masked'. In cases where the star is extremely bright and/or near the edge of the chip, the direct saturation bleed column from the star can hit one o... | benjaminpopeREPO_NAMEsmearcampaignPATH_START.@smearcampaign_extracted@smearcampaign-master@data@lcs@README.md@.PATH_END.py |
{
"filename": "primitives_resample.py",
"repo_name": "GeminiDRSoftware/DRAGONS",
"repo_path": "DRAGONS_extracted/DRAGONS-master/geminidr/core/primitives_resample.py",
"type": "Python"
} | #
# gemini_python
#
# primitives_resample.py
# ------------------------------------------------------------------------------
from functools import reduce
from copy import copy
import numpy as np
fr... | GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@geminidr@core@primitives_resample.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "mrbell/fsclean",
"repo_path": "fsclean_extracted/fsclean-master/setup.py",
"type": "Python"
} | from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy
include_gsl_dir = "/usr/include/gsl/"
lib_gsl_dir = "/usr/lib64/"
# python setup.py build_ext --inplace
# Note that I need to include gslcblas otherwise I get import errors!!!
ext = Extension... | mrbellREPO_NAMEfscleanPATH_START.@fsclean_extracted@fsclean-master@setup.py@.PATH_END.py |
{
"filename": "model.py",
"repo_name": "triton-inference-server/server",
"repo_path": "server_extracted/server-main/qa/L0_model_config/autofill_noplatform_success/python/dynamic_batching/model.py",
"type": "Python"
} | # Copyright 2022-2023, 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, this list o... | triton-inference-serverREPO_NAMEserverPATH_START.@server_extracted@server-main@qa@L0_model_config@autofill_noplatform_success@python@dynamic_batching@model.py@.PATH_END.py |
{
"filename": "_namelength.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/cone/hoverlabel/_namelength.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NamelengthValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="namelength", parent_name="cone.hoverlabel", **kwargs
):
super(NamelengthValidator, self).__init__(
plotly_name=plotly_name,
par... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@cone@hoverlabel@_namelength.py@.PATH_END.py |
{
"filename": "13_power_spectrum_scheme.ipynb",
"repo_name": "smsharma/dark-photons-perturbations",
"repo_path": "dark-photons-perturbations_extracted/dark-photons-perturbations-master/notebooks/13_power_spectrum_scheme.ipynb",
"type": "Jupyter Notebook"
} | ```python
import os, sys
from glob import glob
sys.path.append("../")
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.pylab as pylab
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('retina')
%matplotlib inline
%load_ext autoreload
%autoreload 2
```
```python
# Load pl... | smsharmaREPO_NAMEdark-photons-perturbationsPATH_START.@dark-photons-perturbations_extracted@dark-photons-perturbations-master@notebooks@13_power_spectrum_scheme.ipynb@.PATH_END.py |
{
"filename": "test_ops.py",
"repo_name": "pytorch/vision",
"repo_path": "vision_extracted/vision-main/test/test_ops.py",
"type": "Python"
} | import math
import os
from abc import ABC, abstractmethod
from functools import lru_cache
from itertools import product
from typing import Callable, List, Tuple
import numpy as np
import pytest
import torch
import torch.fx
import torch.nn.functional as F
import torch.testing._internal.optests as optests
from common_ut... | pytorchREPO_NAMEvisionPATH_START.@vision_extracted@vision-main@test@test_ops.py@.PATH_END.py |
{
"filename": "_line.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/ohlc/increasing/_line.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LineValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="line", parent_name="ohlc.increasing", **kwargs):
super(LineValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@ohlc@increasing@_line.py@.PATH_END.py |
{
"filename": "camb.py",
"repo_name": "JulianBMunoz/RelicFast",
"repo_path": "RelicFast_extracted/RelicFast-master/CAMB_Current/pycamb/camb/camb.py",
"type": "Python"
} | from .baseconfig import camblib, CAMBError, CAMB_Structure, dll_import, mock_load
import ctypes
from ctypes import c_float, c_int, c_double, c_bool, POINTER, byref
from . import model, constants, initialpower, lensing
import numpy as np
from numpy import ctypeslib as nplib
from numpy.ctypeslib import ndpointer
import l... | JulianBMunozREPO_NAMERelicFastPATH_START.@RelicFast_extracted@RelicFast-master@CAMB_Current@pycamb@camb@camb.py@.PATH_END.py |
{
"filename": "test_basic.py",
"repo_name": "agreenbaum/ImPlaneIA",
"repo_path": "ImPlaneIA_extracted/ImPlaneIA-master/nrm_analysis/tests/test_basic.py",
"type": "Python"
} | def func(x):
return x + 1
def test_answer():
assert func(3) == 4
| agreenbaumREPO_NAMEImPlaneIAPATH_START.@ImPlaneIA_extracted@ImPlaneIA-master@nrm_analysis@tests@test_basic.py@.PATH_END.py |
{
"filename": "Example.ipynb",
"repo_name": "cheerfuluser/tessreduce",
"repo_path": "tessreduce_extracted/tessreduce-master/examples/Example.ipynb",
"type": "Jupyter Notebook"
} | # Using TESSreduce to get light curves
TESS offers the exciting possibility of high cadence photometry for hundreds of transients across the sky, but the bright complex background can present challenges. With TESSreduce, we can subtract the TESS background accounting for both the smooth background and the discrete... | cheerfuluserREPO_NAMEtessreducePATH_START.@tessreduce_extracted@tessreduce-master@examples@Example.ipynb@.PATH_END.py |
{
"filename": "_shadow.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/waterfall/insidetextfont/_shadow.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShadowValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="shadow", parent_name="waterfall.insidetextfont", **kwargs
):
super(ShadowValidator, self).__init__(
plotly_name=plotly_name,
parent_... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@waterfall@insidetextfont@_shadow.py@.PATH_END.py |
{
"filename": "_textcase.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/heatmap/legendgrouptitle/font/_textcase.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextcaseValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="textcase",
parent_name="heatmap.legendgrouptitle.font",
**kwargs,
):
super(TextcaseValidator, self).__init__(
plot... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@heatmap@legendgrouptitle@font@_textcase.py@.PATH_END.py |
{
"filename": "hapi.py",
"repo_name": "nasa/Kamodo",
"repo_path": "Kamodo_extracted/Kamodo-master/kamodo_ccmc/readers/hapi.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 3 17:11:29 2021
@author: Darren
Adapted by R Ringuette
"""
from kamodo import Kamodo, kamodofy
import numpy as np
import datetime
import urllib, json
# Renamed hapi as PYhapi to avoid name conflict
from hapiclient import hapi as PYhapi
from hapiclient import hapitime2da... | nasaREPO_NAMEKamodoPATH_START.@Kamodo_extracted@Kamodo-master@kamodo_ccmc@readers@hapi.py@.PATH_END.py |
{
"filename": "_uid.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/pie/_uid.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class UidValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="uid", parent_name="pie", **kwargs):
super(UidValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwar... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@pie@_uid.py@.PATH_END.py |
{
"filename": "contour_label_demo.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/galleries/examples/images_contours_and_fields/contour_label_demo.py",
"type": "Python"
} | """
==================
Contour Label Demo
==================
Illustrate some of the more advanced things that one can do with
contour labels.
See also the :doc:`contour demo example
</gallery/images_contours_and_fields/contour_demo>`.
"""
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.ticker a... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@galleries@examples@images_contours_and_fields@contour_label_demo.py@.PATH_END.py |
{
"filename": "_weightsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter/hoverlabel/font/_weightsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WeightsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="weightsrc", parent_name="scatter.hoverlabel.font", **kwargs
):
super(WeightsrcValidator, self).__init__(
plotly_name=plotly_name,
pa... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter@hoverlabel@font@_weightsrc.py@.PATH_END.py |
{
"filename": "model_trace.py",
"repo_name": "simonsobs/nextline-rdb",
"repo_path": "nextline-rdb_extracted/nextline-rdb-main/src/nextline_rdb/alembic/models/rev_4dc6a93dfed8/model_trace.py",
"type": "Python"
} | from datetime import datetime
from typing import TYPE_CHECKING
from sqlalchemy import ForeignKey, UniqueConstraint
from sqlalchemy.orm import Mapped, mapped_column, relationship
from .base import Model
if TYPE_CHECKING:
from .model_prompt import Prompt
from .model_run import Run
from .model_stdout import... | simonsobsREPO_NAMEnextline-rdbPATH_START.@nextline-rdb_extracted@nextline-rdb-main@src@nextline_rdb@alembic@models@rev_4dc6a93dfed8@model_trace.py@.PATH_END.py |
{
"filename": "_bordercolor.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattersmith/marker/colorbar/_bordercolor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="bordercolor",
parent_name="scattersmith.marker.colorbar",
**kwargs,
):
super(BordercolorValidator, self).__init__(
p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattersmith@marker@colorbar@_bordercolor.py@.PATH_END.py |
{
"filename": "test_cosmosim.py",
"repo_name": "astropy/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/cosmosim/tests/test_cosmosim.py",
"type": "Python"
} | astropyREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@cosmosim@tests@test_cosmosim.py@.PATH_END.py | |
{
"filename": "pinecone.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/text_embedding/pinecone.ipynb",
"type": "Jupyter Notebook"
} | # Pinecone Embeddings
Pinecone's inference API can be accessed via `PineconeEmbeddings`. Providing text embeddings via the Pinecone service. We start by installing prerequisite libraries:
```python
!pip install -qU "langchain-pinecone>=0.2.0"
```
Next, we [sign up / log in to Pinecone](https://app.pinecone.io) to ... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@text_embedding@pinecone.ipynb@.PATH_END.py |
{
"filename": "_layer.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/image/_layer.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LayerValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="layer", parent_name="layout.image", **kwargs):
super(LayerValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@image@_layer.py@.PATH_END.py |
{
"filename": "KidderIsentropicCapsuleBoundary.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/tests/functional/Hydro/ICF/KidderIsentropicImplosion/KidderIsentropicCapsuleBoundary.py",
"type": "Python"
} | #-------------------------------------------------------------------------------
# KidderIsentropicCapsuleBoundary
#
# Enforces the boundary conditions appropriate for the Kidder isentropic ICF
# capsule.
#-------------------------------------------------------------------------------
from Spheral import *
from math im... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@tests@functional@Hydro@ICF@KidderIsentropicImplosion@KidderIsentropicCapsuleBoundary.py@.PATH_END.py |
{
"filename": "linear_search.py",
"repo_name": "lgrcia/paper-nuance",
"repo_path": "paper-nuance_extracted/paper-nuance-main/workflows/comparison_toi/scripts/linear_search.py",
"type": "Python"
} | import numpy as np
from nuance import Nuance
from nuance.kernels import rotation
import yaml
import pickle
from time import time as timer
durations = snakemake.params[0]
nus = []
time, flux = np.load(snakemake.input[0])
gp_params = yaml.safe_load(open(snakemake.input[1]))
build_gp, init = rotation(1, long_scale=0.5)
... | lgrciaREPO_NAMEpaper-nuancePATH_START.@paper-nuance_extracted@paper-nuance-main@workflows@comparison_toi@scripts@linear_search.py@.PATH_END.py |
{
"filename": "connection.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/redis/py3/redis/connection.py",
"type": "Python"
} | import copy
import os
import socket
import ssl
import sys
import threading
import weakref
from abc import abstractmethod
from itertools import chain
from queue import Empty, Full, LifoQueue
from time import time
from typing import Any, Callable, Dict, List, Optional, Type, Union
from urllib.parse import parse_qs, unquo... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@redis@py3@redis@connection.py@.PATH_END.py |
{
"filename": "_distr_params.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/stats/_distr_params.py",
"type": "Python"
} | """
Sane parameters for stats.distributions.
"""
import numpy as np
distcont = [
['alpha', (3.5704770516650459,)],
['anglit', ()],
['arcsine', ()],
['argus', (1.0,)],
['beta', (2.3098496451481823, 0.62687954300963677)],
['betaprime', (5, 6)],
['bradford', (0.29891359763170633,)],
['burr... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@stats@_distr_params.py@.PATH_END.py |
{
"filename": "test_pulsemodels_cython.py",
"repo_name": "fjankowsk/scatfit",
"repo_path": "scatfit_extracted/scatfit-master/tests/test_pulsemodels_cython.py",
"type": "Python"
} | import numpy as np
import scatfit.pulsemodels_python as pm_python
import scatfit.pulsemodels_cython as pm_cython
def test_agreement_python_and_cython_models_gaussian():
"""
Check that the Python and Cython implementations match.
Normed Gaussian.
"""
plot_range = np.linspace(-1000.0, 1000.0, num=... | fjankowskREPO_NAMEscatfitPATH_START.@scatfit_extracted@scatfit-master@tests@test_pulsemodels_cython.py@.PATH_END.py |
{
"filename": "_weight.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/choroplethmapbox/colorbar/title/font/_weight.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WeightValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self,
plotly_name="weight",
parent_name="choroplethmapbox.colorbar.title.font",
**kwargs,
):
super(WeightValidator, self).__init__(
plotly... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@choroplethmapbox@colorbar@title@font@_weight.py@.PATH_END.py |
{
"filename": "rec_DL.py",
"repo_name": "Guo-Jian-Wang/refann",
"repo_path": "refann_extracted/refann-master/examples/rec_DL.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 14 21:48:23 2018
@author: Guojian Wang
"""
# import sys
# sys.path.append('..')
# import refann.refann as rf
import refann as rf
import numpy as np
import matplotlib.pyplot as plt
import time
start_time = time.time()
DL = np.loadtxt('data/Union2.1_DL.txt')
rec = rf.ANN... | Guo-Jian-WangREPO_NAMErefannPATH_START.@refann_extracted@refann-master@examples@rec_DL.py@.PATH_END.py |
{
"filename": "plot_neutrinos.py",
"repo_name": "philbull/RadioFisher",
"repo_path": "RadioFisher_extracted/RadioFisher-master/plotting/plot_neutrinos.py",
"type": "Python"
} | #!/usr/bin/python
"""
Plot 2D constraints on (M_nu, n_s).
"""
import numpy as np
import pylab as P
from rfwrapper import rf
import radiofisher.euclid as euclid
import matplotlib.patches
import matplotlib.cm
import matplotlib.ticker
cosmo = rf.experiments.cosmo
names = ['gSKA2_mnumnu010', 'EuclidRef_mnumnu010', 'SKA1MI... | philbullREPO_NAMERadioFisherPATH_START.@RadioFisher_extracted@RadioFisher-master@plotting@plot_neutrinos.py@.PATH_END.py |
{
"filename": "llm_symbolic_math.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/cookbook/llm_symbolic_math.ipynb",
"type": "Jupyter Notebook"
} | # LLM Symbolic Math
This notebook showcases using LLMs and Python to Solve Algebraic Equations. Under the hood is makes use of [SymPy](https://www.sympy.org/en/index.html).
```python
from langchain_experimental.llm_symbolic_math.base import LLMSymbolicMathChain
from langchain_openai import OpenAI
llm = OpenAI(tempe... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@cookbook@llm_symbolic_math.ipynb@.PATH_END.py |
{
"filename": "test_terms.py",
"repo_name": "exoplanet-dev/celerite2",
"repo_path": "celerite2_extracted/celerite2-main/python/test/test_terms.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
import numpy as np
import pytest
from celerite import terms as cterms
from celerite2 import terms
test_terms = [
cterms.RealTerm(log_a=np.log(2.5), log_c=np.log(1.1123)),
cterms.RealTerm(log_a=np.log(12.345), log_c=np.log(1.5))
+ cterms.RealTerm(log_a=np.log(0.5), log_c=np.log(1.12... | exoplanet-devREPO_NAMEcelerite2PATH_START.@celerite2_extracted@celerite2-main@python@test@test_terms.py@.PATH_END.py |
{
"filename": "test_sqlitevss.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/integration_tests/vectorstores/test_sqlitevss.py",
"type": "Python"
} | from typing import List, Optional
import pytest
from langchain_core.documents import Document
from langchain_community.vectorstores import SQLiteVSS
from tests.integration_tests.vectorstores.fake_embeddings import (
FakeEmbeddings,
fake_texts,
)
def _sqlite_vss_from_texts(
metadatas: Optional[List[dict]... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@integration_tests@vectorstores@test_sqlitevss.py@.PATH_END.py |
{
"filename": "matmul.py",
"repo_name": "google/jax",
"repo_path": "jax_extracted/jax-main/jax/experimental/pallas/ops/tpu/matmul.py",
"type": "Python"
} | # Copyright 2023 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@jax@experimental@pallas@ops@tpu@matmul.py@.PATH_END.py |
{
"filename": "api.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/yt/sample_data/api.py",
"type": "Python"
} | """
This is a collection of helper functions to yt.load_sample
"""
import json
import re
import sys
from functools import lru_cache
from pathlib import Path
from typing import Optional
from warnings import warn
from yt.config import ytcfg
from yt.utilities.on_demand_imports import (
_pandas as pd,
_pooch as p... | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@sample_data@api.py@.PATH_END.py |
{
"filename": "Derivedparam.py",
"repo_name": "ja-vazquez/SimpleMC",
"repo_path": "SimpleMC_extracted/SimpleMC-master/simplemc/cosmo/Derivedparam.py",
"type": "Python"
} |
##
# This file has derived parameter definitions given the
# parameters used in this code.
##
class AllDerived:
"""
Given base parameters, return a list of some Derived ones.
"""
def __init__(self):
#Standard cosmological parameters.
self.Ol = Derivedparam('Ol', 0, '\Omega_\Lambda*'... | ja-vazquezREPO_NAMESimpleMCPATH_START.@SimpleMC_extracted@SimpleMC-master@simplemc@cosmo@Derivedparam.py@.PATH_END.py |
{
"filename": "proxs.py",
"repo_name": "CosmoStat/mccd",
"repo_path": "mccd_extracted/mccd-master/mccd/proxs.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
r"""PROXIMAL OPERATORS.
Defines proximal operators to be fed to ModOpt algorithm that are
specific to MCCD(or rather, not currently in ``modopt.opt.proximity``).
: Authors: Tobias Liaudat <tobiasliaudat@gmail.com>,
Morgan Schmitz <github @MorganSchmitz>
"""
from __future__ import... | CosmoStatREPO_NAMEmccdPATH_START.@mccd_extracted@mccd-master@mccd@proxs.py@.PATH_END.py |
{
"filename": "EclipsingBinary_FullSolution_Painful.ipynb",
"repo_name": "rodluger/starry",
"repo_path": "starry_extracted/starry-master/notebooks/EclipsingBinary_FullSolution_Painful.ipynb",
"type": "Jupyter Notebook"
} | # Eclipsing binary: Solving for *everything* the slow way
In this notebook, we're continuing our tutorial on how to do inference. In [this notebook](EclipsingBinary_Generate.ipynb) we showed how to use `pymc3` to get posteriors over map coefficients of an eclipsing binary light curve, and in [this notebook](EclipsingB... | rodlugerREPO_NAMEstarryPATH_START.@starry_extracted@starry-master@notebooks@EclipsingBinary_FullSolution_Painful.ipynb@.PATH_END.py |
{
"filename": "feedback.py",
"repo_name": "veusz/veusz",
"repo_path": "veusz_extracted/veusz-master/veusz/utils/feedback.py",
"type": "Python"
} | # Copyright (C) 2018 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# 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 2 of the License, or
# ... | veuszREPO_NAMEveuszPATH_START.@veusz_extracted@veusz-master@veusz@utils@feedback.py@.PATH_END.py |
{
"filename": "cosmology_params.py",
"repo_name": "LSSTDESC/CCL",
"repo_path": "CCL_extracted/CCL-master/pyccl/_core/parameters/cosmology_params.py",
"type": "Python"
} | __all__ = ("CosmologyParams",)
from ... import lib
from . import CCLParameters
class CosmologyParams(CCLParameters, factory=lib.parameters):
"""Instances of this class hold cosmological parameters."""
def __getattribute__(self, key):
if key == "m_nu":
N_nu_mass = self._instance.N_nu_mass... | LSSTDESCREPO_NAMECCLPATH_START.@CCL_extracted@CCL-master@pyccl@_core@parameters@cosmology_params.py@.PATH_END.py |
{
"filename": "_textfont.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/pie/_textfont.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="textfont", parent_name="pie", **kwargs):
super(TextfontValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@pie@_textfont.py@.PATH_END.py |
{
"filename": "test_stats.py",
"repo_name": "htjb/margarine",
"repo_path": "margarine_extracted/margarine-master/tests/test_stats.py",
"type": "Python"
} | import numpy as np
from anesthetic import MCMCSamples
from margarine.maf import MAF
from margarine.marginal_stats import calculate
import pytest
from margarine.kde import KDE
from margarine.clustered import clusterMAF
from numpy.testing import assert_equal, assert_allclose
from scipy.stats import ks_2samp
def likelih... | htjbREPO_NAMEmargarinePATH_START.@margarine_extracted@margarine-master@tests@test_stats.py@.PATH_END.py |
{
"filename": "_dtick.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/barpolar/marker/colorbar/_dtick.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class DtickValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(
self, plotly_name="dtick", parent_name="barpolar.marker.colorbar", **kwargs
):
super(DtickValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@barpolar@marker@colorbar@_dtick.py@.PATH_END.py |
{
"filename": "rfi_inspect_2458207.ipynb",
"repo_name": "HERA-Team/H1C_IDR3_Notebooks",
"repo_path": "H1C_IDR3_Notebooks-main/rfi_inspect/rfi_inspect_2458207.ipynb",
"type": "Jupyter Notebook"
} | # RFI Inspection Daily RTP Notebook
```python
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import glob
import os
from astropy import units
from copy import deepcopy
from pyuvdata import UVFlag
import matplotlib.colors as colors
from matplotlib import cm
from IPython.display import display, HTM... | HERA-TeamREPO_NAMEH1C_IDR3_NotebooksPATH_START.@H1C_IDR3_Notebooks-main@rfi_inspect@rfi_inspect_2458207.ipynb@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "awmann/M_-M_K-",
"repo_path": "M_-M_K-_extracted/M_-M_K--master/setup.py",
"type": "Python"
} | from setuptools import setup,find_packages
setup(name='mk_mass',
version='1.0',
py_modules=['mk_mass'],
packages=find_packages() + ['resources'],
include_package_data=True
) | awmannREPO_NAMEM_-M_K-PATH_START.@M_-M_K-_extracted@M_-M_K--master@setup.py@.PATH_END.py |
{
"filename": "test_resume.py",
"repo_name": "mj-will/nessai",
"repo_path": "nessai_extracted/nessai-main/tests/test_proposal/test_importance/test_resume.py",
"type": "Python"
} | """Test the properties defined in ImportanceFlowProposal"""
import pickle
from unittest.mock import MagicMock, patch
import pytest
from nessai.proposal.importance import ImportanceFlowProposal as IFP
def test_resume(ifp, model, tmp_path):
flow_config = dict(patience=10, model_config=dict(n_inputs=2))
ifp.... | mj-willREPO_NAMEnessaiPATH_START.@nessai_extracted@nessai-main@tests@test_proposal@test_importance@test_resume.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.