metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "_sizesrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/isosurface/hoverlabel/font/_sizesrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="sizesrc", parent_name="isosurface.hoverlabel.font", **kwargs
):
super(SizesrcValidator, self).__init__(
plotly_name=plotly_name,
paren... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@isosurface@hoverlabel@font@_sizesrc.py@.PATH_END.py |
{
"filename": "test_pickling.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/yt/data_objects/tests/test_pickling.py",
"type": "Python"
} | import pickle
from numpy.testing import assert_equal
from yt.testing import requires_file, requires_module
from yt.utilities.answer_testing.framework import data_dir_load
tipsy_ds = "TipsyGalaxy/galaxy.00300"
enzo_ds = "enzo_tiny_cosmology/DD0000/DD0000"
@requires_module("h5py")
@requires_file(enzo_ds)
def test_gr... | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@data_objects@tests@test_pickling.py@.PATH_END.py |
{
"filename": "generate_ttim_psfs.py",
"repo_name": "spacetelescope/drizzlepac",
"repo_path": "drizzlepac_extracted/drizzlepac-main/drizzlepac/devutils/generate_ttim_psfs.py",
"type": "Python"
} | import pexpect
import os
import sys
import re
import time
acs_filter_dict = {'WFC': ['f435w', 'f475w', 'f555w', 'f606w', 'f625w',
'f775w', 'f814w', 'f850lp', 'f550m',
'f502n', 'f658n', 'f660n', 'f892n'],
'HRC': ['f220w', 'f250w', 'f330w', 'f435w', '... | spacetelescopeREPO_NAMEdrizzlepacPATH_START.@drizzlepac_extracted@drizzlepac-main@drizzlepac@devutils@generate_ttim_psfs.py@.PATH_END.py |
{
"filename": "plotit.py",
"repo_name": "bolverk/huji-rich",
"repo_path": "huji-rich_extracted/huji-rich-master/convergence/discontinuous_advection_1d/base/plotit.py",
"type": "Python"
} | import pylab
import numpy
import re
import sys
import Tkinter
import glob
pref = re.sub(r'/[^/]*$','',sys.argv[0])
n = len(glob.glob(pref+'/center_list.[0-9]+.txt'))
if len(sys.argv)>1:
val = int(sys.argv[1])
else:
val = n
x_list = numpy.loadtxt(pref+'/center_list.'+str(val)+'.txt')
d_list = numpy.loadtxt(p... | bolverkREPO_NAMEhuji-richPATH_START.@huji-rich_extracted@huji-rich-master@convergence@discontinuous_advection_1d@base@plotit.py@.PATH_END.py |
{
"filename": "sumpsf.py",
"repo_name": "rmjarvis/Piff",
"repo_path": "Piff_extracted/Piff-main/piff/sumpsf.py",
"type": "Python"
} | # Copyright (c) 2016 by Mike Jarvis and the other collaborators on GitHub at
# https://github.com/rmjarvis/Piff All rights reserved.
#
# Piff is free software: Redistribution and use in source and binary forms
# with or without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redist... | rmjarvisREPO_NAMEPiffPATH_START.@Piff_extracted@Piff-main@piff@sumpsf.py@.PATH_END.py |
{
"filename": "functions_numba.py",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/pyqtgraph/functions_numba.py",
"type": "Python"
} | import numba
import numpy as np
rescale_functions = {}
def rescale_clip_source(xx, scale, offset, vmin, vmax, yy):
for i in range(xx.size):
val = (xx[i] - offset) * scale
yy[i] = min(max(val, vmin), vmax)
def rescaleData(data, scale, offset, dtype, clip):
data_out = np.empty_like(data, dtype=... | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@pyqtgraph@functions_numba.py@.PATH_END.py |
{
"filename": "config.py",
"repo_name": "davidharvey1986/pyRRG",
"repo_path": "pyRRG_extracted/pyRRG-master/unittests/bugFixPyRRG/lib/python3.7/site-packages/setuptools/config.py",
"type": "Python"
} | from __future__ import absolute_import, unicode_literals
import ast
import io
import os
import sys
import warnings
import functools
import importlib
from collections import defaultdict
from functools import partial
from functools import wraps
import contextlib
from distutils.errors import DistutilsOptionError, Distut... | davidharvey1986REPO_NAMEpyRRGPATH_START.@pyRRG_extracted@pyRRG-master@unittests@bugFixPyRRG@lib@python3.7@site-packages@setuptools@config.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/chains/conversation/__init__.py",
"type": "Python"
} | """Chain that carries on a conversation from a prompt plus history."""
| langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@chains@conversation@__init__.py@.PATH_END.py |
{
"filename": "modoverview.py",
"repo_name": "JohannesBuchner/UltraNest",
"repo_path": "UltraNest_extracted/UltraNest-master/docs/modoverview.py",
"type": "Python"
} | import importlib
sections = [
('Modules commonly used directly', ['integrator', 'plot', 'stepsampler', 'popstepsampler', 'calibrator', 'solvecompat', 'hotstart']),
('Internally used modules', ['mlfriends', 'netiter', 'ordertest', 'stepfuncs', 'store', 'viz']),
('Experimental modules, no guarantees', ['dychmc', 'dyh... | JohannesBuchnerREPO_NAMEUltraNestPATH_START.@UltraNest_extracted@UltraNest-master@docs@modoverview.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "PrincetonUniversity/charis-dep",
"repo_path": "charis-dep_extracted/charis-dep-main/charis/primitives/__init__.py",
"type": "Python"
} | from .locate_psflets import locatePSFlets, PSFLets, pullorder
from .fit_psflets import fit_spectra, optext_spectra
from .buildmonochrome import gethires, make_polychrome
from .offset_cal import calc_offset
from . import matutils
| PrincetonUniversityREPO_NAMEcharis-depPATH_START.@charis-dep_extracted@charis-dep-main@charis@primitives@__init__.py@.PATH_END.py |
{
"filename": "sub_neptune.ipynb",
"repo_name": "nichollsh/AGNI",
"repo_path": "AGNI_extracted/AGNI-main/misc/sub_neptune.ipynb",
"type": "Jupyter Notebook"
} | ## Test surface magma ocean for sub-Neptune conditions
```julia
# Import system packages
using Printf
using DelimitedFiles
using Plots
using LaTeXStrings
```
```julia
# Set directory
ROOT_DIR = abspath(joinpath(pwd(),"../"))
ENV["RAD_DIR"] = joinpath(ROOT_DIR,"socrates")
```
"/Users/nichollsh/Projects/AGNI/... | nichollshREPO_NAMEAGNIPATH_START.@AGNI_extracted@AGNI-main@misc@sub_neptune.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/bar/hoverlabel/font/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._weightsrc import WeightsrcValidator
from ._weight import WeightValidator
from ._variantsrc import VariantsrcValidator
from ._variant import VariantValidator
from ._textcasesrc import TextcasesrcValidat... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@bar@hoverlabel@font@__init__.py@.PATH_END.py |
{
"filename": "plot_spectrum.py",
"repo_name": "exoclime/HELIOS",
"repo_path": "HELIOS_extracted/HELIOS-master/plotting/plot_spectrum.py",
"type": "Python"
} | import matplotlib.pyplot as plt
import sys
sys.path.append("..")
from source import tools as tls
#################################### FUNCTIONS ####################################
def read_and_plot(ax,
path,
label="",
width=1,
style="-",
... | exoclimeREPO_NAMEHELIOSPATH_START.@HELIOS_extracted@HELIOS-master@plotting@plot_spectrum.py@.PATH_END.py |
{
"filename": "training_state.py",
"repo_name": "neuraloperator/neuraloperator",
"repo_path": "neuraloperator_extracted/neuraloperator-main/neuralop/training/training_state.py",
"type": "Python"
} | """
Snippet to load all artifacts of training state as Modules
without constraining to use inside a default Trainer
"""
from typing import Union
from pathlib import Path
import torch
from torch import nn
import torch.distributed as dist
from neuralop.mpu.comm import get_local_rank
def load_training_state(save_dir: U... | neuraloperatorREPO_NAMEneuraloperatorPATH_START.@neuraloperator_extracted@neuraloperator-main@neuralop@training@training_state.py@.PATH_END.py |
{
"filename": "particle_filter.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/doc/source/cookbook/particle_filter.py",
"type": "Python"
} | import numpy as np
import yt
from yt.data_objects.particle_filters import add_particle_filter
# Define filter functions for our particle filters based on stellar age.
# In this dataset particles in the initial conditions are given creation
# times arbitrarily far into the future, so stars with negative ages belong
#... | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@doc@source@cookbook@particle_filter.py@.PATH_END.py |
{
"filename": "test_steps.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/integrations/prefect-azure/tests/deployments/test_steps.py",
"type": "Python"
} | import os
from pathlib import Path
from unittest.mock import ANY, MagicMock, call
import pytest
from azure.identity import DefaultAzureCredential
from azure.storage.blob import ContainerClient
from prefect_azure.deployments.steps import (
pull_from_azure_blob_storage,
push_to_azure_blob_storage,
)
@pytest.fi... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@integrations@prefect-azure@tests@deployments@test_steps.py@.PATH_END.py |
{
"filename": "_tickformatstops.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/heatmapgl/colorbar/_tickformatstops.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickformatstopsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="tickformatstops", parent_name="heatmapgl.colorbar", **kwargs
):
super(TickformatstopsValidator, self).__init__(
plotly_name=plot... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@heatmapgl@colorbar@_tickformatstops.py@.PATH_END.py |
{
"filename": "2.Investigate_4998_images.ipynb",
"repo_name": "Zafiirah13/meercrab",
"repo_path": "meercrab_extracted/meercrab-main/meerCRAB_preprocessing/2.Investigate_4998_images.ipynb",
"type": "Jupyter Notebook"
} | ```python
# This script will analyse the vetting of all candidates. Then we will decide which threshold
# we will use during training and prediction.
import numpy as np
import pandas as pd
from astropy.table import Table
import matplotlib.pylab as plt
figSize = (16, 10)
fontSize = 20
%matplotlib inline
```
```pytho... | Zafiirah13REPO_NAMEmeercrabPATH_START.@meercrab_extracted@meercrab-main@meerCRAB_preprocessing@2.Investigate_4998_images.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "spacetelescope/jwst",
"repo_path": "jwst_extracted/jwst-main/jwst/datamodels/__init__.py",
"type": "Python"
} | # The jwst.datamodels submodule was moved to stdatamodels.jwst.datamodels
# https://github.com/spacetelescope/jwst/pull/7439
import importlib
from inspect import ismodule
import sys
from stdatamodels.jwst.datamodels.util import open
from .container import ModelContainer
from .library import ModelLibrary
from .source... | spacetelescopeREPO_NAMEjwstPATH_START.@jwst_extracted@jwst-main@jwst@datamodels@__init__.py@.PATH_END.py |
{
"filename": "llamafile.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/text_embedding/llamafile.ipynb",
"type": "Jupyter Notebook"
} | # llamafile
Let's load the [llamafile](https://github.com/Mozilla-Ocho/llamafile) Embeddings class.
## Setup
First, the are 3 setup steps:
1. Download a llamafile. In this notebook, we use `TinyLlama-1.1B-Chat-v1.0.Q5_K_M` but there are many others available on [HuggingFace](https://huggingface.co/models?other=llam... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@text_embedding@llamafile.ipynb@.PATH_END.py |
{
"filename": "plot_display_object_visualization.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/examples/miscellaneous/plot_display_object_visualization.py",
"type": "Python"
} | """
===================================
Visualizations with Display Objects
===================================
.. currentmodule:: sklearn.metrics
In this example, we will construct display objects,
:class:`ConfusionMatrixDisplay`, :class:`RocCurveDisplay`, and
:class:`PrecisionRecallDisplay` directly from their resp... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@examples@miscellaneous@plot_display_object_visualization.py@.PATH_END.py |
{
"filename": "compound.py",
"repo_name": "rhayes777/PyAutoFit",
"repo_path": "PyAutoFit_extracted/PyAutoFit-main/autofit/mapper/prior/arithmetic/compound.py",
"type": "Python"
} | import inspect
import logging
from abc import ABC
from copy import copy
from typing import Optional, Dict
import numpy as np
from autofit.mapper.model_object import dereference
from autofit.mapper.prior.arithmetic import ArithmeticMixin
from autofit.mapper.prior_model.abstract import AbstractPriorModel
logger = logg... | rhayes777REPO_NAMEPyAutoFitPATH_START.@PyAutoFit_extracted@PyAutoFit-main@autofit@mapper@prior@arithmetic@compound.py@.PATH_END.py |
{
"filename": "psoap_retrieve_SB2.py",
"repo_name": "iancze/PSOAP",
"repo_path": "PSOAP_extracted/PSOAP-master/scripts/psoap_retrieve_SB2.py",
"type": "Python"
} | #!/usr/bin/env python
import argparse
parser = argparse.ArgumentParser(description="Reconstruct the composite spectra for A and B component.")
parser.add_argument("--draws", type=int, default=0, help="In addition to plotting the mean GP, plot several draws of the GP to show the scatter in predicitions.")
args = parse... | ianczeREPO_NAMEPSOAPPATH_START.@PSOAP_extracted@PSOAP-master@scripts@psoap_retrieve_SB2.py@.PATH_END.py |
{
"filename": "core.py",
"repo_name": "NASA-Planetary-Science/sbpy",
"repo_path": "sbpy_extracted/sbpy-main/sbpy/units/core.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""sbpy units core module
This package defines Vega-based magnitude systems, and a units
equivalency function for converting to/from flux density.
To use these units in the top-level `astropy.units` namespace::
>>> import astropy.units as u
>>> ... | NASA-Planetary-ScienceREPO_NAMEsbpyPATH_START.@sbpy_extracted@sbpy-main@sbpy@units@core.py@.PATH_END.py |
{
"filename": "quickstart.md",
"repo_name": "jax-ml/jax",
"repo_path": "jax_extracted/jax-main/docs/pallas/quickstart.md",
"type": "Markdown"
} | ---
jupytext:
formats: ipynb,md:myst
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.16.4
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
---
# Pallas Quickstart
<!--* freshness: { reviewed: '2024-04-08' } *-->
Pal... | jax-mlREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@docs@pallas@quickstart.md@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "AndreasKvammen/ML_dust_detection",
"repo_path": "ML_dust_detection_extracted/ML_dust_detection-main/CDF_file_classification/README.md",
"type": "Markdown"
} | The folder "CDF_file_classification" contains the trained CNN classifier and the MatLab code to classify the Triggered Snapshot WaveForm (TSWF) data product (.cdf files). A sample script and the needed functions are included in order to classify a sample (.cdf) file "solo_L2_rpw-tds-surv-tswf-e_20211004_V01.cdf". The f... | AndreasKvammenREPO_NAMEML_dust_detectionPATH_START.@ML_dust_detection_extracted@ML_dust_detection-main@CDF_file_classification@README.md@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "OpenAccess-AI-Collective/axolotl",
"repo_path": "axolotl_extracted/axolotl-main/.vscode/README.md",
"type": "Markdown"
} | See [docs/debugging.md](../docs/debugging.md) for guidance on how to modify these files to debug axolotl with VSCode.
| OpenAccess-AI-CollectiveREPO_NAMEaxolotlPATH_START.@axolotl_extracted@axolotl-main@.vscode@README.md@.PATH_END.py |
{
"filename": "test_gs_param_rates.py",
"repo_name": "mirochaj/ares",
"repo_path": "ares_extracted/ares-main/tests/broken/test_gs_param_rates.py",
"type": "Python"
} | """
test_21cm_parameterized_rates.py
Author: Jordan Mirocha
Affiliation: University of Colorado at Boulder
Created on: Mon Nov 17 14:21:53 MST 2014
Description:
"""
import ares
import numpy as np
def test():
sim = ares.simulations.Global21cm(tanh_model=True,
verbose=False, progress_bar=False)
si... | mirochajREPO_NAMEaresPATH_START.@ares_extracted@ares-main@tests@broken@test_gs_param_rates.py@.PATH_END.py |
{
"filename": "time_utils.py",
"repo_name": "dannyjacobs/ECHO",
"repo_path": "ECHO_extracted/ECHO-master/ECHO/time_utils.py",
"type": "Python"
} | import numpy as np
from astropy.time import Time
from datetime import datetime
def unix_to_gps(t):
return Time(t,scale='utc',format='unix').gps
def gps_to_HMS(t,fmt):
t = Time(t,scale='utc',format=fmt)
return t.iso.split(' ')[1]
def find_peak(f,x,fmin=0,fmax=500):
# f = frequencies in MHz
# x... | dannyjacobsREPO_NAMEECHOPATH_START.@ECHO_extracted@ECHO-master@ECHO@time_utils.py@.PATH_END.py |
{
"filename": "_shadow.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/funnel/textfont/_shadow.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShadowValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="shadow", parent_name="funnel.textfont", **kwargs):
super(ShadowValidator, 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@funnel@textfont@_shadow.py@.PATH_END.py |
{
"filename": "TurbulentKineticEnergyEquation.py",
"repo_name": "mmicromegas/ransX",
"repo_path": "ransX_extracted/ransX-master/CANUTO1997/TurbulentKineticEnergyEquation.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
from UTILS.Calculus import Calculus
from UTILS.SetAxisLimit import SetAxisLimit
from UTILS.Tools import Tools
from UTILS.Errors import Errors
import sys
# Theoretical background https://arxiv.org/abs/1401.5176
# Mocak, Meakin, Viallet, Arnett, 2014, Compressible Hyd... | mmicromegasREPO_NAMEransXPATH_START.@ransX_extracted@ransX-master@CANUTO1997@TurbulentKineticEnergyEquation.py@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/barpolar/marker/colorbar/title/_font.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="font", parent_name="barpolar.marker.colorbar.title", **kwargs
):
super(FontValidator, self).__init__(
plotly_name=plotly_name,
paren... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@barpolar@marker@colorbar@title@_font.py@.PATH_END.py |
{
"filename": "universe.py",
"repo_name": "marblestation/posidonius",
"repo_path": "posidonius_extracted/posidonius-master/posidonius/particles/universe.py",
"type": "Python"
} | import os
import six
import math
import datetime
from posidonius.particles.axes import Axes
from posidonius.integrator import WHFast, Ias15, LeapFrog
from posidonius.constants import *
from posidonius.effects.evolution import NonEvolving, Leconte2011, Baraffe2015, Baraffe1998, LeconteChabrier2013, BolmontMathis2016, Ga... | marblestationREPO_NAMEposidoniusPATH_START.@posidonius_extracted@posidonius-master@posidonius@particles@universe.py@.PATH_END.py |
{
"filename": "extra_truth.py",
"repo_name": "GalSim-developers/GalSim",
"repo_path": "GalSim_extracted/GalSim-main/galsim/config/extra_truth.py",
"type": "Python"
} | # Copyright (c) 2012-2023 by the GalSim developers team on GitHub
# https://github.com/GalSim-developers
#
# This file is part of GalSim: The modular galaxy image simulation toolkit.
# https://github.com/GalSim-developers/GalSim
#
# GalSim is free software: redistribution and use in source and binary forms,
# with or w... | GalSim-developersREPO_NAMEGalSimPATH_START.@GalSim_extracted@GalSim-main@galsim@config@extra_truth.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "LSSTDESC/rail",
"repo_path": "rail_extracted/rail-main/examples/creation_examples/README.md",
"type": "Markdown"
} | This directory contains example notebooks explaining how to use the RAIL Creation Module.
- [degradation-demo.ipynb](https://htmlpreview.github.io/?https://github.com/LSSTDESC/RAIL/blob/master/examples/creation/degradation-demo.html) explains how to construct a basic `Engine`, draw samples, and use Degraders to degrad... | LSSTDESCREPO_NAMErailPATH_START.@rail_extracted@rail-main@examples@creation_examples@README.md@.PATH_END.py |
{
"filename": "test_conesearch.py",
"repo_name": "D-arioSpace/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/vo_conesearch/tests/test_conesearch.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Tests for VO Cone Search."""
# STDLIB
import os
import time
# THIRD-PARTY
import numpy as np
import pytest
# ASTROPY
from astropy import units as u
from astropy.coordinates import ICRS, SkyCoord
from astropy.io.votable.exceptions import W25
from astr... | D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@vo_conesearch@tests@test_conesearch.py@.PATH_END.py |
{
"filename": "ami_function.py",
"repo_name": "SAIL-Labs/AMICAL",
"repo_path": "AMICAL_extracted/AMICAL-main/amical/mf_pipeline/ami_function.py",
"type": "Python"
} | """
@author: Anthony Soulain (University of Sydney)
-------------------------------------------------------------------------
AMICAL: Aperture Masking Interferometry Calibration and Analysis Library
-------------------------------------------------------------------------
Matched filter pipeline method.
All AMI rela... | SAIL-LabsREPO_NAMEAMICALPATH_START.@AMICAL_extracted@AMICAL-main@amical@mf_pipeline@ami_function.py@.PATH_END.py |
{
"filename": "manga_axisym_collate.py",
"repo_name": "kbwestfall/NIRVANA",
"repo_path": "NIRVANA_extracted/NIRVANA-master/nirvana/scripts/manga_axisym_collate.py",
"type": "Python"
} | """
Script to collate results from AxisymmetricDisk fits to MaNGA data into a single
fits file.
"""
import warnings
from pathlib import Path
import argparse
from IPython import embed
import numpy as np
from astropy.io import fits
import nirvana
from nirvana.data.manga import manga_paths, manga_file_names, MaNGAGloba... | kbwestfallREPO_NAMENIRVANAPATH_START.@NIRVANA_extracted@NIRVANA-master@nirvana@scripts@manga_axisym_collate.py@.PATH_END.py |
{
"filename": "plot_kiel.py",
"repo_name": "BASTAcode/BASTA",
"repo_path": "BASTA_extracted/BASTA-main/src/basta/plot_kiel.py",
"type": "Python"
} | """
Production of Kiel diagrams
"""
import os
import numpy as np
import matplotlib
import matplotlib.collections
from basta import stats
from basta import fileio as fio
from basta import utils_seismic as su
from basta import utils_general as gu
from basta.constants import parameters
from basta.downloader import get_b... | BASTAcodeREPO_NAMEBASTAPATH_START.@BASTA_extracted@BASTA-main@src@basta@plot_kiel.py@.PATH_END.py |
{
"filename": "doctest.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/_pytest/doctest.py",
"type": "Python"
} | """ discover and run doctests in modules and test files."""
from __future__ import absolute_import, division, print_function
import traceback
import pytest
from _pytest._code.code import ExceptionInfo, ReprFileLocation, TerminalRepr
from _pytest.fixtures import FixtureRequest
DOCTEST_REPORT_CHOICE_NONE = 'none'
DOC... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@_pytest@doctest.py@.PATH_END.py |
{
"filename": "test_helpers.py",
"repo_name": "arviz-devs/arviz",
"repo_path": "arviz_extracted/arviz-main/arviz/tests/base_tests/test_helpers.py",
"type": "Python"
} | import pytest
from _pytest.outcomes import Skipped
from ..helpers import importorskip
def test_importorskip_local(monkeypatch):
"""Test ``importorskip`` run on local machine with non-existent module, which should skip."""
monkeypatch.delenv("ARVIZ_REQUIRE_ALL_DEPS", raising=False)
with pytest.raises(Skip... | arviz-devsREPO_NAMEarvizPATH_START.@arviz_extracted@arviz-main@arviz@tests@base_tests@test_helpers.py@.PATH_END.py |
{
"filename": "_nticks.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/ternary/aaxis/_nticks.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NticksValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="nticks", parent_name="layout.ternary.aaxis", **kwargs
):
super(NticksValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@ternary@aaxis@_nticks.py@.PATH_END.py |
{
"filename": "HO23.py",
"repo_name": "chrisormel/astroscripts",
"repo_path": "astroscripts_extracted/astroscripts-main/papers/HO23.py",
"type": "Python"
} | import numpy as np
def epsilon_plateau (St, xp):
"""
returns \epsilon in the plateau limit
See HO23, eqs. 23 & Table 3.
xp -- planet radius normalized by Hill radius
"""
ps = np.maximum(1, 3.8/St)
pb = np.minimum(1, 2.36 *xp**0.5)
pi = 0.610
nom = (1-ps)*(1-pb)*pi
den = 1 -(... | chrisormelREPO_NAMEastroscriptsPATH_START.@astroscripts_extracted@astroscripts-main@papers@HO23.py@.PATH_END.py |
{
"filename": "1col.py",
"repo_name": "enthought/mayavi",
"repo_path": "mayavi_extracted/mayavi-master/mayavi/tests/csv_files/1col.py",
"type": "Python"
} | { 'array': array([(5.552,),
(5.963,),
(6.135,),
(6.313,),
(6.713,)],
dtype=[('x-values', '<f8')]),
'kwds': { 'comments': '#',
'delimiter': None,
'dtype': {'formats': (float,),
'names... | enthoughtREPO_NAMEmayaviPATH_START.@mayavi_extracted@mayavi-master@mayavi@tests@csv_files@1col.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "DJArmstrong/TransitSOM",
"repo_path": "TransitSOM_extracted/TransitSOM-master/TransitSOM_Release/utils.py",
"type": "Python"
} | # This file is part of the TransitSOM code accompanying the paper Armstrong et al 2016
# Copyright (C) 2016 David Armstrong
#
# 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... | DJArmstrongREPO_NAMETransitSOMPATH_START.@TransitSOM_extracted@TransitSOM-master@TransitSOM_Release@utils.py@.PATH_END.py |
{
"filename": "_stream.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/waterfall/_stream.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Stream(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "waterfall"
_path_str = "waterfall.stream"
_valid_props = {"maxpoints", "token"}
# maxpo... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@waterfall@_stream.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "DedalusProject/dedalus",
"repo_path": "dedalus_extracted/dedalus-master/dedalus/__init__.py",
"type": "Python"
} | # Copyright (c) 2013-2022, Keaton J. Burns.
#
# This file is part of Dedalus, which is free software distributed
# under the terms of the GPLv3 license. A copy of the license should
# have been included in the file 'LICENSE.txt', and is also available
# online at <http://www.gnu.org/licenses/gpl-3.0.html>.
__version_... | DedalusProjectREPO_NAMEdedalusPATH_START.@dedalus_extracted@dedalus-master@dedalus@__init__.py@.PATH_END.py |
{
"filename": "_tickformatstops.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/funnel/marker/colorbar/_tickformatstops.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickformatstopsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self,
plotly_name="tickformatstops",
parent_name="funnel.marker.colorbar",
**kwargs,
):
super(TickformatstopsValidator, self).__init__(... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@funnel@marker@colorbar@_tickformatstops.py@.PATH_END.py |
{
"filename": "runtests.py",
"repo_name": "MP-Gadget/MP-Gadget",
"repo_path": "MP-Gadget_extracted/MP-Gadget-master/depends/bigfile/runtests.py",
"type": "Python"
} | # pop the current directory from search path
# python interpreter adds this to a top level script
# but we will likely have a name conflict (runtests.py .vs runtests package)
import sys; sys.path.pop(0)
from runtests.mpi import Tester
import os.path
tester = Tester(os.path.join(os.path.abspath(__file__)), "bigfile")
... | MP-GadgetREPO_NAMEMP-GadgetPATH_START.@MP-Gadget_extracted@MP-Gadget-master@depends@bigfile@runtests.py@.PATH_END.py |
{
"filename": "cli-installation-cmake-install.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/installation/cli-installation-cmake-install.md",
"type": "Markdown"
} | # Build the binary with `CMake`
See [the documentation here](cli-installation-local-copy-installation.md#cmake)
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@installation@cli-installation-cmake-install.md@.PATH_END.py |
{
"filename": "04_details_on_astrometric_calibration.py",
"repo_name": "juanep97/iop4",
"repo_path": "iop4_extracted/iop4-main/docs/recipes/04_details_on_astrometric_calibration.py",
"type": "Python"
} | # %% [markdown]
# # Details on astrometric calibration
# %%
# %autoawait off
# %matplotlib inline
# %run 01_notebook_configuration.py
# %% [markdown]
# The header of raw FITS files does not usually contain a valid WCS. The
# astrometric calibration is implemented automatically during the
# `ReducedFit.build_file()`... | juanep97REPO_NAMEiop4PATH_START.@iop4_extracted@iop4-main@docs@recipes@04_details_on_astrometric_calibration.py@.PATH_END.py |
{
"filename": "_showscale.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/heatmapgl/_showscale.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowscaleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="showscale", parent_name="heatmapgl", **kwargs):
super(ShowscaleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@heatmapgl@_showscale.py@.PATH_END.py |
{
"filename": "run.py",
"repo_name": "dust-busters/DBNets",
"repo_path": "DBNets_extracted/DBNets-main/training/run.py",
"type": "Python"
} | #/usr/bin/env python
#retrieve data in the index
import pandas as pd
import dblib.index as index
import numpy as np
from astropy.io import fits
from tqdm import tqdm
import gc
from sklearn.model_selection import KFold
import tensorflow as tf
import os
from tensorflow import keras
from tensorflow.keras import layers
... | dust-bustersREPO_NAMEDBNetsPATH_START.@DBNets_extracted@DBNets-main@training@run.py@.PATH_END.py |
{
"filename": "plot_utils.md",
"repo_name": "arviz-devs/arviz",
"repo_path": "arviz_extracted/arviz-main/doc/source/api/plot_utils.md",
"type": "Markdown"
} | ```{eval-rst}
.. currentmodule:: arviz.labels
```
# Plot utils
(labeller_api)=
## Labellers
See also the {ref}`label_guide`
```{eval-rst}
.. autosummary::
:toctree: generated/
BaseLabeller
DimCoordLabeller
IdxLabeller
DimIdxLabeller
MapLabeller
NoModelLabeller
NoVarLabeller
```
## Labeling utils
``... | arviz-devsREPO_NAMEarvizPATH_START.@arviz_extracted@arviz-main@doc@source@api@plot_utils.md@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter3d/error_x/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(self, plotly_name="color", parent_name="scatter3d.error_x", **kwargs):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter3d@error_x@_color.py@.PATH_END.py |
{
"filename": "install_data.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/numpy/py3/numpy/distutils/command/install_data.py",
"type": "Python"
} | import sys
have_setuptools = ('setuptools' in sys.modules)
from distutils.command.install_data import install_data as old_install_data
#data installer with improved intelligence over distutils
#data files are copied into the project directory instead
#of willy-nilly
class install_data (old_install_data):
def run... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@numpy@py3@numpy@distutils@command@install_data.py@.PATH_END.py |
{
"filename": "test_pd_utils.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/sklearn/inspection/tests/test_pd_utils.py",
"type": "Python"
} | import numpy as np
import pytest
from sklearn.inspection._pd_utils import _check_feature_names, _get_feature_index
from sklearn.utils._testing import _convert_container
@pytest.mark.parametrize(
"feature_names, array_type, expected_feature_names",
[
(None, "array", ["x0", "x1", "x2"]),
(None,... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@sklearn@inspection@tests@test_pd_utils.py@.PATH_END.py |
{
"filename": "test_highs.py",
"repo_name": "stephane-caron/qpsolvers",
"repo_path": "qpsolvers_extracted/qpsolvers-main/tests/test_highs.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: LGPL-3.0-or-later
# Copyright 2016-2022 Stéphane Caron and the qpsolvers contributors
"""Unit tests for HiGHS."""
import unittest
import warnings
from .problems import get_sd3310_problem
try:
from qpsolvers.solvers.highs_ import highs_so... | stephane-caronREPO_NAMEqpsolversPATH_START.@qpsolvers_extracted@qpsolvers-main@tests@test_highs.py@.PATH_END.py |
{
"filename": "MassRadiusDB.py",
"repo_name": "francescoa97outlook/pyExoRaMa",
"repo_path": "pyExoRaMa_extracted/pyExoRaMa-main/GUI_Plot/MassRadiusDB.py",
"type": "Python"
} | # Define some mass - radius curves with regard to the Hydrogen -
# EOS by Becker et al . 2014 ApJS
import numpy as np
massradiusS03Becker = np.array([[0.29836567299736877, 3.0967502757378353],
[0.42884079807835007, 3.338213124916876],
[0.6187732258312179,... | francescoa97outlookREPO_NAMEpyExoRaMaPATH_START.@pyExoRaMa_extracted@pyExoRaMa-main@GUI_Plot@MassRadiusDB.py@.PATH_END.py |
{
"filename": "yml_driver.py",
"repo_name": "jeremysanders/mbproj2",
"repo_path": "mbproj2_extracted/mbproj2-master/mbproj2/yml_driver.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Copyright (C) 2016 Jeremy Sanders <jeremy@jeremysanders.net>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your op... | jeremysandersREPO_NAMEmbproj2PATH_START.@mbproj2_extracted@mbproj2-master@mbproj2@yml_driver.py@.PATH_END.py |
{
"filename": "_ticks.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatter3d/marker/colorbar/_ticks.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicksValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="ticks", parent_name="scatter3d.marker.colorbar", **kwargs
):
super(TicksValidator, self).__init__(
plotly_name=plotly_name,
paren... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatter3d@marker@colorbar@_ticks.py@.PATH_END.py |
{
"filename": "test_viewer.py",
"repo_name": "glue-viz/glue",
"repo_path": "glue_extracted/glue-main/glue/viewers/image/tests/test_viewer.py",
"type": "Python"
} | import numpy as np
from echo import delay_callback
from glue.tests.visual.helpers import visual_test
from glue.viewers.image.viewer import SimpleImageViewer
from glue.core.application_base import Application
from glue.core.data import Data
from glue.core.link_helpers import LinkSame
from glue.core.data_region import Re... | glue-vizREPO_NAMEgluePATH_START.@glue_extracted@glue-main@glue@viewers@image@tests@test_viewer.py@.PATH_END.py |
{
"filename": "MatchedRMExtinctionFunctions.py",
"repo_name": "MehrnooshTahani/MC-BLOS",
"repo_path": "MC-BLOS_extracted/MC-BLOS-main/MolecularClouds/LocalLibraries/MatchedRMExtinctionFunctions.py",
"type": "Python"
} | import numpy as np
'''
Contains functions commonly performed on the MatchedRMExtinction dataset and related files.
'''
# -------- REMOVE REFERENCE POINTS FROM THE MATCHED RM AND EXTINCTION DATA. --------
def unpackRefData(refData):
'''
Unpacks the reference values from the reference value PANDAS table.
:pa... | MehrnooshTahaniREPO_NAMEMC-BLOSPATH_START.@MC-BLOS_extracted@MC-BLOS-main@MolecularClouds@LocalLibraries@MatchedRMExtinctionFunctions.py@.PATH_END.py |
{
"filename": "test_physical.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/units/tests/test_physical.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Regression tests for the physical_type support in the units package
"""
# TEST_UNICODE_LITERALS
from __future__ import (absolute_import, unicode_literals, division,
print_function)
from ... import units as u
from ...units i... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@units@tests@test_physical.py@.PATH_END.py |
{
"filename": "image.py",
"repo_name": "transientskp/pyse",
"repo_path": "pyse_extracted/pyse-master/sourcefinder/image.py",
"type": "Python"
} | """
Some generic utility routines for number handling and
calculating (specific) variances
"""
import itertools
import logging
import numpy as np
from numba import guvectorize, float32, int32
import time
from sourcefinder import extract
from sourcefinder import stats
from sourcefinder import utils
from sourcefinder... | transientskpREPO_NAMEpysePATH_START.@pyse_extracted@pyse-master@sourcefinder@image.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattergeo/marker/line/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="scattergeo.marker.line", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattergeo@marker@line@_color.py@.PATH_END.py |
{
"filename": "_insidetextorientation.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/sunburst/_insidetextorientation.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class InsidetextorientationValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="insidetextorientation", parent_name="sunburst", **kwargs
):
super(InsidetextorientationValidator, self).__init__(
plotly_name... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@sunburst@_insidetextorientation.py@.PATH_END.py |
{
"filename": "setup_package.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/time/setup_package.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
def requires_2to3():
return False
| waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@time@setup_package.py@.PATH_END.py |
{
"filename": "_cmid.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/isosurface/_cmid.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CmidValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="cmid", parent_name="isosurface", **kwargs):
super(CmidValidator, 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@isosurface@_cmid.py@.PATH_END.py |
{
"filename": "_y.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/parcoords/domain/_y.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YValidator(_plotly_utils.basevalidators.InfoArrayValidator):
def __init__(self, plotly_name="y", parent_name="parcoords.domain", **kwargs):
super(YValidator, 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@parcoords@domain@_y.py@.PATH_END.py |
{
"filename": "test_amplitude.py",
"repo_name": "light-curve/light-curve-python",
"repo_path": "light-curve-python_extracted/light-curve-python-master/light-curve/tests/light_curve_py/features/test_amplitude.py",
"type": "Python"
} | import numpy as np
from numpy.testing import assert_allclose
from light_curve.light_curve_py import Amplitude
def test_amplitude():
n = 11
feature = Amplitude()
m = np.arange(n)
desired = (n - 1) / 2
actual = feature(m, m, None)
assert_allclose(actual, desired)
| light-curveREPO_NAMElight-curve-pythonPATH_START.@light-curve-python_extracted@light-curve-python-master@light-curve@tests@light_curve_py@features@test_amplitude.py@.PATH_END.py |
{
"filename": "_marker.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/box/unselected/_marker.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MarkerValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="marker", parent_name="box.unselected", **kwargs):
super(MarkerValidator, 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@box@unselected@_marker.py@.PATH_END.py |
{
"filename": "posAngle.py",
"repo_name": "sczesla/PyAstronomy",
"repo_path": "PyAstronomy_extracted/PyAstronomy-master/src/pyasl/asl/posAngle.py",
"type": "Python"
} | from PyAstronomy import pyaC
from numpy import arctan2, sin, cos, tan
def positionAngle(ra1, dec1, ra2, dec2, positive=True):
"""
Compute the position angle.
The position angle is measured from the first position
from North through East. If the `positive` flag is set
True (default) the result will... | sczeslaREPO_NAMEPyAstronomyPATH_START.@PyAstronomy_extracted@PyAstronomy-master@src@pyasl@asl@posAngle.py@.PATH_END.py |
{
"filename": "UxfpdIdentity.py",
"repo_name": "mmicromegas/ransX",
"repo_path": "ransX_extracted/ransX-master/EQUATIONS/UxfpdIdentity.py",
"type": "Python"
} | import numpy as np
import sys
from scipy import integrate
import matplotlib.pyplot as plt
import UTILS.Calculus as calc
import UTILS.SetAxisLimit as al
import UTILS.Tools as uT
import UTILS.Errors as eR
# Theoretical background https://arxiv.org/abs/1401.5176
# Mocak, Meakin, Viallet, Arnett, 2014, Compressible Hydr... | mmicromegasREPO_NAMEransXPATH_START.@ransX_extracted@ransX-master@EQUATIONS@UxfpdIdentity.py@.PATH_END.py |
{
"filename": "implicit_widgets.py",
"repo_name": "enthought/mayavi",
"repo_path": "mayavi_extracted/mayavi-master/mayavi/components/implicit_widgets.py",
"type": "Python"
} | """A component that provides a selection of implicit widgets
to be used by various modules.
"""
# Author: Suyog Dutt Jain <suyog.jain@aero.iitb.ac.in>
# Prabhu Ramachandran <prabhu at aero.iitb.ac.in>
# Copyright (c) 2009-2020, Enthought, Inc.
# License: BSD Style.
import pickle
from traits.api import (Instan... | enthoughtREPO_NAMEmayaviPATH_START.@mayavi_extracted@mayavi-master@mayavi@components@implicit_widgets.py@.PATH_END.py |
{
"filename": "escape.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/tornado/tornado-4/tornado/escape.py",
"type": "Python"
} | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@tornado@tornado-4@tornado@escape.py@.PATH_END.py |
{
"filename": "_lineposition.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/polar/radialaxis/title/font/_lineposition.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LinepositionValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(
self,
plotly_name="lineposition",
parent_name="layout.polar.radialaxis.title.font",
**kwargs,
):
super(LinepositionValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@polar@radialaxis@title@font@_lineposition.py@.PATH_END.py |
{
"filename": "test_niriss_image.py",
"repo_name": "spacetelescope/jwst",
"repo_path": "jwst_extracted/jwst-main/jwst/regtest/test_niriss_image.py",
"type": "Python"
} | """ Test for the detector1 pipeline using NIRISS image mode, starting with
an uncal file. Results from all intermediate steps, including
charge_migration, are saved for comparisons with truth files.
"""
import pytest
from astropy.io.fits.diff import FITSDiff
from jwst import datamodels
from jwst.stpipe import... | spacetelescopeREPO_NAMEjwstPATH_START.@jwst_extracted@jwst-main@jwst@regtest@test_niriss_image.py@.PATH_END.py |
{
"filename": "parameter.ipynb",
"repo_name": "halomod/halomod",
"repo_path": "halomod_extracted/halomod-main/docs/examples/parameter.ipynb",
"type": "Jupyter Notebook"
} | # Parameter Constraints with `halomod`
In this tutorial, parameters of a minimal galaxy HOD are fitted against power spectrum created using `halomod` with some error bars
For auto-power spectrum, all parameters and related calculation can be done using `TracerHaloModel`. Parameters can be easily updated through `upda... | halomodREPO_NAMEhalomodPATH_START.@halomod_extracted@halomod-main@docs@examples@parameter.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "brinckmann/montepython_public",
"repo_path": "montepython_public_extracted/montepython_public-master/montepython/likelihoods/BK14/__init__.py",
"type": "Python"
} | """
.. module:: BK14
:synopsis: BK14 likelihood from http://arxiv.org/pdf/1510.09217.pdf, http://bicepkeck.org/bk14_2015_release.html
.. moduleauthor:: Thomas Tram <thomas.tram@port.ac.uk>
Last updated July 20, 2016. Based on the CosmoMC module.
"""
import numpy as np
import pandas as pd
import scipy.linalg as la
... | brinckmannREPO_NAMEmontepython_publicPATH_START.@montepython_public_extracted@montepython_public-master@montepython@likelihoods@BK14@__init__.py@.PATH_END.py |
{
"filename": "test_slicer.py",
"repo_name": "pymc-devs/pymc",
"repo_path": "pymc_extracted/pymc-main/tests/step_methods/test_slicer.py",
"type": "Python"
} | # Copyright 2024 The PyMC Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | pymc-devsREPO_NAMEpymcPATH_START.@pymc_extracted@pymc-main@tests@step_methods@test_slicer.py@.PATH_END.py |
{
"filename": "jenglish_similarity_code.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/ml_works/jenglish_similarity_code.py",
"type": "Python"
} | import csv
import numpy as np
from numpy import isnan
from numpy import isinf
from scipy.stats.mstats import zscore
from scipy import spatial
def name_list_generator(file_name):
datafile = open(file_name, 'r')
datareader = csv.reader(datafile)
data_1 = []
for row in datareader:
data_1.append(r... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@ml_works@jenglish_similarity_code.py@.PATH_END.py |
{
"filename": "eval_params.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/benchmarks/ranking/eval_params.py",
"type": "Python"
} | import argparse
import datetime
import json
import os
from copy import deepcopy
from sklearn.model_selection import ParameterGrid
from models import *
from utils import read_dataset
RANDOM_SEED = 0
def argmin(fn, space):
best_score = np.NINF
best_params = {}
for params in ParameterGrid(space):
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@benchmarks@ranking@eval_params.py@.PATH_END.py |
{
"filename": "depthwise_conv2d.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/layers/convolutional/depthwise_conv2d.py",
"type": "Python"
} | from keras.src.api_export import keras_export
from keras.src.layers.convolutional.base_depthwise_conv import BaseDepthwiseConv
@keras_export("keras.layers.DepthwiseConv2D")
class DepthwiseConv2D(BaseDepthwiseConv):
"""2D depthwise convolution layer.
Depthwise convolution is a type of convolution in which eac... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@layers@convolutional@depthwise_conv2d.py@.PATH_END.py |
{
"filename": "make_table.py",
"repo_name": "annayqho/TheCannon",
"repo_path": "TheCannon_extracted/TheCannon-master/code/lamost/abundances/make_table.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
import glob
from matplotlib.colors import LogNorm
from matplotlib import rc
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
ids_raw = glob.glob("../xcalib_4labels/output/*_ids.npz")
ids = []
files = []
chisq = []
for val in ids_raw:
date = (val.split("/... | annayqhoREPO_NAMETheCannonPATH_START.@TheCannon_extracted@TheCannon-master@code@lamost@abundances@make_table.py@.PATH_END.py |
{
"filename": "test_lofarcasatable.py",
"repo_name": "transientskp/pyse",
"repo_path": "pyse_extracted/pyse-master/test/test_lofarcasatable.py",
"type": "Python"
} | import os
import unittest
from sourcefinder import accessors
from sourcefinder.accessors.lofaraccessor import LofarAccessor
from sourcefinder.accessors.lofarcasaimage import LofarCasaImage
from sourcefinder.testutil.decorators import requires_data
from sourcefinder.utility.coordinates import angsep
from .conftest imp... | transientskpREPO_NAMEpysePATH_START.@pyse_extracted@pyse-master@test@test_lofarcasatable.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/GalfitModule/Functions/__init__.py",
"type": "Python"
} | __all__ = ["helper_functions"]
| waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@GalfitModule@Functions@__init__.py@.PATH_END.py |
{
"filename": "_requirestxt.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/setuptools/py3/setuptools/command/_requirestxt.py",
"type": "Python"
} | """Helper code used to generate ``requires.txt`` files in the egg-info directory.
The ``requires.txt`` file has an specific format:
- Environment markers need to be part of the section headers and
should not be part of the requirement spec itself.
See https://setuptools.pypa.io/en/latest/deprecated/python_e... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@setuptools@py3@setuptools@command@_requirestxt.py@.PATH_END.py |
{
"filename": "_reversescale.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattermapbox/marker/_reversescale.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ReversescaleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="reversescale", parent_name="scattermapbox.marker", **kwargs
):
super(ReversescaleValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattermapbox@marker@_reversescale.py@.PATH_END.py |
{
"filename": "EXAMPLE_config_Roman_CGI_HLC_NFOV_Band3.py",
"repo_name": "ajeldorado/falco-python",
"repo_path": "falco-python_extracted/falco-python-master/roman/EXAMPLE_config_Roman_CGI_HLC_NFOV_Band3.py",
"type": "Python"
} | """Configuration file for the Roman CGI model."""
import numpy as np
import os
from astropy.io import fits
import matplotlib.pyplot as plt
import falco
import roman_phasec_proper as phasec
mp = falco.config.ModelParameters()
mp.compact = falco.config.Object()
mp.full = falco.config.Object()
# Path to data needed by... | ajeldoradoREPO_NAMEfalco-pythonPATH_START.@falco-python_extracted@falco-python-master@roman@EXAMPLE_config_Roman_CGI_HLC_NFOV_Band3.py@.PATH_END.py |
{
"filename": "cls_model_test_pipeline.py",
"repo_name": "itseez/opencv",
"repo_path": "opencv_extracted/opencv-master/samples/dnn/dnn_model_runner/dnn_conversion/common/test/cls_model_test_pipeline.py",
"type": "Python"
} | from .configs.test_config import TestClsConfig, TestClsModuleConfig
from .model_test_pipeline import ModelTestPipeline
from ..evaluation.classification.cls_accuracy_evaluator import ClsAccEvaluation
from ..utils import get_test_module
class ClsModelTestPipeline(ModelTestPipeline):
def __init__(
self,
... | itseezREPO_NAMEopencvPATH_START.@opencv_extracted@opencv-master@samples@dnn@dnn_model_runner@dnn_conversion@common@test@cls_model_test_pipeline.py@.PATH_END.py |
{
"filename": "tensor_tracer.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/tpu/tensor_tracer.py",
"type": "Python"
} | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@tpu@tensor_tracer.py@.PATH_END.py |
{
"filename": "dist_info.py",
"repo_name": "davidharvey1986/pyRRG",
"repo_path": "pyRRG_extracted/pyRRG-master/unittests/bugFixPyRRG/lib/python3.7/site-packages/setuptools/command/dist_info.py",
"type": "Python"
} | """
Create a dist_info directory
As defined in the wheel specification
"""
import os
from distutils.core import Command
from distutils import log
class dist_info(Command):
description = 'create a .dist-info directory'
user_options = [
('egg-base=', 'e', "directory containing .egg-info directories"... | davidharvey1986REPO_NAMEpyRRGPATH_START.@pyRRG_extracted@pyRRG-master@unittests@bugFixPyRRG@lib@python3.7@site-packages@setuptools@command@dist_info.py@.PATH_END.py |
{
"filename": "axes_scan.py",
"repo_name": "google/flax",
"repo_path": "flax_extracted/flax-main/flax/core/axes_scan.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@core@axes_scan.py@.PATH_END.py |
{
"filename": "HT.py",
"repo_name": "JoeMcEwen/FAST-PT",
"repo_path": "FAST-PT_extracted/FAST-PT-master/fastpt/HT.py",
"type": "Python"
} | '''
python version of FFTLOG by Andrew Hamilton. I am it calling LOG Hankel Transfrom
This version of the fast Hankle transform is due to
Andrew Hamilton (see http://casa.colorado.edu/~ajsh/FFTLog/).
The orgrinal algorithm is due to Talman (1978).
Joseph E. McEwen
McEwen Laboratories (c) 201... | JoeMcEwenREPO_NAMEFAST-PTPATH_START.@FAST-PT_extracted@FAST-PT-master@fastpt@HT.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "jolideco/jolideco",
"repo_path": "jolideco_extracted/jolideco-main/jolideco/priors/__init__.py",
"type": "Python"
} | from .core import (
ExponentialPrior,
ImagePrior,
InverseGammaPrior,
Priors,
SmoothnessPrior,
UniformPrior,
)
from .lira import LIRAPrior
from .patches import GaussianMixtureModel, GMMPatchPrior, MultiScalePrior
PRIOR_REGISTRY = {
"uniform": UniformPrior,
"gmm-patches": GMMPatchPrior,
... | jolidecoREPO_NAMEjolidecoPATH_START.@jolideco_extracted@jolideco-main@jolideco@priors@__init__.py@.PATH_END.py |
{
"filename": "core.py",
"repo_name": "D-arioSpace/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/jplspec/core.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import warnings
import astropy.units as u
from astropy.io import ascii
from ..query import BaseQuery
from ..utils import async_to_sync
# import configurable items declared in __init__.py
from . import conf
from . import lookup_table
from astroqu... | D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@jplspec@core.py@.PATH_END.py |
{
"filename": "PantheonPlusSNLikelihood.py",
"repo_name": "ja-vazquez/SimpleMC",
"repo_path": "SimpleMC_extracted/SimpleMC-master/simplemc/likelihoods/PantheonPlusSNLikelihood.py",
"type": "Python"
} | from simplemc.likelihoods.BaseLikelihood import BaseLikelihood
import numpy as np
import scipy.linalg as la
from scipy.interpolate import interp1d
from simplemc.setup_logger import cdir
import pandas as pd
class PantheonPlusSNLikelihood(BaseLikelihood):
def __init__(self, name, values_filename, cov_filename, nint... | ja-vazquezREPO_NAMESimpleMCPATH_START.@SimpleMC_extracted@SimpleMC-master@simplemc@likelihoods@PantheonPlusSNLikelihood.py@.PATH_END.py |
{
"filename": "package.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/scripts/spack/packages/opensubdiv/package.py",
"type": "Python"
} | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Opensubdiv(CMakePackage, CudaPackage):
"""OpenSubdiv is a set of open source libraries th... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@scripts@spack@packages@opensubdiv@package.py@.PATH_END.py |
{
"filename": "_tickformatstopdefaults.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/bar/marker/colorbar/_tickformatstopdefaults.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickformatstopdefaultsValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self,
plotly_name="tickformatstopdefaults",
parent_name="bar.marker.colorbar",
**kwargs
):
super(TickformatstopdefaultsValidator, sel... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@bar@marker@colorbar@_tickformatstopdefaults.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.