metadata
dict
text
stringlengths
0
40.6M
id
stringlengths
14
255
{ "filename": "test_opt.py", "repo_name": "mikecokina/elisa", "repo_path": "elisa_extracted/elisa-master/unittests/test_opt.py", "type": "Python" }
# keep it first # due to stupid astropy units/constants implementation from unittests import set_astropy_units import numpy as np from elisa.opt.newton import newton from unittests.utils import ElisaTestCase set_astropy_units() class NewtonSolverTestCase(ElisaTestCase): @staticmethod def x_square(x, *args...
mikecokinaREPO_NAMEelisaPATH_START.@elisa_extracted@elisa-master@unittests@test_opt.py@.PATH_END.py
{ "filename": "tensorflow_datasets.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/document_loaders/tensorflow_datasets.py", "type": "Python" }
from typing import Callable, Dict, Iterator, Optional from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader from langchain_community.utilities.tensorflow_datasets import TensorflowDatasets class TensorflowDatasetLoader(BaseLoader): """Load from `TensorFlo...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@document_loaders@tensorflow_datasets.py@.PATH_END.py
{ "filename": "_orientation.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/barpolar/marker/colorbar/_orientation.py", "type": "Python" }
import _plotly_utils.basevalidators class OrientationValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="orientation", parent_name="barpolar.marker.colorbar", **kwargs, ): super(OrientationValidator, self).__init__( ...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@barpolar@marker@colorbar@_orientation.py@.PATH_END.py
{ "filename": "_linewidth.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/scene/yaxis/_linewidth.py", "type": "Python" }
import _plotly_utils.basevalidators class LinewidthValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="linewidth", parent_name="layout.scene.yaxis", **kwargs ): super(LinewidthValidator, self).__init__( plotly_name=plotly_name, pare...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@scene@yaxis@_linewidth.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/shape/line/__init__.py", "type": "Python" }
import sys if sys.version_info < (3, 7): from ._width import WidthValidator from ._dash import DashValidator from ._color import ColorValidator else: from _plotly_utils.importers import relative_import __all__, __getattr__, __dir__ = relative_import( __name__, [], ["._width...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@shape@line@__init__.py@.PATH_END.py
{ "filename": "_variantsrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/surface/hoverlabel/font/_variantsrc.py", "type": "Python" }
import _plotly_utils.basevalidators class VariantsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="variantsrc", parent_name="surface.hoverlabel.font", **kwargs ): super(VariantsrcValidator, self).__init__( plotly_name=plotly_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@surface@hoverlabel@font@_variantsrc.py@.PATH_END.py
{ "filename": "_font.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/streamtube/hoverlabel/_font.py", "type": "Python" }
import _plotly_utils.basevalidators class FontValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__( self, plotly_name="font", parent_name="streamtube.hoverlabel", **kwargs ): super(FontValidator, self).__init__( plotly_name=plotly_name, parent_name=pa...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@streamtube@hoverlabel@_font.py@.PATH_END.py
{ "filename": "_ticktextsrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattermapbox/marker/colorbar/_ticktextsrc.py", "type": "Python" }
import _plotly_utils.basevalidators class TicktextsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="ticktextsrc", parent_name="scattermapbox.marker.colorbar", **kwargs, ): super(TicktextsrcValidator, self).__init__( pl...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattermapbox@marker@colorbar@_ticktextsrc.py@.PATH_END.py
{ "filename": "_delaunayaxis.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/mesh3d/_delaunayaxis.py", "type": "Python" }
import _plotly_utils.basevalidators class DelaunayaxisValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="delaunayaxis", parent_name="mesh3d", **kwargs): super(DelaunayaxisValidator, self).__init__( plotly_name=plotly_name, parent_name=paren...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@mesh3d@_delaunayaxis.py@.PATH_END.py
{ "filename": "icecube_dom_acceptance.py", "repo_name": "claudiok/clsim", "repo_path": "clsim_extracted/clsim-master/resources/plots/icecube_dom_acceptance.py", "type": "Python" }
#!/usr/bin/env python #-------------------------------------------- # plot_icecube_dom_acceptance.py # # A script to plot the wavelength dependent # acceptance of the IceCube DOM as implemented # in python/GetIceCubeDOMAcceptance.py #-------------------------------------------- import matplotlib matplotlib.use("PDF")...
claudiokREPO_NAMEclsimPATH_START.@clsim_extracted@clsim-master@resources@plots@icecube_dom_acceptance.py@.PATH_END.py
{ "filename": "BackyardWorldsCafe2.ipynb", "repo_name": "astro-datalab/notebooks-latest", "repo_path": "notebooks-latest_extracted/notebooks-latest-master/06_EPO/e-TeenAstronomyCafe/12_Discovering_New_Neighbors_of_the_Sun/BackyardWorldsCafe2.ipynb", "type": "Jupyter Notebook" }
<img src="Figures/logo154.svg" alt="to Go logo" width="100" align="right"/> <br> <br> <font size='6'><u><b>Discovering New Neighbors of the Sun</b></u></font> <br> _**Written by Aaron Meisner, NSF's NOIRLab**_ # Table of Contents * [How to Use This Notebook](#How-to-Use-This-Notebook) * [Pre-Activity Setup](#Pre-Act...
astro-datalabREPO_NAMEnotebooks-latestPATH_START.@notebooks-latest_extracted@notebooks-latest-master@06_EPO@e-TeenAstronomyCafe@12_Discovering_New_Neighbors_of_the_Sun@BackyardWorldsCafe2.ipynb@.PATH_END.py
{ "filename": "hist.py", "repo_name": "itseez/opencv", "repo_path": "opencv_extracted/opencv-master/samples/python/hist.py", "type": "Python" }
#!/usr/bin/env python ''' This is a sample for histogram plotting for RGB images and grayscale images for better understanding of colour distribution Benefit : Learn how to draw histogram of images Get familier with cv.calcHist, cv.equalizeHist,cv.normalize and some drawing functions Level : Beginner or In...
itseezREPO_NAMEopencvPATH_START.@opencv_extracted@opencv-master@samples@python@hist.py@.PATH_END.py
{ "filename": "correct.ipynb", "repo_name": "j-faria/kima", "repo_path": "kima_extracted/kima-master/celerite/paper/figures/simulated/correct.ipynb", "type": "Jupyter Notebook" }
```python %matplotlib inline %config IPython.matplotlib.backend = "retina" from matplotlib import rcParams rcParams["savefig.dpi"] = 300 rcParams["figure.dpi"] = 300 from celerite import plot_setup plot_setup.setup(auto=False) ``` ## Recovery of a celerite process ```python import numpy as np import matplotlib.pypl...
j-fariaREPO_NAMEkimaPATH_START.@kima_extracted@kima-master@celerite@paper@figures@simulated@correct.ipynb@.PATH_END.py
{ "filename": "test_transforms.py", "repo_name": "pytorch/vision", "repo_path": "vision_extracted/vision-main/test/test_transforms.py", "type": "Python" }
import math import os import random import re import sys from functools import partial import numpy as np import pytest import torch import torchvision.transforms as transforms import torchvision.transforms._functional_tensor as F_t import torchvision.transforms.functional as F from PIL import Image from torch._utils_...
pytorchREPO_NAMEvisionPATH_START.@vision_extracted@vision-main@test@test_transforms.py@.PATH_END.py
{ "filename": "extract_features.py", "repo_name": "ahmedfgad/GeneticAlgorithmPython", "repo_path": "GeneticAlgorithmPython_extracted/GeneticAlgorithmPython-master/examples/nn/extract_features.py", "type": "Python" }
import numpy import skimage.io, skimage.color, skimage.feature import os dataset_dir = "../data/Fruit360" fruits = ["apple", "raspberry", "mango", "lemon"] # Number of samples in the datset used = 492+490+490+490=1,962 # 360 is the length of the feature vector. dataset_features = numpy.zeros(shape=(1962, 360)) outputs...
ahmedfgadREPO_NAMEGeneticAlgorithmPythonPATH_START.@GeneticAlgorithmPython_extracted@GeneticAlgorithmPython-master@examples@nn@extract_features.py@.PATH_END.py
{ "filename": "colorable.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/ipython/py2/IPython/utils/colorable.py", "type": "Python" }
#***************************************************************************** # Copyright (C) 2016 The IPython Team <ipython-dev@scipy.org> # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #********************************************...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipython@py2@IPython@utils@colorable.py@.PATH_END.py
{ "filename": "matrix_dft.py", "repo_name": "spacetelescope/jwst", "repo_path": "jwst_extracted/jwst-main/jwst/ami/matrix_dft.py", "type": "Python" }
""" Summary ------- MatrixDFT: Matrix-based discrete Fourier transforms for computing PSFs. See Soummer et al. 2007 JOSA The main user interface in this module is a class MatrixFourierTransform. Internally this will call one of several subfunctions depending on the specified centering type. ...
spacetelescopeREPO_NAMEjwstPATH_START.@jwst_extracted@jwst-main@jwst@ami@matrix_dft.py@.PATH_END.py
{ "filename": "figure4-lsbi-prior-dependence.py", "repo_name": "htjb/tension-networks", "repo_path": "tension-networks_extracted/tension-networks-main/figure4-lsbi-prior-dependence.py", "type": "Python" }
from lsbi.model import LinearModel from lsbi.stats import multivariate_normal import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from tensionnet.tensionnet import nre import tensorflow as tf from tensorflow.keras.optimizers.schedules import ExponentialDecay import numpy as np from rand...
htjbREPO_NAMEtension-networksPATH_START.@tension-networks_extracted@tension-networks-main@figure4-lsbi-prior-dependence.py@.PATH_END.py
{ "filename": "stannet.py", "repo_name": "tomasplsek/CADET", "repo_path": "CADET_extracted/CADET-main/training_testing/stannet.py", "type": "Python" }
from tensorflow.keras.initializers import Constant, TruncatedNormal, HeNormal from tensorflow.keras.models import Model from tensorflow.keras.layers import Activation, BatchNormalization, concatenate, Conv2D, Dropout, Input, PReLU ##################### STAN's MODEL ##################### stride = (1, 1) shapes_layers...
tomasplsekREPO_NAMECADETPATH_START.@CADET_extracted@CADET-main@training_testing@stannet.py@.PATH_END.py
{ "filename": "_showscale.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/streamtube/_showscale.py", "type": "Python" }
import _plotly_utils.basevalidators class ShowscaleValidator(_plotly_utils.basevalidators.BooleanValidator): def __init__(self, plotly_name="showscale", parent_name="streamtube", **kwargs): super(ShowscaleValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@streamtube@_showscale.py@.PATH_END.py
{ "filename": "pyopengl2.py", "repo_name": "macrocosme/shwirl", "repo_path": "shwirl_extracted/shwirl-master/shwirl/extern/vispy/gloo/gl/pyopengl2.py", "type": "Python" }
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ GL ES 2.0 API implemented via pyOpenGL library. Intended as a fallback and for testing. """ from OpenGL import GL as _GL import OpenGL.GL.framebufferobjects as _FBO from...
macrocosmeREPO_NAMEshwirlPATH_START.@shwirl_extracted@shwirl-master@shwirl@extern@vispy@gloo@gl@pyopengl2.py@.PATH_END.py
{ "filename": "bilby_example.py", "repo_name": "mj-will/nessai", "repo_path": "nessai_extracted/nessai-main/examples/bilby_example.py", "type": "Python" }
#!/usr/bin/env python # Example of using nessai with Bilby (Requires separate installation) # See 2d_gaussian.py for a more detailed explanation of using nessai import bilby import numpy as np # The output from the sampler will be saved to: # '$outdir/$label_nessai/' # alongside the usual bilby outputs outdir = "./o...
mj-willREPO_NAMEnessaiPATH_START.@nessai_extracted@nessai-main@examples@bilby_example.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "tcollett/LensPop", "repo_path": "LensPop_extracted/LensPop-master/stellarpop/bak25sep12/__init__.py", "type": "Python" }
import distances
tcollettREPO_NAMELensPopPATH_START.@LensPop_extracted@LensPop-master@stellarpop@bak25sep12@__init__.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/funnelarea/stream/__init__.py", "type": "Python" }
import sys if sys.version_info < (3, 7): from ._token import TokenValidator from ._maxpoints import MaxpointsValidator else: from _plotly_utils.importers import relative_import __all__, __getattr__, __dir__ = relative_import( __name__, [], ["._token.TokenValidator", "._maxpoints.MaxpointsValid...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@funnelarea@stream@__init__.py@.PATH_END.py
{ "filename": "setup_package.py", "repo_name": "radio-astro-tools/spectral-cube", "repo_path": "spectral-cube_extracted/spectral-cube-master/spectral_cube/tests/setup_package.py", "type": "Python" }
def get_package_data(): return { _ASTROPY_PACKAGE_NAME_ + '.tests': ['coveragerc', 'data/*.fits', 'data/*.hdr', 'data/*.lmv', 'data/*reg'] }
radio-astro-toolsREPO_NAMEspectral-cubePATH_START.@spectral-cube_extracted@spectral-cube-master@spectral_cube@tests@setup_package.py@.PATH_END.py
{ "filename": "test_interaction.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/ipywidgets/py3/ipywidgets/widgets/tests/test_interaction.py", "type": "Python" }
# Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. """Test interact and interactive.""" from unittest.mock import patch import os from enum import Enum from collections import OrderedDict import pytest import ipywidgets as widgets from traitlets import TraitError, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipywidgets@py3@ipywidgets@widgets@tests@test_interaction.py@.PATH_END.py
{ "filename": "conf.py", "repo_name": "spacetelescope/hstaxe", "repo_path": "hstaxe_extracted/hstaxe-main/docs/conf.py", "type": "Python" }
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
spacetelescopeREPO_NAMEhstaxePATH_START.@hstaxe_extracted@hstaxe-main@docs@conf.py@.PATH_END.py
{ "filename": "position_dependent_power_spectrum.py", "repo_name": "sambit-giri/tools21cm", "repo_path": "tools21cm_extracted/tools21cm-master/src/tools21cm/position_dependent_power_spectrum.py", "type": "Python" }
import numpy as np from tqdm import tqdm from .power_spectrum import * def power_spectrum_response(cube, cube2=None, Ncuts=4, kbins=15, box_dims=244/.7, binning='log', verbose=True): """ Calculate the response of a field to large-scale fluctuations (Giri et al. 2019, arXiv:1811.09633). Parameters: - cube1 (numpy...
sambit-giriREPO_NAMEtools21cmPATH_START.@tools21cm_extracted@tools21cm-master@src@tools21cm@position_dependent_power_spectrum.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "NuSpaceSim/nupyprop", "repo_path": "nupyprop_extracted/nupyprop-main/tests/__init__.py", "type": "Python" }
NuSpaceSimREPO_NAMEnupypropPATH_START.@nupyprop_extracted@nupyprop-main@tests@__init__.py@.PATH_END.py
{ "filename": "setup.py", "repo_name": "timothydmorton/VESPA", "repo_path": "VESPA_extracted/VESPA-master/setup.py", "type": "Python" }
from setuptools import setup, Extension, find_packages on_rtd = False try: from Cython.Distutils import build_ext from Cython.Build import cythonize import numpy except ImportError: on_rtd = True numpy = None build_ext = None import os def readme(): with open('README.rst') as f: r...
timothydmortonREPO_NAMEVESPAPATH_START.@VESPA_extracted@VESPA-master@setup.py@.PATH_END.py
{ "filename": "test_bayesian_model.py", "repo_name": "renecotyfanboy/jaxspec", "repo_path": "jaxspec_extracted/jaxspec-main/tests/test_bayesian_model.py", "type": "Python" }
import operator import jax import jax.numpy as jnp from jaxspec._fit._build_model import build_numpyro_model_for_single_obs, build_prior from jaxspec.fit import BayesianModel from numpyro.infer.inspect import get_model_relations def test_model_building(obs_model_prior): """ Check that all parameters are bui...
renecotyfanboyREPO_NAMEjaxspecPATH_START.@jaxspec_extracted@jaxspec-main@tests@test_bayesian_model.py@.PATH_END.py
{ "filename": "_textpositionsrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/waterfall/_textpositionsrc.py", "type": "Python" }
import _plotly_utils.basevalidators class TextpositionsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="textpositionsrc", parent_name="waterfall", **kwargs ): super(TextpositionsrcValidator, self).__init__( plotly_name=plotly_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@waterfall@_textpositionsrc.py@.PATH_END.py
{ "filename": "ackbar.py", "repo_name": "sebastian-zieba/PACMAN", "repo_path": "PACMAN_extracted/PACMAN-master/src/pacman/lib/models/ackbar.py", "type": "Python" }
# ! /usr/bin/env python """ramp effect model 2 means two types of traps original author: Daniel Apai Version 0.3 fixing trapping parameters Version 0.2.1 introduce two types of traps, slow traps and fast traps Version 0.2: add extra keyword parameter to indicate scan or staring mode observations for staring mode, t...
sebastian-ziebaREPO_NAMEPACMANPATH_START.@PACMAN_extracted@PACMAN-master@src@pacman@lib@models@ackbar.py@.PATH_END.py
{ "filename": "test_MBB_errors.py", "repo_name": "mjuvela/ISM", "repo_path": "ISM_extracted/ISM-master/MBB/test_MBB_errors.py", "type": "Python" }
import os, sys ISM_DIRECTORY = os.path.expanduser('~/GITHUB') try: ISM_DIRECTORY = os.environ(['ISM_DIRECTORY']) except: pass sys.path.append(ISM_DIRECTORY) from ISM.Defs import * from ISM.FITS.FITS import CopyFits, MakeEmptyFitsDim from ISM.MBB.MBB_MCMC import * import matplotlib.ticker as ticker imp...
mjuvelaREPO_NAMEISMPATH_START.@ISM_extracted@ISM-master@MBB@test_MBB_errors.py@.PATH_END.py
{ "filename": "ui-notes.md", "repo_name": "Caltech-IPAC/firefly", "repo_path": "firefly_extracted/firefly-master/docs/ui-notes.md", "type": "Markdown" }
# UI Notes ### Miscellaneous - toolbar background: `<Sheet variant='soft'>` or `<Sheet className='TapSearch__section' variant='outline' sx={{flexDirection: 'column', flexGrow: 1}}>` - Use `Divider` instead of border where possible - `sx` is mostly not necessary for `Box` and `Stack` as these are considered `CSS Utilit...
Caltech-IPACREPO_NAMEfireflyPATH_START.@firefly_extracted@firefly-master@docs@ui-notes.md@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "waynebhayes/SpArcFiRe", "repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/pyfits/tests/__init__.py", "type": "Python" }
from __future__ import division # confidence high import os import shutil import stat import tempfile import time import warnings import pyfits as fits class PyfitsTestCase(object): def setup(self): self.data_dir = os.path.join(os.path.dirname(__file__), 'data') self.temp_dir = tempfile.mkdtemp...
waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@pyfits@tests@__init__.py@.PATH_END.py
{ "filename": "_shape.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter/fillpattern/_shape.py", "type": "Python" }
import _plotly_utils.basevalidators class ShapeValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="shape", parent_name="scatter.fillpattern", **kwargs ): super(ShapeValidator, self).__init__( plotly_name=plotly_name, parent_name...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter@fillpattern@_shape.py@.PATH_END.py
{ "filename": "test_year.py", "repo_name": "pandas-dev/pandas", "repo_path": "pandas_extracted/pandas-main/pandas/tests/tseries/offsets/test_year.py", "type": "Python" }
""" Tests for the following offsets: - YearBegin - YearEnd """ from __future__ import annotations from datetime import datetime import numpy as np import pytest from pandas import Timestamp from pandas.tests.tseries.offsets.common import ( assert_is_on_offset, assert_offset_equal, ) from pandas.tseries.off...
pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@tseries@offsets@test_year.py@.PATH_END.py
{ "filename": "test_feature.py", "repo_name": "light-curve/light-curve-python", "repo_path": "light-curve-python_extracted/light-curve-python-master/light-curve/tests/light_curve_ext/test_feature.py", "type": "Python" }
import copy import inspect import pickle import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal import light_curve.light_curve_ext as lc def _feature_classes(module, *, exclude_parametric=True): for name, member in inspect.getmembers(module): if name.startswith("_...
light-curveREPO_NAMElight-curve-pythonPATH_START.@light-curve-python_extracted@light-curve-python-master@light-curve@tests@light_curve_ext@test_feature.py@.PATH_END.py
{ "filename": "array_descriptor.py", "repo_name": "rapidsai/cuml", "repo_path": "cuml_extracted/cuml-main/python/cuml/cuml/common/array_descriptor.py", "type": "Python" }
# # Copyright (c) 2020-2023, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
rapidsaiREPO_NAMEcumlPATH_START.@cuml_extracted@cuml-main@python@cuml@cuml@common@array_descriptor.py@.PATH_END.py
{ "filename": "_ticklen.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/mesh3d/colorbar/_ticklen.py", "type": "Python" }
import _plotly_utils.basevalidators class TicklenValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="ticklen", parent_name="mesh3d.colorbar", **kwargs): super(TicklenValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@mesh3d@colorbar@_ticklen.py@.PATH_END.py
{ "filename": "validator.md", "repo_name": "ultralytics/ultralytics", "repo_path": "ultralytics_extracted/ultralytics-main/docs/en/reference/engine/validator.md", "type": "Markdown" }
--- description: Explore Ultralytics BaseValidator for model validation in PyTorch, TensorFlow, ONNX, and more. Learn to check model accuracy and performance metrics. keywords: Ultralytics, BaseValidator, model validation, PyTorch, TensorFlow, ONNX, model accuracy, performance metrics --- # Reference for `ultralytics/...
ultralyticsREPO_NAMEultralyticsPATH_START.@ultralytics_extracted@ultralytics-main@docs@en@reference@engine@validator.md@.PATH_END.py
{ "filename": "obs_extinction.py", "repo_name": "msiebert1/UCSC_spectral_pipeline", "repo_path": "UCSC_spectral_pipeline_extracted/UCSC_spectral_pipeline-master/spectral_reduction/tmath/pydux/obs_extinction.py", "type": "Python" }
def obs_extinction(observat): import numpy as np observatory_heights={'keck':4160, 'gemini-north': 4213.4, 'gemini-south': 2737.0, 'gemini-n': 4213.4, 'gemini-s': 2737.0, 'soar': 2737.0, ...
msiebert1REPO_NAMEUCSC_spectral_pipelinePATH_START.@UCSC_spectral_pipeline_extracted@UCSC_spectral_pipeline-master@spectral_reduction@tmath@pydux@obs_extinction.py@.PATH_END.py
{ "filename": "README.md", "repo_name": "pynbody/pynbody", "repo_path": "pynbody_extracted/pynbody-master/README.md", "type": "Markdown" }
pynbody ======= [![Build Status](https://github.com/pynbody/pynbody/actions/workflows/build-test.yaml/badge.svg?branch=master)](https://github.com/pynbody/pynbody/actions) [Pynbody](https://github.com/pynbody/pynbody) is an analysis framework for N-body and hydrodynamic astrophysical simulations supporting PKDGRAV/Gas...
pynbodyREPO_NAMEpynbodyPATH_START.@pynbody_extracted@pynbody-master@README.md@.PATH_END.py
{ "filename": "Wfunctions_test.ipynb", "repo_name": "bradkav/WIMpy_NREFT", "repo_path": "WIMpy_NREFT_extracted/WIMpy_NREFT-main/old_WIMpy/Wfunctions_test.ipynb", "type": "Jupyter Notebook" }
## Testing the python implementation of the structure functions ```python import numpy as np from matplotlib import pylab as pl ``` Load in the fortran structure functions ```python import WD, WM, WMP2, WP1, WP2, WS1, WS2, WS1D print WD.__doc__ ``` This module 'WD' is auto-generated with f2py (version:2). ...
bradkavREPO_NAMEWIMpy_NREFTPATH_START.@WIMpy_NREFT_extracted@WIMpy_NREFT-main@old_WIMpy@Wfunctions_test.ipynb@.PATH_END.py
{ "filename": "gpwatch_7DT.py", "repo_name": "SilverRon/gppy", "repo_path": "gppy_extracted/gppy-main/gpwatch_7DT.py", "type": "Python" }
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #%% #============================================================ # Module #------------------------------------------------------------ import os import sys # import glob import time from util import tool # IMSNGpy modules # sys.path.append('/home/paek/imsngpy') # from mi...
SilverRonREPO_NAMEgppyPATH_START.@gppy_extracted@gppy-main@gpwatch_7DT.py@.PATH_END.py
{ "filename": "rfi_inspect_2458155.ipynb", "repo_name": "HERA-Team/H1C_IDR3_Notebooks", "repo_path": "H1C_IDR3_Notebooks-main/rfi_inspect/rfi_inspect_2458155.ipynb", "type": "Jupyter Notebook" }
# RFI Inspection Daily RTP Notebook ```python import numpy as np import matplotlib.pyplot as plt import matplotlib import glob import os from astropy import units from copy import deepcopy from pyuvdata import UVFlag import matplotlib.colors as colors from matplotlib import cm %matplotlib inline %config InlineBacken...
HERA-TeamREPO_NAMEH1C_IDR3_NotebooksPATH_START.@H1C_IDR3_Notebooks-main@rfi_inspect@rfi_inspect_2458155.ipynb@.PATH_END.py
{ "filename": "_contour.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/template/data/_contour.py", "type": "Python" }
import _plotly_utils.basevalidators class ContourValidator(_plotly_utils.basevalidators.CompoundArrayValidator): def __init__( self, plotly_name="contour", parent_name="layout.template.data", **kwargs ): super(ContourValidator, self).__init__( plotly_name=plotly_name, p...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@template@data@_contour.py@.PATH_END.py
{ "filename": "plot_opacity.py", "repo_name": "dullemond/radmc3d-2.0", "repo_path": "radmc3d-2.0_extracted/radmc3d-2.0-master/opac/dust_continuum/astrosil_laordraine/plot_opacity.py", "type": "Python" }
import numpy as np import matplotlib.pyplot as plt from radmc3dPy.analyze import * o = readOpac(ext=['astrosilicate_laordraine93'],scatmat=[True]) plt.figure() plt.plot(o.wav[0],o.kabs[0],label=r'$\kappa_{a}$ (absorption)') plt.plot(o.wav[0],o.ksca[0],label=r'$\kappa_{s}$ (scattering)') plt.xscale('log') plt.yscale('...
dullemondREPO_NAMEradmc3d-2.0PATH_START.@radmc3d-2.0_extracted@radmc3d-2.0-master@opac@dust_continuum@astrosil_laordraine@plot_opacity.py@.PATH_END.py
{ "filename": "prop_begin.py", "repo_name": "ajeldorado/falco-python", "repo_path": "falco-python_extracted/falco-python-master/falco/proper/prop_begin.py", "type": "Python" }
# Copyright 2016, 2017 California Institute of Technology # Users must agree to abide by the restrictions listed in the # file "LegalStuff.txt" in the PROPER library directory. # # PROPER developed at Jet Propulsion Laboratory/California Inst. Technology # Original IDL version by John Krist # Python transla...
ajeldoradoREPO_NAMEfalco-pythonPATH_START.@falco-python_extracted@falco-python-master@falco@proper@prop_begin.py@.PATH_END.py
{ "filename": "photometry_AB_to_Jy.py", "repo_name": "astrom-tom/SPARTAN", "repo_path": "SPARTAN_extracted/SPARTAN-master/spartan/photometry_AB_to_Jy.py", "type": "Python" }
''' The SPARTAN Project ------------------- conversion from AB to Jy and other way around From http://www.star.bristol.ac.uk/~mbt/stilts/sun256/uk.ac.starlink.ttools.func.Fluxes.html @Author R. THOMAS @year 2017 @place UV/LAM/UCBJ/ESO @License: GPL v3.0 licence - see LICENCE.txt ''' ##python libraries import nump...
astrom-tomREPO_NAMESPARTANPATH_START.@SPARTAN_extracted@SPARTAN-master@spartan@photometry_AB_to_Jy.py@.PATH_END.py
{ "filename": "fit_MM_MCPM_EMCEE_yaml_v1.py", "repo_name": "CPM-project/MCPM", "repo_path": "MCPM_extracted/MCPM-master/examples/fit_MM_MCPM_EMCEE_yaml_v1.py", "type": "Python" }
""" A simple script for running fit_MM_MCPM_EMCEE_v1.py using input from a YAML file. """ import yaml import sys import os from astropy.coordinates import SkyCoord from astropy import units as u from fit_MM_MCPM_EMCEE_v1 import fit_MM_MCPM_EMCEE if __name__ == '__main__': if len(sys.argv) != 2: raise Val...
CPM-projectREPO_NAMEMCPMPATH_START.@MCPM_extracted@MCPM-master@examples@fit_MM_MCPM_EMCEE_yaml_v1.py@.PATH_END.py
{ "filename": "optim.py", "repo_name": "pyro-ppl/pyro", "repo_path": "pyro_extracted/pyro-master/pyro/optim/optim.py", "type": "Python" }
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import inspect from typing import ( Any, Callable, Dict, Iterable, List, Optional, Type, Union, ValuesView, ) import torch from torch import Tensor from torch.nn.utils import clip_grad_norm_, cl...
pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@pyro@optim@optim.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "ultralytics/yolov5", "repo_path": "yolov5_extracted/yolov5-master/models/__init__.py", "type": "Python" }
ultralyticsREPO_NAMEyolov5PATH_START.@yolov5_extracted@yolov5-master@models@__init__.py@.PATH_END.py
{ "filename": "nn.py", "repo_name": "keras-team/keras", "repo_path": "keras_extracted/keras-master/keras/src/backend/jax/nn.py", "type": "Python" }
import builtins import math import jax import jax.experimental.sparse as jax_sparse import jax.numpy as jnp from jax import lax from jax import nn as jnn from jax.experimental.pallas.ops.tpu import ( flash_attention as flash_attention_tpu, ) from keras.src import backend from keras.src.backend.common.backend_util...
keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@backend@jax@nn.py@.PATH_END.py
{ "filename": "fn_system.py", "repo_name": "mtalapinto/moes", "repo_path": "feros/optics/fn_system.py", "type": "Python" }
from . import transform import copy from . import cte from . import spheric_surface from . import refraction_index import numpy as np from . import trace def tracing(H, DC, Tin, l0, t, p, fn_data): H[:, 2] = 0. #Orientation DC_out = transform.transform(DC, -Tin) H_out = transform.transform(H, -Tin) ...
mtalapintoREPO_NAMEmoesPATH_START.@feros@optics@fn_system.py@.PATH_END.py
{ "filename": "_lat.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattergeo/_lat.py", "type": "Python" }
import _plotly_utils.basevalidators class LatValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__(self, plotly_name="lat", parent_name="scattergeo", **kwargs): super(LatValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattergeo@_lat.py@.PATH_END.py
{ "filename": "test_pulsar.py", "repo_name": "vallis/libstempo", "repo_path": "libstempo_extracted/libstempo-master/tests/test_pulsar.py", "type": "Python" }
import shutil import unittest from pathlib import Path import libstempo as t2 import numpy as np DATA_PATH = t2.__path__[0] + "/data/" TMP_DIR = Path("test_output") TMP_DIR.mkdir(exist_ok=True) try: NP_LONG_DOUBLE_TYPE = np.float128 except AttributeError: NP_LONG_DOUBLE_TYPE = np.double class TestDetermin...
vallisREPO_NAMElibstempoPATH_START.@libstempo_extracted@libstempo-master@tests@test_pulsar.py@.PATH_END.py
{ "filename": "SNR_powerspec.py", "repo_name": "JaidenCook/OSIRIS", "repo_path": "OSIRIS_extracted/OSIRIS-main/pipeline/SNR_powerspec.py", "type": "Python" }
#!/usr/bin/python __author__ = "Jaiden Cook" __credits__ = ["Jaiden Cook"] __version__ = "0.0.0" __maintainer__ = "Jaiden Cook" __email__ = "Jaiden.Cook@student.curtin.edu" # Generic stuff: #%matplotlib notebook import os,sys import time from datetime import datetime import glob import shutil import re from math impo...
JaidenCookREPO_NAMEOSIRISPATH_START.@OSIRIS_extracted@OSIRIS-main@pipeline@SNR_powerspec.py@.PATH_END.py
{ "filename": "test_sampled.py", "repo_name": "astropy/astropy", "repo_path": "astropy_extracted/astropy-main/astropy/timeseries/tests/test_sampled.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst from datetime import datetime import pytest from numpy.testing import assert_allclose, assert_equal from astropy import units as u from astropy.table import Column, Table from astropy.tests.helper import assert_quantity_allclose from astropy.time import...
astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@timeseries@tests@test_sampled.py@.PATH_END.py
{ "filename": "ChainContext.py", "repo_name": "BradGreig/21CMMC", "repo_path": "21CMMC_extracted/21CMMC-master/21CMMC_SourceCode/Programs/CosmoHammer_21CMMC/likelihood/ChainContext.py", "type": "Python" }
from CosmoHammer_21CMMC.likelihood.ChainConstants import * class ChainContext(object): """ Context holding a dict to store data and information durring the computation of the likelihood """ def __init__(self, parent, params): """ Constructor of the context """ ...
BradGreigREPO_NAME21CMMCPATH_START.@21CMMC_extracted@21CMMC-master@21CMMC_SourceCode@Programs@CosmoHammer_21CMMC@likelihood@ChainContext.py@.PATH_END.py
{ "filename": "test_scrape.py", "repo_name": "rhayes777/PyAutoFit", "repo_path": "PyAutoFit_extracted/PyAutoFit-main/test_autofit/aggregator/test_scrape.py", "type": "Python" }
import pytest from autofit import SearchOutput from autofit.database.aggregator.scrape import _add_files class MockFit: def __init__(self): self.jsons = {} id = "id" def set_json(self, name, json): self.jsons[name] = json def __setitem__(self, key, value): pass def set...
rhayes777REPO_NAMEPyAutoFitPATH_START.@PyAutoFit_extracted@PyAutoFit-main@test_autofit@aggregator@test_scrape.py@.PATH_END.py
{ "filename": "BADASS3_config_test_example-checkpoint.ipynb", "repo_name": "remingtonsexton/BADASS3", "repo_path": "BADASS3_extracted/BADASS3-master/example_notebooks/.ipynb_checkpoints/BADASS3_config_test_example-checkpoint.ipynb", "type": "Jupyter Notebook" }
## Bayesian AGN Decomposition Analysis for SDSS Spectra (BADASS) ### Single Spectrum Configuration Test Example This notebook shows how to perform configuration testing. Configuration testing is different from line testing. Line testing performs tests on individual lines, whereas configurations can be multiple diffe...
remingtonsextonREPO_NAMEBADASS3PATH_START.@BADASS3_extracted@BADASS3-master@example_notebooks@.ipynb_checkpoints@BADASS3_config_test_example-checkpoint.ipynb@.PATH_END.py
{ "filename": "conviqt.ipynb", "repo_name": "hpc4cmb/toast", "repo_path": "toast_extracted/toast-main/tutorial/04_Simulated_Instrument_Signal/conviqt.ipynb", "type": "Jupyter Notebook" }
# $4\pi$ beam convolution TOAST provides an interface, `OpSimConviqt`, to the spherical harmonic convolution library, `libconviqt`. It was developed by Gary Prezeau and Martin Reinecke and described in ``` G. Prézeau and M. Reinecke: Algorithm for the Evaluation of Reduced Wigner Matrices, APJS 190 (2010) 267 ``` [ar...
hpc4cmbREPO_NAMEtoastPATH_START.@toast_extracted@toast-main@tutorial@04_Simulated_Instrument_Signal@conviqt.ipynb@.PATH_END.py
{ "filename": "test_embeddings.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/cli/langchain_cli/integration_template/tests/integration_tests/test_embeddings.py", "type": "Python" }
"""Test __ModuleName__ embeddings.""" from typing import Type from __module_name__.embeddings import __ModuleName__Embeddings from langchain_tests.integration_tests import EmbeddingsIntegrationTests class TestParrotLinkEmbeddingsIntegration(EmbeddingsIntegrationTests): @property def embeddings_class(self) -...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@cli@langchain_cli@integration_template@tests@integration_tests@test_embeddings.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "Jammy2211/PyAutoLens", "repo_path": "PyAutoLens_extracted/PyAutoLens-main/test_autolens/interferometer/plot/__init__.py", "type": "Python" }
Jammy2211REPO_NAMEPyAutoLensPATH_START.@PyAutoLens_extracted@PyAutoLens-main@test_autolens@interferometer@plot@__init__.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "NASA-Planetary-Science/sbpy", "repo_path": "sbpy_extracted/sbpy-main/sbpy/data/tests/__init__.py", "type": "Python" }
NASA-Planetary-ScienceREPO_NAMEsbpyPATH_START.@sbpy_extracted@sbpy-main@sbpy@data@tests@__init__.py@.PATH_END.py
{ "filename": "_name.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/mesh3d/colorbar/tickformatstop/_name.py", "type": "Python" }
import _plotly_utils.basevalidators class NameValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="name", parent_name="mesh3d.colorbar.tickformatstop", **kwargs ): super(NameValidator, self).__init__( plotly_name=plotly_name, parent_...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@mesh3d@colorbar@tickformatstop@_name.py@.PATH_END.py
{ "filename": "_opacitysrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/funnel/marker/_opacitysrc.py", "type": "Python" }
import _plotly_utils.basevalidators class OpacitysrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__(self, plotly_name="opacitysrc", parent_name="funnel.marker", **kwargs): super(OpacitysrcValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@funnel@marker@_opacitysrc.py@.PATH_END.py
{ "filename": "_color.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/choroplethmapbox/colorbar/tickfont/_color.py", "type": "Python" }
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="choroplethmapbox.colorbar.tickfont", **kwargs, ): super(ColorValidator, self).__init__( plotly_name=p...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@choroplethmapbox@colorbar@tickfont@_color.py@.PATH_END.py
{ "filename": "log.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/traitlets/py3/traitlets/log.py", "type": "Python" }
"""Grab the global logger instance.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import annotations import logging from typing import Any _logger: logging.Logger | logging.LoggerAdapter[Any] | None = None def get_logger() -> logging.Logger ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@traitlets@py3@traitlets@log.py@.PATH_END.py
{ "filename": "setup.py", "repo_name": "rpoleski/MulensModel", "repo_path": "MulensModel_extracted/MulensModel-master/setup.py", "type": "Python" }
from pathlib import Path import platform from setuptools import Extension, find_packages, setup PROJECT_PATH = Path(__file__).resolve().parent SOURCE_PATH = PROJECT_PATH / "source" DATA_PATH = PROJECT_PATH / "data" file_required = PROJECT_PATH / "requirements.txt" with file_required.open() as file_: install_requ...
rpoleskiREPO_NAMEMulensModelPATH_START.@MulensModel_extracted@MulensModel-master@setup.py@.PATH_END.py
{ "filename": "_x.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/surface/contours/_x.py", "type": "Python" }
import _plotly_utils.basevalidators class XValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="x", parent_name="surface.contours", **kwargs): super(XValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, data_...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@surface@contours@_x.py@.PATH_END.py
{ "filename": "test_hotregions.py", "repo_name": "xpsi-group/xpsi", "repo_path": "xpsi_extracted/xpsi-main/xpsi/tests/test_hotregions.py", "type": "Python" }
import numpy as np from xpsi.HotRegion import HotRegion from xpsi.HotRegions import HotRegions import pytest class TestHotRegions(object): def setup_class(cls): cls.super_colatitude_bounds = (None, None) cls.super_radius_bounds = (None, None) cls.phase_shift_bounds = (0.0, 0.1) ...
xpsi-groupREPO_NAMExpsiPATH_START.@xpsi_extracted@xpsi-main@xpsi@tests@test_hotregions.py@.PATH_END.py
{ "filename": "screening_util.py", "repo_name": "pynucastro/pynucastro", "repo_path": "pynucastro_extracted/pynucastro-main/pynucastro/screening/screening_util.py", "type": "Python" }
"""Some helper functions for determining which rates need screening""" from pynucastro.nucdata import Nucleus from pynucastro.rates import ApproximateRate class ScreeningPair: """a pair of nuclei that will have rate screening applied. We store a list of all rates that match this pair of nuclei""" def _...
pynucastroREPO_NAMEpynucastroPATH_START.@pynucastro_extracted@pynucastro-main@pynucastro@screening@screening_util.py@.PATH_END.py
{ "filename": "_r.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/barpolar/_r.py", "type": "Python" }
import _plotly_utils.basevalidators class RValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__(self, plotly_name="r", parent_name="barpolar", **kwargs): super(RValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_type=kw...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@barpolar@_r.py@.PATH_END.py
{ "filename": "_showticksuffix.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/histogram2d/colorbar/_showticksuffix.py", "type": "Python" }
import _plotly_utils.basevalidators class ShowticksuffixValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="showticksuffix", parent_name="histogram2d.colorbar", **kwargs ): super(ShowticksuffixValidator, self).__init__( plotly_name=plotly_n...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@histogram2d@colorbar@_showticksuffix.py@.PATH_END.py
{ "filename": "utils.py", "repo_name": "astropy/astropy", "repo_path": "astropy_extracted/astropy-main/astropy/units/utils.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Miscellaneous utilities for `astropy.units`. None of the functions in the module are meant for use outside of the package. """ from __future__ import annotations import io import re from fractions import Fraction from typing import TYPE_CHECKING, ov...
astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@units@utils.py@.PATH_END.py
{ "filename": "sourcepairing.py", "repo_name": "juanep97/iop4", "repo_path": "iop4_extracted/iop4-main/iop4lib/utils/sourcepairing.py", "type": "Python" }
import iop4lib.config iop4conf = iop4lib.Config(config_db=False) import numpy as np import scipy as sp import matplotlib as mplt import matplotlib.pyplot as plt import itertools from scipy.spatial import cKDTree def get_pairs_d(pos, d0=None, d_eps=None, d_min=None, d_max=None, bi...
juanep97REPO_NAMEiop4PATH_START.@iop4_extracted@iop4-main@iop4lib@utils@sourcepairing.py@.PATH_END.py
{ "filename": "ExposureTime.ipynb", "repo_name": "rodluger/starry", "repo_path": "starry_extracted/starry-master/notebooks/ExposureTime.ipynb", "type": "Jupyter Notebook" }
# Exposure time integration Here we'll briefly discuss how to account for finite exposure time integration, which tends to smooth out occultation light curves. Unfortunately, there's no analytic way (that I know of) to tackle this, so the thing to do is to oversample the light curve on a fine time grid and numerically...
rodlugerREPO_NAMEstarryPATH_START.@starry_extracted@starry-master@notebooks@ExposureTime.ipynb@.PATH_END.py
{ "filename": "create.md", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/lite/g3doc/api_docs/python/tflite_model_maker/recommendation/create.md", "type": "Markdown" }
page_type: reference description: Loads data and train the model for recommendation. <link rel="stylesheet" href="/site-assets/css/style.css"> <!-- DO NOT EDIT! Automatically generated file. --> <div itemscope itemtype="http://developers.google.com/ReferenceObject"> <meta itemprop="name" content="tflite_model_maker...
tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@lite@g3doc@api_docs@python@tflite_model_maker@recommendation@create.md@.PATH_END.py
{ "filename": "setup_chgcentre.py", "repo_name": "IanHeywood/oxkat", "repo_path": "oxkat_extracted/oxkat-master/waterhole/setup_chgcentre.py", "type": "Python" }
import glob import os import sys def write_slurm(opfile,jobname,logfile,syscall): f = open(opfile,'w') f.writelines(['#!/bin/bash\n', '#file: '+opfile+':\n', '#SBATCH --job-name='+jobname+'\n', '#SBATCH --time=01:00:00\n', '#SBATCH --partition=Main\n' '#SBATCH --ntasks...
IanHeywoodREPO_NAMEoxkatPATH_START.@oxkat_extracted@oxkat-master@waterhole@setup_chgcentre.py@.PATH_END.py
{ "filename": "runSimulator.py", "repo_name": "LSSTDESC/Spectractor", "repo_path": "Spectractor_extracted/Spectractor-master/runSimulator.py", "type": "Python" }
from spectractor import parameters from spectractor.simulation.simulator import AtmosphereGrid, SpectrumSimulatorSimGrid from spectractor.config import load_config from spectractor.simulation.image_simulation import ImageSim from spectractor.logbook import LogBook from spectractor.extractor.extractor import Spectractor...
LSSTDESCREPO_NAMESpectractorPATH_START.@Spectractor_extracted@Spectractor-master@runSimulator.py@.PATH_END.py
{ "filename": "prop_divide.py", "repo_name": "ajeldorado/falco-python", "repo_path": "falco-python_extracted/falco-python-master/falco/proper/prop_divide.py", "type": "Python" }
# Copyright 2016, 2017 California Institute of Technology # Users must agree to abide by the restrictions listed in the # file "LegalStuff.txt" in the PROPER library directory. # # PROPER developed at Jet Propulsion Laboratory/California Inst. Technology # Original IDL version by John Krist # Python transla...
ajeldoradoREPO_NAMEfalco-pythonPATH_START.@falco-python_extracted@falco-python-master@falco@proper@prop_divide.py@.PATH_END.py
{ "filename": "main.py", "repo_name": "cdslaborg/paramonte", "repo_path": "paramonte_extracted/paramonte-main/example/fortran/pm_distMultiNorm/setMultiNormRand/main.py", "type": "Python" }
#!/usr/bin/env python import matplotlib.pyplot as plt import pandas as pd import numpy as np import glob import sys linewidth = 2 fontsize = 17 for kind in ["RK"]: pattern = "*." + kind + ".txt" fileList = glob.glob(pattern) for file in fileList: df = pd.read_csv(file, delimiter = ",", header ...
cdslaborgREPO_NAMEparamontePATH_START.@paramonte_extracted@paramonte-main@example@fortran@pm_distMultiNorm@setMultiNormRand@main.py@.PATH_END.py
{ "filename": "_hoverlabel.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/waterfall/_hoverlabel.py", "type": "Python" }
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Hoverlabel(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "waterfall" _path_str = "waterfall.hoverlabel" _valid_props = { "align", ...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@waterfall@_hoverlabel.py@.PATH_END.py
{ "filename": "convert.md", "repo_name": "amrvac/amrvac", "repo_path": "amrvac_extracted/amrvac-master/doc/convert.md", "type": "Markdown" }
# Data file conversion [TOC] # Introduction {#convert_intro} The standard [MPI-AMRVAC dataformat](fileformat.md), i.e. the _*.dat_ files usable for restart, contain all the conservative variables in all gridblocks, and hence suffice for visualization. Additional variables can be added in the _*.dat_ files as explain...
amrvacREPO_NAMEamrvacPATH_START.@amrvac_extracted@amrvac-master@doc@convert.md@.PATH_END.py
{ "filename": "_customdata.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/sankey/_customdata.py", "type": "Python" }
import _plotly_utils.basevalidators class CustomdataValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__(self, plotly_name="customdata", parent_name="sankey", **kwargs): super(CustomdataValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name,...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@sankey@_customdata.py@.PATH_END.py
{ "filename": "repplugin.py", "repo_name": "wokast/PyCactus", "repo_path": "PyCactus_extracted/PyCactus-master/SimRep/simrep/plugins/repplugin.py", "type": "Python" }
# -*- coding: utf-8 -*- from __future__ import print_function from builtins import str import os import sys import glob from simrep.pydocument import * valid_image_formats = set(['svg', 'png', 'jpeg', 'jpg', 'gif', 'pdf', 'eps']) valid_movie_formats = set(['mpeg', 'wmv', 'mov', 'mp4']) d...
wokastREPO_NAMEPyCactusPATH_START.@PyCactus_extracted@PyCactus-master@SimRep@simrep@plugins@repplugin.py@.PATH_END.py
{ "filename": "tfsa-2021-024.md", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/security/advisory/tfsa-2021-024.md", "type": "Markdown" }
## TFSA-2021-024: `CHECK`-fail in `SparseConcat` ### CVE Number CVE-2021-29534 ### Impact An attacker can trigger a denial of service via a `CHECK`-fail in `tf.raw_ops.SparseConcat`: ```python import tensorflow as tf import numpy as np indices_1 = tf.constant([[514, 514], [514, 514]], dtype=tf.int64) indices_2 = tf...
tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@security@advisory@tfsa-2021-024.md@.PATH_END.py
{ "filename": "toy_ms_pulsar.py", "repo_name": "lucabaldini/ixpeobssim", "repo_path": "ixpeobssim_extracted/ixpeobssim-main/ixpeobssim/examples/toy_ms_pulsar.py", "type": "Python" }
# Copyright (C) 2022, the ixpeobssim team. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distrib...
lucabaldiniREPO_NAMEixpeobssimPATH_START.@ixpeobssim_extracted@ixpeobssim-main@ixpeobssim@examples@toy_ms_pulsar.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "galsci/pysm", "repo_path": "pysm_extracted/pysm-main/src/pysm3/data/__init__.py", "type": "Python" }
galsciREPO_NAMEpysmPATH_START.@pysm_extracted@pysm-main@src@pysm3@data@__init__.py@.PATH_END.py
{ "filename": "cov_output.py", "repo_name": "rreischke/OneCovariance", "repo_path": "OneCovariance_extracted/OneCovariance-main/onecov/cov_output.py", "type": "Python" }
import enum import numpy as np import os from astropy.units.cgs import K # from astropy.io import fits #plot stuff import matplotlib.pyplot as plt from matplotlib import rc, rcParams # rc('font', **{'family': 'serif', 'serif': ['Computer Modern']}) plt.rc('font', family='sans-serif') # rcParams['figure.figsize'] = (...
rreischkeREPO_NAMEOneCovariancePATH_START.@OneCovariance_extracted@OneCovariance-main@onecov@cov_output.py@.PATH_END.py
{ "filename": "download_test_data.py", "repo_name": "kbwestfall/NIRVANA", "repo_path": "NIRVANA_extracted/NIRVANA-master/download_test_data.py", "type": "Python" }
from pathlib import Path import os import warnings import tqdm import requests import netrc from nirvana.util.download import download_file from nirvana.tests.util import remote_data_file, remote_drp_test_files, remote_drp_test_images from nirvana.tests.util import remote_dap_test_files from nirvana.tests.util import...
kbwestfallREPO_NAMENIRVANAPATH_START.@NIRVANA_extracted@NIRVANA-master@download_test_data.py@.PATH_END.py
{ "filename": "connect.py", "repo_name": "mhammond/pywin32", "repo_path": "pywin32_extracted/pywin32-main/com/win32com/client/connect.py", "type": "Python" }
"""Utilities for working with Connections""" import pythoncom import win32com.server.policy import win32com.server.util class SimpleConnection: "A simple, single connection object" def __init__(self, coInstance=None, eventInstance=None, eventCLSID=None, debug=0): self.cp = None self.cookie =...
mhammondREPO_NAMEpywin32PATH_START.@pywin32_extracted@pywin32-main@com@win32com@client@connect.py@.PATH_END.py
{ "filename": "generate_python_docs.py", "repo_name": "hannorein/REBOUND", "repo_path": "REBOUND_extracted/REBOUND-main/docs/generate_python_docs.py", "type": "Python" }
import rebound import inspect import docstring_to_markdown def convert_code_blocks(doc): new_doc = "" lines = doc.split("\n") first = True for line in lines: if first: if line[:3]==">>>": first = False new_doc += "```python\n" new_doc +...
hannoreinREPO_NAMEREBOUNDPATH_START.@REBOUND_extracted@REBOUND-main@docs@generate_python_docs.py@.PATH_END.py
{ "filename": "test_config.py", "repo_name": "realfastvla/realfast", "repo_path": "realfast_extracted/realfast-main/tests/test_config.py", "type": "Python" }
import rfpipe import pytest import evla_mcast import os.path import os _install_dir = os.path.abspath(os.path.dirname(__file__)) @pytest.fixture(scope="module") def config(): config = evla_mcast.scan_config.ScanConfig(vci=os.path.join(_install_dir, 'data/vci.xml'), ...
realfastvlaREPO_NAMErealfastPATH_START.@realfast_extracted@realfast-main@tests@test_config.py@.PATH_END.py
{ "filename": "_range.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/xaxis/rangeslider/_range.py", "type": "Python" }
import _plotly_utils.basevalidators class RangeValidator(_plotly_utils.basevalidators.InfoArrayValidator): def __init__( self, plotly_name="range", parent_name="layout.xaxis.rangeslider", **kwargs ): super(RangeValidator, self).__init__( plotly_name=plotly_name, parent_...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@xaxis@rangeslider@_range.py@.PATH_END.py
{ "filename": "reid14_rotcurve.py", "repo_name": "tvwenger/kd", "repo_path": "kd_extracted/kd-master/kd/reid14_rotcurve.py", "type": "Python" }
#!/usr/bin/env python """ reid14_rotcurve.py Utilities involving the Universal Rotation Curve (Persic+1996) from Reid+2014. Copyright(C) 2017-2021 by Trey V. Wenger; tvwenger@gmail.com GNU General Public License v3 (GNU GPLv3) This program is free software: you can redistribute it and/or modify it under the terms o...
tvwengerREPO_NAMEkdPATH_START.@kd_extracted@kd-master@kd@reid14_rotcurve.py@.PATH_END.py
{ "filename": "recipes_FLAT_LS_SPECT.py", "repo_name": "GeminiDRSoftware/DRAGONS", "repo_path": "DRAGONS_extracted/DRAGONS-master/geminidr/gmos/recipes/ql/recipes_FLAT_LS_SPECT.py", "type": "Python" }
""" Recipes available to data with tags ['GMOS', 'SPECT', 'LS', 'FLAT']. These are GMOS longslit observations. Default is "reduce". """ recipe_tags = {'GMOS', 'SPECT', 'LS', 'FLAT'} from geminidr.gmos.recipes.sq.recipes_FLAT_LS_SPECT import (makeProcessedFlatStack, makeProcessed...
GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@geminidr@gmos@recipes@ql@recipes_FLAT_LS_SPECT.py@.PATH_END.py