metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "linalg.py",
"repo_name": "fchollet/keras",
"repo_path": "keras_extracted/keras-master/keras/src/backend/torch/linalg.py",
"type": "Python"
} | import torch
from keras.src.backend import config
from keras.src.backend import standardize_dtype
from keras.src.backend.common import dtypes
from keras.src.backend.torch.core import cast
from keras.src.backend.torch.core import convert_to_tensor
def cholesky(x):
return torch.linalg.cholesky(x)
def det(x):
... | fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@backend@torch@linalg.py@.PATH_END.py |
{
"filename": "fitsheaders.py",
"repo_name": "chandra-marx/marxs",
"repo_path": "marxs_extracted/marxs-main/marxs/missions/chandra/fitsheaders.py",
"type": "Python"
} | # Licensed under GPL version 3 - see LICENSE.rst
'''
See `ASC FITS File Designers' Guide ASC-FITS-2.1.0 <cxc.harvard.edu/contrib/arots/fits/ascfits.ps>`.
'''
from astropy import time
import astropy.units as u
from ... import __version__
from .data import TLMINMAX, PIXSIZE, NOMINAL_FOCALLENGTH, ODET
def update_header... | chandra-marxREPO_NAMEmarxsPATH_START.@marxs_extracted@marxs-main@marxs@missions@chandra@fitsheaders.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/pyqtgraph/colors/__init__.py",
"type": "Python"
} | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@pyqtgraph@colors@__init__.py@.PATH_END.py | |
{
"filename": "groupby.py",
"repo_name": "mwaskom/seaborn",
"repo_path": "seaborn_extracted/seaborn-master/seaborn/_core/groupby.py",
"type": "Python"
} | """Simplified split-apply-combine paradigm on dataframes for internal use."""
from __future__ import annotations
from typing import cast, Iterable
import pandas as pd
from seaborn._core.rules import categorical_order
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import Callable
from pandas ... | mwaskomREPO_NAMEseabornPATH_START.@seaborn_extracted@seaborn-master@seaborn@_core@groupby.py@.PATH_END.py |
{
"filename": "_ticklabeloverflow.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/barpolar/marker/colorbar/_ticklabeloverflow.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicklabeloverflowValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="ticklabeloverflow",
parent_name="barpolar.marker.colorbar",
**kwargs,
):
super(TicklabeloverflowValidator, self).__in... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@barpolar@marker@colorbar@_ticklabeloverflow.py@.PATH_END.py |
{
"filename": "extract_region.py",
"repo_name": "CIRADA-Tools/RM-Tools",
"repo_path": "RM-Tools_extracted/RM-Tools-master/RMtools_3D/extract_region.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 30 10:44:28 2019
Extract subregion of a FITS file, with option to extract a plane.
There are many cutout tools like it, but this one is mine.
@author: cvaneck
May 2019
"""
import argparse
import os
import astropy.io.fits as pf
from astropy.wcs ... | CIRADA-ToolsREPO_NAMERM-ToolsPATH_START.@RM-Tools_extracted@RM-Tools-master@RMtools_3D@extract_region.py@.PATH_END.py |
{
"filename": "xml.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/io/formats/xml.py",
"type": "Python"
} | """
:mod:`pandas.io.formats.xml` is a module for formatting data in XML.
"""
from __future__ import annotations
import codecs
import io
from typing import (
TYPE_CHECKING,
Any,
final,
)
from pandas.errors import AbstractMethodError
from pandas.util._decorators import (
cache_readonly,
doc,
)
fro... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@io@formats@xml.py@.PATH_END.py |
{
"filename": "test_fill_region.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/yt/utilities/lib/tests/test_fill_region.py",
"type": "Python"
} | import numpy as np
from numpy.testing import assert_equal
from yt.utilities.lib.misc_utilities import fill_region
NDIM = 32
def test_fill_region():
for level in range(2):
rf = 2**level
output_fields = [
np.zeros((NDIM * rf, NDIM * rf, NDIM * rf), "float64") for i in range(3)
... | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@yt@utilities@lib@tests@test_fill_region.py@.PATH_END.py |
{
"filename": "kernel_approximation.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/sklearn/kernel_approximation.py",
"type": "Python"
} | """Approximate kernel feature maps based on Fourier transforms and count sketches."""
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
import warnings
from numbers import Integral, Real
import numpy as np
import scipy.sparse as sp
from scipy.fft import fft, ifft
from scipy.linalg import... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@sklearn@kernel_approximation.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "utsav-akhaury/understanding-unets",
"repo_path": "understanding-unets_extracted/understanding-unets-master/README.md",
"type": "Markdown"
} | # Learnlets
[](https://travis-ci.com/zaccharieramzi/understanding-unets)
Learnlets are a way to learn a filter bank rather than design one like in the curvelets.
This filter bank will be learned in a... | utsav-akhauryREPO_NAMEunderstanding-unetsPATH_START.@understanding-unets_extracted@understanding-unets-master@README.md@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/scatter/hoverlabel/_font.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatter.hoverlabel"
_path_str = "scatter.hoverlabel.font"
_valid_props = {
"color",
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@scatter@hoverlabel@_font.py@.PATH_END.py |
{
"filename": "clustAlgor.py",
"repo_name": "msolpera/pyUPMASK",
"repo_path": "pyUPMASK_extracted/pyUPMASK-main/modules/clustAlgor.py",
"type": "Python"
} |
import numpy as np
import sklearn.cluster as skclust
import sklearn.mixture as skmixture
from scipy.spatial.distance import cdist
from scipy import spatial
from .voronoiVols import voronoi_volumes
def DDhisto(clust_data, N_membs, n_clusters):
"""
Testing simple N-dimensional histogram
"""
import pand... | msolperaREPO_NAMEpyUPMASKPATH_START.@pyUPMASK_extracted@pyUPMASK-main@modules@clustAlgor.py@.PATH_END.py |
{
"filename": "heartbeat.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/ipykernel/py2/ipykernel/heartbeat.py",
"type": "Python"
} | """The client and server for a basic ping-pong style heartbeat.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as pa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipykernel@py2@ipykernel@heartbeat.py@.PATH_END.py |
{
"filename": "prepare_data.py",
"repo_name": "rpoleski/MulensModel",
"repo_path": "MulensModel_extracted/MulensModel-master/examples/run_time_tests/prepare_data.py",
"type": "Python"
} | """
Prepare files to be used as tests.
"""
import numpy as np
from MulensModel import Model
MAG_ZEROPOINT = 18.
def simulate_PSPL(file_name, n_data, t_start=None, t_stop=None, u_0=None,
magnification_function=None):
"""simulate PSPL light curve and save to file"""
t_0 = 2456900.
t_E =... | rpoleskiREPO_NAMEMulensModelPATH_START.@MulensModel_extracted@MulensModel-master@examples@run_time_tests@prepare_data.py@.PATH_END.py |
{
"filename": "epub.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/document_loaders/epub.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import UnstructuredEPubLoader
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@document_loaders@epub.py@.PATH_END.py |
{
"filename": "_enabled.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/histogram/cumulative/_enabled.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class EnabledValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="enabled", parent_name="histogram.cumulative", **kwargs
):
super(EnabledValidator, self).__init__(
plotly_name=plotly_name,
parent_... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@histogram@cumulative@_enabled.py@.PATH_END.py |
{
"filename": "metalpoor_stars.py",
"repo_name": "annayqho/TheCannon",
"repo_path": "TheCannon_extracted/TheCannon-master/code/lamost/mass_age/paper_plots/metalpoor_stars.py",
"type": "Python"
} | import matplotlib.pyplot as plt
from matplotlib import rc
import matplotlib.gridspec as gridspec
from matplotlib.colors import LogNorm
from math import log10, floor
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
import numpy as np
def round_sig(x, sig=2):
if x < 0:
return -round(-x, sig-int(flo... | annayqhoREPO_NAMETheCannonPATH_START.@TheCannon_extracted@TheCannon-master@code@lamost@mass_age@paper_plots@metalpoor_stars.py@.PATH_END.py |
{
"filename": "test_ephemerides.py",
"repo_name": "lsst/rubin_sim",
"repo_path": "rubin_sim_extracted/rubin_sim-main/tests/moving_objects/test_ephemerides.py",
"type": "Python"
} | import os
import unittest
import numpy as np
import pandas as pd
from astropy.time import Time
from rubin_scheduler.data import get_data_dir
from rubin_sim.moving_objects import Orbits, PyOrbEphemerides
class TestPyOrbEphemerides(unittest.TestCase):
def setUp(self):
self.testdir = os.path.join(get_data_... | lsstREPO_NAMErubin_simPATH_START.@rubin_sim_extracted@rubin_sim-main@tests@moving_objects@test_ephemerides.py@.PATH_END.py |
{
"filename": "load_dust.py",
"repo_name": "rometsch/fargocpt",
"repo_path": "fargocpt_extracted/fargocpt-master/test/dust_diffusion/load_dust.py",
"type": "Python"
} | import numpy as np
from fargocpt import Loader
def get_sigma_dust(outdir, N, nbins=51):
l = Loader(outdir)
r = l.particles.get("r", N).value
counts, interfaces = np.histogram(r, bins=nbins)
mid = 0.5*(interfaces[1:] + interfaces[:-1])
dr = interfaces[1:] - interfaces[:-1]
sigma_dust = counts... | rometschREPO_NAMEfargocptPATH_START.@fargocpt_extracted@fargocpt-master@test@dust_diffusion@load_dust.py@.PATH_END.py |
{
"filename": "GCPDataTee.py",
"repo_name": "CMB-S4/spt3g_software",
"repo_path": "spt3g_software_extracted/spt3g_software-master/gcp/python/GCPDataTee.py",
"type": "Python"
} | import struct, socket, errno, numpy, time, threading
from .. import core, dfmux
class PagerWatchdog(object):
'''
Module that sends a watchdog (ping) message to the GCP pager when the parent
process is running successfully. Modify the `data_valid` method for
particular use cases, and call the `run` me... | CMB-S4REPO_NAMEspt3g_softwarePATH_START.@spt3g_software_extracted@spt3g_software-master@gcp@python@GCPDataTee.py@.PATH_END.py |
{
"filename": "friendly.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/Pygments/py3/pygments/styles/friendly.py",
"type": "Python"
} | """
pygments.styles.friendly
~~~~~~~~~~~~~~~~~~~~~~~~
A modern style based on the VIM pyte theme.
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, Stri... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@Pygments@py3@pygments@styles@friendly.py@.PATH_END.py |
{
"filename": "transform_dataset.ipynb",
"repo_name": "astrockragh/Mangrove",
"repo_path": "Mangrove_extracted/Mangrove-main/transform/transform_dataset.ipynb",
"type": "Jupyter Notebook"
} | ```python
import torch, os, pickle, time
import torch_geometric as tg
from torch_geometric.data import Data
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from tqdm import tqdm
import os.path as osp
import networkx as nx
path='~/../../tigress/cj1223/merger_trees/isotrees/'
transform_path='~/../.... | astrockraghREPO_NAMEMangrovePATH_START.@Mangrove_extracted@Mangrove-main@transform@transform_dataset.ipynb@.PATH_END.py |
{
"filename": "testDistributeByPosition2d.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/tests/unit/Distributed/testDistributeByPosition2d.py",
"type": "Python"
} | #ATS:test(SELF, np=8, label="DistributeByPosition2d unit tests")
from math import *
import unittest
from Spheral import *
#===============================================================================
# Load mpi, and figure out how may domains to set up, and which domain we are.
#===================================... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@tests@unit@Distributed@testDistributeByPosition2d.py@.PATH_END.py |
{
"filename": "B_Model_Tutorial_3_Bayes_Classifier.ipynb",
"repo_name": "jmschrei/pomegranate",
"repo_path": "pomegranate_extracted/pomegranate-master/docs/tutorials/B_Model_Tutorial_3_Bayes_Classifier.ipynb",
"type": "Jupyter Notebook"
} | ## Bayes Classifier
author: Jacob Schreiber <br>
contact: jmschreiber91@gmail.com
Although most of the models implemented in pomegranate are unsupervised, a simple way to construct a classifier using probabilistic models is to use Bayes' rule. Specifically, given a set of probabilistic models M, one can make classifi... | jmschreiREPO_NAMEpomegranatePATH_START.@pomegranate_extracted@pomegranate-master@docs@tutorials@B_Model_Tutorial_3_Bayes_Classifier.ipynb@.PATH_END.py |
{
"filename": "null_test.py",
"repo_name": "amanchokshi/EMBERS",
"repo_path": "EMBERS_extracted/EMBERS-master/src/embers/kindle/null_test.py",
"type": "Python"
} | """
Null Test
---------
perform null tests on reference rf data and reference beam models
"""
import argparse
from pathlib import Path
from embers.tile_maps.null_test import null_test
def main():
"""
Perform a null test of the reference antennas using the :func:`~embers.tile_maps.null_test.null_test` func... | amanchokshiREPO_NAMEEMBERSPATH_START.@EMBERS_extracted@EMBERS-master@src@embers@kindle@null_test.py@.PATH_END.py |
{
"filename": "conftest.py",
"repo_name": "nickhand/pyRSD",
"repo_path": "pyRSD_extracted/pyRSD-master/pyRSD/tests/test_gal_derivatives/conftest.py",
"type": "Python"
} | from .. import pytest
from .. import cache_manager
from pyRSD.rsdfit import FittingDriver
from pyRSD import data_dir
import os
@pytest.fixture(scope='session', autouse=True)
def driver(request):
from pyRSD.rsd import GalaxySpectrum
# add the PYRSD_DATA env var
os.environ['PYRSD_DATA'] = data_dir
# i... | nickhandREPO_NAMEpyRSDPATH_START.@pyRSD_extracted@pyRSD-master@pyRSD@tests@test_gal_derivatives@conftest.py@.PATH_END.py |
{
"filename": "check_accuracy_of_WODEN.ipynb",
"repo_name": "JLBLine/WODEN",
"repo_path": "WODEN_extracted/WODEN-master/cmake_testing/GPU_code/source_components/check_accuracy_of_WODEN.ipynb",
"type": "Jupyter Notebook"
} | # Does 2 + 2 = 4?
This notebook is an attempt to quantify the errors of the float sine/cosine functions in `CUDA`, and estimate how they might impact the asbolute accuracy of `WODEN`. They theory for everything is written into `test_calc_measurement_equation.c` in the `testing/cmake_testing/source_components` section o... | JLBLineREPO_NAMEWODENPATH_START.@WODEN_extracted@WODEN-master@cmake_testing@GPU_code@source_components@check_accuracy_of_WODEN.ipynb@.PATH_END.py |
{
"filename": "example_rotation.py",
"repo_name": "danielrd6/ifscube",
"repo_path": "ifscube_extracted/ifscube-master/ifscube/examples/example_rotation.py",
"type": "Python"
} | import matplotlib.pyplot as plt
import numpy as np
from ifscube import models, rotation
def create_fake_data(plot: bool = False):
y, x = np.indices((100, 100))
m = models.DiskRotation(amplitude=250.0, c_0=3.0, p=1.25, phi_0=np.deg2rad(60.0), theta=np.deg2rad(30.0), v_sys=0.0,
x_0=... | danielrd6REPO_NAMEifscubePATH_START.@ifscube_extracted@ifscube-master@ifscube@examples@example_rotation.py@.PATH_END.py |
{
"filename": "mc_publish_summary.py",
"repo_name": "HERA-Team/hera_mc",
"repo_path": "hera_mc_extracted/hera_mc-main/scripts/mc_publish_summary.py",
"type": "Python"
} | #! /usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# Copyright 2017 the HERA Collaboration
# Licensed under the 2-clause BSD license.
"""This publishes a webpage on hera-today.
If not on qmaster, it just writes the html file.
"""
from hera_mc import cm_sysutils, cm_utils, mc
if __name__ == "__main__":
... | HERA-TeamREPO_NAMEhera_mcPATH_START.@hera_mc_extracted@hera_mc-main@scripts@mc_publish_summary.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/table/hoverlabel/font/_lineposition.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LinepositionValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(
self, plotly_name="lineposition", parent_name="table.hoverlabel.font", **kwargs
):
super(LinepositionValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@table@hoverlabel@font@_lineposition.py@.PATH_END.py |
{
"filename": "_yanchor.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattermap/marker/colorbar/_yanchor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YanchorValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="yanchor", parent_name="scattermap.marker.colorbar", **kwargs
):
super(YanchorValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattermap@marker@colorbar@_yanchor.py@.PATH_END.py |
{
"filename": "BaseCosmology.py",
"repo_name": "igomezv/simplemc_tests",
"repo_path": "simplemc_tests_extracted/simplemc_tests-main/simplemc/cosmo/BaseCosmology.py",
"type": "Python"
} |
from simplemc.cosmo.paramDefs import h_par, Pr_par, s8_par
from scipy.misc import derivative
import scipy.integrate as intg
from scipy import constants
import scipy as sp
class BaseCosmology:
"""
Base Cosmology class doesn't know about your
parameterization of the equation of state or densities or anyt... | igomezvREPO_NAMEsimplemc_testsPATH_START.@simplemc_tests_extracted@simplemc_tests-main@simplemc@cosmo@BaseCosmology.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/treemap/root/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._color import ColorValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._color.ColorValidator"]
)
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@treemap@root@__init__.py@.PATH_END.py |
{
"filename": "more.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/setuptools/py3/pkg_resources/_vendor/more_itertools/more.py",
"type": "Python"
} | import warnings
from collections import Counter, defaultdict, deque, abc
from collections.abc import Sequence
from functools import cached_property, partial, reduce, wraps
from heapq import heapify, heapreplace, heappop
from itertools import (
chain,
compress,
count,
cycle,
dropwhile,
groupby,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@setuptools@py3@pkg_resources@_vendor@more_itertools@more.py@.PATH_END.py |
{
"filename": "_x.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/choropleth/colorbar/_x.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="x", parent_name="choropleth.colorbar", **kwargs):
super(XValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@choropleth@colorbar@_x.py@.PATH_END.py |
{
"filename": "cats.py",
"repo_name": "legacysurvey/imagine",
"repo_path": "imagine_extracted/imagine-main/map/cats.py",
"type": "Python"
} | from __future__ import print_function
from functools import lru_cache
import os
if __name__ == '__main__':
import sys
sys.path.insert(0, 'django-1.9')
os.environ['DJANGO_SETTINGS_MODULE'] = 'viewer.settings'
import django
django.setup()
from django.http import HttpResponse
from viewer import setti... | legacysurveyREPO_NAMEimaginePATH_START.@imagine_extracted@imagine-main@map@cats.py@.PATH_END.py |
{
"filename": "_field_common.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/pyrsistent/py3/pyrsistent/_field_common.py",
"type": "Python"
} | from pyrsistent._checked_types import (
CheckedPMap,
CheckedPSet,
CheckedPVector,
CheckedType,
InvariantException,
_restore_pickle,
get_type,
maybe_parse_user_type,
maybe_parse_many_user_types,
)
from pyrsistent._checked_types import optional as optional_type
from pyrsistent._checked... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@pyrsistent@py3@pyrsistent@_field_common.py@.PATH_END.py |
{
"filename": "_shadowsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/sunburst/outsidetextfont/_shadowsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShadowsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="shadowsrc", parent_name="sunburst.outsidetextfont", **kwargs
):
super(ShadowsrcValidator, self).__init__(
plotly_name=plotly_name,
p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@sunburst@outsidetextfont@_shadowsrc.py@.PATH_END.py |
{
"filename": "_kernels.py",
"repo_name": "MikeSWang/Harmonia",
"repo_path": "Harmonia_extracted/Harmonia-master/harmonia/reader/_kernels.py",
"type": "Python"
} | """
Spherical kernels (:mod:`~harmonia.reader.kernels`)
===========================================================================
Evaluate integration kernels for computing spherical Fourier coupling
coefficients.
"""
import numpy as np
from harmonia.algorithms.bases import spherical_besselj, spherical_harmonic
... | MikeSWangREPO_NAMEHarmoniaPATH_START.@Harmonia_extracted@Harmonia-master@harmonia@reader@_kernels.py@.PATH_END.py |
{
"filename": "build_remedy_call_for_date.py",
"repo_name": "grzeimann/Remedy",
"repo_path": "Remedy_extracted/Remedy-master/build_remedy_call_for_date.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 1 14:47:05 2019
@author: gregz
"""
import glob
import os.path as op
import sys
import tarfile
import numpy as np
from astropy.io import fits
rootdir = '/work/03946/hetdex/maverick'
inst = 'virus'
date = sys.argv[1]
cal = sys.argv[2]
target =... | grzeimannREPO_NAMERemedyPATH_START.@Remedy_extracted@Remedy-master@build_remedy_call_for_date.py@.PATH_END.py |
{
"filename": "sf_error.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/special/sf_error.py",
"type": "Python"
} | # This file is not meant for public use and will be removed in SciPy v2.0.0.
# Use the `scipy.special` namespace for importing the functions
# included below.
from scipy._lib.deprecation import _sub_module_deprecation
__all__ = [ # noqa: F822
'SpecialFunctionWarning',
'SpecialFunctionError'
]
def __dir__()... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@special@sf_error.py@.PATH_END.py |
{
"filename": "skimage_measure_fit.py",
"repo_name": "igrins/plp",
"repo_path": "plp_extracted/plp-master/igrins/procedures/skimage_measure_fit.py",
"type": "Python"
} | import math
import warnings
import numpy as np
from scipy import optimize
def _check_data_dim(data, dim):
if data.ndim != 2 or data.shape[1] != dim:
raise ValueError('Input data must have shape (N, %d).' % dim)
class BaseModel(object):
def __init__(self):
self.params = None
@property
... | igrinsREPO_NAMEplpPATH_START.@plp_extracted@plp-master@igrins@procedures@skimage_measure_fit.py@.PATH_END.py |
{
"filename": "srsgan.py",
"repo_name": "xwzhang98/SREmulator",
"repo_path": "SREmulator_extracted/SREmulator-main/map2map/map2map/models/srsgan.py",
"type": "Python"
} | from math import log2
import torch
import torch.nn as nn
from .narrow import narrow_by
from .resample import Resampler
class G(nn.Module):
def __init__(
self,
in_chan,
out_chan,
scale_factor=16,
chan_base=512,
chan_min=64,
chan_max=512,
cat_noise=Fa... | xwzhang98REPO_NAMESREmulatorPATH_START.@SREmulator_extracted@SREmulator-main@map2map@map2map@models@srsgan.py@.PATH_END.py |
{
"filename": "detectors.py",
"repo_name": "GalSim-developers/GalSim",
"repo_path": "GalSim_extracted/GalSim-main/galsim/detectors.py",
"type": "Python"
} | # Copyright (c) 2012-2023 by the GalSim developers team on GitHub
# https://github.com/GalSim-developers
#
# This file is part of GalSim: The modular galaxy image simulation toolkit.
# https://github.com/GalSim-developers/GalSim
#
# GalSim is free software: redistribution and use in source and binary forms,
# with or w... | GalSim-developersREPO_NAMEGalSimPATH_START.@GalSim_extracted@GalSim-main@galsim@detectors.py@.PATH_END.py |
{
"filename": "test_extended_source.py",
"repo_name": "threeML/astromodels",
"repo_path": "astromodels_extracted/astromodels-master/astromodels/tests/test_extended_source.py",
"type": "Python"
} | from __future__ import print_function
# this prevent a crash in macos. If does not import threeML first the code crashes
# with a segmantiation violation (Need to investigate more)s
try:
from threeML import *
except:
pass
import astropy.io.fits as fits
import astropy.units as u
from astropy import wcs
import n... | threeMLREPO_NAMEastromodelsPATH_START.@astromodels_extracted@astromodels-master@astromodels@tests@test_extended_source.py@.PATH_END.py |
{
"filename": "fft_window.py",
"repo_name": "cosmodesi/pypower",
"repo_path": "pypower_extracted/pypower-main/pypower/fft_window.py",
"type": "Python"
} | """
Implementation of window function estimation, following https://github.com/cosmodesi/GC_derivations,
and https://fr.overleaf.com/read/hpgbwqzmtcxn.
"""
import time
import numpy as np
from scipy import special
from . import mpi, utils
from .fftlog import PowerToCorrelation
from .utils import _make_array
from .fft_... | cosmodesiREPO_NAMEpypowerPATH_START.@pypower_extracted@pypower-main@pypower@fft_window.py@.PATH_END.py |
{
"filename": "test_extint128.py",
"repo_name": "numpy/numpy",
"repo_path": "numpy_extracted/numpy-main/numpy/_core/tests/test_extint128.py",
"type": "Python"
} | import itertools
import contextlib
import operator
import pytest
import numpy as np
import numpy._core._multiarray_tests as mt
from numpy.testing import assert_raises, assert_equal
INT64_MAX = np.iinfo(np.int64).max
INT64_MIN = np.iinfo(np.int64).min
INT64_MID = 2**32
# int128 is not two's complement, the sign bit... | numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@numpy@_core@tests@test_extint128.py@.PATH_END.py |
{
"filename": "ReadMe.md",
"repo_name": "christophmschaefer/miluphcuda",
"repo_path": "miluphcuda_extracted/miluphcuda-main/test_cases/rotating_sphere/ReadMe.md",
"type": "Markdown"
} | ### Rotating sphere test case
Standard SPH cannot handle rigid rotations.
This test case is one of the standard tests to check if the TENSORIAL_CORRECTION
implementation works.
How to run it:
1. copy parameter.h to the root source directory of miluphcuda (usually cp parameter.h ../../)
2. compile
3. copy the binary... | christophmschaeferREPO_NAMEmiluphcudaPATH_START.@miluphcuda_extracted@miluphcuda-main@test_cases@rotating_sphere@ReadMe.md@.PATH_END.py |
{
"filename": "contents.md",
"repo_name": "triton-inference-server/server",
"repo_path": "server_extracted/server-main/docs/contents.md",
"type": "Markdown"
} | <!--
# Copyright 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this l... | triton-inference-serverREPO_NAMEserverPATH_START.@server_extracted@server-main@docs@contents.md@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "CosmoLike/cocoa",
"repo_path": "cocoa_extracted/cocoa-main/Cocoa/projects/README.md",
"type": "Markdown"
} | # Table of contents
1. [The Projects Folder](#appendix_projects_folder)
2. [Adapting the COCOA_LSST_Y1 repository to a new project](#appendix_lsst_y1_new)
1. [Minor changes: the easy way](#appendix_lsst_y1_new_small)
2. [Minor changes: the hard way](#appendix_lsst_y1_new_small2)
3. [Major changes](#appendix_ls... | CosmoLikeREPO_NAMEcocoaPATH_START.@cocoa_extracted@cocoa-main@Cocoa@projects@README.md@.PATH_END.py |
{
"filename": "makesky.py",
"repo_name": "mdwarfgeek/tres-tools",
"repo_path": "tres-tools_extracted/tres-tools-master/makesky.py",
"type": "Python"
} | import numpy
from poly import *
def makesky(wave, flux, deg):
# x is normalised [-1, 1] wavelength.
wavemin = wave[0]
wavemax = wave[-1]
x = (2*wave - (wavemin + wavemax)) / (wavemax - wavemin)
# Remove NaNs.
ww = numpy.isfinite(flux)
# Legendre fit.
coef = cliplegfit(x[ww], flux[ww], deg)
retur... | mdwarfgeekREPO_NAMEtres-toolsPATH_START.@tres-tools_extracted@tres-tools-master@makesky.py@.PATH_END.py |
{
"filename": "overview.md",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/lite/g3doc/examples/auto_complete/overview.md",
"type": "Markdown"
} | # Auto Complete
<table class="tfo-notebook-buttons" align="left">
<td>
<a target="_blank" href="https://www.tensorflow.org/lite/examples/auto_complete/overview"><img src="https://www.tensorflow.org/images/tf_logo_32px.png" />View on TensorFlow.org</a>
</td>
<td>
<a target="_blank" href="https://colab.san... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@lite@g3doc@examples@auto_complete@overview.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "AstroVPK/kali",
"repo_path": "kali_extracted/kali-master/python/__init__.py",
"type": "Python"
} | AstroVPKREPO_NAMEkaliPATH_START.@kali_extracted@kali-master@python@__init__.py@.PATH_END.py | |
{
"filename": "_twodim_base_impl.py",
"repo_name": "numpy/numpy",
"repo_path": "numpy_extracted/numpy-main/numpy/lib/_twodim_base_impl.py",
"type": "Python"
} | """ Basic functions for manipulating 2d arrays
"""
import functools
import operator
from numpy._core._multiarray_umath import _array_converter
from numpy._core.numeric import (
asanyarray, arange, zeros, greater_equal, multiply, ones,
asarray, where, int8, int16, int32, int64, intp, empty, promote_types,
... | numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@numpy@lib@_twodim_base_impl.py@.PATH_END.py |
{
"filename": "eta_phi.py",
"repo_name": "LoganAMorrison/Hazma",
"repo_path": "Hazma_extracted/Hazma-master/hazma/vector_mediator/form_factors/eta_phi.py",
"type": "Python"
} | from dataclasses import dataclass
from typing import Union, overload
import numpy as np
import numpy.typing as npt
from hazma import parameters
from .cross_sections import cross_section_x_x_to_p_v
from .utils import ComplexArray, RealArray, breit_wigner_fw
from .widths import width_v_to_v_p
@dataclass(frozen=True)... | LoganAMorrisonREPO_NAMEHazmaPATH_START.@Hazma_extracted@Hazma-master@hazma@vector_mediator@form_factors@eta_phi.py@.PATH_END.py |
{
"filename": "_tickformatstops.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/histogram/marker/colorbar/_tickformatstops.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickformatstopsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self,
plotly_name="tickformatstops",
parent_name="histogram.marker.colorbar",
**kwargs,
):
super(TickformatstopsValidator, self).__init... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@histogram@marker@colorbar@_tickformatstops.py@.PATH_END.py |
{
"filename": "tableSaxParser.py",
"repo_name": "astropy/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/utils/tap/xmlparser/tableSaxParser.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 xml.sax
from astroquery.utils.ta... | astropyREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@utils@tap@xmlparser@tableSaxParser.py@.PATH_END.py |
{
"filename": "problem.py",
"repo_name": "tigerchenlu98/rebound",
"repo_path": "rebound_extracted/rebound-main/python_examples/horizons/problem.py",
"type": "Python"
} | import matplotlib; matplotlib.use("pdf")
import matplotlib.pyplot as plt
import rebound
import socket
import sys
import os.path
import os
filename = "cache.bin"
solar_system_objects = ["Sun", "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "C/2014 Q2"]
if os.path.isfile(filename):
#... | tigerchenlu98REPO_NAMEreboundPATH_START.@rebound_extracted@rebound-main@python_examples@horizons@problem.py@.PATH_END.py |
{
"filename": "test_factorize.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/indexes/datetimes/methods/test_factorize.py",
"type": "Python"
} | import numpy as np
import pytest
from pandas import (
DatetimeIndex,
Index,
date_range,
factorize,
)
import pandas._testing as tm
class TestDatetimeIndexFactorize:
def test_factorize(self):
idx1 = DatetimeIndex(
["2014-01", "2014-01", "2014-02", "2014-02", "2014-03", "2014-03"... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@indexes@datetimes@methods@test_factorize.py@.PATH_END.py |
{
"filename": "test_verifyCalib.py",
"repo_name": "lsst/cp_verify",
"repo_path": "cp_verify_extracted/cp_verify-main/tests/test_verifyCalib.py",
"type": "Python"
} | # This file is part of cp_verify.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This program is free software: you c... | lsstREPO_NAMEcp_verifyPATH_START.@cp_verify_extracted@cp_verify-main@tests@test_verifyCalib.py@.PATH_END.py |
{
"filename": "DataPropagation.py",
"repo_name": "wlxu/RelicClass",
"repo_path": "RelicClass_extracted/RelicClass-master/RealSpaceInterface/Calc2D/DataPropagation.py",
"type": "Python"
} | import numpy as np
#uses one dimensional interpolation
def PropagateDatawithListOld(k,FValue,zredindex,transferFunctionlist):
return (transferFunctionlist[zredindex](k.ravel()) * FValue.ravel()).reshape(FValue.shape)
def PropagateDatawithList(k, FValue, zredindex, transferFunctionlist):
result = {}
for field... | wlxuREPO_NAMERelicClassPATH_START.@RelicClass_extracted@RelicClass-master@RealSpaceInterface@Calc2D@DataPropagation.py@.PATH_END.py |
{
"filename": "codeofconduct.md",
"repo_name": "21cmfast/21cmEMU",
"repo_path": "21cmEMU_extracted/21cmEMU-main/docs/codeofconduct.md",
"type": "Markdown"
} | ```{include} ../CODE_OF_CONDUCT.md
```
| 21cmfastREPO_NAME21cmEMUPATH_START.@21cmEMU_extracted@21cmEMU-main@docs@codeofconduct.md@.PATH_END.py |
{
"filename": "_bgcolorsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattergeo/hoverlabel/_bgcolorsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BgcolorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="bgcolorsrc", parent_name="scattergeo.hoverlabel", **kwargs
):
super(BgcolorsrcValidator, self).__init__(
plotly_name=plotly_name,
p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattergeo@hoverlabel@_bgcolorsrc.py@.PATH_END.py |
{
"filename": "MakeMasterContbars.py",
"repo_name": "Keck-DataReductionPipelines/KCWI_DRP",
"repo_path": "KCWI_DRP_extracted/KCWI_DRP-master/kcwidrp/primitives/MakeMasterContbars.py",
"type": "Python"
} | from keckdrpframework.primitives.base_img import BaseImg
from kcwidrp.primitives.kcwi_file_primitives import kcwi_fits_reader, \
kcwi_fits_writer, strip_fname , get_unique_STATEID_master_name
import os
import ccdproc
import numpy as np
from astropy.stats import mad_std
class MakeMasterContbars(BaseImg):
"""
... | Keck-DataReductionPipelinesREPO_NAMEKCWI_DRPPATH_START.@KCWI_DRP_extracted@KCWI_DRP-master@kcwidrp@primitives@MakeMasterContbars.py@.PATH_END.py |
{
"filename": "pool__quantize__p.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage-python/pool__quantize__p.md",
"type": "Markdown"
} |
Create a pool from a file and quantize it while loading the data. This compresses the size of the initial dataset and provides an opportunity to load huge datasets that can not be loaded to RAM otherwise.
{% note info %}
The input data should contain only numerical features (other types are not currently supported).... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage-python@pool__quantize__p.md@.PATH_END.py |
{
"filename": "traces.py",
"repo_name": "nu-radio/NuRadioMC",
"repo_path": "NuRadioMC_extracted/NuRadioMC-master/NuRadioReco/eventbrowser/apps/traces.py",
"type": "Python"
} | from __future__ import absolute_import, division, print_function # , unicode_literals
from dash import html, no_update
import NuRadioReco.eventbrowser.apps.trace_plots.rec_electric_field_trace
import NuRadioReco.eventbrowser.apps.trace_plots.rec_electric_field_spectrum
import NuRadioReco.eventbrowser.apps.trace_plots.... | nu-radioREPO_NAMENuRadioMCPATH_START.@NuRadioMC_extracted@NuRadioMC-master@NuRadioReco@eventbrowser@apps@traces.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "jrenaud90/TidalPy",
"repo_path": "TidalPy_extracted/TidalPy-main/TidalPy/utilities/dimensions/__init__.py",
"type": "Python"
} | jrenaud90REPO_NAMETidalPyPATH_START.@TidalPy_extracted@TidalPy-main@TidalPy@utilities@dimensions@__init__.py@.PATH_END.py | |
{
"filename": "_color.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatterpolargl/line/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="scatterpolargl.line", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatterpolargl@line@_color.py@.PATH_END.py |
{
"filename": "test_ddt_log_norm_likelihood.py",
"repo_name": "sibirrer/hierArc",
"repo_path": "hierArc_extracted/hierArc-main/test/test_Likelihood/test_LensLikelihood/test_ddt_log_norm_likelihood.py",
"type": "Python"
} | import numpy as np
import numpy.testing as npt
from hierarc.Likelihood.LensLikelihood.ddt_lognorm_likelihood import (
DdtLogNormLikelihood,
)
from scipy.stats import lognorm
import pytest
class TestTDLikelihoodLogNorm(object):
def setup_method(self):
self.z_L = 0.8
self.z_S = 3.0
self.... | sibirrerREPO_NAMEhierArcPATH_START.@hierArc_extracted@hierArc-main@test@test_Likelihood@test_LensLikelihood@test_ddt_log_norm_likelihood.py@.PATH_END.py |
{
"filename": "_x0.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/waterfall/_x0.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class X0Validator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="x0", parent_name="waterfall", **kwargs):
super(X0Validator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwar... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@waterfall@_x0.py@.PATH_END.py |
{
"filename": "python.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/pytest/py3/_pytest/python.py",
"type": "Python"
} | """Python test discovery, setup and run of test functions."""
import dataclasses
import enum
import fnmatch
import inspect
import itertools
import os
import sys
import types
import warnings
from collections import Counter
from collections import defaultdict
from functools import partial
from pathlib import Path
from ty... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@pytest@py3@_pytest@python.py@.PATH_END.py |
{
"filename": "pygrplib.t.py",
"repo_name": "sherpa/sherpa",
"repo_path": "sherpa_extracted/sherpa-main/extern/grplib-4.9/python/pygrplib.t.py",
"type": "Python"
} | # May 3, 2007
# pygrplib.t.py
# this file
# pygrplib.t
# unix sh script, to activate grpglue.t.py for running regression testing
# OUTFILE and/or INFILE
# global variables exported in grpglue.t
#------------ Beginning of Template ----------------------
# import the packge
from group import *
import numpy
import o... | sherpaREPO_NAMEsherpaPATH_START.@sherpa_extracted@sherpa-main@extern@grplib-4.9@python@pygrplib.t.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "Autostronomy/AutoProf",
"repo_path": "AutoProf_extracted/AutoProf-main/autoprof/autoprofutils/__init__.py",
"type": "Python"
} | from .Diagnostic_Plots import *
from .ImageTransform import *
from .SharedFunctions import *
| AutostronomyREPO_NAMEAutoProfPATH_START.@AutoProf_extracted@AutoProf-main@autoprof@autoprofutils@__init__.py@.PATH_END.py |
{
"filename": "_namelength.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/histogram2d/hoverlabel/_namelength.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NamelengthValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="namelength", parent_name="histogram2d.hoverlabel", **kwargs
):
super(NamelengthValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@histogram2d@hoverlabel@_namelength.py@.PATH_END.py |
{
"filename": "createExtendedSourceFromTemplate.py",
"repo_name": "threeML/astromodels",
"repo_path": "astromodels_extracted/astromodels-master/examples/createExtendedSourceFromTemplate.py",
"type": "Python"
} | # code to show how to create an extended source via uploading a FITs image template
# author: Andrea Albert (aalbert@slac.stanford.edu)
# date: Oct 26, 2016
from threeML import *
# the class SpatialTemplate_2D expects a FITs file that contains a header with the following info: reference pixels (e.g. 'CRPIX1'), pixels... | threeMLREPO_NAMEastromodelsPATH_START.@astromodels_extracted@astromodels-master@examples@createExtendedSourceFromTemplate.py@.PATH_END.py |
{
"filename": "test_galactics.py",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/src/amuse/test/suite/codes_tests/test_galactics.py",
"type": "Python"
} | import os
import os.path
import numpy
import platform
from amuse.community import *
from amuse.test.amusetest import TestWithMPI
from amuse.community.galactics.interface import GalactICsInterface, GalactICs
# Change the default for some GalactICs(-Interface) keyword arguments:
default_options = dict()
# default_optio... | amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@src@amuse@test@suite@codes_tests@test_galactics.py@.PATH_END.py |
{
"filename": "extract_errors.py",
"repo_name": "mcataneo/mochi_class_public",
"repo_path": "mochi_class_public_extracted/mochi_class_public-main/python/extract_errors.py",
"type": "Python"
} | # From the dumped stdout and stderr of a nosetests test_class.py, extract all
# the failed steps.
# Usage: python extract_errors.py output
from __future__ import print_function
import sys
import os
def main(path):
"""
Create a shorter file containing only the errors from nosetests
"""
assert os.path.... | mcataneoREPO_NAMEmochi_class_publicPATH_START.@mochi_class_public_extracted@mochi_class_public-main@python@extract_errors.py@.PATH_END.py |
{
"filename": "Atmo_spectro.py",
"repo_name": "bretonr/Icarus",
"repo_path": "Icarus_extracted/Icarus-master/Icarus/Atmosphere/Atmo_spectro.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE
from __future__ import print_function, division
__all__ = ["Atmo_grid_spectro"]
from ..Utils.import_modules import *
from .. import Utils
from .Atmo import Atmo_grid
######################## class Atmo_grid_spectro ########################
class Atmo_grid_... | bretonrREPO_NAMEIcarusPATH_START.@Icarus_extracted@Icarus-master@Icarus@Atmosphere@Atmo_spectro.py@.PATH_END.py |
{
"filename": "_enabled.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/volume/colorbar/tickformatstop/_enabled.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class EnabledValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name="enabled",
parent_name="volume.colorbar.tickformatstop",
**kwargs,
):
super(EnabledValidator, self).__init__(
plotly_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@volume@colorbar@tickformatstop@_enabled.py@.PATH_END.py |
{
"filename": "TinyReconstruction.py",
"repo_name": "nu-radio/NuRadioMC",
"repo_path": "NuRadioMC_extracted/NuRadioMC-master/NuRadioReco/test/tiny_reconstruction/TinyReconstruction.py",
"type": "Python"
} | #!/usr/bin/env python3
import os
import sys
import datetime
import matplotlib
import matplotlib.pyplot as plt
from NuRadioReco.utilities import units
from NuRadioReco.detector import detector
import NuRadioReco.modules.io.coreas.readCoREAS
import NuRadioReco.modules.io.coreas.simulationSelector
import NuRadioReco.modul... | nu-radioREPO_NAMENuRadioMCPATH_START.@NuRadioMC_extracted@NuRadioMC-master@NuRadioReco@test@tiny_reconstruction@TinyReconstruction.py@.PATH_END.py |
{
"filename": "periods.py",
"repo_name": "lgrcia/paper-nuance",
"repo_path": "paper-nuance_extracted/paper-nuance-main/workflows/tess_injection_recovery/scripts/periods.py",
"type": "Python"
} | import numpy as np
import yaml
from nuance.utils import clean_periods
info = yaml.safe_load(open(snakemake.input[0], "r"))
periods = np.linspace(*snakemake.config["search"]["periods_linspace"])
periods = clean_periods(periods, info["star_period"])
output = snakemake.output[0]
np.save(output, periods)
| lgrciaREPO_NAMEpaper-nuancePATH_START.@paper-nuance_extracted@paper-nuance-main@workflows@tess_injection_recovery@scripts@periods.py@.PATH_END.py |
{
"filename": "ueda2003.py",
"repo_name": "mirochaj/ares",
"repo_path": "ares_extracted/ares-main/input/litdata/ueda2003.py",
"type": "Python"
} | """
Ueda, Y., Akiyama, M., Ohta, K., & Miyaji, T. 2003, ApJ, 598, 886
Notes
-----
There are three different models here:
(1) Pure Luminosity Evolution (`ple`)
(2) Pure Density Evolution (`pde`)
(3) Luminosity Dependent Density Evolution (`ldde`)
The cosmology assumed was (H0, Om, Ol) = (70, 0.3, 0.7)
"""
import num... | mirochajREPO_NAMEaresPATH_START.@ares_extracted@ares-main@input@litdata@ueda2003.py@.PATH_END.py |
{
"filename": "luminosity_model--BPL_3param--parameter_error_estimation.py",
"repo_name": "DebduttaPaul/luminosity_function_of_sGRBs",
"repo_path": "luminosity_function_of_sGRBs_extracted/luminosity_function_of_sGRBs-master/luminosity_model--BPL_3param--parameter_error_estimation.py",
"type": "Python"
} | from __future__ import division
from astropy.io import ascii
from astropy.table import Table
from scipy.optimize import curve_fit
from scipy.integrate import quad, simps
import debduttaS_functions as mf
import specific_functions as sf
import time, pickle, pprint
import numpy as np
import matplotlib.pyplot as plt
plt.rc... | DebduttaPaulREPO_NAMEluminosity_function_of_sGRBsPATH_START.@luminosity_function_of_sGRBs_extracted@luminosity_function_of_sGRBs-master@luminosity_model--BPL_3param--parameter_error_estimation.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "desihub/LSS",
"repo_path": "LSS_extracted/LSS-main/py/LSS/DESI_ke/utils.py",
"type": "Python"
} | from subprocess import check_output
def run_command(cmd, noid=False):
print('Command: {}'.format(cmd))
cmd = cmd.split()
env = {}
# env.update(os.environ) ... | desihubREPO_NAMELSSPATH_START.@LSS_extracted@LSS-main@py@LSS@DESI_ke@utils.py@.PATH_END.py |
{
"filename": "cprint.py",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/pyqtgraph/util/cprint.py",
"type": "Python"
} | """
Cross-platform color text printing
Based on colorama (see pyqtgraph/util/colorama/README.txt)
"""
import sys
from .colorama.win32 import windll
from .colorama.winterm import WinColor, WinStyle, WinTerm
_WIN = sys.platform.startswith('win')
if windll is not None:
winterm = WinTerm()
else:
_WIN = False
de... | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@pyqtgraph@util@cprint.py@.PATH_END.py |
{
"filename": "_plist.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/pyrsistent/py3/pyrsistent/_plist.py",
"type": "Python"
} | from collections.abc import Sequence, Hashable
from numbers import Integral
from functools import reduce
from typing import Generic, TypeVar
T_co = TypeVar('T_co', covariant=True)
class _PListBuilder(object):
"""
Helper class to allow construction of a list without
having to reverse it in the end.
""... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@pyrsistent@py3@pyrsistent@_plist.py@.PATH_END.py |
{
"filename": "input_pipeline.py",
"repo_name": "google/flax",
"repo_path": "flax_extracted/flax-main/examples/vae/input_pipeline.py",
"type": "Python"
} | # Copyright 2024 The Flax 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | googleREPO_NAMEflaxPATH_START.@flax_extracted@flax-main@examples@vae@input_pipeline.py@.PATH_END.py |
{
"filename": "_bgcolorsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter3d/hoverlabel/_bgcolorsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BgcolorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="bgcolorsrc", parent_name="scatter3d.hoverlabel", **kwargs
):
super(BgcolorsrcValidator, self).__init__(
plotly_name=plotly_name,
pa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter3d@hoverlabel@_bgcolorsrc.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "IftachSadeh/ANNZ",
"repo_path": "ANNZ_extracted/ANNZ-master/examples/scripts/__init__.py",
"type": "Python"
} | import commonImports
import fitsFuncs
import generalSettings
import helperFuncs
| IftachSadehREPO_NAMEANNZPATH_START.@ANNZ_extracted@ANNZ-master@examples@scripts@__init__.py@.PATH_END.py |
{
"filename": "visualizer.py",
"repo_name": "Jammy2211/PyAutoLens",
"repo_path": "PyAutoLens_extracted/PyAutoLens-main/autolens/interferometer/model/visualizer.py",
"type": "Python"
} | import autofit as af
from autolens.interferometer.model.plotter_interface import (
PlotterInterfaceInterferometer,
)
from autogalaxy import exc
class VisualizerInterferometer(af.Visualizer):
@staticmethod
def visualize_before_fit(
analysis,
paths: af.AbstractPaths,
model: af.Abstr... | Jammy2211REPO_NAMEPyAutoLensPATH_START.@PyAutoLens_extracted@PyAutoLens-main@autolens@interferometer@model@visualizer.py@.PATH_END.py |
{
"filename": "base.py",
"repo_name": "icrar/daliuge",
"repo_path": "daliuge_extracted/daliuge-master/daliuge-translator/dlg/dropmake/utils/heft/base.py",
"type": "Python"
} | # This file was ported and adapted by chen.wu@icrar.org from:
# https://github.com/mrocklin/heft/blob/master/heft/core.py
# The original copyright statement is as below:
# Copyright (c) 2013 Matthew Rocklin
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are ... | icrarREPO_NAMEdaliugePATH_START.@daliuge_extracted@daliuge-master@daliuge-translator@dlg@dropmake@utils@heft@base.py@.PATH_END.py |
{
"filename": "decoder.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/toml/py2/toml/decoder.py",
"type": "Python"
} | import datetime
import io
from os import linesep
import re
import sys
from toml.tz import TomlTz
if sys.version_info < (3,):
_range = xrange # noqa: F821
else:
unicode = str
_range = range
basestring = str
unichr = chr
def _detect_pathlib_path(p):
if (3, 4) <= sys.version_info:
impo... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@toml@py2@toml@decoder.py@.PATH_END.py |
{
"filename": "makesetup.py",
"repo_name": "bill-cotton/Obit",
"repo_path": "Obit_extracted/Obit-master/ObitSystem/ObitSD/python/makesetup.py",
"type": "Python"
} | # Python/Obit build utillity
# $Id$
#-----------------------------------------------------------------------
# Copyright (C) 2005
# Associated Universities, Inc. Washington DC, USA.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# ... | bill-cottonREPO_NAMEObitPATH_START.@Obit_extracted@Obit-master@ObitSystem@ObitSD@python@makesetup.py@.PATH_END.py |
{
"filename": "_len.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/parcats/line/colorbar/_len.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="len", parent_name="parcats.line.colorbar", **kwargs
):
super(LenValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@parcats@line@colorbar@_len.py@.PATH_END.py |
{
"filename": "power.py",
"repo_name": "Harry45/DESEMU",
"repo_path": "DESEMU_extracted/DESEMU-main/jax_cosmo/power.py",
"type": "Python"
} | # This module computes power spectra
import jax
import jax.numpy as jnp
import jax_cosmo.background as bkgrd
import jax_cosmo.constants as const
import jax_cosmo.transfer as tklib
from jax_cosmo.scipy.integrate import romb
from jax_cosmo.scipy.integrate import simps
from jax_cosmo.scipy.interpolate import interp
from ... | Harry45REPO_NAMEDESEMUPATH_START.@DESEMU_extracted@DESEMU-main@jax_cosmo@power.py@.PATH_END.py |
{
"filename": "ppxf_example_integral_field_high_redshift.ipynb",
"repo_name": "micappe/ppxf_examples",
"repo_path": "ppxf_examples_extracted/ppxf_examples-main/ppxf_example_integral_field_high_redshift.ipynb",
"type": "Jupyter Notebook"
} | # pPXF: Fitting integral-field data at high redshift

## Description
Usage example for the procedure pPXF originally described in
[Cappellari & Emsellem (2004)](http://adsabs.harvard.edu/abs/2004PASP..116..138C),
substantially upgraded in... | micappeREPO_NAMEppxf_examplesPATH_START.@ppxf_examples_extracted@ppxf_examples-main@ppxf_example_integral_field_high_redshift.ipynb@.PATH_END.py |
{
"filename": "_outsidetextfont.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/sunburst/_outsidetextfont.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OutsidetextfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="outsidetextfont", parent_name="sunburst", **kwargs):
super(OutsidetextfontValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@sunburst@_outsidetextfont.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "mavrix93/LightCurvesClassifier",
"repo_path": "LightCurvesClassifier_extracted/LightCurvesClassifier-master/lcc/stars_processing/deciders/__init__.py",
"type": "Python"
} | from .neuron_decider import NeuronDecider
from .supervised_deciders import (QDADec, LDADec, TreeDec, GaussianNBDec, GradBoostDec,
SVCDec, AdaBoostDec, ExtraTreesDec, RandomForestDec)
from .custom_decider import CustomDecider | mavrix93REPO_NAMELightCurvesClassifierPATH_START.@LightCurvesClassifier_extracted@LightCurvesClassifier-master@lcc@stars_processing@deciders@__init__.py@.PATH_END.py |
{
"filename": "style.py",
"repo_name": "desy-multimessenger/nuztf",
"repo_path": "nuztf_extracted/nuztf-main/nuztf/style.py",
"type": "Python"
} | #!/usr/bin/env python3
# coding: utf-8
import logging
import os
import subprocess
import matplotlib.pyplot as plt
import seaborn as sns
from ztfquery.io import LOCALSOURCE
logger = logging.getLogger(__name__)
sns.set_style("white")
# Use latex if available
try:
subprocess.check_output(["which", "latex"])
p... | desy-multimessengerREPO_NAMEnuztfPATH_START.@nuztf_extracted@nuztf-main@nuztf@style.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "jrenaud90/TidalPy",
"repo_path": "TidalPy_extracted/TidalPy-main/TidalPy/Extending/burnman/material/custom/__init__.py",
"type": "Python"
} | from .ice import (
LowPressureIceConst,
HighPressureIceConst,
UnterbornIce,
Water,
HighPressureIce,
IceX_Fu2010,
IceVII_Fu2010,
IceIh_Fu2010
)
from .pyrite import Pyrite
| jrenaud90REPO_NAMETidalPyPATH_START.@TidalPy_extracted@TidalPy-main@TidalPy@Extending@burnman@material@custom@__init__.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.