metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "conftest.py",
"repo_name": "numpy/numpy",
"repo_path": "numpy_extracted/numpy-main/doc/conftest.py",
"type": "Python"
} | """
Pytest configuration and fixtures for the Numpy test suite.
"""
import pytest
import numpy
import matplotlib
import doctest
matplotlib.use('agg', force=True)
# Ignore matplotlib output such as `<matplotlib.image.AxesImage at
# 0x7f956908c280>`. doctest monkeypatching inspired by
# https://github.com/wooyek/pytest... | numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@doc@conftest.py@.PATH_END.py |
{
"filename": "_reversescale.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterpolargl/marker/line/_reversescale.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ReversescaleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name="reversescale",
parent_name="scatterpolargl.marker.line",
**kwargs,
):
super(ReversescaleValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterpolargl@marker@line@_reversescale.py@.PATH_END.py |
{
"filename": "waveforms_start.ipynb",
"repo_name": "gwastro/PyCBC-Tutorials",
"repo_path": "PyCBC-Tutorials_extracted/PyCBC-Tutorials-master/examples/waveforms_start.ipynb",
"type": "Jupyter Notebook"
} | ### Generate the gravitational-wave waveform for a binary merger ###
```python
# Install the software we need
import sys
!{sys.executable} -m pip install pycbc ligo-common --no-cache-dir
```
Requirement already satisfied: pycbc in /home/nbuser/anaconda2_501/lib/python2.7/site-packages (1.13.5)
Requirement al... | gwastroREPO_NAMEPyCBC-TutorialsPATH_START.@PyCBC-Tutorials_extracted@PyCBC-Tutorials-master@examples@waveforms_start.ipynb@.PATH_END.py |
{
"filename": "multiclass.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scikit-learn/py2/sklearn/utils/multiclass.py",
"type": "Python"
} |
# Author: Arnaud Joly, Joel Nothman, Hamzeh Alsalhi
#
# License: BSD 3 clause
"""
Multi-class / multi-label utility function
==========================================
"""
from __future__ import division
from collections import Sequence
from itertools import chain
from scipy.sparse import issparse
from scipy.sparse.... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scikit-learn@py2@sklearn@utils@multiclass.py@.PATH_END.py |
{
"filename": "test_decode.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/simplejson/py3/simplejson/tests/test_decode.py",
"type": "Python"
} | from __future__ import absolute_import
import decimal
from unittest import TestCase
import sys
import simplejson as json
from simplejson.compat import StringIO, b, binary_type
from simplejson import OrderedDict
class MisbehavingBytesSubtype(binary_type):
def decode(self, encoding=None):
return "bad decode... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@simplejson@py3@simplejson@tests@test_decode.py@.PATH_END.py |
{
"filename": "sampler.py",
"repo_name": "JulianBMunoz/21cmvFAST",
"repo_path": "21cmvFAST_extracted/21cmvFAST-master/public_21CMvFAST_MC/Programs/CosmoHammer_21CMMC/emcee/sampler.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The base sampler class implementing various helpful functions.
"""
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__all__ = ["Sampler"]
import numpy as np
try:
import acor
acor = acor
except Impo... | JulianBMunozREPO_NAME21cmvFASTPATH_START.@21cmvFAST_extracted@21cmvFAST-master@public_21CMvFAST_MC@Programs@CosmoHammer_21CMMC@emcee@sampler.py@.PATH_END.py |
{
"filename": "config_tests.py",
"repo_name": "swagnercarena/paltas",
"repo_path": "paltas_extracted/paltas-main/test/config_tests.py",
"type": "Python"
} | import unittest
from paltas.Utils import cosmology_utils, hubble_utils
from paltas.Configs import config_handler
import paltas
import numpy as np
from lenstronomy.LensModel.lens_model import LensModel
from lenstronomy.PointSource.point_source import PointSource
from scipy.signal import fftconvolve
from paltas.Sources.c... | swagnercarenaREPO_NAMEpaltasPATH_START.@paltas_extracted@paltas-main@test@config_tests.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/candlestick/decreasing/line/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="candlestick.decreasing.line", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@candlestick@decreasing@line@_color.py@.PATH_END.py |
{
"filename": "05_Supervised_ML_1_intro.ipynb",
"repo_name": "astro-datalab/notebooks-latest",
"repo_path": "notebooks-latest_extracted/notebooks-latest-master/06_EPO/LaSerenaSchoolForDataScience/2019/05_Supervised_ML_I/05_Supervised_ML_1_intro.ipynb",
"type": "Jupyter Notebook"
} | ```python
__author__ = 'Guillermo Damke <gdamke@gmail.com>, Francisco Förster <francisco.forster@gmail.com>, Alice Jacques <alice.jacques@noirlab.edu>'
__version__ = '20210119' # yyyymmdd;
__datasets__ = ['Iris flower dataset']
__keywords__ = ['Introduction to Machine Learning', 'Supervised Machine Learning', 'La Seren... | astro-datalabREPO_NAMEnotebooks-latestPATH_START.@notebooks-latest_extracted@notebooks-latest-master@06_EPO@LaSerenaSchoolForDataScience@2019@05_Supervised_ML_I@05_Supervised_ML_1_intro.ipynb@.PATH_END.py |
{
"filename": "SolutionGUI.py",
"repo_name": "wmpg/Supracenter",
"repo_path": "Supracenter_extracted/Supracenter-master/supra/GUI/Dialogs/SolutionGUI.py",
"type": "Python"
} | ################################################
# Credits:
# Peter Brown - Supervisor
# Luke McFadden - General coding
# Denis Vida - Ballistic code, WMPL
# Wayne Edwards - Supracenter code
# Elizabeth Silber - Updated Supracenter code, Geminus
# Gunter Stober - Advice on atmospheric profiles
# Stack Overflow - Freque... | wmpgREPO_NAMESupracenterPATH_START.@Supracenter_extracted@Supracenter-master@supra@GUI@Dialogs@SolutionGUI.py@.PATH_END.py |
{
"filename": "testPythonExtension.py",
"repo_name": "CRPropa/CRPropa3",
"repo_path": "CRPropa3_extracted/CRPropa3-master/test/testPythonExtension.py",
"type": "Python"
} | import sys
try:
import unittest
except:
print("***********************************************************")
print("* WARNING!! Couldn't import python unittesting framework! *")
print("* No python tests have been executed *")
print("*********************************************... | CRPropaREPO_NAMECRPropa3PATH_START.@CRPropa3_extracted@CRPropa3-master@test@testPythonExtension.py@.PATH_END.py |
{
"filename": "test_html.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/astropy/cosmology/_io/tests/test_html.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import astropy.units as u
from astropy.cosmology._io.html import _FORMAT_TABLE, read_html_table, write_html_table
from astropy.table import QTable, Table, vstack
from astropy.utils.compat.optional_deps import HAS_BS4
from .base import Read... | astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@cosmology@_io@tests@test_html.py@.PATH_END.py |
{
"filename": "numpy_binary.py",
"repo_name": "CEA-COSMIC/pysap",
"repo_path": "pysap_extracted/pysap-master/pysap/base/loaders/numpy_binary.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
##########################################################################
# pySAP - Copyright (C) CEA, 2017 - 2018
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-e... | CEA-COSMICREPO_NAMEpysapPATH_START.@pysap_extracted@pysap-master@pysap@base@loaders@numpy_binary.py@.PATH_END.py |
{
"filename": "stats.py",
"repo_name": "ebachelet/pyLIMA",
"repo_path": "pyLIMA_extracted/pyLIMA-master/pyLIMA/fits/stats.py",
"type": "Python"
} | import numpy as np
import scipy.stats as ss
def normal_Kolmogorov_Smirnov(sample):
"""The moon illumination expressed as a percentage.
:param astropy sun: the sun ephemeris
:param astropy moon: the moon ephemeris
:return: a numpy array like indicated the moon illu... | ebacheletREPO_NAMEpyLIMAPATH_START.@pyLIMA_extracted@pyLIMA-master@pyLIMA@fits@stats.py@.PATH_END.py |
{
"filename": "transformer_deformable.py",
"repo_name": "Nikhel1/Gal-DINO",
"repo_path": "Gal-DINO_extracted/Gal-DINO-main/models/dino/transformer_deformable.py",
"type": "Python"
} | # ------------------------------------------------------------------------
# DINO
# Copyright (c) 2022 IDEA. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# ------------------------------------------------------------------------
# Deformable DETR
# Copyright (c) 2020 S... | Nikhel1REPO_NAMEGal-DINOPATH_START.@Gal-DINO_extracted@Gal-DINO-main@models@dino@transformer_deformable.py@.PATH_END.py |
{
"filename": "tutorial.ipynb",
"repo_name": "joe-antognini/kozai",
"repo_path": "kozai_extracted/kozai-master/docs/tutorial.ipynb",
"type": "Jupyter Notebook"
} | # A stroll through the `kozai` python package
## Installation
The `kozai` package is available on PyPI and can be installed with `pip` like so:
```
pip install kozai
```
If you don't have the right permissions, try installing it like this:
```
pip install --user kozai
```
If you run into problems with the package... | joe-antogniniREPO_NAMEkozaiPATH_START.@kozai_extracted@kozai-master@docs@tutorial.ipynb@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "jax-ml/jax",
"repo_path": "jax_extracted/jax-main/jax/_src/third_party/README.md",
"type": "Markdown"
} | This sub-directory contains third-party code for which Google does not have
copyright. Each sub-directory should correspond to a third-party library and
must contain the appropriate LICENSE file.
See [instructions](https://opensource.google/docs/releasing/preparing/#third-party-components).
| jax-mlREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@_src@third_party@README.md@.PATH_END.py |
{
"filename": "compute_second_order_aperture_mass_correlations_MS_shapenoise.py",
"repo_name": "sheydenreich/threepoint",
"repo_path": "threepoint_extracted/threepoint-main/python_scripts/old/compute_second_order_aperture_mass_correlations_MS_shapenoise.py",
"type": "Python"
} | from matplotlib import use
from file_loader import get_gamma_millennium_shapenoise
from utility import aperture_mass_computer,extract_second_order_aperture_masses_of_field
import numpy as np
import sys
from tqdm import tqdm
import multiprocessing.managers
from multiprocessing import Pool
from astropy.io import fits
imp... | sheydenreichREPO_NAMEthreepointPATH_START.@threepoint_extracted@threepoint-main@python_scripts@old@compute_second_order_aperture_mass_correlations_MS_shapenoise.py@.PATH_END.py |
{
"filename": "_namelengthsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/histogram2d/hoverlabel/_namelengthsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="namelengthsrc",
parent_name="histogram2d.hoverlabel",
**kwargs,
):
super(NamelengthsrcValidator, self).__init__(
plo... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@histogram2d@hoverlabel@_namelengthsrc.py@.PATH_END.py |
{
"filename": "_text.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter3d/marker/colorbar/title/_text.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="text",
parent_name="scatter3d.marker.colorbar.title",
**kwargs,
):
super(TextValidator, self).__init__(
plotly_name=plotly... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter3d@marker@colorbar@title@_text.py@.PATH_END.py |
{
"filename": "ovd_360.py",
"repo_name": "dazhiUBC/SCUBA2_MF",
"repo_path": "SCUBA2_MF_extracted/SCUBA2_MF-main/blank/ovd_360.py",
"type": "Python"
} | import pandas as pd
from MF import *
from astropy.coordinates import SkyCoord
ntrials = 10000 # number of mock maps
def read_ca(fname):
cata = pd.read_csv(fname,delimiter= ' ' )
f = cata['flux'] # flux
e = cata['err'] # err
c = SkyCoord(ra=cata['ra'],dec=cata['dec'],unit=(u.hourangle, u.deg)) # coordi... | dazhiUBCREPO_NAMESCUBA2_MFPATH_START.@SCUBA2_MF_extracted@SCUBA2_MF-main@blank@ovd_360.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "ratt-ru/eidos",
"repo_path": "eidos_extracted/eidos-master/eidos/__init__.py",
"type": "Python"
} | ratt-ruREPO_NAMEeidosPATH_START.@eidos_extracted@eidos-master@eidos@__init__.py@.PATH_END.py | |
{
"filename": "_size.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/barpolar/hoverlabel/font/_size.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="size", parent_name="barpolar.hoverlabel.font", **kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@barpolar@hoverlabel@font@_size.py@.PATH_END.py |
{
"filename": "_tickformatstopdefaults.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/polar/angularaxis/_tickformatstopdefaults.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickformatstopdefaultsValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self,
plotly_name="tickformatstopdefaults",
parent_name="layout.polar.angularaxis",
**kwargs,
):
super(TickformatstopdefaultsValidato... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@polar@angularaxis@_tickformatstopdefaults.py@.PATH_END.py |
{
"filename": "test_overwrite.py",
"repo_name": "aewallin/allantools",
"repo_path": "allantools_extracted/allantools-master/tests/functional_tests/test_overwrite.py",
"type": "Python"
} | #!/usr/bin/python
import sys
sys.path.append("..")
import allantools as at
import numpy
import pytest
def test_overwrite():
""" Tests if data is overwritten as pointed out in issue
https://github.com/aewallin/allantools/issues/76
"""
x1 = at.noise.white(num_points=1024)
x2 = at.noise.pink(num_po... | aewallinREPO_NAMEallantoolsPATH_START.@allantools_extracted@allantools-master@tests@functional_tests@test_overwrite.py@.PATH_END.py |
{
"filename": "test_Smoothing.py",
"repo_name": "sambit-giri/tools21cm",
"repo_path": "tools21cm_extracted/tools21cm-master/tests/test_Smoothing.py",
"type": "Python"
} | import numpy as np
import tools21cm as t2c
data = np.zeros((9,9,9))
data[4,4,4] = 1
def test_smooth_coeval():
'''
With this, smooth_coeval_gauss, smooth_coeval_tophat, gauss_kernel and tophat_kernel
are also tested.
'''
smt = t2c.smooth_coeval(data, 9, box_size_mpc=90)
assert smt[4,4,4]<1
def test_interpolat... | sambit-giriREPO_NAMEtools21cmPATH_START.@tools21cm_extracted@tools21cm-master@tests@test_Smoothing.py@.PATH_END.py |
{
"filename": "test_trig.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/special/tests/test_trig.py",
"type": "Python"
} | import numpy as np
from numpy.testing import assert_equal, assert_allclose, suppress_warnings
from scipy.special._ufuncs import _sinpi as sinpi
from scipy.special._ufuncs import _cospi as cospi
def test_integer_real_part():
x = np.arange(-100, 101)
y = np.hstack((-np.linspace(310, -30, 10), np.linspace(-30, ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@special@tests@test_trig.py@.PATH_END.py |
{
"filename": "test_physical_numpyfuncs.py",
"repo_name": "juliotux/astropop",
"repo_path": "astropop_extracted/astropop-main/tests/test_physical_numpyfuncs.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# flake8: noqa: F403, F405
import numpy as np
import pytest
from astropop.math.physical import QFloat, UnitsError, units
from packaging import version
from astropop.testing import *
# Testing qfloat compatibility with Numpy ufuncs and array functions.
... | juliotuxREPO_NAMEastropopPATH_START.@astropop_extracted@astropop-main@tests@test_physical_numpyfuncs.py@.PATH_END.py |
{
"filename": "test_logger.py",
"repo_name": "crossbario/crossbar",
"repo_path": "crossbar_extracted/crossbar-master/crossbar/test/test_logger.py",
"type": "Python"
} | #####################################################################################
#
# Copyright (c) typedef int GmbH
# SPDX-License-Identifier: EUPL-1.2
#
#####################################################################################
import json
from io import StringIO as NativeStringIO
from io import S... | crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@crossbar@test@test_logger.py@.PATH_END.py |
{
"filename": "_colorscale.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter3d/marker/line/_colorscale.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorscaleValidator(_plotly_utils.basevalidators.ColorscaleValidator):
def __init__(
self, plotly_name="colorscale", parent_name="scatter3d.marker.line", **kwargs
):
super(ColorscaleValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter3d@marker@line@_colorscale.py@.PATH_END.py |
{
"filename": "ex_univar_kde.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/examples/ex_univar_kde.py",
"type": "Python"
} | """
This example tests the nonparametric estimator
for several popular univariate distributions with the different
bandwidth selction methods - CV-ML; CV-LS; Scott's rule of thumb.
Produces six different plots for each distribution
1) Beta
2) f
3) Pareto
4) Laplace
5) Weibull
6) Poisson
"""
import numpy as np
impor... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@examples@ex_univar_kde.py@.PATH_END.py |
{
"filename": "extract_message.py",
"repo_name": "PX4/pyulog",
"repo_path": "pyulog_extracted/pyulog-main/pyulog/extract_message.py",
"type": "Python"
} | """
Extract values from a ULog file message to use in scripting
"""
import numpy as np
from .core import ULog
def extract_message(ulog_file_name: str, message: str,
time_s: "int | None" = None, time_e: "int | None" = None,
disable_str_exceptions: bool = False) -> list[dict]:
... | PX4REPO_NAMEpyulogPATH_START.@pyulog_extracted@pyulog-main@pyulog@extract_message.py@.PATH_END.py |
{
"filename": "followup.py",
"repo_name": "gwastro/pycbc",
"repo_path": "pycbc_extracted/pycbc-master/pycbc/results/followup.py",
"type": "Python"
} | # Copyright (C) 2014 Alex Nitz
#
# 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
# option) any later version.
#
# This program is distributed in the ... | gwastroREPO_NAMEpycbcPATH_START.@pycbc_extracted@pycbc-master@pycbc@results@followup.py@.PATH_END.py |
{
"filename": "octoai_endpoint.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/llms/octoai_endpoint.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.llms import OctoAIEndpoint
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@llms@octoai_endpoint.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "dealii/dealii",
"repo_path": "dealii_extracted/dealii-master/bundled/README.md",
"type": "Markdown"
} | This folder contains third party projects bundled with deal.II
==============================================================
**Please note that these projects are copyrighted by others than the deal.II
authors, but are included by permission. For details, consult the stated
licenses below.**
Below is a detailed list... | dealiiREPO_NAMEdealiiPATH_START.@dealii_extracted@dealii-master@bundled@README.md@.PATH_END.py |
{
"filename": "mocklc.py",
"repo_name": "hpparvi/MuSCAT2_transit_pipeline",
"repo_path": "MuSCAT2_transit_pipeline_extracted/MuSCAT2_transit_pipeline-master/muscat2ta/mocklc.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@muscat2ta@mocklc.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "pennucci/PulsePortraiture",
"repo_path": "PulsePortraiture_extracted/PulsePortraiture-master/setup.py",
"type": "Python"
} | #!/usr/bin/env python
from distutils.core import setup
setup(name='PulsePortraiture',
version='0.0',
description='Data analysis package for wideband pulsar timing',
author='Tim Pennucci',
author_email='tim.pennucci@nanograv.org',
url='http://github.com/pennucci/PulsePortraiture',
p... | pennucciREPO_NAMEPulsePortraiturePATH_START.@PulsePortraiture_extracted@PulsePortraiture-master@setup.py@.PATH_END.py |
{
"filename": "test_image_data_probe.py",
"repo_name": "enthought/mayavi",
"repo_path": "mayavi_extracted/mayavi-master/integrationtests/mayavi/test_image_data_probe.py",
"type": "Python"
} | """Simple test for the ImageDataProbe filter.
"""
# Author: Prabhu Ramachandran <prabhu [at] aero . iitb . ac . in>
# Copyright (c) 2008, Enthought, Inc.
# License: BSD Style.
# Standard library imports.
from os.path import abspath
from io import BytesIO
import copy
# Local imports.
from common import TestCase, get_... | enthoughtREPO_NAMEmayaviPATH_START.@mayavi_extracted@mayavi-master@integrationtests@mayavi@test_image_data_probe.py@.PATH_END.py |
{
"filename": "numpycompat.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/utils/compat/numpycompat.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This is a collection of monkey patches and workarounds for bugs in
earlier versions of Numpy.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from ...utils import minversion
__all__ = [... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@utils@compat@numpycompat.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "spacetelescope/imexam",
"repo_path": "imexam_extracted/imexam-master/imexam/__init__.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
An Astropy affiliated package to help perform image examination through a
viewing tool, like DS9
"""
# Affiliated packages may add whatever they like to this file, but
# should keep this content at the top.
# -----------------------------------------... | spacetelescopeREPO_NAMEimexamPATH_START.@imexam_extracted@imexam-master@imexam@__init__.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "theonefromnowhere/FitCov",
"repo_path": "FitCov_extracted/FitCov-main/setup.py",
"type": "Python"
} | import setuptools
import os
import sys
long_description = 'FitCov'
package_basedir = os.path.abspath(os.path.dirname(__file__))
package_basename = 'FitCov'
sys.path.insert(0, os.path.join(package_basedir, package_basename))
if __name__ == '__main__':
setuptools.setup(
name="FitCov",
version="... | theonefromnowhereREPO_NAMEFitCovPATH_START.@FitCov_extracted@FitCov-main@setup.py@.PATH_END.py |
{
"filename": "testdata.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/sandbox/nonparametric/testdata.py",
"type": "Python"
} | """
Created on Fri Mar 04 07:36:28 2011
@author: Mike
"""
import numpy as np
class kdetest:
Hpi = np.matrix([[ 0.05163034, 0.5098923 ],
[0.50989228, 8.8822365 ]])
faithfulData = dict(
eruptions=[
3.6, 1.8, 3.333, 2.283, 4.533, 2.883, 4.7, 3.6, 1.95, 4.35, 1.833, 3.917,
... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@sandbox@nonparametric@testdata.py@.PATH_END.py |
{
"filename": "04_B_train_on_data.py",
"repo_name": "gully/blase",
"repo_path": "blase_extracted/blase-main/experiments/04_full_bandwidth_HPF/04_B_train_on_data.py",
"type": "Python"
} | import os
import torch
from torch import nn
from tqdm import trange
import torch.optim as optim
from blase.emulator import SparsePhoenixEmulator
import matplotlib.pyplot as plt
from gollum.phoenix import PHOENIXSpectrum
import numpy as np
from muler.hpf import HPFSpectrumList, HPFSpectrum
import copy
import astropy.uni... | gullyREPO_NAMEblasePATH_START.@blase_extracted@blase-main@experiments@04_full_bandwidth_HPF@04_B_train_on_data.py@.PATH_END.py |
{
"filename": "_weight.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/splom/hoverlabel/font/_weight.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WeightValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="weight", parent_name="splom.hoverlabel.font", **kwargs
):
super(WeightValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@splom@hoverlabel@font@_weight.py@.PATH_END.py |
{
"filename": "fit_fhhe.py",
"repo_name": "cpiaulet/smint",
"repo_path": "smint_extracted/smint-master/smint/fit_fhhe.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 1 11:52:50 2020
@author: caroline
Estimate gas-to-core mass ratio based on the Lopez & Fortney 2014
models based on planet mass, radius, insolation and system age
Utilities functions
"""
# Import modules ----------
import numpy as np
from scipy.interpolate import Reg... | cpiauletREPO_NAMEsmintPATH_START.@smint_extracted@smint-master@smint@fit_fhhe.py@.PATH_END.py |
{
"filename": "_colorsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/box/hoverlabel/font/_colorsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="colorsrc", parent_name="box.hoverlabel.font", **kwargs
):
super(ColorsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@box@hoverlabel@font@_colorsrc.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "lucabaldini/ixpeobssim",
"repo_path": "ixpeobssim_extracted/ixpeobssim-main/ixpeobssim/targets/__init__.py",
"type": "Python"
} | lucabaldiniREPO_NAMEixpeobssimPATH_START.@ixpeobssim_extracted@ixpeobssim-main@ixpeobssim@targets@__init__.py@.PATH_END.py | |
{
"filename": "_scatterpolar.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/layout/template/data/_scatterpolar.py",
"type": "Python"
} | from plotly.graph_objs import Scatterpolar
| plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@layout@template@data@_scatterpolar.py@.PATH_END.py |
{
"filename": "retrieval_result.py",
"repo_name": "ideasrule/platon",
"repo_path": "platon_extracted/platon-master/platon/retrieval_result.py",
"type": "Python"
} | import numpy as np
class RetrievalResult:
def __init__(self, results, retrieval_type, best_fit_params,
transit_bins=None, transit_depths=None, transit_errors=None,
eclipse_bins=None, eclipse_depths=None, eclipse_errors=None,
best_fit_transit_depths=None, best_fit_... | ideasruleREPO_NAMEplatonPATH_START.@platon_extracted@platon-master@platon@retrieval_result.py@.PATH_END.py |
{
"filename": "test_reordering.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/sparse/csgraph/tests/test_reordering.py",
"type": "Python"
} | import numpy as np
from numpy.testing import assert_equal
from scipy.sparse.csgraph import reverse_cuthill_mckee, structural_rank
from scipy.sparse import csc_array, csr_array, coo_array
def test_graph_reverse_cuthill_mckee():
A = np.array([[1, 0, 0, 0, 1, 0, 0, 0],
[0, 1, 1, 0, 0, 1, 0, 1],
... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@sparse@csgraph@tests@test_reordering.py@.PATH_END.py |
{
"filename": "fit.py",
"repo_name": "veusz/veusz",
"repo_path": "veusz_extracted/veusz-master/veusz/widgets/fit.py",
"type": "Python"
} | # fitting plotter
# Copyright (C) 2005 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# 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 2 of ... | veuszREPO_NAMEveuszPATH_START.@veusz_extracted@veusz-master@veusz@widgets@fit.py@.PATH_END.py |
{
"filename": "traverse_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/tools/common/traverse_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@tools@common@traverse_test.py@.PATH_END.py |
{
"filename": "_binned_statistic.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/stats/_binned_statistic.py",
"type": "Python"
} | import builtins
import numpy as np
from numpy.testing import suppress_warnings
from operator import index
from collections import namedtuple
__all__ = ['binned_statistic',
'binned_statistic_2d',
'binned_statistic_dd']
BinnedStatisticResult = namedtuple('BinnedStatisticResult',
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@stats@_binned_statistic.py@.PATH_END.py |
{
"filename": "iris_get_response.py",
"repo_name": "OfAaron3/irispreppy",
"repo_path": "irispreppy_extracted/irispreppy-main/irispreppy/radcal/iris_get_response.py",
"type": "Python"
} | import pickle
import urllib.error
import urllib.request
from datetime import datetime as dt
from glob import glob as ls
from os import path, remove
import numpy as np
from astropy.time import Time
from bs4 import BeautifulSoup
from scipy.interpolate import interp1d
from scipy.io import readsav
def iris_get_response(... | OfAaron3REPO_NAMEirispreppyPATH_START.@irispreppy_extracted@irispreppy-main@irispreppy@radcal@iris_get_response.py@.PATH_END.py |
{
"filename": "example_gam_0.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/sandbox/examples/example_gam_0.py",
"type": "Python"
} | '''first examples for gam and PolynomialSmoother used for debugging
This example was written as a test case.
The data generating process is chosen so the parameters are well identified
and estimated.
Note: uncomment plt.show() to display graphs
'''
import time
import numpy as np
import numpy.random as R
import mat... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@sandbox@examples@example_gam_0.py@.PATH_END.py |
{
"filename": "estimator.py",
"repo_name": "smsharma/mining-for-substructure-lens",
"repo_path": "mining-for-substructure-lens_extracted/mining-for-substructure-lens-master/inference/estimator.py",
"type": "Python"
} | from __future__ import absolute_import, division, print_function
import logging
import os
import json
import numpy as np
from collections import OrderedDict
import torch
from inference.models.vgg import VGGRatioEstimator
from inference.models.resnet import ResNetRatioEstimator
from inference.trainer import RatioTrain... | smsharmaREPO_NAMEmining-for-substructure-lensPATH_START.@mining-for-substructure-lens_extracted@mining-for-substructure-lens-master@inference@estimator.py@.PATH_END.py |
{
"filename": "plot_window.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/yt/visualization/plot_window.py",
"type": "Python"
} | import abc
import sys
from collections import defaultdict
from numbers import Number
from typing import TYPE_CHECKING, Union
import matplotlib
import numpy as np
from more_itertools import always_iterable
from unyt.exceptions import UnitConversionError
from yt._maintenance.deprecation import issue_deprecation_warning... | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@visualization@plot_window.py@.PATH_END.py |
{
"filename": "_idssrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/pie/_idssrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class IdssrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="idssrc", parent_name="pie", **kwargs):
super(IdssrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_typ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@pie@_idssrc.py@.PATH_END.py |
{
"filename": "train.py",
"repo_name": "ML4GW/aframe",
"repo_path": "aframe_extracted/aframe-main/aframe/tasks/train/train.py",
"type": "Python"
} | import base64
import json
import shlex
import sys
from pathlib import Path
from typing import Dict
import law
import luigi
import yaml
from kr8s.objects import Secret
from luigi.contrib.kubernetes import KubernetesJobTask
from luigi.util import inherits
from aframe.base import AframeSingularityTask, AframeWrapperTask... | ML4GWREPO_NAMEaframePATH_START.@aframe_extracted@aframe-main@aframe@tasks@train@train.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "li-yangyang/lotus",
"repo_path": "lotus_extracted/lotus-main/setup.py",
"type": "Python"
} | from setuptools import setup, find_packages
from setuptools.command.install import install as _install
import os, sys, re
import codecs
NAME = "lotus_nlte"
PACKAGES = find_packages(where='src')
META_PATH = os.path.join("src", NAME, "__init__.py")
EXTRA_REQUIRE = {
"advanced-interp": ["rbf", "torch", "gpytorch"],
... | li-yangyangREPO_NAMElotusPATH_START.@lotus_extracted@lotus-main@setup.py@.PATH_END.py |
{
"filename": "setup_baroclinic.py",
"repo_name": "fdebras/ECLIPS3D",
"repo_path": "ECLIPS3D_extracted/ECLIPS3D-master/ECLIPS3D/2D_axi/python/setup_baroclinic.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 12 16:38:10 2017
@author: florian
"""
from netCDF4 import Dataset
import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate
from scipy.misc import derivative
import scipy.optimize as Opt
three=False
#three = True
Nlong = 35
Nlat = 25
Nz = 12
... | fdebrasREPO_NAMEECLIPS3DPATH_START.@ECLIPS3D_extracted@ECLIPS3D-master@ECLIPS3D@2D_axi@python@setup_baroclinic.py@.PATH_END.py |
{
"filename": "fit.py",
"repo_name": "timothydmorton/isochrones",
"repo_path": "isochrones_extracted/isochrones-master/isochrones/fit.py",
"type": "Python"
} | import os, sys
import pandas as pd
import numpy as np
import emcee3
from emcee3.backends import Backend, HDFBackend
class Emcee3Model(emcee3.Model):
def __init__(self, mod, *args, **kwargs):
self.mod = mod
super().__init__(*args, **kwargs)
def compute_log_prior(self, state):
state.lo... | timothydmortonREPO_NAMEisochronesPATH_START.@isochrones_extracted@isochrones-master@isochrones@fit.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "mr-superonion/FPFS",
"repo_path": "FPFS_extracted/FPFS-master/setup.py",
"type": "Python"
} | import os
from setuptools import setup, find_packages
this_dir = os.path.dirname(os.path.realpath(__file__))
__version__ = ""
fname = os.path.join(this_dir, "fpfs", "__version__.py")
with open(fname, "r") as ff:
exec(ff.read())
long_description = open(os.path.join(this_dir, "README.md")).read()
scripts = [
... | mr-superonionREPO_NAMEFPFSPATH_START.@FPFS_extracted@FPFS-master@setup.py@.PATH_END.py |
{
"filename": "delete_mercfiles.py",
"repo_name": "ahermosillo/stochastic-randommigration",
"repo_path": "stochastic-randommigration_extracted/stochastic-randommigration-main/mercury6/delete_mercfiles.py",
"type": "Python"
} | import time
import os
import shutil
directory = "./"
files_in_directory = os.listdir(directory)
filtered_files = [file for file in files_in_directory if file.endswith(".dmp") \
or file.endswith(".tmp") or file.endswith(".out") or file.endswith(".aei")\
or file.endswith(".dat")]
# filtered_files = [file if ... | ahermosilloREPO_NAMEstochastic-randommigrationPATH_START.@stochastic-randommigration_extracted@stochastic-randommigration-main@mercury6@delete_mercfiles.py@.PATH_END.py |
{
"filename": "_separatethousands.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/scene/xaxis/_separatethousands.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SeparatethousandsValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name="separatethousands",
parent_name="layout.scene.xaxis",
**kwargs,
):
super(SeparatethousandsValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@scene@xaxis@_separatethousands.py@.PATH_END.py |
{
"filename": "launch.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/setuptools/py2/setuptools/launch.py",
"type": "Python"
} | """
Launch the Python script on the command line after
setuptools is bootstrapped via import.
"""
# Note that setuptools gets imported implicitly by the
# invocation of this script using python -m setuptools.launch
import tokenize
import sys
def run():
"""
Run the script in sys.argv[1] as if it had
been... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@setuptools@py2@setuptools@launch.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/scatter3d/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@scatter3d@hoverlabel@__init__.py@.PATH_END.py |
{
"filename": "_linepositionsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/volume/hoverlabel/font/_linepositionsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LinepositionsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="linepositionsrc",
parent_name="volume.hoverlabel.font",
**kwargs,
):
super(LinepositionsrcValidator, self).__init__(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@volume@hoverlabel@font@_linepositionsrc.py@.PATH_END.py |
{
"filename": "kafkaAlert.py",
"repo_name": "jlenain/flaapluc",
"repo_path": "flaapluc_extracted/flaapluc-master/flaapluc/kafkaAlert.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Time-stamp: "2022-11-17 12:13:36 jlenain"
"""
Alert producer for FLaapLUC using the kafka protocol and AVRO alert format
"""
import yaml
import os
from confluent_kafka import Producer
from flaapluc import avroUtils
import flaapluc
class AlertProducer:
def __i... | jlenainREPO_NAMEflaaplucPATH_START.@flaapluc_extracted@flaapluc-master@flaapluc@kafkaAlert.py@.PATH_END.py |
{
"filename": "volterra_tikhonov_cg.py",
"repo_name": "hmuellergoe/mrbeam",
"repo_path": "mrbeam_extracted/mrbeam-main/mr_beam/itreg/examples/volterra_tikhonov_cg.py",
"type": "Python"
} | from regpy.operators.volterra import Volterra
from regpy.hilbert import L2
from regpy.discrs import UniformGrid
from regpy.solvers import HilbertSpaceSetting
from regpy.solvers.tikhonov import TikhonovCG
import regpy.stoprules as rules
import numpy as np
import logging
import matplotlib.pyplot as plt
logging.basicCon... | hmuellergoeREPO_NAMEmrbeamPATH_START.@mrbeam_extracted@mrbeam-main@mr_beam@itreg@examples@volterra_tikhonov_cg.py@.PATH_END.py |
{
"filename": "TemperatureDensity.py",
"repo_name": "mmicromegas/ransX",
"repo_path": "ransX_extracted/ransX-master/EQUATIONS/TemperatureDensity.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
from UTILS.Calculus import Calculus
from UTILS.SetAxisLimit import SetAxisLimit
from UTILS.Tools import Tools
from UTILS.Errors import Errors
import sys
# Theoretical background https://arxiv.org/abs/1401.5176
# Mocak, Meakin, Viallet, Arnett, 2014, Compressible Hyd... | mmicromegasREPO_NAMEransXPATH_START.@ransX_extracted@ransX-master@EQUATIONS@TemperatureDensity.py@.PATH_END.py |
{
"filename": "sample.py",
"repo_name": "astropy/photutils",
"repo_path": "photutils_extracted/photutils-main/photutils/isophote/sample.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides a class to sample data along an elliptical path.
"""
import copy
import numpy as np
from photutils.isophote.geometry import EllipseGeometry
from photutils.isophote.integrator import INTEGRATORS
__all__ = ['EllipseSample']
cla... | astropyREPO_NAMEphotutilsPATH_START.@photutils_extracted@photutils-main@photutils@isophote@sample.py@.PATH_END.py |
{
"filename": "test_sample.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/groupby/methods/test_sample.py",
"type": "Python"
} | import pytest
from pandas import (
DataFrame,
Index,
Series,
)
import pandas._testing as tm
@pytest.mark.parametrize("n, frac", [(2, None), (None, 0.2)])
def test_groupby_sample_balanced_groups_shape(n, frac):
values = [1] * 10 + [2] * 10
df = DataFrame({"a": values, "b": values})
result = d... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@groupby@methods@test_sample.py@.PATH_END.py |
{
"filename": "objects.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/prefect/client/schemas/objects.py",
"type": "Python"
} | import datetime
import warnings
from collections.abc import Callable, Mapping
from functools import partial
from typing import (
TYPE_CHECKING,
Annotated,
Any,
ClassVar,
Generic,
Optional,
Union,
cast,
overload,
)
from uuid import UUID, uuid4
import orjson
import pendulum
from pydan... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@client@schemas@objects.py@.PATH_END.py |
{
"filename": "_util.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py2/scipy/_lib/_util.py",
"type": "Python"
} | from __future__ import division, print_function, absolute_import
import functools
import operator
import sys
import warnings
import numbers
from collections import namedtuple
from multiprocessing import Pool
import inspect
import numpy as np
def _broadcast_arrays(a, b):
"""
Same as np.broadcast_arrays(a, b) ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py2@scipy@_lib@_util.py@.PATH_END.py |
{
"filename": "sel_utils.py",
"repo_name": "arviz-devs/arviz",
"repo_path": "arviz_extracted/arviz-main/arviz/sel_utils.py",
"type": "Python"
} | """Utilities for selecting and iterating on xarray objects."""
from itertools import product, tee
import numpy as np
import xarray as xr
from .labels import BaseLabeller
__all__ = ["xarray_sel_iter", "xarray_var_iter", "xarray_to_ndarray"]
def selection_to_string(selection):
"""Convert dictionary of coordinat... | arviz-devsREPO_NAMEarvizPATH_START.@arviz_extracted@arviz-main@arviz@sel_utils.py@.PATH_END.py |
{
"filename": "test_gp_opt.py",
"repo_name": "scikit-optimize/scikit-optimize",
"repo_path": "scikit-optimize_extracted/scikit-optimize-master/skopt/tests/test_gp_opt.py",
"type": "Python"
} | import numpy as np
from numpy.testing import assert_array_equal
import pytest
from skopt import gp_minimize
from skopt.benchmarks import bench1
from skopt.benchmarks import bench2
from skopt.benchmarks import bench3
from skopt.benchmarks import bench4
from skopt.benchmarks import branin
from skopt.space.space import R... | scikit-optimizeREPO_NAMEscikit-optimizePATH_START.@scikit-optimize_extracted@scikit-optimize-master@skopt@tests@test_gp_opt.py@.PATH_END.py |
{
"filename": "getting_started.md",
"repo_name": "rbuehler/vasca",
"repo_path": "vasca_extracted/vasca-main/docs/getting_started.md",
"type": "Markdown"
} | # Getting started
## Installation
VASCA is tested to work with Python 3.10 and 3.11. Typically, you want to create a new
Python environment, e.g., with [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv)
or [mamba](https://github.com/mamba-org/mamba):
```bash
mamba create -n vasca python=3.11
mamba activat... | rbuehlerREPO_NAMEvascaPATH_START.@vasca_extracted@vasca-main@docs@getting_started.md@.PATH_END.py |
{
"filename": "plot_diff.py",
"repo_name": "AFD-Illinois/iharm3d",
"repo_path": "iharm3d_extracted/iharm3d-master/script/analysis/plot_diff.py",
"type": "Python"
} | ################################################################################
# #
# PLOT DIFFERENCES IN TWO FILES #
# ... | AFD-IllinoisREPO_NAMEiharm3dPATH_START.@iharm3d_extracted@iharm3d-master@script@analysis@plot_diff.py@.PATH_END.py |
{
"filename": "SettledDisk.py",
"repo_name": "psheehan/pdspy",
"repo_path": "pdspy_extracted/pdspy-master/pdspy/modeling/SettledDisk.py",
"type": "Python"
} | import numpy
import h5py
from scipy.integrate import trapz
from ..constants.physics import G, m_p
from ..constants.astronomy import AU, M_sun
from ..constants.math import pi
from ..dust import Dust
from ..gas import Gas
class SettledDisk:
def __init__(self, mass=1.0e-3, rmin=0.1, rmax=300, plrho=2.37, h0=0.1, \
... | psheehanREPO_NAMEpdspyPATH_START.@pdspy_extracted@pdspy-master@pdspy@modeling@SettledDisk.py@.PATH_END.py |
{
"filename": "ascii.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/tools/python3/Lib/encodings/ascii.py",
"type": "Python"
} | """ Python 'ascii' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is intended.
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@python3@Lib@encodings@ascii.py@.PATH_END.py |
{
"filename": "pep425tags.py",
"repo_name": "davidharvey1986/pyRRG",
"repo_path": "pyRRG_extracted/pyRRG-master/unittests/bugFixPyRRG/lib/python3.7/site-packages/wheel/pep425tags.py",
"type": "Python"
} | """Generate and work with PEP 425 Compatibility Tags."""
import distutils.util
import platform
import sys
import os
import sysconfig
import warnings
from .macosx_libfile import extract_macosx_min_system_version
try:
from importlib.machinery import all_suffixes as get_all_suffixes
except ImportError:
from im... | davidharvey1986REPO_NAMEpyRRGPATH_START.@pyRRG_extracted@pyRRG-master@unittests@bugFixPyRRG@lib@python3.7@site-packages@wheel@pep425tags.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "teuben/QAC",
"repo_path": "QAC_extracted/QAC-master/casa/README.md",
"type": "Markdown"
} | Here we discuss CASA and derived products to do array combinations.
## CASA
CASA: (Common Astronomy Software Applications) is used for all ALMA
and VLA calibration and imaging, and the natural starting point
for any array combination procedures. Please have CASA 5.1
installed on your laptop, and follow the guidelines... | teubenREPO_NAMEQACPATH_START.@QAC_extracted@QAC-master@casa@README.md@.PATH_END.py |
{
"filename": "_textfont.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/histogram2dcontour/_textfont.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Textfont(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "histogram2dcontour"
_path_str = "histogram2dcontour.textfont"
_valid_props = {
"co... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@histogram2dcontour@_textfont.py@.PATH_END.py |
{
"filename": "deployments.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/prefect/server/models/deployments.py",
"type": "Python"
} | """
Functions for interacting with deployment ORM objects.
Intended for internal use by the Prefect REST API.
"""
import datetime
from typing import Dict, Iterable, List, Optional, Sequence, TypeVar, cast
from uuid import UUID, uuid4
import pendulum
import sqlalchemy as sa
from sqlalchemy import delete, or_, select
f... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@server@models@deployments.py@.PATH_END.py |
{
"filename": "_symmetric.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattergl/error_x/_symmetric.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SymmetricValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="symmetric", parent_name="scattergl.error_x", **kwargs
):
super(SymmetricValidator, self).__init__(
plotly_name=plotly_name,
pare... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattergl@error_x@_symmetric.py@.PATH_END.py |
{
"filename": "cifar10.md",
"repo_name": "ultralytics/ultralytics",
"repo_path": "ultralytics_extracted/ultralytics-main/docs/en/datasets/classify/cifar10.md",
"type": "Markdown"
} | ---
comments: true
description: Explore the CIFAR-10 dataset, featuring 60,000 color images in 10 classes. Learn about its structure, applications, and how to train models using YOLO.
keywords: CIFAR-10, dataset, machine learning, computer vision, image classification, YOLO, deep learning, neural networks
---
# CIFAR-... | ultralyticsREPO_NAMEultralyticsPATH_START.@ultralytics_extracted@ultralytics-main@docs@en@datasets@classify@cifar10.md@.PATH_END.py |
{
"filename": "68041e36e11b_adding_new_heraautos_table.py",
"repo_name": "HERA-Team/hera_mc",
"repo_path": "hera_mc_extracted/hera_mc-main/alembic/versions/68041e36e11b_adding_new_heraautos_table.py",
"type": "Python"
} | """add HeraAutos table
Revision ID: 68041e36e11b
Revises: b022867d09e3
Create Date: 2019-12-30 20:56:04.518300+00:00
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "68041e36e11b"
down_revision = "b022867d09e3"
branch_... | HERA-TeamREPO_NAMEhera_mcPATH_START.@hera_mc_extracted@hera_mc-main@alembic@versions@68041e36e11b_adding_new_heraautos_table.py@.PATH_END.py |
{
"filename": "_stylesrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/pie/insidetextfont/_stylesrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class StylesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="stylesrc", parent_name="pie.insidetextfont", **kwargs
):
super(StylesrcValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@pie@insidetextfont@_stylesrc.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "mit-ll/spacegym-kspdg",
"repo_path": "spacegym-kspdg_extracted/spacegym-kspdg-main/src/kspdg/private_src/python3_13/Darwin_x86_64/pyarmor_runtime_000000/__init__.py",
"type": "Python"
} | # Pyarmor 9.0.6 (trial), 000000, 2024-12-09T10:19:33.924322
from .pyarmor_runtime import __pyarmor__
| mit-llREPO_NAMEspacegym-kspdgPATH_START.@spacegym-kspdg_extracted@spacegym-kspdg-main@src@kspdg@private_src@python3_13@Darwin_x86_64@pyarmor_runtime_000000@__init__.py@.PATH_END.py |
{
"filename": "plot_constraints.py",
"repo_name": "MikeSWang/HorizonGRound",
"repo_path": "HorizonGRound_extracted/HorizonGRound-master/application/pipeline/plot_constraints.py",
"type": "Python"
} | """Plot 2-d parameter constraints from parameter chains.
"""
import warnings
import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
from matplotlib.colors import LinearSegmentedColormap, ListedColormap, to_rgb
from matplotlib.ticker import AutoMinorLocator
from scipy.integrate import cumtrapz, ... | MikeSWangREPO_NAMEHorizonGRoundPATH_START.@HorizonGRound_extracted@HorizonGRound-master@application@pipeline@plot_constraints.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/smith/imaginaryaxis/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._visible import VisibleValidator
from ._tickwidth import TickwidthValidator
from ._tickvalssrc import TickvalssrcValidator
from ._tickvals import TickvalsValidator
from ._ticksuffix import TicksuffixVal... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@smith@imaginaryaxis@__init__.py@.PATH_END.py |
{
"filename": "_ygap.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/heatmap/_ygap.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YgapValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="ygap", parent_name="heatmap", **kwargs):
super(YgapValidator, 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@heatmap@_ygap.py@.PATH_END.py |
{
"filename": "mock_primitive.py",
"repo_name": "GeminiDRSoftware/DRAGONS",
"repo_path": "DRAGONS_extracted/DRAGONS-master/recipe_system/adcc/client/qap_specviewer/mock_primitive.py",
"type": "Python"
} | #!/usr/bin/env python
"""
Mock plotSpectraForQA primitive.
This module emulates a pipeline that reproduces how the plotSpectraForQA would
behave in real time.
In practice, it creates JSON data and send it to the ADCC Server in a timed loop.
"""
import json
import time
import urllib.error
import urllib.request
import... | GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@recipe_system@adcc@client@qap_specviewer@mock_primitive.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "seeh/surprise",
"repo_path": "surprise_extracted/surprise-master/surprise/__init__.py",
"type": "Python"
} | __author__ = 'Sebastian Seehars'
__email__ = 'seehars@phys.ethz.ch'
__version__ = '0.1.0'
__credits__ = 'ETH Zurich, Institute for Astronomy'
#for py27+py33 compatibility
try:
from surprise import Surprise
except ImportError:
from surprise.surprise import Surprise | seehREPO_NAMEsurprisePATH_START.@surprise_extracted@surprise-master@surprise@__init__.py@.PATH_END.py |
{
"filename": "fast_ffts.py",
"repo_name": "pscicluna/precision",
"repo_path": "precision_extracted/precision-master/image_registration/fft_tools/fast_ffts.py",
"type": "Python"
} | ######################################################################
#
# This file is from Adam Ginsburg's image_registration
# library (originally released un the MIT license) and
# is used to provide precise image registration. At
# some point, I may replace it with a more elegant
# ... | psciclunaREPO_NAMEprecisionPATH_START.@precision_extracted@precision-master@image_registration@fft_tools@fast_ffts.py@.PATH_END.py |
{
"filename": "lg3_envs.py",
"repo_name": "mit-ll/spacegym-kspdg",
"repo_path": "spacegym-kspdg_extracted/spacegym-kspdg-main/src/kspdg/private_src/python3_12/Darwin_x86_64/kspdg_envs/lbg1/lg3_envs.py",
"type": "Python"
} | # Pyarmor 8.5.11 (trial), 000000, non-profits, 2024-12-09T10:19:37.718552
from kspdg.private_src.python3_12.Darwin_x86_64.pyarmor_runtime_000000 import __pyarmor__
__pyarmor__(__name__, __file__, b'PY000000\x00\x03\x0c\x00\xcb\r\r\n\x80\x00\x01\x00\x08\x00\x00\x00\x04\x00\x00\x00@\x00\x00\x00&\x7f\x00\x00\x12\t\x04\x00... | mit-llREPO_NAMEspacegym-kspdgPATH_START.@spacegym-kspdg_extracted@spacegym-kspdg-main@src@kspdg@private_src@python3_12@Darwin_x86_64@kspdg_envs@lbg1@lg3_envs.py@.PATH_END.py |
{
"filename": "interval.py",
"repo_name": "threeML/threeML",
"repo_path": "threeML_extracted/threeML-master/threeML/utils/interval.py",
"type": "Python"
} | import copy
import re
from operator import attrgetter, itemgetter
import numpy as np
from threeML.io.logging import setup_logger
log = setup_logger(__name__)
class IntervalsDoNotOverlap(RuntimeError):
pass
class IntervalsNotContiguous(RuntimeError):
pass
class Interval:
def __init__(self, start: flo... | threeMLREPO_NAMEthreeMLPATH_START.@threeML_extracted@threeML-master@threeML@utils@interval.py@.PATH_END.py |
{
"filename": "test_testing.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/yt/tests/test_testing.py",
"type": "Python"
} | from unittest import SkipTest
import matplotlib
from yt.testing import requires_backend
active_backend = matplotlib.get_backend()
inactive_backend = ({"gtkagg", "macosx", "wx", "tkagg"} - {active_backend}).pop()
def test_requires_inactive_backend():
@requires_backend(inactive_backend)
def foo():
re... | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@yt@tests@test_testing.py@.PATH_END.py |
{
"filename": "pota2clus_novetonocoll.py",
"repo_name": "desihub/LSS",
"repo_path": "LSS_extracted/LSS-main/scripts/mock_tools/pota2clus_novetonocoll.py",
"type": "Python"
} | #standard python
import sys
import os
import shutil
import unittest
from datetime import datetime
import json
import numpy as np
import fitsio
import glob
import argparse
from astropy.table import Table,join,unique,vstack
from matplotlib import pyplot as plt
from desitarget.io import read_targets_in_tiles
from desitarg... | desihubREPO_NAMELSSPATH_START.@LSS_extracted@LSS-main@scripts@mock_tools@pota2clus_novetonocoll.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.