metadata
dict
text
stringlengths
0
40.6M
id
stringlengths
14
255
{ "filename": "vars_test.py", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/distribute/vars_test.py", "type": "Python" }
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@distribute@vars_test.py@.PATH_END.py
{ "filename": "gp.py", "repo_name": "pymc-devs/pymc", "repo_path": "pymc_extracted/pymc-main/pymc/gp/gp.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@gp@gp.py@.PATH_END.py
{ "filename": "get_lds_with_errors_v1.py", "repo_name": "delinea/LDCU", "repo_path": "LDCU_extracted/LDCU-main/get_lds_with_errors_v1.py", "type": "Python" }
import os import numpy as np import matplotlib.pyplot as plt import tqdm from uncertainties import ufloat from scipy.special import erf from scipy.optimize import root_scalar import get_lds as lds def cdf_minus_quantile(x, q, distribs, weights): cdf = 0 for d, w in zip(distribs, weights): cdf += .5*(1...
delineaREPO_NAMELDCUPATH_START.@LDCU_extracted@LDCU-main@get_lds_with_errors_v1.py@.PATH_END.py
{ "filename": "build.py", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/third_party/xla/build_tools/ci/build.py", "type": "Python" }
#!/usr/bin/python3 # Copyright 2024 The OpenXLA 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 l...
tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@third_party@xla@build_tools@ci@build.py@.PATH_END.py
{ "filename": "projection.py", "repo_name": "KeplerGO/K2fov", "repo_path": "K2fov_extracted/K2fov-master/K2fov/projection.py", "type": "Python" }
"""This file defines the projection classes.""" try: import matplotlib.pyplot as mp except Exception: pass import numpy as np from . import rotate class Projection(): """Base Projection class. Used for mapping ra and dec into Euclidean space based on a given projection. The primary reference for...
KeplerGOREPO_NAMEK2fovPATH_START.@K2fov_extracted@K2fov-master@K2fov@projection.py@.PATH_END.py
{ "filename": "covariance_matrices.py", "repo_name": "nathanchara/l1periodogram", "repo_path": "l1periodogram_extracted/l1periodogram-master/l1periodogram_codes/covariance_matrices.py", "type": "Python" }
# -*- coding: utf-8 -*- # Copyright 2020 Nathan Hara # # This file is part of the l1periodogram code. # # rvmodel 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...
nathancharaREPO_NAMEl1periodogramPATH_START.@l1periodogram_extracted@l1periodogram-master@l1periodogram_codes@covariance_matrices.py@.PATH_END.py
{ "filename": "scann.ipynb", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/vectorstores/scann.ipynb", "type": "Jupyter Notebook" }
# ScaNN ScaNN (Scalable Nearest Neighbors) is a method for efficient vector similarity search at scale. ScaNN includes search space pruning and quantization for Maximum Inner Product Search and also supports other distance functions such as Euclidean distance. The implementation is optimized for x86 processors with A...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@vectorstores@scann.ipynb@.PATH_END.py
{ "filename": "_variant.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/barpolar/legendgrouptitle/font/_variant.py", "type": "Python" }
import _plotly_utils.basevalidators class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="variant", parent_name="barpolar.legendgrouptitle.font", **kwargs, ): super(VariantValidator, self).__init__( plotly...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@barpolar@legendgrouptitle@font@_variant.py@.PATH_END.py
{ "filename": "Mspectrum.py", "repo_name": "chianti-atomic/ChiantiPy", "repo_path": "ChiantiPy_extracted/ChiantiPy-master/ChiantiPy/core/Mspectrum.py", "type": "Python" }
from datetime import datetime import copy import multiprocessing as mp import numpy as np import ChiantiPy.tools.data as chdata import ChiantiPy.tools.util as util import ChiantiPy.tools.filters as chfilters import ChiantiPy.tools.io as chio from ChiantiPy.base import ionTrails from ChiantiPy.base import specTrails i...
chianti-atomicREPO_NAMEChiantiPyPATH_START.@ChiantiPy_extracted@ChiantiPy-master@ChiantiPy@core@Mspectrum.py@.PATH_END.py
{ "filename": "test_filter_core.py", "repo_name": "lsst-uk/lasair-lsst", "repo_path": "lasair-lsst_extracted/lasair-lsst-main/tests/unit/pipeline/filter/test_filter_core.py", "type": "Python" }
import unittest, unittest.mock from unittest.mock import patch import psutil import context from filtercore import Filter import re class FilterTest(unittest.TestCase): def test_sigterm_handler(self): """Test that the sigterm handler sets sigterm raised correctly""" fltr = Filter(group_id='filte...
lsst-ukREPO_NAMElasair-lsstPATH_START.@lasair-lsst_extracted@lasair-lsst-main@tests@unit@pipeline@filter@test_filter_core.py@.PATH_END.py
{ "filename": "hover.py", "repo_name": "NannyML/nannyml", "repo_path": "nannyml_extracted/nannyml-main/nannyml/plots/components/hover.py", "type": "Python" }
# Author: Niels Nuyttens <niels@nannyml.com> # # # License: Apache Software License 2.0 # Author: Niels Nuyttens <niels@nannyml.com> # # License: Apache Software License 2.0 import re from typing import Callable, List, Optional, Union import numpy as np import pandas as pd from nannyml.exceptions import I...
NannyMLREPO_NAMEnannymlPATH_START.@nannyml_extracted@nannyml-main@nannyml@plots@components@hover.py@.PATH_END.py
{ "filename": "orig_test_dmg_mc.py", "repo_name": "FRBs/zdm", "repo_path": "zdm_extracted/zdm-main/zdm/orig_tests/orig_test_dmg_mc.py", "type": "Python" }
""" Examines the effect of handling of Galactic DM Uses Monte Carlo data for ICS generated for DM_MW = 0,100,200,500 pc/cm3 (generate using ics_dmg_mc.py) Runs agaist H0 Also outputs component likelihoods (p(z,DM),p(z|DM), etc) Plots results. """ import pytest from zdm import io from zdm.craco import loading...
FRBsREPO_NAMEzdmPATH_START.@zdm_extracted@zdm-main@zdm@orig_tests@orig_test_dmg_mc.py@.PATH_END.py
{ "filename": "simulationvariables.md", "repo_name": "hannorein/REBOUND", "repo_path": "REBOUND_extracted/REBOUND-main/docs/simulationvariables.md", "type": "Markdown" }
# Variables The following example shows how to access variables in the simulation structure. === "C" ```c struct reb_simulation* r = reb_simulation_create(); r->G = 1.0; // Set the gravitational constant printf("%f\n", r->t); // print current simulation time ``` === "Python" ```...
hannoreinREPO_NAMEREBOUNDPATH_START.@REBOUND_extracted@REBOUND-main@docs@simulationvariables.md@.PATH_END.py
{ "filename": "model2vec.ipynb", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/text_embedding/model2vec.ipynb", "type": "Jupyter Notebook" }
## Overview Model2Vec is a technique to turn any sentence transformer into a really small static model [model2vec](https://github.com/MinishLab/model2vec) can be used to generate embeddings. ## Setup ```bash pip install -U langchain-community ``` ## Instantiation Ensure that `model2vec` is installed ```bash pip ...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@text_embedding@model2vec.ipynb@.PATH_END.py
{ "filename": "test_cylindrical_coordinates.py", "repo_name": "yt-project/yt", "repo_path": "yt_extracted/yt-main/yt/geometry/coordinates/tests/test_cylindrical_coordinates.py", "type": "Python" }
# Some tests for the Cylindrical coordinates handler import numpy as np from numpy.testing import assert_almost_equal, assert_equal from yt.testing import fake_amr_ds # Our canonical tests are that we can access all of our fields and we can # compute our volume correctly. def test_cylindrical_coordinates(): # ...
yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@geometry@coordinates@tests@test_cylindrical_coordinates.py@.PATH_END.py
{ "filename": "_opacity.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/histogram/selected/marker/_opacity.py", "type": "Python" }
import _plotly_utils.basevalidators class OpacityValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="opacity", parent_name="histogram.selected.marker", **kwargs ): super(OpacityValidator, self).__init__( plotly_name=plotly_name, par...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@histogram@selected@marker@_opacity.py@.PATH_END.py
{ "filename": "feature_request.md", "repo_name": "spacetelescope/synphot_refactor", "repo_path": "synphot_refactor_extracted/synphot_refactor-master/.github/ISSUE_TEMPLATE/feature_request.md", "type": "Markdown" }
--- name: Feature request about: Suggest an idea to improve synphot label: 'Feature Request' --- <!-- This comments are hidden when you submit the issue, so you do not need to remove them! --> <!-- Please be sure to check out our code of conduct, https://github.com/spacetelescope/synphot_refactor/blob/master/CODE_OF_...
spacetelescopeREPO_NAMEsynphot_refactorPATH_START.@synphot_refactor_extracted@synphot_refactor-master@.github@ISSUE_TEMPLATE@feature_request.md@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "DifferentiableUniverseInitiative/sbi_lens", "repo_path": "sbi_lens_extracted/sbi_lens-main/sbi_lens/normflow/bijectors/__init__.py", "type": "Python" }
from sbi_lens.normflow.bijectors.bijectors import MixtureAffineSigmoidBijector
DifferentiableUniverseInitiativeREPO_NAMEsbi_lensPATH_START.@sbi_lens_extracted@sbi_lens-main@sbi_lens@normflow@bijectors@__init__.py@.PATH_END.py
{ "filename": "setup.py", "repo_name": "sdss/cluplus", "repo_path": "cluplus_extracted/cluplus-main/setup.py", "type": "Python" }
from email.utils import getaddresses import toml from setuptools import find_packages, setup module = toml.load("pyproject.toml") module_tool_poetry = module["tool"]["poetry"] module_name = module_tool_poetry["name"] module_package_from = module_tool_poetry["packages"][0]["from"] module_package_include = module_to...
sdssREPO_NAMEcluplusPATH_START.@cluplus_extracted@cluplus-main@setup.py@.PATH_END.py
{ "filename": "_autocolorscale.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterpolargl/marker/_autocolorscale.py", "type": "Python" }
import _plotly_utils.basevalidators class AutocolorscaleValidator(_plotly_utils.basevalidators.BooleanValidator): def __init__( self, plotly_name="autocolorscale", parent_name="scatterpolargl.marker", **kwargs, ): super(AutocolorscaleValidator, self).__init__( ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterpolargl@marker@_autocolorscale.py@.PATH_END.py
{ "filename": "units.py", "repo_name": "nu-radio/NuRadioMC", "repo_path": "NuRadioMC_extracted/NuRadioMC-master/NuRadioReco/utilities/units.py", "type": "Python" }
""" standard system of units =================================== You should use the units defined in this file whenever you have a dimensional quantity in your code. For example, write: ``s = 1.5 * units.km`` instead of: ``s = 1.5 # don't forget this is in km!`` The conversion factors defined in this fi...
nu-radioREPO_NAMENuRadioMCPATH_START.@NuRadioMC_extracted@NuRadioMC-master@NuRadioReco@utilities@units.py@.PATH_END.py
{ "filename": "test_multispectra.py", "repo_name": "LSSTDESC/Spectractor", "repo_path": "Spectractor_extracted/Spectractor-master/tests/test_multispectra.py", "type": "Python" }
import matplotlib as mpl mpl.use('Agg') # must be run first! But therefore requires noqa E402 on all other imports from spectractor.fit.fit_multispectra import _build_test_sample, MultiSpectraFitWorkspace, run_multispectra_minimisation # noqa: E402 from spectractor import parameters # noqa: E402 from spectractor.to...
LSSTDESCREPO_NAMESpectractorPATH_START.@Spectractor_extracted@Spectractor-master@tests@test_multispectra.py@.PATH_END.py
{ "filename": "RandomSampling.py", "repo_name": "igomezv/neuralike", "repo_path": "neuralike_extracted/neuralike-main/neuralike/RandomSampling.py", "type": "Python" }
import os import numpy as np import time class RandomSampling: def __init__(self, like_fn, samples, means, mins, maxs, nrand=10, files_path='randomsampling'): """ Create a random samples in the parameter space and evaluate the likelihood in them. This is used to generate the training set f...
igomezvREPO_NAMEneuralikePATH_START.@neuralike_extracted@neuralike-main@neuralike@RandomSampling.py@.PATH_END.py
{ "filename": "test_proxqp.py", "repo_name": "stephane-caron/qpsolvers", "repo_path": "qpsolvers_extracted/qpsolvers-main/tests/test_proxqp.py", "type": "Python" }
#!/usr/bin/env python # -*- coding: utf-8 -*- # # SPDX-License-Identifier: LGPL-3.0-or-later # Copyright 2016-2022 Stéphane Caron and the qpsolvers contributors """Unit tests for ProxQP.""" import unittest import warnings from qpsolvers.exceptions import ParamError, ProblemError from .problems import get_sd3310_pro...
stephane-caronREPO_NAMEqpsolversPATH_START.@qpsolvers_extracted@qpsolvers-main@tests@test_proxqp.py@.PATH_END.py
{ "filename": "_ticklabelstep.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/heatmapgl/colorbar/_ticklabelstep.py", "type": "Python" }
import _plotly_utils.basevalidators class TicklabelstepValidator(_plotly_utils.basevalidators.IntegerValidator): def __init__( self, plotly_name="ticklabelstep", parent_name="heatmapgl.colorbar", **kwargs ): super(TicklabelstepValidator, self).__init__( plotly_name=plotly_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@heatmapgl@colorbar@_ticklabelstep.py@.PATH_END.py
{ "filename": "ensemble_test.py", "repo_name": "triton-inference-server/server", "repo_path": "server_extracted/server-main/qa/L0_backend_python/ensemble/ensemble_test.py", "type": "Python" }
#!/usr/bin/env python3 # Copyright 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright ...
triton-inference-serverREPO_NAMEserverPATH_START.@server_extracted@server-main@qa@L0_backend_python@ensemble@ensemble_test.py@.PATH_END.py
{ "filename": "test_from_cupy.py", "repo_name": "dmlc/xgboost", "repo_path": "xgboost_extracted/xgboost-master/tests/python-gpu/test_from_cupy.py", "type": "Python" }
import json import numpy as np import pytest import xgboost as xgb from xgboost import testing as tm from xgboost.testing.data import run_base_margin_info cp = pytest.importorskip("cupy") def test_array_interface() -> None: arr = cp.array([[1, 2, 3, 4], [1, 2, 3, 4]]) i_arr = arr.__cuda_array_interface__ ...
dmlcREPO_NAMExgboostPATH_START.@xgboost_extracted@xgboost-master@tests@python-gpu@test_from_cupy.py@.PATH_END.py
{ "filename": "neural_autoregressive.py", "repo_name": "pyro-ppl/pyro", "repo_path": "pyro_extracted/pyro-master/pyro/distributions/transforms/neural_autoregressive.py", "type": "Python" }
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 from functools import partial import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions.transforms import SigmoidTransform, TanhTransform from pyro.nn import AutoRegressiveNN, ConditionalAutoRegr...
pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@pyro@distributions@transforms@neural_autoregressive.py@.PATH_END.py
{ "filename": "_namelengthsrc.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/sunburst/hoverlabel/_namelengthsrc.py", "type": "Python" }
import _plotly_utils.basevalidators class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="namelengthsrc", parent_name="sunburst.hoverlabel", **kwargs ): super(NamelengthsrcValidator, self).__init__( plotly_name=plotly_name, ...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@sunburst@hoverlabel@_namelengthsrc.py@.PATH_END.py
{ "filename": "plot_tools.py", "repo_name": "LucIJspeert/eclipsr", "repo_path": "eclipsr_extracted/eclipsr-master/eclipsr/plot_tools.py", "type": "Python" }
"""ECLIPSR This module contains functions to make (diagnostic) plots for various stages of the eclipse finding. Code written by: Luc IJspeert """ import numpy as np import matplotlib.pyplot as plt from . import eclipse_finding as ecf from . import utility as ut def rescale_tess_dplot(times, signal, signal_copy, a...
LucIJspeertREPO_NAMEeclipsrPATH_START.@eclipsr_extracted@eclipsr-master@eclipsr@plot_tools.py@.PATH_END.py
{ "filename": "_ticklen.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/yaxis/minor/_ticklen.py", "type": "Python" }
import _plotly_utils.basevalidators class TicklenValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="ticklen", parent_name="layout.yaxis.minor", **kwargs ): super(TicklenValidator, self).__init__( plotly_name=plotly_name, parent_nam...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@yaxis@minor@_ticklen.py@.PATH_END.py
{ "filename": "test_utils.py", "repo_name": "spacetelescope/astrocut", "repo_path": "astrocut_extracted/astrocut-main/astrocut/tests/test_utils.py", "type": "Python" }
import numpy as np from astropy.io import fits from astropy import wcs from astropy.coordinates import SkyCoord from astropy import units as u from astropy.utils.data import get_pkg_data_filename import pytest from astrocut.exceptions import InputWarning, InvalidQueryError from ..utils import utils # Example FFI W...
spacetelescopeREPO_NAMEastrocutPATH_START.@astrocut_extracted@astrocut-main@astrocut@tests@test_utils.py@.PATH_END.py
{ "filename": "README.md", "repo_name": "crislong/DySc", "repo_path": "DySc_extracted/DySc-main/README.md", "type": "Markdown" }
# DySc Dynamical Scale : Python package to measure protoplanetary discs mass through the rotation curve
crislongREPO_NAMEDyScPATH_START.@DySc_extracted@DySc-main@README.md@.PATH_END.py
{ "filename": "ioloop.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/pyzmq/py2/zmq/green/eventloop/ioloop.py", "type": "Python" }
from zmq.eventloop.ioloop import *
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@pyzmq@py2@zmq@green@eventloop@ioloop.py@.PATH_END.py
{ "filename": "nestor_transit_fitting.py", "repo_name": "afeinstein20/nirhiss", "repo_path": "nirhiss_extracted/nirhiss-main/src/nirhiss/nestor_transit_fitting.py", "type": "Python" }
# taken from nespinoza/transitspectroscopy # https://github.com/nespinoza/transitspectroscopy/blob/dev/src/transitfitting.py import os import numpy as np import juliet try: import ray except: print('Could not import the "ray" library. If you want to parallelize \ lightcurve fitting, please install b...
afeinstein20REPO_NAMEnirhissPATH_START.@nirhiss_extracted@nirhiss-main@src@nirhiss@nestor_transit_fitting.py@.PATH_END.py
{ "filename": "_hovertemplate.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/isosurface/_hovertemplate.py", "type": "Python" }
import _plotly_utils.basevalidators class HovertemplateValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="hovertemplate", parent_name="isosurface", **kwargs): super(HovertemplateValidator, self).__init__( plotly_name=plotly_name, parent_name=pa...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@isosurface@_hovertemplate.py@.PATH_END.py
{ "filename": "SoniScope.ipynb", "repo_name": "fhstp/soniscope-jupyter", "repo_path": "soniscope-jupyter_extracted/soniscope-jupyter-main/examples/SoniScope.ipynb", "type": "Jupyter Notebook" }
# SoniScope Prototype ```python # pip install sc3nb soniscope_jupyter ``` ```python import numpy as np import pandas as pd import sc3nb as scn from sc3nb import SynthDef, Synth import time import math import ipywidgets as widgets from ipywidgets import interactive, interact from ipywidgets import HBox, Label, L...
fhstpREPO_NAMEsoniscope-jupyterPATH_START.@soniscope-jupyter_extracted@soniscope-jupyter-main@examples@SoniScope.ipynb@.PATH_END.py
{ "filename": "21CMMC.py", "repo_name": "BradGreig/21CMMC", "repo_path": "21CMMC_extracted/21CMMC-master/21CMMC_SourceCode/Programs/21CMMC.py", "type": "Python" }
import os import numpy import math from scipy import interpolate from decimal import * import string import pickle import time TWOPLACES = Decimal(10) ** -2 # same as Decimal('0.01') FOURPLACES = Decimal(10) ** -4 # same as Decimal('0.0001') SIXPLACES = Decimal(10) ** -6 # same as Decimal('0.000001')...
BradGreigREPO_NAME21CMMCPATH_START.@21CMMC_extracted@21CMMC-master@21CMMC_SourceCode@Programs@21CMMC.py@.PATH_END.py
{ "filename": "after_eruption.py", "repo_name": "DTsuna/CHIPS", "repo_path": "CHIPS_extracted/CHIPS-master/after_eruption.py", "type": "Python" }
from optparse import OptionParser import subprocess # our modules from utils import utils from input.TOPS import gen_op_tbl from input.TOPS_multigroup import gen_op_frq import lightcurve def parse_command_line(): parser = OptionParser( description = '''Execution script. e.g.,\n python run.py --Eej 1e51 --stell...
DTsunaREPO_NAMECHIPSPATH_START.@CHIPS_extracted@CHIPS-master@after_eruption.py@.PATH_END.py
{ "filename": "_gradient.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattergeo/marker/_gradient.py", "type": "Python" }
import _plotly_utils.basevalidators class GradientValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__( self, plotly_name="gradient", parent_name="scattergeo.marker", **kwargs ): super(GradientValidator, self).__init__( plotly_name=plotly_name, parent...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattergeo@marker@_gradient.py@.PATH_END.py
{ "filename": "create_hpx_list.py", "repo_name": "LSSTDESC/lsstdesc-diffsky", "repo_path": "lsstdesc-diffsky_extracted/lsstdesc-diffsky-main/scripts/mock_production/create_hpx_list.py", "type": "Python" }
import sys import glob import os import re import argparse import numpy as np hpxdir = '/gpfs/mira-fs0/projects/DarkUniverse_esp/kovacs/OR_5000/auxiliary_files' hpx_template = 'healpix_cutouts/z_{}_{}/cutout_*.hdf5' hpxfiles = 'hpx_z_{}_{}.txt' file_template = 'pixels_{}_{}.txt' hpxfiles_all = 'hpx_z_{}.txt' size_min ...
LSSTDESCREPO_NAMElsstdesc-diffskyPATH_START.@lsstdesc-diffsky_extracted@lsstdesc-diffsky-main@scripts@mock_production@create_hpx_list.py@.PATH_END.py
{ "filename": "eigen.py", "repo_name": "rychallener/ThERESA", "repo_path": "ThERESA_extracted/ThERESA-master/theresa/lib/eigen.py", "type": "Python" }
import numpy as np import pca import time import utils import starry import theano import theano.tensor as tt import scipy.constants as sc def mkcurves(system, t, lmax, y00, ncurves=None, method='pca'): """ Generates light curves from a star+planet system at times t, for positive and negative spherical har...
rychallenerREPO_NAMEThERESAPATH_START.@ThERESA_extracted@ThERESA-master@theresa@lib@eigen.py@.PATH_END.py
{ "filename": "_value.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/yaxis/tickformatstop/_value.py", "type": "Python" }
import _plotly_utils.basevalidators class ValueValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="value", parent_name="layout.yaxis.tickformatstop", **kwargs ): super(ValueValidator, self).__init__( plotly_name=plotly_name, parent_...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@yaxis@tickformatstop@_value.py@.PATH_END.py
{ "filename": "downstream_status.md", "repo_name": "hgrecco/pint", "repo_path": "pint_extracted/pint-master/downstream_status.md", "type": "Markdown" }
In Pint, we work hard to avoid breaking projects that depend on us. If you are the maintainer of one of such projects, you can help us get ahead of problems in simple way. Pint will publish a release candidate (rc) at least a week before each new version. By default, `pip` does not install these versions unless a [pre...
hgreccoREPO_NAMEpintPATH_START.@pint_extracted@pint-master@downstream_status.md@.PATH_END.py
{ "filename": "analysis.ipynb", "repo_name": "tanner-trickle/EXCEED-DM", "repo_path": "EXCEED-DM_extracted/EXCEED-DM-main/examples/6/analysis.ipynb", "type": "Jupyter Notebook" }
# Example 6 Analysis We will plot the absorption rate as a function of mass, as well as the reach on $g_{aee}$ ## Packages ```python import numpy as np # some personal preferences for nice plots %run "../../utilities/output_parser/plotter.ipynb" # helpful functions for processing output import sys sys.path.append...
tanner-trickleREPO_NAMEEXCEED-DMPATH_START.@EXCEED-DM_extracted@EXCEED-DM-main@examples@6@analysis.ipynb@.PATH_END.py
{ "filename": "test_yaml.py", "repo_name": "Goobley/crtaf-py", "repo_path": "crtaf-py_extracted/crtaf-py-main/tests/test_yaml.py", "type": "Python" }
from copy import deepcopy import ruamel.yaml from crtaf.spec_version import spec_version from crtaf.simplification_visitors import default_visitors from crtaf.core_types import ( Atom, AtomicSimplificationVisitor, CollisionalRate, NaturalBroadening, OmegaRate, ) from io import StringIO import astrop...
GoobleyREPO_NAMEcrtaf-pyPATH_START.@crtaf-py_extracted@crtaf-py-main@tests@test_yaml.py@.PATH_END.py
{ "filename": "continuum.py", "repo_name": "yi-jia-li/cue", "repo_path": "cue_extracted/cue-main/src/cue/continuum.py", "type": "Python" }
### temperal line prediction function import numpy as np #import glob import tensorflow as tf import tqdm import dill as pickle from . import cont_pca from .cont_pca import SpectrumPCA from .nn import Speculator from .utils import cont_lam, logQ #import __main__ #__main__.SpectrumPCA = SpectrumPCA ### read the fit PCA...
yi-jia-liREPO_NAMEcuePATH_START.@cue_extracted@cue-main@src@cue@continuum.py@.PATH_END.py
{ "filename": "README.md", "repo_name": "gbrammer/threedhst", "repo_path": "threedhst_extracted/threedhst-master/README.md", "type": "Markdown" }
# threedhst Automatically exported from code.google.com/p/threedhst (Oct 9, 2015 / GBB) This now takes precedence over the frozen google-code SVN repository. Note that much of the grism analysis code including the aXe wrappers is now deprecated in favor of the "interlacing" code described by Momcheva et al. (http://a...
gbrammerREPO_NAMEthreedhstPATH_START.@threedhst_extracted@threedhst-master@README.md@.PATH_END.py
{ "filename": "_shadow.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/scene/annotation/font/_shadow.py", "type": "Python" }
import _plotly_utils.basevalidators class ShadowValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="shadow", parent_name="layout.scene.annotation.font", **kwargs ): super(ShadowValidator, self).__init__( plotly_name=plotly_name, par...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@scene@annotation@font@_shadow.py@.PATH_END.py
{ "filename": "deepreload.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/ipython/py3/IPython/lib/deepreload.py", "type": "Python" }
# -*- coding: utf-8 -*- """ Provides a reload() function that acts recursively. Python's normal :func:`python:reload` function only reloads the module that it's passed. The :func:`reload` function in this module also reloads everything imported from that module, which is useful when you're changing files deep inside a...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipython@py3@IPython@lib@deepreload.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "sirocco-rt/sirocco", "repo_path": "sirocco_extracted/sirocco-main/py_progs/py4py/py4py/reverb/timeseries/__init__.py", "type": "Python" }
sirocco-rtREPO_NAMEsiroccoPATH_START.@sirocco_extracted@sirocco-main@py_progs@py4py@py4py@reverb@timeseries@__init__.py@.PATH_END.py
{ "filename": "new_MOFF_testing_MWA.py", "repo_name": "epic-astronomy/EPIC", "repo_path": "EPIC_extracted/EPIC-master/main/new_MOFF_testing_MWA.py", "type": "Python" }
import datetime as DT import numpy as NP import matplotlib.pyplot as PLT import matplotlib.colors as PLTC import scipy.constants as FCNST import antenna_array as AA import geometry as GEOM import sim_observe as SIM import my_DSP_modules as DSP import ipdb as PDB itr = 4 # Antenna initialization lat = -26.701 # Latit...
epic-astronomyREPO_NAMEEPICPATH_START.@EPIC_extracted@EPIC-master@main@new_MOFF_testing_MWA.py@.PATH_END.py
{ "filename": "render_pngs.py", "repo_name": "IanHeywood/oxkat", "repo_path": "oxkat_extracted/oxkat-master/tools/render_pngs.py", "type": "Python" }
import sys import glob def write_slurm(opfile, jobname, logfile, container, syscall, ntasks='1', nodes='1', cpus='8', mem='32GB'): f = open(opfile,'w') f.writelines(['#!/bin/bash\n'...
IanHeywoodREPO_NAMEoxkatPATH_START.@oxkat_extracted@oxkat-master@tools@render_pngs.py@.PATH_END.py
{ "filename": "script_example_ngc6888.ipynb", "repo_name": "thomasorb/orcs", "repo_path": "orcs_extracted/orcs-master/docs/_build/doctrees/nbsphinx/script_example_ngc6888.ipynb", "type": "Jupyter Notebook" }
# Automatic estimation of the flux and velocity and double sinc fit The following example shows how to make a quick estimate of the flux + velocity. The NGC6888 shell displays two generally unresolved components which can be fitted with a double sinc model thanks to the generally high SNR of the data. ```python from...
thomasorbREPO_NAMEorcsPATH_START.@orcs_extracted@orcs-master@docs@_build@doctrees@nbsphinx@script_example_ngc6888.ipynb@.PATH_END.py
{ "filename": "test_nifs.py", "repo_name": "GeminiDRSoftware/DRAGONS", "repo_path": "DRAGONS_extracted/DRAGONS-master/gemini_instruments/nifs/tests/test_nifs.py", "type": "Python" }
import pytest import astrodata import astrodata.testing import gemini_instruments test_files = [ 'N20160727S0077.fits', ] @pytest.fixture(params=test_files) def ad(request): filename = request.param path = astrodata.testing.download_from_archive(filename) return astrodata.open(path) @pytest.mark.d...
GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@gemini_instruments@nifs@tests@test_nifs.py@.PATH_END.py
{ "filename": "fil2h5.py", "repo_name": "ucberkeleyseti/blimpy", "repo_path": "blimpy_extracted/blimpy-master/blimpy/fil2h5.py", "type": "Python" }
#!/usr/bin/env python """ Simple script for making an h5 file from a .fil. ..author: Emilio Enriquez (jeenriquez@gmail.com) July 28th 2017 """ import sys import os import time from argparse import ArgumentParser from .utils import change_the_ext # Logging set up import logging logger = logging.getLogger...
ucberkeleysetiREPO_NAMEblimpyPATH_START.@blimpy_extracted@blimpy-master@blimpy@fil2h5.py@.PATH_END.py
{ "filename": "reaclib_rate.py", "repo_name": "pynucastro/pynucastro", "repo_path": "pynucastro_extracted/pynucastro-main/pynucastro/rates/reaclib_rate.py", "type": "Python" }
import io from pathlib import Path import matplotlib.pyplot as plt import numpy as np from pynucastro.nucdata import Nucleus from pynucastro.rates.files import RateFileError, _find_rate_file from pynucastro.rates.rate import Rate, RateSource, Tfactors class SingleSet: """ a set in Reaclib is one piece of a rate...
pynucastroREPO_NAMEpynucastroPATH_START.@pynucastro_extracted@pynucastro-main@pynucastro@rates@reaclib_rate.py@.PATH_END.py
{ "filename": "test_log.py", "repo_name": "astroufsc/chimera", "repo_path": "chimera_extracted/chimera-master/src/chimera/core/tests/test_log.py", "type": "Python" }
from chimera.core.chimeraobject import ChimeraObject from chimera.core.manager import Manager from chimera.core.exceptions import ChimeraException import logging log = logging.getLogger("chimera.test_log") class TestLog(object): def test_log(self): class Simple(ChimeraObject): def __init__...
astroufscREPO_NAMEchimeraPATH_START.@chimera_extracted@chimera-master@src@chimera@core@tests@test_log.py@.PATH_END.py
{ "filename": "AUTHORS.md", "repo_name": "aymgal/COOLEST", "repo_path": "COOLEST_extracted/COOLEST-main/AUTHORS.md", "type": "Markdown" }
# Authors credits The main instigators and developers of COOLEST are the following people: - Aymeric Galan, [@aymgal](https://github.com/aymgal) - Lyne Van de Vyvere, [@LyneVdV](https://github.com/LyneVdV) - Matt Gomer, [@mattgomer](https://github.com/mattgomer) - Georgios Vernardos, [@gvernard](https://github.com/gve...
aymgalREPO_NAMECOOLESTPATH_START.@COOLEST_extracted@COOLEST-main@AUTHORS.md@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "discsim/frank", "repo_path": "frank_extracted/frank-master/frank/__init__.py", "type": "Python" }
# Frankenstein: 1D disc brightness profile reconstruction from Fourier data # using non-parametric Gaussian Processes # # Copyright (C) 2019-2020 R. Booth, J. Jennings, M. Tazzari # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publishe...
discsimREPO_NAMEfrankPATH_START.@frank_extracted@frank-master@frank@__init__.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "ExObsSim/ExoRad2-public", "repo_path": "ExoRad2-public_extracted/ExoRad2-public-master/exorad/models/foregrounds/__init__.py", "type": "Python" }
ExObsSimREPO_NAMEExoRad2-publicPATH_START.@ExoRad2-public_extracted@ExoRad2-public-master@exorad@models@foregrounds@__init__.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "plazar/TOASTER", "repo_path": "TOASTER_extracted/TOASTER-master/webtoaster/app/controllers/__init__.py", "type": "Python" }
plazarREPO_NAMETOASTERPATH_START.@TOASTER_extracted@TOASTER-master@webtoaster@app@controllers@__init__.py@.PATH_END.py
{ "filename": "slab.py", "repo_name": "jax-ml/jax", "repo_path": "jax_extracted/jax-main/jax/experimental/slab/slab.py", "type": "Python" }
# Copyright 2024 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...
jax-mlREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@experimental@slab@slab.py@.PATH_END.py
{ "filename": "_coloraxis.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/funnel/marker/line/_coloraxis.py", "type": "Python" }
import _plotly_utils.basevalidators class ColoraxisValidator(_plotly_utils.basevalidators.SubplotidValidator): def __init__( self, plotly_name="coloraxis", parent_name="funnel.marker.line", **kwargs ): super(ColoraxisValidator, self).__init__( plotly_name=plotly_name, p...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@funnel@marker@line@_coloraxis.py@.PATH_END.py
{ "filename": "cuda_installation.md", "repo_name": "myinxd/mcrgnet", "repo_path": "mcrgnet_extracted/mcrgnet-master/cuda_installation.md", "type": "Markdown" }
## Install tensorflow with gpu library CUDA on Ubuntu 16.04 x64 ### System and Software info 1. System: Ubuntu16.04 2. GPU card: Nvidia GeForce GT 620 3. tensoflow-gpu==1.2.1 4. CUDA: 8.0 https://developer.nvidia.com/cuda-downloads 5. cuDNN: v5.1 https://developer.nvidia.com/rdp/cudnn-download ### References 1. Tens...
myinxdREPO_NAMEmcrgnetPATH_START.@mcrgnet_extracted@mcrgnet-master@cuda_installation.md@.PATH_END.py
{ "filename": "_itemdoubleclick.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/legend/_itemdoubleclick.py", "type": "Python" }
import _plotly_utils.basevalidators class ItemdoubleclickValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="itemdoubleclick", parent_name="layout.legend", **kwargs ): super(ItemdoubleclickValidator, self).__init__( plotly_name=plotly_name,...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@legend@_itemdoubleclick.py@.PATH_END.py
{ "filename": "_opacity.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattergl/marker/_opacity.py", "type": "Python" }
import _plotly_utils.basevalidators class OpacityValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="opacity", parent_name="scattergl.marker", **kwargs): super(OpacityValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattergl@marker@_opacity.py@.PATH_END.py
{ "filename": "DensityResolutionStudy.py", "repo_name": "mmicromegas/ransX", "repo_path": "ransX_extracted/ransX-master/EQUATIONS/FOR_RESOLUTION_STUDY/DensityResolutionStudy.py", "type": "Python" }
import numpy as np from scipy import integrate import matplotlib.pyplot as plt from UTILS.Calculus import Calculus from UTILS.SetAxisLimit import SetAxisLimit from UTILS.Tools import Tools from UTILS.Errors import Errors import sys # Theoretical background https://arxiv.org/abs/1401.5176 # Mocak, Meakin, Viallet, Ar...
mmicromegasREPO_NAMEransXPATH_START.@ransX_extracted@ransX-master@EQUATIONS@FOR_RESOLUTION_STUDY@DensityResolutionStudy.py@.PATH_END.py
{ "filename": "_backoffsrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterpolar/line/_backoffsrc.py", "type": "Python" }
import _plotly_utils.basevalidators class BackoffsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="backoffsrc", parent_name="scatterpolar.line", **kwargs ): super(BackoffsrcValidator, self).__init__( plotly_name=plotly_name, paren...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterpolar@line@_backoffsrc.py@.PATH_END.py
{ "filename": "_colorsrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/table/cells/font/_colorsrc.py", "type": "Python" }
import _plotly_utils.basevalidators class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="colorsrc", parent_name="table.cells.font", **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@cells@font@_colorsrc.py@.PATH_END.py
{ "filename": "_style.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/scene/zaxis/title/font/_style.py", "type": "Python" }
import _plotly_utils.basevalidators class StyleValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="style", parent_name="layout.scene.zaxis.title.font", **kwargs ): super(StyleValidator, self).__init__( plotly_name=plotly_name, p...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@scene@zaxis@title@font@_style.py@.PATH_END.py
{ "filename": "external_sfrs.py", "repo_name": "kokron/skyLine", "repo_path": "skyLine_extracted/skyLine-main/source/external_sfrs.py", "type": "Python" }
''' Catalog for external SFRs ''' import numpy as np from scipy.interpolate import griddata import os def Behroozi_SFR(M, z): ''' Returns SFR(M,z) interpolated from Behroozi et al. 2013 ''' return SFR_Mz_2dinterp(M,z,'sfr_table_Behroozi.dat') def UniverseMachine_SFR(M,z): ''' Returns SFR(M,...
kokronREPO_NAMEskyLinePATH_START.@skyLine_extracted@skyLine-main@source@external_sfrs.py@.PATH_END.py
{ "filename": "ma.py", "repo_name": "numpy/numpy", "repo_path": "numpy_extracted/numpy-main/numpy/typing/tests/data/pass/ma.py", "type": "Python" }
from typing import Any import numpy as np import numpy.ma m : np.ma.MaskedArray[Any, np.dtype[np.float64]] = np.ma.masked_array([1.5, 2, 3], mask=[True, False, True])
numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@numpy@typing@tests@data@pass@ma.py@.PATH_END.py
{ "filename": "signal.py", "repo_name": "CosmoStatGW/gwfast", "repo_path": "gwfast_extracted/gwfast-master/gwfast/signal.py", "type": "Python" }
# # Copyright (c) 2022 Francesco Iacovelli <francesco.iacovelli@unige.ch>, Michele Mancarella <michele.mancarella@unige.ch> # # All rights reserved. Use of this source code is governed by the # license that can be found in the LICENSE file. import os import jax #Enable 64bit on JAX, fundamental #from jax.co...
CosmoStatGWREPO_NAMEgwfastPATH_START.@gwfast_extracted@gwfast-master@gwfast@signal.py@.PATH_END.py
{ "filename": "test_exoplanet_orbit_database.py", "repo_name": "D-arioSpace/astroquery", "repo_path": "astroquery_extracted/astroquery-main/astroquery/exoplanet_orbit_database/tests/test_exoplanet_orbit_database.py", "type": "Python" }
import os import pytest import astropy.units as u from astropy.tests.helper import assert_quantity_allclose from astropy.utils import minversion from astropy.coordinates import SkyCoord from ...exoplanet_orbit_database import ExoplanetOrbitDatabase APY_LT12 = not minversion('astropy', '1.2') LOCAL_TABLE_PATH = os.pa...
D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@exoplanet_orbit_database@tests@test_exoplanet_orbit_database.py@.PATH_END.py
{ "filename": "base_hdf.py", "repo_name": "gwastro/pycbc", "repo_path": "pycbc_extracted/pycbc-master/pycbc/inference/io/base_hdf.py", "type": "Python" }
# Copyright (C) 2016 Christopher M. Biwer, Collin Capano # 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 # self.option) any later version. # # This p...
gwastroREPO_NAMEpycbcPATH_START.@pycbc_extracted@pycbc-master@pycbc@inference@io@base_hdf.py@.PATH_END.py
{ "filename": "simulation_coordinates.py", "repo_name": "cmlamman/spec-IA", "repo_path": "spec-IA_extracted/spec-IA-main/geometry_functions/simulation_coordinates.py", "type": "Python" }
# SIMPLE FUNCTION TO MODIFY A PERIODIC BOX FOR THE REST OF THE CODE import numpy as np def make_tracers_periodic(origional_points, extend_by=100): ''' Function to extend a set of points in a periodic box by a given distance. Used for extended a tracer sample to use multiplets / shapes in the full box. orig...
cmlammanREPO_NAMEspec-IAPATH_START.@spec-IA_extracted@spec-IA-main@geometry_functions@simulation_coordinates.py@.PATH_END.py
{ "filename": "plot_wind.py", "repo_name": "sirocco-rt/sirocco", "repo_path": "sirocco_extracted/sirocco-main/py_progs/plot_wind.py", "type": "Python" }
#!/usr/bin/env python ''' Synopsis: These are routines for plotting various parameters in of the wind after these parameters have been saved to an astropy-compatible ascii table Command line usage plot_wind filename var to make a plot of a single variable from the command line Description...
sirocco-rtREPO_NAMEsiroccoPATH_START.@sirocco_extracted@sirocco-main@py_progs@plot_wind.py@.PATH_END.py
{ "filename": "revived_types_test.py", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/saved_model/revived_types_test.py", "type": "Python" }
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@saved_model@revived_types_test.py@.PATH_END.py
{ "filename": "test_tracer_model_fit.py", "repo_name": "lenstronomy/lenstronomy", "repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_Workflow/test_tracer_model_fit.py", "type": "Python" }
import numpy.testing as npt import numpy as np class TestTracerModelFit(object): def setup_method(self): # imagng data specifics background_rms = 0.005 # background noise per pixel exp_time = 500.0 # exposure time (arbitrary units, flux per pixel is in units #photons/exp_time unit) ...
lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_Workflow@test_tracer_model_fit.py@.PATH_END.py
{ "filename": "test_main.py", "repo_name": "HengyueZ/astrofix", "repo_path": "astrofix_extracted/astrofix-master/astrofix/tests/test_main.py", "type": "Python" }
# -*- coding: utf-8 -*- """ Created on Thu Mar 18 22:22:53 2021 @author: hyzha """ import astrofix import numpy as np import pytest import os import requests from astropy.io import fits def test_kernel_construction(): for width in np.linspace(3,11,5): width=int(width) kernel=astrofix.GPR_Kernel(2...
HengyueZREPO_NAMEastrofixPATH_START.@astrofix_extracted@astrofix-master@astrofix@tests@test_main.py@.PATH_END.py
{ "filename": "demo_axisline_style.py", "repo_name": "matplotlib/matplotlib", "repo_path": "matplotlib_extracted/matplotlib-main/galleries/examples/axisartist/demo_axisline_style.py", "type": "Python" }
""" ================ Axis line styles ================ This example shows some configurations for axis style. Note: The `mpl_toolkits.axisartist` Axes classes may be confusing for new users. If the only aim is to obtain arrow heads at the ends of the axes, rather check out the :doc:`/gallery/spines/centered_spines_wi...
matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@galleries@examples@axisartist@demo_axisline_style.py@.PATH_END.py
{ "filename": "admin.py", "repo_name": "RafiKueng/SpaghettiLens", "repo_path": "SpaghettiLens_extracted/SpaghettiLens-master/SpaghettiLensProject/SpaghettiLens_app/admin.py", "type": "Python" }
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin # Register your models here.
RafiKuengREPO_NAMESpaghettiLensPATH_START.@SpaghettiLens_extracted@SpaghettiLens-master@SpaghettiLensProject@SpaghettiLens_app@admin.py@.PATH_END.py
{ "filename": "test_mathtext.py", "repo_name": "matplotlib/matplotlib", "repo_path": "matplotlib_extracted/matplotlib-main/lib/matplotlib/tests/test_mathtext.py", "type": "Python" }
from __future__ import annotations import io from pathlib import Path import platform import re from xml.etree import ElementTree as ET from typing import Any import numpy as np from packaging.version import parse as parse_version import pyparsing import pytest import matplotlib as mpl from matplotlib.testing.decor...
matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@lib@matplotlib@tests@test_mathtext.py@.PATH_END.py
{ "filename": "calibrate.py", "repo_name": "ratt-ru/QuartiCal", "repo_path": "QuartiCal_extracted/QuartiCal-main/quartical/calibration/calibrate.py", "type": "Python" }
# -*- coding: utf-8 -*- import numpy as np import dask.array as da from quartical.calibration.mapping import make_mapping_datasets from quartical.gains.general.generics import (compute_residual, compute_corrected_residual, compu...
ratt-ruREPO_NAMEQuartiCalPATH_START.@QuartiCal_extracted@QuartiCal-main@quartical@calibration@calibrate.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "brinckmann/montepython_public", "repo_path": "montepython_public_extracted/montepython_public-master/montepython/likelihoods/bao_known_rs/__init__.py", "type": "Python" }
import os import numpy as np from math import sqrt from montepython.likelihood_class import Likelihood class bao_known_rs(Likelihood): # initialization routine def __init__(self, path, data, command_line): Likelihood.__init__(self, path, data, command_line) # define array for values of z a...
brinckmannREPO_NAMEmontepython_publicPATH_START.@montepython_public_extracted@montepython_public-master@montepython@likelihoods@bao_known_rs@__init__.py@.PATH_END.py
{ "filename": "diy_reduction_script.ipynb", "repo_name": "juliotux/astropop", "repo_path": "astropop_extracted/astropop-main/docs/ipynb/diy_reduction_script.ipynb", "type": "Jupyter Notebook" }
# Make Your Own Reduction Scrypt (photometry) *Work in Progress* ASTROPOP is not a reduction script by itself, but a library containing (almost) everything you need to create your reduction script by yourself. In this guide, we will follow a standard reduction procedure using the ASTROPOP modules and you can follow ...
juliotuxREPO_NAMEastropopPATH_START.@astropop_extracted@astropop-main@docs@ipynb@diy_reduction_script.ipynb@.PATH_END.py
{ "filename": "initialize.py", "repo_name": "iancze/PSOAP", "repo_path": "PSOAP_extracted/PSOAP-master/psoap/initialize.py", "type": "Python" }
import sys import pkg_resources import psoap def main(): """ Available from command line as ``psoap-initialize`` """ import argparse parser = argparse.ArgumentParser(description="Initialize a new directory to do inference.") parser.add_argument("--check", action="store_true", help="To help ...
ianczeREPO_NAMEPSOAPPATH_START.@PSOAP_extracted@PSOAP-master@psoap@initialize.py@.PATH_END.py
{ "filename": "pi_gamma.py", "repo_name": "LoganAMorrison/Hazma", "repo_path": "Hazma_extracted/Hazma-master/hazma/vector_mediator/form_factors/pi_gamma.py", "type": "Python" }
from dataclasses import dataclass from typing import Union, overload import numpy as np from hazma import parameters from .cross_sections import width_to_cs from .utils import MPI_GEV, ComplexArray, RealArray from .widths import width_v_to_p_a @dataclass class FormFactorPiGamma: masses: RealArray = np.array([...
LoganAMorrisonREPO_NAMEHazmaPATH_START.@Hazma_extracted@Hazma-master@hazma@vector_mediator@form_factors@pi_gamma.py@.PATH_END.py
{ "filename": "utils_saha_av.py", "repo_name": "justyncw/STAR_MELT", "repo_path": "STAR_MELT_extracted/STAR_MELT-main/utils_saha_av.py", "type": "Python" }
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 10 11:23:41 2021 @author: jcampbellwhite001 """ from numpy import * from scipy.special import gamma from matplotlib import * from matplotlib.pyplot import * import numpy as np import pandas as pd import matplotlib.pylab as plt from scipy import opt...
justyncwREPO_NAMESTAR_MELTPATH_START.@STAR_MELT_extracted@STAR_MELT-main@utils_saha_av.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/contourcarpet/colorbar/title/__init__.py", "type": "Python" }
import sys from typing import TYPE_CHECKING if sys.version_info < (3, 7) or TYPE_CHECKING: from ._text import TextValidator from ._side import SideValidator from ._font import FontValidator else: from _plotly_utils.importers import relative_import __all__, __getattr__, __dir__ = relative_import( ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@contourcarpet@colorbar@title@__init__.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "hpc4cmb/toast", "repo_path": "toast_extracted/toast-main/src/toast/pybind11/pybind11/__init__.py", "type": "Python" }
import sys if sys.version_info < (3, 6): msg = "pybind11 does not support Python < 3.6. 2.9 was the last release supporting Python 2.7 and 3.5." raise ImportError(msg) from ._version import __version__, version_info from .commands import get_cmake_dir, get_include, get_pkgconfig_dir __all__ = ( "version...
hpc4cmbREPO_NAMEtoastPATH_START.@toast_extracted@toast-main@src@toast@pybind11@pybind11@__init__.py@.PATH_END.py
{ "filename": "python__note__predict_note_for_packages_must-contain-all-features__python.md", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage-common-phrases/python__note__predict_note_for_packages_must-contain-all-features__python.md",...
The model prediction results will be correct only if the `data` parameter with feature values contains all the features used in the model. Typically, the order of these features must match the order of the corresponding columns that is provided during the training. But if feature names are provided both during the trai...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage-common-phrases@python__note__predict_note_for_packages_must-contain-all-features__python.md@.PATH_END.py
{ "filename": "tfsa-2021-042.md", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/security/advisory/tfsa-2021-042.md", "type": "Markdown" }
## TFSA-2021-042: Division by 0 in `DenseCountSparseOutput` ### CVE Number CVE-2021-29554 ### Impact An attacker can cause a denial of service via a FPE runtime error in `tf.raw_ops.DenseCountSparseOutput`: ```python import tensorflow as tf values = tf.constant([], shape=[0, 0], dtype=tf.int64) weights = tf.constan...
tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@security@advisory@tfsa-2021-042.md@.PATH_END.py
{ "filename": "tfsa-2018-006.md", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/security/advisory/tfsa-2018-006.md", "type": "Markdown" }
## TFSA-2018-006: Crafted Configuration File results in Invalid Memory Access ### CVE Number CVE-2018-10055 ### Issue Description A maliciously crafted configuration file passed into the TensorFlow XLA compiler could cause an invalid memory access and/or a heap buffer overflow. ### Impact A maliciously crafted co...
tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@security@advisory@tfsa-2018-006.md@.PATH_END.py
{ "filename": "photometry_kernels.py", "repo_name": "LSSTDESC/lsstdesc-diffsky", "repo_path": "lsstdesc-diffsky_extracted/lsstdesc-diffsky-main/lsstdesc_diffsky/photometry/photometry_kernels.py", "type": "Python" }
""" """ from dsps.photometry.photometry_kernels import calc_obs_mag, calc_rest_mag from jax import jit as jjit from jax import vmap from ..defaults import DEFAULT_COSMO_PARAMS from ..sed import calc_rest_sed_singlegal _F = (*[None] * 2, 0, 0, *[None] * 5) calc_obs_mag_vmap = jjit(vmap(calc_obs_mag, in_axes=_F)) _R ...
LSSTDESCREPO_NAMElsstdesc-diffskyPATH_START.@lsstdesc-diffsky_extracted@lsstdesc-diffsky-main@lsstdesc_diffsky@photometry@photometry_kernels.py@.PATH_END.py
{ "filename": "mio_utils.py", "repo_name": "scipy/scipy", "repo_path": "scipy_extracted/scipy-main/scipy/io/matlab/mio_utils.py", "type": "Python" }
# This file is not meant for public use and will be removed in SciPy v2.0.0. # Use the `scipy.io.matlab` namespace for importing the functions # included below. from scipy._lib.deprecation import _sub_module_deprecation __all__: list[str] = [] def __dir__(): return __all__ def __getattr__(name): return _s...
scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@io@matlab@mio_utils.py@.PATH_END.py
{ "filename": "_gridcolor.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/xaxis/_gridcolor.py", "type": "Python" }
import _plotly_utils.basevalidators class GridcolorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__(self, plotly_name="gridcolor", parent_name="layout.xaxis", **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@layout@xaxis@_gridcolor.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "astropy/astropy", "repo_path": "astropy_extracted/astropy-main/astropy/modeling/tests/data/__init__.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst from pathlib import Path dpath = str(Path(__file__).parent.resolve())
astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@modeling@tests@data@__init__.py@.PATH_END.py
{ "filename": "_maxpoints.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/histogram2dcontour/stream/_maxpoints.py", "type": "Python" }
import _plotly_utils.basevalidators class MaxpointsValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="maxpoints", parent_name="histogram2dcontour.stream", **kwargs ): super(MaxpointsValidator, self).__init__( plotly_name=plotly_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@histogram2dcontour@stream@_maxpoints.py@.PATH_END.py