metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "debug.py",
"repo_name": "spacetelescope/specview",
"repo_path": "specview_extracted/specview-master/proto/specviewer/debug.py",
"type": "Python"
} | import logging
import sys
def msg_debug(msg, cls=None):
if cls is None:
logging.debug('{}: {}'.format(sys._getframe(1).f_code.co_name,
msg))
else:
logging.debug('{}.{}: {}'.format(cls.__name__,
sys._getframe(1).f_cod... | spacetelescopeREPO_NAMEspecviewPATH_START.@specview_extracted@specview-master@proto@specviewer@debug.py@.PATH_END.py |
{
"filename": "test_alpha_perp.py",
"repo_name": "nickhand/pyRSD",
"repo_path": "pyRSD_extracted/pyRSD-master/pyRSD/tests/test_qso_derivatives/test_alpha_perp.py",
"type": "Python"
} | from . import numdifftools, numpy as np
from pyRSD.rsd.power.gradient import compute
from pyRSD.rsd.power.qso.derivatives import PqsoDerivative
import numpy as np
NMU = 41
def test_total(driver):
# set fiducial
model = driver.theory.model
driver.set_fiducial()
# get the deriv arguments
k = dr... | nickhandREPO_NAMEpyRSDPATH_START.@pyRSD_extracted@pyRSD-master@pyRSD@tests@test_qso_derivatives@test_alpha_perp.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/yt/utilities/lib/__init__.py",
"type": "Python"
} | """Blank __init__"""
| yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@utilities@lib@__init__.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "marblestation/iSpec",
"repo_path": "iSpec_extracted/iSpec-master/ispec/modeling/__init__.py",
"type": "Python"
} | #
# This file is part of iSpec.
# Copyright Sergi Blanco-Cuaresma - http://www.blancocuaresma.com/s/
#
# iSpec is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | marblestationREPO_NAMEiSpecPATH_START.@iSpec_extracted@iSpec-master@ispec@modeling@__init__.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattermap/legendgrouptitle/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._text import TextValidator
from ._font import FontValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._text.TextVal... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattermap@legendgrouptitle@__init__.py@.PATH_END.py |
{
"filename": "compute_nu_e_cross_sections.py",
"repo_name": "SNOwGLoBES/snowglobes",
"repo_path": "snowglobes_extracted/snowglobes-master/xscns/scripts/compute_nu_e_cross_sections.py",
"type": "Python"
} | # Compute cross sections for neutrino/electron scattering
# using calculations from doi.org/10.1088/0954-3899/29/11/013
# This script has been tested with python 2.6 and 3.7
import numpy as np
import matplotlib.pyplot as plt
import math
import code
# Goodness so many constants (from the paper)
Gmu = 1.16637e-5 # GeV... | SNOwGLoBESREPO_NAMEsnowglobesPATH_START.@snowglobes_extracted@snowglobes-master@xscns@scripts@compute_nu_e_cross_sections.py@.PATH_END.py |
{
"filename": "_showtickprefix.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattermapbox/marker/colorbar/_showtickprefix.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowtickprefixValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="showtickprefix",
parent_name="scattermapbox.marker.colorbar",
**kwargs,
):
super(ShowtickprefixValidator, self).__init__... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattermapbox@marker@colorbar@_showtickprefix.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "sgshulman/DGEM",
"repo_path": "DGEM_extracted/DGEM-master/README.md",
"type": "Markdown"
} | # DGEM



import getopt
import glob as glob
import os
import sys
import matplotlib.pylab as plt
import numpy as np
import ... | MichaelCretignierREPO_NAMERassine_publicPATH_START.@Rassine_public_extracted@Rassine_public-master@Python<3.7@Rassine_trigger.py@.PATH_END.py |
{
"filename": "loss_plot_train_ary.py",
"repo_name": "chenwuperth/rgz_rcnn",
"repo_path": "rgz_rcnn_extracted/rgz_rcnn-master/experiments/scripts/plots/loss/train/loss_plot_train_ary.py",
"type": "Python"
} | import glob, os, re
import numpy as np
files = ['D1_264_train.out','D3_600_train.out','D4_600_train.out']
file_num = len(files)
# iter = 80000 -> iters =8000
iters = 8000
save_file = 'tra_loss.npy'
data_num = 12280
# processing txt data
data = []
for nfil in files:
with open(nfil) as fil:
lines = fil.readlines()
f... | chenwuperthREPO_NAMErgz_rcnnPATH_START.@rgz_rcnn_extracted@rgz_rcnn-master@experiments@scripts@plots@loss@train@loss_plot_train_ary.py@.PATH_END.py |
{
"filename": "docscrape.py",
"repo_name": "astroML/gatspy",
"repo_path": "gatspy_extracted/gatspy-master/doc/sphinxext/numpy_ext/docscrape.py",
"type": "Python"
} | """Extract reference documentation from the NumPy source tree.
"""
from __future__ import division, absolute_import, print_function
import inspect
import textwrap
import re
import pydoc
from warnings import warn
import collections
import sys
class Reader(object):
"""A line-based string reader.
"""
def ... | astroMLREPO_NAMEgatspyPATH_START.@gatspy_extracted@gatspy-master@doc@sphinxext@numpy_ext@docscrape.py@.PATH_END.py |
{
"filename": "SB across core in MACS J0717.ipynb",
"repo_name": "gogrean/PyXel",
"repo_path": "PyXel_extracted/PyXel-master/examples/notebooks/SB across core in MACS J0717.ipynb",
"type": "Jupyter Notebook"
} | ```python
%matplotlib inline
import os
import pickle
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
from pyxel import Image, load_region
from pyxel.models import BrokenPow, IntModel
from pyxel.fitters import CstatFitter
```
```python
pkl = 'profile-core-ell.pkl'
if os.path.exi... | gogreanREPO_NAMEPyXelPATH_START.@PyXel_extracted@PyXel-master@examples@notebooks@SB across core in MACS J0717.ipynb@.PATH_END.py |
{
"filename": "mulan.py",
"repo_name": "muLAn-project/muLAn",
"repo_path": "muLAn_extracted/muLAn-master/muLAn/mulan.py",
"type": "Python"
} | # -*-coding:Utf-8 -*
# ====================================================================
# MIT License
#
# Copyright (c) 2014-2017 The muLAn project team
# Copyright (c) 2014-2017 Clément Ranc & Arnaud Cassan
#
# See the LICENCE file
# ====================================================================
# -------... | muLAn-projectREPO_NAMEmuLAnPATH_START.@muLAn_extracted@muLAn-master@muLAn@mulan.py@.PATH_END.py |
{
"filename": "thermal_attenuation.py",
"repo_name": "PrincetonUniversity/athena",
"repo_path": "athena_extracted/athena-master/tst/regression/scripts/tests/diffusion/thermal_attenuation.py",
"type": "Python"
} | # Regression test based on the decaying linear wave due to thermal
# conduction. The decay rate is fit and then compared with analytic
# solution.
# Modules
import logging
import numpy as np
from numpy.polynomial import Polynomial
import sys
import scripts.utils.athena as athena
sys.path.insert(0, '../../vis/python')
... | PrincetonUniversityREPO_NAMEathenaPATH_START.@athena_extracted@athena-master@tst@regression@scripts@tests@diffusion@thermal_attenuation.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "ggalloni/cobaya",
"repo_path": "cobaya_extracted/cobaya-master/cobaya/likelihoods/planck_2015_plikHM_TT/__init__.py",
"type": "Python"
} | from cobaya.likelihoods.base_classes import Planck2015Clik
class planck_2015_plikHM_TT(Planck2015Clik):
r"""
High-$\ell$ temperature-only likelihood (binned) of Planck's 2015 data release
\cite{Aghanim:2015xee}.
"""
pass
| ggalloniREPO_NAMEcobayaPATH_START.@cobaya_extracted@cobaya-master@cobaya@likelihoods@planck_2015_plikHM_TT@__init__.py@.PATH_END.py |
{
"filename": "export.py",
"repo_name": "ML4GW/aframe",
"repo_path": "aframe_extracted/aframe-main/aframe/tasks/export/export.py",
"type": "Python"
} | import os
import law
import luigi
from luigi.util import inherits
from aframe.base import AframeSingularityTask
from aframe.config import paths
from aframe.parameters import PathParameter
from aframe.tasks.export.target import ModelRepositoryTarget
class ExportParams(law.Task):
fduration = luigi.FloatParameter(... | ML4GWREPO_NAMEaframePATH_START.@aframe_extracted@aframe-main@aframe@tasks@export@export.py@.PATH_END.py |
{
"filename": "c_lexer.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/pycparser/py2/pycparser/c_lexer.py",
"type": "Python"
} | #------------------------------------------------------------------------------
# pycparser: c_lexer.py
#
# CLexer class: lexer for the C language
#
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#------------------------------------------------------------------------------
import re
from .ply import... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@pycparser@py2@pycparser@c_lexer.py@.PATH_END.py |
{
"filename": "gammainc_data.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/scipy/special/_precompute/gammainc_data.py",
"type": "Python"
} | """Compute gammainc and gammaincc for large arguments and parameters
and save the values to data files for use in tests. We can't just
compare to mpmath's gammainc in test_mpmath.TestSystematic because it
would take too long.
Note that mpmath's gammainc is computed using hypercomb, but since it
doesn't allow the user ... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@scipy@special@_precompute@gammainc_data.py@.PATH_END.py |
{
"filename": "test_irsa.py",
"repo_name": "astropy/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/ipac/irsa/tests/test_irsa.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from astropy.coordinates import SkyCoord
import astropy.units as u
from astroquery.ipac.irsa import Irsa
from astroquery.exceptions import InvalidQueryError
OBJ_LIST = ["00h42m44.330s +41d16m07.50s",
SkyCoord(l=121.1743 * u.deg... | astropyREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@ipac@irsa@tests@test_irsa.py@.PATH_END.py |
{
"filename": "quatextensions.py",
"repo_name": "CMB-S4/spt3g_software",
"repo_path": "spt3g_software_extracted/spt3g_software-master/core/python/quatextensions.py",
"type": "Python"
} | import numpy as np
from . import Quat, G3VectorQuat, G3TimestreamQuat
__all__ = []
quat_types = (Quat, G3VectorQuat, G3TimestreamQuat)
def quat_ufunc(self, ufunc, method, *inputs, **kwargs):
"""Numpy ufunc interface for vectorized quaternion methods."""
if ufunc.__name__ in ["isinf", "isnan", "isfinite"] an... | CMB-S4REPO_NAMEspt3g_softwarePATH_START.@spt3g_software_extracted@spt3g_software-master@core@python@quatextensions.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/pip/__init__.py",
"type": "Python"
} | #!/usr/bin/env python
import os
import optparse
import sys
import re
from pip.exceptions import InstallationError, CommandError, PipError
from pip.log import logger
from pip.util import get_installed_distributions, get_prog
from pip.vcs import git, mercurial, subversion, bazaar # noqa
from pip.baseparser import crea... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@pip@__init__.py@.PATH_END.py |
{
"filename": "many_times.ipynb",
"repo_name": "GuillermoFrancoAbellan/class_clumpy",
"repo_path": "class_clumpy_extracted/class_clumpy-main/notebooks/many_times.ipynb",
"type": "Jupyter Notebook"
} | ```python
# import necessary modules
# uncomment to get plots displayed in notebook
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from classy import Class
from scipy.optimize import fsolve
from scipy.interpolate import interp1d
import math
```
```python
# esthetic definitions... | GuillermoFrancoAbellanREPO_NAMEclass_clumpyPATH_START.@class_clumpy_extracted@class_clumpy-main@notebooks@many_times.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "mj-will/nessai",
"repo_path": "nessai_extracted/nessai-main/src/nessai/experimental/flowmodel/__init__.py",
"type": "Python"
} | mj-willREPO_NAMEnessaiPATH_START.@nessai_extracted@nessai-main@src@nessai@experimental@flowmodel@__init__.py@.PATH_END.py | |
{
"filename": "Greybody_emulator.ipynb",
"repo_name": "H-E-L-P/XID_plus",
"repo_path": "XID_plus_extracted/XID_plus-master/docs/build/html/notebooks/examples/SED_emulator/Greybody_emulator.ipynb",
"type": "Jupyter Notebook"
} | ```python
import fitIR
import fitIR.models as models
import fitIR.analyse as analyse
from astropy.cosmology import WMAP9 as cosmo
import jax
import numpy as np
import pylab as plt
import astropy.units as u
import scipy.integrate as integrate
%matplotlib inline
import jax.numpy as jnp
from jax import grad, jit, vmap, v... | H-E-L-PREPO_NAMEXID_plusPATH_START.@XID_plus_extracted@XID_plus-master@docs@build@html@notebooks@examples@SED_emulator@Greybody_emulator.ipynb@.PATH_END.py |
{
"filename": "createRMParmdb.py",
"repo_name": "lofar-astron/RMextract",
"repo_path": "RMextract_extracted/RMextract-master/RMextract/LOFAR_TOOLS/createRMParmdb.py",
"type": "Python"
} | import argparse
import os
import lofar.parmdb as parmdb
import numpy as np
import pyrap.tables as tab
import RMextract.getRM as gt
def createRMParmdb(MS,parmdbname,create=True,patchname='',
server="ftp://cddis.gsfc.nasa.gov/gnss/products/ionex/",
prefix='codg',
... | lofar-astronREPO_NAMERMextractPATH_START.@RMextract_extracted@RMextract-master@RMextract@LOFAR_TOOLS@createRMParmdb.py@.PATH_END.py |
{
"filename": "lockfile_helpers.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/samp/lockfile_helpers.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
# TODO: this file should be refactored to use a more thread-safe and
# race-condition-safe lockfile mechanism.
import datetime
import os
import ... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@samp@lockfile_helpers.py@.PATH_END.py |
{
"filename": "transpose.py",
"repo_name": "ledatelescope/bifrost",
"repo_path": "bifrost_extracted/bifrost-master/python/bifrost/blocks/transpose.py",
"type": "Python"
} |
# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | ledatelescopeREPO_NAMEbifrostPATH_START.@bifrost_extracted@bifrost-master@python@bifrost@blocks@transpose.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "pyro-ppl/pyro",
"repo_path": "pyro_extracted/pyro-master/tests/contrib/epidemiology/__init__.py",
"type": "Python"
} | pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@tests@contrib@epidemiology@__init__.py@.PATH_END.py | |
{
"filename": "_text.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterternary/_text.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="text", parent_name="scatterternary", **kwargs):
super(TextValidator, 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@scatterternary@_text.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "astro-seanwhy/AstroStats",
"repo_path": "AstroStats_extracted/AstroStats-main/README.md",
"type": "Markdown"
} | AstroStats is designed for hosting a series of statistical test methods that are not easily found in standard Python/R packages but are relevant for astrophysical and exoplanetary studies.
These codes are released in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCH... | astro-seanwhyREPO_NAMEAstroStatsPATH_START.@AstroStats_extracted@AstroStats-main@README.md@.PATH_END.py |
{
"filename": "slack.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/tools/slack.ipynb",
"type": "Jupyter Notebook"
} | # Slack Toolkit
This will help you getting started with the Slack [toolkit](/docs/concepts/tools/#toolkits). For detailed documentation of all SlackToolkit features and configurations head to the [API reference](https://python.langchain.com/api_reference/community/agent_toolkits/langchain_community.agent_toolkits.slac... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@tools@slack.ipynb@.PATH_END.py |
{
"filename": "_tickformatstopdefaults.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/surface/colorbar/_tickformatstopdefaults.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickformatstopdefaultsValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self,
plotly_name="tickformatstopdefaults",
parent_name="surface.colorbar",
**kwargs
):
super(TickformatstopdefaultsValidator, self).... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@surface@colorbar@_tickformatstopdefaults.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "mavrix93/LightCurvesClassifier",
"repo_path": "LightCurvesClassifier_extracted/LightCurvesClassifier-master/lcc/stars_processing/descriptors/__init__.py",
"type": "Python"
} | """There are implementations of filters"""
from .abbe_value_descr import AbbeValueDescr
from .color_index_descr import ColorIndexDescr
from .curve_density_descr import CurveDensityDescr
from .curve_descr import CurveDescr
from .curves_shape_descr import CurvesShapeDescr
from .hist_shape_descr import HistShapeDescr
fro... | mavrix93REPO_NAMELightCurvesClassifierPATH_START.@LightCurvesClassifier_extracted@LightCurvesClassifier-master@lcc@stars_processing@descriptors@__init__.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "spacetelescope/specview",
"repo_path": "specview_extracted/specview-master/proto/spectraltool-jde/setup.py",
"type": "Python"
} | import sys
sys.path.insert(1, '../spec-widgets/specviewer')
from sp_model_manager import ModelManager
from specviewer import SpecViewer
mm = ModelManager()
sv = SpecViewer()
| spacetelescopeREPO_NAMEspecviewPATH_START.@specview_extracted@specview-master@proto@spectraltool-jde@setup.py@.PATH_END.py |
{
"filename": "generate_Pk_example_w_tensors.py",
"repo_name": "wlxu/RelicClass",
"repo_path": "RelicClass_extracted/RelicClass-master/external_Pk/generate_Pk_example_w_tensors.py",
"type": "Python"
} | #!/usr/bin/python
from __future__ import print_function
import sys
from math import exp
# README:
#
# This is an example python script for the external_Pk mode of Class.
# It generates the primordial spectrum of LambdaCDM.
# It can be edited and used directly, though keeping a copy of it is recommended.
#
# Two (maybe... | wlxuREPO_NAMERelicClassPATH_START.@RelicClass_extracted@RelicClass-master@external_Pk@generate_Pk_example_w_tensors.py@.PATH_END.py |
{
"filename": "MPWTest.py",
"repo_name": "djgroen/MPWide",
"repo_path": "MPWide_extracted/MPWide-master/python/MPWTest.py",
"type": "Python"
} | import sys
import time
import argparse
# load the shared object
#import MPWide
import ctypes
MPWide = ctypes.cdll.LoadLibrary("../libMPW.so")
"""
MPWide Test script (direct port from Test.cpp).
- TODO: incorporate argparse mechanism
- TODO: It's possible to convert NumPy array to char * without copying (which
we... | djgroenREPO_NAMEMPWidePATH_START.@MPWide_extracted@MPWide-master@python@MPWTest.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "bfarr/exocartographer",
"repo_path": "exocartographer_extracted/exocartographer-master/stan/README.md",
"type": "Markdown"
} | # An Implementation of Exocartographer in Stan
This directory contains a [Stan](http://mc-stan.org) file that implements an
exocartographer-like algorithm. Because Stan does not natively understand
[healpix](https://healpix.jpl.nasa.gov/), it is necessary to do some
pre-computation in order to use the Stan sampler. ... | bfarrREPO_NAMEexocartographerPATH_START.@exocartographer_extracted@exocartographer-master@stan@README.md@.PATH_END.py |
{
"filename": "_dtheta.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/barpolar/_dtheta.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class DthetaValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="dtheta", parent_name="barpolar", **kwargs):
super(DthetaValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@barpolar@_dtheta.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "mmicromegas/ransX",
"repo_path": "ransX_extracted/ransX-master/UTILS/RANSX/__init__.py",
"type": "Python"
} | mmicromegasREPO_NAMEransXPATH_START.@ransX_extracted@ransX-master@UTILS@RANSX@__init__.py@.PATH_END.py | |
{
"filename": "test_model_compatibility.py",
"repo_name": "dmlc/xgboost",
"repo_path": "xgboost_extracted/xgboost-master/tests/python/test_model_compatibility.py",
"type": "Python"
} | import copy
import json
import os
import urllib.request
import zipfile
import generate_models as gm
import pytest
import xgboost
from xgboost import testing as tm
def run_model_param_check(config):
assert config['learner']['learner_model_param']['num_feature'] == str(4)
assert config['learner']['learner_tra... | dmlcREPO_NAMExgboostPATH_START.@xgboost_extracted@xgboost-master@tests@python@test_model_compatibility.py@.PATH_END.py |
{
"filename": "hello_world.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/integration_tests/examples/hello_world.py",
"type": "Python"
} | #!/usr/bin/env python3
import sys
def main() -> int:
print("Hello World!") # noqa: T201
return 0
if __name__ == "__main__":
sys.exit(main())
| langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@integration_tests@examples@hello_world.py@.PATH_END.py |
{
"filename": "_variantsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter3d/hoverlabel/font/_variantsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="variantsrc",
parent_name="scatter3d.hoverlabel.font",
**kwargs,
):
super(VariantsrcValidator, self).__init__(
plotly_na... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter3d@hoverlabel@font@_variantsrc.py@.PATH_END.py |
{
"filename": "posterior.py",
"repo_name": "ACCarnall/bagpipes",
"repo_path": "bagpipes_extracted/bagpipes-master/bagpipes/fitting/posterior.py",
"type": "Python"
} | from __future__ import print_function, division, absolute_import
import numpy as np
import os
import h5py
from copy import deepcopy
from .fitted_model import fitted_model
from .prior import dirichlet
from ..models.star_formation_history import star_formation_history
from ..models.model_galaxy import model_galaxy
... | ACCarnallREPO_NAMEbagpipesPATH_START.@bagpipes_extracted@bagpipes-master@bagpipes@fitting@posterior.py@.PATH_END.py |
{
"filename": "sitemap.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/document_loaders/sitemap.ipynb",
"type": "Jupyter Notebook"
} | # Sitemap
Extends from the `WebBaseLoader`, `SitemapLoader` loads a sitemap from a given URL, and then scrapes and loads all pages in the sitemap, returning each page as a Document.
The scraping is done concurrently. There are reasonable limits to concurrent requests, defaulting to 2 per second. If you aren't concer... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@document_loaders@sitemap.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "nuc-astro/winnet",
"repo_path": "winnet_extracted/winnet-master/bin/__init__.py",
"type": "Python"
} | nuc-astroREPO_NAMEwinnetPATH_START.@winnet_extracted@winnet-master@bin@__init__.py@.PATH_END.py | |
{
"filename": "zarr_dataset.py",
"repo_name": "neuraloperator/neuraloperator",
"repo_path": "neuraloperator_extracted/neuraloperator-main/neuralop/data/datasets/zarr_dataset.py",
"type": "Python"
} | import torch
import zarr
from torch.utils.data import Dataset
class ZarrDataset(Dataset):
"""PDE h5py dataset"""
def __init__(
self,
filename,
resolution=128,
transform_x=None,
transform_y=None,
n_samples=None,
):
resolution_to_step = {128: 8, 256: ... | neuraloperatorREPO_NAMEneuraloperatorPATH_START.@neuraloperator_extracted@neuraloperator-main@neuralop@data@datasets@zarr_dataset.py@.PATH_END.py |
{
"filename": "_width.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/indicator/gauge/threshold/line/_width.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="width",
parent_name="indicator.gauge.threshold.line",
**kwargs,
):
super(WidthValidator, self).__init__(
plotly_name=plot... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@indicator@gauge@threshold@line@_width.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/histogram/textfont/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._weight import WeightValidator
from ._variant import VariantValidator
from ._textcase import TextcaseValidator
from ._style import StyleValidator
from ._size import SizeValidator
from ._shadow impor... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@histogram@textfont@__init__.py@.PATH_END.py |
{
"filename": "roman_o.py",
"repo_name": "CosmoLike/cocoa",
"repo_path": "cocoa_extracted/cocoa-main/cocoa_installation_libraries/cobaya_changes/cobaya/likelihoods/sn/roman_o.py",
"type": "Python"
} | from cobaya.likelihoods.base_classes import SN
class roman_o(SN):
r"""
Likelihood (marginalized over nuisance parameters) of the JLA type Ia supernova sample
\cite{Betoule:2014frx}, based on observations obtained by the SDSS-II and SNLS
collaborations.
"""
pass
| CosmoLikeREPO_NAMEcocoaPATH_START.@cocoa_extracted@cocoa-main@cocoa_installation_libraries@cobaya_changes@cobaya@likelihoods@sn@roman_o.py@.PATH_END.py |
{
"filename": "forwardprop_util.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/eager/forwardprop_util.py",
"type": "Python"
} | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@eager@forwardprop_util.py@.PATH_END.py |
{
"filename": "_compat.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/attr/_compat.py",
"type": "Python"
} | from __future__ import absolute_import, division, print_function
import platform
import sys
import types
import warnings
PY2 = sys.version_info[0] == 2
PYPY = platform.python_implementation() == "PyPy"
if PY2:
from UserDict import IterableUserDict
# We 'bundle' isclass instead of using inspect as importin... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@attr@_compat.py@.PATH_END.py |
{
"filename": "TestNestedSampler.py",
"repo_name": "dokester/BayesicFitting",
"repo_path": "BayesicFitting_extracted/BayesicFitting-master/BayesicFitting/test/TestNestedSampler.py",
"type": "Python"
} | # run with : python3 -m unittest TestNestedSampler
# or : python3 -m unittest TestNestedSampler.TestNestedSampler.test1
import unittest
import os
import time
import numpy as numpy
from astropy import units
import math
from numpy.testing import assert_array_almost_equal as assertAAE
from FitPlot import plotFit
i... | dokesterREPO_NAMEBayesicFittingPATH_START.@BayesicFitting_extracted@BayesicFitting-master@BayesicFitting@test@TestNestedSampler.py@.PATH_END.py |
{
"filename": "base_multitemper.py",
"repo_name": "gwastro/pycbc",
"repo_path": "pycbc_extracted/pycbc-master/pycbc/inference/io/base_multitemper.py",
"type": "Python"
} | # Copyright (C) 2018 Collin Capano
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# self.option) any later version.
#
# This program is distributed ... | gwastroREPO_NAMEpycbcPATH_START.@pycbc_extracted@pycbc-master@pycbc@inference@io@base_multitemper.py@.PATH_END.py |
{
"filename": "boundary_comp.py",
"repo_name": "atomec-project/atoMEC",
"repo_path": "atoMEC_extracted/atoMEC-master/examples/boundary_comp.py",
"type": "Python"
} | #!/usr/bin/env python3
"""
Compares dirichlet and neumann boundary conditions for Aluminium
"""
from atoMEC import models, Atom, config
# use parallelization to make things slightly quicker
config.numcores = -1
# initialize the atom
Al = Atom("Al", density=2.7, temp=5, units_temp="eV")
# set up the model with lda e... | atomec-projectREPO_NAMEatoMECPATH_START.@atoMEC_extracted@atoMEC-master@examples@boundary_comp.py@.PATH_END.py |
{
"filename": "DINO_4scale_swin.py",
"repo_name": "Nikhel1/Gal-DINO",
"repo_path": "Gal-DINO_extracted/Gal-DINO-main/config/DINO/DINO_4scale_swin.py",
"type": "Python"
} | _base_ = ['coco_transformer.py']
num_classes=91
lr = 0.0001
param_dict_type = 'default'
lr_backbone = 1e-05
lr_backbone_names = ['backbone.0']
lr_linear_proj_names = ['reference_points', 'sampling_offsets']
lr_linear_proj_mult = 0.1
ddetr_lr_param = False
batch_size = 2
weight_decay = 0.0001
epochs = 12
lr_drop = 11
... | Nikhel1REPO_NAMEGal-DINOPATH_START.@Gal-DINO_extracted@Gal-DINO-main@config@DINO@DINO_4scale_swin.py@.PATH_END.py |
{
"filename": "test_ahf.py",
"repo_name": "ytree-project/ytree",
"repo_path": "ytree_extracted/ytree-main/tests/frontends/test_ahf.py",
"type": "Python"
} | from ytree.frontends.ahf import \
AHFArbor, \
AHFNewArbor
from ytree.utilities.testing import \
ArborTest, \
TempDirTest
class AHFArborTest(TempDirTest, ArborTest):
arbor_type = AHFArbor
test_filename = "ahf_halos/snap_N64L16_000.parameter"
num_data_files = 136
tree_skip = 100
class AH... | ytree-projectREPO_NAMEytreePATH_START.@ytree_extracted@ytree-main@tests@frontends@test_ahf.py@.PATH_END.py |
{
"filename": "combine_resstudy_results.py",
"repo_name": "samuelyeewl/specmatch-emp",
"repo_path": "specmatch-emp_extracted/specmatch-emp-master/tests/combine_resstudy_results.py",
"type": "Python"
} | #!/usr/bin/env python
"""
@filename combine_resstudy_results.py
Combine results from resolution degradation study
"""
import pandas as pd
import numpy as np
from collections import defaultdict
from specmatchemp import library
from specmatchemp import specmatch
# Noise selection path
lst = '/home/syee/specmatchemp-w... | samuelyeewlREPO_NAMEspecmatch-empPATH_START.@specmatch-emp_extracted@specmatch-emp-master@tests@combine_resstudy_results.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/tests/test_core/test_optional_imports/__init__.py",
"type": "Python"
} | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@tests@test_core@test_optional_imports@__init__.py@.PATH_END.py | |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattercarpet/unselected/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._textfont import TextfontValidator
from ._marker import MarkerValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattercarpet@unselected@__init__.py@.PATH_END.py |
{
"filename": "test_assumptions.py",
"repo_name": "ryanvarley/exodata",
"repo_path": "exodata_extracted/exodata-master/exodata/tests/test_assumptions.py",
"type": "Python"
} | import unittest
from .patches import TestCase
class Test_planetAssumptions(TestCase):
def test_MassType(self):
pass
if __name__ == '__main__':
unittest.main()
| ryanvarleyREPO_NAMEexodataPATH_START.@exodata_extracted@exodata-master@exodata@tests@test_assumptions.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "sibirrer/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_LensModel/test_Util/__init__.py",
"type": "Python"
} | sibirrerREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_LensModel@test_Util@__init__.py@.PATH_END.py | |
{
"filename": "__init__.py",
"repo_name": "fchollet/keras",
"repo_path": "keras_extracted/keras-master/keras/api/_tf_keras/keras/distribution/__init__.py",
"type": "Python"
} | """DO NOT EDIT.
This file was autogenerated. Do not edit it by hand,
since your modifications would be overwritten.
"""
from keras.src.distribution.distribution_lib import DataParallel
from keras.src.distribution.distribution_lib import DeviceMesh
from keras.src.distribution.distribution_lib import LayoutMap
from ker... | fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@api@_tf_keras@keras@distribution@__init__.py@.PATH_END.py |
{
"filename": "hera-sim-vis.py",
"repo_name": "HERA-Team/hera_sim",
"repo_path": "hera_sim_extracted/hera_sim-main/scripts/hera-sim-vis.py",
"type": "Python"
} | #!/bin/env python
"""
Command-line interface for simulating visibilities with ``hera_sim``.
This script may be used to run a visibility simulation from a configuration file and
write the result to disk.
"""
from hera_cli_utils import parse_args, run_with_profiling
from hera_sim.visibilities.cli import run_vis_sim, ... | HERA-TeamREPO_NAMEhera_simPATH_START.@hera_sim_extracted@hera_sim-main@scripts@hera-sim-vis.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "kevin218/Eureka",
"repo_path": "Eureka_extracted/Eureka-main/src/eureka/S6_planet_spectra/__init__.py",
"type": "Python"
} | """
Package to plot transmission/emission spectra after fitting
"""
from . import plots_s6
from . import s6_spectra
from . import s6_meta
| kevin218REPO_NAMEEurekaPATH_START.@Eureka_extracted@Eureka-main@src@eureka@S6_planet_spectra@__init__.py@.PATH_END.py |
{
"filename": "typechecks.py",
"repo_name": "sbi-dev/sbi",
"repo_path": "sbi_extracted/sbi-main/sbi/utils/typechecks.py",
"type": "Python"
} | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
"""Functions that check types."""
def is_bool(x):
return isinstance(x, bool)
def is_int(x):
return isinstance(x, int)
def is_positive_int(x)... | sbi-devREPO_NAMEsbiPATH_START.@sbi_extracted@sbi-main@sbi@utils@typechecks.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "rhayes777/PyAutoFit",
"repo_path": "PyAutoFit_extracted/PyAutoFit-main/autofit/graphical/declarative/factor/__init__.py",
"type": "Python"
} | rhayes777REPO_NAMEPyAutoFitPATH_START.@PyAutoFit_extracted@PyAutoFit-main@autofit@graphical@declarative@factor@__init__.py@.PATH_END.py | |
{
"filename": "pyoof_effelsberg_mpi.py",
"repo_name": "tcassanelli/pyoof",
"repo_path": "pyoof_extracted/pyoof-master/scripts/pyoof_effelsberg_mpi.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Tomas Cassanelli
import numpy as np
import glob
from astropy import units as u
from pyoof import aperture, telgeometry, fit_zpoly, extract_data_effelsberg
import mpi4py.rc
mpi4py.rc.threads = False
from mpi4py import MPI
comm = MPI.COMM_WORLD
size = comm.Get_si... | tcassanelliREPO_NAMEpyoofPATH_START.@pyoof_extracted@pyoof-master@scripts@pyoof_effelsberg_mpi.py@.PATH_END.py |
{
"filename": "uniontable.md",
"repo_name": "jbroll/starbase",
"repo_path": "starbase_extracted/starbase-master/docs/uniontable.md",
"type": "Markdown"
} |
### uniontable - compute the union of starbase data tables.
SYNOPSYS
--------
```
`uniontable` [-o *ofile] *table1* *table2* [*tablen~] ...
```
DESCRIPTION
-----------
`uniontable` computes the union of two or more tables. It concatenates the
rows of all the tables into one larger table. All the rows and... | jbrollREPO_NAMEstarbasePATH_START.@starbase_extracted@starbase-master@docs@uniontable.md@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "webbjj/m2mcluster",
"repo_path": "m2mcluster_extracted/m2mcluster-main/m2mcluster/setup.py",
"type": "Python"
} | from __future__ import print_function
import numpy as np
from amuse.lab import *
from amuse.units import nbody_system,units
from amuse.datamodel import Particles
def setup_star_cluster(N=100, Mcluster=100.0 | units.MSun, Rcluster= 1.0 | units.parsec, softening=0.1 | units.parsec, W0=0.,imf='kroupa', mmin=0.08 | units... | webbjjREPO_NAMEm2mclusterPATH_START.@m2mcluster_extracted@m2mcluster-main@m2mcluster@setup.py@.PATH_END.py |
{
"filename": "MC_calc.py",
"repo_name": "joshuakt/Oxygen-False-Positives",
"repo_path": "Oxygen-False-Positives_extracted/Oxygen-False-Positives-main/MC_calc.py",
"type": "Python"
} | #####################
# load modules
import time
#model_run_time = time.time()
#time.sleep(16000)
import numpy as np
import pylab
from joblib import Parallel, delayed
from all_classes import *
from Main_code_callable import forward_model
import sys
import os
import shutil
import contextlib
####################
num_r... | joshuaktREPO_NAMEOxygen-False-PositivesPATH_START.@Oxygen-False-Positives_extracted@Oxygen-False-Positives-main@MC_calc.py@.PATH_END.py |
{
"filename": "analysis.ipynb",
"repo_name": "tanner-trickle/EXCEED-DM",
"repo_path": "EXCEED-DM_extracted/EXCEED-DM-main/examples/15/analysis.ipynb",
"type": "Jupyter Notebook"
} | # Example 15 Analysis
We will plot the rate binned in energy deposition.
## Packages
```python
import numpy as np
# some personal preferences for nice plots
%run "../../utilities/output_parser/plotter.ipynb"
# helpful functions for processing output
import sys
sys.path.append("../../utilities/output_parser")
impo... | tanner-trickleREPO_NAMEEXCEED-DMPATH_START.@EXCEED-DM_extracted@EXCEED-DM-main@examples@15@analysis.ipynb@.PATH_END.py |
{
"filename": "version.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/ipython/py2/IPython/utils/version.py",
"type": "Python"
} | # encoding: utf-8
"""
Utilities for version comparison
It is a bit ridiculous that we need these.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the f... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipython@py2@IPython@utils@version.py@.PATH_END.py |
{
"filename": "ftplib.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/tools/python3/Lib/ftplib.py",
"type": "Python"
} | """An FTP client class and some helper functions.
Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds
Example:
>>> from ftplib import FTP
>>> ftp = FTP('ftp.python.org') # connect to host, default port
>>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@
'230 Guest login ok, ac... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@python3@Lib@ftplib.py@.PATH_END.py |
{
"filename": "_tick0.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/cone/colorbar/_tick0.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class Tick0Validator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="tick0", parent_name="cone.colorbar", **kwargs):
super(Tick0Validator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@cone@colorbar@_tick0.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "mlarichardson/CosmosCanvas",
"repo_path": "CosmosCanvas_extracted/CosmosCanvas-main/README.md",
"type": "Markdown"
} | # CosmosCanvas
A library for creating useful colour maps for different astrophysical properties, that relies on Gilles Ferrand's [colourspace](https://github.com/gillesferrand/colourspace). Accepted by the Astrophysics Source Code Library https://ascl.net/2401.005. If you use this code for your publication please use t... | mlarichardsonREPO_NAMECosmosCanvasPATH_START.@CosmosCanvas_extracted@CosmosCanvas-main@README.md@.PATH_END.py |
{
"filename": "test_utils.py",
"repo_name": "MikeSWang/Harmonia",
"repo_path": "Harmonia_extracted/Harmonia-master/harmonia/tests/test_utils.py",
"type": "Python"
} | import numpy as np
import pytest
from mpi4py.MPI import COMM_WORLD
import harmonia.utils as u
@pytest.mark.parametrize(
"data_array,mapping,comm,values",
[
([1, 2, 3, 4], np.square, COMM_WORLD, [1, 4, 9, 16]),
]
)
def test_mpi_compute(data_array, mapping, comm, values):
assert u.mpi_compute(d... | MikeSWangREPO_NAMEHarmoniaPATH_START.@Harmonia_extracted@Harmonia-master@harmonia@tests@test_utils.py@.PATH_END.py |
{
"filename": "conftest.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/matplotlib/testing/conftest.py",
"type": "Python"
} | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import pytest
import matplotlib
def pytest_configure(config):
matplotlib.use('agg')
matplotlib._called_from_pytest = True
matplotlib._init_tests()
def pytest_unconfigure(config):
matplotlib... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@matplotlib@testing@conftest.py@.PATH_END.py |
{
"filename": "index_toc.py",
"repo_name": "athob/py-ananke",
"repo_path": "py-ananke_extracted/py-ananke-main/docs/source/index_toc.py",
"type": "Python"
} | #!/usr/bin/env python
import pathlib
import markdown
from lxml import etree
rst_indent = " "
tmp_dir: pathlib.Path = pathlib.Path('temp')
root_dir: pathlib.Path = pathlib.Path('../..')
README: str = (root_dir / "README.md").read_text()
# credit to https://stackoverflow.com/a/30737066
doc: etree._Element = etree.fr... | athobREPO_NAMEpy-anankePATH_START.@py-ananke_extracted@py-ananke-main@docs@source@index_toc.py@.PATH_END.py |
{
"filename": "test_utils.py",
"repo_name": "roban/CosmoloPy",
"repo_path": "CosmoloPy_extracted/CosmoloPy-master/tests/test_utils.py",
"type": "Python"
} |
from __future__ import absolute_import, division, print_function
import numpy
from cosmolopy.utils import *
from cosmolopy.saveable import Saveable
######### Testing ############
def test_integrate_piecewise(pieces=2, method='quad'):
# Test modified from scipy test_quadrature.py.
n = 2
z = 1.8
def... | robanREPO_NAMECosmoloPyPATH_START.@CosmoloPy_extracted@CosmoloPy-master@tests@test_utils.py@.PATH_END.py |
{
"filename": "EnumOption.py",
"repo_name": "rat-pac/rat-pac",
"repo_path": "rat-pac_extracted/rat-pac-master/python/SCons/Options/EnumOption.py",
"type": "Python"
} | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitati... | rat-pacREPO_NAMErat-pacPATH_START.@rat-pac_extracted@rat-pac-master@python@SCons@Options@EnumOption.py@.PATH_END.py |
{
"filename": "aDR122xrun.py",
"repo_name": "rohinkumar/correlcalc",
"repo_path": "correlcalc_extracted/correlcalc-master/clusterresults/aDR122xrun.py",
"type": "Python"
} | from correlcalc import *
bins = np.arange(0.002,0.052,0.002)
acorrdr12flcdmcmn2x=atpcf('/usr3/vstr/yrohin/Downloads/galaxy_DR12v5_CMASS_North.fits',bins,bins,randfile='/usr3/vstr/yrohin/randcat_DR12_CMN2x.dat',vtype='sigpi',estimator='ls',weights='eq')
print("------------------------------------------------------------... | rohinkumarREPO_NAMEcorrelcalcPATH_START.@correlcalc_extracted@correlcalc-master@clusterresults@aDR122xrun.py@.PATH_END.py |
{
"filename": "test_czt.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/signal/tests/test_czt.py",
"type": "Python"
} | # This program is public domain
# Authors: Paul Kienzle, Nadav Horesh
'''
A unit test module for czt.py
'''
import pytest
from numpy.testing import assert_allclose
from scipy.fft import fft
from scipy.signal import (czt, zoom_fft, czt_points, CZT, ZoomFFT)
import numpy as np
def check_czt(x):
# Check that czt is ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@signal@tests@test_czt.py@.PATH_END.py |
{
"filename": "double-schechter.ipynb",
"repo_name": "nanograv/holodeck",
"repo_path": "holodeck_extracted/holodeck-main/notebooks/devs/sams/double-schechter.ipynb",
"type": "Jupyter Notebook"
} | ```python
import numpy as np
import matplotlib.pyplot as plt
import kalepy as kale
import holodeck as holo
import holodeck.sams
from holodeck import utils, plot
from holodeck.constants import MSOL
```
See [Leja+2020 - A New Census of the 0.2 < z < 3.0 Universe. I. The Stellar Mass Function ](https://ui.adsabs.harvar... | nanogravREPO_NAMEholodeckPATH_START.@holodeck_extracted@holodeck-main@notebooks@devs@sams@double-schechter.ipynb@.PATH_END.py |
{
"filename": "convert_filters.py",
"repo_name": "starkit/wsynphot",
"repo_path": "wsynphot_extracted/wsynphot-master/wsynphot/data/hst/acs/convert_filters.py",
"type": "Python"
} | #Reading HST ACS filters
from astropy import units as u, constants as const
from numpy import genfromtxt, asscalar
import pandas as pd
import os
from glob import glob
def read_hst_filter(fname):
"""
Reading the gemini filter file into a dataframe
Parameters
----------
fname: ~str
path to... | starkitREPO_NAMEwsynphotPATH_START.@wsynphot_extracted@wsynphot-master@wsynphot@data@hst@acs@convert_filters.py@.PATH_END.py |
{
"filename": "mc.py",
"repo_name": "cta-observatory/cta-lstchain",
"repo_path": "cta-lstchain_extracted/cta-lstchain-main/lstchain/mc/mc.py",
"type": "Python"
} | import sys
import astropy.units as u
import numpy as np
from gammapy.modeling.models import LogParabolaSpectralModel
__all__ = [
'int_diff_sp',
'power_law_integrated_distribution',
'rate',
'weight'
]
def power_law_integrated_distribution(emin, emax, tot_num_events, spectral_index, bin_number=30):
... | cta-observatoryREPO_NAMEcta-lstchainPATH_START.@cta-lstchain_extracted@cta-lstchain-main@lstchain@mc@mc.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "KeplerGO/lightkurve",
"repo_path": "lightkurve_extracted/lightkurve-main/src/lightkurve/utils.py",
"type": "Python"
} | """This module provides various helper functions."""
import logging
import sys
import os
import warnings
from functools import wraps
import urllib
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
import numpy as np
from tqdm import tqdm
import astropy
from astropy.utils.data import download_file
... | KeplerGOREPO_NAMElightkurvePATH_START.@lightkurve_extracted@lightkurve-main@src@lightkurve@utils.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/lib/matplotlib/_api/__init__.py",
"type": "Python"
} | """
Helper functions for managing the Matplotlib API.
This documentation is only relevant for Matplotlib developers, not for users.
.. warning::
This module and its submodules are for internal use only. Do not use them
in your own code. We may change the API at any time with no warning.
"""
import functo... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@lib@matplotlib@_api@__init__.py@.PATH_END.py |
{
"filename": "ex_feasible_gls_het_0.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/examples/ex_feasible_gls_het_0.py",
"type": "Python"
} | """Examples for linear model with heteroscedasticity estimated by feasible GLS
These are examples to check the results during development.
The assumptions:
We have a linear model y = X*beta where the variance of an observation depends
on some explanatory variable Z (`exog_var`).
linear_model.WLS estimated the model ... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@examples@ex_feasible_gls_het_0.py@.PATH_END.py |
{
"filename": "data.py",
"repo_name": "fabiorigamonti/bang",
"repo_path": "bang_extracted/bang-main/tests/data.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
from astropy.cosmology import FlatLambdaCDM
def grid_conversion(x,y,z):
'''
Utils Function
----------------------------------------------------------------------
----------------------------------------------------------------------
conversion fr... | fabiorigamontiREPO_NAMEbangPATH_START.@bang_extracted@bang-main@tests@data.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "CarlosCoba/XookSuut-code",
"repo_path": "XookSuut-code_extracted/XookSuut-code-master/setup.py",
"type": "Python"
} | #!/usr/bin/env python3
import os
from setuptools import setup, find_packages
def readme():
with open("README.rst") as f:
return f.read()
with open("requirements.txt", "r") as r:
filtered_lines = filter(lambda line: not line.startswith("#"), r.readlines())
requirements = list(map(lambda s: s.replace... | CarlosCobaREPO_NAMEXookSuut-codePATH_START.@XookSuut-code_extracted@XookSuut-code-master@setup.py@.PATH_END.py |
{
"filename": "gitwildmatch.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/pathspec/pathspec/patterns/gitwildmatch.py",
"type": "Python"
} | """
This module implements Git's wildmatch pattern matching which itself is derived
from Rsync's wildmatch. Git uses wildmatch for its ".gitignore" files.
"""
import re
import warnings
from typing import (
AnyStr,
Optional, # Replaced by `X | None` in 3.10.
Tuple) # Replaced by `tuple` in 3.9.
from .. import uti... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@pathspec@pathspec@patterns@gitwildmatch.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/layout/shape/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._line import Line
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(__name__, [], ["._line.Line"])
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@layout@shape@__init__.py@.PATH_END.py |
{
"filename": "functions_WL.py",
"repo_name": "AndresaCampos/sompz_y6",
"repo_path": "sompz_y6_extracted/sompz_y6-main/sompz/functions_WL.py",
"type": "Python"
} | import h5py
import numpy as np
import pandas as pd
import pickle
from astropy.coordinates import SkyCoord
from astropy import units as u
def build_balrog_df(balrog_file,
deep_cells_assignment_balrog_file,
wide_cells_assignment_balrog_file):
with open(balrog_file, 'rb') as f... | AndresaCamposREPO_NAMEsompz_y6PATH_START.@sompz_y6_extracted@sompz_y6-main@sompz@functions_WL.py@.PATH_END.py |
{
"filename": "bol_early.py",
"repo_name": "saberyoung/haffet",
"repo_path": "haffet_extracted/haffet-master/sdapy/engines/bol_early.py",
"type": "Python"
} | from sdapy.model_fitters import fit_model, get_pars
from sdapy.functions import *
import numpy as np
import os
LOCALSOURCE = os.getenv('ZTFDATA',"./Data/")
def engine(self, model_name, engine_name, sourcename=None, **kwargs):
''' engine used to fit bolometric lc in the early phases
'''
if 'fitcls' not in s... | saberyoungREPO_NAMEhaffetPATH_START.@haffet_extracted@haffet-master@sdapy@engines@bol_early.py@.PATH_END.py |
{
"filename": "learning_to_rank.py",
"repo_name": "dmlc/xgboost",
"repo_path": "xgboost_extracted/xgboost-master/demo/guide-python/learning_to_rank.py",
"type": "Python"
} | """
Getting started with learning to rank
=====================================
.. versionadded:: 2.0.0
This is a demonstration of using XGBoost for learning to rank tasks using the
MSLR_10k_letor dataset. For more infomation about the dataset, please visit its
`description page <https://www.microsoft.com/en-us/res... | dmlcREPO_NAMExgboostPATH_START.@xgboost_extracted@xgboost-master@demo@guide-python@learning_to_rank.py@.PATH_END.py |
{
"filename": "pacman_script.py",
"repo_name": "sebastian-zieba/PACMAN",
"repo_path": "PACMAN_extracted/PACMAN-master/src/pacman/data/run_files/pacman_script.py",
"type": "Python"
} | import sys, os
import getopt
import numpy as np
from pathlib import Path
import pacman.s00_table as s00
import pacman.s01_horizons as s01
import pacman.s02_barycorr as s02
import pacman.s03_refspectra as s03
import pacman.s10_direct_images as s10
import pacman.s20_extract as s20
import pacman.s21_bin_spectroscopic_lc a... | sebastian-ziebaREPO_NAMEPACMANPATH_START.@PACMAN_extracted@PACMAN-master@src@pacman@data@run_files@pacman_script.py@.PATH_END.py |
{
"filename": "chi2_impl.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/stats/lombscargle/implementations/chi2_impl.py",
"type": "Python"
} | from __future__ import print_function, division
import numpy as np
from .mle import design_matrix
def lombscargle_chi2(t, y, dy, frequency, normalization='standard',
fit_mean=True, center_data=True, nterms=1):
"""Lomb-Scargle Periodogram
This implements a chi-squared-based periodogram,... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@stats@lombscargle@implementations@chi2_impl.py@.PATH_END.py |
{
"filename": "Frame_Constrains.py",
"repo_name": "francescoa97outlook/pyExoRaMa",
"repo_path": "pyExoRaMa_extracted/pyExoRaMa-main/GUI_Load_Data/Frame_Constrains.py",
"type": "Python"
} | import os
import tkinter as tk
from tkinter import messagebox as msgbox
from tkinter.filedialog import askopenfilename
import pandas as pd
import GUI_Plot.Gui
def helpButtonFunc():
msgbox.showinfo(title="INFO", message="Filename: it is a configuration file containing the data columns selected and saved previousl... | francescoa97outlookREPO_NAMEpyExoRaMaPATH_START.@pyExoRaMa_extracted@pyExoRaMa-main@GUI_Load_Data@Frame_Constrains.py@.PATH_END.py |
{
"filename": "_tickfont.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/ternary/aaxis/_tickfont.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="tickfont", parent_name="layout.ternary.aaxis", **kwargs
):
super(TickfontValidator, self).__init__(
plotly_name=plotly_name,
par... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@ternary@aaxis@_tickfont.py@.PATH_END.py |
{
"filename": "_hovertextsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattermapbox/_hovertextsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HovertextsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="hovertextsrc", parent_name="scattermapbox", **kwargs
):
super(HovertextsrcValidator, self).__init__(
plotly_name=plotly_name,
par... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattermapbox@_hovertextsrc.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.