metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "stellarAge.py",
"repo_name": "sczesla/PyAstronomy",
"repo_path": "PyAstronomy_extracted/PyAstronomy-master/src/pyasl/asl/aslExt_1/stellarAge.py",
"type": "Python"
} | import numpy as np
from PyAstronomy.pyaC import pyaErrors as PE
def gyroAgeBarnes(p, bv):
"""
Calculate gyrochronological age according to Barnes 2007.
The gyrochronological age is calculated according to Eq. 3 in
Barnes 2007 (ApJ 669, 1167). The derivation of the error follows Eq. 16.
Par... | sczeslaREPO_NAMEPyAstronomyPATH_START.@PyAstronomy_extracted@PyAstronomy-master@src@pyasl@asl@aslExt_1@stellarAge.py@.PATH_END.py |
{
"filename": "_widthsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/barpolar/_widthsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WidthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="widthsrc", parent_name="barpolar", **kwargs):
super(WidthsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@barpolar@_widthsrc.py@.PATH_END.py |
{
"filename": "initializer.py",
"repo_name": "fchollet/keras",
"repo_path": "keras_extracted/keras-master/keras/src/initializers/initializer.py",
"type": "Python"
} | from keras.src.api_export import keras_export
@keras_export(["keras.Initializer", "keras.initializers.Initializer"])
class Initializer:
"""Initializer base class: all Keras initializers inherit from this class.
Initializers should implement a `__call__()` method with the following
signature:
```pyth... | fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@initializers@initializer.py@.PATH_END.py |
{
"filename": "correctSPHSumMassDensityInst.cc.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/src/SPH/correctSPHSumMassDensityInst.cc.py",
"type": "Python"
} | text = """
//------------------------------------------------------------------------------
// Explicit instantiation.
//------------------------------------------------------------------------------
#include "SPH/correctSPHSumMassDensity.cc"
#include "Geometry/Dimension.hh"
namespace Spheral {
template void correct... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@src@SPH@correctSPHSumMassDensityInst.cc.py@.PATH_END.py |
{
"filename": "algorithm_zh-CN.md",
"repo_name": "alibaba/TinyNeuralNetwork",
"repo_path": "TinyNeuralNetwork_extracted/TinyNeuralNetwork-main/tinynn/graph/quantization/algorithm/algorithm_zh-CN.md",
"type": "Markdown"
} | # 量化算法:
[English](algorithm.md)
1. [x] 跨层均衡算法([Cross Layer Equalization](https://arxiv.org/abs/1906.04721))
2. [ ] 偏置修正算法([Bias Correction](https://arxiv.org/abs/1906.04721))
3. [ ] 激活值平滑算法([Smooth Quant](https://arxiv.org/abs/2211.10438))
## 跨层均衡算法(Corss Layer Equalization, CLE)
在某些模型中,其输出通道之间的权重分布存在极大差异,而对于per-tens... | alibabaREPO_NAMETinyNeuralNetworkPATH_START.@TinyNeuralNetwork_extracted@TinyNeuralNetwork-main@tinynn@graph@quantization@algorithm@algorithm_zh-CN.md@.PATH_END.py |
{
"filename": "bsr.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/scipy/sparse/bsr.py",
"type": "Python"
} | """Compressed Block Sparse Row matrix format"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['bsr_matrix', 'isspmatrix_bsr']
from warnings import warn
import numpy as np
from .data import _data_matrix, _minmax_mixin
from .compressed import _cs_m... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@scipy@sparse@bsr.py@.PATH_END.py |
{
"filename": "test_kilonovae.py",
"repo_name": "cnsetzer/kilopop",
"repo_path": "kilopop_extracted/kilopop-main/tests/test_kilonovae.py",
"type": "Python"
} | """
Module to test implementations of kne.py module
"""
import unittest
import numpy as np
import sncosmo
from kilopop.kilonovae import bns_kilonova as kilonova
from kilopop.kilonovae import bns_kilonovae_population_distribution as population
class test_kne(unittest.TestCase):
@classmethod
def setUpClass(cl... | cnsetzerREPO_NAMEkilopopPATH_START.@kilopop_extracted@kilopop-main@tests@test_kilonovae.py@.PATH_END.py |
{
"filename": "base.py",
"repo_name": "sdss/marvin",
"repo_path": "marvin_extracted/marvin-main/python/marvin/utils/datamodel/vacs/base.py",
"type": "Python"
} | # !usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
# @Author: Brian Cherinka
# @Date: 2018-07-17 23:36:31
# @Last modified by: Brian Cherinka
# @Last Modified time: 2018-07-19 00:37:28
from __future__ import print_function, division, absolute_import
import copy as copy_mod
... | sdssREPO_NAMEmarvinPATH_START.@marvin_extracted@marvin-main@python@marvin@utils@datamodel@vacs@base.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/packages/amuse-hermite-grx/README.md",
"type": "Markdown"
} | This package installs the Hermite-GRX community code for AMUSE.
| amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@packages@amuse-hermite-grx@README.md@.PATH_END.py |
{
"filename": "varnish.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/Pygments/py2/pygments/lexers/varnish.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
pygments.lexers.varnish
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Varnish configuration
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, bygroups, using, this, \
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@Pygments@py2@pygments@lexers@varnish.py@.PATH_END.py |
{
"filename": "test_lightsurface.py",
"repo_name": "transientskp/tkp",
"repo_path": "tkp_extracted/tkp-master/tests/test_database/test_lightsurface.py",
"type": "Python"
} | from operator import attrgetter
import unittest
import datetime
from tkp.testutil.decorators import requires_database
from tkp.db.orm import DataSet
from tkp.db.orm import Image
from tkp.db.associations import associate_extracted_sources
from tkp.db.general import insert_extracted_sources
import tkp.db
from tkp.testu... | transientskpREPO_NAMEtkpPATH_START.@tkp_extracted@tkp-master@tests@test_database@test_lightsurface.py@.PATH_END.py |
{
"filename": "test_calc.py",
"repo_name": "GalSim-developers/GalSim",
"repo_path": "GalSim_extracted/GalSim-main/tests/test_calc.py",
"type": "Python"
} | # Copyright (c) 2012-2023 by the GalSim developers team on GitHub
# https://github.com/GalSim-developers
#
# This file is part of GalSim: The modular galaxy image simulation toolkit.
# https://github.com/GalSim-developers/GalSim
#
# GalSim is free software: redistribution and use in source and binary forms,
# with or w... | GalSim-developersREPO_NAMEGalSimPATH_START.@GalSim_extracted@GalSim-main@tests@test_calc.py@.PATH_END.py |
{
"filename": "data.py",
"repo_name": "adrn/thejoker",
"repo_path": "thejoker_extracted/thejoker-main/thejoker/data.py",
"type": "Python"
} | # Third-party
import astropy.units as u
import numpy as np
from astropy.table import Table
from astropy.time import Time
from astropy.utils.decorators import deprecated_renamed_argument
from .data_helpers import guess_time_format
# Project
from .logging import logger
__all__ = ["RVData"]
class RVData:
"""
... | adrnREPO_NAMEthejokerPATH_START.@thejoker_extracted@thejoker-main@thejoker@data.py@.PATH_END.py |
{
"filename": "_ticklen.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/xaxis/_ticklen.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicklenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="ticklen", parent_name="layout.xaxis", **kwargs):
super(TicklenValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@xaxis@_ticklen.py@.PATH_END.py |
{
"filename": "test_mcmc_interface.py",
"repo_name": "rodluger/starry_process",
"repo_path": "starry_process_extracted/starry_process-master/tests/test_mcmc_interface.py",
"type": "Python"
} | from starry_process import MCMCInterface
import pymc3 as pm
import numpy as np
# Generate a dataset
npts = 100
yerr = 1e-2
x = np.linspace(0, 2 * np.pi, npts)
u_true = 0.5
v_true = 0.3
y = np.cos(u_true * x + v_true) + yerr * np.random.randn(npts)
# Define the model
with pm.Model() as model:
u = pm.Uniform("u", 0... | rodlugerREPO_NAMEstarry_processPATH_START.@starry_process_extracted@starry_process-master@tests@test_mcmc_interface.py@.PATH_END.py |
{
"filename": "files.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/_plotly_utils/files.py",
"type": "Python"
} | import os
PLOTLY_DIR = os.environ.get(
"PLOTLY_DIR", os.path.join(os.path.expanduser("~"), ".plotly")
)
TEST_FILE = os.path.join(PLOTLY_DIR, ".permission_test")
def _permissions():
try:
if not os.path.exists(PLOTLY_DIR):
try:
os.mkdir(PLOTLY_DIR)
except Excepti... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@_plotly_utils@files.py@.PATH_END.py |
{
"filename": "_standoffsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattersmith/marker/_standoffsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class StandoffsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="standoffsrc", parent_name="scattersmith.marker", **kwargs
):
super(StandoffsrcValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattersmith@marker@_standoffsrc.py@.PATH_END.py |
{
"filename": "analytical2mcfost.py",
"repo_name": "cpinte/pymcfost",
"repo_path": "pymcfost_extracted/pymcfost-master/src/pymcfost/analytical2mcfost.py",
"type": "Python"
} | import numpy as np
import astropy.io.fits as fits
import astropy.units as u
import sys
import subprocess
from .parameters import Params
from .disc_structure import Disc
def analytic_params_import(file):
parobj = open(file)
params = {} # this is a dictionary
for line in parobj:
line = line.strip()... | cpinteREPO_NAMEpymcfostPATH_START.@pymcfost_extracted@pymcfost-master@src@pymcfost@analytical2mcfost.py@.PATH_END.py |
{
"filename": "reader.py",
"repo_name": "kusmic/pycosie",
"repo_path": "pycosie_extracted/pycosie-main/pycosie/fileio/reader.py",
"type": "Python"
} | import numpy as np
from astropy.io import ascii
import astropy.units as u
class VPM():
#"%4d %6.4lg %12.1f %6.3lg %6.4lg %6.3lg -1 %6.3lg %6.3lg\n",nLines, N/1.e+13, v_mean, b, sigma_N/1.e+13, sigma_b, ew, sigma_ew
def __init__(self, fname):
with open(fname) as f:
content = f.read().split("... | kusmicREPO_NAMEpycosiePATH_START.@pycosie_extracted@pycosie-main@pycosie@fileio@reader.py@.PATH_END.py |
{
"filename": "test_data.py",
"repo_name": "dmlc/xgboost",
"repo_path": "xgboost_extracted/xgboost-master/tests/test_distributed/test_with_spark/test_data.py",
"type": "Python"
} | from typing import List
import numpy as np
import pandas as pd
import pytest
from xgboost import testing as tm
pytestmark = [pytest.mark.skipif(**tm.no_spark())]
from xgboost import DMatrix, QuantileDMatrix
from xgboost.spark.data import (
_read_csr_matrix_from_unwrapped_spark_vec,
alias,
create_dmatrix... | dmlcREPO_NAMExgboostPATH_START.@xgboost_extracted@xgboost-master@tests@test_distributed@test_with_spark@test_data.py@.PATH_END.py |
{
"filename": "astro.py",
"repo_name": "sfarrens/sfof",
"repo_path": "sfof_extracted/sfof-master/sfof/python/functions/astro.py",
"type": "Python"
} | #######################
# ASTRONOMY FUNCTIONS #
#######################
import math
def deg2rad(angle):
"""
Function that converts angle from degrees to radians.
"""
rad_angle = angle * math.pi / 180.0
return rad_angle
def rad2deg(angle):
"""
Function that converts angle from radians to degrees.... | sfarrensREPO_NAMEsfofPATH_START.@sfof_extracted@sfof-master@sfof@python@functions@astro.py@.PATH_END.py |
{
"filename": "self_query.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/how_to/self_query.ipynb",
"type": "Jupyter Notebook"
} | # How to do "self-querying" retrieval
:::info
Head to [Integrations](/docs/integrations/retrievers/self_query) for documentation on vector stores with built-in support for self-querying.
:::
A self-querying [retriever](/docs/concepts/retrievers/) is one that, as the name suggests, has the ability to query itself. S... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@how_to@self_query.ipynb@.PATH_END.py |
{
"filename": "_scale.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/geo/projection/_scale.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ScaleValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="scale", parent_name="layout.geo.projection", **kwargs
):
super(ScaleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@geo@projection@_scale.py@.PATH_END.py |
{
"filename": "MovingTarget_simulator_use_examples.ipynb",
"repo_name": "spacetelescope/mirage",
"repo_path": "mirage_extracted/mirage-master/examples/MovingTarget_simulator_use_examples.ipynb",
"type": "Jupyter Notebook"
} | # Example: Using MIRAGE to Generate Moving Target Exposures
### (i.e. Solar System target observations)
This notebook shows an example of how to simulate observations of a non-sidereal target. In this case, JWST tracks the non-sidereal target during the exposure, causing sidereal targets to move over the course of the... | spacetelescopeREPO_NAMEmiragePATH_START.@mirage_extracted@mirage-master@examples@MovingTarget_simulator_use_examples.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "jax-ml/jax",
"repo_path": "jax_extracted/jax-main/jax/_src/scipy/spatial/__init__.py",
"type": "Python"
} | # Copyright 2023 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | jax-mlREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@_src@scipy@spatial@__init__.py@.PATH_END.py |
{
"filename": "_bgcolorsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterternary/hoverlabel/_bgcolorsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BgcolorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="bgcolorsrc",
parent_name="scatterternary.hoverlabel",
**kwargs,
):
super(BgcolorsrcValidator, self).__init__(
plotly_na... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterternary@hoverlabel@_bgcolorsrc.py@.PATH_END.py |
{
"filename": "tools.py",
"repo_name": "bccp/nbodykit",
"repo_path": "nbodykit_extracted/nbodykit-master/nbodykit/io/tools.py",
"type": "Python"
} | import numpy
def get_slice_size(start, stop, step):
"""
Utility function to return the size of an array slice
Parameters
----------
start : int
the beginning of the slice
stop : int
the end of the slice
step : int
the slice step size
Returns
-------... | bccpREPO_NAMEnbodykitPATH_START.@nbodykit_extracted@nbodykit-master@nbodykit@io@tools.py@.PATH_END.py |
{
"filename": "tuple_to_shape.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/pythran/pythran/optimizations/tuple_to_shape.py",
"type": "Python"
} | """ TupleToShap transforms some Tuple node into shape nodes when relevant. """
from pythran.analyses import Aliases
from pythran.tables import MODULES
from pythran.passmanager import Transformation
from pythran.utils import pythran_builtin_attr
import gast as ast
patterns = (MODULES['numpy']['full'],
MOD... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@pythran@pythran@optimizations@tuple_to_shape.py@.PATH_END.py |
{
"filename": "lacosmics.py",
"repo_name": "igrins/plp",
"repo_path": "plp_extracted/plp-master/igrins/libs/lacosmics.py",
"type": "Python"
} | from . cosmics import cosmicsimage
try:
import astroscrappy
except ImportError:
astroscrappy = None
def get_cr_mask_astroscrappy(d, gain=2.2, readnoise=10.0,
sigclip=5, sigfrac = 0.3, objlim = 5.0):
c = astroscrappy.detect_cosmics(d, gain=gain, readnoise=readnoise,
... | igrinsREPO_NAMEplpPATH_START.@plp_extracted@plp-master@igrins@libs@lacosmics.py@.PATH_END.py |
{
"filename": "minuit_ml.py",
"repo_name": "light-curve/light-curve-python",
"repo_path": "light-curve-python_extracted/light-curve-python-master/light-curve/light_curve/light_curve_py/minuit_ml.py",
"type": "Python"
} | """Maximum-likelihood based cost function"""
from typing import Callable, Dict, Tuple
import numpy as np
try:
from iminuit import Minuit
from scipy.special import erf
except ImportError:
MaximumLikelihood = None
else:
class MaximumLikelihood:
errordef = Minuit.LIKELIHOOD
def __init_... | light-curveREPO_NAMElight-curve-pythonPATH_START.@light-curve-python_extracted@light-curve-python-master@light-curve@light_curve@light_curve_py@minuit_ml.py@.PATH_END.py |
{
"filename": "test_synthesis.py",
"repo_name": "sibirrer/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_LensModel/test_Profiles/test_synthesis.py",
"type": "Python"
} | __author__ = "mgomer"
from lenstronomy.LensModel.Profiles.synthesis import SynthesisProfile
from lenstronomy.Analysis.lens_profile import LensProfileAnalysis
from lenstronomy.LensModel.lens_model import LensModel
import numpy as np
import numpy.testing as npt
import pytest
class TestSynthesis(object):
"""Tests ... | sibirrerREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_LensModel@test_Profiles@test_synthesis.py@.PATH_END.py |
{
"filename": "_weightsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattermapbox/hoverlabel/font/_weightsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WeightsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="weightsrc",
parent_name="scattermapbox.hoverlabel.font",
**kwargs,
):
super(WeightsrcValidator, self).__init__(
plotly_n... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattermapbox@hoverlabel@font@_weightsrc.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/core/langchain_core/tools/__init__.py",
"type": "Python"
} | """**Tools** are classes that an Agent uses to interact with the world.
Each tool has a **description**. Agent uses the description to choose the right
tool for the job.
**Class hierarchy:**
.. code-block::
RunnableSerializable --> BaseTool --> <name>Tool # Examples: AIPluginTool, BaseGraphQLTool
... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@core@langchain_core@tools@__init__.py@.PATH_END.py |
{
"filename": "_bordercolor.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/table/hoverlabel/_bordercolor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="bordercolor", parent_name="table.hoverlabel", **kwargs
):
super(BordercolorValidator, self).__init__(
plotly_name=plotly_name,
p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@table@hoverlabel@_bordercolor.py@.PATH_END.py |
{
"filename": "plot_confusion_matrix.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/examples/model_selection/plot_confusion_matrix.py",
"type": "Python"
} | """
================
Confusion matrix
================
Example of confusion matrix usage to evaluate the quality
of the output of a classifier on the iris data set. The
diagonal elements represent the number of points for which
the predicted label is equal to the true label, while
off-diagonal elements are those that ... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@examples@model_selection@plot_confusion_matrix.py@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter/marker/colorbar/title/_font.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="font", parent_name="scatter.marker.colorbar.title", **kwargs
):
super(FontValidator, self).__init__(
plotly_name=plotly_name,
parent... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter@marker@colorbar@title@_font.py@.PATH_END.py |
{
"filename": "_tickprefix.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattercarpet/marker/colorbar/_tickprefix.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickprefixValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="tickprefix",
parent_name="scattercarpet.marker.colorbar",
**kwargs
):
super(TickprefixValidator, self).__init__(
plo... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattercarpet@marker@colorbar@_tickprefix.py@.PATH_END.py |
{
"filename": "ufunc_docstrings.py",
"repo_name": "numpy/numpy",
"repo_path": "numpy_extracted/numpy-main/numpy/_core/code_generators/ufunc_docstrings.py",
"type": "Python"
} | """
Docstrings for generated ufuncs
The syntax is designed to look like the function add_newdoc is being
called from numpy.lib, but in this file add_newdoc puts the docstrings
in a dictionary. This dictionary is used in
numpy/_core/code_generators/generate_umath_doc.py to generate the docstrings
as a C #definitions f... | numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@numpy@_core@code_generators@ufunc_docstrings.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/carpet/baxis/title/font/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="carpet.baxis.title.font", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@carpet@baxis@title@font@_color.py@.PATH_END.py |
{
"filename": "python-reference_catboost_select_features.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/concepts/python-reference_catboost_select_features.md",
"type": "Markdown"
} | # select_features
## {{ dl--purpose }} {#purpose}
{% include [select_features-python__select-features__desc](../_includes/work_src/reusage-python/python__select-features__desc.md) %}
## {{ dl--invoke-format }} {#call-format}
```python
model.select_features(
X,
y=None,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@concepts@python-reference_catboost_select_features.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "samuelyeewl/specmatch-emp",
"repo_path": "specmatch-emp_extracted/specmatch-emp-master/specmatchemp/buildlib/__init__.py",
"type": "Python"
} | samuelyeewlREPO_NAMEspecmatch-empPATH_START.@specmatch-emp_extracted@specmatch-emp-master@specmatchemp@buildlib@__init__.py@.PATH_END.py | |
{
"filename": "alignment.py",
"repo_name": "lgrcia/prose",
"repo_path": "prose_extracted/prose-main/prose/blocks/alignment.py",
"type": "Python"
} | import numpy as np
from astropy.wcs.utils import fit_wcs_from_points
from skimage.transform import warp
from twirl.match import count_cross_match
from prose.blocks.geometry import ComputeTransformTwirl
from prose.core import Block, Image
__all__ = ["TransformData", "AlignReferenceSources", "AlignReferenceWCS"]
# TO... | lgrciaREPO_NAMEprosePATH_START.@prose_extracted@prose-main@prose@blocks@alignment.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/constants/tests/__init__.py",
"type": "Python"
} | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@constants@tests@__init__.py@.PATH_END.py | |
{
"filename": "Main.py",
"repo_name": "MarioRomeroC/Mixclask",
"repo_path": "Mixclask_extracted/Mixclask-main/Main.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import cloudy.CloudyClass as cc #class with all methods needed to operate with cloudy
from skirt import pigs #source code that generates the .ski file
from skirt.ski_params import SkiParams #class that contains all the data to generate the .ski file
import utils.convergen... | MarioRomeroCREPO_NAMEMixclaskPATH_START.@Mixclask_extracted@Mixclask-main@Main.py@.PATH_END.py |
{
"filename": "pyrafTk.py",
"repo_name": "iraf-community/pyraf",
"repo_path": "pyraf_extracted/pyraf-main/pyraf/pyrafTk.py",
"type": "Python"
} | """pyrafTk.py: modify tkinter root to print short PyRAF tracebacks
R. L. White, 2000 November 17
"""
import sys
import tkinter
from . import wutil
class _PyrafTk(tkinter.Tk):
"""Modified Tk class that prints short pyraf tracebacks"""
def __init__(self, function):
self._pyraf_showtraceback = functi... | iraf-communityREPO_NAMEpyrafPATH_START.@pyraf_extracted@pyraf-main@pyraf@pyrafTk.py@.PATH_END.py |
{
"filename": "snapshot-not-working-for-cv.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage-common-phrases/snapshot-not-working-for-cv.md",
"type": "Markdown"
} |
{% note info %}
This parameter is not supported in the `params` parameter of the [cv](../../../concepts/python-reference_cv.md) function.
{% endnote %}
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage-common-phrases@snapshot-not-working-for-cv.md@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/chart-studio/chart_studio/api/utils.py",
"type": "Python"
} | from base64 import b64encode
from requests.compat import builtin_str, is_py2
def _to_native_string(string, encoding):
if isinstance(string, builtin_str):
return string
if is_py2:
return string.encode(encoding)
return string.decode(encoding)
def to_native_utf8_string(string):
return ... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@chart-studio@chart_studio@api@utils.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/surface/hoverlabel/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._font import Font
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(__name__, [], ["._font.Font"])
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@surface@hoverlabel@__init__.py@.PATH_END.py |
{
"filename": "Fujiwara-641.ipynb",
"repo_name": "PyEllips/pyElli",
"repo_path": "pyElli_extracted/pyElli-master/examples/Ellipsometry uniaxial materials/Fujiwara-641.ipynb",
"type": "Jupyter Notebook"
} | # We reproduce results from section 6.4.1 in 'Spectroscopic Ellipsometry', by H. Fujiwara.
Author: O. Castany, M. Müller
Verification of the code against results presented in Fujiwara's book 'Spectroscopic Ellipsometry', section 6.4.1
(p. 237). We reproduce figures 6.16 and 6.17.
```python
import numpy as np
import... | PyEllipsREPO_NAMEpyElliPATH_START.@pyElli_extracted@pyElli-master@examples@Ellipsometry uniaxial materials@Fujiwara-641.ipynb@.PATH_END.py |
{
"filename": "whichdict.py",
"repo_name": "Michalychforever/CLASS-PT",
"repo_path": "CLASS-PT_extracted/CLASS-PT-master/ORTHOGONAL_NG_matrices/computation_of_matrices/bias_multipoles/whichdict.py",
"type": "Python"
} | #--> b2_vd0_f0.txt, b2_vv0_f1.txt, b2_vv2_f1.txt
#--> bG2_vd0_f0.txt, bG2_vv0_f1.txt, bG2_vv2_f1.txt
#-) vd0, f = 0 is [ 3 ] of vv0, f = 1
#-) vv2, f = 1 is [ 2 ] of vv0, f = 1
importdict={"1":["b2_vv0_f1.txt",-1.25],"2":["bG2_vv0_f1.txt",-0.8]}
| MichalychforeverREPO_NAMECLASS-PTPATH_START.@CLASS-PT_extracted@CLASS-PT-master@ORTHOGONAL_NG_matrices@computation_of_matrices@bias_multipoles@whichdict.py@.PATH_END.py |
{
"filename": "test_rebound.py",
"repo_name": "sblunt/orbitize",
"repo_path": "orbitize_extracted/orbitize-main/tests/test_rebound.py",
"type": "Python"
} | from matplotlib import pyplot as plt
from astropy.time import Time
from orbitize import sampler
from orbitize.system import System
from orbitize import DATADIR
from orbitize.read_input import read_file
import astropy.units as u
import numpy as np
# Test Data
mass_in_mjup = 10
mB_Jup = 7
mass_in_msun = mass_in_mjup * u... | sbluntREPO_NAMEorbitizePATH_START.@orbitize_extracted@orbitize-main@tests@test_rebound.py@.PATH_END.py |
{
"filename": "init.py",
"repo_name": "simonsobs/nextline-rdb",
"repo_path": "nextline-rdb_extracted/nextline-rdb-main/src/nextline_rdb/init.py",
"type": "Python"
} | from logging import getLogger
from typing import Optional
from sqlalchemy import func, select
from sqlalchemy.orm import selectinload
from nextline import Nextline
from .db import DB
from .models import CurrentScript, Run
async def initialize_nextline(nextline: Nextline, db: DB) -> None:
run_no = await _last_r... | simonsobsREPO_NAMEnextline-rdbPATH_START.@nextline-rdb_extracted@nextline-rdb-main@src@nextline_rdb@init.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "fred3m/toyz",
"repo_path": "toyz_extracted/toyz-master/docs/source/conf.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
#
# Toyz documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 16 11:46:03 2014.
#
# 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.
#
# All ... | fred3mREPO_NAMEtoyzPATH_START.@toyz_extracted@toyz-master@docs@source@conf.py@.PATH_END.py |
{
"filename": "model.py",
"repo_name": "triton-inference-server/server",
"repo_path": "server_extracted/server-main/qa/L0_model_config/autofill_noplatform/python/input_missing_datatype/model.py",
"type": "Python"
} | # Copyright 2022-2023, NVIDIA CORPORATION & AFFILIATES. 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 o... | triton-inference-serverREPO_NAMEserverPATH_START.@server_extracted@server-main@qa@L0_model_config@autofill_noplatform@python@input_missing_datatype@model.py@.PATH_END.py |
{
"filename": "walkthrough.ipynb",
"repo_name": "VChristiaens/special",
"repo_path": "special_extracted/special-main/docs/_build/doctrees/nbsphinx/tutorials/walkthrough.ipynb",
"type": "Jupyter Notebook"
} | # *special* tutorial
Written by: *Valentin Christiaens*.
Last update: *2022/08/04*
**IMPORTANT**: to run this jupyter notebook tutorial, you will have to download the ``special-extras`` [repository](https://github.com/VChristiaens/special_extras), and keep the `utils.py` file (containing utility routines specific to... | VChristiaensREPO_NAMEspecialPATH_START.@special_extracted@special-main@docs@_build@doctrees@nbsphinx@tutorials@walkthrough.ipynb@.PATH_END.py |
{
"filename": "Sample.ipynb",
"repo_name": "ashleychontos/sort-a-survey",
"repo_path": "sort-a-survey_extracted/sort-a-survey-main/examples/Sample.ipynb",
"type": "Jupyter Notebook"
} | ```python
from sortasurvey.notebook import Survey, rank
from sortasurvey.sample import Sample
```
### The `Sample` class
#### Functionality within the target selection process:
But first, because it's easy and we already have all the required info, let's create the `Survey` first.
```python
TKS = Survey(path_sampl... | ashleychontosREPO_NAMEsort-a-surveyPATH_START.@sort-a-survey_extracted@sort-a-survey-main@examples@Sample.ipynb@.PATH_END.py |
{
"filename": "script_example_model+fit_1_line.ipynb",
"repo_name": "thomasorb/orcs",
"repo_path": "orcs_extracted/orcs-master/docs/script_example_model+fit_1_line.ipynb",
"type": "Jupyter Notebook"
} | # Modelling and fitting a single line spectrum
```python
import orb.fit
import pylab as pl
import numpy as np
```
### Retrieve the observation parameters of a cube of data
Basic observation parameters can be retrieved from any data cube.
They are useful to simulate a spectrum which corresponds to your data.
```p... | thomasorbREPO_NAMEorcsPATH_START.@orcs_extracted@orcs-master@docs@script_example_model+fit_1_line.ipynb@.PATH_END.py |
{
"filename": "Example for lensed quasar.ipynb",
"repo_name": "ajshajib/dolphin",
"repo_path": "dolphin_extracted/dolphin-main/notebooks/Example for lensed quasar.ipynb",
"type": "Jupyter Notebook"
} | # Example for lensed quasar
## Running a model from the config file
Setting up the `dolphin` ecosystem:
- Install `dolphin`, `lenstronomy`, and the required dependencies.
- Create an input/output directory for `dolphin`, we are using "../io_directory_example" in this example.
- Set up these directories inside the in... | ajshajibREPO_NAMEdolphinPATH_START.@dolphin_extracted@dolphin-main@notebooks@Example for lensed quasar.ipynb@.PATH_END.py |
{
"filename": "disc_plotter1D.ipynb",
"repo_name": "cuDisc/cuDisc",
"repo_path": "cuDisc_extracted/cuDisc-main/codes/python/disc_plotter1D.ipynb",
"type": "Jupyter Notebook"
} | # **cuDisc plotting example notebook**
This notebook shows how to use the file in/out functions (stored in fileIO.py) for cuDisc.
To run the cpp files, move to the cuDisc directory and use the commands
make *
then
./*
replacing * with the desired code, without the extension (e.g. 1Ddisc, not 1Ddisc.cpp). ... | cuDiscREPO_NAMEcuDiscPATH_START.@cuDisc_extracted@cuDisc-main@codes@python@disc_plotter1D.ipynb@.PATH_END.py |
{
"filename": "score.py",
"repo_name": "CosmoStat/score",
"repo_path": "score_extracted/score-master/score.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 12 10:16:22 2019
@author: fnammour
"""
#libraries
import numpy as np
import cadmos_lib as cl
import starlets
def is_number(s):
try:
float(s)
return True
except ValueError:
return False
#error message
np2d_error_mes... | CosmoStatREPO_NAMEscorePATH_START.@score_extracted@score-master@score.py@.PATH_END.py |
{
"filename": "plot-shear.py",
"repo_name": "smoh/kinesis",
"repo_path": "kinesis_extracted/kinesis-master/scripts/plot-shear.py",
"type": "Python"
} | """
Script to illustrate the equivalence of shear and expansion.
"""
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
from matplotlib import cm
import matplotlib.pyplot as plt
from matplotlib.patches import ConnectionPatch
import numpy as np
import kinesis as kn
import gapipes as gp
import astropy.c... | smohREPO_NAMEkinesisPATH_START.@kinesis_extracted@kinesis-master@scripts@plot-shear.py@.PATH_END.py |
{
"filename": "test_blas.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/scipy/linalg/tests/test_blas.py",
"type": "Python"
} | #
# Created by: Pearu Peterson, April 2002
#
from __future__ import division, print_function, absolute_import
__usage__ = """
Build linalg:
python setup.py build
Run tests if scipy is installed:
python -c 'import scipy;scipy.linalg.test()'
"""
import math
import numpy as np
from numpy.testing import (assert_equ... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@scipy@linalg@tests@test_blas.py@.PATH_END.py |
{
"filename": "test_quick.py",
"repo_name": "mfouesneau/dustapprox",
"repo_path": "dustapprox_extracted/dustapprox-main/unittests/test_quick.py",
"type": "Python"
} | import unittest
import sys
sys.path.append('../')
class TestQuick(unittest.TestCase):
def test_dependencies(self):
"""Check that the package dependencies are installed."""
from dustapprox import __VERSION__
print("code version: ", __VERSION__)
if __name__ == '__main__':
unittest.mai... | mfouesneauREPO_NAMEdustapproxPATH_START.@dustapprox_extracted@dustapprox-main@unittests@test_quick.py@.PATH_END.py |
{
"filename": "psf.py",
"repo_name": "latrop/DECA",
"repo_path": "DECA_extracted/DECA-master/prep_modules/psf.py",
"type": "Python"
} | #!/usr/bin/python
# -*- coding: cp1251 -*-
import sys
import math
import numpy as np
from scipy import stats
import scipy as sp
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import matplotlib.patches as patches
import matplotlib.path as path
from matplotlib.ticker import NullFormatter
from numpy impo... | latropREPO_NAMEDECAPATH_START.@DECA_extracted@DECA-master@prep_modules@psf.py@.PATH_END.py |
{
"filename": "test_ctransformers.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/integration_tests/llms/test_ctransformers.py",
"type": "Python"
} | """Test C Transformers wrapper."""
from langchain_community.llms import CTransformers
from tests.unit_tests.callbacks.fake_callback_handler import FakeCallbackHandler
def test_ctransformers_call() -> None:
"""Test valid call to C Transformers."""
config = {"max_new_tokens": 5}
callback_handler = FakeCall... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@integration_tests@llms@test_ctransformers.py@.PATH_END.py |
{
"filename": "ViewBoxMenu.py",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/pyqtgraph/graphicsItems/ViewBox/ViewBoxMenu.py",
"type": "Python"
} | from ...Qt import QtCore, QtGui, QtWidgets
from ...WidgetGroup import WidgetGroup
from . import axisCtrlTemplate_generic as ui_template
import weakref
translate = QtCore.QCoreApplication.translate
class ViewBoxMenu(QtWidgets.QMenu):
def __init__(self, view):
QtWidgets.QMenu.__init__(self)
... | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@pyqtgraph@graphicsItems@ViewBox@ViewBoxMenu.py@.PATH_END.py |
{
"filename": "Visualizing Event Horizon and Ergosphere (Singularities) of Kerr Metric or Black Hole.ipynb",
"repo_name": "einsteinpy/einsteinpy",
"repo_path": "einsteinpy_extracted/einsteinpy-main/docs/source/examples/Visualizing Event Horizon and Ergosphere (Singularities) of Kerr Metric or Black Hole.ipynb",
... | # Visualizing Event Horizon and Ergosphere (Singularities) of Kerr Metric or Black Hole
### Importing required modules
```python
import astropy.units as u
import numpy as np
import astropy.units as u
import matplotlib.pyplot as plt
from einsteinpy.coordinates import BoyerLindquistDifferential
from einsteinpy.metric... | einsteinpyREPO_NAMEeinsteinpyPATH_START.@einsteinpy_extracted@einsteinpy-main@docs@source@examples@Visualizing Event Horizon and Ergosphere (Singularities) of Kerr Metric or Black Hole.ipynb@.PATH_END.py |
{
"filename": "gradcam.py",
"repo_name": "SKA-INAF/sclassifier",
"repo_path": "sclassifier_extracted/sclassifier-master/scripts/gradcam.py",
"type": "Python"
} | #!/usr/bin/env python
from __future__ import print_function
##################################################
### SET SEED FOR REPRODUCIBILITY (DEBUG)
##################################################
#from numpy.random import seed
#seed(1)
#import tensorflow
#tensorflow.random.set_seed(2)
#####################... | SKA-INAFREPO_NAMEsclassifierPATH_START.@sclassifier_extracted@sclassifier-master@scripts@gradcam.py@.PATH_END.py |
{
"filename": "findsource.py",
"repo_name": "gammapy/enrico",
"repo_path": "enrico_extracted/enrico-master/enrico/findsource.py",
"type": "Python"
} | #!/usr/bin/env python
import string,os
from enrico import utils
from enrico.fitmaker import FitMaker
from enrico.config import get_config
from enrico.gtfunction import Observation
def update_reg(config):
lines=open(utils._dump_findsrcout(config),"r").readlines()[-4]
word = string.split(lines)
text = "\ncir... | gammapyREPO_NAMEenricoPATH_START.@enrico_extracted@enrico-master@enrico@findsource.py@.PATH_END.py |
{
"filename": "_scattergl.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/_scattergl.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Scattergl(_BaseTraceType):
# class properties
# --------------------
_parent_path_str = ""
_path_str = "scattergl"
_valid_props = {
"connectgaps",
"customdata",
"customdatasrc",
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@_scattergl.py@.PATH_END.py |
{
"filename": "_colorbar.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/heatmapgl/_colorbar.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorbarValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="colorbar", parent_name="heatmapgl", **kwargs):
super(ColorbarValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@heatmapgl@_colorbar.py@.PATH_END.py |
{
"filename": "_tickmode.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter/marker/colorbar/_tickmode.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="tickmode", parent_name="scatter.marker.colorbar", **kwargs
):
super(TickmodeValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter@marker@colorbar@_tickmode.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "tbmiller-astro/silkscreen",
"repo_path": "silkscreen_extracted/silkscreen-main/silkscreen/utils.py",
"type": "Python"
} |
import torch
from tqdm.auto import tqdm
from sbi import utils as sbi_utils
from sbi.inference import posteriors
from sbi.utils import BoxUniform
from sbi.utils import process_prior
from typing import Iterable, Optional
import gc
from astropy.io import fits
import mpire
import torch.nn as nn
import torch.nn.functional... | tbmiller-astroREPO_NAMEsilkscreenPATH_START.@silkscreen_extracted@silkscreen-main@silkscreen@utils.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "astropy/halotools",
"repo_path": "halotools_extracted/halotools-master/halotools/mock_observables/group_identification/test_groups/__init__.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .test_fof_groups import *
| astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@halotools@mock_observables@group_identification@test_groups@__init__.py@.PATH_END.py |
{
"filename": "wigners.py",
"repo_name": "carronj/lenspyx",
"repo_path": "lenspyx_extracted/lenspyx-master/lenspyx/tests/wigners/wigners.py",
"type": "Python"
} | """Compares the Wigner functions to Plancklens's
"""
try:
from plancklens.wigners import wigners as wigners_pl
except:
assert 0, 'cant do this test witout plancklens'
import numpy as np
import time
from ducc0.misc import GL_thetas, GL_weights
from lenspyx.utils_hp import gauss_beam
from lenspyx.wigners import ... | carronjREPO_NAMElenspyxPATH_START.@lenspyx_extracted@lenspyx-master@lenspyx@tests@wigners@wigners.py@.PATH_END.py |
{
"filename": "_dtickrange.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/choroplethmapbox/colorbar/tickformatstop/_dtickrange.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class DtickrangeValidator(_plotly_utils.basevalidators.InfoArrayValidator):
def __init__(
self,
plotly_name="dtickrange",
parent_name="choroplethmapbox.colorbar.tickformatstop",
**kwargs,
):
super(DtickrangeValidator, self).__init__(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@choroplethmapbox@colorbar@tickformatstop@_dtickrange.py@.PATH_END.py |
{
"filename": "Explore_PCs.ipynb",
"repo_name": "patrickaleo/LAISS-local",
"repo_path": "LAISS-local_extracted/LAISS-local-main/notebooks/Explore_PCs.ipynb",
"type": "Jupyter Notebook"
} | ```python
import time
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pickle
import os
import sys
import annoy
from annoy import AnnoyIndex
import random
import itertools
from IPython.display import display_markdown
from collections import Counter
from sklearn import preprocessing
fr... | patrickaleoREPO_NAMELAISS-localPATH_START.@LAISS-local_extracted@LAISS-local-main@notebooks@Explore_PCs.ipynb@.PATH_END.py |
{
"filename": "test_array_source.py",
"repo_name": "enthought/mayavi",
"repo_path": "mayavi_extracted/mayavi-master/integrationtests/mayavi/test_array_source.py",
"type": "Python"
} | """Tests for the ArraySource data source for MayaVi.
"""
# Author: Prabhu Ramachandran <prabhu_r@users.sf.net>
# Copyright (c) 2005, Enthought, Inc.
# License: BSD Style.
# Standard library imports.
from os.path import abspath
from io import BytesIO
import copy
import numpy
# Enthought library imports.
from traits.a... | enthoughtREPO_NAMEmayaviPATH_START.@mayavi_extracted@mayavi-master@integrationtests@mayavi@test_array_source.py@.PATH_END.py |
{
"filename": "tf_unknown_rank_test.py",
"repo_name": "triton-inference-server/server",
"repo_path": "server_extracted/server-main/qa/L0_tf_unknown_rank/tf_unknown_rank_test.py",
"type": "Python"
} | #!/usr/bin/env python3
# Copyright 2022-2023, NVIDIA CORPORATION & AFFILIATES. 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
... | triton-inference-serverREPO_NAMEserverPATH_START.@server_extracted@server-main@qa@L0_tf_unknown_rank@tf_unknown_rank_test.py@.PATH_END.py |
{
"filename": "plot_structure.py",
"repo_name": "dullemond/radmc3d-2.0",
"repo_path": "radmc3d-2.0_extracted/radmc3d-2.0-master/examples/run_spher2d_1/plot_structure.py",
"type": "Python"
} | from matplotlib import cm
import matplotlib.pyplot as plt
import numpy as np
import math
import os
from radmc3dPy.analyze import *
from radmc3dPy.natconst import *
#
# First set up the model with
#
# python problem_setup.py
#
# Then make sure to have run
#
# radmc3d mctherm
#
#os.system('radmc3d mctherm')
#
# ... | dullemondREPO_NAMEradmc3d-2.0PATH_START.@radmc3d-2.0_extracted@radmc3d-2.0-master@examples@run_spher2d_1@plot_structure.py@.PATH_END.py |
{
"filename": "test_version.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/integrations/prefect-gitlab/tests/test_version.py",
"type": "Python"
} | from packaging.version import Version
def test_version():
from prefect_gitlab import __version__
assert isinstance(__version__, str)
assert Version(__version__)
assert __version__.startswith("0.")
| PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@integrations@prefect-gitlab@tests@test_version.py@.PATH_END.py |
{
"filename": "statNames.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/fonttools/fontTools/designspaceLib/statNames.py",
"type": "Python"
} | """Compute name information for a given location in user-space coordinates
using STAT data. This can be used to fill-in automatically the names of an
instance:
.. code:: python
instance = doc.instances[0]
names = getStatNames(doc, instance.getFullUserLocation(doc))
print(names.styleNames)
"""
from __futu... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@fonttools@fontTools@designspaceLib@statNames.py@.PATH_END.py |
{
"filename": "modeling.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/Pygments/py2/pygments/lexers/modeling.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
pygments.lexers.modeling
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for modeling languages.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, using, d... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@Pygments@py2@pygments@lexers@modeling.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/choroplethmap/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._colorbar import ColorBar
from ._hoverlabel import Hoverlabel
from ._legendgrouptitle import Legendgrouptitle
from ._marker import Marker
from ._selected import Selected
from ._stream import Stream
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@choroplethmap@__init__.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "grackle-project/grackle",
"repo_path": "grackle_extracted/grackle-main/src/clib/README.md",
"type": "Markdown"
} | # Basic Code Organization
This directory contains all of Grackle's C and Fortran source code files. It also contains all private header files.
The directory located at `../include` (i.e. the `include` directory at `src/include`) contains Grackle's public header files.
We review the differences between these headers ... | grackle-projectREPO_NAMEgracklePATH_START.@grackle_extracted@grackle-main@src@clib@README.md@.PATH_END.py |
{
"filename": "num_input.py",
"repo_name": "DirectDM/directdm-py",
"repo_path": "directdm-py_extracted/directdm-py-master/directdm/num/num_input.py",
"type": "Python"
} | #!/usr/bin/env python3
import sys
import numpy as np
import warnings
from directdm.run import rge
#----------------------------------------------#
# #
# Numerical input. All masses in units of GeV. #
# #
#----------------------... | DirectDMREPO_NAMEdirectdm-pyPATH_START.@directdm-py_extracted@directdm-py-master@directdm@num@num_input.py@.PATH_END.py |
{
"filename": "fujitsuccompiler.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/numpy/py3/numpy/distutils/fujitsuccompiler.py",
"type": "Python"
} | from distutils.unixccompiler import UnixCCompiler
class FujitsuCCompiler(UnixCCompiler):
"""
Fujitsu compiler.
"""
compiler_type = 'fujitsu'
cc_exe = 'fcc'
cxx_exe = 'FCC'
def __init__(self, verbose=0, dry_run=0, force=0):
UnixCCompiler.__init__(self, verbose, dry_run, force)
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@numpy@py3@numpy@distutils@fujitsuccompiler.py@.PATH_END.py |
{
"filename": "_outsidetextfont.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/pie/_outsidetextfont.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OutsidetextfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="outsidetextfont", parent_name="pie", **kwargs):
super(OutsidetextfontValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@pie@_outsidetextfont.py@.PATH_END.py |
{
"filename": "test_dmatrix.py",
"repo_name": "dmlc/xgboost",
"repo_path": "xgboost_extracted/xgboost-master/tests/python/test_dmatrix.py",
"type": "Python"
} | import csv
import os
import tempfile
import warnings
import numpy as np
import pytest
import scipy.sparse
from hypothesis import given, settings, strategies
from scipy.sparse import csr_matrix, rand
import xgboost as xgb
from xgboost import testing as tm
from xgboost.core import DataSplitMode
from xgboost.testing.dat... | dmlcREPO_NAMExgboostPATH_START.@xgboost_extracted@xgboost-master@tests@python@test_dmatrix.py@.PATH_END.py |
{
"filename": "evpatools.py",
"repo_name": "skiehl/polarizationtools",
"repo_path": "polarizationtools_extracted/polarizationtools-main/evpatools.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Analysis tools for electric vector position angle (EVPA) time-series data.
"""
from itertools import groupby
from operator import itemgetter
import numpy as np
__author__ = "Sebastian Kiehlmann"
__credits__ = ["Sebastian Kiehlmann", "Dmitry Blinov"]
__license__ = "BS... | skiehlREPO_NAMEpolarizationtoolsPATH_START.@polarizationtools_extracted@polarizationtools-main@evpatools.py@.PATH_END.py |
{
"filename": "_namelength.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/surface/hoverlabel/_namelength.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NamelengthValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="namelength", parent_name="surface.hoverlabel", **kwargs
):
super(NamelengthValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@surface@hoverlabel@_namelength.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "bradkav/AntiparticleDM",
"repo_path": "AntiparticleDM_extracted/AntiparticleDM-master/analysis/README.md",
"type": "Markdown"
} | # AntiparticleDM - analysis
Files for generating plots from the data in the `results` folder. Requires `numpy`, `scipy` and `matplotlib` for processing and plotting the results.
Run `scripts/GeneratePlots.sh` to (re-)generate all the plots from the paper.
### Plotting scripts
- `PlotContours_row.py`: Plot contours ... | bradkavREPO_NAMEAntiparticleDMPATH_START.@AntiparticleDM_extracted@AntiparticleDM-master@analysis@README.md@.PATH_END.py |
{
"filename": "animation.py",
"repo_name": "dmentipl/plonk",
"repo_path": "plonk_extracted/plonk-main/src/plonk/visualize/animation.py",
"type": "Python"
} | """Animations of visualizations."""
from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING, Any, Dict, List, Union
import matplotlib.pyplot as plt
from matplotlib import animation as _animation
try:
from tqdm import tqdm
except ImportError:
tqdm = None
from .._logging ... | dmentiplREPO_NAMEplonkPATH_START.@plonk_extracted@plonk-main@src@plonk@visualize@animation.py@.PATH_END.py |
{
"filename": "_uid.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/densitymap/_uid.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class UidValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="uid", parent_name="densitymap", **kwargs):
super(UidValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_ty... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@densitymap@_uid.py@.PATH_END.py |
{
"filename": "gpu_common_utils.py",
"repo_name": "jax-ml/jax",
"repo_path": "jax_extracted/jax-main/jaxlib/gpu_common_utils.py",
"type": "Python"
} | # Copyright 2023 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | jax-mlREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jaxlib@gpu_common_utils.py@.PATH_END.py |
{
"filename": "spectrum.py",
"repo_name": "icecube/toise",
"repo_path": "toise_extracted/toise-main/toise/figures/diffuse/spectrum.py",
"type": "Python"
} | from copy import copy
from functools import partial
from io import StringIO
import numpy as np
from scipy import optimize
from tqdm import tqdm
from toise import (
diffuse,
factory,
multillh,
surface_veto,
)
from toise.cache import ecached, lru_cache
from toise.figures import figure, figure_data
def... | icecubeREPO_NAMEtoisePATH_START.@toise_extracted@toise-main@toise@figures@diffuse@spectrum.py@.PATH_END.py |
{
"filename": "_symbolsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/area/marker/_symbolsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SymbolsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="symbolsrc", parent_name="area.marker", **kwargs):
super(SymbolsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@area@marker@_symbolsrc.py@.PATH_END.py |
{
"filename": "cm.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/matplotlib/py3/matplotlib/cm.py",
"type": "Python"
} | """
Builtin colormaps, colormap handling utilities, and the `ScalarMappable` mixin.
.. seealso::
:doc:`/gallery/color/colormap_reference` for a list of builtin colormaps.
:ref:`colormap-manipulation` for examples of how to make
colormaps.
:ref:`colormaps` an in-depth discussion of choosing
colormaps.
:... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@matplotlib@py3@matplotlib@cm.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "AMReX-Astro/MAESTROeX",
"repo_path": "MAESTROeX_extracted/MAESTROeX-main/Exec/science/urca/analysis/UrcaAnalysis/tools/__init__.py",
"type": "Python"
} | from UrcaAnalysis.tools.FileToolkit import *
| AMReX-AstroREPO_NAMEMAESTROeXPATH_START.@MAESTROeX_extracted@MAESTROeX-main@Exec@science@urca@analysis@UrcaAnalysis@tools@__init__.py@.PATH_END.py |
{
"filename": "test_pickle.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/indexes/datetimes/test_pickle.py",
"type": "Python"
} | import pytest
from pandas import (
NaT,
date_range,
to_datetime,
)
import pandas._testing as tm
class TestPickle:
def test_pickle(self):
# GH#4606
idx = to_datetime(["2013-01-01", NaT, "2014-01-06"])
idx_p = tm.round_trip_pickle(idx)
assert idx_p[0] == idx[0]
a... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@indexes@datetimes@test_pickle.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.