metadata
dict
text
stringlengths
0
40.6M
id
stringlengths
14
255
{ "filename": "test_series.py", "repo_name": "spacetelescope/astronify", "repo_path": "astronify_extracted/astronify-main/astronify/series/tests/test_series.py", "type": "Python" }
import pytest import numpy as np from astropy.table import Table from pyo import Server from .. import SoniSeries, PitchMap from ...utils.exceptions import InputWarning def test_pitchmap(): """ Testing the PitchMap class. """ # Defaults my_pitchmapper = PitchMap() assert isinstance(my_...
spacetelescopeREPO_NAMEastronifyPATH_START.@astronify_extracted@astronify-main@astronify@series@tests@test_series.py@.PATH_END.py
{ "filename": "fastcc_test.py", "repo_name": "mpeel/fastcc", "repo_path": "fastcc_extracted/fastcc-master/fastcc_test.py", "type": "Python" }
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Test code for fastcc # # Version history: # Mike Peel 01-Feb-2013 v1.0 Initial version # Mike Peel 04-Feb-2013 v1.1 Update format # Locke Spencer 05-Feb-2013: v1.2 changed planckcc to LFI_fastcc within this code to follow changes to LFI_fastcc # ...
mpeelREPO_NAMEfastccPATH_START.@fastcc_extracted@fastcc-master@fastcc_test.py@.PATH_END.py
{ "filename": "_textcasesrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/waterfall/textfont/_textcasesrc.py", "type": "Python" }
import _plotly_utils.basevalidators class TextcasesrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="textcasesrc", parent_name="waterfall.textfont", **kwargs ): super(TextcasesrcValidator, self).__init__( plotly_name=plotly_name, p...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@waterfall@textfont@_textcasesrc.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "yt-project/yt", "repo_path": "yt_extracted/yt-main/yt/__init__.py", "type": "Python" }
""" yt is a toolkit for analyzing and visualizing volumetric data. * Website: https://yt-project.org * Documentation: https://yt-project.org/doc * Data hub: https://girder.hub.yt * Contribute: https://github.com/yt-project/yt """ from ._version import __version__, version_info # isort: skip import yt.units as units...
yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@__init__.py@.PATH_END.py
{ "filename": "_weight.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattergeo/marker/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="scattergeo.marker.colorbar.title.font", **kwargs, ): super(WeightValidator, self).__init__( plotl...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattergeo@marker@colorbar@title@font@_weight.py@.PATH_END.py
{ "filename": "DummyResponse.py", "repo_name": "D-arioSpace/astroquery", "repo_path": "astroquery_extracted/astroquery-main/astroquery/utils/tap/conn/tests/DummyResponse.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ ============= TAP plus ============= @author: Juan Carlos Segovia @contact: juan.carlos.segovia@sciops.esa.int European Space Astronomy Centre (ESAC) European Space Agency (ESA) Created on 30 jun. 2016 """ class DummyResponse: ''' classd...
D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@utils@tap@conn@tests@DummyResponse.py@.PATH_END.py
{ "filename": "gpt_router.ipynb", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/chat/gpt_router.ipynb", "type": "Jupyter Notebook" }
--- sidebar_label: GPTRouter --- # GPTRouter [GPTRouter](https://github.com/Writesonic/GPTRouter) is an open source LLM API Gateway that offers a universal API for 30+ LLMs, vision, and image models, with smart fallbacks based on uptime and latency, automatic retries, and streaming. This notebook covers how to get ...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@chat@gpt_router.ipynb@.PATH_END.py
{ "filename": "rabacus_confirm.py", "repo_name": "galtay/rabacus", "repo_path": "rabacus_extracted/rabacus-master/cloudy/cooling/rabacus_confirm.py", "type": "Python" }
import rabacus as ra import pylab as plt import numpy as np z = 3.0 Nnu = 100 q_min = 1.0e-2 q_max = 1.0e6 uvb = ra.BackgroundSource( q_min, q_max, 'hm12', z=z, Nnu=Nnu ) NT=100 T = np.logspace( 4.0, 5.0, NT ) * ra.u.K nH = np.ones( NT ) * 1.0e-2 / ra.u.cm**3 nHe = nH * 10**(-1.0701) H1i = np.ones(T.size) * uvb.th...
galtayREPO_NAMErabacusPATH_START.@rabacus_extracted@rabacus-master@cloudy@cooling@rabacus_confirm.py@.PATH_END.py
{ "filename": "random.py", "repo_name": "scikit-learn/scikit-learn", "repo_path": "scikit-learn_extracted/scikit-learn-main/sklearn/utils/random.py", "type": "Python" }
"""Utilities for random sampling.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import array import numpy as np import scipy.sparse as sp from . import check_random_state from ._random import sample_without_replacement __all__ = ["sample_without_replacement"] def _random_choic...
scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@sklearn@utils@random.py@.PATH_END.py
{ "filename": "_colorsrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/pie/insidetextfont/_colorsrc.py", "type": "Python" }
import _plotly_utils.basevalidators class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="colorsrc", parent_name="pie.insidetextfont", **kwargs ): super(ColorsrcValidator, self).__init__( plotly_name=plotly_name, parent_nam...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@pie@insidetextfont@_colorsrc.py@.PATH_END.py
{ "filename": "download_data.py", "repo_name": "chenwuperth/rgz_rcnn", "repo_path": "rgz_rcnn_extracted/rgz_rcnn-master/tools/download_data.py", "type": "Python" }
# ICRAR - International Centre for Radio Astronomy Research # (c) UWA - The University of Western Australia, 2017 # Copyright by UWA (in the framework of the ICRAR) # All rights reserved # # This library is free software; you can redistribute it and/or # modify it under the MIT license # # Created ...
chenwuperthREPO_NAMErgz_rcnnPATH_START.@rgz_rcnn_extracted@rgz_rcnn-master@tools@download_data.py@.PATH_END.py
{ "filename": "c9a1ff35c6ed_make_librarian_file_obsids_optional.py", "repo_name": "HERA-Team/hera_mc", "repo_path": "hera_mc_extracted/hera_mc-main/alembic/versions/c9a1ff35c6ed_make_librarian_file_obsids_optional.py", "type": "Python" }
"""Make Librarian file obsids optional. Revision ID: c9a1ff35c6ed Revises: f29adafca107 Create Date: 2017-12-15 18:50:37.889271+00:00 """ import sqlalchemy as sa from alembic import op revision = "c9a1ff35c6ed" down_revision = "f29adafca107" branch_labels = None depends_on = None def upgrade(): op.alter_colum...
HERA-TeamREPO_NAMEhera_mcPATH_START.@hera_mc_extracted@hera_mc-main@alembic@versions@c9a1ff35c6ed_make_librarian_file_obsids_optional.py@.PATH_END.py
{ "filename": "NCStressConsumer.py", "repo_name": "ACS-Community/ACS", "repo_path": "ACS_extracted/ACS-master/Benchmark/components/src/NCStressConsumer.py", "type": "Python" }
#!/usr/bin/env python import getopt import sys import os import popen2 from time import sleep from perftestImpl.NotificationServiceStressConsumer import NCStressConsumer from perftestImpl.NotificationServiceStressConsumer import debugprint def printUsageAndExit(): print "" print "Usage: " + sys.argv[0] + " [O...
ACS-CommunityREPO_NAMEACSPATH_START.@ACS_extracted@ACS-master@Benchmark@components@src@NCStressConsumer.py@.PATH_END.py
{ "filename": "test_coherencegram.py", "repo_name": "gwpy/gwpy", "repo_path": "gwpy_extracted/gwpy-main/gwpy/cli/tests/test_coherencegram.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@cli@tests@test_coherencegram.py@.PATH_END.py
{ "filename": "core.py", "repo_name": "astropy/photutils", "repo_path": "photutils_extracted/photutils-main/photutils/background/core.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module defines classes to estimate the background and background RMS in an array of any dimension. """ import abc import warnings import numpy as np from astropy.stats import SigmaClip, mad_std from photutils.extern.biweight import biweight_loc...
astropyREPO_NAMEphotutilsPATH_START.@photutils_extracted@photutils-main@photutils@background@core.py@.PATH_END.py
{ "filename": "data_inspect_2458069.ipynb", "repo_name": "HERA-Team/H1C_IDR3_Notebooks", "repo_path": "H1C_IDR3_Notebooks-main/data_inspect/data_inspect_2458069.ipynb", "type": "Jupyter Notebook" }
```python import matplotlib import matplotlib.pyplot as plt from matplotlib.ticker import FormatStrFormatter import matplotlib.patches as mpatches import matplotlib.gridspec as gridspec import numpy as np from pyuvdata import UVCal, UVData import os import sys import glob import uvtools as uvt from astropy.time import ...
HERA-TeamREPO_NAMEH1C_IDR3_NotebooksPATH_START.@H1C_IDR3_Notebooks-main@data_inspect@data_inspect_2458069.ipynb@.PATH_END.py
{ "filename": "configdict_test.py", "repo_name": "yuliang419/AstroNet-Triage", "repo_path": "AstroNet-Triage_extracted/AstroNet-Triage-master/astronet/util/configdict_test.py", "type": "Python" }
# Copyright 2018 The TensorFlow Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
yuliang419REPO_NAMEAstroNet-TriagePATH_START.@AstroNet-Triage_extracted@AstroNet-Triage-master@astronet@util@configdict_test.py@.PATH_END.py
{ "filename": "qc_science.py", "repo_name": "LCOGT/banzai-nres", "repo_path": "banzai-nres_extracted/banzai-nres-main/banzai_nres/qc/qc_science.py", "type": "Python" }
import numpy as np from banzai.stages import Stage from banzai.logs import get_logger logger = get_logger() # This defines the order for which we calculate the SNR value for the header. # By default this is the order containing the Mg b lines. SNR_ORDER = 90 class CalculateScienceFrameMetrics(Stage): def __ini...
LCOGTREPO_NAMEbanzai-nresPATH_START.@banzai-nres_extracted@banzai-nres-main@banzai_nres@qc@qc_science.py@.PATH_END.py
{ "filename": "_shadow.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/parcats/labelfont/_shadow.py", "type": "Python" }
import _plotly_utils.basevalidators class ShadowValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="shadow", parent_name="parcats.labelfont", **kwargs): super(ShadowValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@parcats@labelfont@_shadow.py@.PATH_END.py
{ "filename": "ultra_nested.py", "repo_name": "florpi/sunbird", "repo_path": "sunbird_extracted/sunbird-main/sunbird/inference/ultra_nested.py", "type": "Python" }
from sunbird.inference import Inference import numpy as np from ultranest import ReactiveNestedSampler import ultranest.stepsampler class UltraNested(Inference): """ def get_prior_from_cube(self, cube): transformed_cube = np.zeros_like(cube) for n, param in enumerate(self.param_names): ...
florpiREPO_NAMEsunbirdPATH_START.@sunbird_extracted@sunbird-main@sunbird@inference@ultra_nested.py@.PATH_END.py
{ "filename": "test_match_utils.py", "repo_name": "pyDANDIA/pyDANDIA", "repo_path": "pyDANDIA_extracted/pyDANDIA-main/pyDANDIA/tests/test_match_utils.py", "type": "Python" }
import os import sys cwd = os.getcwd() sys.path.append(os.path.join(cwd,'../')) import match_utils import numpy as np import logs import copy def test_add_match(): log = logs.start_stage_log( cwd, 'test_match_utils' ) nstars = 10 matched_stars = match_utils.StarMatchIndex() for j in range(1,nstars+1,...
pyDANDIAREPO_NAMEpyDANDIAPATH_START.@pyDANDIA_extracted@pyDANDIA-main@pyDANDIA@tests@test_match_utils.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "NuSpaceSim/nuSpaceSim", "repo_path": "nuSpaceSim_extracted/nuSpaceSim-main/src/nuspacesim/data/RenoNu2TauTables/__init__.py", "type": "Python" }
NuSpaceSimREPO_NAMEnuSpaceSimPATH_START.@nuSpaceSim_extracted@nuSpaceSim-main@src@nuspacesim@data@RenoNu2TauTables@__init__.py@.PATH_END.py
{ "filename": "path.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/ipython-genutils/py3/ipython_genutils/path.py", "type": "Python" }
# encoding: utf-8 """ Utilities for path handling. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import os import sys import errno import shutil import random from . import py3compat fs_encoding = sys.getfilesystemencoding() def filefind(filename, path_d...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipython-genutils@py3@ipython_genutils@path.py@.PATH_END.py
{ "filename": "setup.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/optimize/cython_optimize/setup.py", "type": "Python" }
def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('cython_optimize', parent_package, top_path) config.add_data_files('*.pxd') config.add_extension('_zeros', sources='_zeros.c') return config if __name__ == '__main__': ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@optimize@cython_optimize@setup.py@.PATH_END.py
{ "filename": "test_io.py", "repo_name": "ixkael/Delight", "repo_path": "Delight_extracted/Delight-master/tests/test_io.py", "type": "Python" }
# -*- coding: utf-8 -*- from delight.io import * paramFile = "tests/parametersTest.cfg" def test_Parser(): params = parseParamFile(paramFile, verbose=False) def test_createGrids(): params = parseParamFile(paramFile, verbose=False) out = createGrids(params) def test_readBandCoefficients(): params...
ixkaelREPO_NAMEDelightPATH_START.@Delight_extracted@Delight-master@tests@test_io.py@.PATH_END.py
{ "filename": "womrdfits.py", "repo_name": "msiebert1/UCSC_spectral_pipeline", "repo_path": "UCSC_spectral_pipeline_extracted/UCSC_spectral_pipeline-master/spectral_reduction/tmath/wombat/womrdfits.py", "type": "Python" }
def womrdfits(hop): from astropy.io import fits import numpy as np done=False while (not done): inputfile=input('Name of fits file to be read? (.fits added if necessary) ') inputfile=inputfile.strip() if (inputfile == ''): return hop if ('.fits' not in inputfi...
msiebert1REPO_NAMEUCSC_spectral_pipelinePATH_START.@UCSC_spectral_pipeline_extracted@UCSC_spectral_pipeline-master@spectral_reduction@tmath@wombat@womrdfits.py@.PATH_END.py
{ "filename": "ma_uniform_nb.py", "repo_name": "hpparvi/PyTransit", "repo_path": "PyTransit_extracted/PyTransit-master/pytransit/models/numba/ma_uniform_nb.py", "type": "Python" }
# PyTransit: fast and easy exoplanet transit modelling in Python. # Copyright (C) 2010-2019 Hannu Parviainen # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Licen...
hpparviREPO_NAMEPyTransitPATH_START.@PyTransit_extracted@PyTransit-master@pytransit@models@numba@ma_uniform_nb.py@.PATH_END.py
{ "filename": "README.md", "repo_name": "mcataneo/mochi_class_public", "repo_path": "mochi_class_public_extracted/mochi_class_public-main/external/external_Pk/README.md", "type": "Markdown" }
The `external_Pk` mode ====================== * Author: Jesus Torrado (torradocacho [@] lorentz.leidenuniv.nl) * Date: 2013-12-20 Introduction ------------ This mode allows for an arbitrary primordial spectrum `P(k)` to be calculated by an external command and passed to CLASS. That external command may be anythin...
mcataneoREPO_NAMEmochi_class_publicPATH_START.@mochi_class_public_extracted@mochi_class_public-main@external@external_Pk@README.md@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/tools/cogniswitch/__init__.py", "type": "Python" }
"Cogniswitch Tools"
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@tools@cogniswitch@__init__.py@.PATH_END.py
{ "filename": "conf.py", "repo_name": "sibirrer/psfr", "repo_path": "psfr_extracted/psfr-main/docs/conf.py", "type": "Python" }
#!/usr/bin/env python # # psfr documentation build configuration file, created by # sphinx-quickstart on Fri Jun 9 13:47:02 2017. # # 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. # # All co...
sibirrerREPO_NAMEpsfrPATH_START.@psfr_extracted@psfr-main@docs@conf.py@.PATH_END.py
{ "filename": "sensitivity.py", "repo_name": "DebduttaPaul/luminosity_function_of_sGRBs", "repo_path": "luminosity_function_of_sGRBs_extracted/luminosity_function_of_sGRBs-master/sensitivity.py", "type": "Python" }
from __future__ import division from astropy.io import ascii from astropy.table import Table from scipy.stats import pearsonr as R from scipy.stats import spearmanr as S from scipy.stats import kendalltau as T from scipy.optimize import curve_fit from scipy.integrate import quad import debduttaS_functions as mf import ...
DebduttaPaulREPO_NAMEluminosity_function_of_sGRBsPATH_START.@luminosity_function_of_sGRBs_extracted@luminosity_function_of_sGRBs-master@sensitivity.py@.PATH_END.py
{ "filename": "forced_config.py", "repo_name": "Autostronomy/AutoProf", "repo_path": "AutoProf_extracted/AutoProf-main/tests/forced_config.py", "type": "Python" }
ap_process_mode = "forced image" ap_image_file = "ESO479-G1_r.fits" ap_name = "testforcedimage" ap_pixscale = 0.262 ap_doplot = True ap_isoclip = True ap_forcing_profile = "testimage.prof"
AutostronomyREPO_NAMEAutoProfPATH_START.@AutoProf_extracted@AutoProf-main@tests@forced_config.py@.PATH_END.py
{ "filename": "voc_annotate_and_Roboflow_export.py", "repo_name": "ESA-Datalabs/XAMI-model", "repo_path": "XAMI-model_extracted/XAMI-model-main/xami_model/dataset/voc_annotate_and_Roboflow_export.py", "type": "Python" }
import xml.etree.ElementTree as ET import numpy as np from skimage import measure from xml.dom import minidom def binary_image_to_polygon(binary_image): array = binary_image.astype(int).reshape(binary_image.shape[0], binary_image.shape[1]) # Find contours contours = measure.find_contours(array, 0.8) po...
ESA-DatalabsREPO_NAMEXAMI-modelPATH_START.@XAMI-model_extracted@XAMI-model-main@xami_model@dataset@voc_annotate_and_Roboflow_export.py@.PATH_END.py
{ "filename": "mignone_radial_1d.py", "repo_name": "PrincetonUniversity/athena", "repo_path": "athena_extracted/athena-master/tst/regression/scripts/tests/scalars/mignone_radial_1d.py", "type": "Python" }
# Regression test based on Mignone (2014) section 5.1.1 tests: radial advection of passive # scalar profiles in cylindrical and spherical-polar curvilinear coordinate systems. Tests # the importance of curvilinear corrections to PLM and PPM4 limiters and PPM4 stencil # weights for interpolation of face-averages from ce...
PrincetonUniversityREPO_NAMEathenaPATH_START.@athena_extracted@athena-master@tst@regression@scripts@tests@scalars@mignone_radial_1d.py@.PATH_END.py
{ "filename": "conftest.py", "repo_name": "scikit-learn/scikit-learn", "repo_path": "scikit-learn_extracted/scikit-learn-main/sklearn/externals/conftest.py", "type": "Python" }
# Do not collect any tests in externals. This is more robust than using # --ignore because --ignore needs a path and it is not convenient to pass in # the externals path (very long install-dependent path in site-packages) when # using --pyargs def pytest_ignore_collect(collection_path, config): return True
scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@sklearn@externals@conftest.py@.PATH_END.py
{ "filename": "test_stats.py", "repo_name": "rapidsai/cuml", "repo_path": "cuml_extracted/cuml-main/python/cuml/cuml/tests/test_stats.py", "type": "Python" }
# Copyright (c) 2020-2023, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
rapidsaiREPO_NAMEcumlPATH_START.@cuml_extracted@cuml-main@python@cuml@cuml@tests@test_stats.py@.PATH_END.py
{ "filename": "_automargin.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/pie/_automargin.py", "type": "Python" }
import _plotly_utils.basevalidators class AutomarginValidator(_plotly_utils.basevalidators.BooleanValidator): def __init__(self, plotly_name="automargin", parent_name="pie", **kwargs): super(AutomarginValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@pie@_automargin.py@.PATH_END.py
{ "filename": "NormalShockRelations.py", "repo_name": "LLNL/spheral", "repo_path": "spheral_extracted/spheral-main/tests/functional/Hydro/ShockWaterColumn/NormalShockRelations.py", "type": "Python" }
class NormalShockRelations: def __init__(self, M = 1.0, # Mach number gamma = 1.4): # ratio of specic heats self.M = M self.g = gamma def totalPressure(self): # total pressure in front of shock return (1+(self.g-1.0)/2.0*self.M**2) ** (self.g/(self...
LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@tests@functional@Hydro@ShockWaterColumn@NormalShockRelations.py@.PATH_END.py
{ "filename": "_textposition.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatter/_textposition.py", "type": "Python" }
import _plotly_utils.basevalidators class TextpositionValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="textposition", parent_name="scatter", **kwargs): super(TextpositionValidator, self).__init__( plotly_name=plotly_name, parent_name=pare...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatter@_textposition.py@.PATH_END.py
{ "filename": "sampling.py", "repo_name": "ja-vazquez/SimpleMC", "repo_path": "SimpleMC_extracted/SimpleMC-master/simplemc/analyzers/dynesty/sampling.py", "type": "Python" }
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Functions for proposing new live points used by :class:`~dynesty.sampler.Sampler` (and its children from :mod:`~dynesty.nestedsamplers`) and :class:`~dynesty.dynamicsampler.DynamicSampler`. """ from __future__ import (print_function, division) from six.moves import r...
ja-vazquezREPO_NAMESimpleMCPATH_START.@SimpleMC_extracted@SimpleMC-master@simplemc@analyzers@dynesty@sampling.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "jrenaud90/TidalPy", "repo_path": "TidalPy_extracted/TidalPy-main/TidalPy/tides/modes/mode_calc_helper/__init__.py", "type": "Python" }
from . import (eccen_calc_orderl2, eccen_calc_orderl3, eccen_calc_orderl4, eccen_calc_orderl5, eccen_calc_orderl6, eccen_calc_orderl7, inclin_calc_orderl2, inclin_calc_orderl3, inclin_calc_orderl4, inclin_calc_orderl5, inclin_calc_orderl6, inclin_calc_orderl7) eccentricity_functions_looku...
jrenaud90REPO_NAMETidalPyPATH_START.@TidalPy_extracted@TidalPy-main@TidalPy@tides@modes@mode_calc_helper@__init__.py@.PATH_END.py
{ "filename": "demo02-orbital_motion.ipynb", "repo_name": "mikecokina/elisa", "repo_path": "elisa_extracted/elisa-master/jupyter_tutorials/demo02-orbital_motion.ipynb", "type": "Jupyter Notebook" }
```python %matplotlib notebook import numpy as np from astropy import units as u from elisa import BinarySystem from elisa import Star ``` # Demo No. 2 - Orbital motion This demo will demonstrate capability of the package to produce orbital positions of a binary system in reference frame alligned with orbital plane...
mikecokinaREPO_NAMEelisaPATH_START.@elisa_extracted@elisa-master@jupyter_tutorials@demo02-orbital_motion.ipynb@.PATH_END.py
{ "filename": "config.py", "repo_name": "spedas/pyspedas", "repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/poes/config.py", "type": "Python" }
import os CONFIG = { "local_data_dir": "poes_data/", "remote_data_dir": "https://spdf.gsfc.nasa.gov/pub/data/noaa/", "ncei_remote_data_dir": "https://www.ncei.noaa.gov/data/poes-metop-space-environment-monitor/access/l2/v01r00/cdf/", } # override local data directory with environment variables if os.envir...
spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@poes@config.py@.PATH_END.py
{ "filename": "_stream.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattergl/_stream.py", "type": "Python" }
import _plotly_utils.basevalidators class StreamValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="stream", parent_name="scattergl", **kwargs): super(StreamValidator, 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@scattergl@_stream.py@.PATH_END.py
{ "filename": "concept.md", "repo_name": "grburgess/popsynth", "repo_path": "popsynth_extracted/popsynth-master/docs/md/concept.md", "type": "Markdown" }
--- jupyter: jupytext: formats: ipynb,md text_representation: extension: .md format_name: markdown format_version: '1.3' jupytext_version: 1.11.1 kernelspec: display_name: Python 3 language: python name: python3 --- # Core Concept `popsynth` core function is to create **...
grburgessREPO_NAMEpopsynthPATH_START.@popsynth_extracted@popsynth-master@docs@md@concept.md@.PATH_END.py
{ "filename": "weighted_least_squares_ex.py", "repo_name": "cjekel/piecewise_linear_fit_py", "repo_path": "piecewise_linear_fit_py_extracted/piecewise_linear_fit_py-master/examples/weighted_least_squares_ex.py", "type": "Python" }
from time import time import os os.environ['OMP_NUM_THREADS'] = '1' import numpy as np import matplotlib.pyplot as plt import pwlf t0 = time() np.random.seed(123) n = 100 n_data_sets = 100 n_segments = 6 # generate sine data x = np.linspace(0, 10, n) y = np.zeros((n_data_sets, n)) sigma_change = np.linspace(0.001, 0.05...
cjekelREPO_NAMEpiecewise_linear_fit_pyPATH_START.@piecewise_linear_fit_py_extracted@piecewise_linear_fit_py-master@examples@weighted_least_squares_ex.py@.PATH_END.py
{ "filename": "_stream.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/box/_stream.py", "type": "Python" }
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Stream(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "box" _path_str = "box.stream" _valid_props = {"maxpoints", "token"} # maxpoints # -...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@box@_stream.py@.PATH_END.py
{ "filename": "clarifai.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/llms/clarifai.py", "type": "Python" }
from typing import TYPE_CHECKING, Any from langchain._api import create_importer if TYPE_CHECKING: from langchain_community.llms import Clarifai # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optional imports. DEPRECATED_LOOKU...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@llms@clarifai.py@.PATH_END.py
{ "filename": "XRayBinaries.py", "repo_name": "TommasoRonconi/galapy", "repo_path": "galapy_extracted/galapy-main/galapy/XRayBinaries.py", "type": "Python" }
"""The XRayBinaries module implements the contribution to the X-band emission from stellar binary systems. This module provides classes for modeling X-ray emission from both High Mass Stars (HMXRB) and Low Mass Stars (LMXRB). """ #######################################################################################...
TommasoRonconiREPO_NAMEgalapyPATH_START.@galapy_extracted@galapy-main@galapy@XRayBinaries.py@.PATH_END.py
{ "filename": "test_ultranest.py", "repo_name": "21cmfast/21CMMC", "repo_path": "21CMMC_extracted/21CMMC-master/tests/test_ultranest.py", "type": "Python" }
import pytest import numpy as np from py21cmfast._utils import ParameterError import py21cmmc as mcmc from py21cmmc.cosmoHammer import Params from py21cmmc.likelihood import LikelihoodBase def test_ultranest_21cmemu(): model_name = "LuminosityLikelihood" redshifts = [6, 7, 8, 10] F_STAR10 = [-1.3, -3, 0...
21cmfastREPO_NAME21CMMCPATH_START.@21CMMC_extracted@21CMMC-master@tests@test_ultranest.py@.PATH_END.py
{ "filename": "data_utils.py", "repo_name": "gperezs/StarcNet", "repo_path": "StarcNet_extracted/StarcNet-master/src/utils/data_utils.py", "type": "Python" }
import os import sys import pickle import numpy as np from astropy.io import fits def create_target_db(tab=None, target=None, sz=22): """ Function for loading of CAT annotations, FITS file, and creation of numpy array with all star cluster candidates. Size of output 'slices' is (N x 1 x sz xsz), were ...
gperezsREPO_NAMEStarcNetPATH_START.@StarcNet_extracted@StarcNet-master@src@utils@data_utils.py@.PATH_END.py
{ "filename": "abscal_inspect_2458095.ipynb", "repo_name": "HERA-Team/H1C_IDR3_Notebooks", "repo_path": "H1C_IDR3_Notebooks-main/abscal_inspect/abscal_inspect_2458095.ipynb", "type": "Jupyter Notebook" }
# Stage 2 Absolute Calibration Nightly Notebook **Josh Dillon**, Last Revised 9/23/20 ```python import numpy as np import matplotlib.pyplot as plt import matplotlib from hera_cal import io, redcal, apply_cal, abscal, utils from hera_cal.smooth_cal import build_time_blacklist from hera_qm.metrics_io import load_metri...
HERA-TeamREPO_NAMEH1C_IDR3_NotebooksPATH_START.@H1C_IDR3_Notebooks-main@abscal_inspect@abscal_inspect_2458095.ipynb@.PATH_END.py
{ "filename": "convolve.py", "repo_name": "segasai/astrolibpy", "repo_path": "astrolibpy_extracted/astrolibpy-master/astrolib/convolve.py", "type": "Python" }
from numpy import * from numpy.fft import fft2, ifft2 def convolve(image, psf, ft_psf=None, ft_image=None, no_ft=None, correlate=None, auto_correlation=None): """ NAME: CONVOLVE PURPOSE: Convolution of an image with a Point Spread Function (PSF) EXPLANATION: The default is ...
segasaiREPO_NAMEastrolibpyPATH_START.@astrolibpy_extracted@astrolibpy-master@astrolib@convolve.py@.PATH_END.py
{ "filename": "manual_deme.md", "repo_name": "projectchrono/chrono", "repo_path": "chrono_extracted/chrono-main/doxygen/documentation/manuals/deme/manual_deme.md", "type": "Markdown" }
DEM-Engine {#manual_deme} ================================= * @subpage deme_installation * @subpage deme_usage
projectchronoREPO_NAMEchronoPATH_START.@chrono_extracted@chrono-main@doxygen@documentation@manuals@deme@manual_deme.md@.PATH_END.py
{ "filename": "class_api.py", "repo_name": "gwastro/pycbc", "repo_path": "pycbc_extracted/pycbc-master/pycbc/fft/class_api.py", "type": "Python" }
# Copyright (C) 2012 Josh Willis, Andrew Miller # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at your # option) any later version. # # This program is d...
gwastroREPO_NAMEpycbcPATH_START.@pycbc_extracted@pycbc-master@pycbc@fft@class_api.py@.PATH_END.py
{ "filename": "test_coosys.py", "repo_name": "astropy/astropy", "repo_path": "astropy_extracted/astropy-main/astropy/io/votable/tests/test_coosys.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst import io import pytest from astropy.io.votable.exceptions import E16, W27, W57 from astropy.io.votable.table import parse from astropy.utils.data import get_pkg_data_filename COOSYS_TEMPLATE = """<?xml version="1.0" encoding="UTF-8"?> <VOTABLE xmlns="h...
astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@io@votable@tests@test_coosys.py@.PATH_END.py
{ "filename": "Finetune_opt_bnb_peft.ipynb", "repo_name": "huggingface/peft", "repo_path": "peft_extracted/peft-main/examples/int8_training/Finetune_opt_bnb_peft.ipynb", "type": "Jupyter Notebook" }
## Fine-tune large models using 🤗 `peft` adapters, `transformers` & `bitsandbytes` In this tutorial we will cover how we can fine-tune large language models using the very recent `peft` library and `bitsandbytes` for loading large models in 8-bit. The fine-tuning method will rely on a recent method called "Low Rank A...
huggingfaceREPO_NAMEpeftPATH_START.@peft_extracted@peft-main@examples@int8_training@Finetune_opt_bnb_peft.ipynb@.PATH_END.py
{ "filename": "zip.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/python-libarchive/py2/libarchive/zip.py", "type": "Python" }
# Copyright (c) 2011, SmartFile <btimby@smartfile.com> # 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 l...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@python-libarchive@py2@libarchive@zip.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/yaxis/title/font/__init__.py", "type": "Python" }
import sys from typing import TYPE_CHECKING if sys.version_info < (3, 7) or TYPE_CHECKING: from ._weight import WeightValidator from ._variant import VariantValidator from ._textcase import TextcaseValidator from ._style import StyleValidator from ._size import SizeValidator from ._shadow impor...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@yaxis@title@font@__init__.py@.PATH_END.py
{ "filename": "artist.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/matplotlib/py2/matplotlib/artist.py", "type": "Python" }
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from collections import OrderedDict, namedtuple from functools import wraps import inspect import re import warnings import numpy as np import matplotlib from . import cbook, docstring, rcParams f...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@matplotlib@py2@matplotlib@artist.py@.PATH_END.py
{ "filename": "question_02_nans.md", "repo_name": "sbi-dev/sbi", "repo_path": "sbi_extracted/sbi-main/docs/docs/faq/question_02_nans.md", "type": "Markdown" }
# Can the algorithms deal with invalid data, e.g., NaN or inf? Yes. By default, whenever a simulation returns at least one `NaN` or `inf`, it is completely excluded from the training data. In other words, the simulation is simply discarded. In cases where a very large fraction of simulations return `NaN` or `inf`, di...
sbi-devREPO_NAMEsbiPATH_START.@sbi_extracted@sbi-main@docs@docs@faq@question_02_nans.md@.PATH_END.py
{ "filename": "do_bkg_llhs.py", "repo_name": "Swift-BAT/NITRATES", "repo_path": "NITRATES_extracted/NITRATES-main/nitrates/archive/do_bkg_llhs.py", "type": "Python" }
import numpy as np from astropy.io import fits import os import argparse import logging, traceback from ..analysis_seeds.bkg_rate_estimation import rate_obj_from_sqltab from ..lib.sqlite_funcs import get_conn from ..lib.dbread_funcs import get_rate_fits_tab, guess_dbfname from ..config import EBINS0, EBINS1 # need to...
Swift-BATREPO_NAMENITRATESPATH_START.@NITRATES_extracted@NITRATES-main@nitrates@archive@do_bkg_llhs.py@.PATH_END.py
{ "filename": "utils_jax.py", "repo_name": "martinjameswhite/directsht", "repo_path": "directsht_extracted/directsht-main/sht/utils_jax.py", "type": "Python" }
import numpy as np import jax from jax.sharding import PositionalSharding from functools import partial from jax.experimental import mesh_utils import sht.shared_utils as shared_utils # Choose the number of devices we'll be parallelizing across N_devices = len(jax.devices()) def find_transitions(a...
martinjameswhiteREPO_NAMEdirectshtPATH_START.@directsht_extracted@directsht-main@sht@utils_jax.py@.PATH_END.py
{ "filename": "_family.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/sunburst/legendgrouptitle/font/_family.py", "type": "Python" }
import _plotly_utils.basevalidators class FamilyValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="family", parent_name="sunburst.legendgrouptitle.font", **kwargs, ): super(FamilyValidator, self).__init__( plotly_name=p...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@sunburst@legendgrouptitle@font@_family.py@.PATH_END.py
{ "filename": "_width.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/icicle/marker/line/_width.py", "type": "Python" }
import _plotly_utils.basevalidators class WidthValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="width", parent_name="icicle.marker.line", **kwargs): super(WidthValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@icicle@marker@line@_width.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "Jammy2211/PyAutoLens", "repo_path": "PyAutoLens_extracted/PyAutoLens-main/test_autolens/lens/plot/__init__.py", "type": "Python" }
Jammy2211REPO_NAMEPyAutoLensPATH_START.@PyAutoLens_extracted@PyAutoLens-main@test_autolens@lens@plot@__init__.py@.PATH_END.py
{ "filename": "README.md", "repo_name": "Azeret/galIMF", "repo_path": "galIMF_extracted/galIMF-master/README.md", "type": "Markdown" }
# GalIMF version 1.1.13 Last update: 31.7.2024 ## Contents - [Overview](https://github.com/Azeret/galIMF#overview) - [Scientific motivation](https://github.com/Azeret/galIMF#scientific-motivation) - [The galaxy-wide IMF generator](https://github.com/Azeret/galIMF#the-galaxy-wide-IMF-generator) - [Main features ...
AzeretREPO_NAMEgalIMFPATH_START.@galIMF_extracted@galIMF-master@README.md@.PATH_END.py
{ "filename": "gwModels.md", "repo_name": "tousifislam/gwModels", "repo_path": "gwModels_extracted/gwModels-main/website/_build/html/_sources/gwModels.md", "type": "Markdown" }
# gwModels! ![](gwModels.png) **gwModels** is a Python-based package for data-driven and phenomenological models for gravitational waveforms radiated from the merger of binary black holes. For questions, suggestions or collaborations, please feel free to drop an email to tousifislam24@gmail.com. ### Getting the pac...
tousifislamREPO_NAMEgwModelsPATH_START.@gwModels_extracted@gwModels-main@website@_build@html@_sources@gwModels.md@.PATH_END.py
{ "filename": "mms_pgs_make_fac.py", "repo_name": "spedas/pyspedas", "repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/mms/particles/mms_pgs_make_fac.py", "type": "Python" }
import logging import numpy as np from pytplot import data_exists from pyspedas.cotrans_tools.cotrans import cotrans from pytplot import tnormalize from pytplot import tcrossp from pyspedas.analysis.tinterpol import tinterpol from pytplot import get_data, store_data logging.captureWarnings(True) logging.basicConfig(fo...
spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@mms@particles@mms_pgs_make_fac.py@.PATH_END.py
{ "filename": "EPIRK4s3B.py", "repo_name": "Pranab-JD/LeXInt", "repo_path": "LeXInt_extracted/LeXInt-main/Python/Constant/EPIRK4s3B.py", "type": "Python" }
import numpy as np ###! LeXInt functions from Jacobian import Jacobian from linear_phi import linear_phi ################################################################################################ def EPIRK4s3B(u, T_final, substeps, RHS_function, c, Gamma, Leja_X, tol, Real_Imag): """ Parameters ---...
Pranab-JDREPO_NAMELeXIntPATH_START.@LeXInt_extracted@LeXInt-main@Python@Constant@EPIRK4s3B.py@.PATH_END.py
{ "filename": "fixpix.py", "repo_name": "cmccully/lcogtgemini", "repo_path": "lcogtgemini_extracted/lcogtgemini-master/lcogtgemini/fixpix.py", "type": "Python" }
import os from pyraf import iraf from lcogtgemini import file_utils def fixpix(txtfile, rawpath, binning, namps): images = file_utils.get_images_from_txt_file(txtfile) for image in images: if not os.path.exists('../raw_fixpix'): iraf.mkdir('../raw_fixpix') iraf.cp(os.path.join(rawp...
cmccullyREPO_NAMElcogtgeminiPATH_START.@lcogtgemini_extracted@lcogtgemini-master@lcogtgemini@fixpix.py@.PATH_END.py
{ "filename": "_ticksuffix.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/heatmap/colorbar/_ticksuffix.py", "type": "Python" }
import _plotly_utils.basevalidators class TicksuffixValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="ticksuffix", parent_name="heatmap.colorbar", **kwargs ): super(TicksuffixValidator, self).__init__( plotly_name=plotly_name, par...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@heatmap@colorbar@_ticksuffix.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "abeelen/powspec", "repo_path": "powspec_extracted/powspec-master/powspec/example_subpkg/__init__.py", "type": "Python" }
""" This is the docstring for the examplesubpkg package. Normally you would have whatever.py files in this directory implementing some modules, but this is just an example sub-package, so it doesn't actually do anything. """
abeelenREPO_NAMEpowspecPATH_START.@powspec_extracted@powspec-master@powspec@example_subpkg@__init__.py@.PATH_END.py
{ "filename": "test_sffcorrector.py", "repo_name": "lightkurve/lightkurve", "repo_path": "lightkurve_extracted/lightkurve-main/tests/correctors/test_sffcorrector.py", "type": "Python" }
"""Tests the `lightkurve.correctors.SFFCorrector` class.""" import pytest import warnings import numpy as np from astropy.utils.data import get_pkg_data_filename from numpy.testing import assert_array_equal from lightkurve import ( LightCurve, KeplerLightCurve, TessLightCurve, LightkurveWarning, s...
lightkurveREPO_NAMElightkurvePATH_START.@lightkurve_extracted@lightkurve-main@tests@correctors@test_sffcorrector.py@.PATH_END.py
{ "filename": "test1d.py", "repo_name": "dbstein/fast_interp", "repo_path": "fast_interp_extracted/fast_interp-master/examples/test1d.py", "type": "Python" }
import numpy as np import scipy as sp import scipy.interpolate import time from fast_interp import interp1d import matplotlib as mpl import matplotlib.pyplot as plt plt.ion() import gc gc.disable() ################################################################################ # Basic error sweep print('\n----- Test...
dbsteinREPO_NAMEfast_interpPATH_START.@fast_interp_extracted@fast_interp-master@examples@test1d.py@.PATH_END.py
{ "filename": "_textcase.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/funnel/textfont/_textcase.py", "type": "Python" }
import _plotly_utils.basevalidators class TextcaseValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="textcase", parent_name="funnel.textfont", **kwargs): super(TextcaseValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_n...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@funnel@textfont@_textcase.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/treemap/pathbar/__init__.py", "type": "Python" }
import sys if sys.version_info < (3, 7): from ._textfont import Textfont else: from _plotly_utils.importers import relative_import __all__, __getattr__, __dir__ = relative_import( __name__, [], ["._textfont.Textfont"] )
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@treemap@pathbar@__init__.py@.PATH_END.py
{ "filename": "find_outliers.py", "repo_name": "SKA-INAF/sclassifier", "repo_path": "sclassifier_extracted/sclassifier-master/scripts/find_outliers.py", "type": "Python" }
#!/usr/bin/env python from __future__ import print_function ################################################## ### MODULE IMPORT ################################################## ## STANDARD MODULES import os import sys import subprocess import string import time import signal from threading import Thread i...
SKA-INAFREPO_NAMEsclassifierPATH_START.@sclassifier_extracted@sclassifier-master@scripts@find_outliers.py@.PATH_END.py
{ "filename": "Psi4.py", "repo_name": "zachetienne/nrpytutorial", "repo_path": "nrpytutorial_extracted/nrpytutorial-master/BSSN/Psi4.py", "type": "Python" }
# As documented in the NRPy+ tutorial module # Tutorial-Psi4.ipynb, # this module will construct a generic # expression for \psi_4 # Author: Zachariah B. Etienne # zachetie **at** gmail **dot* com # Step 1.a: import all needed modules from NRPy+: import sympy as sp # SymPy: The Python com...
zachetienneREPO_NAMEnrpytutorialPATH_START.@nrpytutorial_extracted@nrpytutorial-master@BSSN@Psi4.py@.PATH_END.py
{ "filename": "run_all_tests.py", "repo_name": "aewallin/allantools", "repo_path": "allantools_extracted/allantools-master/tests/run_all_tests.py", "type": "Python" }
#!/usr/bin/python """ top-level test-script for allantools https://github.com/aewallin/allantools this files runs all the tests defined in the /tests/ subdirectories More datasets along with known deviations (or calculated with known-good programs) are welcome. results from allantools seem correct, ...
aewallinREPO_NAMEallantoolsPATH_START.@allantools_extracted@allantools-master@tests@run_all_tests.py@.PATH_END.py
{ "filename": "_weight.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/carpet/font/_weight.py", "type": "Python" }
import _plotly_utils.basevalidators class WeightValidator(_plotly_utils.basevalidators.IntegerValidator): def __init__(self, plotly_name="weight", parent_name="carpet.font", **kwargs): super(WeightValidator, 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@carpet@font@_weight.py@.PATH_END.py
{ "filename": "_family.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattermap/marker/colorbar/tickfont/_family.py", "type": "Python" }
import _plotly_utils.basevalidators class FamilyValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="family", parent_name="scattermap.marker.colorbar.tickfont", **kwargs, ): super(FamilyValidator, self).__init__( plotly_n...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattermap@marker@colorbar@tickfont@_family.py@.PATH_END.py
{ "filename": "test_optical.py", "repo_name": "moeyensj/atm", "repo_path": "atm_extracted/atm-master/atm/functions/tests/test_optical.py", "type": "Python" }
#!/usr/bin/env python # -*- coding: UTF-8 -*- import numpy as np from numpy import testing as test from ..optical import calcH from ..optical import calcD from ..optical import calcPv # Test calcH def test_calcH(): # Data taken from: # Reference # --------- # Alan W. Harris and Alan W. Harris, 1997: ...
moeyensjREPO_NAMEatmPATH_START.@atm_extracted@atm-master@atm@functions@tests@test_optical.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/cone/colorbar/tickfont/__init__.py", "type": "Python" }
import sys if sys.version_info < (3, 7): from ._size import SizeValidator from ._family import FamilyValidator from ._color import ColorValidator else: from _plotly_utils.importers import relative_import __all__, __getattr__, __dir__ = relative_import( __name__, [], ["._siz...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@cone@colorbar@tickfont@__init__.py@.PATH_END.py
{ "filename": "_yanchor.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter/marker/colorbar/_yanchor.py", "type": "Python" }
import _plotly_utils.basevalidators class YanchorValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="yanchor", parent_name="scatter.marker.colorbar", **kwargs ): super(YanchorValidator, self).__init__( plotly_name=plotly_name, p...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter@marker@colorbar@_yanchor.py@.PATH_END.py
{ "filename": "utils.py", "repo_name": "ML4GW/amplfi", "repo_path": "amplfi_extracted/amplfi-main/amplfi/train/data/utils/utils.py", "type": "Python" }
from typing import Callable, Dict import torch class ParameterTransformer(torch.nn.Module): """ Helper class for applying preprocessing transformations to inference parameters """ def __init__(self, **transforms: Callable): super().__init__() self.transforms = transforms def...
ML4GWREPO_NAMEamplfiPATH_START.@amplfi_extracted@amplfi-main@amplfi@train@data@utils@utils.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "djones1040/PythonPhot", "repo_path": "PythonPhot_extracted/PythonPhot-master/packagename/example_subpkg/__init__.py", "type": "Python" }
""" This is the docstring for the examplesubpkg package. Normally you would have whatever.py files in this directory implementing some modules, but this is just an example sub-package, so it doesn't actually do anything. """
djones1040REPO_NAMEPythonPhotPATH_START.@PythonPhot_extracted@PythonPhot-master@packagename@example_subpkg@__init__.py@.PATH_END.py
{ "filename": "test_synthesis.py", "repo_name": "MikeSWang/Harmonia", "repo_path": "Harmonia_extracted/Harmonia-master/harmonia/tests/test_synthesis.py", "type": "Python" }
import pytest from harmonia.surveyor.synthesis import ( generate_compression_matrix, ) @pytest.mark.skip(reason="Unimplemented.") def test_generate_compression_matrix(): print("Unimplemented test.") raise NotImplementedError
MikeSWangREPO_NAMEHarmoniaPATH_START.@Harmonia_extracted@Harmonia-master@harmonia@tests@test_synthesis.py@.PATH_END.py
{ "filename": "results.py", "repo_name": "PrefectHQ/prefect", "repo_path": "prefect_extracted/prefect-main/src/prefect/results.py", "type": "Python" }
import abc import inspect import os import socket import threading import uuid from functools import partial from pathlib import Path from typing import ( TYPE_CHECKING, Annotated, Any, Callable, Dict, Generic, Optional, Tuple, Type, TypeVar, Union, ) from uuid import UUID i...
PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@results.py@.PATH_END.py
{ "filename": "setup_base.py", "repo_name": "clemson-cal/sailfish", "repo_path": "sailfish_extracted/sailfish-master/sailfish/setup_base.py", "type": "Python" }
""" The `Setup` class dictates physics and solver choices to the driver. """ from abc import ABC, abstractmethod from textwrap import dedent from typing import NamedTuple, Any class SetupError(Exception): """Something went wrong during setup configuration""" class Parameter(NamedTuple): """ A model par...
clemson-calREPO_NAMEsailfishPATH_START.@sailfish_extracted@sailfish-master@sailfish@setup_base.py@.PATH_END.py
{ "filename": "hadec.py", "repo_name": "astropy/astropy", "repo_path": "astropy_extracted/astropy-main/astropy/coordinates/builtin_frames/hadec.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy import units as u from astropy.coordinates import representation as r from astropy.coordinates.attributes import ( EarthLocationAttribute, QuantityAttribute, TimeAttribute, ) from astropy.coordinates.baseframe import ( BaseCoo...
astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@coordinates@builtin_frames@hadec.py@.PATH_END.py
{ "filename": "core.py", "repo_name": "aburgasser/kastredux", "repo_path": "kastredux_extracted/kastredux-main/core.py", "type": "Python" }
# -*- coding: utf-8 -*- from __future__ import print_function # WORKING COPY OF KAST REDUCTION CODE # THINGS THAT NEED FIXING # - fix flux calibration "wiggle" at red end of blue dispersion # - documentation # - function docstrings # - if output dictionary exists, won't do anything! -> can't used saved files # import...
aburgasserREPO_NAMEkastreduxPATH_START.@kastredux_extracted@kastredux-main@core.py@.PATH_END.py
{ "filename": "stein.py", "repo_name": "pymc-devs/pymc", "repo_path": "pymc_extracted/pymc-main/pymc/variational/stein.py", "type": "Python" }
# Copyright 2024 The PyMC Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
pymc-devsREPO_NAMEpymcPATH_START.@pymc_extracted@pymc-main@pymc@variational@stein.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "probabilists/lampe", "repo_path": "lampe_extracted/lampe-master/lampe/diagnostics/__init__.py", "type": "Python" }
r"""Diagnostics and reliability assessment.""" from .coverage import *
probabilistsREPO_NAMElampePATH_START.@lampe_extracted@lampe-master@lampe@diagnostics@__init__.py@.PATH_END.py
{ "filename": "test_lkj.py", "repo_name": "pyro-ppl/pyro", "repo_path": "pyro_extracted/pyro-master/tests/distributions/test_lkj.py", "type": "Python" }
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import math import pytest import torch from torch.distributions import ( AffineTransform, Beta, TransformedDistribution, biject_to, transform_to, ) from pyro.distributions import constraints, transforms from p...
pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@tests@distributions@test_lkj.py@.PATH_END.py
{ "filename": "interpolated_gxy.ipynb", "repo_name": "TommasoRonconi/galapy", "repo_path": "galapy_extracted/galapy-main/doc/notebooks/interpolated_gxy.ipynb", "type": "Jupyter Notebook" }
# Build a galaxy model from an interpolated SFH GalaPy provides a non-parametric, interpolated, step-wise SFH model with derived components (like dust/gas mass and metallicity) treated as free parameters. This model is designed to predict the emission from galaxies for which the stellar mass growth history is availabl...
TommasoRonconiREPO_NAMEgalapyPATH_START.@galapy_extracted@galapy-main@doc@notebooks@interpolated_gxy.ipynb@.PATH_END.py
{ "filename": "testing.py", "repo_name": "radiocosmology/draco", "repo_path": "draco_extracted/draco-master/draco/util/testing.py", "type": "Python" }
"""draco test utils.""" from typing import Optional, Union import numpy as np from caput import config, memh5, pipeline from ..core.containers import SiderealStream from ..core.task import SingleTask from . import random class DummyTask(SingleTask): """Produce an empty data stream for testing. Attributes ...
radiocosmologyREPO_NAMEdracoPATH_START.@draco_extracted@draco-master@draco@util@testing.py@.PATH_END.py
{ "filename": "_text.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/sunburst/_text.py", "type": "Python" }
import _plotly_utils.basevalidators class TextValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__(self, plotly_name="text", parent_name="sunburst", **kwargs): super(TextValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edi...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@sunburst@_text.py@.PATH_END.py
{ "filename": "conftest.py", "repo_name": "keras-team/keras", "repo_path": "keras_extracted/keras-master/conftest.py", "type": "Python" }
import os # When using jax.experimental.enable_x64 in unit test, we want to keep the # default dtype with 32 bits, aligning it with Keras's default. os.environ["JAX_DEFAULT_DTYPE_BITS"] = "32" try: # When using torch and tensorflow, torch needs to be imported first, # otherwise it will segfault upon import. T...
keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@conftest.py@.PATH_END.py
{ "filename": "render_examples.py", "repo_name": "enthought/mayavi", "repo_path": "mayavi_extracted/mayavi-master/docs/source/render_examples.py", "type": "Python" }
""" Render the examples to images and adds them to the documentation. """ # Standard library imports import glob import os import shutil import token, tokenize import textwrap import itertools # Enthought imports from mayavi import mlab # A global counter, for subsitutions. global_counter = itertools.count() EXAMPL...
enthoughtREPO_NAMEmayaviPATH_START.@mayavi_extracted@mayavi-master@docs@source@render_examples.py@.PATH_END.py