metadata
dict
text
stringlengths
0
40.6M
id
stringlengths
14
255
{ "filename": "datafind.py", "repo_name": "gwpy/gwpy", "repo_path": "gwpy_extracted/gwpy-main/gwpy/io/datafind.py", "type": "Python" }
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2014-2020) # # This file is part of GWpy. # # GWpy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option)...
gwpyREPO_NAMEgwpyPATH_START.@gwpy_extracted@gwpy-main@gwpy@io@datafind.py@.PATH_END.py
{ "filename": "helper.py", "repo_name": "CaymanUnterborn/ExoPlex", "repo_path": "ExoPlex_extracted/ExoPlex-master/ExoPlex/burnman/eos/helper.py", "type": "Python" }
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences # Copyright (C) 2012 - 2017 by the BurnMan team, released under the GNU # GPL v2 or later. from __future__ import absolute_import import inspect from . import slb from . import mie_grueneisen_debye as mgd f...
CaymanUnterbornREPO_NAMEExoPlexPATH_START.@ExoPlex_extracted@ExoPlex-master@ExoPlex@burnman@eos@helper.py@.PATH_END.py
{ "filename": "system.py", "repo_name": "mikecokina/elisa", "repo_path": "elisa_extracted/elisa-master/src/elisa/single_system/system.py", "type": "Python" }
import numpy as np from scipy import optimize from copy import deepcopy from . orbit import orbit from . curves import lc, rv, c_router from . transform import SingleSystemProperties from . import ( model, graphic, radius as sradius, utils as sys_utils ) from . container import SinglePositionContainer...
mikecokinaREPO_NAMEelisaPATH_START.@elisa_extracted@elisa-master@src@elisa@single_system@system.py@.PATH_END.py
{ "filename": "make_bursty_movie.py", "repo_name": "agurvich/FIRE_studio", "repo_path": "FIRE_studio_extracted/FIRE_studio-main/src/firestudio/scripts/make_bursty_movie.py", "type": "Python" }
import copy import numpy as np from abg_python.function_utils import CLI_args from abg_python.plot_utils import plt plt.rcParams['figure.dpi']=300 from abg_python.galaxy.gal_utils import Galaxy from firestudio.interpolate.interpolate import InterpolationHandler from firestudio.studios.gas_studio import GasStudio from...
agurvichREPO_NAMEFIRE_studioPATH_START.@FIRE_studio_extracted@FIRE_studio-main@src@firestudio@scripts@make_bursty_movie.py@.PATH_END.py
{ "filename": "exceptions.py", "repo_name": "spacetelescope/synphot_refactor", "repo_path": "synphot_refactor_extracted/synphot_refactor-master/synphot/exceptions.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Exceptions specific to synthetic photometry.""" __all__ = ['SynphotError', 'TableFormatError', 'DuplicateWavelength', 'ZeroWavelength', 'UnsortedWavelength', 'OverlapError', 'PartialOverlap', 'DisjointError', 'UndefinedBinset', ...
spacetelescopeREPO_NAMEsynphot_refactorPATH_START.@synphot_refactor_extracted@synphot_refactor-master@synphot@exceptions.py@.PATH_END.py
{ "filename": "igrins_config.py", "repo_name": "igrins/plp", "repo_path": "plp_extracted/plp-master/igrins/igrins_libs/igrins_config.py", "type": "Python" }
import os from six.moves import configparser as ConfigParser from six.moves import cStringIO as StringIO from ..igrins_libs.logger import warning default_config_content = """[DEFAULT] MASTER_CAL_DIR=master_calib INDATA_PATH=indata/%(UTDATE)s OUTDATA_PATH=outdata/%(UTDATE)s PRIMARY_CALIB_PATH=calib/primary/%(UTDATE)s ...
igrinsREPO_NAMEplpPATH_START.@plp_extracted@plp-master@igrins@igrins_libs@igrins_config.py@.PATH_END.py
{ "filename": "sam.py", "repo_name": "nanograv/holodeck", "repo_path": "holodeck_extracted/holodeck-main/holodeck/sams/sam.py", "type": "Python" }
r"""Semi Analytic Modeling (SAM) submodule. The core element of the SAM module is the :class:`Semi_Analytic_Model` class. This class requires four components as arguments: (1) Galaxy Stellar Mass Function (GSMF): gives the comoving number-density of galaxies as a function of stellar mass. This is implemented as...
nanogravREPO_NAMEholodeckPATH_START.@holodeck_extracted@holodeck-main@holodeck@sams@sam.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/scattermapbox/marker/colorbar/tickfont/_style.py", "type": "Python" }
import _plotly_utils.basevalidators class StyleValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="style", parent_name="scattermapbox.marker.colorbar.tickfont", **kwargs, ): super(StyleValidator, self).__init__( plot...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattermapbox@marker@colorbar@tickfont@_style.py@.PATH_END.py
{ "filename": "tool_call_messages.ipynb", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/cookbook/tool_call_messages.ipynb", "type": "Jupyter Notebook" }
```python from langchain_anthropic import ChatAnthropic from langchain_core.runnables import ConfigurableField from langchain_core.tools import tool from langchain_openai import ChatOpenAI @tool def multiply(x: float, y: float) -> float: """Multiply 'x' times 'y'.""" return x * y @tool def exponentiate(x: f...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@cookbook@tool_call_messages.ipynb@.PATH_END.py
{ "filename": "test_repr.py", "repo_name": "renecotyfanboy/jaxspec", "repo_path": "jaxspec_extracted/jaxspec-main/tests/test_repr.py", "type": "Python" }
def test_spectral_model_repr(obs_model_prior): _, model, _ = obs_model_prior print(repr(model))
renecotyfanboyREPO_NAMEjaxspecPATH_START.@jaxspec_extracted@jaxspec-main@tests@test_repr.py@.PATH_END.py
{ "filename": "test_warping_coordinates.py", "repo_name": "LCOGT/nres-pipe", "repo_path": "nres-pipe_extracted/nres-pipe-master/nrespipe/test/test_warping_coordinates.py", "type": "Python" }
from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np from nrespipe.utils import evaluate_poly_coords, warp_coordinates def test_shift_in_x(): x = np.arange(100) y = np.arange(-100, 0) for shift in np.arange(-100, 100): expected = x + shift ...
LCOGTREPO_NAMEnres-pipePATH_START.@nres-pipe_extracted@nres-pipe-master@nrespipe@test@test_warping_coordinates.py@.PATH_END.py
{ "filename": "test_source_position.py", "repo_name": "lenstronomy/lenstronomy", "repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_PointSource/test_Types/test_source_position.py", "type": "Python" }
from lenstronomy.PointSource.Types.source_position import SourcePositions from lenstronomy.LensModel.lens_model import LensModel import pytest import numpy.testing as npt class TestLensedPosition(object): def setup_method(self): lens_model = LensModel(lens_model_list=["SIS"]) self.kwargs_lens = [{...
lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_PointSource@test_Types@test_source_position.py@.PATH_END.py
{ "filename": "nebulosity_mask.py", "repo_name": "schlafly/crowdsource", "repo_path": "crowdsource_extracted/crowdsource-master/crowdsource/nebulosity_mask.py", "type": "Python" }
#!/usr/bin/env python from __future__ import print_function, division import os import numpy as np from scipy.ndimage import gaussian_filter # quiet all of the annoying tensorflow compile model warnings os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' from keras import models as kmodels # import resource def equalize_histog...
schlaflyREPO_NAMEcrowdsourcePATH_START.@crowdsource_extracted@crowdsource-master@crowdsource@nebulosity_mask.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "PrefectHQ/prefect", "repo_path": "prefect_extracted/prefect-main/src/prefect/settings/models/server/__init__.py", "type": "Python" }
from .root import ServerSettings
PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@settings@models@server@__init__.py@.PATH_END.py
{ "filename": "plot_lib.py", "repo_name": "vblanka24/Ba_star_classification_PaperIII", "repo_path": "Ba_star_classification_PaperIII_extracted/Ba_star_classification_PaperIII-main/plotting_resids_correls/plot_lib.py", "type": "Python" }
import pandas as pd import numpy as np def peakfilter(rowstar, peak1, peak2, res_obs_mode=False): '''Create the dataframes filtered by peaks and ordered by increasing atomic number''' cols = rowstar.index.values.tolist() peak1p1, peak1p2, peak2p1, peak2p2 = [pd.DataFrame() for i in range(4)]#[pd.Series(dt...
vblanka24REPO_NAMEBa_star_classification_PaperIIIPATH_START.@Ba_star_classification_PaperIII_extracted@Ba_star_classification_PaperIII-main@plotting_resids_correls@plot_lib.py@.PATH_END.py
{ "filename": "_color.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/densitymap/colorbar/title/font/_color.py", "type": "Python" }
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="densitymap.colorbar.title.font", **kwargs, ): super(ColorValidator, self).__init__( plotly_name=plotl...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@densitymap@colorbar@title@font@_color.py@.PATH_END.py
{ "filename": "index.md", "repo_name": "ChandraCXC/iris", "repo_path": "iris_extracted/iris-master/iris-visualizer/src/site/markdown/index.md", "type": "Markdown" }
# iris-visualizer This page contains developer information for the `iris-visualizer` package. Please see the [Project Documentation][proj-info] for more details. Otherwise, return to the main [Iris user documentation][user-docs]. [proj-info]: ./project-info.html [user-docs]: ../index.html
ChandraCXCREPO_NAMEirisPATH_START.@iris_extracted@iris-master@iris-visualizer@src@site@markdown@index.md@.PATH_END.py
{ "filename": "test_models_ps_21cm.py", "repo_name": "mirochaj/micro21cm", "repo_path": "micro21cm_extracted/micro21cm-main/tests/test_models_ps_21cm.py", "type": "Python" }
""" test_models_ps_21cm.py Author: Jordan Mirocha Affiliation: McGill University Created on: Wed 16 Dec 2020 16:16:41 EST Description: """ import pytest import micro21cm import numpy as np @pytest.mark.parametrize('use_mcfit,', [(True,), (False,)]) def test(use_mcfit): model = micro21cm.BubbleModel(use_mcfit=...
mirochajREPO_NAMEmicro21cmPATH_START.@micro21cm_extracted@micro21cm-main@tests@test_models_ps_21cm.py@.PATH_END.py
{ "filename": "torch_adadelta.py", "repo_name": "keras-team/keras", "repo_path": "keras_extracted/keras-master/keras/src/backend/torch/optimizers/torch_adadelta.py", "type": "Python" }
import torch from keras.src import ops from keras.src import optimizers from keras.src.backend.torch.optimizers import torch_parallel_optimizer class Adadelta( torch_parallel_optimizer.TorchParallelOptimizer, optimizers.Adadelta ): def _parallel_update_step( self, grads, variables, ...
keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@backend@torch@optimizers@torch_adadelta.py@.PATH_END.py
{ "filename": "SiO2_Si Mueller Matrix.ipynb", "repo_name": "PyEllips/pyElli", "repo_path": "pyElli_extracted/pyElli-master/examples/SiO2_Si Mueller Matrix/SiO2_Si Mueller Matrix.ipynb", "type": "Jupyter Notebook" }
```python %matplotlib inline ``` # Mueller matrix Mueller matrix fit to a SiO2 on Si measurement. ```python import elli from elli.fitting import ParamsHist, fit_mueller_matrix # sphinx_gallery_thumbnail_path = '_static/mueller_matrix.png' ``` ## Read data We load the data from an ascii file containing each of ...
PyEllipsREPO_NAMEpyElliPATH_START.@pyElli_extracted@pyElli-master@examples@SiO2_Si Mueller Matrix@SiO2_Si Mueller Matrix.ipynb@.PATH_END.py
{ "filename": "decoder.py", "repo_name": "davidharvey1986/pyRRG", "repo_path": "pyRRG_extracted/pyRRG-master/unittests/bugFixPyRRG/lib/python3.7/site-packages/pip/_vendor/toml/decoder.py", "type": "Python" }
import datetime import io from os import linesep import re import sys from pip._vendor.toml.tz import TomlTz if sys.version_info < (3,): _range = xrange # noqa: F821 else: unicode = str _range = range basestring = str unichr = chr def _detect_pathlib_path(p): if (3, 4) <= sys.version_info: ...
davidharvey1986REPO_NAMEpyRRGPATH_START.@pyRRG_extracted@pyRRG-master@unittests@bugFixPyRRG@lib@python3.7@site-packages@pip@_vendor@toml@decoder.py@.PATH_END.py
{ "filename": "remove_deprecations.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/_plotly_future_/remove_deprecations.py", "type": "Python" }
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@_plotly_future_@remove_deprecations.py@.PATH_END.py
{ "filename": "manga.py", "repo_name": "sdss/mangadap", "repo_path": "mangadap_extracted/mangadap-main/mangadap/spectra/manga.py", "type": "Python" }
""" Implement the derived class for MaNGA row-stacked spectra. ---- .. include license and copyright .. include:: ../include/copy.rst ---- .. include common links, assuming primary doc root is up one directory .. include:: ../include/links.rst """ import os import warnings from IPython import embed import numpy ...
sdssREPO_NAMEmangadapPATH_START.@mangadap_extracted@mangadap-main@mangadap@spectra@manga.py@.PATH_END.py
{ "filename": "_ysrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatter3d/_ysrc.py", "type": "Python" }
import _plotly_utils.basevalidators class YsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__(self, plotly_name="ysrc", parent_name="scatter3d", **kwargs): super(YsrcValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_typ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatter3d@_ysrc.py@.PATH_END.py
{ "filename": "ninjatracing.py", "repo_name": "scipy/scipy", "repo_path": "scipy_extracted/scipy-main/tools/ninjatracing.py", "type": "Python" }
# Copyright 2018 Nico Weber # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@tools@ninjatracing.py@.PATH_END.py
{ "filename": "test_plot_utils.py", "repo_name": "nanograv/PINT", "repo_path": "PINT_extracted/PINT-master/tests/test_plot_utils.py", "type": "Python" }
"""Test basic functionality of the :module:`pint.plot_utils`.""" import numpy as np import astropy.units as u from astropy.time import Time from pint.plot_utils import phaseogram, phaseogram_binned import tempfile import os def test_phaseogram(): mjds_float = np.arange(58000, 58500, 1.0) mjds_quantity = mjds...
nanogravREPO_NAMEPINTPATH_START.@PINT_extracted@PINT-master@tests@test_plot_utils.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "adrn/gala", "repo_path": "gala_extracted/gala-main/gala/coordinates/__init__.py", "type": "Python" }
from .sgr import * from .orphan import * from .gd1 import * from .oph import * from .pal5 import * from .pal13 import * from .jhelum import * from .velocity_frame_transforms import * from .poincarepolar import * from .magellanic_stream import * from .reflex import * from .greatcircle import * from .pm_cov_transform imp...
adrnREPO_NAMEgalaPATH_START.@gala_extracted@gala-main@gala@coordinates@__init__.py@.PATH_END.py
{ "filename": "pyiriplas.py", "repo_name": "lofar-astron/RMextract", "repo_path": "RMextract_extracted/RMextract-master/RMextract/pyiriplas/pyiriplas.py", "type": "Python" }
import sys from scipy.interpolate import interp1d if (sys.version_info.major, sys.version_info.minor) < (3, 9): import importlib_resources as resources else: import importlib.resources as resources from . import _iriplas class pyiriplas: def __init__(self,year=2016,month=5,day=12,hour=1.,lon=0.,lat=0.):...
lofar-astronREPO_NAMERMextractPATH_START.@RMextract_extracted@RMextract-master@RMextract@pyiriplas@pyiriplas.py@.PATH_END.py
{ "filename": "trace_flat_old.py", "repo_name": "igrins/plp", "repo_path": "plp_extracted/plp-master/igrins/procedures/trace_flat_old.py", "type": "Python" }
from __future__ import print_function # import Libs.manual as m # reload(m) # import Libs.ap_tracing as m2 # reload(m2) import os import numpy as np import astropy.io.fits as pyfits import scipy.ndimage as ni import itertools from . import badpixel as bp def get_flat_normalization(flat_on_off, bg_std, bpix_mask):...
igrinsREPO_NAMEplpPATH_START.@plp_extracted@plp-master@igrins@procedures@trace_flat_old.py@.PATH_END.py
{ "filename": "_title.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/densitymap/colorbar/_title.py", "type": "Python" }
import _plotly_utils.basevalidators class TitleValidator(_plotly_utils.basevalidators.TitleValidator): def __init__( self, plotly_name="title", parent_name="densitymap.colorbar", **kwargs ): super(TitleValidator, self).__init__( plotly_name=plotly_name, parent_name=pare...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@densitymap@colorbar@_title.py@.PATH_END.py
{ "filename": "_dtickrange.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/parcats/line/colorbar/tickformatstop/_dtickrange.py", "type": "Python" }
import _plotly_utils.basevalidators class DtickrangeValidator(_plotly_utils.basevalidators.InfoArrayValidator): def __init__( self, plotly_name="dtickrange", parent_name="parcats.line.colorbar.tickformatstop", **kwargs, ): super(DtickrangeValidator, self).__init__( ...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@parcats@line@colorbar@tickformatstop@_dtickrange.py@.PATH_END.py
{ "filename": "README.md", "repo_name": "esa/gaia-bhthree", "repo_path": "gaia-bhthree_extracted/gaia-bhthree-main/README.md", "type": "Markdown" }
[//]: # (Copyright &#40;c&#41; European Space Agency, 2024.) [//]: # () [//]: # (This file is subject to the terms and conditions defined in file 'LICENCE.txt', which) [//]: # (is part of this source code package. No part of the package, including) [//]: # (this file, may be copied, modified, propagated, or distributed...
esaREPO_NAMEgaia-bhthreePATH_START.@gaia-bhthree_extracted@gaia-bhthree-main@README.md@.PATH_END.py
{ "filename": "test_core.py", "repo_name": "adrn/gala", "repo_path": "gala_extracted/gala-main/gala/potential/potential/tests/test_core.py", "type": "Python" }
""" Test the core Potential classes """ # Third party import pytest import numpy as np from astropy.constants import G import astropy.units as u from matplotlib import cm # This package from ..core import PotentialBase, CompositePotential from ...common import PotentialParameter from ....units import UnitSystem ...
adrnREPO_NAMEgalaPATH_START.@gala_extracted@gala-main@gala@potential@potential@tests@test_core.py@.PATH_END.py
{ "filename": "_text.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/table/legendgrouptitle/_text.py", "type": "Python" }
import _plotly_utils.basevalidators class TextValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="text", parent_name="table.legendgrouptitle", **kwargs ): super(TextValidator, self).__init__( plotly_name=plotly_name, parent_name=par...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@table@legendgrouptitle@_text.py@.PATH_END.py
{ "filename": "test_object_specialisms.py", "repo_name": "pynbody/tangos", "repo_path": "tangos_extracted/tangos-master/tests/test_object_specialisms.py", "type": "Python" }
import tangos import tangos as db import tangos.core.halo import tangos.core.simulation import tangos.core.timestep import tangos.relation_finding as relation_finding_strategies import tangos.testing import tangos.testing.simulation_generator def setup_module(): tangos.testing.init_blank_db_for_testing() gen...
pynbodyREPO_NAMEtangosPATH_START.@tangos_extracted@tangos-master@tests@test_object_specialisms.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "bwinkel/pycraf", "repo_path": "pycraf_extracted/pycraf-master/pycraf/geospatial/__init__.py", "type": "Python" }
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' This subpackage contains a couple of functions to convert coordinates between typical GIS frames, such as GPS (WGS84), UTM, and ETRS89. The underlying transformations are based on the `pyproj <https://pypi.python.org/pypi/pyproj>`_ package, which itself is a wrapper ar...
bwinkelREPO_NAMEpycrafPATH_START.@pycraf_extracted@pycraf-master@pycraf@geospatial@__init__.py@.PATH_END.py
{ "filename": "fitting.py", "repo_name": "LCOGT/banzai-nres", "repo_path": "banzai-nres_extracted/banzai-nres-main/banzai_nres/fitting.py", "type": "Python" }
import numpy as np from statsmodels.robust.norms import HuberT from astropy.modeling import fitting, polynomial def fit_polynomial(y, error, mask=None, n_iter=5, x=None, sigma=5, order=3, domain=None): if mask is None: mask = np.zeros(y.shape, dtype=bool) if x is None: x = np.arange(len(y), d...
LCOGTREPO_NAMEbanzai-nresPATH_START.@banzai-nres_extracted@banzai-nres-main@banzai_nres@fitting.py@.PATH_END.py
{ "filename": "_bracket.py", "repo_name": "scipy/scipy", "repo_path": "scipy_extracted/scipy-main/scipy/optimize/_bracket.py", "type": "Python" }
import numpy as np import scipy._lib._elementwise_iterative_method as eim from scipy._lib._util import _RichResult from scipy._lib._array_api import array_namespace, xp_ravel _ELIMITS = -1 # used in _bracket_root _ESTOPONESIDE = 2 # used in _bracket_root def _bracket_root_iv(func, xl0, xr0, xmin, xmax, factor, args...
scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@optimize@_bracket.py@.PATH_END.py
{ "filename": "_color.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/icicle/insidetextfont/_color.py", "type": "Python" }
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="icicle.insidetextfont", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name=pa...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@icicle@insidetextfont@_color.py@.PATH_END.py
{ "filename": "kltransform.py", "repo_name": "TianlaiProject/tlpipe", "repo_path": "tlpipe_extracted/tlpipe-master/tlpipe/map/drift/core/kltransform.py", "type": "Python" }
import time import os import re import numpy as np import scipy.linalg as la import h5py from caput import config, mpiutil from cora.util import hputil from ..util import util from . import skymodel def collect_m_arrays(mlist, func, shapes, dtype): data = [ (mi, func(mi)) for mi in mpiutil.partition_list_mpi...
TianlaiProjectREPO_NAMEtlpipePATH_START.@tlpipe_extracted@tlpipe-master@tlpipe@map@drift@core@kltransform.py@.PATH_END.py
{ "filename": "test_clenshaw.py", "repo_name": "DedalusProject/dedalus", "repo_path": "dedalus_extracted/dedalus-master/dedalus/tests/test_clenshaw.py", "type": "Python" }
"""Test spherical Clenshaw functions.""" # TODO: add tests for regular Jacobi Clenshaw import pytest import numpy as np from scipy import sparse import dedalus.public as d3 from dedalus.tools import clenshaw from dedalus.libraries import dedalus_sphere N_range = [8] regtotal_range = [-1, 0, +1] k_range = [0, 1] ell_...
DedalusProjectREPO_NAMEdedalusPATH_START.@dedalus_extracted@dedalus-master@dedalus@tests@test_clenshaw.py@.PATH_END.py
{ "filename": "noise.py", "repo_name": "jmackereth/asteroestimate", "repo_path": "asteroestimate_extracted/asteroestimate-master/asteroestimate/detections/noise.py", "type": "Python" }
import numpy as np def kepler_noise_model(G, BP, RP, cadence): """ return the ppm/hr noise for Kepler INPUT: G - G band magnitude BP - G_BP magnitude (not used for kepler!) RP - G_RP magnitude (not used for kepler!) cadence - the integration time OUTPUT: noise - ...
jmackerethREPO_NAMEasteroestimatePATH_START.@asteroestimate_extracted@asteroestimate-master@asteroestimate@detections@noise.py@.PATH_END.py
{ "filename": "inspect_gcat.ipynb", "repo_name": "rbuehler/vasca", "repo_path": "vasca_extracted/vasca-main/vasca/examples/inspect_gcat.ipynb", "type": "Jupyter Notebook" }
# Get and look at GCAT files ### Get GCAT files from https://archive.stsci.edu/prepds/gcat/gcat_dataproducts.html ```python import urllib.request import os outdir = "/home/buehler/Downloads/msc/" chunkdir = outdir + "manflag/" nr_chunks = 192 chunks = ["075","076","077","079","080","081","082","083","084","085","087"...
rbuehlerREPO_NAMEvascaPATH_START.@vasca_extracted@vasca-main@vasca@examples@inspect_gcat.ipynb@.PATH_END.py
{ "filename": "wcs.py", "repo_name": "astropy/astropy", "repo_path": "astropy_extracted/astropy-main/astropy/wcs/wcs.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst # Under the hood, there are 3 separate classes that perform different # parts of the transformation: # # - `~astropy.wcs.Wcsprm`: Is a direct wrapper of the core WCS # functionality in `wcslib`_. (This includes TPV and TPD # polynomial disto...
astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@wcs@wcs.py@.PATH_END.py
{ "filename": "test_pk.py", "repo_name": "andreicuceu/vega", "repo_path": "vega_extracted/vega-master/tests/test_pk.py", "type": "Python" }
import pytest import numpy as np import configparser from astropy.io import fits from vega.power_spectrum import PowerSpectrum from vega import utils def kaiser(): params = {'bias_LYA': -0.12, 'beta_LYA': 1.6} bias1, beta1, bias2, beta2 = utils.bias_beta(params, 'LYA', 'LYA') assert bias1 == bias2 as...
andreicuceuREPO_NAMEvegaPATH_START.@vega_extracted@vega-master@tests@test_pk.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "rennehan/yt-swift", "repo_path": "yt-swift_extracted/yt-swift-main/yt/utilities/grid_data_format/conversion/__init__.py", "type": "Python" }
from .conversion_abc import Converter from .conversion_athena import AthenaConverter, AthenaDistributedConverter
rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@yt@utilities@grid_data_format@conversion@__init__.py@.PATH_END.py
{ "filename": "_torchutils.py", "repo_name": "mariabenitocst/exoplanets", "repo_path": "exoplanets_extracted/exoplanets-main/src/utils/_torchutils.py", "type": "Python" }
import torch import torch.nn.functional # Class below is taking from pyrofit-utils: # https://github.com/kosiokarchev/pyrofit-utils/blob/master/pyrofit/utils/torchutils.py # It is used instead of scipy.interpolate.griddata class TorchInterpNd: """Curently only works in 2D and 3D because of limitations in torch's ...
mariabenitocstREPO_NAMEexoplanetsPATH_START.@exoplanets_extracted@exoplanets-main@src@utils@_torchutils.py@.PATH_END.py
{ "filename": "StellarMassDistribution.py", "repo_name": "LSSTDESC/descqa", "repo_path": "descqa_extracted/descqa-master/descqa/StellarMassDistribution.py", "type": "Python" }
import os import numpy as np from GCR import GCRQuery from .base import BaseValidationTest, TestResult from .plotting import plt __all__ = ["StellarMassTest"] class StellarMassTest(BaseValidationTest): """ This validation test looks at stellar mass distribution of DC2 catalogs to make sure it matches...
LSSTDESCREPO_NAMEdescqaPATH_START.@descqa_extracted@descqa-master@descqa@StellarMassDistribution.py@.PATH_END.py
{ "filename": "weimer_4D.py", "repo_name": "nasa/Kamodo", "repo_path": "Kamodo_extracted/Kamodo-master/kamodo_ccmc/readers/weimer_4D.py", "type": "Python" }
''' Written by Rebecca Ringuette, 2022 ''' # variable name in file: [standardized variable name, descriptive term, units] model_varnames = {'PHI': ['Phi', 'Electric potential', 0, 'SM', 'sph', ['time', 'lon', 'lat'], 'kV'], 'Psi': ['Psi', 'Magnetic potential', 0, 'SM', 'sph'...
nasaREPO_NAMEKamodoPATH_START.@Kamodo_extracted@Kamodo-master@kamodo_ccmc@readers@weimer_4D.py@.PATH_END.py
{ "filename": "test_kepclip.py", "repo_name": "KeplerGO/PyKE", "repo_path": "PyKE_extracted/PyKE-master/pyke/tests/test_kepclip.py", "type": "Python" }
from astropy.utils.data import get_pkg_data_filename from astropy.io import fits import numpy as np import os from ..kepio import delete from ..kepclip import kepclip TPF_filename = get_pkg_data_filename("data/testtpf.fits") LC_filename = get_pkg_data_filename("data/dip_llc.fits") OUT_filename = "out.fits" de...
KeplerGOREPO_NAMEPyKEPATH_START.@PyKE_extracted@PyKE-master@pyke@tests@test_kepclip.py@.PATH_END.py
{ "filename": "test_sedfit.py", "repo_name": "keflavich/HiGal_SEDfitter", "repo_path": "HiGal_SEDfitter_extracted/HiGal_SEDfitter-master/higal_sedfitter/tests/test_sedfit.py", "type": "Python" }
import numpy as np from astropy.io import fits from astropy import units as u from dust_emissivity.blackbody import modified_blackbody from higal_sedfitter.fit import fit_modified_blackbody_to_imagecube, PixelFitter def test_bbfit(): temperatures = [5,10,15,20,25] betas = [1,1.25,1.5,1.75,2.0,2.25,2.5] ...
keflavichREPO_NAMEHiGal_SEDfitterPATH_START.@HiGal_SEDfitter_extracted@HiGal_SEDfitter-master@higal_sedfitter@tests@test_sedfit.py@.PATH_END.py
{ "filename": "run_catboost_hnsw.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/catboost/python-package/ut/medium/run_catboost_hnsw.py", "type": "Python" }
import os import numpy as np from catboost.hnsw import HnswEstimator, EDistance def test_floats_60000(): data = np.fromfile(os.path.join(os.getcwd(), "hnsw_data", 'floats_60000'), dtype=np.dtype('float32')) dimension = 40 distance = EDistance.DotProduct data = data.reshape((data.size // dimension, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@python-package@ut@medium@run_catboost_hnsw.py@.PATH_END.py
{ "filename": "shift_jisx0213.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/tools/python3/Lib/encodings/shift_jisx0213.py", "type": "Python" }
# # shift_jisx0213.py: Python Unicode Codec for SHIFT_JISX0213 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('shift_jisx0213') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEnc...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@python3@Lib@encodings@shift_jisx0213.py@.PATH_END.py
{ "filename": "test_variety_parfiles.py", "repo_name": "nanograv/PINT", "repo_path": "PINT_extracted/PINT-master/tests/test_variety_parfiles.py", "type": "Python" }
"""Various test for the bad par files""" import pytest from io import StringIO from pint.exceptions import ( TimingModelError, UnknownBinaryModel, MissingBinaryError, MissingParameter, ) from pint.models.model_builder import get_model base_par = """ PSR J1234+5678 ELAT 0 ELONG 0 F0 1 DM 10 PEPOCH 57...
nanogravREPO_NAMEPINTPATH_START.@PINT_extracted@PINT-master@tests@test_variety_parfiles.py@.PATH_END.py
{ "filename": "peft_no_lora_accelerate.py", "repo_name": "huggingface/peft", "repo_path": "peft_extracted/peft-main/examples/sequence_classification/peft_no_lora_accelerate.py", "type": "Python" }
import argparse import evaluate import torch from accelerate import Accelerator, DistributedDataParallelKwargs from datasets import load_dataset from torch.optim import AdamW from torch.utils.data import DataLoader from tqdm import tqdm from transformers import AutoModelForSequenceClassification, AutoTokenizer, get_li...
huggingfaceREPO_NAMEpeftPATH_START.@peft_extracted@peft-main@examples@sequence_classification@peft_no_lora_accelerate.py@.PATH_END.py
{ "filename": "rmsprop.py", "repo_name": "keras-team/keras", "repo_path": "keras_extracted/keras-master/keras/src/optimizers/rmsprop.py", "type": "Python" }
from keras.src import ops from keras.src.api_export import keras_export from keras.src.optimizers import optimizer @keras_export(["keras.optimizers.RMSprop"]) class RMSprop(optimizer.Optimizer): """Optimizer that implements the RMSprop algorithm. The gist of RMSprop is to: - Maintain a moving (discounte...
keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@optimizers@rmsprop.py@.PATH_END.py
{ "filename": "emcee2_gprot_fit.py", "repo_name": "RuthAngus/gprotation", "repo_path": "gprotation_extracted/gprotation-master/gprotation/emcee2_gprot_fit.py", "type": "Python" }
from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import pandas as pd import h5py import os import math from emcee2_GProt import calc_p_init, mcmc_fit def make_lists(xb, yb, yerrb, l): nlists = int(math.ceil((xb[-1] - xb[0]) / l)) xlist, ylist, yerrlist= [], [], [] ...
RuthAngusREPO_NAMEgprotationPATH_START.@gprotation_extracted@gprotation-master@gprotation@emcee2_gprot_fit.py@.PATH_END.py
{ "filename": "io.py", "repo_name": "yt-project/yt", "repo_path": "yt_extracted/yt-main/yt/frontends/cf_radial/io.py", "type": "Python" }
""" CF-Radial-specific IO functions """ import numpy as np from yt.utilities.io_handler import BaseIOHandler class CFRadialIOHandler(BaseIOHandler): _particle_reader = False _dataset_type = "cf_radial" def _read_fluid_selection(self, chunks, selector, fields, size): # This needs to allocate ...
yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@frontends@cf_radial@io.py@.PATH_END.py
{ "filename": "_spfuncs.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/sparse/_spfuncs.py", "type": "Python" }
""" Functions that operate on sparse matrices """ __all__ = ['count_blocks','estimate_blocksize'] from ._base import issparse from ._csr import csr_array from ._sparsetools import csr_count_blocks def estimate_blocksize(A,efficiency=0.7): """Attempt to determine the blocksize of a sparse matrix Returns a b...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@sparse@_spfuncs.py@.PATH_END.py
{ "filename": "base_app_configurator.py", "repo_name": "SKA-INAF/caesar-rest", "repo_path": "caesar-rest_extracted/caesar-rest-master/caesar_rest/base_app_configurator.py", "type": "Python" }
############################## # MODULE IMPORTS ############################## # Import standard modules import os import sys import json import time import datetime import logging import numpy as np import subprocess import json import ast import yaml # Import flask modules from flask import current_app, g # Impor...
SKA-INAFREPO_NAMEcaesar-restPATH_START.@caesar-rest_extracted@caesar-rest-master@caesar_rest@base_app_configurator.py@.PATH_END.py
{ "filename": "_linepositionsrc.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/sunburst/hoverlabel/font/_linepositionsrc.py", "type": "Python" }
import _plotly_utils.basevalidators class LinepositionsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="linepositionsrc", parent_name="sunburst.hoverlabel.font", **kwargs, ): super(LinepositionsrcValidator, self).__init__( ...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@sunburst@hoverlabel@font@_linepositionsrc.py@.PATH_END.py
{ "filename": "evolstate.ipynb", "repo_name": "danxhuber/evolstate", "repo_path": "evolstate_extracted/evolstate-master/evolstate.ipynb", "type": "Jupyter Notebook" }
```python %matplotlib inline %reload_ext autoreload %autoreload 2 from evolstate import * # read in a bunch of stellar parameters epic=ascii.read('k2c4_stparas.txt') # get evolutionary states given Teff & R cl= evolstate(epic['Teff'],epic['Rad'],-99.+np.zeros(len(epic['Teff']))) plt.ion() plt.clf() plt.semilogy(ep...
danxhuberREPO_NAMEevolstatePATH_START.@evolstate_extracted@evolstate-master@evolstate.ipynb@.PATH_END.py
{ "filename": "setup.py", "repo_name": "mikecokina/elisa", "repo_path": "elisa_extracted/elisa-master/setup.py", "type": "Python" }
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject Pre-release steps ----------------- 1. make sure all newly added data files are listed in `setup.py` in variable `package_data`as well as in `MANIFEST.in` file 2. make sure ve...
mikecokinaREPO_NAMEelisaPATH_START.@elisa_extracted@elisa-master@setup.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "D-arioSpace/astroquery", "repo_path": "astroquery_extracted/astroquery-main/astroquery/cds/__init__.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ CDS MOCServer Query Tool ------------------------ :Author: Matthieu Baumann (matthieu.baumann@astro.unistra.fr) This package is for querying the CDS MOC service, primarily hosted at: * https://alasky.unistra.fr/MocServer/query * https://alaskybis.un...
D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@cds@__init__.py@.PATH_END.py
{ "filename": "axis_labels_demo.py", "repo_name": "matplotlib/matplotlib", "repo_path": "matplotlib_extracted/matplotlib-main/galleries/examples/subplots_axes_and_figures/axis_labels_demo.py", "type": "Python" }
""" =================== Axis label position =================== Choose axis label position when calling `~.Axes.set_xlabel` and `~.Axes.set_ylabel` as well as for colorbar. """ import matplotlib.pyplot as plt fig, ax = plt.subplots() sc = ax.scatter([1, 2], [1, 2], c=[1, 2]) ax.set_ylabel('YLabel', loc='top') ax.se...
matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@galleries@examples@subplots_axes_and_figures@axis_labels_demo.py@.PATH_END.py
{ "filename": "phantom.py", "repo_name": "dmentipl/plonk", "repo_path": "plonk_extracted/plonk-main/src/plonk/snap/readers/phantom.py", "type": "Python" }
"""Phantom HDF5 snapshot file.""" from __future__ import annotations from pathlib import Path from typing import TYPE_CHECKING, Any, Callable, Dict, List, Tuple, Union import h5py import numpy as np from ..._logging import logger from ..._units import Quantity from ..._units import units as plonk_units if TYPE_CHE...
dmentiplREPO_NAMEplonkPATH_START.@plonk_extracted@plonk-main@src@plonk@snap@readers@phantom.py@.PATH_END.py
{ "filename": "test_multitaper.py", "repo_name": "aaryapatil/tapify", "repo_path": "tapify_extracted/tapify-main/tests/test_multitaper.py", "type": "Python" }
import pytest import numpy as np from numpy.testing import assert_allclose from tapify import MultiTaper @pytest.fixture def data(N=2048, frequency=10, theta=[8, 2, 5], rseed=0): """ Generate some sinusoidal data with white noise for testing. """ rng = np.random.RandomState(rseed) t = -0.5 + rng....
aaryapatilREPO_NAMEtapifyPATH_START.@tapify_extracted@tapify-main@tests@test_multitaper.py@.PATH_END.py
{ "filename": "GiRaFFE_NRPy_BCs.py", "repo_name": "zachetienne/nrpytutorial", "repo_path": "nrpytutorial_extracted/nrpytutorial-master/in_progress-GiRaFFE_NRPy/GiRaFFE_NRPy/GiRaFFE_NRPy_BCs.py", "type": "Python" }
# Step 0: Add NRPy's directory to the path # https://stackoverflow.com/questions/16780014/import-file-from-parent-directory import os, sys # Standard Python modules for multiplatform OS-level functions import cmdline_helper as cmd # NRPy+: Multi-platform Python command-line interface nrpy_dir_path = os.pa...
zachetienneREPO_NAMEnrpytutorialPATH_START.@nrpytutorial_extracted@nrpytutorial-master@in_progress-GiRaFFE_NRPy@GiRaFFE_NRPy@GiRaFFE_NRPy_BCs.py@.PATH_END.py
{ "filename": "test_pcf.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/special/tests/test_pcf.py", "type": "Python" }
"""Tests for parabolic cylinder functions. """ import numpy as np from numpy.testing import assert_allclose, assert_equal import scipy.special as sc def test_pbwa_segfault(): # Regression test for https://github.com/scipy/scipy/issues/6208. # # Data generated by mpmath. # w = 1.022765672113168671...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@special@tests@test_pcf.py@.PATH_END.py
{ "filename": "get_TOAs.py", "repo_name": "scottransom/presto", "repo_path": "presto_extracted/presto-master/bin/get_TOAs.py", "type": "Python" }
#!/usr/bin/env python from builtins import range import getopt, sys from presto import fftfit from presto import psr_utils import numpy as Num from presto.prepfold import pfd from presto.polycos import polycos from presto.psr_constants import * scopes = {'GBT':'1', 'Arecibo':'3', 'Parkes':'7', ...
scottransomREPO_NAMEprestoPATH_START.@presto_extracted@presto-master@bin@get_TOAs.py@.PATH_END.py
{ "filename": "elementsui.py", "repo_name": "peppedilillo/mescal", "repo_path": "mescal_extracted/mescal-main/source/cli/elementsui.py", "type": "Python" }
from time import sleep from rich.console import Console from rich.progress import BarColumn from rich.progress import MofNCompleteColumn from rich.progress import Progress from rich.progress import SpinnerColumn from rich.progress import TextColumn from rich.progress import TimeElapsedColumn from rich.progress import ...
peppedililloREPO_NAMEmescalPATH_START.@mescal_extracted@mescal-main@source@cli@elementsui.py@.PATH_END.py
{ "filename": "plate_solution.py", "repo_name": "rzellem/EXOTIC", "repo_path": "EXOTIC_extracted/EXOTIC-main/exotic/api/plate_solution.py", "type": "Python" }
# ########################################################################### # # Copyright (c) 2019-2020, California Institute of Technology. # All rights reserved. Based on Government Sponsored Research under # contracts NNN12AA01C, NAS7-1407 and/or NAS7-03001. # # Redistribution and use in source and bi...
rzellemREPO_NAMEEXOTICPATH_START.@EXOTIC_extracted@EXOTIC-main@exotic@api@plate_solution.py@.PATH_END.py
{ "filename": "test_dltisys.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py2/scipy/signal/tests/test_dltisys.py", "type": "Python" }
# Author: Jeffrey Armstrong <jeff@approximatrix.com> # April 4, 2011 from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import (assert_equal, assert_array_almost_equal, assert_array_equal, assert_allclose, assert...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py2@scipy@signal@tests@test_dltisys.py@.PATH_END.py
{ "filename": "igimf_epoch_68.py", "repo_name": "juzikong/photGalIMF", "repo_path": "photGalIMF_extracted/photGalIMF-main/simulation_results_from_galaxy_evol/example/igimf_epoch_68.py", "type": "Python" }
# File to define a custom IMF # The return value represents the chosen IMF value for the input mass def custom_imf(mass, time): # there is no time dependence for IGIMF if mass < 0.08: return 0 elif mass < 0.101: return -881912095498.0004 * mass + 126349388048.4443 elif mass < 0.10201: ...
juzikongREPO_NAMEphotGalIMFPATH_START.@photGalIMF_extracted@photGalIMF-main@simulation_results_from_galaxy_evol@example@igimf_epoch_68.py@.PATH_END.py
{ "filename": "conf.py", "repo_name": "Keck-DataReductionPipelines/KPF-Pipeline", "repo_path": "KPF-Pipeline_extracted/KPF-Pipeline-master/docs/source/conf.py", "type": "Python" }
# -*- coding: utf-8 -*- # # KPFPipeline documentation build configuration file, created by # sphinx-quickstart on Thu Jan 23 21:59:39 2020. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. #...
Keck-DataReductionPipelinesREPO_NAMEKPF-PipelinePATH_START.@KPF-Pipeline_extracted@KPF-Pipeline-master@docs@source@conf.py@.PATH_END.py
{ "filename": "conf.py", "repo_name": "minaskar/hankl", "repo_path": "hankl_extracted/hankl-master/docs/source/conf.py", "type": "Python" }
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
minaskarREPO_NAMEhanklPATH_START.@hankl_extracted@hankl-master@docs@source@conf.py@.PATH_END.py
{ "filename": "plotspectra.py", "repo_name": "artis-mcrt/artistools", "repo_path": "artistools_extracted/artistools-main/artistools/spectra/plotspectra.py", "type": "Python" }
#!/usr/bin/env python3 # PYTHON_ARGCOMPLETE_OK """Artistools - spectra plotting functions.""" import argparse import math import sys import typing as t from collections.abc import Collection from collections.abc import Iterable from collections.abc import Sequence from pathlib import Path import argcomplete import ma...
artis-mcrtREPO_NAMEartistoolsPATH_START.@artistools_extracted@artistools-main@artistools@spectra@plotspectra.py@.PATH_END.py
{ "filename": "XID+example_run_script-Prior_predictive_checks.ipynb", "repo_name": "H-E-L-P/XID_plus", "repo_path": "XID_plus_extracted/XID_plus-master/docs/build/doctrees/nbsphinx/notebooks/examples/SED_emulator/XID+example_run_script-Prior_predictive_checks.ipynb", "type": "Jupyter Notebook" }
# XID+ Example Run Script (This is based on a Jupyter notebook, available in the [XID+ package](https://github.com/H-E-L-P/XID_plus/tree/master/docs/notebooks/examples/) and can be interactively run and edited) XID+ is a probababilistic deblender for confusion dominated maps. It is designed to: 1. Use a MCMC based a...
H-E-L-PREPO_NAMEXID_plusPATH_START.@XID_plus_extracted@XID_plus-master@docs@build@doctrees@nbsphinx@notebooks@examples@SED_emulator@XID+example_run_script-Prior_predictive_checks.ipynb@.PATH_END.py
{ "filename": "plot_digits_pipe.py", "repo_name": "scikit-learn/scikit-learn", "repo_path": "scikit-learn_extracted/scikit-learn-main/examples/compose/plot_digits_pipe.py", "type": "Python" }
""" ========================================================= Pipelining: chaining a PCA and a logistic regression ========================================================= The PCA does an unsupervised dimensionality reduction, while the logistic regression does the prediction. We use a GridSearchCV to set the dimens...
scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@examples@compose@plot_digits_pipe.py@.PATH_END.py
{ "filename": "Lib_common.py", "repo_name": "astrom-tom/SPARTAN", "repo_path": "SPARTAN_extracted/SPARTAN-master/spartan/Lib_common.py", "type": "Python" }
''' The SPARTAN project ------------------- This module gathers deals with the library. It extract it, select templates of the right age, and put it at z @author: R. THOMAS @year: 2016-17 @place: UV/LAM/UCBJ/ESO @License: GPL licence - see LICENCE.txt ''' ##Python LIB import os import warnings import time warnings.sim...
astrom-tomREPO_NAMESPARTANPATH_START.@SPARTAN_extracted@SPARTAN-master@spartan@Lib_common.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/partners/mistralai/tests/__init__.py", "type": "Python" }
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@partners@mistralai@tests@__init__.py@.PATH_END.py
{ "filename": "_uirevision.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/ternary/aaxis/_uirevision.py", "type": "Python" }
import _plotly_utils.basevalidators class UirevisionValidator(_plotly_utils.basevalidators.AnyValidator): def __init__( self, plotly_name="uirevision", parent_name="layout.ternary.aaxis", **kwargs ): super(UirevisionValidator, self).__init__( plotly_name=plotly_name, pa...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@ternary@aaxis@_uirevision.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "alibaba/TinyNeuralNetwork", "repo_path": "TinyNeuralNetwork_extracted/TinyNeuralNetwork-main/tinynn/graph/__init__.py", "type": "Python" }
alibabaREPO_NAMETinyNeuralNetworkPATH_START.@TinyNeuralNetwork_extracted@TinyNeuralNetwork-main@tinynn@graph@__init__.py@.PATH_END.py
{ "filename": "swiss_escapement.py", "repo_name": "projectchrono/chrono", "repo_path": "chrono_extracted/chrono-main/data/solidworks/swiss_escapement.py", "type": "Python" }
# PyChrono script generated from SolidWorks using Chrono::SolidWorks add-in # Assembly: C:\Users\SB\Documents\CAD\CAD_swiss_escapement\escapement.SLDASM import pychrono as chrono import builtins shapes_dir = 'swiss_escapement_shapes/' if hasattr(builtins, 'exported_system_relpath'): shapes_dir = builtins.e...
projectchronoREPO_NAMEchronoPATH_START.@chrono_extracted@chrono-main@data@solidworks@swiss_escapement.py@.PATH_END.py
{ "filename": "selections.py", "repo_name": "nanograv/enterprise", "repo_path": "enterprise_extracted/enterprise-master/enterprise/signals/selections.py", "type": "Python" }
# selections.py """Contains various selection functions to mask parameters by backend flags, time-intervals, etc.""" import functools import inspect import numpy as np def call_me_maybe(obj): """See `here`_ for description. .. _here: https://www.youtube.com/watch?v=fWNaR-rxAic """ return obj() if ...
nanogravREPO_NAMEenterprisePATH_START.@enterprise_extracted@enterprise-master@enterprise@signals@selections.py@.PATH_END.py
{ "filename": "test_resolution_adjustment.py", "repo_name": "DaneSpaeth/pyoscillot", "repo_path": "pyoscillot_extracted/pyoscillot-main/pyoscillot/test_scripts/test_resolution_adjustment.py", "type": "Python" }
import numpy as np import matplotlib.pyplot as plt from utils import adjust_resolution, adjust_resolution_per_pixel, _gauss_continuum, neg_gaussian from dataloader import phoenix_spectrum from scipy.optimize import curve_fit from astropy.convolution import Gaussian1DKernel from scipy.signal import deconvolve import pan...
DaneSpaethREPO_NAMEpyoscillotPATH_START.@pyoscillot_extracted@pyoscillot-main@pyoscillot@test_scripts@test_resolution_adjustment.py@.PATH_END.py
{ "filename": "_build_utils.py", "repo_name": "athob/py-ananke", "repo_path": "py-ananke_extracted/py-ananke-main/src/_build_utils.py", "type": "Python" }
#!/usr/bin/env python """ Contains the ananke module building utility tools. Credit to https://github.com/GalacticDynamics-Oxford/Agama/blob/master/setup.py. """ import importlib.util import sys import pathlib import subprocess # from packaging import version from ._constants import * from .__metadata__ import * from ...
athobREPO_NAMEpy-anankePATH_START.@py-ananke_extracted@py-ananke-main@src@_build_utils.py@.PATH_END.py
{ "filename": "_candlestick.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/_candlestick.py", "type": "Python" }
import _plotly_utils.basevalidators class CandlestickValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="candlestick", parent_name="", **kwargs): super(CandlestickValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@_candlestick.py@.PATH_END.py
{ "filename": "cpPtcSolve.py", "repo_name": "lsst/cp_pipe", "repo_path": "cp_pipe_extracted/cp_pipe-main/python/lsst/cp/pipe/ptc/cpPtcSolve.py", "type": "Python" }
# This file is part of cp_pipe. # # Developed for the LSST Data Management System. # This product includes software developed by the LSST Project # (https://www.lsst.org). # See the COPYRIGHT file at the top-level directory of this distribution # for details of code ownership. # # This program is free software: you can...
lsstREPO_NAMEcp_pipePATH_START.@cp_pipe_extracted@cp_pipe-main@python@lsst@cp@pipe@ptc@cpPtcSolve.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "statsmodels/statsmodels", "repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/tools/__init__.py", "type": "Python" }
from .tools import add_constant, categorical from statsmodels.tools._test_runner import PytestTester __all__ = ['test', 'add_constant', 'categorical'] test = PytestTester()
statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@tools@__init__.py@.PATH_END.py
{ "filename": "_side.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/isosurface/colorbar/title/_side.py", "type": "Python" }
import _plotly_utils.basevalidators class SideValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="side", parent_name="isosurface.colorbar.title", **kwargs ): super(SideValidator, self).__init__( plotly_name=plotly_name, parent_n...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@isosurface@colorbar@title@_side.py@.PATH_END.py
{ "filename": "graph_store.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/graphs/graph_store.py", "type": "Python" }
from typing import TYPE_CHECKING, Any from langchain._api import create_importer if TYPE_CHECKING: from langchain_community.graphs.graph_store import GraphStore # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optional imports. ...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@graphs@graph_store.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "lenstronomy/lenstronomy", "repo_path": "lenstronomy_extracted/lenstronomy-main/lenstronomy/Sampling/Samplers/__init__.py", "type": "Python" }
lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@lenstronomy@Sampling@Samplers@__init__.py@.PATH_END.py
{ "filename": "RimeSolver.py", "repo_name": "ratt-ru/montblanc", "repo_path": "montblanc_extracted/montblanc-master/montblanc/impl/rime/tensorflow/RimeSolver.py", "type": "Python" }
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2015 Simon Perkins # # This file is part of montblanc. # # 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 L...
ratt-ruREPO_NAMEmontblancPATH_START.@montblanc_extracted@montblanc-master@montblanc@impl@rime@tensorflow@RimeSolver.py@.PATH_END.py
{ "filename": "_family.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/choropleth/hoverlabel/font/_family.py", "type": "Python" }
import _plotly_utils.basevalidators class FamilyValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="family", parent_name="choropleth.hoverlabel.font", **kwargs ): super(FamilyValidator, self).__init__( plotly_name=plotly_name, paren...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@choropleth@hoverlabel@font@_family.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "alessiospuriomancini/cosmopower", "repo_path": "cosmopower_extracted/cosmopower-main/cosmopower/__init__.py", "type": "Python" }
from .cosmopower_PCA import cosmopower_PCA from .cosmopower_PCAplusNN import cosmopower_PCAplusNN from .cosmopower_NN import cosmopower_NN from .likelihoods import * __version__ = "0.1.3" __author__ = 'Alessio Spurio Mancini'
alessiospuriomanciniREPO_NAMEcosmopowerPATH_START.@cosmopower_extracted@cosmopower-main@cosmopower@__init__.py@.PATH_END.py
{ "filename": "hbox.py", "repo_name": "mzechmeister/viper", "repo_path": "viper_extracted/viper-master/utils/hbox.py", "type": "Python" }
#! /usr/bin/env python3 # Licensed under a GPLv3 style license - see LICENSE import tkinter as tk #infotext class Help_Box(object): def __init__(self, widget, text, show=1): self.widget = widget self.text = text def show_help(event): self.iwindow = tw = tk.Toplevel(self.widget...
mzechmeisterREPO_NAMEviperPATH_START.@viper_extracted@viper-master@utils@hbox.py@.PATH_END.py
{ "filename": "test_import.py", "repo_name": "Martindelosrios/CADDENA", "repo_path": "CADDENA_extracted/CADDENA-master/tests/test_import.py", "type": "Python" }
import h5py import swyft import torch from importlib_resources import files import numpy as np from CADDENA.caddena import Model def importtestset(): ref = files("CADDENA") / "dataset/" data_path = str(ref) with h5py.File(data_path + "/testset.h5", "r") as data: pars_testset = data["pars_testset"...
MartindelosriosREPO_NAMECADDENAPATH_START.@CADDENA_extracted@CADDENA-master@tests@test_import.py@.PATH_END.py
{ "filename": "test_jplhorizons.py", "repo_name": "astropy/astroquery", "repo_path": "astroquery_extracted/astroquery-main/astroquery/jplhorizons/tests/test_jplhorizons.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import os from collections import OrderedDict from numpy.ma import is_masked from astropy.tests.helper import assert_quantity_allclose from astropy.utils.exceptions import AstropyDeprecationWarning from astropy import units as u from astro...
astropyREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@jplhorizons@tests@test_jplhorizons.py@.PATH_END.py
{ "filename": "_hovertextsrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/contourcarpet/_hovertextsrc.py", "type": "Python" }
import _plotly_utils.basevalidators class HovertextsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="hovertextsrc", parent_name="contourcarpet", **kwargs ): super(HovertextsrcValidator, self).__init__( plotly_name=plotly_name, par...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@contourcarpet@_hovertextsrc.py@.PATH_END.py