metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "scConvolution.py",
"repo_name": "akleroy/phangs_imaging_scripts",
"repo_path": "phangs_imaging_scripts_extracted/phangs_imaging_scripts-master/phangsPipeline/scConvolution.py",
"type": "Python"
} | import logging
import numpy as np
import astropy.units as u
from astropy.io import fits
from astropy.convolution import Box1DKernel
from astropy.convolution import convolve, convolve_fft
from radio_beam import Beam
from spectral_cube import SpectralCube, LazyMask, Projection
logger = logging.getLogger(__name__)
logge... | akleroyREPO_NAMEphangs_imaging_scriptsPATH_START.@phangs_imaging_scripts_extracted@phangs_imaging_scripts-master@phangsPipeline@scConvolution.py@.PATH_END.py |
{
"filename": "visitdepth_batch.py",
"repo_name": "lsst/rubin_sim",
"repo_path": "rubin_sim_extracted/rubin_sim-main/rubin_sim/maf/batches/visitdepth_batch.py",
"type": "Python"
} | """Sets of metrics to look at general sky coverage -
nvisits/coadded depth/Teff.
"""
__all__ = ("nvisitsM5Maps", "tEffMetrics", "nvisitsPerNight", "nvisitsPerSubset")
import copy
import numpy as np
import rubin_sim.maf.metric_bundles as mb
import rubin_sim.maf.metrics as metrics
import rubin_sim.maf.slicers as slic... | lsstREPO_NAMErubin_simPATH_START.@rubin_sim_extracted@rubin_sim-main@rubin_sim@maf@batches@visitdepth_batch.py@.PATH_END.py |
{
"filename": "plots.py",
"repo_name": "RuthAngus/flicker",
"repo_path": "flicker_extracted/flicker-master/code/plots.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
import triangle
import scipy.interpolate as spi
import h5py
import sys
from noisy_plane import model1
from model import load_data
def interp(xold, yold, xnew, s):
tck = spi.splrep(xold, yold, s=s)
ynew = spi.splev(xnew, tck, der=0)
return ynew
def fit_str... | RuthAngusREPO_NAMEflickerPATH_START.@flicker_extracted@flicker-master@code@plots.py@.PATH_END.py |
{
"filename": "stochastic_optics.py",
"repo_name": "achael/eht-imaging",
"repo_path": "eht-imaging_extracted/eht-imaging-main/ehtim/scattering/stochastic_optics.py",
"type": "Python"
} | # Michael Johnson, 2/15/2017
# See http://adsabs.harvard.edu/abs/2016ApJ...833...74J for details about this module
from __future__ import print_function
from builtins import range
from builtins import object
import numpy as np
import scipy.signal
import scipy.special as sps
import scipy.integrate as integrate
from sci... | achaelREPO_NAMEeht-imagingPATH_START.@eht-imaging_extracted@eht-imaging-main@ehtim@scattering@stochastic_optics.py@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/heatmapgl/hoverlabel/_font.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="font", parent_name="heatmapgl.hoverlabel", **kwargs
):
super(FontValidator, self).__init__(
plotly_name=plotly_name,
parent_name=par... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@heatmapgl@hoverlabel@_font.py@.PATH_END.py |
{
"filename": "__version__.py",
"repo_name": "danielkoll/PyRADS-shortwave",
"repo_path": "PyRADS-shortwave_extracted/PyRADS-shortwave-master/pyDISORT-master/build/lib/disort/__version__.py",
"type": "Python"
} | __version__ = '0.0.1'
| danielkollREPO_NAMEPyRADS-shortwavePATH_START.@PyRADS-shortwave_extracted@PyRADS-shortwave-master@pyDISORT-master@build@lib@disort@__version__.py@.PATH_END.py |
{
"filename": "_gridwidth.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/ternary/baxis/_gridwidth.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class GridwidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="gridwidth", parent_name="layout.ternary.baxis", **kwargs
):
super(GridwidthValidator, self).__init__(
plotly_name=plotly_name,
pa... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@ternary@baxis@_gridwidth.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "jpcoles/glass",
"repo_path": "glass_extracted/glass-master/glass/solvers/rwalk/__init__.py",
"type": "Python"
} | jpcolesREPO_NAMEglassPATH_START.@glass_extracted@glass-master@glass@solvers@rwalk@__init__.py@.PATH_END.py | |
{
"filename": "edenai.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/embeddings/edenai.py",
"type": "Python"
} | from typing import Any, Dict, List, Optional
from langchain_core.embeddings import Embeddings
from langchain_core.utils import convert_to_secret_str, get_from_dict_or_env, pre_init
from pydantic import (
BaseModel,
ConfigDict,
Field,
SecretStr,
)
from langchain_community.utilities.requests import Requ... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@embeddings@edenai.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/violin/legendgrouptitle/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._font import Font
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(__name__, [], ["._font.Font"])
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@violin@legendgrouptitle@__init__.py@.PATH_END.py |
{
"filename": "_base.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scikit-learn/py3/sklearn/mixture/_base.py",
"type": "Python"
} | """Base class for mixture models."""
# Author: Wei Xue <xuewei4d@gmail.com>
# Modified by Thierry Guillemot <thierry.guillemot.work@gmail.com>
# License: BSD 3 clause
import warnings
from abc import ABCMeta, abstractmethod
from numbers import Integral, Real
from time import time
import numpy as np
from scipy.special... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scikit-learn@py3@sklearn@mixture@_base.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "riogroup/SORA",
"repo_path": "SORA_extracted/SORA-master/sora/lightcurve/__init__.py",
"type": "Python"
} | from .core import *
from .utils import *
__all__ = ['LightCurve']
| riogroupREPO_NAMESORAPATH_START.@SORA_extracted@SORA-master@sora@lightcurve@__init__.py@.PATH_END.py |
{
"filename": "Web-Redirection-Service.md",
"repo_name": "crossbario/crossbar",
"repo_path": "crossbar_extracted/crossbar-master/docs-old/pages/administration/web-service/Web-Redirection-Service.md",
"type": "Markdown"
} | title: Web Redirection Service
toc: [Documentation, Administration, Web Services, Web Redirection Service]
# Web Redirection Service
## Configuration
To configure a Web Redirection Service, attach a dictionary element to a path in your [Web transport](Web Transport and Services):
option | description
---|---
**`typ... | crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@docs-old@pages@administration@web-service@Web-Redirection-Service.md@.PATH_END.py |
{
"filename": "test_utils.py",
"repo_name": "galsci/pysm",
"repo_path": "pysm_extracted/pysm-main/tests/test_utils.py",
"type": "Python"
} | from urllib.error import URLError
import numpy as np
try:
from numpy import trapezoid
except ImportError:
from numpy import trapz as trapezoid
import pixell.enmap
import pytest
from astropy.io import fits
from astropy.tests.helper import assert_quantity_allclose
import pysm3
import pysm3.units as u
from pysm... | galsciREPO_NAMEpysmPATH_START.@pysm_extracted@pysm-main@tests@test_utils.py@.PATH_END.py |
{
"filename": "test_nan.py",
"repo_name": "transientskp/tkp",
"repo_path": "tkp_extracted/tkp-master/tests/test_quality/test_nan.py",
"type": "Python"
} | import unittest
import numpy as np
from tkp.quality.nan import contains_nan
class TestNan(unittest.TestCase):
def test_valid(self):
array = np.array([1, 2, 3.0])
self.assertFalse(contains_nan(array))
def test_invalid(self):
array = np.array([1, 2, np.nan])
result = contains_na... | transientskpREPO_NAMEtkpPATH_START.@tkp_extracted@tkp-master@tests@test_quality@test_nan.py@.PATH_END.py |
{
"filename": "train_segmentor.py",
"repo_name": "ESA-Datalabs/XAMI-model",
"repo_path": "XAMI-model_extracted/XAMI-model-main/xami_model/train/train_segmentor.py",
"type": "Python"
} | import os
import sys
import yaml
import torch
import numpy as np
import json
import cv2
import albumentations as A
import matplotlib.pyplot as plt
from datetime import datetime
from pycocotools import mask as maskUtils
from torch.utils.data import DataLoader
from segment_anything.utils.transforms import ResizeLongestSi... | ESA-DatalabsREPO_NAMEXAMI-modelPATH_START.@XAMI-model_extracted@XAMI-model-main@xami_model@train@train_segmentor.py@.PATH_END.py |
{
"filename": "_variant.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/choroplethmap/hoverlabel/font/_variant.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="variant",
parent_name="choroplethmap.hoverlabel.font",
**kwargs,
):
super(VariantValidator, self).__init__(
plotly_... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@choroplethmap@hoverlabel@font@_variant.py@.PATH_END.py |
{
"filename": "make_particles_file.py",
"repo_name": "AMReX-Astro/Castro",
"repo_path": "Castro_extracted/Castro-main/Exec/unit_tests/particles_test/make_particles_file.py",
"type": "Python"
} | """
This script creates a particle file for the test problem.
Note it's not very clever - if you change problo and probhi in the inputs file,
you'll need to change them here as well.
"""
import numpy as np
outfile_name = "particle_file"
# number of particles
n_particles = 20
# copy these from the inputs file
problo... | AMReX-AstroREPO_NAMECastroPATH_START.@Castro_extracted@Castro-main@Exec@unit_tests@particles_test@make_particles_file.py@.PATH_END.py |
{
"filename": "_xanchor.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/parcoords/line/colorbar/_xanchor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XanchorValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="xanchor", parent_name="parcoords.line.colorbar", **kwargs
):
super(XanchorValidator, self).__init__(
plotly_name=plotly_name,
p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@parcoords@line@colorbar@_xanchor.py@.PATH_END.py |
{
"filename": "log.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/ipython/py2/IPython/utils/log.py",
"type": "Python"
} | from __future__ import absolute_import
from warnings import warn
warn("IPython.utils.log has moved to traitlets.log")
from traitlets.log import *
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipython@py2@IPython@utils@log.py@.PATH_END.py |
{
"filename": "_variantsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattergl/textfont/_variantsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="variantsrc", parent_name="scattergl.textfont", **kwargs
):
super(VariantsrcValidator, self).__init__(
plotly_name=plotly_name,
pare... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattergl@textfont@_variantsrc.py@.PATH_END.py |
{
"filename": "_nticks.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/ternary/caxis/_nticks.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NticksValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="nticks", parent_name="layout.ternary.caxis", **kwargs
):
super(NticksValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@ternary@caxis@_nticks.py@.PATH_END.py |
{
"filename": "polyutils.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/numpy/polynomial/polyutils.py",
"type": "Python"
} | """
Utility classes and functions for the polynomial modules.
This module provides: error and warning objects; a polynomial base class;
and some routines used in both the `polynomial` and `chebyshev` modules.
Error objects
-------------
.. autosummary::
:toctree: generated/
PolyError base class for... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@numpy@polynomial@polyutils.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "POSYDON-code/POSYDON",
"repo_path": "POSYDON_extracted/POSYDON-main/posydon/grids/__init__.py",
"type": "Python"
} | POSYDON-codeREPO_NAMEPOSYDONPATH_START.@POSYDON_extracted@POSYDON-main@posydon@grids@__init__.py@.PATH_END.py | |
{
"filename": "area_expansion.py",
"repo_name": "rice-solar-physics/ebtelPlusPlus",
"repo_path": "ebtelPlusPlus_extracted/ebtelPlusPlus-main/examples/area_expansion.py",
"type": "Python"
} | """
The Effect of Cross-sectional Area Expansion
============================================
In this example, we demonstrate the effect of expanding cross-sectional area on the time-evolution
of the temperature, density, and pressure. We will reproduce Figure 7 of :cite:t:`cargill_static_2022`.
"""
import astropy.unit... | rice-solar-physicsREPO_NAMEebtelPlusPlusPATH_START.@ebtelPlusPlus_extracted@ebtelPlusPlus-main@examples@area_expansion.py@.PATH_END.py |
{
"filename": "test_upstash_redis.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/integration_tests/storage/test_upstash_redis.py",
"type": "Python"
} | """Implement integration tests for Redis storage."""
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from langchain_community.storage.upstash_redis import UpstashRedisByteStore
if TYPE_CHECKING:
from upstash_redis import Redis
pytest.importorskip("upstash_redis")
URL = "<UPS... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@integration_tests@storage@test_upstash_redis.py@.PATH_END.py |
{
"filename": "filter_Gaussian.py",
"repo_name": "Ntsikelelo-Charles/Fringe_rate_filters",
"repo_path": "Fringe_rate_filters_extracted/Fringe_rate_filters-main/Mutual_coupling_fringe_rate_filters/filter_Gaussian.py",
"type": "Python"
} | import matplotlib.pyplot as plt
import matplotlib
import numpy as np
from pyuvdata import UVData
import hera_cal as hc
import uvtools as uvt
import hera_pspec as hp
import copy
from scipy import integrate
from scipy import optimize
def gauss(x, amp, loc, scale):
return amp * np.exp(-0.5 * (x-loc)**2 / scale**2)
d... | Ntsikelelo-CharlesREPO_NAMEFringe_rate_filtersPATH_START.@Fringe_rate_filters_extracted@Fringe_rate_filters-main@Mutual_coupling_fringe_rate_filters@filter_Gaussian.py@.PATH_END.py |
{
"filename": "ecsv.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/astropy/cosmology/_io/ecsv.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""|Cosmology| <-> ECSV I/O, using |Cosmology.read| and |Cosmology.write|.
This module provides functions to write/read a |Cosmology| object to/from an ECSV file.
The functions are registered with ``readwrite_registry`` under the format name
"ascii.ecsv".... | astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@cosmology@_io@ecsv.py@.PATH_END.py |
{
"filename": "core.py",
"repo_name": "dfm/corner.py",
"repo_path": "corner.py_extracted/corner.py-main/src/corner/core.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
__all__ = [
"corner_impl",
"hist2d",
"quantile",
"overplot_lines",
"overplot_points",
]
import copy
import logging
import matplotlib
import numpy as np
from matplotlib import pyplot as pl
from matplotlib.colors import LinearSegmentedColormap, colorConverter
from matplotlib... | dfmREPO_NAMEcorner.pyPATH_START.@corner.py_extracted@corner.py-main@src@corner@core.py@.PATH_END.py |
{
"filename": "util.py",
"repo_name": "juliotux/astropop",
"repo_path": "astropop_extracted/astropop-main/astropop/framedata/util.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Utilities for loading data as FrameData."""
import os
import numpy as np
from astropy.io import fits
from astropy.units import Quantity
from astropy.nddata import CCDData
from .framedata import FrameData
from ._compat import _extract_ccddata, _extract... | juliotuxREPO_NAMEastropopPATH_START.@astropop_extracted@astropop-main@astropop@framedata@util.py@.PATH_END.py |
{
"filename": "compute_second_order_aperture_mass_correlations_MS_subsampled.py",
"repo_name": "sheydenreich/threepoint",
"repo_path": "threepoint_extracted/threepoint-main/python_scripts/old/compute_second_order_aperture_mass_correlations_MS_subsampled.py",
"type": "Python"
} | from matplotlib import use
from file_loader import get_millennium_downsampled
from utility import aperture_mass_computer,extract_second_order_aperture_masses
import numpy as np
import sys
from tqdm import tqdm
import multiprocessing.managers
from multiprocessing import Pool
from astropy.io import fits
import os
import ... | sheydenreichREPO_NAMEthreepointPATH_START.@threepoint_extracted@threepoint-main@python_scripts@old@compute_second_order_aperture_mass_correlations_MS_subsampled.py@.PATH_END.py |
{
"filename": "source_candidate.py",
"repo_name": "epfl-radio-astro/LiSA",
"repo_path": "LiSA_extracted/LiSA-main/modules/util/source_candidate.py",
"type": "Python"
} | ############################################################
# Helper class to store source candidate information
############################################################
class SourceCandidate:
def __init__(self, i, j, k = None, kslice = None, sig = None):
self.i = i
self.j = j
self.k =... | epfl-radio-astroREPO_NAMELiSAPATH_START.@LiSA_extracted@LiSA-main@modules@util@source_candidate.py@.PATH_END.py |
{
"filename": "test_parfile_writing_format.py",
"repo_name": "nanograv/PINT",
"repo_path": "PINT_extracted/PINT-master/tests/test_parfile_writing_format.py",
"type": "Python"
} | import os
import pytest
from io import StringIO
import pytest
from hypothesis import given
from hypothesis.strategies import sampled_from
from pint.models import get_model, get_model_and_toas
from pint import fitter
from pinttestdata import datadir
def test_SWM():
"""Should be present in PINT, not in TEMPO/TEMP... | nanogravREPO_NAMEPINTPATH_START.@PINT_extracted@PINT-master@tests@test_parfile_writing_format.py@.PATH_END.py |
{
"filename": "example_mcmc.py",
"repo_name": "NumCosmo/NumCosmo",
"repo_path": "NumCosmo_extracted/NumCosmo-master/examples/pydata_simple/example_mcmc.py",
"type": "Python"
} | #!/usr/bin/env python
#
# example_mcmc.py
#
# Mon May 22 16:00:00 2023
# Copyright 2023 Sandro Dias Pinto Vitenti
# <vitenti@uel.br>
#
# example_mcmc.py
# Copyright (C) 2023 Sandro Dias Pinto Vitenti <vitenti@uel.br>
#
# numcosmo is free software: you can redistribute it and/or modify it
# under the terms of the GNU ... | NumCosmoREPO_NAMENumCosmoPATH_START.@NumCosmo_extracted@NumCosmo-master@examples@pydata_simple@example_mcmc.py@.PATH_END.py |
{
"filename": "toyproblem presentation.ipynb",
"repo_name": "bencebeky/spotrod",
"repo_path": "spotrod_extracted/spotrod-master/toyproblem/toyproblem presentation.ipynb",
"type": "Jupyter Notebook"
} | # Bence Béky: Using to the numpy C API
## Problem
```
from IPython.display import Image;
Image(filename="ipython.png")
```
```
r = numpy.linspace(0.0, 1.0, 1000);
p = 0.1;
z = 0.5;
```
## Python implementations
```
def circleangleloop(r, p, z):
# If the circle arc of radius r is disjoint from the circular di... | bencebekyREPO_NAMEspotrodPATH_START.@spotrod_extracted@spotrod-master@toyproblem@toyproblem presentation.ipynb@.PATH_END.py |
{
"filename": "helper.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/libs/onnx/onnx/helper.py",
"type": "Python"
} | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
# pylint: disable=C0302,R0912
import collections.abc
import numbers
import struct
from cmath import isnan
from typing import (
Any,
Callable,
Dict,
KeysView,
List,
Optional,
Sequence,
Tuple,
TypeVar,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@libs@onnx@onnx@helper.py@.PATH_END.py |
{
"filename": "model.py",
"repo_name": "ifauh/par-sir",
"repo_path": "par-sir_extracted/par-sir-main/mods/sir3d/synth/model.py",
"type": "Python"
} | from collections import OrderedDict
from sir3d import sir_code
from sir3d.configuration import Configuration
import numpy as np
import os
import scipy.stats
import scipy.constants
import logging
import h5py
import scipy.integrate as integ
from scipy import interpolate
# from ipdb import set_trace as stop
__all__ = ['... | ifauhREPO_NAMEpar-sirPATH_START.@par-sir_extracted@par-sir-main@mods@sir3d@synth@model.py@.PATH_END.py |
{
"filename": "plottiling.py",
"repo_name": "wchenastro/Mosaic",
"repo_path": "Mosaic_extracted/Mosaic-master/example/plottiling.py",
"type": "Python"
} | #!/usr/bin/env python3
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.patches import Ellipse
from astropy import wcs
from astropy.coordinates import SkyCoord
from astropy import units as u
import sys, argparse
def parse_argument():
for i, arg in enumerate(sys.argv):
if (arg[0] ... | wchenastroREPO_NAMEMosaicPATH_START.@Mosaic_extracted@Mosaic-master@example@plottiling.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "sibirrer/hierArc",
"repo_path": "hierArc_extracted/hierArc-main/hierarc/Sampling/__init__.py",
"type": "Python"
} | sibirrerREPO_NAMEhierArcPATH_START.@hierArc_extracted@hierArc-main@hierarc@Sampling@__init__.py@.PATH_END.py | |
{
"filename": "noxfile.py",
"repo_name": "dfm/tinygp",
"repo_path": "tinygp_extracted/tinygp-main/noxfile.py",
"type": "Python"
} | import platform
from pathlib import Path
import nox
PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12"]
@nox.session(python=PYTHON_VERSIONS)
def test(session: nox.Session) -> None:
session.install(".[test]")
session.run("pytest", *session.posargs)
@nox.session(python=PYTHON_VERSIONS)
def comparison(session:... | dfmREPO_NAMEtinygpPATH_START.@tinygp_extracted@tinygp-main@noxfile.py@.PATH_END.py |
{
"filename": "classify_eigenvalues.py",
"repo_name": "dh4gan/tache",
"repo_path": "tache_extracted/tache-master/plot/classify_eigenvalues.py",
"type": "Python"
} | # Written 9/10/14 by dh4gan
# Some useful functions for classifying eigenvalues and defining structure
def classify_eigenvalue(eigenvalues, threshold):
'''Given 3 eigenvalues, and some threshold, returns an integer
'iclass' corresponding to the number of eigenvalues below the threshold
iclass = 0 --> ... | dh4ganREPO_NAMEtachePATH_START.@tache_extracted@tache-master@plot@classify_eigenvalues.py@.PATH_END.py |
{
"filename": "test_halos.py",
"repo_name": "bccp/nbodykit",
"repo_path": "nbodykit_extracted/nbodykit-master/nbodykit/tutorials/tests/test_halos.py",
"type": "Python"
} | from runtests.mpi import MPITest
from nbodykit.tutorials import DemoHaloCatalog
from nbodykit import setup_logging
import pytest
setup_logging()
@MPITest([4])
def test_download(comm):
from halotools.sim_manager import UserSuppliedHaloCatalog
# download and load the cached catalog
cat = DemoHaloCatalog('... | bccpREPO_NAMEnbodykitPATH_START.@nbodykit_extracted@nbodykit-master@nbodykit@tutorials@tests@test_halos.py@.PATH_END.py |
{
"filename": "test_pixell.py",
"repo_name": "simonsobs/pixell",
"repo_path": "pixell_extracted/pixell-master/tests/test_pixell.py",
"type": "Python"
} | """Tests for `pixell` package."""
import unittest
from pixell import enmap
from pixell import curvedsky
from pixell import lensing
from pixell import interpol
from pixell import array_ops
from pixell import enplot
from pixell import powspec
from pixell import reproject
from pixell import pointsrcs
from pixell import ... | simonsobsREPO_NAMEpixellPATH_START.@pixell_extracted@pixell-master@tests@test_pixell.py@.PATH_END.py |
{
"filename": "legrand.py",
"repo_name": "jabesq-org/pyatmo",
"repo_path": "pyatmo_extracted/pyatmo-master/src/pyatmo/modules/legrand.py",
"type": "Python"
} | """Module to represent Legrand modules."""
from __future__ import annotations
import logging
from pyatmo.modules.module import (
BatteryMixin,
ContactorMixin,
DimmableMixin,
Dimmer,
EnergyHistoryLegacyMixin,
EnergyHistoryMixin,
Fan,
FirmwareMixin,
Module,
OffloadMixin,
Pow... | jabesq-orgREPO_NAMEpyatmoPATH_START.@pyatmo_extracted@pyatmo-master@src@pyatmo@modules@legrand.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "axgoujon/convex_ridge_regularizers",
"repo_path": "convex_ridge_regularizers_extracted/convex_ridge_regularizers-main/inverse_problems/mri/README.md",
"type": "Markdown"
} | # Single- and multi-coil MRI
**Preprocessed data:** download the data [](https://doi.org/10.5281/zenodo.8302121)
, unzip it and put it in the data folder under the name `data_sets.
The data contains validation (aka calibration) and test sets with:
- subs... | axgoujonREPO_NAMEconvex_ridge_regularizersPATH_START.@convex_ridge_regularizers_extracted@convex_ridge_regularizers-main@inverse_problems@mri@README.md@.PATH_END.py |
{
"filename": "_opacity.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/heatmapgl/_opacity.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OpacityValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="opacity", parent_name="heatmapgl", **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@heatmapgl@_opacity.py@.PATH_END.py |
{
"filename": "test_cosmosis_interface.py",
"repo_name": "mraveri/tensiometer",
"repo_path": "tensiometer_extracted/tensiometer-master/tensiometer/tests/test_cosmosis_interface.py",
"type": "Python"
} | ###############################################################################
# initial imports:
import unittest
import tensiometer.cosmosis_interface as ci
import os
###############################################################################
class test_cosmosis_interface(unittest.TestCase):
def setUp(... | mraveriREPO_NAMEtensiometerPATH_START.@tensiometer_extracted@tensiometer-master@tensiometer@tests@test_cosmosis_interface.py@.PATH_END.py |
{
"filename": "make_shear.py",
"repo_name": "AWehrhahn/PyReduce",
"repo_path": "PyReduce_extracted/PyReduce-master/pyreduce/make_shear.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Calculate the tilt based on a reference spectrum with high SNR, e.g. Wavelength calibration image
Authors
-------
Nikolai Piskunov
Ansgar Wehrhahn
Version
--------
0.9 - NP - IDL Version
1.0 - AW - Python Version
License
-------
....
"""
import logging
import matplotlib.pyplot as plt
im... | AWehrhahnREPO_NAMEPyReducePATH_START.@PyReduce_extracted@PyReduce-master@pyreduce@make_shear.py@.PATH_END.py |
{
"filename": "test_primitives.py",
"repo_name": "pyro-ppl/pyro",
"repo_path": "pyro_extracted/pyro-master/tests/test_primitives.py",
"type": "Python"
} | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from typing import Optional
import pytest
import torch
import pyro
import pyro.distributions as dist
from pyro import poutine
pytestmark = pytest.mark.stage("unit")
def test_sample_ok():
x = pyro.sample("x", dist.Normal(0, 1))... | pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@tests@test_primitives.py@.PATH_END.py |
{
"filename": "_family.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/carpet/baxis/tickfont/_family.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="family", parent_name="carpet.baxis.tickfont", **kwargs
):
super(FamilyValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@carpet@baxis@tickfont@_family.py@.PATH_END.py |
{
"filename": "module.py",
"repo_name": "google/flax",
"repo_path": "flax_extracted/flax-main/flax/nnx/module.py",
"type": "Python"
} | # Copyright 2024 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | googleREPO_NAMEflaxPATH_START.@flax_extracted@flax-main@flax@nnx@module.py@.PATH_END.py |
{
"filename": "_showticklabels.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterternary/marker/colorbar/_showticklabels.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowticklabelsValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name="showticklabels",
parent_name="scatterternary.marker.colorbar",
**kwargs,
):
super(ShowticklabelsValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterternary@marker@colorbar@_showticklabels.py@.PATH_END.py |
{
"filename": "_valuessrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/treemap/_valuessrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ValuessrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="valuessrc", parent_name="treemap", **kwargs):
super(ValuessrcValidator, 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@treemap@_valuessrc.py@.PATH_END.py |
{
"filename": "apply_blinding_main_fromfile_fcomp_double_blinding.py",
"repo_name": "desihub/LSS",
"repo_path": "LSS_extracted/LSS-main/scripts/main/apply_blinding_main_fromfile_fcomp_double_blinding.py",
"type": "Python"
} | '''
Documentation needs to be updated
EXAMPLE USE
===========
GENERAL NOTES
=============
NOTES FOR TESTING AND VALIDATION
================================
'''
import sys
import os
import logging
import shutil
import unittest
from datetime import datetime
import json
import numpy as np
#from numpy.random import ... | desihubREPO_NAMELSSPATH_START.@LSS_extracted@LSS-main@scripts@main@apply_blinding_main_fromfile_fcomp_double_blinding.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "AWehrhahn/PyReduce",
"repo_path": "PyReduce_extracted/PyReduce-master/pyreduce/clib/__init__.py",
"type": "Python"
} | AWehrhahnREPO_NAMEPyReducePATH_START.@PyReduce_extracted@PyReduce-master@pyreduce@clib@__init__.py@.PATH_END.py | |
{
"filename": "devcore.py",
"repo_name": "dstndstn/tractor",
"repo_path": "tractor_extracted/tractor-main/tractor/devcore.py",
"type": "Python"
} | from tractor.utils import *
from tractor.galaxy import *
from tractor.pointsource import PointSource
class DevCoreGalaxy(MultiParams, BasicSource):
'''
A galaxy with deVauc and central point source components.
The two components share a position (ie the centers are the same),
but have different bright... | dstndstnREPO_NAMEtractorPATH_START.@tractor_extracted@tractor-main@tractor@devcore.py@.PATH_END.py |
{
"filename": "_util.py",
"repo_name": "crossbario/crossbar",
"repo_path": "crossbar_extracted/crossbar-master/crossbar/_util.py",
"type": "Python"
} | #####################################################################################
#
# Copyright (c) typedef int GmbH
# SPDX-License-Identifier: EUPL-1.2
#
#####################################################################################
import contextlib
import socket
import sys
import json
import os
import ... | crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@crossbar@_util.py@.PATH_END.py |
{
"filename": "_stylesrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattermap/hoverlabel/font/_stylesrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class StylesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="stylesrc", parent_name="scattermap.hoverlabel.font", **kwargs
):
super(StylesrcValidator, self).__init__(
plotly_name=plotly_name,
pa... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattermap@hoverlabel@font@_stylesrc.py@.PATH_END.py |
{
"filename": "_visible.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/slider/_visible.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VisibleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="visible", parent_name="layout.slider", **kwargs):
super(VisibleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@slider@_visible.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "sunpy/ndcube",
"repo_path": "ndcube_extracted/ndcube-main/ndcube/visualization/__init__.py",
"type": "Python"
} | from .base import BasePlotter
from .descriptor import PlotterDescriptor
__all__ = ['BasePlotter', "PlotterDescriptor"]
| sunpyREPO_NAMEndcubePATH_START.@ndcube_extracted@ndcube-main@ndcube@visualization@__init__.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "johnveitch/cpnest",
"repo_path": "cpnest_extracted/cpnest-master/cpnest/utils.py",
"type": "Python"
} | import os
import logging
# Default formats and level names
FORMATTER = logging.Formatter(
'%(asctime)s - %(name)-38s: %(message)s',
datefmt='%Y-%m-%d, %H:%M:%S'
)
LEVELS = ['CRITICAL', 'WARNING', 'INFO', 'DEBUG']
LOGGER = logging.getLogger('cpnest.utils')
class _Handler(logging.Handler):
def __init__(se... | johnveitchREPO_NAMEcpnestPATH_START.@cpnest_extracted@cpnest-master@cpnest@utils.py@.PATH_END.py |
{
"filename": "lctemplate.py",
"repo_name": "nanograv/PINT",
"repo_path": "PINT_extracted/PINT-master/src/pint/templates/lctemplate.py",
"type": "Python"
} | """Normalized template representing directional data
Implements a mixture model of LCPrimitives to form a normalized template representing directional data.
author: M. Kerr <matthew.kerr@gmail.com>
"""
import contextlib
import logging
from collections import defaultdict
from copy import deepcopy
import numpy as np... | nanogravREPO_NAMEPINTPATH_START.@PINT_extracted@PINT-master@src@pint@templates@lctemplate.py@.PATH_END.py |
{
"filename": "open_problems.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/open_problems/open_problems.md",
"type": "Markdown"
} | 1. `treat_object_as_categorical`
Currently you have to pass `cat_features` to CatBoost* init function or to fit function.
Many people ask for automatic detection of categorical features.
This flag would solve the problem.
It is suggested to add the flag to Pool init function, CatBoost* init functions and to fit functio... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@open_problems@open_problems.md@.PATH_END.py |
{
"filename": "_xanchor.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/coloraxis/colorbar/_xanchor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XanchorValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="xanchor", parent_name="layout.coloraxis.colorbar", **kwargs
):
super(XanchorValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@coloraxis@colorbar@_xanchor.py@.PATH_END.py |
{
"filename": "calculation.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/coordinates/calculation.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
# Standard library
from datetime import datetime
from xml.dom.minidom import parse
import re
import textwrap
# Third-par... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@coordinates@calculation.py@.PATH_END.py |
{
"filename": "database.py",
"repo_name": "aburgasser/splat",
"repo_path": "splat_extracted/splat-main/splat/database.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
from __future__ import print_function, division
"""
.. note::
These are the database functions for SPLAT
"""
# imports: internal
import base64
import copy
import csv
import glob
import os
import re
import requests
from shutil import copyfile
import time
# imports: external
import as... | aburgasserREPO_NAMEsplatPATH_START.@splat_extracted@splat-main@splat@database.py@.PATH_END.py |
{
"filename": "backend_svg.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/matplotlib/py2/matplotlib/backends/backend_svg.py",
"type": "Python"
} | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from collections import OrderedDict
import six
from six import unichr
from six.moves import xrange
import base64
import codecs
import gzip
import hashlib
import io
import logging
import re
import uuid
import... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@matplotlib@py2@matplotlib@backends@backend_svg.py@.PATH_END.py |
{
"filename": "repr_.py",
"repo_name": "LSSTDESC/CCL",
"repo_path": "CCL_extracted/CCL-master/pyccl/_core/repr_.py",
"type": "Python"
} | import numpy as np
from ..pyutils import _get_spline1d_arrays, _get_spline2d_arrays
from .caching import _to_hashable, hash_
class Table:
"""Build nice tables.
Comments describing the capabilities of each method are included below.
"""
def __init__(self, *, n_y=6, n_x=6, decimals=2,
... | LSSTDESCREPO_NAMECCLPATH_START.@CCL_extracted@CCL-master@pyccl@_core@repr_.py@.PATH_END.py |
{
"filename": "_colorscale.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/treemap/marker/_colorscale.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorscaleValidator(_plotly_utils.basevalidators.ColorscaleValidator):
def __init__(
self, plotly_name="colorscale", parent_name="treemap.marker", **kwargs
):
super(ColorscaleValidator, self).__init__(
plotly_name=plotly_name,
p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@treemap@marker@_colorscale.py@.PATH_END.py |
{
"filename": "projections.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py2/scipy/optimize/_trustregion_constr/projections.py",
"type": "Python"
} | """Basic linear factorizations needed by the solver."""
from __future__ import division, print_function, absolute_import
from scipy.sparse import (bmat, csc_matrix, eye, issparse)
from scipy.sparse.linalg import LinearOperator
import scipy.linalg
import scipy.sparse.linalg
try:
from sksparse.cholmod import cholesk... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py2@scipy@optimize@_trustregion_constr@projections.py@.PATH_END.py |
{
"filename": "analyse_cv.ipynb",
"repo_name": "SpandanCh/Barnard5_filaments",
"repo_path": "Barnard5_filaments_extracted/Barnard5_filaments-main/analyse_cv.ipynb",
"type": "Jupyter Notebook"
} | # Analyse different properties along the spines of the filaments and orthogonal cuts
```python
import astropy.io.fits as fits
import astropy.units as u
import numpy as np
import matplotlib.pyplot as plt
```
### Produce the orthogonal cuts to the spines
#### following the procedure detailed in Schmiedeke et al., 2021... | SpandanChREPO_NAMEBarnard5_filamentsPATH_START.@Barnard5_filaments_extracted@Barnard5_filaments-main@analyse_cv.ipynb@.PATH_END.py |
{
"filename": "remote_memory_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/eager/memory_tests/remote_memory_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@eager@memory_tests@remote_memory_test.py@.PATH_END.py |
{
"filename": "zeus_sampler.py",
"repo_name": "Samreay/Barry",
"repo_path": "Barry_extracted/Barry-master/barry/samplers/zeus_sampler.py",
"type": "Python"
} | import logging
import os
import numpy as np
from barry.samplers.sampler import Sampler
class ZeusSampler(Sampler):
def __init__(self, num_walkers=None, temp_dir=None, num_steps=20000, autoconverge=True, print_progress=False):
self.logger = logging.getLogger("barry")
self.num_steps = num_steps
... | SamreayREPO_NAMEBarryPATH_START.@Barry_extracted@Barry-master@barry@samplers@zeus_sampler.py@.PATH_END.py |
{
"filename": "_tickwidth.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/isosurface/colorbar/_tickwidth.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickwidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="tickwidth", parent_name="isosurface.colorbar", **kwargs
):
super(TickwidthValidator, self).__init__(
plotly_name=plotly_name,
par... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@isosurface@colorbar@_tickwidth.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "giuspugl/MCMole3D",
"repo_path": "MCMole3D_extracted/MCMole3D-master/setup.py",
"type": "Python"
} | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="mcmole3d-giuspugl",
version="0.0.1",
author="Giuseppe Puglisi",
author_email="giuse.puglisi@gmail.com",
description="Monte-Carlo realization of Galactic CO emission",
long_description... | giuspuglREPO_NAMEMCMole3DPATH_START.@MCMole3D_extracted@MCMole3D-master@setup.py@.PATH_END.py |
{
"filename": "_title.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/barpolar/marker/colorbar/_title.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Title(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "barpolar.marker.colorbar"
_path_str = "barpolar.marker.colorbar.title"
_valid_props = {"font"... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@barpolar@marker@colorbar@_title.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "astropy/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/solarsystem/__init__.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
astroquery.solarsystem
----------------------
a collection of Solar-System related data services
"""
from .jpl import SBDB, SBDBClass, Horizons, HorizonsClass
from .imcce import Miriade, MiriadeClass, Skybot, SkybotClass
from .mpc import MPC, MPCCla... | astropyREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@solarsystem@__init__.py@.PATH_END.py |
{
"filename": "_familysrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/pie/outsidetextfont/_familysrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="familysrc", parent_name="pie.outsidetextfont", **kwargs
):
super(FamilysrcValidator, self).__init__(
plotly_name=plotly_name,
parent... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@pie@outsidetextfont@_familysrc.py@.PATH_END.py |
{
"filename": "test_em.py",
"repo_name": "dstndstn/tractor",
"repo_path": "tractor_extracted/tractor-main/tractor/test_em.py",
"type": "Python"
} | from __future__ import print_function
import matplotlib
matplotlib.use('Agg')
import pylab as plt
from tractor.emfit import em_fit_1d_samples
import numpy as np
from tractor.fitpsf import em_init_params
mus = np.array([1.77, 3.7])
stds = np.array([3.9, 1.])
amps = np.array([0.8, 0.2])
N = 1000
#X = np.array(N)
a =... | dstndstnREPO_NAMEtractorPATH_START.@tractor_extracted@tractor-main@tractor@test_em.py@.PATH_END.py |
{
"filename": "_line.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/treemap/marker/_line.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "treemap.marker"
_path_str = "treemap.marker.line"
_valid_props = {"color", "colorsrc", "width"... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@treemap@marker@_line.py@.PATH_END.py |
{
"filename": "tracer_likelihood.py",
"repo_name": "sibirrer/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/lenstronomy/Sampling/Likelihoods/tracer_likelihood.py",
"type": "Python"
} | import numpy as np
from lenstronomy.Util import class_creator
class TracerLikelihood(object):
"""Class to evaluate the tracer map."""
def __init__(
self,
tracer_data,
kwargs_model,
kwargs_imaging,
tracer_likelihood_mask=None,
linear_solver=True,
):
... | sibirrerREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@lenstronomy@Sampling@Likelihoods@tracer_likelihood.py@.PATH_END.py |
{
"filename": "constants.py",
"repo_name": "ska-sa/hibayes",
"repo_path": "hibayes_extracted/hibayes-master/hibayes/constants.py",
"type": "Python"
} | """
# constants.py
Constants used for calculations within ledabayes package
"""
from numpy import pi, sqrt, log
# Constants
muJy2Jy = 1.0e-6
sqDeg2sr = 4.0 * pi * pi / 129600.0
sqrtTwo = sqrt(2.0)
Jy2muJy = 1.0e6
beamFac = pi / (4.0 * log(2.0)) | ska-saREPO_NAMEhibayesPATH_START.@hibayes_extracted@hibayes-master@hibayes@constants.py@.PATH_END.py |
{
"filename": "abscal_inspect_2458085.ipynb",
"repo_name": "HERA-Team/H1C_IDR3_Notebooks",
"repo_path": "H1C_IDR3_Notebooks-main/abscal_inspect/abscal_inspect_2458085.ipynb",
"type": "Jupyter Notebook"
} | # Stage 2 Absolute Calibration Nightly Notebook
**Josh Dillon**, Last Revised 9/23/20
```python
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from hera_cal import io, redcal, apply_cal, abscal, utils
from hera_cal.smooth_cal import build_time_blacklist
from hera_qm.metrics_io import load_metri... | HERA-TeamREPO_NAMEH1C_IDR3_NotebooksPATH_START.@H1C_IDR3_Notebooks-main@abscal_inspect@abscal_inspect_2458085.ipynb@.PATH_END.py |
{
"filename": "_plot_bgcolor.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/_plot_bgcolor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class Plot_BgcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(self, plotly_name="plot_bgcolor", parent_name="layout", **kwargs):
super(Plot_BgcolorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@_plot_bgcolor.py@.PATH_END.py |
{
"filename": "test_ls372_agent_integration.py",
"repo_name": "simonsobs/socs",
"repo_path": "socs_extracted/socs-main/tests/integration/test_ls372_agent_integration.py",
"type": "Python"
} | import os
import ocs
import pytest
from integration.util import docker_compose_file # noqa: F401
from integration.util import create_crossbar_fixture
from ocs.base import OpCode
from ocs.testing import create_agent_runner_fixture, create_client_fixture
from socs.testing.device_emulator import create_device_emulator
... | simonsobsREPO_NAMEsocsPATH_START.@socs_extracted@socs-main@tests@integration@test_ls372_agent_integration.py@.PATH_END.py |
{
"filename": "callbacks_constructor.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/how_to/callbacks_constructor.ipynb",
"type": "Jupyter Notebook"
} | # How to propagate callbacks constructor
:::info Prerequisites
This guide assumes familiarity with the following concepts:
- [Callbacks](/docs/concepts/callbacks)
- [Custom callback handlers](/docs/how_to/custom_callbacks)
:::
Most LangChain modules allow you to pass `callbacks` directly into the constructor (i.e... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@how_to@callbacks_constructor.ipynb@.PATH_END.py |
{
"filename": "GRGeometryTests.ipynb",
"repo_name": "GRTLCollaboration/engrenage",
"repo_path": "engrenage_extracted/engrenage-main/tests/GRGeometryTests.ipynb",
"type": "Jupyter Notebook"
} | ```python
# Some tests that calculate known geometric quantities
# restart the kernel to clear past work
from IPython.core.display import HTML
HTML("<script>Jupyter.notebook.kernel.restart()</script>")
```
<script>Jupyter.notebook.kernel.restart()</script>
```python
# load the required python modules
import nu... | GRTLCollaborationREPO_NAMEengrenagePATH_START.@engrenage_extracted@engrenage-main@tests@GRGeometryTests.ipynb@.PATH_END.py |
{
"filename": "test_regression.py",
"repo_name": "rhayes777/PyAutoFit",
"repo_path": "PyAutoFit_extracted/PyAutoFit-main/test_autofit/mapper/prior/test_regression.py",
"type": "Python"
} | import pytest
import autofit as af
@pytest.fixture(
name="prior"
)
def make_prior():
return af.GaussianPrior(
mean=1,
sigma=2,
lower_limit=3,
upper_limit=4
)
@pytest.fixture(
name="message"
)
def make_message(prior):
return prior.message
def test_copy_limits(me... | rhayes777REPO_NAMEPyAutoFitPATH_START.@PyAutoFit_extracted@PyAutoFit-main@test_autofit@mapper@prior@test_regression.py@.PATH_END.py |
{
"filename": "model_fitting.py",
"repo_name": "spacetelescope/jdaviz",
"repo_path": "jdaviz_extracted/jdaviz-main/jdaviz/configs/default/plugins/model_fitting/model_fitting.py",
"type": "Python"
} | import re
import numpy as np
from copy import deepcopy
import astropy.units as u
from specutils import Spectrum1D
from specutils.utils import QuantityModel
from traitlets import Bool, List, Unicode, observe
from jdaviz.configs.default.plugins.model_fitting.fitting_backend import fit_model_to_spectrum
from jdaviz.conf... | spacetelescopeREPO_NAMEjdavizPATH_START.@jdaviz_extracted@jdaviz-main@jdaviz@configs@default@plugins@model_fitting@model_fitting.py@.PATH_END.py |
{
"filename": "test_ensemble.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/tests/unit_tests/retrievers/test_ensemble.py",
"type": "Python"
} | from typing import List, Optional
from langchain_core.callbacks.manager import CallbackManagerForRetrieverRun
from langchain_core.documents import Document
from langchain_core.retrievers import BaseRetriever
from langchain.retrievers.ensemble import EnsembleRetriever
class MockRetriever(BaseRetriever):
docs: Li... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@tests@unit_tests@retrievers@test_ensemble.py@.PATH_END.py |
{
"filename": "2D_gaussian.ipynb",
"repo_name": "bfarr/kombine",
"repo_path": "kombine_extracted/kombine-master/examples/2D_gaussian.ipynb",
"type": "Jupyter Notebook"
} | ```python
import numpy as np
from scipy.stats import multivariate_normal as mvn
import kombine
```
Import some cool visualization stuff.
```python
from matplotlib import pyplot as plt
import corner
import prism
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
prism.inline_ipynb()
```
# 2-D Gauss... | bfarrREPO_NAMEkombinePATH_START.@kombine_extracted@kombine-master@examples@2D_gaussian.ipynb@.PATH_END.py |
{
"filename": "volume-plot-circum_vel.py",
"repo_name": "amrex-astro/MAESTRO",
"repo_path": "MAESTRO_extracted/MAESTRO-master/Util/postprocessing/urca-tools/volume-plot-circum_vel.py",
"type": "Python"
} | #!/usr/bin/env python
import yt
from yt.units import dimensions
from yt import derived_field
import yt.visualization.volume_rendering.api as vr
from yt.visualization.volume_rendering.transfer_function_helper import TransferFunctionHelper
from yt.visualization.volume_rendering.api import Scene, VolumeSource, Camera, Col... | amrex-astroREPO_NAMEMAESTROPATH_START.@MAESTRO_extracted@MAESTRO-master@Util@postprocessing@urca-tools@volume-plot-circum_vel.py@.PATH_END.py |
{
"filename": "deltat.py",
"repo_name": "rat-pac/rat-pac",
"repo_path": "rat-pac_extracted/rat-pac-master/python/ratproc/deltat.py",
"type": "Python"
} | from ratproc.base import Processor
from rat import ROOT
class DeltaT(Processor):
def __init__(self):
# Calculates the time since the last event in ns.
Processor.__init__(self)
self.t0 = ROOT.TTimeStamp()
self.first = True
def event(self, ds, ev):
t1 = ev.GetUTC()
... | rat-pacREPO_NAMErat-pacPATH_START.@rat-pac_extracted@rat-pac-master@python@ratproc@deltat.py@.PATH_END.py |
{
"filename": "gmosaicfile.py",
"repo_name": "GeminiDRSoftware/DRAGONS",
"repo_path": "DRAGONS_extracted/DRAGONS-master/gempy/gemini/eti/gmosaicfile.py",
"type": "Python"
} | import os
import tempfile
import re
import astrodata
import gemini_instruments
from gempy.utils import logutils
from gempy.eti_core.pyrafetifile import PyrafETIFile
from gempy.gemini import gemini_tools
log = logutils.get_logger(__name__)
class GmosaicFile(PyrafETIFile):
"""This class coordinates the ETI files ... | GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@gempy@gemini@eti@gmosaicfile.py@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/heatmap/hoverlabel/_font.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "heatmap.hoverlabel"
_path_str = "heatmap.hoverlabel.font"
_valid_props = {"color", "colorsrc",... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@heatmap@hoverlabel@_font.py@.PATH_END.py |
{
"filename": "project.py",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/src/amuse/support/project.py",
"type": "Python"
} | """
Some general functions useful for AMUSE science projects
"""
import os
import os.path
import shutil
import pickle
def new_working_directory(script_filename=None, sub_directories=[]):
"""
Call this function from your script to create a new directory and move
into it, for storing all your simulation out... | amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@src@amuse@support@project.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/barpolar/unselected/marker/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._opacity import OpacityValidator
from ._color import ColorValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._opac... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@barpolar@unselected@marker@__init__.py@.PATH_END.py |
{
"filename": "uvottemplating.py",
"repo_name": "PaulKuin/uvotpy",
"repo_path": "uvotpy_extracted/uvotpy-master/uvotpy/uvottemplating.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
#
# This software was written by N.P.M. Kuin (Paul Kuin)
# Copyright N.P.M. Kuin
# All rights reserved
# This software is licenced under a 3-clause BSD style license
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted... | PaulKuinREPO_NAMEuvotpyPATH_START.@uvotpy_extracted@uvotpy-master@uvotpy@uvottemplating.py@.PATH_END.py |
{
"filename": "jla.py",
"repo_name": "ggalloni/cobaya",
"repo_path": "cobaya_extracted/cobaya-master/cobaya/likelihoods/sn/jla.py",
"type": "Python"
} | from cobaya.likelihoods.base_classes import SN
class JLA(SN):
r"""
Likelihood of the JLA type Ia supernova sample \cite{Betoule:2014frx}, based on
observations obtained by the SDSS-II and SNLS collaborations.
"""
pass
| ggalloniREPO_NAMEcobayaPATH_START.@cobaya_extracted@cobaya-master@cobaya@likelihoods@sn@jla.py@.PATH_END.py |
{
"filename": "model_trace.py",
"repo_name": "simonsobs/nextline-rdb",
"repo_path": "nextline-rdb_extracted/nextline-rdb-main/src/nextline_rdb/models/model_trace.py",
"type": "Python"
} | from datetime import datetime
from typing import TYPE_CHECKING
from sqlalchemy import ForeignKey, UniqueConstraint
from sqlalchemy.orm import Mapped, mapped_column, relationship
from .base import Model
if TYPE_CHECKING:
from .model_prompt import Prompt
from .model_run import Run
from .model_stdout import... | simonsobsREPO_NAMEnextline-rdbPATH_START.@nextline-rdb_extracted@nextline-rdb-main@src@nextline_rdb@models@model_trace.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.