metadata
dict
text
stringlengths
0
40.6M
id
stringlengths
14
255
{ "filename": "CornerPlotExamples.ipynb", "repo_name": "nickfarrow/GalacticDNSMass", "repo_path": "GalacticDNSMass_extracted/GalacticDNSMass-master/mainCode/Plotting/CornerPlotExamples.ipynb", "type": "Jupyter Notebook" }
```python import matplotlib.pyplot as plt import corner import pymultinest #Imports import numpy as np from scipy import stats from scipy.special import erf import json import os import sys import random from math import log10, floor ### Top directory for the location of project files. topDirectory = '../' if not...
nickfarrowREPO_NAMEGalacticDNSMassPATH_START.@GalacticDNSMass_extracted@GalacticDNSMass-master@mainCode@Plotting@CornerPlotExamples.ipynb@.PATH_END.py
{ "filename": "detection_discrepancy_LCO.py", "repo_name": "cy-xu/cosmic-conn", "repo_path": "cosmic-conn_extracted/cosmic-conn-main/paper_utils/detection_discrepancy_LCO.py", "type": "Python" }
from inference_cr import init_model, detect_2d_array from enum import auto import os import numpy as np from astropy.io import fits import matplotlib.pyplot as plt import matplotlib.image as mpimg import astroscrappy.astroscrappy as lac from sys import path from os.path import dirname as dir path.append(dir(path[0])...
cy-xuREPO_NAMEcosmic-connPATH_START.@cosmic-conn_extracted@cosmic-conn-main@paper_utils@detection_discrepancy_LCO.py@.PATH_END.py
{ "filename": "tfsa-2021-005.md", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/security/advisory/tfsa-2021-005.md", "type": "Markdown" }
## TFSA-2021-005: Null pointer dereference via invalid Ragged Tensors ### CVE Number CVE-2021-29516 ### Impact Calling `tf.raw_ops.RaggedTensorToVariant` with arguments specifying an invalid ragged tensor results in a null pointer dereference: ```python import tensorflow as tf input_tensor = tf.constant([], shape=[...
tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@security@advisory@tfsa-2021-005.md@.PATH_END.py
{ "filename": "tmap_day_night_scaled.py", "repo_name": "Jingxuan97/nemesispy", "repo_path": "nemesispy_extracted/nemesispy-main/nemesispy/models/backup_tmaps/tmap_day_night_scaled.py", "type": "Python" }
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np from nemesispy.models.TP_profiles import TP_Guillot def tmap_day_night_scaled(P_grid, lon_grid, lat_grid, g_plt, T_eq, scale, phase_offset, log_kappa_day, log_gamma_day, log_f_day, T_int_day, log_kappa_night, log_gamma_night, log_f_night, T_...
Jingxuan97REPO_NAMEnemesispyPATH_START.@nemesispy_extracted@nemesispy-main@nemesispy@models@backup_tmaps@tmap_day_night_scaled.py@.PATH_END.py
{ "filename": "test_statistics.py", "repo_name": "mwaskom/seaborn", "repo_path": "seaborn_extracted/seaborn-master/tests/test_statistics.py", "type": "Python" }
import numpy as np import pandas as pd try: import statsmodels.distributions as smdist except ImportError: smdist = None import pytest from numpy.testing import assert_array_equal, assert_array_almost_equal from seaborn._statistics import ( KDE, Histogram, ECDF, EstimateAggregator, Letter...
mwaskomREPO_NAMEseabornPATH_START.@seaborn_extracted@seaborn-master@tests@test_statistics.py@.PATH_END.py
{ "filename": "_legendgroup.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/splom/_legendgroup.py", "type": "Python" }
import _plotly_utils.basevalidators class LegendgroupValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="legendgroup", parent_name="splom", **kwargs): super(LegendgroupValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@splom@_legendgroup.py@.PATH_END.py
{ "filename": "IncrementCullenMultipliersInst.cc.py", "repo_name": "LLNL/spheral", "repo_path": "spheral_extracted/spheral-main/src/ArtificialViscosity/IncrementCullenMultipliersInst.cc.py", "type": "Python" }
text = """ //------------------------------------------------------------------------------ // Explicit instantiation. //------------------------------------------------------------------------------ #include "Geometry/Dimension.hh" #include "ArtificialViscosity/IncrementCullenMultipliers.cc" namespace Spheral { tem...
LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@src@ArtificialViscosity@IncrementCullenMultipliersInst.cc.py@.PATH_END.py
{ "filename": "Constant_test.py", "repo_name": "Pranab-JD/LeXInt", "repo_path": "LeXInt_extracted/LeXInt-main/Python/Test/Constant_test.py", "type": "Python" }
""" Created on Sat Aug 14 11:31:19 2022 @author: Pranab JD Description: Constant Test """ import os, sys, shutil import numpy as np from scipy.sparse import csr_matrix import matplotlib.pyplot as plt from datetime import datetime startTime = datetime.now() ### -----------------------------------------------------...
Pranab-JDREPO_NAMELeXIntPATH_START.@LeXInt_extracted@LeXInt-main@Python@Test@Constant_test.py@.PATH_END.py
{ "filename": "vq.py", "repo_name": "google/jax", "repo_path": "jax_extracted/jax-main/jax/_src/scipy/cluster/vq.py", "type": "Python" }
# Copyright 2022 The JAX Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
googleREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@_src@scipy@cluster@vq.py@.PATH_END.py
{ "filename": "test_pdtr.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/special/tests/test_pdtr.py", "type": "Python" }
import numpy as np import scipy.special as sc from numpy.testing import assert_almost_equal, assert_array_equal class TestPdtr: def test(self): val = sc.pdtr(0, 1) assert_almost_equal(val, np.exp(-1)) def test_m_zero(self): val = sc.pdtr([0, 1, 2], 0) assert_array_equal(val, [...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@special@tests@test_pdtr.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterternary/marker/colorbar/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...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterternary@marker@colorbar@title@font@__init__.py@.PATH_END.py
{ "filename": "interpolation.py", "repo_name": "gammapy/gammapy", "repo_path": "gammapy_extracted/gammapy-main/gammapy/utils/interpolation.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Interpolation utilities.""" import html from itertools import compress import numpy as np import scipy.interpolate from astropy import units as u from .compat import COPY_IF_NEEDED __all__ = [ "interpolate_profile", "interpolation_scale", ...
gammapyREPO_NAMEgammapyPATH_START.@gammapy_extracted@gammapy-main@gammapy@utils@interpolation.py@.PATH_END.py
{ "filename": "_y.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/surface/contours/z/project/_y.py", "type": "Python" }
import _plotly_utils.basevalidators class YValidator(_plotly_utils.basevalidators.BooleanValidator): def __init__( self, plotly_name="y", parent_name="surface.contours.z.project", **kwargs ): super(YValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@surface@contours@z@project@_y.py@.PATH_END.py
{ "filename": "util.py", "repo_name": "MNiwano/Eclaire", "repo_path": "Eclaire_extracted/Eclaire-master/eclaire/util.py", "type": "Python" }
# -*- coding: utf-8 -*- import warnings import cupy as cp from . import common def set_dtype(dtype): ''' Change the default dtype used in all functions and classes in this package. Parameters ---------- dtype : str or dtype ''' common.default_dtype = judge_dtype(dtype).name def j...
MNiwanoREPO_NAMEEclairePATH_START.@Eclaire_extracted@Eclaire-master@eclaire@util.py@.PATH_END.py
{ "filename": "README.md", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/filelock/py2/README.md", "type": "Markdown" }
# py-filelock [![PyPI](https://img.shields.io/pypi/v/filelock?style=flat-square)](https://pypi.org/project/filelock/) [![Supported Python versions](https://img.shields.io/pypi/pyversions/filelock.svg)](https://pypi.org/project/filelock/) [![Documentation status](https://readthedocs.org/projects/py-filelock/badge/?vers...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@filelock@py2@README.md@.PATH_END.py
{ "filename": "_font.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/choroplethmap/colorbar/title/_font.py", "type": "Python" }
import _plotly_utils.basevalidators class FontValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__( self, plotly_name="font", parent_name="choroplethmap.colorbar.title", **kwargs ): super(FontValidator, self).__init__( plotly_name=plotly_name, parent_...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@choroplethmap@colorbar@title@_font.py@.PATH_END.py
{ "filename": "_gridcolor.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/carpet/aaxis/_gridcolor.py", "type": "Python" }
import _plotly_utils.basevalidators class GridcolorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__(self, plotly_name="gridcolor", parent_name="carpet.aaxis", **kwargs): super(GridcolorValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@carpet@aaxis@_gridcolor.py@.PATH_END.py
{ "filename": "visualization.md", "repo_name": "hannorein/REBOUND", "repo_path": "REBOUND_extracted/REBOUND-main/docs/visualization.md", "type": "Markdown" }
# Visualization Starting with version 4, REBOUND includes new real-time interactive 3D visualizations. The code for these visualization is built-upon the previous OpenGL visualizations that came with the C version of REBOUND. However, the new visualization feature has several advantages - There are zero dependencie...
hannoreinREPO_NAMEREBOUNDPATH_START.@REBOUND_extracted@REBOUND-main@docs@visualization.md@.PATH_END.py
{ "filename": "test_callbacks.py", "repo_name": "DLR-RM/stable-baselines3", "repo_path": "stable-baselines3_extracted/stable-baselines3-master/tests/test_callbacks.py", "type": "Python" }
import os import shutil import gymnasium as gym import numpy as np import pytest import torch as th from stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3, HerReplayBuffer from stable_baselines3.common.callbacks import ( BaseCallback, CallbackList, CheckpointCallback, EvalCallback, EveryNTime...
DLR-RMREPO_NAMEstable-baselines3PATH_START.@stable-baselines3_extracted@stable-baselines3-master@tests@test_callbacks.py@.PATH_END.py
{ "filename": "backend_wxcairo.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/matplotlib/py3/matplotlib/backends/backend_wxcairo.py", "type": "Python" }
import wx.lib.wxcairo as wxcairo from .backend_cairo import cairo, FigureCanvasCairo from .backend_wx import _BackendWx, _FigureCanvasWxBase from .backend_wx import ( # noqa: F401 # pylint: disable=W0611 NavigationToolbar2Wx as NavigationToolbar2WxCairo) class FigureCanvasWxCairo(FigureCanvasCairo, _FigureCanva...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@matplotlib@py3@matplotlib@backends@backend_wxcairo.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "simonsobs/sotodlib", "repo_path": "sotodlib_extracted/sotodlib-master/sotodlib/toast/io/__init__.py", "type": "Python" }
# Copyright (c) 2020-2022 Simons Observatory. # Full license can be found in the top level "LICENSE" file. """Simons Observatory TOAST I/O helper classes. """ from .save_book import ( book_name_from_obs, write_book, ) from .load_book import ( parse_book_name, parse_book_time, read_book, )
simonsobsREPO_NAMEsotodlibPATH_START.@sotodlib_extracted@sotodlib-master@sotodlib@toast@io@__init__.py@.PATH_END.py
{ "filename": "save_model__div_desc.md", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage-python/save_model__div_desc.md", "type": "Markdown" }
Save the model borders to a file.
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage-python@save_model__div_desc.md@.PATH_END.py
{ "filename": "nfw_vir_trunc.py", "repo_name": "sibirrer/lenstronomy", "repo_path": "lenstronomy_extracted/lenstronomy-main/lenstronomy/LensModel/Profiles/nfw_vir_trunc.py", "type": "Python" }
__author__ = "sibirrer" # this file contains a class to compute the Navaro-Frank-White function in mass/kappa space # the potential therefore is its integral import numpy as np from lenstronomy.Util import constants as const from lenstronomy.LensModel.Profiles.base_profile import LensProfileBase from lenstronomy.Cosm...
sibirrerREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@lenstronomy@LensModel@Profiles@nfw_vir_trunc.py@.PATH_END.py
{ "filename": "image.py", "repo_name": "CEA-COSMIC/pysap", "repo_path": "pysap_extracted/pysap-master/pysap/base/image.py", "type": "Python" }
# -*- coding: utf-8 -*- ########################################################################## # pySAP - Copyright (C) CEA, 2017 - 2018 # Distributed under the terms of the CeCILL-B license, as published by # the CEA-CNRS-INRIA. Refer to the LICENSE file or to # http://www.cecill.info/licences/Licence_CeCILL-B_V1-e...
CEA-COSMICREPO_NAMEpysapPATH_START.@pysap_extracted@pysap-master@pysap@base@image.py@.PATH_END.py
{ "filename": "test_rawfile_grouping.py", "repo_name": "timstaley/drive-ami", "repo_path": "drive-ami_extracted/drive-ami-master/driveami/tests/test_rawfile_grouping.py", "type": "Python" }
import unittest from unittest import TestCase import os import driveami import driveami.tests.resources as resources import logging logging.basicConfig(level=logging.DEBUG) import pickle # @unittest.skip class TestGrouping(TestCase): def setUp(self): env_extras = resources.setup_testdata_symlink() ...
timstaleyREPO_NAMEdrive-amiPATH_START.@drive-ami_extracted@drive-ami-master@driveami@tests@test_rawfile_grouping.py@.PATH_END.py
{ "filename": "mlemodel.py", "repo_name": "statsmodels/statsmodels", "repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/tsa/mlemodel.py", "type": "Python" }
"""Base Classes for Likelihood Models in time series analysis Warning: imports numdifftools Created on Sun Oct 10 15:00:47 2010 Author: josef-pktd License: BSD """ try: import numdifftools as ndt except ImportError: pass from statsmodels.base.model import LikelihoodModel #copied from sandbox/regressi...
statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@tsa@mlemodel.py@.PATH_END.py
{ "filename": "model.py", "repo_name": "jfcrenshaw/photerr", "repo_path": "photerr_extracted/photerr-main/photerr/model.py", "type": "Python" }
"""The photometric error model.""" from typing import Any import numpy as np import pandas as pd from photerr.params import ErrorParams class ErrorModel: """Base error model from Ivezic 2019. Below is the parameter docstring: """ __doc__ += ErrorParams.__doc__ def __init__(self, *args: Error...
jfcrenshawREPO_NAMEphoterrPATH_START.@photerr_extracted@photerr-main@photerr@model.py@.PATH_END.py
{ "filename": "test_synch_pysm3.py", "repo_name": "galsci/pysm", "repo_path": "pysm_extracted/pysm-main/tests/test_synch_pysm3.py", "type": "Python" }
import numpy as np import psutil import pytest from astropy.tests.helper import assert_quantity_allclose import pysm3 from pysm3 import units as u @pytest.mark.parametrize("model_tag", ["s7"]) def test_synch_model_s7_noscaling(model_tag): nside = 2048 freq = 23 * u.GHz model = pysm3.Sky(preset_strings=...
galsciREPO_NAMEpysmPATH_START.@pysm_extracted@pysm-main@tests@test_synch_pysm3.py@.PATH_END.py
{ "filename": "_showticksuffix.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/scene/zaxis/_showticksuffix.py", "type": "Python" }
import _plotly_utils.basevalidators class ShowticksuffixValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="showticksuffix", parent_name="layout.scene.zaxis", **kwargs ): super(ShowticksuffixValidator, self).__init__( plotly_name=plotly_nam...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@scene@zaxis@_showticksuffix.py@.PATH_END.py
{ "filename": "transformation.py", "repo_name": "Harry45/DESEMU", "repo_path": "DESEMU_extracted/DESEMU-main/torchemu/transformation.py", "type": "Python" }
# Author: Dr. Arrykrishna Mootoovaloo # Date: 17th January 2022 # Email: arrykrish@gmail.com, a.mootoovaloo17@imperial.ac.uk, arrykrishna.mootoovaloo@physics # Description: Code to transform the inputs to the GP, that is, the input training points import torch class PreWhiten(object): def __init__(self, xinputs:...
Harry45REPO_NAMEDESEMUPATH_START.@DESEMU_extracted@DESEMU-main@torchemu@transformation.py@.PATH_END.py
{ "filename": "_bgcolor.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/contour/colorbar/_bgcolor.py", "type": "Python" }
import _plotly_utils.basevalidators class BgcolorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__(self, plotly_name="bgcolor", parent_name="contour.colorbar", **kwargs): super(BgcolorValidator, 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@contour@colorbar@_bgcolor.py@.PATH_END.py
{ "filename": "plot_logistic_multinomial.py", "repo_name": "scikit-learn/scikit-learn", "repo_path": "scikit-learn_extracted/scikit-learn-main/examples/linear_model/plot_logistic_multinomial.py", "type": "Python" }
""" ====================================================================== Decision Boundaries of Multinomial and One-vs-Rest Logistic Regression ====================================================================== This example compares decision boundaries of multinomial and one-vs-rest logistic regression on a 2D d...
scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@examples@linear_model@plot_logistic_multinomial.py@.PATH_END.py
{ "filename": "quadrature_torch.py", "repo_name": "astro-informatics/s2fft", "repo_path": "s2fft_extracted/s2fft-main/s2fft/utils/quadrature_torch.py", "type": "Python" }
import torch from s2fft.sampling import s2_samples as samples def quad_weights_transform( L: int, sampling: str = "mwss", nside: int = 0 ) -> torch.tensor: r""" Compute quadrature weights for :math:`\theta` and :math:`\phi` integration *to use in transform* for various sampling schemes. Torch impleme...
astro-informaticsREPO_NAMEs2fftPATH_START.@s2fft_extracted@s2fft-main@s2fft@utils@quadrature_torch.py@.PATH_END.py
{ "filename": "utils.py", "repo_name": "carronj/plancklens", "repo_path": "plancklens_extracted/plancklens-master/plancklens/sims/utils.py", "type": "Python" }
import numpy as np class sim_lib_shuffle: """A simulation library with remapped indices. """ def __init__(self, sim_lib, shuffle_dict): self.sim_lib = sim_lib self._shuffle = shuffle_dict def get_sim_tmap(self, idx): return self.sim_lib.get_sim_tmap(int(self._shuffle[idx])) def ...
carronjREPO_NAMEplancklensPATH_START.@plancklens_extracted@plancklens-master@plancklens@sims@utils.py@.PATH_END.py
{ "filename": "test_model_residual_maps.py", "repo_name": "threeML/hawc_hal", "repo_path": "hawc_hal_extracted/hawc_hal-master/hawc_hal/tests/test_model_residual_maps.py", "type": "Python" }
from __future__ import division from past.utils import old_div import pytest from os.path import dirname from hawc_hal import HealpixConeROI, HAL from hawc_hal.maptree import map_tree_factory from threeML import Model, JointLikelihood, DataList import astropy.units as u from astromodels import PointSource, ExtendedSour...
threeMLREPO_NAMEhawc_halPATH_START.@hawc_hal_extracted@hawc_hal-master@hawc_hal@tests@test_model_residual_maps.py@.PATH_END.py
{ "filename": "test_create_master_bkg.py", "repo_name": "spacetelescope/jwst", "repo_path": "jwst_extracted/jwst-main/jwst/master_background/tests/test_create_master_bkg.py", "type": "Python" }
""" Test for master_background.create_master_bkg """ import numpy as np from jwst.master_background import create_master_bkg def test_create_master_bkg(): wl = np.arange(37, dtype=np.float64) * 0.1 + 3. surf_bright = np.ones(37, dtype=np.float64) * 7 model = create_master_bkg.create_background(wl, surf...
spacetelescopeREPO_NAMEjwstPATH_START.@jwst_extracted@jwst-main@jwst@master_background@tests@test_create_master_bkg.py@.PATH_END.py
{ "filename": "__main__.py", "repo_name": "gammapy/gammapy", "repo_path": "gammapy_extracted/gammapy-main/gammapy/__main__.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Top-level script environment for Gammapy. This is what's executed when you run: python -m gammapy See https://docs.python.org/3/library/__main__.html """ import sys from .scripts.main import cli if __name__ == "__main__": sys.exit(cli()) # ...
gammapyREPO_NAMEgammapyPATH_START.@gammapy_extracted@gammapy-main@gammapy@__main__.py@.PATH_END.py
{ "filename": "Pk_analysis.py", "repo_name": "Valcin/BE_HaPPy", "repo_path": "BE_HaPPy_extracted/BE_HaPPy-master/coefficients/simu_ps/0.15eV/NCV2/analysis/Pk_analysis.py", "type": "Python" }
import numpy as np import sys,os,h5py,time import Pk_library as PKL ################################# INPUT ##################################### redshifts = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0] BoxSize = 1000.0 #Mpc/h ###...
ValcinREPO_NAMEBE_HaPPyPATH_START.@BE_HaPPy_extracted@BE_HaPPy-master@coefficients@simu_ps@0.15eV@NCV2@analysis@Pk_analysis.py@.PATH_END.py
{ "filename": "OneObservationFlow_Tutorial.ipynb", "repo_name": "folsomcp/specpolFlow", "repo_path": "specpolFlow_extracted/specpolFlow-main/docs-jb/GetStarted/OneObservationFlow_Tutorial.ipynb", "type": "Jupyter Notebook" }
# From normalized spectrum to Bz measurement <img src="https://github.com/folsomcp/specpolFlow/blob/main/docs-jb/GetStarted/OneObservationFlow_tutorialfiles/diagram4.png?raw=true" align: center width="1000px"> In the below code, we will walk through how to use `SpecpolFlow` (with the use of [`LSDpy`](https://github...
folsomcpREPO_NAMEspecpolFlowPATH_START.@specpolFlow_extracted@specpolFlow-main@docs-jb@GetStarted@OneObservationFlow_Tutorial.ipynb@.PATH_END.py
{ "filename": "_hoverlabel.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/surface/_hoverlabel.py", "type": "Python" }
import _plotly_utils.basevalidators class HoverlabelValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="hoverlabel", parent_name="surface", **kwargs): super(HoverlabelValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name,...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@surface@_hoverlabel.py@.PATH_END.py
{ "filename": "pipeline.py", "repo_name": "lucabaldini/ixpeobssim", "repo_path": "ixpeobssim_extracted/ixpeobssim-main/ixpeobssim/core/pipeline.py", "type": "Python" }
# Copyright (C) 2016--2022, the ixpeobssim team. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is d...
lucabaldiniREPO_NAMEixpeobssimPATH_START.@ixpeobssim_extracted@ixpeobssim-main@ixpeobssim@core@pipeline.py@.PATH_END.py
{ "filename": "__databases__.py", "repo_name": "ucl-exoplanets/pylightcurve", "repo_path": "pylightcurve_extracted/pylightcurve-master/pylightcurve/__databases__.py", "type": "Python" }
import os import glob import time import shutil from scipy.interpolate import interp1d from .processes.files import open_dict, open_yaml, save_dict, download, open_dict_online try: import zipfile download_zip = True except: download_zip = False databases_file = '__databases__.pickle' package_name = 'pyl...
ucl-exoplanetsREPO_NAMEpylightcurvePATH_START.@pylightcurve_extracted@pylightcurve-master@pylightcurve@__databases__.py@.PATH_END.py
{ "filename": "_width.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/mesh3d/contour/_width.py", "type": "Python" }
import _plotly_utils.basevalidators class WidthValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="width", parent_name="mesh3d.contour", **kwargs): super(WidthValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@mesh3d@contour@_width.py@.PATH_END.py
{ "filename": "_customdatasrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/heatmapgl/_customdatasrc.py", "type": "Python" }
import _plotly_utils.basevalidators class CustomdatasrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__(self, plotly_name="customdatasrc", parent_name="heatmapgl", **kwargs): super(CustomdatasrcValidator, self).__init__( plotly_name=plotly_name, parent_name=parent...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@heatmapgl@_customdatasrc.py@.PATH_END.py
{ "filename": "singularity.py", "repo_name": "ratt-ru/Stimela-classic", "repo_path": "Stimela-classic_extracted/Stimela-classic-master/stimela/singularity.py", "type": "Python" }
import subprocess import os import sys from stimela import utils from stimela.cargo import cab import json import stimela import time import datetime import tempfile import hashlib from shutil import which version = None for item in ["apptainer", "singularity"]: BINARY = which(item) BINARY_NAME = item if...
ratt-ruREPO_NAMEStimela-classicPATH_START.@Stimela-classic_extracted@Stimela-classic-master@stimela@singularity.py@.PATH_END.py
{ "filename": "_width.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/violin/meanline/_width.py", "type": "Python" }
import _plotly_utils.basevalidators class WidthValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="width", parent_name="violin.meanline", **kwargs): super(WidthValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@violin@meanline@_width.py@.PATH_END.py
{ "filename": "RVmod_as_py_lib_kep_vs_dyn_example.py", "repo_name": "3fon3fonov/exostriker", "repo_path": "exostriker_extracted/exostriker-main/examples/RVmod_as_py_lib_kep_vs_dyn_example.py", "type": "Python" }
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This is one VERY simple example how to use RVmod as a fitting library. The RVmod options however, are a lot more. Reminder: the Exo-Striker GUI interface is warped around the RVmod. This example script delas with the Eta Ceti system (the usual demo in the Exo-Str...
3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@examples@RVmod_as_py_lib_kep_vs_dyn_example.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "GeminiDRSoftware/DRAGONS", "repo_path": "DRAGONS_extracted/DRAGONS-master/gemini_instruments/niri/tests/__init__.py", "type": "Python" }
GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@gemini_instruments@niri@tests@__init__.py@.PATH_END.py
{ "filename": "subfindhdf_gadget4_test.py", "repo_name": "pynbody/pynbody", "repo_path": "pynbody_extracted/pynbody-master/tests/subfindhdf_gadget4_test.py", "type": "Python" }
import numpy as np import pytest import pynbody from pynbody.test_utils.gadget4_subfind_reader import Halos # tell pytest not to raise warnings across this module pytestmark = pytest.mark.filterwarnings("ignore:Masses are either stored") @pytest.fixture(scope='module', autouse=True) def get_data(): pynbody.test...
pynbodyREPO_NAMEpynbodyPATH_START.@pynbody_extracted@pynbody-master@tests@subfindhdf_gadget4_test.py@.PATH_END.py
{ "filename": "verticalPotential.py", "repo_name": "jobovy/galpy", "repo_path": "galpy_extracted/galpy-main/galpy/potential/verticalPotential.py", "type": "Python" }
import numpy from ..util import conversion from .DissipativeForce import _isDissipative from .linearPotential import linearPotential from .planarPotential import planarPotential from .Potential import Potential, PotentialError, flatten class verticalPotential(linearPotential): """Class that represents a vertical...
jobovyREPO_NAMEgalpyPATH_START.@galpy_extracted@galpy-main@galpy@potential@verticalPotential.py@.PATH_END.py
{ "filename": "woden_uv2ms.py", "repo_name": "JLBLine/WODEN", "repo_path": "WODEN_extracted/WODEN-master/scripts/woden_uv2ms.py", "type": "Python" }
#!/usr/bin/env python3 """Script to use pyuvdata to convert uvfits files to measurement sets` """ from subprocess import call import numpy as np import os import argparse import sys from pyuvdata import UVData def make_ms(uvfits_file, no_delete=False): """Takes a path to a uvfits file, checks it exists, and conver...
JLBLineREPO_NAMEWODENPATH_START.@WODEN_extracted@WODEN-master@scripts@woden_uv2ms.py@.PATH_END.py
{ "filename": "dok.py", "repo_name": "waynebhayes/SpArcFiRe", "repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/scipy/sparse/dok.py", "type": "Python" }
"""Dictionary Of Keys based matrix""" from __future__ import division, print_function, absolute_import __docformat__ = "restructuredtext en" __all__ = ['dok_matrix', 'isspmatrix_dok'] import functools import operator import itertools import numpy as np from scipy._lib.six import zip as izip, xrange, iteritems, it...
waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@scipy@sparse@dok.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "moble/scri", "repo_path": "scri_extracted/scri-main/scri/SpEC/file_io/__init__.py", "type": "Python" }
# Copyright (c) 2021, Michael Boyle # See LICENSE file for details: <https://github.com/moble/spherical_functions/blob/master/LICENSE> import warnings import os import re import ast import numpy as np import h5py import quaternion import spherical_functions as sf from ... import ( jit, WaveformModes, Frame...
mobleREPO_NAMEscriPATH_START.@scri_extracted@scri-main@scri@SpEC@file_io@__init__.py@.PATH_END.py
{ "filename": "decontest.py", "repo_name": "drphilmarshall/HumVI", "repo_path": "HumVI_extracted/HumVI-master/attic/test/decontest.py", "type": "Python" }
#!/usr/bin/env/python ##============================================================ """ Some tests for deconvolution They aren't extreme """ import sys sys.path.append("../decon/") sys.path.append("../misc/") import DeconvolveToTargetPSF as DT import numpy,scipy import time def decontest(): ## Original image p...
drphilmarshallREPO_NAMEHumVIPATH_START.@HumVI_extracted@HumVI-master@attic@test@decontest.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/ipython/py3/IPython/testing/plugin/__init__.py", "type": "Python" }
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipython@py3@IPython@testing@plugin@__init__.py@.PATH_END.py
{ "filename": "test_transformations.py", "repo_name": "LouisDesdoigts/dLux", "repo_path": "dLux_extracted/dLux-main/tests/test_transformations.py", "type": "Python" }
from jax import numpy as np, config config.update("jax_debug_nans", True) import pytest from dLux import CoordTransform def test_coord_transform(): CoordTransform().calculate(1, 16) CoordTransform([0.0, 0.0], np.pi, [1, 1], [1, 1]).calculate(1, 16) with pytest.raises(ValueError): CoordTransform(t...
LouisDesdoigtsREPO_NAMEdLuxPATH_START.@dLux_extracted@dLux-main@tests@test_transformations.py@.PATH_END.py
{ "filename": "promptlayer.ipynb", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/callbacks/promptlayer.ipynb", "type": "Jupyter Notebook" }
# PromptLayer >[PromptLayer](https://docs.promptlayer.com/introduction) is a platform for prompt engineering. It also helps with the LLM observability to visualize requests, version prompts, and track usage. > >While `PromptLayer` does have LLMs that integrate directly with LangChain (e.g. [`PromptLayerOpenAI`](/docs/...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@callbacks@promptlayer.ipynb@.PATH_END.py
{ "filename": "test_gofplots.py", "repo_name": "statsmodels/statsmodels", "repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/graphics/tests/test_gofplots.py", "type": "Python" }
from statsmodels.compat.python import PYTHON_IMPL_WASM import numpy as np import numpy.testing as nptest from numpy.testing import assert_equal import pytest from scipy import stats import statsmodels.api as sm from statsmodels.graphics import gofplots from statsmodels.graphics.gofplots import ( ProbPlot, qql...
statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@graphics@tests@test_gofplots.py@.PATH_END.py
{ "filename": "read_reno_nu2tautables.py", "repo_name": "NuSpaceSim/nuSpaceSim", "repo_path": "nuSpaceSim_extracted/nuSpaceSim-main/src/nuspacesim/data/RenoNu2TauTables/read_reno_nu2tautables.py", "type": "Python" }
import math import h5py import numpy as np def extract_pexit_data(filename): infile = open(filename, "r") data = [line.split() for line in infile] b = [(math.pi * float(lne[0]) / 180.0) for lne in data] le = [math.log10(float(lne[1])) for lne in data] p = [math.log10(float(lne[-1])) for lne in da...
NuSpaceSimREPO_NAMEnuSpaceSimPATH_START.@nuSpaceSim_extracted@nuSpaceSim-main@src@nuspacesim@data@RenoNu2TauTables@read_reno_nu2tautables.py@.PATH_END.py
{ "filename": "convert_data_reformatted_LWA_to_CDF.py", "repo_name": "epic-astronomy/EPIC", "repo_path": "EPIC_extracted/EPIC-master/main/convert_data_reformatted_LWA_to_CDF.py", "type": "Python" }
import data_interface as DI LWA_reformatted_datafile_prefix = '/data3/t_nithyanandan/project_MOFF/data/samples/lwa_reformatted_data_test' LWA_pol0_reformatted_datafile = LWA_reformatted_datafile_prefix + '.pol-0.fits' LWA_pol1_reformatted_datafile = LWA_reformatted_datafile_prefix + '.pol-1.fits' filelist = [LWA_pol0...
epic-astronomyREPO_NAMEEPICPATH_START.@EPIC_extracted@EPIC-master@main@convert_data_reformatted_LWA_to_CDF.py@.PATH_END.py
{ "filename": "java-reference_catboostpredictions__copyobjectpredictionsobjectindexpredictions__desc.md", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage-java/java-reference_catboostpredictions__copyobjectpredictionsobjectindexpredicti...
Copy the prediction for the specified object to the specified array.
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage-java@java-reference_catboostpredictions__copyobjectpredictionsobjectindexpredictions__desc.md@.PATH_END.py
{ "filename": "freeze_test.py", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/examples/speech_commands/freeze_test.py", "type": "Python" }
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@examples@speech_commands@freeze_test.py@.PATH_END.py
{ "filename": "simple-neural-network.md", "repo_name": "jax-ml/jax", "repo_path": "jax_extracted/jax-main/docs/_tutorials/simple-neural-network.md", "type": "Markdown" }
# Example: Writing a simple neural network <!--* freshness: { reviewed: '2024-05-03' } *--> ```{note} This is a placeholder for a section in the new {ref}`jax-tutorials-draft`. ```
jax-mlREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@docs@_tutorials@simple-neural-network.md@.PATH_END.py
{ "filename": "needlets.py", "repo_name": "javicarron/mtneedlet", "repo_path": "mtneedlet_extracted/mtneedlet-master/mtneedlet/needlets.py", "type": "Python" }
import healpy as hp import numpy as np import matplotlib.pyplot as plt import scipy.integrate as integrate def plot_bl(bl,newfigure=True,label=None): '''Plot the needlet filter b(l) in multipole space. Parameters ---------- bl : np.ndarray A numpy array containing the values of a needlet...
javicarronREPO_NAMEmtneedletPATH_START.@mtneedlet_extracted@mtneedlet-master@mtneedlet@needlets.py@.PATH_END.py
{ "filename": "AUTHORS.md", "repo_name": "joshspeagle/dynesty", "repo_path": "dynesty_extracted/dynesty-master/AUTHORS.md", "type": "Markdown" }
Authors: - [Josh Speagle](https://github.com/joshspeagle) - [Sergey Koposov](https://github.com/segasai) Contributors: - [Kyle Barbary](https://github.com/kbarbary/) - [Johannes Buchner](https://github.com/JohannesBuchner) - [Ben Cook](https://github.com/bacook17) - [James Guillochon](https://github.com/guillochon) ...
joshspeagleREPO_NAMEdynestyPATH_START.@dynesty_extracted@dynesty-master@AUTHORS.md@.PATH_END.py
{ "filename": "c-plus-plus-api_dynamic-c-pluplus-wrapper.md", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/catboost/docs/en/concepts/c-plus-plus-api_dynamic-c-pluplus-wrapper.md", "type": "Markdown" }
# Evaluation library This is the fastest way to evaluate a model. The library provides a [C API](#c-api) and a simple [C++ wrapper API](#c-plus-plus-wrapper). The C API interface can be accessed from any programming language. ## Download Prebuilt shared library artifacts are available. {% include [reusage-cli-relea...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@concepts@c-plus-plus-api_dynamic-c-pluplus-wrapper.md@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "veragluscevic/dmdd", "repo_path": "dmdd_extracted/dmdd-master/dmdd/tests/__init__.py", "type": "Python" }
veragluscevicREPO_NAMEdmddPATH_START.@dmdd_extracted@dmdd-master@dmdd@tests@__init__.py@.PATH_END.py
{ "filename": "_tickformat.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/cone/colorbar/_tickformat.py", "type": "Python" }
import _plotly_utils.basevalidators class TickformatValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="tickformat", parent_name="cone.colorbar", **kwargs): super(TickformatValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_n...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@cone@colorbar@_tickformat.py@.PATH_END.py
{ "filename": "pcaproj_dscovr.py", "repo_name": "HajimeKawahara/sot", "repo_path": "sot_extracted/sot-master/src/sot/nmfmap/pcaproj_dscovr.py", "type": "Python" }
# # PCA projection DISCOVR (in Kawahara 2020) # import io_surface_type import io_refdata import toymap import matplotlib.pyplot as plt import numpy as np import healpy as hp import matplotlib from sklearn.decomposition import PCA import sklearn.linear_model as lm import plotmap as pm import read_data def tik(lcall,W)...
HajimeKawaharaREPO_NAMEsotPATH_START.@sot_extracted@sot-master@src@sot@nmfmap@pcaproj_dscovr.py@.PATH_END.py
{ "filename": "energies_co2.py", "repo_name": "radis/radis", "repo_path": "radis_extracted/radis-master/radis/levels/energies_co2.py", "type": "Python" }
# -*- coding: utf-8 -*- """Functions specific to the calculation of CO2 energy levels. Notes ----- @dev: you can define Python functions here, with hardcoded spectroscopic coefficients. Or, you can use the spectroscopic coefficients given in ``radis/db/CO2`` under JSON format. In both cases, you will need to overwri...
radisREPO_NAMEradisPATH_START.@radis_extracted@radis-master@radis@levels@energies_co2.py@.PATH_END.py
{ "filename": "test_astro.py", "repo_name": "sherpa/sherpa", "repo_path": "sherpa_extracted/sherpa-main/sherpa/astro/tests/test_astro.py", "type": "Python" }
# # Copyright (C) 2007, 2015 - 2021, 2023, 2024 # Smithsonian Astrophysical Observatory # # # 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 o...
sherpaREPO_NAMEsherpaPATH_START.@sherpa_extracted@sherpa-main@sherpa@astro@tests@test_astro.py@.PATH_END.py
{ "filename": "test_msa_open.py", "repo_name": "spacetelescope/jwst", "repo_path": "jwst_extracted/jwst-main/jwst/msaflagopen/tests/test_msa_open.py", "type": "Python" }
import numpy as np from numpy.testing import assert_array_equal import os from stdatamodels.jwst.datamodels import ImageModel, dqflags from stdatamodels.jwst.transforms.models import Slit from jwst.assign_wcs import AssignWcsStep from jwst.msaflagopen.msaflag_open import ( boundingbox_to_indices, create_slitl...
spacetelescopeREPO_NAMEjwstPATH_START.@jwst_extracted@jwst-main@jwst@msaflagopen@tests@test_msa_open.py@.PATH_END.py
{ "filename": "MultiAnisotropyMaps.ipynb", "repo_name": "oliverphilcox/HADES", "repo_path": "HADES_extracted/HADES-master/hades/MultiAnisotropyMaps.ipynb", "type": "Jupyter Notebook" }
```python from hades import PowerMap ``` --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-2-f423a9d9fd9c> in <module>() ----> 1 from hades import PowerMap ImportError: No m...
oliverphilcoxREPO_NAMEHADESPATH_START.@HADES_extracted@HADES-master@hades@MultiAnisotropyMaps.ipynb@.PATH_END.py
{ "filename": "cl_ST.ipynb", "repo_name": "mcataneo/mochi_class_public", "repo_path": "mochi_class_public_extracted/mochi_class_public-main/notebooks/cl_ST.ipynb", "type": "Jupyter Notebook" }
```python # import necessary modules from classy import Class from math import pi ``` ```python ##################################################### # # Cosmological parameters and other CLASS parameters # ##################################################### common_settings = {# LambdaCDM parameters ...
mcataneoREPO_NAMEmochi_class_publicPATH_START.@mochi_class_public_extracted@mochi_class_public-main@notebooks@cl_ST.ipynb@.PATH_END.py
{ "filename": "test_compressed.py", "repo_name": "astropy/astropy", "repo_path": "astropy_extracted/astropy-main/astropy/io/fits/hdu/compressed/tests/test_compressed.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see PYFITS.rst import io import math import os import pickle import re import time from io import BytesIO from itertools import product import numpy as np import pytest from hypothesis import given from hypothesis.extra.numpy import basic_indices from numpy.testing impo...
astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@io@fits@hdu@compressed@tests@test_compressed.py@.PATH_END.py
{ "filename": "test_params.py", "repo_name": "dtamayo/reboundx", "repo_path": "reboundx_extracted/reboundx-main/reboundx/test/test_params.py", "type": "Python" }
import rebound import reboundx from reboundx import data import unittest import math import numpy as np from ctypes import c_uint, c_uint8, c_uint32, c_uint64 def mycomp(obj1, obj2): if type(obj1) != type(obj2): return False for attr in [attr for attr in dir(obj1) if not attr.startswith('_')]: ...
dtamayoREPO_NAMEreboundxPATH_START.@reboundx_extracted@reboundx-main@reboundx@test@test_params.py@.PATH_END.py
{ "filename": "gridconfig.py", "repo_name": "ggalloni/cobaya", "repo_path": "cobaya_extracted/cobaya-master/cobaya/grid_tools/gridconfig.py", "type": "Python" }
""" .. module:: cobaya.grid_tools.gridconfig :Synopsis: Grid creator (Cobaya version) :Author: Antony Lewis and Jesus Torrado (based on Antony Lewis' CosmoMC version of the same code) """ # Global import os import argparse import importlib.util from itertools import chain from getdist.inifile import IniFile...
ggalloniREPO_NAMEcobayaPATH_START.@cobaya_extracted@cobaya-master@cobaya@grid_tools@gridconfig.py@.PATH_END.py
{ "filename": "bageldb.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/vectorstores/bageldb.py", "type": "Python" }
from typing import TYPE_CHECKING, Any from langchain._api import create_importer if TYPE_CHECKING: from langchain_community.vectorstores import Bagel # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optional imports. DEPRECATED_...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@vectorstores@bageldb.py@.PATH_END.py
{ "filename": "_size.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter3d/marker/colorbar/title/font/_size.py", "type": "Python" }
import _plotly_utils.basevalidators class SizeValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="size", parent_name="scatter3d.marker.colorbar.title.font", **kwargs, ): super(SizeValidator, self).__init__( plotly_name=p...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter3d@marker@colorbar@title@font@_size.py@.PATH_END.py
{ "filename": "nessai.py", "repo_name": "gwastro/pycbc", "repo_path": "pycbc_extracted/pycbc-master/pycbc/inference/io/nessai.py", "type": "Python" }
"""Provides IO for the nessai sampler""" import numpy from .base_nested_sampler import BaseNestedSamplerFile from .posterior import read_raw_samples_from_file from .dynesty import CommonNestedMetadataIO class NessaiFile(CommonNestedMetadataIO, BaseNestedSamplerFile): """Class to handle file IO for the ``nessai`...
gwastroREPO_NAMEpycbcPATH_START.@pycbc_extracted@pycbc-master@pycbc@inference@io@nessai.py@.PATH_END.py
{ "filename": "Jpeg2KImagePlugin.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/Pillow/py2/PIL/Jpeg2KImagePlugin.py", "type": "Python" }
# # The Python Imaging Library # $Id$ # # JPEG2000 file handling # # History: # 2014-03-12 ajh Created # # Copyright (c) 2014 Coriolis Systems Limited # Copyright (c) 2014 Alastair Houghton # # See the README file for information on usage and redistribution. # import io import os import struct from . import Image, Im...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@Pillow@py2@PIL@Jpeg2KImagePlugin.py@.PATH_END.py
{ "filename": "starlets.py", "repo_name": "lenstronomy/lenstronomy", "repo_path": "lenstronomy_extracted/lenstronomy-main/lenstronomy/LightModel/Profiles/starlets.py", "type": "Python" }
__author__ = "aymgal" import numpy as np import warnings from lenstronomy.LightModel.Profiles import starlets_util from lenstronomy.LightModel.Profiles.interpolation import Interpol from lenstronomy.Util import util __all__ = ["SLIT_Starlets"] class SLIT_Starlets(object): """Decomposition of an image using the...
lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@lenstronomy@LightModel@Profiles@starlets.py@.PATH_END.py
{ "filename": "_colorsrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/table/header/line/_colorsrc.py", "type": "Python" }
import _plotly_utils.basevalidators class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="colorsrc", parent_name="table.header.line", **kwargs ): super(ColorsrcValidator, self).__init__( plotly_name=plotly_name, parent_name...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@table@header@line@_colorsrc.py@.PATH_END.py
{ "filename": "_marker.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/scattercarpet/_marker.py", "type": "Python" }
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Marker(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "scattercarpet" _path_str = "scattercarpet.marker" _valid_props = { "autocolorscale",...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@scattercarpet@_marker.py@.PATH_END.py
{ "filename": "imbalanced-datasets-description.md", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage/imbalanced-datasets-description.md", "type": "Markdown" }
For imbalanced datasets with binary classification the weight multiplier can be set to 1 for class 0 and to $\left(\frac{sum\_negative}{sum\_positive}\right)$ for class 1.
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage@imbalanced-datasets-description.md@.PATH_END.py
{ "filename": "_color.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/treemap/pathbar/textfont/_color.py", "type": "Python" }
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="treemap.pathbar.textfont", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@treemap@pathbar@textfont@_color.py@.PATH_END.py
{ "filename": "SYGMA_BUGS.ipynb", "repo_name": "NuGrid/NuPyCEE", "repo_path": "NuPyCEE_extracted/NuPyCEE-master/regression_tests/temp/SYGMA_BUGS.ipynb", "type": "Jupyter Notebook" }
# BUG report To keep track of bugs we report them here so that they can be reproduced easily. Additionally, as soon as they are fixed they should disappear in this notebook. To each bug report add time and your name. Add new bugs at the end of the file. ```python %pylab nbagg import sygma as s reload(s) s.__file__ `...
NuGridREPO_NAMENuPyCEEPATH_START.@NuPyCEE_extracted@NuPyCEE-master@regression_tests@temp@SYGMA_BUGS.ipynb@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "triton-inference-server/server", "repo_path": "server_extracted/server-main/python/openai/openai_frontend/frontend/__init__.py", "type": "Python" }
# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions a...
triton-inference-serverREPO_NAMEserverPATH_START.@server_extracted@server-main@python@openai@openai_frontend@frontend@__init__.py@.PATH_END.py
{ "filename": "_tickfont.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/carpet/baxis/_tickfont.py", "type": "Python" }
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Tickfont(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "carpet.baxis" _path_str = "carpet.baxis.tickfont" _valid_props = {"color", "family", "size...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@carpet@baxis@_tickfont.py@.PATH_END.py
{ "filename": "plot_opacity.py", "repo_name": "dullemond/radmc3d-2.0", "repo_path": "radmc3d-2.0_extracted/radmc3d-2.0-master/examples/run_ppdisk_analytic_1/plot_opacity.py", "type": "Python" }
import numpy as np from matplotlib import pyplot as plt from radmc3dPy.analyze import * from radmc3dPy.natconst import * # # Plot the opacity table # o = readOpac(ext='silicate') plt.figure() plt.loglog(o.wav[0],o.kabs[0],label=r'$\kappa_\nu^{\mathrm{abs}}$ (absorption)') plt.loglog(o.wav[0],o.ksca[0],':',label=r'$...
dullemondREPO_NAMEradmc3d-2.0PATH_START.@radmc3d-2.0_extracted@radmc3d-2.0-master@examples@run_ppdisk_analytic_1@plot_opacity.py@.PATH_END.py
{ "filename": "README.md", "repo_name": "njcuk9999/apero-drs", "repo_path": "apero-drs_extracted/apero-drs-main/data_example/raw/README.md", "type": "Markdown" }
# Raw data folder Raw file should be placed here within a sub-folder consisting of (at least) the date of observation. i.e. - /data/raw/ - /data/raw/20180925/ - /data/raw/20180925/raw_fits_file1.fits - /data/raw/20180925/raw_fits_file2.fits - /data/raw/20180925/raw_fits_file3.fits These paths can be changed in ``...
njcuk9999REPO_NAMEapero-drsPATH_START.@apero-drs_extracted@apero-drs-main@data_example@raw@README.md@.PATH_END.py
{ "filename": "ffs_ninv_filt.py", "repo_name": "carronj/LensIt", "repo_path": "LensIt_extracted/LensIt-master/lensit/qcinv/ffs_ninv_filt.py", "type": "Python" }
from __future__ import print_function import numpy as np from lensit.qcinv import template_removal from lensit.ffs_deflect import ffs_deflect from lensit.misc.misc_utils import cls_hash, npy_hash from lensit.ffs_covs import ffs_specmat, ell_mat from lensit.misc.rfft2_utils import degrade_mask load_map = lambda _map:...
carronjREPO_NAMELensItPATH_START.@LensIt_extracted@LensIt-master@lensit@qcinv@ffs_ninv_filt.py@.PATH_END.py
{ "filename": "test.py", "repo_name": "atomec-project/atoMEC", "repo_path": "atoMEC_extracted/atoMEC-master/tests/dev_tests/test.py", "type": "Python" }
"""Test template file for atoMEC.""" from atoMEC import Atom, models, config, mathtools, unitconv from atoMEC.postprocess import pressure import json import time st_time = time.time() config.numcores = -1 # load input params and set up the atom and model objects with open("input.json", "r") as f: input = json.l...
atomec-projectREPO_NAMEatoMECPATH_START.@atoMEC_extracted@atoMEC-master@tests@dev_tests@test.py@.PATH_END.py
{ "filename": "test_helper.py", "repo_name": "rmjarvis/TreeCorr", "repo_path": "TreeCorr_extracted/TreeCorr-main/tests/test_helper.py", "type": "Python" }
# Copyright (c) 2003-2024 by Mike Jarvis # # TreeCorr is free software: redistribution and use in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of condi...
rmjarvisREPO_NAMETreeCorrPATH_START.@TreeCorr_extracted@TreeCorr-main@tests@test_helper.py@.PATH_END.py
{ "filename": "kepler.py", "repo_name": "sblunt/orbitize", "repo_path": "orbitize_extracted/orbitize-main/orbitize/kepler.py", "type": "Python" }
""" This module solves for the orbit of the planet given Keplerian parameters. """ import numpy as np import astropy.units as u import astropy.constants as consts from orbitize import cuda_ext, cext if cext: from . import _kepler if cuda_ext: # Configure GPU context for CUDA accelerated compute from orbi...
sbluntREPO_NAMEorbitizePATH_START.@orbitize_extracted@orbitize-main@orbitize@kepler.py@.PATH_END.py
{ "filename": "modified_power_spectrum_multipoles.ipynb", "repo_name": "MikeSWang/HorizonGRound", "repo_path": "HorizonGRound_extracted/HorizonGRound-master/docs/source/tutorials/modified_power_spectrum_multipoles.ipynb", "type": "Jupyter Notebook" }
# Modified Power Spectrum Multipoles In this tutorial, we show how you can calculate the power spectrum multipole modifications due to primordial non-Gaussianity (PNG) $f_\textrm{NL}$ and relativistic effects the ``clustering_modification`` module. The fiducial cosmology is Planck15, and we set the fiducial redshift $...
MikeSWangREPO_NAMEHorizonGRoundPATH_START.@HorizonGRound_extracted@HorizonGRound-master@docs@source@tutorials@modified_power_spectrum_multipoles.ipynb@.PATH_END.py
{ "filename": "test_utils.py", "repo_name": "PetroFit/petrofit", "repo_path": "petrofit_extracted/petrofit-main/petrofit/tests/test_utils.py", "type": "Python" }
import os import numpy as np import pytest from scipy.interpolate import interp1d from astropy.io import fits from astropy.wcs import WCS from astropy import units as u import petrofit as pf def test_natural_sort(): test_list = ["item10", "item2", "item1a", "item1b", "item"] sorted_list = pf.natural_sort(...
PetroFitREPO_NAMEpetrofitPATH_START.@petrofit_extracted@petrofit-main@petrofit@tests@test_utils.py@.PATH_END.py
{ "filename": "v4-migration.md", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/doc/python/v4-migration.md", "type": "Markdown" }
--- jupyter: jupytext: notebook_metadata_filter: all text_representation: extension: .md format_name: markdown format_version: '1.1' jupytext_version: 1.1.1 kernelspec: display_name: Python 3 language: python name: python3 language_info: codemirror_mode: name:...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@doc@python@v4-migration.md@.PATH_END.py
{ "filename": "fit.py", "repo_name": "IvS-KULeuven/IvSPythonRepository", "repo_path": "IvSPythonRepository_extracted/IvSPythonRepository-master/sed/fit.py", "type": "Python" }
# -*- coding: utf-8 -*- """ Fit SED models to observed data using various approaches. """ import logging import sys import astropy.io.fits as pf import itertools import re import copy import numpy as np from numpy import inf import scipy from scipy.interpolate import Rbf from scipy.optimize import fmin,fmin_powell fro...
IvS-KULeuvenREPO_NAMEIvSPythonRepositoryPATH_START.@IvSPythonRepository_extracted@IvSPythonRepository-master@sed@fit.py@.PATH_END.py
{ "filename": "_lightposition.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/cone/_lightposition.py", "type": "Python" }
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Lightposition(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "cone" _path_str = "cone.lightposition" _valid_props = {"x", "y", "z"} # x # ...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@cone@_lightposition.py@.PATH_END.py