metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "new_fig3.py",
"repo_name": "LSSTDESC/chroma",
"repo_path": "chroma_extracted/chroma-master/bin/color_gradients/Voigt12/new_fig3.py",
"type": "Python"
} | import os
import sys
import logging
import copy
import scipy.optimize
import numpy as np
import lmfit
import galsim
pixel_scale = 0.2
data_dir = '../../../data/'
def fiducial_galaxy():
'''Bulge + disk parameters of the fiducial galaxy described in Voigt+12.'''
gparam = lmfit.Parameters()
# bulge
gpar... | LSSTDESCREPO_NAMEchromaPATH_START.@chroma_extracted@chroma-master@bin@color_gradients@Voigt12@new_fig3.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/yt/frontends/tipsy/__init__.py",
"type": "Python"
} | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@yt@frontends@tipsy@__init__.py@.PATH_END.py | |
{
"filename": "python-reference_catboostranker_get_evals_result.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/concepts/python-reference_catboostranker_get_evals_result.md",
"type": "Markdown"
} | {% include [python-reference_catboost_get_evals_result](python-reference_catboost_get_evals_result.md) %}
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@concepts@python-reference_catboostranker_get_evals_result.md@.PATH_END.py |
{
"filename": "_familysrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/cone/hoverlabel/font/_familysrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="familysrc", parent_name="cone.hoverlabel.font", **kwargs
):
super(FamilysrcValidator, self).__init__(
plotly_name=plotly_name,
paren... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@cone@hoverlabel@font@_familysrc.py@.PATH_END.py |
{
"filename": "pipeline_tutorial.md",
"repo_name": "CosmoStat/shapepipe",
"repo_path": "shapepipe_extracted/shapepipe-master/docs/source/pipeline_tutorial.md",
"type": "Markdown"
} | # ShapePipe Tutorial
## Quick start
Run the entire pipeline on a single example CFIS image with tile ID 246.290:
1. [Install](https://github.com/cosmostat/shapepipe#installing-shapepipe) `ShapePipe` and activate the `shapepipe` conda environment.
3. Run the job script
```bash
job_sp 246.290 -j 127
```
## Introductio... | CosmoStatREPO_NAMEshapepipePATH_START.@shapepipe_extracted@shapepipe-master@docs@source@pipeline_tutorial.md@.PATH_END.py |
{
"filename": "client_t.py",
"repo_name": "simonsobs/ocs",
"repo_path": "ocs_extracted/ocs-main/ocs/client_t.py",
"type": "Python"
} | import ocs
import txaio
txaio.use_twisted()
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from twisted.internet.error import ReactorNotRunning
from autobahn.wamp.types import ComponentConfig
from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner
import depre... | simonsobsREPO_NAMEocsPATH_START.@ocs_extracted@ocs-main@ocs@client_t.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "fchollet/keras",
"repo_path": "keras_extracted/keras-master/keras/api/_tf_keras/keras/preprocessing/__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.api._tf_keras.keras.preprocessing import image
from keras.api._tf_keras.keras.preprocessing import sequence
from keras.api._tf_keras.keras.preprocessing import text
from keras.src.utils.i... | fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@api@_tf_keras@keras@preprocessing@__init__.py@.PATH_END.py |
{
"filename": "astronomy.py",
"repo_name": "psheehan/pdspy",
"repo_path": "pdspy_extracted/pdspy-master/pdspy/constants/astronomy.py",
"type": "Python"
} | AU = 1.495978707e13 # cm
pc = 3.085677581e18 # cm
ly = 9.463e17 # cm
M_sun = 1.99e33 # g
R_sun = 6.96e10 # cm
L_sun = 3.9e33 # erg s^-1
T_sun = 5.78e3 # K
Jy = 1.0e-23 # erg s^-1 cm^-2 Hz^-1
arcsec = 4.84813681e-6... | psheehanREPO_NAMEpdspyPATH_START.@pdspy_extracted@pdspy-master@pdspy@constants@astronomy.py@.PATH_END.py |
{
"filename": "imageSegment.py",
"repo_name": "sbetti22/ImSeg",
"repo_path": "ImSeg_extracted/ImSeg-master/imageSegment.py",
"type": "Python"
} | ## written by Sarah Betti 2019
## updated 5 November 2019
import numpy as np
import numpy.ma as ma
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
from astropy.io import fits
from astropy.stats import SigmaClip
from astropy.visualization import ZScaleInterval
from astropy.wcs import WCS
... | sbetti22REPO_NAMEImSegPATH_START.@ImSeg_extracted@ImSeg-master@imageSegment.py@.PATH_END.py |
{
"filename": "dataset_ops.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/data/ops/dataset_ops.py",
"type": "Python"
} | # Copyright 2017 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@data@ops@dataset_ops.py@.PATH_END.py |
{
"filename": "builtin-colorscales.md",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/doc/python/builtin-colorscales.md",
"type": "Markdown"
} | ---
jupyter:
jupytext:
notebook_metadata_filter: all
text_representation:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.14.1
kernelspec:
display_name: Python 3
language: python
name: python3
language_info:
codemirror_mode:
name... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@doc@python@builtin-colorscales.md@.PATH_END.py |
{
"filename": "_line.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/layout/map/layer/_line.py",
"type": "Python"
} | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Line(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.map.layer"
_path_str = "layout.map.layer.line"
_valid_props = {"dash", "dashsrc", "w... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@layout@map@layer@_line.py@.PATH_END.py |
{
"filename": "scripts.py",
"repo_name": "handley-lab/anesthetic",
"repo_path": "anesthetic_extracted/anesthetic-master/anesthetic/scripts.py",
"type": "Python"
} | """Command-line scripts for anesthetic."""
import argparse
import matplotlib.pyplot as plt
from anesthetic import read_chains
def gui(args=None):
"""Launch the anesthetic GUI.
See :class:`anesthetic.gui.plot.RunPlotter` for details.
"""
description = "Nested sampling visualisation"
parser = argpa... | handley-labREPO_NAMEanestheticPATH_START.@anesthetic_extracted@anesthetic-master@anesthetic@scripts.py@.PATH_END.py |
{
"filename": "leitherer1999.py",
"repo_name": "mirochaj/ares",
"repo_path": "ares_extracted/ares-main/input/litdata/leitherer1999.py",
"type": "Python"
} | """
Leitherer, C., Schaerer, D., Goldader, J. D., Delgado, R. M. G., Robert, C.,
Kune, D. F., de Mello, D. F., Devost, D., & Heckman, T. M. 1999, ApJS,
123, 3
Notes
-----
"""
import re, os
import numpy as np
from ares.data import ARES
from ares.physics import Cosmology
from scipy.integrate import cumtrapz
from scipy... | mirochajREPO_NAMEaresPATH_START.@ares_extracted@ares-main@input@litdata@leitherer1999.py@.PATH_END.py |
{
"filename": "conftest.py",
"repo_name": "rodluger/starry",
"repo_path": "starry_extracted/starry-master/starry/_core/ops/lib/include/oblate/tests/conftest.py",
"type": "Python"
} | import oblate
import pytest
@pytest.fixture(scope="session", autouse=True)
def solvers(lmax=5):
cppsolver = oblate.CppSolver(lmax)
numsolver = oblate.NumericalSolver(lmax, linear=False)
linsolver = oblate.NumericalSolver(lmax, linear=True)
pysolver = oblate.PythonSolver(lmax)
brutesolver = oblate.... | rodlugerREPO_NAMEstarryPATH_START.@starry_extracted@starry-master@starry@_core@ops@lib@include@oblate@tests@conftest.py@.PATH_END.py |
{
"filename": "_lenmode.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/treemap/marker/colorbar/_lenmode.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LenmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="lenmode", parent_name="treemap.marker.colorbar", **kwargs
):
super(LenmodeValidator, self).__init__(
plotly_name=plotly_name,
p... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@treemap@marker@colorbar@_lenmode.py@.PATH_END.py |
{
"filename": "changethelog.py",
"repo_name": "halomod/hmf",
"repo_path": "hmf_extracted/hmf-main/changethelog.py",
"type": "Python"
} | #!/usr/bin/python
"""Automatically update changelog."""
import sys
from datetime import datetime
if __name__ == "__main__":
newversion = sys.argv[1]
with open("CHANGELOG.rst") as fl:
lines = fl.readlines()
for _i, line in enumerate(lines):
if line == "dev-version\n":
break
... | halomodREPO_NAMEhmfPATH_START.@hmf_extracted@hmf-main@changethelog.py@.PATH_END.py |
{
"filename": "downloader_examples.py",
"repo_name": "BASTAcode/BASTA",
"repo_path": "BASTA_extracted/BASTA-main/src/basta/downloader_examples.py",
"type": "Python"
} | """
Routines to download examples (for non-GitHub installations)
"""
import os
import gzip
import shutil
import tarfile
import requests
import argparse
from tqdm import tqdm
from basta.__about__ import __version__
from basta.downloader import get_basta_dir
EXAMPLESFILE = "_examplespath.py"
def get_bundle(version: ... | BASTAcodeREPO_NAMEBASTAPATH_START.@BASTA_extracted@BASTA-main@src@basta@downloader_examples.py@.PATH_END.py |
{
"filename": "ttest.py",
"repo_name": "mhammond/pywin32",
"repo_path": "pywin32_extracted/pywin32-main/com/win32comext/axdebug/Test/ttest.py",
"type": "Python"
} | """A multiline
docstring"""
print("ttest is being imported")
def test():
print("Hello from test")
a = 1
b = a
c = b
s = """\
A multi line string
"""
| mhammondREPO_NAMEpywin32PATH_START.@pywin32_extracted@pywin32-main@com@win32comext@axdebug@Test@ttest.py@.PATH_END.py |
{
"filename": "multi_plane_base.py",
"repo_name": "sibirrer/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/lenstronomy/LensModel/MultiPlane/multi_plane_base.py",
"type": "Python"
} | import numpy as np
from lenstronomy.Cosmo.background import Background
from lenstronomy.LensModel.profile_list_base import ProfileListBase
import lenstronomy.Util.constants as const
__all__ = ["MultiPlaneBase"]
class MultiPlaneBase(ProfileListBase):
"""Multi-plane lensing class.
The lens model deflection an... | sibirrerREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@lenstronomy@LensModel@MultiPlane@multi_plane_base.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "NuSpaceSim/nupyprop",
"repo_path": "nupyprop_extracted/nupyprop-main/src/nupyprop/__init__.py",
"type": "Python"
} | """nupyprop
Monte Carlo neutrino propagation through the earth!
"""
| NuSpaceSimREPO_NAMEnupypropPATH_START.@nupyprop_extracted@nupyprop-main@src@nupyprop@__init__.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "NuSpaceSim/nupyprop",
"repo_path": "nupyprop_extracted/nupyprop-main/src/nupyprop/scripts/__init__.py",
"type": "Python"
} | NuSpaceSimREPO_NAMEnupypropPATH_START.@nupyprop_extracted@nupyprop-main@src@nupyprop@scripts@__init__.py@.PATH_END.py | |
{
"filename": "README-checkpoint.md",
"repo_name": "oliverphilcox/HIPSTER",
"repo_path": "HIPSTER_extracted/HIPSTER-master/.ipynb_checkpoints/README-checkpoint.md",
"type": "Markdown"
} | # HIPSTER
## HIgh-k Power Spectrum EstimatoR
Code to compute small-scale power spectra and isotropic bispectra for cosmological simulations and galaxy surveys of arbitrary shape, based on the configuration space estimators of Philcox & Eisenstein (2019, MNRAS, [arXiv](https://arxiv.org/abs/1912.01010)) and Philcox (2... | oliverphilcoxREPO_NAMEHIPSTERPATH_START.@HIPSTER_extracted@HIPSTER-master@.ipynb_checkpoints@README-checkpoint.md@.PATH_END.py |
{
"filename": "get_dirs.py",
"repo_name": "sdss/idlspec2d",
"repo_path": "idlspec2d_extracted/idlspec2d-master/python/boss_drp/utils/get_dirs.py",
"type": "Python"
} | #!/usr/bin/env python3
from boss_drp.field import field_to_string
import os.path as ptt
import numpy as np
import glob
def get_dirs(basedir, subdir='', pattern='*', match=None,
start=None, end=None, numeric=True, field=False):
"""
Generates of list of directores matching a patten with in base... | sdssREPO_NAMEidlspec2dPATH_START.@idlspec2d_extracted@idlspec2d-master@python@boss_drp@utils@get_dirs.py@.PATH_END.py |
{
"filename": "example_complex_resonator_model.py",
"repo_name": "lmfit/lmfit-py",
"repo_path": "lmfit-py_extracted/lmfit-py-master/examples/example_complex_resonator_model.py",
"type": "Python"
} | """
Complex Resonator Model
=======================
This notebook shows how to fit the parameters of a complex resonator,
using `lmfit.Model` and defining a custom `Model` class.
Following Khalil et al. (https://arxiv.org/abs/1108.3117), we can model the
forward transmission of a microwave resonator with total qualit... | lmfitREPO_NAMElmfit-pyPATH_START.@lmfit-py_extracted@lmfit-py-master@examples@example_complex_resonator_model.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "tomlouden/spiderman",
"repo_path": "spiderman_extracted/spiderman-master/docs/conf.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
#
# spiderman documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 9 17:11:41 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | tomloudenREPO_NAMEspidermanPATH_START.@spiderman_extracted@spiderman-master@docs@conf.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/third_party/xla/xla/codegen/testlib/README.md",
"type": "Markdown"
} | # XLA Codegen Testlib
This is a collection of APIs and libraries for testing XLA kernel codegen in
isolation. It is intended for use it tests only, to test one kernel at a time
without relying on end-to-end compilation pipeline via the hlo-runner tool.
| tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@third_party@xla@xla@codegen@testlib@README.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "VChristiaens/vcal_sphere",
"repo_path": "vcal_sphere_extracted/vcal_sphere-main/vcal/preproc/__init__.py",
"type": "Python"
} | from .preproc_IFS import *
from .preproc_IRDIS import * | VChristiaensREPO_NAMEvcal_spherePATH_START.@vcal_sphere_extracted@vcal_sphere-main@vcal@preproc@__init__.py@.PATH_END.py |
{
"filename": "lobpcg.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py",
"type": "Python"
} | """
Pure SciPy implementation of Locally Optimal Block Preconditioned Conjugate
Gradient Method (LOBPCG), see
https://bitbucket.org/joseroman/blopex
License: BSD
Authors: Robert Cimrman, Andrew Knyazev
Examples in tests directory contributed by Nils Wagner.
"""
from __future__ import division, print_function, absol... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@scipy@sparse@linalg@eigen@lobpcg@lobpcg.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/image/legendgrouptitle/font/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="image.legendgrouptitle.font", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@image@legendgrouptitle@font@_color.py@.PATH_END.py |
{
"filename": "marvin_pickle.py",
"repo_name": "sdss/marvin",
"repo_path": "marvin_extracted/marvin-main/python/marvin/core/marvin_pickle.py",
"type": "Python"
} | #!/usr/bin/env python3
# encoding: utf-8
#
# pickle.py
#
# Created by José Sánchez-Gallego on 7 Oct 2016.
from __future__ import absolute_import, division, print_function
import os
import warnings
from six import string_types
from marvin.core.exceptions import MarvinError, MarvinUserWarning
try:
import cPick... | sdssREPO_NAMEmarvinPATH_START.@marvin_extracted@marvin-main@python@marvin@core@marvin_pickle.py@.PATH_END.py |
{
"filename": "Example4_Simple_NPTF.ipynb",
"repo_name": "bsafdi/NPTFit",
"repo_path": "NPTFit_extracted/NPTFit-master/examples/Example4_Simple_NPTF.ipynb",
"type": "Jupyter Notebook"
} | # Example 4: Simple NPTF example
In this example we perform a non-Poissonian template fit in a simplified setting. Specifically we will restrict ourselves to randomly generated nside=2 maps, which means our data consists only of 48 pixels. Nevertheless in this simple setting we will be able to clearly see the differen... | bsafdiREPO_NAMENPTFitPATH_START.@NPTFit_extracted@NPTFit-master@examples@Example4_Simple_NPTF.ipynb@.PATH_END.py |
{
"filename": "test_composite.py",
"repo_name": "adrn/gala",
"repo_path": "gala_extracted/gala-main/gala/potential/potential/tests/test_composite.py",
"type": "Python"
} | # Third party
import astropy.units as u
import pytest
import numpy as np
# This project
from ..core import PotentialBase, CompositePotential
from ...common import PotentialParameter
from ..builtin import (KeplerPotential, HernquistPotential,
HenonHeilesPotential)
from ..ccompositepotential impo... | adrnREPO_NAMEgalaPATH_START.@gala_extracted@gala-main@gala@potential@potential@tests@test_composite.py@.PATH_END.py |
{
"filename": "ensemble.py",
"repo_name": "ML4GW/hermes",
"repo_path": "hermes_extracted/hermes-main/hermes/quiver/exporters/ensemble.py",
"type": "Python"
} | import abc
from typing import Optional, Sequence
from hermes.quiver import Platform
from hermes.quiver.exporters import Exporter
class EnsembleMeta(abc.ABCMeta):
@property
def handles(self):
return type(None)
@property
def platform(self) -> Platform:
return Platform.ENSEMBLE
class ... | ML4GWREPO_NAMEhermesPATH_START.@hermes_extracted@hermes-main@hermes@quiver@exporters@ensemble.py@.PATH_END.py |
{
"filename": "demoutils.py",
"repo_name": "mhammond/pywin32",
"repo_path": "pywin32_extracted/pywin32-main/Pythonwin/pywin/Demos/app/demoutils.py",
"type": "Python"
} | # Utilities for the demos
import sys
import win32api
import win32con
import win32ui
NotScriptMsg = """\
This demo program is not designed to be run as a Script, but is
probably used by some other test program. Please try another demo.
"""
NeedGUIMsg = """\
This demo program can only be run from inside of Pythonwin... | mhammondREPO_NAMEpywin32PATH_START.@pywin32_extracted@pywin32-main@Pythonwin@pywin@Demos@app@demoutils.py@.PATH_END.py |
{
"filename": "simple_2D.py",
"repo_name": "mugurbil/gnm",
"repo_path": "gnm_extracted/gnm-master/examples/simple_2D/simple_2D.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Simple example with 2D function
print("----------------------------\n"+
"----Jtest and Simple 2D-----\n"+
"----------------------------")
'''
This program shows the usage of Jtest and how it can be helpful in seeing
mistakes in the definition of the function. One should observe... | mugurbilREPO_NAMEgnmPATH_START.@gnm_extracted@gnm-master@examples@simple_2D@simple_2D.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "matiscke/lcps",
"repo_path": "lcps_extracted/lcps-master/setup.py",
"type": "Python"
} | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import glob
import os
import sys
import ah_bootstrap
from setuptools import setup
#A dirty hack to get around some early import/configurations ambiguities
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin_... | matisckeREPO_NAMElcpsPATH_START.@lcps_extracted@lcps-master@setup.py@.PATH_END.py |
{
"filename": "check_model.py",
"repo_name": "yaojian95/ForSEplus",
"repo_path": "ForSEplus_extracted/ForSEplus-main/src/ForSEplus/check_model.py",
"type": "Python"
} | from .utility import rescale_min_max, get_functionals_fix, compute_intersection
import numpy as np
import os
import tensorflow as tf
# physical_devices = tf.config.experimental.list_physical_devices('GPU')
# tf.config.experimental.set_memory_growth(physical_devices[0], True)
import matplotlib.pyplot as plt
import matp... | yaojian95REPO_NAMEForSEplusPATH_START.@ForSEplus_extracted@ForSEplus-main@src@ForSEplus@check_model.py@.PATH_END.py |
{
"filename": "_textcase.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/treemap/insidetextfont/_textcase.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextcaseValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="textcase", parent_name="treemap.insidetextfont", **kwargs
):
super(TextcaseValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@treemap@insidetextfont@_textcase.py@.PATH_END.py |
{
"filename": "checks.py",
"repo_name": "kevin218/POET",
"repo_path": "POET_extracted/POET-master/code/run/checks.py",
"type": "Python"
} |
#------------------------------------------------------------------
# Checkings
import sys, os
r = os.getcwd().split("/")
maindir = "/".join(r[:r.index("run")])
sys.path.append(maindir + '/lib/')
import manageevent as me
# Load to see and check the results:
# change evtname to the name of your event.
event = me.loa... | kevin218REPO_NAMEPOETPATH_START.@POET_extracted@POET-master@code@run@checks.py@.PATH_END.py |
{
"filename": "example-fit.ipynb",
"repo_name": "pysersic/pysersic",
"repo_path": "pysersic_extracted/pysersic-main/examples/example-fit.ipynb",
"type": "Jupyter Notebook"
} | # Pysersic Walkthrough: Fitting a single source
In this tutorial we'll walk through how to set up and fit a galaxy using `pysersic`.
## Loading the data
We'll be using three galaxies imaged by HSC for this example. The 4 needed inputs to perform a fit are
- im: the image itself
- mask: a mask indicating pixels wh... | pysersicREPO_NAMEpysersicPATH_START.@pysersic_extracted@pysersic-main@examples@example-fit.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "starkit/wsynphot",
"repo_path": "wsynphot_extracted/wsynphot-master/wsynphot/io/__init__.py",
"type": "Python"
} | starkitREPO_NAMEwsynphotPATH_START.@wsynphot_extracted@wsynphot-master@wsynphot@io@__init__.py@.PATH_END.py | |
{
"filename": "NullPotential.py",
"repo_name": "jobovy/galpy",
"repo_path": "galpy_extracted/galpy-main/galpy/potential/NullPotential.py",
"type": "Python"
} | ###############################################################################
# NullPotential.py: class that implements a constant potential
###############################################################################
from .Potential import Potential
class NullPotential(Potential):
"""Class that implements... | jobovyREPO_NAMEgalpyPATH_START.@galpy_extracted@galpy-main@galpy@potential@NullPotential.py@.PATH_END.py |
{
"filename": "mod.md",
"repo_name": "miguelzuma/hi_class_public",
"repo_path": "hi_class_public_extracted/hi_class_public-master/doc/input/mod.md",
"type": "Markdown"
} | Updating the manual
===================
Author: D. C. Hooper (hooper@physik.rwth-aachen.de)
This pdf manual and accompanying web version have been generated using the `doxygen` software (http://www.doxygen.org). This software directly reads the code and extracts the necessary comments to form the manual, meaning it is... | miguelzumaREPO_NAMEhi_class_publicPATH_START.@hi_class_public_extracted@hi_class_public-master@doc@input@mod.md@.PATH_END.py |
{
"filename": "test_simulate_spectrum.py",
"repo_name": "jzuhone/soxs",
"repo_path": "soxs_extracted/soxs-main/soxs/tests/test_simulate_spectrum.py",
"type": "Python"
} | import os
import shutil
import tempfile
from astropy.io import fits
from numpy.testing import assert_allclose
from soxs.instrument import simulate_spectrum
from soxs.instrument_registry import get_instrument_from_registry
from soxs.spectra import Spectrum
def test_simulate_spectrum():
tmpdir = tempfile.mkdtemp(... | jzuhoneREPO_NAMEsoxsPATH_START.@soxs_extracted@soxs-main@soxs@tests@test_simulate_spectrum.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "BradGreig/21CMMC",
"repo_path": "21CMMC_extracted/21CMMC-master/21CMMC_SourceCode/Programs/CosmoHammer_21CMMC/sampler/util/__init__.py",
"type": "Python"
} | BradGreigREPO_NAME21CMMCPATH_START.@21CMMC_extracted@21CMMC-master@21CMMC_SourceCode@Programs@CosmoHammer_21CMMC@sampler@util@__init__.py@.PATH_END.py | |
{
"filename": "gravity_potential.py",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/examples/textbook/gravity_potential.py",
"type": "Python"
} | #from __future__ import print_function
import numpy
from amuse.units import units
from amuse.units import quantities
from amuse.units import constants
from amuse.units import nbody_system
from amuse.ext.bridge import bridge
from amuse.community.phigrape.interface import PhiGRAPE
from amuse.community.ph4.interface impor... | amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@examples@textbook@gravity_potential.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/ternary/caxis/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="layout.ternary.caxis", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=par... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@ternary@caxis@_color.py@.PATH_END.py |
{
"filename": "_south.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/map/bounds/_south.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SouthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="south", parent_name="layout.map.bounds", **kwargs):
super(SouthValidator, 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@layout@map@bounds@_south.py@.PATH_END.py |
{
"filename": "conv_lstm.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/layers/rnn/conv_lstm.py",
"type": "Python"
} | from keras.src import activations
from keras.src import backend
from keras.src import constraints
from keras.src import initializers
from keras.src import ops
from keras.src import regularizers
from keras.src import tree
from keras.src.layers.input_spec import InputSpec
from keras.src.layers.layer import Layer
from ker... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@layers@rnn@conv_lstm.py@.PATH_END.py |
{
"filename": "test_openapi.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/tests/integration_tests/chains/openai_functions/test_openapi.py",
"type": "Python"
} | import json
import pytest
from langchain.chains.openai_functions.openapi import get_openapi_chain
api_spec = {
"openapi": "3.0.0",
"info": {"title": "JSONPlaceholder API", "version": "1.0.0"},
"servers": [{"url": "https://jsonplaceholder.typicode.com"}],
"paths": {
"/posts": {
"ge... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@tests@integration_tests@chains@openai_functions@test_openapi.py@.PATH_END.py |
{
"filename": "_uirevision.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/ternary/aaxis/_uirevision.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class UirevisionValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(
self, plotly_name="uirevision", parent_name="layout.ternary.aaxis", **kwargs
):
super(UirevisionValidator, self).__init__(
plotly_name=plotly_name,
pa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@ternary@aaxis@_uirevision.py@.PATH_END.py |
{
"filename": "HPdata_to_burnman.py",
"repo_name": "geodynamics/burnman",
"repo_path": "burnman_extracted/burnman-main/burnman/data/input_raw_endmember_datasets/HPdata_to_burnman.py",
"type": "Python"
} | # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for
# the Earth and Planetary Sciences
# Copyright (C) 2012 - 2021 by the BurnMan team, released under the GNU
# GPL v2 or later.
# This is a standalone program that converts the Holland and Powell data format
# into the standard burnman forma... | geodynamicsREPO_NAMEburnmanPATH_START.@burnman_extracted@burnman-main@burnman@data@input_raw_endmember_datasets@HPdata_to_burnman.py@.PATH_END.py |
{
"filename": "test_time_delay_likelihood.py",
"repo_name": "lenstronomy/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_Sampling/test_Likelihoods/test_time_delay_likelihood.py",
"type": "Python"
} | from lenstronomy.Sampling.Likelihoods.time_delay_likelihood import TimeDelayLikelihood
from lenstronomy.LensModel.lens_model import LensModel
from lenstronomy.PointSource.point_source import PointSource
from lenstronomy.LensModel.Solver.lens_equation_solver import LensEquationSolver
from lenstronomy.Cosmo.lens_cosmo im... | lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_Sampling@test_Likelihoods@test_time_delay_likelihood.py@.PATH_END.py |
{
"filename": "_xperiod.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/contour/_xperiod.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XperiodValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="xperiod", parent_name="contour", **kwargs):
super(XperiodValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@contour@_xperiod.py@.PATH_END.py |
{
"filename": "context.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/setuptools/py3/setuptools/_vendor/jaraco/context.py",
"type": "Python"
} | from __future__ import annotations
import contextlib
import functools
import operator
import os
import shutil
import subprocess
import sys
import tempfile
import urllib.request
import warnings
from typing import Iterator
if sys.version_info < (3, 12):
from setuptools.extern.backports import tarfile
else:
imp... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@setuptools@py3@setuptools@_vendor@jaraco@context.py@.PATH_END.py |
{
"filename": "TabulatedBAODVLikelihood.py",
"repo_name": "igomezv/simplemc_tests",
"repo_path": "simplemc_tests_extracted/simplemc_tests-main/simplemc/likelihoods/TabulatedBAODVLikelihood.py",
"type": "Python"
} |
from simplemc.likelihoods.BaseLikelihood import BaseLikelihood
from scipy.interpolate import interp1d
from scipy.optimize import minimize
from scipy.integrate import quad
import scipy as sp
class TabulatedBAODVLikelihood(BaseLikelihood):
def __init__(self, name, filename, fid_theory, z):
"""
Th... | igomezvREPO_NAMEsimplemc_testsPATH_START.@simplemc_tests_extracted@simplemc_tests-main@simplemc@likelihoods@TabulatedBAODVLikelihood.py@.PATH_END.py |
{
"filename": "test_isotonic.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/sklearn/tests/test_isotonic.py",
"type": "Python"
} | import copy
import pickle
import warnings
import numpy as np
import pytest
from scipy.special import expit
import sklearn
from sklearn.datasets import make_regression
from sklearn.isotonic import (
IsotonicRegression,
_make_unique,
check_increasing,
isotonic_regression,
)
from sklearn.utils import shu... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@sklearn@tests@test_isotonic.py@.PATH_END.py |
{
"filename": "radial_velocity_decomposition.py",
"repo_name": "astropy/halotools",
"repo_path": "halotools_extracted/halotools-master/halotools/mock_observables/velocity_decomposition/radial_velocity_decomposition.py",
"type": "Python"
} | """ Functions calculating the radial distance and radial velocity of satellites
with respect to their centrals
"""
import numpy as np
__all__ = ('radial_distance', 'radial_distance_and_velocity')
def _signed_dx(xs, xc, xperiod):
""" Calculate the 1-d distance between xs and xc,
accounting for periodic bound... | astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@halotools@mock_observables@velocity_decomposition@radial_velocity_decomposition.py@.PATH_END.py |
{
"filename": "time_integration.py",
"repo_name": "jan-rybizki/Chempy",
"repo_path": "Chempy_extracted/Chempy-master/Chempy/time_integration.py",
"type": "Python"
} | import numpy as np
class ABUNDANCE_MATRIX(object):
'''
This class contains all information necessary to characterize the chemical evolution of the open-box one-zone Chempy model.
It calculates the mass flow between the different components. And can advance the chemical evolution when the enrichment from the SSP ... | jan-rybizkiREPO_NAMEChempyPATH_START.@Chempy_extracted@Chempy-master@Chempy@time_integration.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/parcats/line/colorbar/title/font/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="color",
parent_name="parcats.line.colorbar.title.font",
**kwargs,
):
super(ColorValidator, self).__init__(
plotly_name=plo... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@parcats@line@colorbar@title@font@_color.py@.PATH_END.py |
{
"filename": "FortesFit_Plots.py",
"repo_name": "vikalibrate/FortesFit",
"repo_path": "FortesFit_extracted/FortesFit-master/fortesfit/FortesFit_Plots.py",
"type": "Python"
} | import sys
import os.path
from collections import OrderedDict
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import Normalize
from matplotlib.cm import ScalarMappable
from matplotlib.backends.backend_pdf import PdfPages
from scipy.stats import entropy
from scipy.stats import gaussian_kde
f... | vikalibrateREPO_NAMEFortesFitPATH_START.@FortesFit_extracted@FortesFit-master@fortesfit@FortesFit_Plots.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattergeo/hoverlabel/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._namelengthsrc import NamelengthsrcValidator
from ._namelength import NamelengthValidator
from ._font import FontValidator
from ._bordercolorsrc import BordercolorsrcValidator
from ._bordercolor import BordercolorValidator
from ._bgcolorsrc import ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattergeo@hoverlabel@__init__.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "pyro-ppl/numpyro",
"repo_path": "numpyro_extracted/numpyro-master/numpyro/infer/__init__.py",
"type": "Python"
} | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from numpyro.infer.barker import BarkerMH
from numpyro.infer.elbo import (
ELBO,
RenyiELBO,
Trace_ELBO,
TraceEnum_ELBO,
TraceGraph_ELBO,
TraceMeanField_ELBO,
)
from numpyro.infer.ensemble import AIES, ESS
from ... | pyro-pplREPO_NAMEnumpyroPATH_START.@numpyro_extracted@numpyro-master@numpyro@infer@__init__.py@.PATH_END.py |
{
"filename": "_showticksuffix.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/choroplethmapbox/colorbar/_showticksuffix.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowticksuffixValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="showticksuffix",
parent_name="choroplethmapbox.colorbar",
**kwargs
):
super(ShowticksuffixValidator, self).__init__(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@choroplethmapbox@colorbar@_showticksuffix.py@.PATH_END.py |
{
"filename": "re-identify.py",
"repo_name": "saltastro/pyhrs",
"repo_path": "pyhrs_extracted/pyhrs-master/scripts/re-identify.py",
"type": "Python"
} | import os
import sys
import numpy as np
import pickle
from ccdproc import CCDData
import specutils
from astropy import units as u
from astropy import modeling as mod
from astropy.io import fits
import pylab as pl
import specreduce
from specreduce.interidentify import InterIdentify
from specreduce import spectools... | saltastroREPO_NAMEpyhrsPATH_START.@pyhrs_extracted@pyhrs-master@scripts@re-identify.py@.PATH_END.py |
{
"filename": "update_qm_list.py",
"repo_name": "HERA-Team/hera_mc",
"repo_path": "hera_mc_extracted/hera_mc-main/scripts/update_qm_list.py",
"type": "Python"
} | #! /usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# Copyright 2017 the HERA Collaboration
# Licensed under the 2-clause BSD license.
import hera_mc.mc as mc
parser = mc.get_mc_argument_parser()
args = parser.parse_args()
db = mc.connect_to_mc_db(args)
with db.sessionmaker() as session:
session.update_q... | HERA-TeamREPO_NAMEhera_mcPATH_START.@hera_mc_extracted@hera_mc-main@scripts@update_qm_list.py@.PATH_END.py |
{
"filename": "_variant.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattermap/marker/colorbar/title/font/_variant.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="variant",
parent_name="scattermap.marker.colorbar.title.font",
**kwargs,
):
super(VariantValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattermap@marker@colorbar@title@font@_variant.py@.PATH_END.py |
{
"filename": "test_lightcurve.py",
"repo_name": "StingraySoftware/stingray",
"repo_path": "stingray_extracted/stingray-main/stingray/tests/test_lightcurve.py",
"type": "Python"
} | import os
import importlib
import copy
import numpy as np
import pytest
import warnings
import matplotlib.pyplot as plt
from numpy.testing import assert_allclose
import astropy.units as u
from astropy.time import Time
from astropy.timeseries import TimeSeries
from astropy.table import Table
import scipy.stats
from sti... | StingraySoftwareREPO_NAMEstingrayPATH_START.@stingray_extracted@stingray-main@stingray@tests@test_lightcurve.py@.PATH_END.py |
{
"filename": "_error_x.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter/_error_x.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class Error_XValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="error_x", parent_name="scatter", **kwargs):
super(Error_XValidator, 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@scatter@_error_x.py@.PATH_END.py |
{
"filename": "annotations.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/tests/test_optional/test_matplotlylib/data/annotations.py",
"type": "Python"
} | import plotly.graph_objs as go
ANNOTATIONS = go.Figure(
data=[
go.Scatter(
x=[0.0, 1.0, 2.0],
y=[1.0, 2.0, 3.0],
name="_line0",
mode="lines",
line=go.scatter.Line(dash="solid", color="rgba (0, 0, 255, 1)", width=1.5),
xaxis="x1",
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@tests@test_optional@test_matplotlylib@data@annotations.py@.PATH_END.py |
{
"filename": "GUI.py",
"repo_name": "wmpg/WesternMeteorPyLib",
"repo_path": "WesternMeteorPyLib_extracted/WesternMeteorPyLib-master/wmpl/MetSim/GUI.py",
"type": "Python"
} | """ GUI interface to meteor ablation models which enables manual modelling of meteors. """
import os
import sys
import copy
import argparse
import time
import datetime
import json
import glob
import multiprocessing as mp
import importlib.machinery
import numpy as np
import scipy.stats
import scipy.interpolate
import... | wmpgREPO_NAMEWesternMeteorPyLibPATH_START.@WesternMeteorPyLib_extracted@WesternMeteorPyLib-master@wmpl@MetSim@GUI.py@.PATH_END.py |
{
"filename": "tutorial.py",
"repo_name": "pcubillos/mc3",
"repo_path": "mc3_extracted/mc3-master/examples/tutorial.py",
"type": "Python"
} | import sys
import numpy as np
import mc3
def quad(p, x):
"""
Quadratic polynomial function.
Parameters
p: Polynomial constant, linear, and quadratic coefficients.
x: Array of dependent variables where to evaluate the polynomial.
Returns
y: Polinomial evaluated at x: y(x) = p0... | pcubillosREPO_NAMEmc3PATH_START.@mc3_extracted@mc3-master@examples@tutorial.py@.PATH_END.py |
{
"filename": "plot_kernel_approximation.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/examples/miscellaneous/plot_kernel_approximation.py",
"type": "Python"
} | """
==================================================
Explicit feature map approximation for RBF kernels
==================================================
An example illustrating the approximation of the feature map
of an RBF kernel.
.. currentmodule:: sklearn.kernel_approximation
It shows how to use :class:`RBFSa... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@examples@miscellaneous@plot_kernel_approximation.py@.PATH_END.py |
{
"filename": "interactively-inspecting-data.ipynb",
"repo_name": "lightkurve/lightkurve",
"repo_path": "lightkurve_extracted/lightkurve-main/docs/source/tutorials/1-getting-started/interactively-inspecting-data.ipynb",
"type": "Jupyter Notebook"
} | # Interactively inspecting Target Pixel Files
## Learning Goals
By the end of this tutorial, you will:
* Be able to inspect target pixel files and create custom light curves using the `interact()` tool.
* Be able to identify stars in a target pixel file using `interact_sky()`.
* Be able to interactively search for t... | lightkurveREPO_NAMElightkurvePATH_START.@lightkurve_extracted@lightkurve-main@docs@source@tutorials@1-getting-started@interactively-inspecting-data.ipynb@.PATH_END.py |
{
"filename": "conftest.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/python-package/ut/medium/gpu/conftest.py",
"type": "Python"
} | import catboost.utils
import pytest
def pytest_configure(config):
config.addinivalue_line(
"markers", "fails_on_gpu(how): mark test that fails only on GPU"
)
GPU_DEVICE_COUNT = catboost.utils.get_gpu_device_count()
def get_fails_on_gpu_mark(metafunc):
"""
returns Mark or None
"""
f... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@python-package@ut@medium@gpu@conftest.py@.PATH_END.py |
{
"filename": "plotting.py",
"repo_name": "Zstone19/pypetal",
"repo_path": "pypetal_extracted/pypetal-main/src/pypetal/pyzdcf/plotting.py",
"type": "Python"
} | import matplotlib as mpl
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
from pypetal.utils.petalio import err2str
mpl.rcParams['xtick.minor.visible'] = True
mpl.rcParams['xtick.top'] = True
mpl.rcParams['xtick.direction'] = 'in'
mpl.rcParams['ytick.minor.visible'] = True
mpl.rcParams['ytick.r... | Zstone19REPO_NAMEpypetalPATH_START.@pypetal_extracted@pypetal-main@src@pypetal@pyzdcf@plotting.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "CobayaSampler/cobaya",
"repo_path": "cobaya_extracted/cobaya-master/cobaya/likelihoods/gaussian_mixture/__init__.py",
"type": "Python"
} | from .gaussian_mixture import GaussianMixture, random_mean, random_cov, \
info_random_gaussian_mixture
| CobayaSamplerREPO_NAMEcobayaPATH_START.@cobaya_extracted@cobaya-master@cobaya@likelihoods@gaussian_mixture@__init__.py@.PATH_END.py |
{
"filename": "markov_chain.py",
"repo_name": "jmschrei/pomegranate",
"repo_path": "pomegranate_extracted/pomegranate-master/pomegranate/markov_chain.py",
"type": "Python"
} | # markov_chain.py
# Author: Jacob Schreiber <jmschreiber91@gmail.com>
import torch
from ._utils import _cast_as_tensor
from ._utils import _update_parameter
from ._utils import _check_parameter
from ._utils import _reshape_weights
from .distributions._distribution import Distribution
from .distributions import Categ... | jmschreiREPO_NAMEpomegranatePATH_START.@pomegranate_extracted@pomegranate-master@pomegranate@markov_chain.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/ternary/aaxis/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.ternary.aaxis.title.font",
**kwargs,
):
super(LinepositionValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@ternary@aaxis@title@font@_lineposition.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/waterfall/increasing/marker/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._line import LineValidator
from ._color import ColorValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._line.LineValidator", "._color.ColorValidator"]
)
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@waterfall@increasing@marker@__init__.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/violin/box/line/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._width import WidthValidator
from ._color import ColorValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._width.Wi... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@violin@box@line@__init__.py@.PATH_END.py |
{
"filename": "matplotlib_ext.py",
"repo_name": "cmbant/CosmoMC",
"repo_path": "CosmoMC_extracted/CosmoMC-master/python/getdist/matplotlib_ext.py",
"type": "Python"
} | from matplotlib import ticker
from matplotlib.axis import YAxis
import math
import numpy as np
from bisect import bisect_left
class SciFuncFormatter(ticker.Formatter):
# To put full sci notation into each axis label rather than split offsetText
def __call__(self, x, pos=None):
return "${}$".format(se... | cmbantREPO_NAMECosmoMCPATH_START.@CosmoMC_extracted@CosmoMC-master@python@getdist@matplotlib_ext.py@.PATH_END.py |
{
"filename": "loading_datasets.md",
"repo_name": "google/flax",
"repo_path": "flax_extracted/flax-main/docs/guides/data_preprocessing/loading_datasets.md",
"type": "Markdown"
} | ---
jupytext:
formats: ipynb,md:myst
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.8
---
# Loading datasets
[](https://colab.research.google.com/github/google/flax/blob/mai... | googleREPO_NAMEflaxPATH_START.@flax_extracted@flax-main@docs@guides@data_preprocessing@loading_datasets.md@.PATH_END.py |
{
"filename": "make_cosamp_hk.py",
"repo_name": "simonsobs/sotodlib",
"repo_path": "sotodlib_extracted/sotodlib-master/sotodlib/site_pipeline/make_cosamp_hk.py",
"type": "Python"
} | import os
import yaml
import time
import numpy as np
import argparse
import logging
from typing import Optional
from sotodlib import core
from sotodlib.io import hk_utils
from sotodlib.site_pipeline import util
logger = util.init_logger('make_cosamp_hk', 'make_cosamp_hk: ')
def get_parser(parser=None):
if parser ... | simonsobsREPO_NAMEsotodlibPATH_START.@sotodlib_extracted@sotodlib-master@sotodlib@site_pipeline@make_cosamp_hk.py@.PATH_END.py |
{
"filename": "win32verstamp.py",
"repo_name": "mhammond/pywin32",
"repo_path": "pywin32_extracted/pywin32-main/win32/Lib/win32verstamp.py",
"type": "Python"
} | """Stamp a Win32 binary with version information."""
import glob
import optparse
import os
import struct
from _win32verstamp_pywin32ctypes import (
BeginUpdateResource,
EndUpdateResource,
UpdateResource,
)
VS_FFI_SIGNATURE = -17890115 # 0xFEEF04BD
VS_FFI_STRUCVERSION = 0x00010000
VS_FFI_FILEFLAGSMASK = ... | mhammondREPO_NAMEpywin32PATH_START.@pywin32_extracted@pywin32-main@win32@Lib@win32verstamp.py@.PATH_END.py |
{
"filename": "site-patch.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/setuptools/py2/setuptools/site-patch.py",
"type": "Python"
} | def __boot():
import sys
import os
PYTHONPATH = os.environ.get('PYTHONPATH')
if PYTHONPATH is None or (sys.platform == 'win32' and not PYTHONPATH):
PYTHONPATH = []
else:
PYTHONPATH = PYTHONPATH.split(os.pathsep)
pic = getattr(sys, 'path_importer_cache', {})
stdpath = sys.pat... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@setuptools@py2@setuptools@site-patch.py@.PATH_END.py |
{
"filename": "test_setup_pbundles.py",
"repo_name": "mirochaj/ares",
"repo_path": "ares_extracted/ares-main/tests/adv/test_setup_pbundles.py",
"type": "Python"
} | """
test_setup_pbundles.py
Author: Jordan Mirocha
Affiliation: UCLA
Created on: Mon Jun 13 11:59:46 PDT 2016
Description:
"""
import ares
pop1 = ares.util.ParameterBundle('pop:sfe')
pop2 = ares.util.ParameterBundle('pop:fcoll')
pop1.num = 0
pop2.num = 1
sed = ares.util.ParameterBundle('sed:bpass')
pf = pop1 +... | mirochajREPO_NAMEaresPATH_START.@ares_extracted@ares-main@tests@adv@test_setup_pbundles.py@.PATH_END.py |
{
"filename": "NLopt_C-plus-plus_Reference.md",
"repo_name": "stevengj/nlopt",
"repo_path": "nlopt_extracted/nlopt-master/doc/docs/NLopt_C-plus-plus_Reference.md",
"type": "Markdown"
} | ---
# NLopt C-plus-plus Reference
---
NLopt is written in C and the C NLopt programming interface (API), as described in the [NLopt Reference](NLopt_Reference.md), is directly callable from C++.
However, we also provide a C++ header file, nlopt.hpp, that wraps a more natural C++ interface around the NLopt API, which ... | stevengjREPO_NAMEnloptPATH_START.@nlopt_extracted@nlopt-master@doc@docs@NLopt_C-plus-plus_Reference.md@.PATH_END.py |
{
"filename": "readme.md",
"repo_name": "tanner-trickle/EXCEED-DM",
"repo_path": "EXCEED-DM_extracted/EXCEED-DM-main/examples/6/readme.md",
"type": "Markdown"
} | ### Example 6: Si Axion Absorption Rate, valence to conduction
- Calculation: Absorption rate
- Target: Si
Absorption rate of an axion-like particle, for two $\delta$: $\delta = 1 \, \mathrm{eV}$ and $\delta = 0.2 + 10^{-1} \omega$. Only valence to conduction transitions are included.
```{note}
This electronic stat... | tanner-trickleREPO_NAMEEXCEED-DMPATH_START.@EXCEED-DM_extracted@EXCEED-DM-main@examples@6@readme.md@.PATH_END.py |
{
"filename": "Nseries Odd-Parity 4PCF.ipynb",
"repo_name": "oliverphilcox/Parity-Odd-4PCF",
"repo_path": "Parity-Odd-4PCF_extracted/Parity-Odd-4PCF-main/Nseries Odd-Parity 4PCF.ipynb",
"type": "Jupyter Notebook"
} | ```python
%pylab inline
import os,sys,pickle
from scipy.stats import percentileofscore, chi2
from scipy.linalg import sqrtm
from scipy.interpolate import interp1d
from scipy.special import loggamma
from scipy.optimize import minimize
import emcee # only needed for step 8
```
Populating the interactive namespace fr... | oliverphilcoxREPO_NAMEParity-Odd-4PCFPATH_START.@Parity-Odd-4PCF_extracted@Parity-Odd-4PCF-main@Nseries Odd-Parity 4PCF.ipynb@.PATH_END.py |
{
"filename": "_colorbar.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/densitymapbox/_colorbar.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class ColorBar(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "densitymapbox"
_path_str = "densitymapbox.colorbar"
_valid_props = {
"bgcolor",
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@densitymapbox@_colorbar.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "NASA-Planetary-Science/sbpy",
"repo_path": "sbpy_extracted/sbpy-main/sbpy/imageanalysis/__init__.py",
"type": "Python"
} | """
SBPy Module for small image analysis
"""
from .core import *
| NASA-Planetary-ScienceREPO_NAMEsbpyPATH_START.@sbpy_extracted@sbpy-main@sbpy@imageanalysis@__init__.py@.PATH_END.py |
{
"filename": "test_multi_gravito_mhd.py",
"repo_name": "n-claes/legolas",
"repo_path": "legolas_extracted/legolas-master/tests/regression_tests/test_multi_gravito_mhd.py",
"type": "Python"
} | import numpy as np
import pytest
from .regression import MultiRegressionTest
class TestGravito_MHD_Multi(MultiRegressionTest):
name = "gravito MHD multi"
filename = "multi_gravito_mhd"
equilibrium = "gravito_mhd"
geometry = "Cartesian"
number_of_runs = 18
gridpoints = 31
kvals = np.linsp... | n-claesREPO_NAMElegolasPATH_START.@legolas_extracted@legolas-master@tests@regression_tests@test_multi_gravito_mhd.py@.PATH_END.py |
{
"filename": "_textcase.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattersmith/marker/colorbar/title/font/_textcase.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextcaseValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="textcase",
parent_name="scattersmith.marker.colorbar.title.font",
**kwargs,
):
super(TextcaseValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattersmith@marker@colorbar@title@font@_textcase.py@.PATH_END.py |
{
"filename": "test_shape_manipulation.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/coordinates/tests/test_shape_manipulation.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# TEST_UNICODE_LITERALS
import numpy as np
from ... import units as u
from .. import Longitude, Latitude, EarthLocation, SkyCoord
# test on frame with most complicated frame attributes.
from ..builtin_frames import ICRS, AltAz, GCRS
from ...time import T... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@coordinates@tests@test_shape_manipulation.py@.PATH_END.py |
{
"filename": "tricontour.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/matplotlib/py2/matplotlib/tri/tricontour.py",
"type": "Python"
} | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from matplotlib.contour import ContourSet
from matplotlib.tri.triangulation import Triangulation
import matplotlib._tri as _tri
import numpy as np
class TriContourSet(ContourSet):
"""
Crea... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@matplotlib@py2@matplotlib@tri@tricontour.py@.PATH_END.py |
{
"filename": "test_kernels.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/nonparametric/tests/test_kernels.py",
"type": "Python"
} | """
Created on Sat Dec 14 17:23:25 2013
Author: Josef Perktold
"""
import os
import numpy as np
from numpy.testing import assert_allclose, assert_array_less
import pandas as pd
import pytest
from statsmodels.sandbox.nonparametric import kernels
DEBUG = 0
curdir = os.path.dirname(os.path.abspath(__file__))
fname =... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@nonparametric@tests@test_kernels.py@.PATH_END.py |
{
"filename": "flows.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/docs/myproject/flows.py",
"type": "Python"
} | from prefect import flow
@flow
def my_flow():
pass
@flow(name="Nestedflow")
def my_nested_flow(msg):
pass
| PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@docs@myproject@flows.py@.PATH_END.py |
{
"filename": "hg_plotters.py",
"repo_name": "lsst/rubin_sim",
"repo_path": "rubin_sim_extracted/rubin_sim-main/rubin_sim/maf/plots/hg_plotters.py",
"type": "Python"
} | """Second generation hourglass plotting classes.
"""
# pylint: disable=too-many-arguments
# pylint: disable=super-init-not-called
# pylint: disable=too-many-instance-attributes
# pylint: disable=too-few-public-methods
__all__ = (
"GeneralHourglassPlot",
"CategoricalHourglassPlotMixin",
"RangeHourglassCateg... | lsstREPO_NAMErubin_simPATH_START.@rubin_sim_extracted@rubin_sim-main@rubin_sim@maf@plots@hg_plotters.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.