metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "__init__.py",
"repo_name": "guillochon/MOSFiT",
"repo_path": "MOSFiT_extracted/MOSFiT-master/mosfit/modules/datas/__init__.py",
"type": "Python"
} | """Initilization procedure for `Data` modules."""
import inspect
import os
import sys
path = os.path.dirname(os.path.abspath(__file__))
__all__ = []
for py in [
f[:-3] for f in os.listdir(path)
if f.endswith('.py') and f != '__init__.py'
]:
mod = __import__('.'.join([__name__, py]), fromlist=[py])... | guillochonREPO_NAMEMOSFiTPATH_START.@MOSFiT_extracted@MOSFiT-master@mosfit@modules@datas@__init__.py@.PATH_END.py |
{
"filename": "shell.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/Pygments/py3/pygments/lexers/shell.py",
"type": "Python"
} | """
pygments.lexers.shell
~~~~~~~~~~~~~~~~~~~~~
Lexers for various shells.
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, \
include, default, this,... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@Pygments@py3@pygments@lexers@shell.py@.PATH_END.py |
{
"filename": "ex_grangercausality.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/examples/ex_grangercausality.py",
"type": "Python"
} | """
Created on Sat Jul 06 15:44:57 2013
Author: Josef Perktold
"""
import numpy as np
from numpy.testing import assert_almost_equal
from statsmodels.datasets import macrodata
import statsmodels.tsa.stattools as tsa_stats
# some example data
mdata = macrodata.load_pandas().data
mdata = mdata[['realgdp','realcons']].... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@examples@ex_grangercausality.py@.PATH_END.py |
{
"filename": "StarDestroyer.ipynb",
"repo_name": "astronomyk/SimCADO",
"repo_path": "SimCADO_extracted/SimCADO-master/docs/source/_static/python_notebooks/StarDestroyer.ipynb",
"type": "Jupyter Notebook"
} | ```python
import scipy.ndimage as spi
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
%matplotlib inline
from astropy.io import fits, ascii
import astropy.units as u
import simcado
```
# Observing an Imperial Star Destroyer with SimCADO
The goal here is to work out how close... | astronomykREPO_NAMESimCADOPATH_START.@SimCADO_extracted@SimCADO-master@docs@source@_static@python_notebooks@StarDestroyer.ipynb@.PATH_END.py |
{
"filename": "_line.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/scattergl/_line.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scattergl"
_path_str = "scattergl.line"
_valid_props = {"color", "dash", "shape", "width"}
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@scattergl@_line.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "rapidsai/cuml",
"repo_path": "cuml_extracted/cuml-main/python/cuml/cuml/benchmark/automated/utils/utils.py",
"type": "Python"
} | #
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | rapidsaiREPO_NAMEcumlPATH_START.@cuml_extracted@cuml-main@python@cuml@cuml@benchmark@automated@utils@utils.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "fchollet/keras",
"repo_path": "keras_extracted/keras-master/keras/api/_tf_keras/keras/saving/__init__.py",
"type": "Python"
} | """DO NOT EDIT.
This file was autogenerated. Do not edit it by hand,
since your modifications would be overwritten.
"""
from keras.src.saving.file_editor import KerasFileEditor
from keras.src.saving.object_registration import CustomObjectScope
from keras.src.saving.object_registration import (
CustomObjectScope a... | fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@api@_tf_keras@keras@saving@__init__.py@.PATH_END.py |
{
"filename": "format_instructions.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/core/langchain_core/output_parsers/format_instructions.py",
"type": "Python"
} | # flake8: noqa
JSON_FORMAT_INSTRUCTIONS = """The output should be formatted as a JSON instance that conforms to the JSON schema below.
As an example, for the schema {{"properties": {{"foo": {{"title": "Foo", "description": "a list of strings", "type": "array", "items": {{"type": "string"}}}}}}, "required": ["foo"]}}
... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@core@langchain_core@output_parsers@format_instructions.py@.PATH_END.py |
{
"filename": "_textfont.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/histogram2d/_textfont.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="textfont", parent_name="histogram2d", **kwargs):
super(TextfontValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@histogram2d@_textfont.py@.PATH_END.py |
{
"filename": "Adaptive_test.py",
"repo_name": "Pranab-JD/LeXInt",
"repo_path": "LeXInt_extracted/LeXInt-main/Python/Test/Adaptive_test.py",
"type": "Python"
} | """
Created on Sat Aug 14 11:31:19 2022
@author: Pranab JD
Description: Adaptive Test
"""
import os, sys, shutil
import numpy as np
from scipy.sparse import csr_matrix
from datetime import datetime
startTime = datetime.now()
### ------------------------------------------------------ ###
sys.path.insert(1, "../Va... | Pranab-JDREPO_NAMELeXIntPATH_START.@LeXInt_extracted@LeXInt-main@Python@Test@Adaptive_test.py@.PATH_END.py |
{
"filename": "setup_package.py",
"repo_name": "D-arioSpace/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/utils/tap/tests/setup_package.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
=============
TAP plus
=============
@author: Juan Carlos Segovia
@contact: juan.carlos.segovia@sciops.esa.int
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
Created on 30 jun. 2016
"""
import os
# setup paths to the test d... | D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@utils@tap@tests@setup_package.py@.PATH_END.py |
{
"filename": "noise_spec.py",
"repo_name": "samuelyeewl/specmatch-emp",
"repo_path": "specmatch-emp_extracted/specmatch-emp-master/tests/noise_spec.py",
"type": "Python"
} | #!/usr/bin/env python
"""
@filename noise_spec.py
Adds noise to a given spectrum
"""
import numpy as np
import os
from argparse import ArgumentParser
from specmatchemp import SPECMATCHDIR
from specmatchemp import spectrum
def add_noise(spec, snr):
"""Adds Poisson noise to the given spectrum.
The amount of ... | samuelyeewlREPO_NAMEspecmatch-empPATH_START.@specmatch-emp_extracted@specmatch-emp-master@tests@noise_spec.py@.PATH_END.py |
{
"filename": "dora_finetuning.py",
"repo_name": "huggingface/peft",
"repo_path": "peft_extracted/peft-main/examples/dora_finetuning/dora_finetuning.py",
"type": "Python"
} | import os
import torch
from datasets import load_dataset
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
BitsAndBytesConfig,
DataCollatorForLanguageModeling,
Trainer,
TrainingArguments,
)
from peft import LoraConfig, get_peft_model, prepare_model_for_kbit_training
def train_m... | huggingfaceREPO_NAMEpeftPATH_START.@peft_extracted@peft-main@examples@dora_finetuning@dora_finetuning.py@.PATH_END.py |
{
"filename": "joint.py",
"repo_name": "CobayaSampler/cobaya",
"repo_path": "cobaya_extracted/cobaya-master/cobaya/likelihoods/des_y1/joint.py",
"type": "Python"
} | from cobaya.likelihoods.base_classes import DES
class joint(DES):
r"""
Combination of galaxy clustering and weak lensing data from the first year of the
Dark Energy Survey (DES Y1) \cite{Abbott:2017wau}.
"""
bibtex_file = 'des_y1.bibtex'
| CobayaSamplerREPO_NAMEcobayaPATH_START.@cobaya_extracted@cobaya-master@cobaya@likelihoods@des_y1@joint.py@.PATH_END.py |
{
"filename": "neutrino3DVertexReconstructor.py",
"repo_name": "nu-radio/NuRadioMC",
"repo_path": "NuRadioMC_extracted/NuRadioMC-master/NuRadioReco/modules/neutrinoVertexReconstructor/neutrino3DVertexReconstructor.py",
"type": "Python"
} | import numpy as np
from matplotlib import cm
import matplotlib.pyplot as plt
from NuRadioReco.utilities import units
import NuRadioReco.utilities.io_utilities
import NuRadioReco.framework.electric_field
import NuRadioReco.detector.antennapattern
from NuRadioReco.framework.parameters import stationParameters as stnp
fro... | nu-radioREPO_NAMENuRadioMCPATH_START.@NuRadioMC_extracted@NuRadioMC-master@NuRadioReco@modules@neutrinoVertexReconstructor@neutrino3DVertexReconstructor.py@.PATH_END.py |
{
"filename": "time_series.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/doc/source/cookbook/time_series.py",
"type": "Python"
} | import matplotlib.pyplot as plt
import numpy as np
import yt
# Enable parallelism in the script (assuming it was called with
# `mpirun -np <n_procs>` )
yt.enable_parallelism()
# By using wildcards such as ? and * with the load command, we can load up a
# Time Series containing all of these datasets simultaneously.
#... | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@doc@source@cookbook@time_series.py@.PATH_END.py |
{
"filename": "plot.py",
"repo_name": "lgrcia/paper-nuance",
"repo_path": "paper-nuance_extracted/paper-nuance-main/workflows/synthetic-injection-recovery/scripts/plot.py",
"type": "Python"
} | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.stats import binned_statistic_2d
def is_found(period, true_period):
period_check = np.abs(period - true_period) < 0.01
alias_check = np.abs(2 * period - true_period) < 0.01
alias_check |= np.abs(period / 2 - true_period) < 0.... | lgrciaREPO_NAMEpaper-nuancePATH_START.@paper-nuance_extracted@paper-nuance-main@workflows@synthetic-injection-recovery@scripts@plot.py@.PATH_END.py |
{
"filename": "iuwt_convolution.py",
"repo_name": "ratt-ru/PyMORESANE",
"repo_path": "PyMORESANE_extracted/PyMORESANE-master/pymoresane/iuwt_convolution.py",
"type": "Python"
} | import numpy as np
import traceback
try:
import pycuda.driver as drv
import pycuda.tools
import pycuda.autoinit
import pycuda.gpuarray as gpuarray
from pycuda.compiler import SourceModule
from scikits.cuda.fft import Plan
from scikits.cuda.fft import fft
from scikits.cuda.fft import iff... | ratt-ruREPO_NAMEPyMORESANEPATH_START.@PyMORESANE_extracted@PyMORESANE-master@pymoresane@iuwt_convolution.py@.PATH_END.py |
{
"filename": "operon-bindings.py",
"repo_name": "heal-research/pyoperon",
"repo_path": "pyoperon_extracted/pyoperon-main/example/operon-bindings.py",
"type": "Python"
} | # SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: Copyright 2019-2022 Heal Research
import random, time, sys, os, json
import numpy as np
import pandas as pd
from scipy import stats
import pyoperon as Operon
from pmlb import fetch_data
if __name__ == '__main__':
# get some training data - see https://e... | heal-researchREPO_NAMEpyoperonPATH_START.@pyoperon_extracted@pyoperon-main@example@operon-bindings.py@.PATH_END.py |
{
"filename": "_locations.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/volume/slices/z/_locations.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LocationsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self, plotly_name="locations", parent_name="volume.slices.z", **kwargs
):
super(LocationsValidator, self).__init__(
plotly_name=plotly_name,
pare... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@volume@slices@z@_locations.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "myrafproject/myrafproject",
"repo_path": "myrafproject_extracted/myrafproject-main/src/myrafgui/__init__.py",
"type": "Python"
} | from .about import Ui_FormAbout
from .align import Ui_FormAlign
from .arithmetic import Ui_FormArithmetic
from .bin import Ui_FormBin
from .ccdproc import Ui_FormCCDPROC
from .combine import Ui_FormCombine
from .cosmic_cleaner import Ui_FormCosmicCleaner
from .crop import Ui_FormCrop
from .display import Ui_FormDisplay... | myrafprojectREPO_NAMEmyrafprojectPATH_START.@myrafproject_extracted@myrafproject-main@src@myrafgui@__init__.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/scatterpolar/marker/colorbar/tickfont/_lineposition.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LinepositionValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(
self,
plotly_name="lineposition",
parent_name="scatterpolar.marker.colorbar.tickfont",
**kwargs,
):
super(LinepositionValidator, self).__init__... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterpolar@marker@colorbar@tickfont@_lineposition.py@.PATH_END.py |
{
"filename": "make.py",
"repo_name": "ashleychontos/pySYD",
"repo_path": "pySYD_extracted/pySYD-master/dev/dev/make.py",
"type": "Python"
} | # SOURCE PACKAGE ---> DEVELOPMENT BRANCH
print('\n\n COPYING FROM SOURCE PACKAGE ---> DEVELOPMENT BRANCH \n\n')
from pysyd import utils
cont = utils._ask_yesno('continue? ')
if cont:
import os
scripts = ['cli', 'models', 'pipeline', 'plots', 'target', 'utils']
rows, rows_cli = 18, 32
_ROOT, _ = os.pa... | ashleychontosREPO_NAMEpySYDPATH_START.@pySYD_extracted@pySYD-master@dev@dev@make.py@.PATH_END.py |
{
"filename": "animate.py",
"repo_name": "rzellem/EXOTIC",
"repo_path": "EXOTIC_extracted/EXOTIC-main/exotic/animate.py",
"type": "Python"
} | import threading
import time
import sys
done_flag_animate_exotic = None
th_animate_exotic = None
def animate():
import itertools
for c in itertools.cycle(['|', '/', '-', '\\']):
if done_flag_animate_exotic:
sys.stdout.write('\rThinking ... DONE!')
sys.stdout.write('\n')
... | rzellemREPO_NAMEEXOTICPATH_START.@EXOTIC_extracted@EXOTIC-main@exotic@animate.py@.PATH_END.py |
{
"filename": "fitsutils.py",
"repo_name": "mlafarga/raccoon",
"repo_path": "raccoon_extracted/raccoon-master/raccoon/fitsutils.py",
"type": "Python"
} | #!/usr/bin/env python
from __future__ import division
from __future__ import print_function
import sys
from astropy.io import fits
import numpy as np
import pandas as pd
###############################################################################
# Read header
def read_header(filin, ext=0):
"""
Read FI... | mlafargaREPO_NAMEraccoonPATH_START.@raccoon_extracted@raccoon-master@raccoon@fitsutils.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattercarpet/marker/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="scattercarpet.marker", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=par... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattercarpet@marker@_color.py@.PATH_END.py |
{
"filename": "test_FitData.py",
"repo_name": "rpoleski/MulensModel",
"repo_path": "MulensModel_extracted/MulensModel-master/source/MulensModel/tests/test_FitData.py",
"type": "Python"
} | import ast
import numpy as np
from numpy.testing import assert_almost_equal as almost
from numpy.testing import assert_allclose
import pytest
import unittest
from os.path import join
import MulensModel as mm
from fortran_files import FortranSFitFile51
dir_1 = join(mm.DATA_PATH, 'photometry_files', 'OB140939')
dir_2 ... | rpoleskiREPO_NAMEMulensModelPATH_START.@MulensModel_extracted@MulensModel-master@source@MulensModel@tests@test_FitData.py@.PATH_END.py |
{
"filename": "_hoverinfo.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/box/_hoverinfo.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HoverinfoValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(self, plotly_name="hoverinfo", parent_name="box", **kwargs):
super(HoverinfoValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@box@_hoverinfo.py@.PATH_END.py |
{
"filename": "nml_roles.py",
"repo_name": "rhdtownsend/gyre",
"repo_path": "gyre_extracted/gyre-master/docs/source/exts/nml_roles.py",
"type": "Python"
} | from docutils.parsers.rst import roles, nodes
def nml_group_role (name, rawtext, text, lineno, inliner, options={}, content=[]):
"""Format a namelist group name.
Returns 2 part tuple containing list of nodes to insert into the
document and a list of system messages. Both are allowed to be
empty.
... | rhdtownsendREPO_NAMEgyrePATH_START.@gyre_extracted@gyre-master@docs@source@exts@nml_roles.py@.PATH_END.py |
{
"filename": "Sim2-multisim.ipynb",
"repo_name": "abhisrkckl/pint-noise",
"repo_path": "pint-noise_extracted/pint-noise-main/sim2-efac-ecorr/Sim2-multisim.ipynb",
"type": "Jupyter Notebook"
} | ```python
from pint.models import get_model
from pint.simulation import make_fake_toas_fromtim
from pint.logging import setup as setup_log
from pint.fitter import Fitter
from io import StringIO
import numpy as np
import astropy.units as u
import matplotlib.pyplot as plt
import corner
from joblib import delayed, Paral... | abhisrkcklREPO_NAMEpint-noisePATH_START.@pint-noise_extracted@pint-noise-main@sim2-efac-ecorr@Sim2-multisim.ipynb@.PATH_END.py |
{
"filename": "floats.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/hypothesis/py2/hypothesis/internal/conjecture/floats.py",
"type": "Python"
} | # coding=utf-8
#
# This file is part of Hypothesis, which may be found at
# https://github.com/HypothesisWorks/hypothesis/
#
# Most of this work is copyright (C) 2013-2019 David R. MacIver
# (david@drmaciver.com), but it contains contributions by others. See
# CONTRIBUTING.rst for a full list of people who may hold cop... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@hypothesis@py2@hypothesis@internal@conjecture@floats.py@.PATH_END.py |
{
"filename": "LimitedMonaghanGingoldViscosity.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/src/PYB11/ArtificialViscosity/LimitedMonaghanGingoldViscosity.py",
"type": "Python"
} | #-------------------------------------------------------------------------------
# LimitedMonaghanGingoldViscosity
#-------------------------------------------------------------------------------
from PYB11Generator import *
from MonaghanGingoldViscosity import *
from ArtificialViscosityAbstractMethods import *
@PYB11... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@src@PYB11@ArtificialViscosity@LimitedMonaghanGingoldViscosity.py@.PATH_END.py |
{
"filename": "joint_likelihood_set.py",
"repo_name": "threeML/threeML",
"repo_path": "threeML_extracted/threeML-master/threeML/classicMLE/joint_likelihood_set.py",
"type": "Python"
} |
import warnings
from builtins import object, range
import numpy as np
import pandas as pd
from astromodels import Model
from threeML.analysis_results import AnalysisResultsSet
from threeML.classicMLE.joint_likelihood import JointLikelihood
from threeML.config.config import threeML_config
from threeML.data_list impor... | threeMLREPO_NAMEthreeMLPATH_START.@threeML_extracted@threeML-master@threeML@classicMLE@joint_likelihood_set.py@.PATH_END.py |
{
"filename": "multi_width_image.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/doc/source/cookbook/multi_width_image.py",
"type": "Python"
} | import yt
# Load the dataset.
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
# Create a slice plot for the dataset. With no additional arguments,
# the width will be the size of the domain and the center will be the
# center of the simulation box
slc = yt.SlicePlot(ds, "z", ("gas", "density"))
# Create a list... | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@doc@source@cookbook@multi_width_image.py@.PATH_END.py |
{
"filename": "_textfont.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattermap/_textfont.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="textfont", parent_name="scattermap", **kwargs):
super(TextfontValidator, 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@scattermap@_textfont.py@.PATH_END.py |
{
"filename": "AIMS.py",
"repo_name": "benrendle/AIMS",
"repo_path": "AIMS_extracted/AIMS-master/AIMS_v1.0/AIMS.py",
"type": "Python"
} | #!/usr/bin/env python
# $Id: AIMS.py
# Author: Daniel R. Reese <daniel.reese@obspm.fr>
# Copyright (C) Daniel R. Reese and contributors
# Copyright license: GNU GPL v3.0
#
# AIMS is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... | benrendleREPO_NAMEAIMSPATH_START.@AIMS_extracted@AIMS-master@AIMS_v1.0@AIMS.py@.PATH_END.py |
{
"filename": "_projection.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/scene/camera/_projection.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ProjectionValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="projection", parent_name="layout.scene.camera", **kwargs
):
super(ProjectionValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@scene@camera@_projection.py@.PATH_END.py |
{
"filename": "apero_stats.py",
"repo_name": "njcuk9999/apero-drs",
"repo_path": "apero-drs_extracted/apero-drs-main/apero/tools/recipes/bin/apero_stats.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# CODE NAME HERE
# CODE DESCRIPTION HERE
Created on 2019-07-26 at 09:39
@author: cook
"""
from apero.base import base
from apero.core import constants
from apero.core.core import drs_log
from apero.core.utils import drs_recipe
from apero.core.utils import drs_startup... | njcuk9999REPO_NAMEapero-drsPATH_START.@apero-drs_extracted@apero-drs-main@apero@tools@recipes@bin@apero_stats.py@.PATH_END.py |
{
"filename": "imports.py",
"repo_name": "CMB-S4/spt3g_software",
"repo_path": "spt3g_software_extracted/spt3g_software-master/dfmux/tests/imports.py",
"type": "Python"
} | import spt3g._libdfmux
for k in dir(spt3g._libdfmux):
print(k, getattr(spt3g._libdfmux, k))
from spt3g._libdfmux import DfMuxSample
import spt3g.dfmux
from spt3g import dfmux
from spt3g.dfmux import DfMuxSample
| CMB-S4REPO_NAMEspt3g_softwarePATH_START.@spt3g_software_extracted@spt3g_software-master@dfmux@tests@imports.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "h5py/h5py",
"repo_path": "h5py_extracted/h5py-master/h5py/tests/data_files/__init__.py",
"type": "Python"
} | from os.path import dirname, join
def get_data_file_path(basename):
"""
Returns the path to the test data file given by `basename`
"""
return join(dirname(__file__), basename)
| h5pyREPO_NAMEh5pyPATH_START.@h5py_extracted@h5py-master@h5py@tests@data_files@__init__.py@.PATH_END.py |
{
"filename": "rubber_seconds.py",
"repo_name": "spacepy/spacepy",
"repo_path": "spacepy_extracted/spacepy-main/developer/scripts/rubber_seconds.py",
"type": "Python"
} | #!/usr/bin/env python
"""Calculate various approaches to UTC - TAI during rubber second era"""
import datetime
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy
import spacepy.pycdf
import spacepy.time
# These are values from USNO tai-utc during rubber-second era
# Piece-wise line... | spacepyREPO_NAMEspacepyPATH_START.@spacepy_extracted@spacepy-main@developer@scripts@rubber_seconds.py@.PATH_END.py |
{
"filename": "pdm.py",
"repo_name": "johnh2o2/cuvarbase",
"repo_path": "cuvarbase_extracted/cuvarbase-master/cuvarbase/pdm.py",
"type": "Python"
} | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from builtins import zip
from builtins import range
import numpy as np
import resource
import warnings
import pycuda.driver as cuda
import pycuda.gpuarray as gpuarray
from pycuda.compiler import SourceModule
... | johnh2o2REPO_NAMEcuvarbasePATH_START.@cuvarbase_extracted@cuvarbase-master@cuvarbase@pdm.py@.PATH_END.py |
{
"filename": "predict.py",
"repo_name": "ucl-exoplanets/ExoGAN_public",
"repo_path": "ExoGAN_public_extracted/ExoGAN_public-master/predict.py",
"type": "Python"
} | # Original Version: Taehoon Kim (http://carpedm20.github.io)
# + Source: https://github.com/carpedm20/DCGAN-tensorflow/blob/e30539fb5e20d5a0fed40935853da97e9e55eee8/model.py
# + License: MIT
# [2016-08-05] Modifications for Completion: Brandon Amos (http://bamos.github.io)
# + License: MIT
#
# [2017-11-02] Modif... | ucl-exoplanetsREPO_NAMEExoGAN_publicPATH_START.@ExoGAN_public_extracted@ExoGAN_public-master@predict.py@.PATH_END.py |
{
"filename": "testFit.py",
"repo_name": "IvS-KULeuven/IvSPythonRepository",
"repo_path": "IvSPythonRepository_extracted/IvSPythonRepository-master/sigproc/testFit.py",
"type": "Python"
} | """
Unit test covering sigproc.fit.py and sigproc.funclib.py
@author: Joris Vos
"""
import copy
import numpy as np
from ivs.sigproc import fit, lmfit, funclib
import unittest
try:
from mock import patch
noMock = False
except Exception:
noMock = True
class FitTestCase(unittest.TestCase):
def assertAr... | IvS-KULeuvenREPO_NAMEIvSPythonRepositoryPATH_START.@IvSPythonRepository_extracted@IvSPythonRepository-master@sigproc@testFit.py@.PATH_END.py |
{
"filename": "test_job.py",
"repo_name": "D-arioSpace/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/utils/tap/model/tests/test_job.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
=============
TAP plus
=============
@author: Juan Carlos Segovia
@contact: juan.carlos.segovia@sciops.esa.int
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
Created on 30 jun. 2016
"""
from pathlib import Path
import pytest
... | D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@utils@tap@model@tests@test_job.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/library/cpp/testing/gtest_main/README.md",
"type": "Markdown"
} | # Glue for `GTEST` macro
Provides `main` function. This library is automatically linked into any test binary that uses `GTEST`. This way, you don't have to implement `main` yourself every time you write a test target.
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@library@cpp@testing@gtest_main@README.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/layout/smith/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._domain import Domain
from ._imaginaryaxis import Imaginaryaxis
from ._realaxis import Realaxis
from . import imaginaryaxis
from . import realaxis
else:
from _plotly_utils.importers import relative_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@layout@smith@__init__.py@.PATH_END.py |
{
"filename": "file_editor_test.py",
"repo_name": "fchollet/keras",
"repo_path": "keras_extracted/keras-master/keras/src/saving/file_editor_test.py",
"type": "Python"
} | import os
import numpy as np
import pytest
import keras
from keras.src import testing
from keras.src.saving.file_editor import KerasFileEditor
def get_source_model():
inputs = keras.Input((2,))
x = keras.layers.Dense(3, name="mydense")(inputs)
outputs = keras.layers.Dense(3, name="output_layer")(x)
... | fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@saving@file_editor_test.py@.PATH_END.py |
{
"filename": "clik_smica_change_criterion.py",
"repo_name": "CosmoLike/cocoa",
"repo_path": "cocoa_extracted/cocoa-main/Cocoa/external_modules/code/planck/code/spt_clik/src/python/attic/clik_smica_change_criterion.py",
"type": "Python"
} | #! PYTHONEXE
import sys
sys.path = ["REPLACEPATH"]+sys.path
import numpy as nm
import clik.parobject as php
import clik
import clik.hpy as hpy
import clik.smicahlp as smh
def main(argv):
pars = clik.miniparse(argv[1])
inhf = hpy.File(pars.input_object)
assert inhf["clik/lkl_0"].attrs["lkl_type"].lower() == ... | CosmoLikeREPO_NAMEcocoaPATH_START.@cocoa_extracted@cocoa-main@Cocoa@external_modules@code@planck@code@spt_clik@src@python@attic@clik_smica_change_criterion.py@.PATH_END.py |
{
"filename": "AIDA_Settings.py",
"repo_name": "erikhom/aida",
"repo_path": "aida_extracted/aida-master/AIDA_Settings.py",
"type": "Python"
} | ################################################################################
#
# File: AIDA_Settings.py
#
# Summary: This file contains user-defined settings to run AIDA
# It can be copied elsewhere and called using the '-S'
# command line option, e.g.:
#
# ... | erikhomREPO_NAMEaidaPATH_START.@aida_extracted@aida-master@AIDA_Settings.py@.PATH_END.py |
{
"filename": "containers.py",
"repo_name": "transientskp/pyse",
"repo_path": "pyse_extracted/pyse-master/sourcefinder/utility/containers.py",
"type": "Python"
} | """
Container classes for the TKP pipeline.
These provide convenient means of marshalling the various types of data --
lightcurves, detections, sources, etc -- that the pipeline must handle.
"""
import logging
logger = logging.getLogger(__name__)
class ObjectContainer(list):
"""A container class for objects.
... | transientskpREPO_NAMEpysePATH_START.@pyse_extracted@pyse-master@sourcefinder@utility@containers.py@.PATH_END.py |
{
"filename": "AdvancedVisualization.ipynb",
"repo_name": "JustGlowing/minisom",
"repo_path": "minisom_extracted/minisom-master/examples/AdvancedVisualization.ipynb",
"type": "Jupyter Notebook"
} | In this notebook we will demonstrate some more advanced visualizations of MiniSom results.
```python
from minisom import MiniSom
```
For this example we will again load the <a href="https://archive.ics.uci.edu/ml/datasets/seeds">seeds</a> dataset dataset using pandas:
```python
import pandas as pd
import numpy as ... | JustGlowingREPO_NAMEminisomPATH_START.@minisom_extracted@minisom-master@examples@AdvancedVisualization.ipynb@.PATH_END.py |
{
"filename": "combine_noise_results.py",
"repo_name": "samuelyeewl/specmatch-emp",
"repo_path": "specmatch-emp_extracted/specmatch-emp-master/tests/combine_noise_results.py",
"type": "Python"
} | #!/usr/bin/env python
"""
@filename combine_noise_results.py
Combine results from internal cross-validation of library
"""
import pandas as pd
import numpy as np
from collections import defaultdict
from specmatchemp import library
from specmatchemp import specmatch
# Noise selection path
lst = '/home/syee/specmatch... | samuelyeewlREPO_NAMEspecmatch-empPATH_START.@specmatch-emp_extracted@specmatch-emp-master@tests@combine_noise_results.py@.PATH_END.py |
{
"filename": "catalog.py",
"repo_name": "hpparvi/MuSCAT2_transit_pipeline",
"repo_path": "MuSCAT2_transit_pipeline_extracted/MuSCAT2_transit_pipeline-master/muscat2ph/catalog.py",
"type": "Python"
} | # MuSCAT2 photometry and transit analysis pipeline
# Copyright (C) 2019 Hannu Parviainen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | hpparviREPO_NAMEMuSCAT2_transit_pipelinePATH_START.@MuSCAT2_transit_pipeline_extracted@MuSCAT2_transit_pipeline-master@muscat2ph@catalog.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "rapidsai/cuml",
"repo_path": "cuml_extracted/cuml-main/python/cuml/cuml/thirdparty_adapters/__init__.py",
"type": "Python"
} | # Copyright (c) 2020-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | rapidsaiREPO_NAMEcumlPATH_START.@cuml_extracted@cuml-main@python@cuml@cuml@thirdparty_adapters@__init__.py@.PATH_END.py |
{
"filename": "setup_2GC_CASA.py",
"repo_name": "IanHeywood/oxkat",
"repo_path": "oxkat_extracted/oxkat-master/waterhole/setup_2GC_CASA.py",
"type": "Python"
} | #!/usr/bin/env python
# ian.heywood@physics.ox.ac.uk
import glob
import json
import os.path as o
import sys
sys.path.append(o.abspath(o.join(o.dirname(sys.modules[__name__].__file__), "..")))
from oxkat import generate_jobs as gen
from oxkat import config as cfg
def main():
USE_SINGULARITY = cfg.USE_SINGULAR... | IanHeywoodREPO_NAMEoxkatPATH_START.@oxkat_extracted@oxkat-master@waterhole@setup_2GC_CASA.py@.PATH_END.py |
{
"filename": "core.py",
"repo_name": "jolideco/jolideco",
"repo_path": "jolideco_extracted/jolideco-main/jolideco/priors/patches/core.py",
"type": "Python"
} | import logging
from math import sqrt
import numpy as np
import torch
import torch.nn.functional as F
from astropy.convolution import Gaussian2DKernel
from astropy.utils import lazyproperty
from jolideco.priors.patches.gmm import GaussianMixtureModel
from jolideco.utils.norms import IdentityImageNorm, ImageNorm
from j... | jolidecoREPO_NAMEjolidecoPATH_START.@jolideco_extracted@jolideco-main@jolideco@priors@patches@core.py@.PATH_END.py |
{
"filename": "test_pinte_mono.py",
"repo_name": "cuDisc/cuDisc",
"repo_path": "cuDisc_extracted/cuDisc-main/tests/scripts/test_pinte_mono.py",
"type": "Python"
} | import os
from constants import *
from fileIO import *
import numpy as np
import matplotlib.pyplot as plt
print("Making and running test...\n")
os.system('cd ../../ && make -j test_pinte_graindist_mono')
os.system('../../test_pinte_graindist_mono')
sim1 = CuDiscModel("../outputs/pinte_mono/run_thick")
sim2 = CuDiscM... | cuDiscREPO_NAMEcuDiscPATH_START.@cuDisc_extracted@cuDisc-main@tests@scripts@test_pinte_mono.py@.PATH_END.py |
{
"filename": "test_agents.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/tests/server/models/test_agents.py",
"type": "Python"
} | from uuid import uuid4
import pendulum
import pytest
from sqlalchemy.exc import IntegrityError
from prefect.server import models, schemas
@pytest.fixture
async def work_queue(session):
work_queue = await models.work_queues.create_work_queue(
session=session,
work_queue=schemas.actions.WorkQueueC... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@tests@server@models@test_agents.py@.PATH_END.py |
{
"filename": "_colorbar.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/scatterternary/marker/_colorbar.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class ColorBar(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatterternary.marker"
_path_str = "scatterternary.marker.colorbar"
_valid_props = {
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@scatterternary@marker@_colorbar.py@.PATH_END.py |
{
"filename": "tool.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/tools/google_places/tool.py",
"type": "Python"
} | """Tool for the Google search API."""
from typing import Optional, Type
from langchain_core._api.deprecation import deprecated
from langchain_core.callbacks import CallbackManagerForToolRun
from langchain_core.tools import BaseTool
from pydantic import BaseModel, Field
from langchain_community.utilities.google_place... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@tools@google_places@tool.py@.PATH_END.py |
{
"filename": "queue_wrapper.py",
"repo_name": "ratt-ru/montblanc",
"repo_path": "montblanc_extracted/montblanc-master/montblanc/impl/rime/tensorflow/queue_wrapper.py",
"type": "Python"
} | import collections
import itertools
import sys
import six
import attridict as AttrDict
import tensorflow as tf
def _get_queue_types(fed_arrays, data_sources):
"""
Given a list of arrays to feed in fed_arrays, return
a list of associated queue types, obtained from tuples
in the data_sources dictionary... | ratt-ruREPO_NAMEmontblancPATH_START.@montblanc_extracted@montblanc-master@montblanc@impl@rime@tensorflow@queue_wrapper.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/funnelarea/hoverlabel/font/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._sizesrc import SizesrcValidator
from ._size import SizeValidator
from ._familysrc import FamilysrcValidator
from ._family import FamilyValidator
from ._colorsrc import ColorsrcValidator
from ._color import ColorValidator
else:
from _plotly_uti... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@funnelarea@hoverlabel@font@__init__.py@.PATH_END.py |
{
"filename": "2022_07_29_181111_905134444e17_add_index_to_flow_run_infrastructure_.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/prefect/server/database/_migrations/versions/sqlite/2022_07_29_181111_905134444e17_add_index_to_flow_run_infrastructure_.py",
"type": "Pytho... | """add-index-to-flow-run-infrastructure_document_id
Revision ID: 905134444e17
Revises: 88c2112b668f
Create Date: 2022-07-29 18:11:11.645359
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "905134444e17"
down_revision = "88c2112b668f"
branch_labels = None
depends_on = None
def upgrad... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@server@database@_migrations@versions@sqlite@2022_07_29_181111_905134444e17_add_index_to_flow_run_infrastructure_.py@.PATH_END.py |
{
"filename": "_labelsuffix.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/carpet/aaxis/_labelsuffix.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LabelsuffixValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="labelsuffix", parent_name="carpet.aaxis", **kwargs):
super(LabelsuffixValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@carpet@aaxis@_labelsuffix.py@.PATH_END.py |
{
"filename": "_templateitemname.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/contour/colorbar/tickformatstop/_templateitemname.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TemplateitemnameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="templateitemname",
parent_name="contour.colorbar.tickformatstop",
**kwargs,
):
super(TemplateitemnameValidator, self).__in... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@contour@colorbar@tickformatstop@_templateitemname.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "MazinLab/MKIDGen3",
"repo_path": "MKIDGen3_extracted/MKIDGen3-main/arduino/libraries/SdFat/README.md",
"type": "Markdown"
} | ### Warning: This is SdFat Version 2.
Earlier releases of Version 1 are here:
https://github.com/greiman/SdFat/releases
UTF-8 encoded filenames are supported in v2.1.0 or later.
Try the UnicodeFilenames example. Here is output from ls:
<pre>
Type any character to begin
ls:
0 😀/
20 россиянин
... | MazinLabREPO_NAMEMKIDGen3PATH_START.@MKIDGen3_extracted@MKIDGen3-main@arduino@libraries@SdFat@README.md@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "POSYDON-code/POSYDON",
"repo_path": "POSYDON_extracted/POSYDON-main/README.md",
"type": "Markdown"
} | # POSYDON
POSYDON is a next-generation single- and binary-star population synthesis framework, incorporating, fully self-consistent, state-of-the-art stellar structure and evolution modelling, using the [MESA](https://docs.mesastar.org) code, throughout the evolution of both binary components. This allows for a more a... | POSYDON-codeREPO_NAMEPOSYDONPATH_START.@POSYDON_extracted@POSYDON-main@README.md@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "nuc-astro/winnet",
"repo_path": "winnet_extracted/winnet-master/data/Example_data/Example_CCSN_wind_bliss/README.md",
"type": "Markdown"
} | ### Neutrino driven wind example
When using the data in this folder please read and cite the following literature.
#### Literature
- [Bliss J., Witt M., Arcones A., Montes F., Pereira J., 2018, ApJ, 855, 135. doi:10.3847/1538-4357/aaadbe](https://ui.adsabs.harvard.edu/abs/2018ApJ...855..135B/abstract)
#### Access lin... | nuc-astroREPO_NAMEwinnetPATH_START.@winnet_extracted@winnet-master@data@Example_data@Example_CCSN_wind_bliss@README.md@.PATH_END.py |
{
"filename": "_opacity.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattermapbox/unselected/marker/_opacity.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OpacityValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="opacity",
parent_name="scattermapbox.unselected.marker",
**kwargs,
):
super(OpacityValidator, self).__init__(
plotly_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattermapbox@unselected@marker@_opacity.py@.PATH_END.py |
{
"filename": "plot_likelihood_ratios.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/examples/model_selection/plot_likelihood_ratios.py",
"type": "Python"
} | """
=============================================================
Class Likelihood Ratios to measure classification performance
=============================================================
This example demonstrates the :func:`~sklearn.metrics.class_likelihood_ratios`
function, which computes the positive and negative... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@examples@model_selection@plot_likelihood_ratios.py@.PATH_END.py |
{
"filename": "datasets__msrank.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage-python/datasets__msrank.md",
"type": "Markdown"
} |
Load the [Microsoft Learning to Rank Dataset](https://www.microsoft.com/en-us/research/project/mslr/).
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage-python@datasets__msrank.md@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "SimonPfeifer/cows",
"repo_path": "cows_extracted/cows-master/setup.py",
"type": "Python"
} | #!/usr/bin/env python3
import io
import os
import platform
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import relpath
from os.path import splitext
from setuptools import Extension
from setuptools import find_packages
from setuptools im... | SimonPfeiferREPO_NAMEcowsPATH_START.@cows_extracted@cows-master@setup.py@.PATH_END.py |
{
"filename": "py_function_lib.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/compiler/mlir/quantization/tensorflow/python/py_function_lib.py",
"type": "Python"
} | # Copyright 2023 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@compiler@mlir@quantization@tensorflow@python@py_function_lib.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "GeminiDRSoftware/DRAGONS",
"repo_path": "DRAGONS_extracted/DRAGONS-master/geminidr/ghost/tests/slit/__init__.py",
"type": "Python"
} | import pytest
import datetime
from astropy.io import fits
import astrodata, gemini_instruments
from geminidr.ghost.polyfit.slitview import SlitView
from geminidr.ghost.lookups import polyfit_lookup
NO_SLITS = 10
EXPTIME_SLITS = 10.
SLIT_UT_START = datetime.datetime(2023, 3, 1, 0, 0)
STRFTIME = '%H:%M:%S.%f'
STRFDA... | GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@geminidr@ghost@tests@slit@__init__.py@.PATH_END.py |
{
"filename": "demo_FEA_tetra.py",
"repo_name": "projectchrono/chrono",
"repo_path": "chrono_extracted/chrono-main/src/demos/python/fea/demo_FEA_tetra.py",
"type": "Python"
} | # =============================================================================
# PROJECT CHRONO - http://projectchrono.org
#
# Copyright (c) 2024 projectchrono.org
# All rights reserved.
#
# Use of this source code is governed by a BSD-style license that can be found
# in the LICENSE file at the top level of the distr... | projectchronoREPO_NAMEchronoPATH_START.@chrono_extracted@chrono-main@src@demos@python@fea@demo_FEA_tetra.py@.PATH_END.py |
{
"filename": "bug_report.md",
"repo_name": "stammler/dustpy",
"repo_path": "dustpy_extracted/dustpy-master/.github/ISSUE_TEMPLATE/bug_report.md",
"type": "Markdown"
} | ---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior.
**Expected behavior**
A clear and concise description of what you expected to happen.
**So... | stammlerREPO_NAMEdustpyPATH_START.@dustpy_extracted@dustpy-master@.github@ISSUE_TEMPLATE@bug_report.md@.PATH_END.py |
{
"filename": "url.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/document_loaders/url.ipynb",
"type": "Jupyter Notebook"
} | # URL
This example covers how to load `HTML` documents from a list of `URLs` into the `Document` format that we can use downstream.
## Unstructured URL Loader
For the examples below, please install the `unstructured` library and see [this guide](/docs/integrations/providers/unstructured/) for more instructions on se... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@document_loaders@url.ipynb@.PATH_END.py |
{
"filename": "ensemble.py",
"repo_name": "dfm/emcee",
"repo_path": "emcee_extracted/emcee-main/src/emcee/ensemble.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
import warnings
from itertools import count
from typing import Dict, List, Optional, Union
import numpy as np
from .backends import Backend
from .model import Model
from .moves import StretchMove
from .pbar import get_progress_bar
from .state import State
from .utils import deprecated, deprec... | dfmREPO_NAMEemceePATH_START.@emcee_extracted@emcee-main@src@emcee@ensemble.py@.PATH_END.py |
{
"filename": "count_hurdle.ipynb",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/examples/notebooks/count_hurdle.ipynb",
"type": "Jupyter Notebook"
} | ## Hurdle and truncated count models
Author: Josef Perktold
Statsmodels has now hurdle and truncated count models, added in version 0.14.
A hurdle model is composed of a model for zeros and a model for the distribution for counts larger than zero. The zero model is a binary model for a count of zero versus larger th... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@examples@notebooks@count_hurdle.ipynb@.PATH_END.py |
{
"filename": "footprint_hsc_nep.py",
"repo_name": "HETDEX/elixer",
"repo_path": "elixer_extracted/elixer-main/elixer/footprint_hsc_nep.py",
"type": "Python"
} | #to use, pipe the output to some text file, then repalce hsc_meta.py with that text file
#NOTE: the last entry in the dictionary has a trailing comma ... need to remove that
"""
HSC_NEP
"""
from astropy.wcs import WCS
import astropy
import astropy.io.fits as fits
import argparse
import numpy as np
import os
import g... | HETDEXREPO_NAMEelixerPATH_START.@elixer_extracted@elixer-main@elixer@footprint_hsc_nep.py@.PATH_END.py |
{
"filename": "Taylor_1993_raw_to_yaml.py",
"repo_name": "NickSwainston/pulsar_spectra",
"repo_path": "pulsar_spectra_extracted/pulsar_spectra-main/pulsar_spectra/catalogue_papers/Taylor_1993_raw_to_yaml.py",
"type": "Python"
} | import json
import csv
with open("Taylor_1993_raw.tsv") as file:
tsv_file = csv.reader(file, delimiter="\t")
lines = []
for line in tsv_file:
lines.append(line)
print(lines)
pulsar_dict = {}
for row in lines:
row = [r.strip() for r in row]
if len(row) == 0:
continue
if row[0].s... | NickSwainstonREPO_NAMEpulsar_spectraPATH_START.@pulsar_spectra_extracted@pulsar_spectra-main@pulsar_spectra@catalogue_papers@Taylor_1993_raw_to_yaml.py@.PATH_END.py |
{
"filename": "base.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/text-splitters/langchain_text_splitters/base.py",
"type": "Python"
} | from __future__ import annotations
import copy
import logging
from abc import ABC, abstractmethod
from dataclasses import dataclass
from enum import Enum
from typing import (
AbstractSet,
Any,
Callable,
Collection,
Iterable,
List,
Literal,
Optional,
Sequence,
Type,
TypeVar,
... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@text-splitters@langchain_text_splitters@base.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scikit-learn/py2/sklearn/linear_model/setup.py",
"type": "Python"
} | import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('linear_model', parent_package, top_path)
cblas_libs, blas_info = get_blas_info... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scikit-learn@py2@sklearn@linear_model@setup.py@.PATH_END.py |
{
"filename": "munge.py",
"repo_name": "gmbrandt/xwavecal",
"repo_path": "xwavecal_extracted/xwavecal-main/xwavecal/munge.py",
"type": "Python"
} | """
Module for rotating and flipping frames
This is to make frames such that the mean wavelengths of the diffraction orders increase
from left to right (e.g bluest horizontal coordinate is x=0 and reddest is x=4096)
and increase from top to bottom (e.g. bluest vertical coordinate is y=4096 and reddest is y=0).
"""
im... | gmbrandtREPO_NAMExwavecalPATH_START.@xwavecal_extracted@xwavecal-main@xwavecal@munge.py@.PATH_END.py |
{
"filename": "beat_frequencies.ipynb",
"repo_name": "exoclam/gaspery",
"repo_path": "gaspery_extracted/gaspery-main/tutorials/beat_frequencies.ipynb",
"type": "Jupyter Notebook"
} | ### Tutorial: Beat Frequencies
The reason why we have to optimize our observing strategy is aliasing. Aliasing is when two signals overlap because one is at an integer ratio or multiple frequency of the other. When this happens, it's difficult to tease out whether an observed signal is due to one or the other. Beat fr... | exoclamREPO_NAMEgasperyPATH_START.@gaspery_extracted@gaspery-main@tutorials@beat_frequencies.ipynb@.PATH_END.py |
{
"filename": "initialise.py",
"repo_name": "fkoehlin/montepython_2cosmos_public",
"repo_path": "montepython_2cosmos_public_extracted/montepython_2cosmos_public-master/montepython/initialise.py",
"type": "Python"
} | """
.. module:: initialise
:synopsis: intialisation
.. moduleauthor:: Benjamin Audren <benjamin.audren@epfl.ch>
"""
from __future__ import print_function
import io_mp
import parser_mp # parsing the input command line
from data import Data
import sys
import os
from io_mp import dictitems,dictvalues,dictkeys
def ... | fkoehlinREPO_NAMEmontepython_2cosmos_publicPATH_START.@montepython_2cosmos_public_extracted@montepython_2cosmos_public-master@montepython@initialise.py@.PATH_END.py |
{
"filename": "cond_v2_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/kernel_tests/control_flow/cond_v2_test.py",
"type": "Python"
} | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@kernel_tests@control_flow@cond_v2_test.py@.PATH_END.py |
{
"filename": "esd.py",
"repo_name": "spedas/pyspedas",
"repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/themis/spacecraft/particles/esd.py",
"type": "Python"
} | # Hacked from esa.py, for esd 3d L2 data files
from pyspedas.projects.themis.load import load
def esd(trange=['2021-03-23', '2021-03-24'],
probe='c',
level='l2', #Kept here, but 'l2' is hardcoded in load.py
datatype = 'peif', #ESD datatypes are in separate files
suffix='',
get_... | spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@themis@spacecraft@particles@esd.py@.PATH_END.py |
{
"filename": "policies.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/prefect/server/orchestration/policies.py",
"type": "Python"
} | """
Policies are collections of orchestration rules and transforms.
Prefect implements (most) orchestration with logic that governs a Prefect flow or task
changing state. Policies organize of orchestration logic both to provide an ordering
mechanism as well as provide observability into the orchestration process.
Whi... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@server@orchestration@policies.py@.PATH_END.py |
{
"filename": "reader_ops_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/kernel_tests/io_ops/reader_ops_test.py",
"type": "Python"
} | # Copyright 2015 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@kernel_tests@io_ops@reader_ops_test.py@.PATH_END.py |
{
"filename": "constants.py",
"repo_name": "mikekatz04/LISAanalysistools",
"repo_path": "LISAanalysistools_extracted/LISAanalysistools-main/lisatools/utils/constants.py",
"type": "Python"
} | MSUN_SI = 1.98848e30
YRSID_SI = 31558149.763545603
AU_SI = 149597870700.0
C_SI = 299792458.0
G_SI = 6.674080e-11
GMSUN = 1.3271244210789466e20
MTSUN_SI = 4.925491025873693e-06
MRSUN_SI = 1476.6250615036158
PC_SI = 3.0856775814913674e16
PI = 3.141592653589793238462643383279502884
PI_2 = 1.5707963267948966192313216916397... | mikekatz04REPO_NAMELISAanalysistoolsPATH_START.@LISAanalysistools_extracted@LISAanalysistools-main@lisatools@utils@constants.py@.PATH_END.py |
{
"filename": "test_widget_float.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/ipywidgets/py3/ipywidgets/widgets/tests/test_widget_float.py",
"type": "Python"
} | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from unittest import TestCase
from traitlets import TraitError
from ipywidgets import FloatSlider
class TestFloatSlider(TestCase):
def test_construction(self):
FloatSlider()
def test_construction_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipywidgets@py3@ipywidgets@widgets@tests@test_widget_float.py@.PATH_END.py |
{
"filename": "_nticks.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/ternary/baxis/_nticks.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NticksValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="nticks", parent_name="layout.ternary.baxis", **kwargs
):
super(NticksValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@ternary@baxis@_nticks.py@.PATH_END.py |
{
"filename": "test_image_collection.py",
"repo_name": "astropy/ccdproc",
"repo_path": "ccdproc_extracted/ccdproc-main/ccdproc/tests/test_image_collection.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import logging
import os
from glob import iglob
from pathlib import Path
from shutil import rmtree
from tempfile import NamedTemporaryFile, TemporaryDirectory, mkdtemp
import astropy.io.fits as fits
import numpy as np
import pytest
from astropy.io.fits.v... | astropyREPO_NAMEccdprocPATH_START.@ccdproc_extracted@ccdproc-main@ccdproc@tests@test_image_collection.py@.PATH_END.py |
{
"filename": "xgboost_early_stopping.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/benchmarks/kaggle/rossmann-store-sales/xgboost_early_stopping.py",
"type": "Python"
} | #!/usr/bin/env python
import os.path
import config
import experiment_lib
import xgboost as xgb
class XGBoostExperimentEarlyStopping(experiment_lib.ExperimentEarlyStopping):
def __init__(self, **kwargs):
super(XGBoostExperimentEarlyStopping, self).__init__(**kwargs)
def get_estimator(self, cat_col... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@benchmarks@kaggle@rossmann-store-sales@xgboost_early_stopping.py@.PATH_END.py |
{
"filename": "W05ElectricFields.py",
"repo_name": "nu-radio/NuRadioMC",
"repo_path": "NuRadioMC_extracted/NuRadioMC-master/NuRadioMC/examples/06_webinar/W05ElectricFields.py",
"type": "Python"
} | from NuRadioReco.utilities import units
from NuRadioMC.SignalGen.askaryan import get_time_trace, get_frequency_spectrum
import matplotlib.pyplot as plt
import numpy as np
"""
This file shows how to use the electric field modules for standalone calculations.
First we start defining all the input parameters for the func... | nu-radioREPO_NAMENuRadioMCPATH_START.@NuRadioMC_extracted@NuRadioMC-master@NuRadioMC@examples@06_webinar@W05ElectricFields.py@.PATH_END.py |
{
"filename": "cauchy.py",
"repo_name": "jax-ml/jax",
"repo_path": "jax_extracted/jax-main/jax/_src/scipy/stats/cauchy.py",
"type": "Python"
} | # Copyright 2018 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@stats@cauchy.py@.PATH_END.py |
{
"filename": "test_ia_model_components.py",
"repo_name": "astropy/halotools",
"repo_path": "halotools_extracted/halotools-master/halotools/empirical_models/ia_models/tests/test_ia_model_components.py",
"type": "Python"
} | import numpy as np
from ..ia_model_components import RandomAlignment, CentralAlignment, SatelliteAlignment, RadialSatelliteAlignment, SubhaloAlignment
from ..ia_model_components import axes_correlated_with_z, axes_correlated_with_input_vector, is_z
from astropy.table import Table
from ....utils.mcrotations import rotat... | astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@halotools@empirical_models@ia_models@tests@test_ia_model_components.py@.PATH_END.py |
{
"filename": "_column.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/parcoords/domain/_column.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColumnValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(self, plotly_name="column", parent_name="parcoords.domain", **kwargs):
super(ColumnValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@parcoords@domain@_column.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.