metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "diaObjectCopy.py",
"repo_name": "lsst-uk/lasair-lsst",
"repo_path": "lasair-lsst_extracted/lasair-lsst-main/pipeline/filter/features/diaObjectCopy.py",
"type": "Python"
} | from features.FeatureGroup import FeatureGroup
class diaObjectCopy(FeatureGroup):
"""Several features are simply copied from the diaObject that Rubin provides"""
_features = [
'timestamp',
'diaObjectId',
'ra', 'decl',
'g_psfFluxMean',
'g_psfFluxMeanErr',
'r_psfF... | lsst-ukREPO_NAMElasair-lsstPATH_START.@lasair-lsst_extracted@lasair-lsst-main@pipeline@filter@features@diaObjectCopy.py@.PATH_END.py |
{
"filename": "test_line_lists.py",
"repo_name": "spacetelescope/jdaviz",
"repo_path": "jdaviz_extracted/jdaviz-main/jdaviz/configs/default/plugins/line_lists/tests/test_line_lists.py",
"type": "Python"
} | import numpy as np
from numpy.testing import assert_allclose
import pytest
import astropy.units as u
from astropy.table import QTable
from specutils import Spectrum1D
from jdaviz.core.marks import SpectralLine
from jdaviz.core.linelists import get_available_linelists
def test_line_lists(specviz_helper):
spec = ... | spacetelescopeREPO_NAMEjdavizPATH_START.@jdaviz_extracted@jdaviz-main@jdaviz@configs@default@plugins@line_lists@tests@test_line_lists.py@.PATH_END.py |
{
"filename": "test_mtl_streams.py",
"repo_name": "desihub/desitarget",
"repo_path": "desitarget_extracted/desitarget-main/py/desitarget/test/test_mtl_streams.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""Test desitarget.mtl specifically for secondary/stream programs.
"""
import os
import unittest
import numpy as np
from astropy.table import Table, join
from desitarget.targetmask import desi_mask as Mx
from desitarget.targetmask... | desihubREPO_NAMEdesitargetPATH_START.@desitarget_extracted@desitarget-main@py@desitarget@test@test_mtl_streams.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/funnel/marker/colorbar/title/__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@funnel@marker@colorbar@title@__init__.py@.PATH_END.py |
{
"filename": "qotree.py",
"repo_name": "spacepy/spacepy",
"repo_path": "spacepy_extracted/spacepy-main/spacepy/sandbox/qotree.py",
"type": "Python"
} | #!/usr/bin/env python
'''
Let's try to make a OQ tree. QO tree. Whatever.
Original by Dan Welling, cleanup and subclassing by Brian Larsen
'''
import numpy as np
def leftdaughter(dim, k):
return k*2**dim-2**dim+2
def rightdaughter(dim, k):
return k*2**dim+1
def mother(dim, k):
return (k+2**dim-2)/2... | spacepyREPO_NAMEspacepyPATH_START.@spacepy_extracted@spacepy-main@spacepy@sandbox@qotree.py@.PATH_END.py |
{
"filename": "test_crossmatch_tns_dump.py",
"repo_name": "lsst-uk/lasair-lsst",
"repo_path": "lasair-lsst_extracted/lasair-lsst-main/tests/unit/services/test_crossmatch_tns_dump.py",
"type": "Python"
} | import context
#import crossmatch_tns_dump
import unittest
class CrossmatchTNSDumpTest(unittest.TestCase):
"""Placeholder"""
if __name__ == '__main__':
import xmlrunner
runner = xmlrunner.XMLTestRunner(output='test-reports')
unittest.main(testRunner=runner)
| lsst-ukREPO_NAMElasair-lsstPATH_START.@lasair-lsst_extracted@lasair-lsst-main@tests@unit@services@test_crossmatch_tns_dump.py@.PATH_END.py |
{
"filename": "javelin_ai_gateway.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/chat_models/javelin_ai_gateway.py",
"type": "Python"
} | import logging
from typing import Any, Dict, List, Mapping, Optional, cast
from langchain_core.callbacks import (
AsyncCallbackManagerForLLMRun,
CallbackManagerForLLMRun,
)
from langchain_core.language_models.chat_models import BaseChatModel
from langchain_core.messages import (
AIMessage,
BaseMessage,... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@chat_models@javelin_ai_gateway.py@.PATH_END.py |
{
"filename": "echelle_orders.py",
"repo_name": "mtalapinto/moes",
"repo_path": "fideos/optics/echelle_orders.py",
"type": "Python"
} | import numpy as np
from optics import transform
import pandas as pd
def init():
wav_N = 500 # 1575
wav_lo = 0.36 # in microns
wav_hi = 0.71
blaze_angle = 70. * np.pi / 180
G = 44.41 * 1e-3 # lines per um
d = 1 / G
# n=
ord_blu = int(2 * d * np.sin(blaze_angle) / wav_lo)
ord_re... | mtalapintoREPO_NAMEmoesPATH_START.@fideos@optics@echelle_orders.py@.PATH_END.py |
{
"filename": "Scatter Density vs. Violin Plot Comparison.ipynb",
"repo_name": "shaoshanglqy/shap-shapley",
"repo_path": "shap-shapley_extracted/shap-shapley-master/notebooks/tree_explainer/Scatter Density vs. Violin Plot Comparison.ipynb",
"type": "Jupyter Notebook"
} | # Scatter Density vs. Violin Plot
This gives several examples to compare the dot density vs. violin plot options for summary_plot.
```python
import xgboost
import shap
# train xgboost model on diabetes data:
X, y = shap.datasets.diabetes()
bst = xgboost.train({"learning_rate": 0.01}, xgboost.DMatrix(X, label=y), 10... | shaoshanglqyREPO_NAMEshap-shapleyPATH_START.@shap-shapley_extracted@shap-shapley-master@notebooks@tree_explainer@Scatter Density vs. Violin Plot Comparison.ipynb@.PATH_END.py |
{
"filename": "run_astropy_tests.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/.pyinstaller/run_astropy_tests.py",
"type": "Python"
} | import os
import shutil
import sys
import erfa # noqa: F401
import matplotlib as mpl
import pytest
import astropy # noqa: F401
if len(sys.argv) == 3 and sys.argv[1] == "--astropy-root":
ROOT = sys.argv[2]
else:
# Make sure we don't allow any arguments to be passed - some tests call
# sys.executable whi... | astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@.pyinstaller@run_astropy_tests.py@.PATH_END.py |
{
"filename": "admin.py",
"repo_name": "simonsobs/TeleView",
"repo_path": "TeleView_extracted/TeleView-main/tvapi/api/admin.py",
"type": "Python"
} | from django.contrib import admin
from .models import StatusModel, SchedulerState, SchedulerQueue
admin.site.register(StatusModel)
admin.site.register(SchedulerState)
admin.site.register(SchedulerQueue)
| simonsobsREPO_NAMETeleViewPATH_START.@TeleView_extracted@TeleView-main@tvapi@api@admin.py@.PATH_END.py |
{
"filename": "dump.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/tools/python3/Lib/sqlite3/dump.py",
"type": "Python"
} | # Mimic the sqlite3 console shell's .dump command
# Author: Paul Kippes <kippesp@gmail.com>
# Every identifier in sql is quoted based on a comment in sqlite
# documentation "SQLite adds new keywords from time to time when it
# takes on new features. So to prevent your code from being broken by
# future enhancements, y... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@python3@Lib@sqlite3@dump.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/pip/vendor/html5lib/filters/__init__.py",
"type": "Python"
} | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@pip@vendor@html5lib@filters@__init__.py@.PATH_END.py | |
{
"filename": "combinations.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/framework/combinations.py",
"type": "Python"
} | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@framework@combinations.py@.PATH_END.py |
{
"filename": "td_mag_likelihood.py",
"repo_name": "sibirrer/hierArc",
"repo_path": "hierArc_extracted/hierArc-main/hierarc/Likelihood/LensLikelihood/td_mag_likelihood.py",
"type": "Python"
} | import numpy as np
from lenstronomy.Util import constants as const
from lenstronomy.Util.data_util import magnitude2cps
class TDMagLikelihood(object):
"""Likelihood of time delays and magnification likelihood.
This likelihood uses linear flux units and linear lensing magnifications.
"""
def __init__... | sibirrerREPO_NAMEhierArcPATH_START.@hierArc_extracted@hierArc-main@hierarc@Likelihood@LensLikelihood@td_mag_likelihood.py@.PATH_END.py |
{
"filename": "logm0_c1_early.py",
"repo_name": "ArgonneCPAC/diffmah",
"repo_path": "diffmah_extracted/diffmah-main/diffmah/diffmahpop_kernels/bimod_logm0_kernels/logm0_c1_early.py",
"type": "Python"
} | """
"""
from collections import OrderedDict, namedtuple
from jax import jit as jjit
from jax import numpy as jnp
from jax import value_and_grad, vmap
from ...bfgs_wrapper import bfgs_adam_fallback
from ...utils import _inverse_sigmoid, _sig_slope, _sigmoid
DEFAULT_LGM0POP_C1_PDICT = OrderedDict(
lgm0pop_c1_ytp_... | ArgonneCPACREPO_NAMEdiffmahPATH_START.@diffmah_extracted@diffmah-main@diffmah@diffmahpop_kernels@bimod_logm0_kernels@logm0_c1_early.py@.PATH_END.py |
{
"filename": "batch.py",
"repo_name": "minoshim/qasMHD",
"repo_path": "qasMHD_extracted/qasMHD-main/2D/MPI/python/batch.py",
"type": "Python"
} | # Python3 script to load and draw MHD-2D(MPI-merged) data
# Packages Numpy and Matplotlib are required.
# Call the script in command line:
# > python batch.py
# Call the script in Python3 interactive mode:
# >>> exec(open("batch.py").read())
import numpy as np
import matplotlib.pyplot as plt
from python import plt2d
... | minoshimREPO_NAMEqasMHDPATH_START.@qasMHD_extracted@qasMHD-main@2D@MPI@python@batch.py@.PATH_END.py |
{
"filename": "lensed_position.py",
"repo_name": "sibirrer/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/lenstronomy/PointSource/Types/lensed_position.py",
"type": "Python"
} | import numpy as np
from lenstronomy.PointSource.Types.base_ps import PSBase, _expand_to_array
__all__ = ["LensedPositions"]
class LensedPositions(PSBase):
"""
class of a lensed point source parameterized as the (multiple) observed image positions
Name within the PointSource module: 'LENSED_POSITION'
... | sibirrerREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@lenstronomy@PointSource@Types@lensed_position.py@.PATH_END.py |
{
"filename": "_textsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/icicle/_textsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="textsrc", parent_name="icicle", **kwargs):
super(TextsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
ed... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@icicle@_textsrc.py@.PATH_END.py |
{
"filename": "ident_result.py",
"repo_name": "yqiuu/spectuner",
"repo_path": "spectuner_extracted/spectuner-master/spectuner/identify/ident_result.py",
"type": "Python"
} | from functools import partial
from collections import defaultdict
from dataclasses import dataclass, field
from copy import deepcopy
import numpy as np
import pandas as pd
def compute_T_single_data(mol_store, config, params, freq_data):
param_mgr = mol_store.create_parameter_manager(config)
T_single_data = d... | yqiuuREPO_NAMEspectunerPATH_START.@spectuner_extracted@spectuner-master@spectuner@identify@ident_result.py@.PATH_END.py |
{
"filename": "50c966c5427a_more_antenna_stats.py",
"repo_name": "HERA-Team/hera_mc",
"repo_path": "hera_mc_extracted/hera_mc-main/alembic/versions/50c966c5427a_more_antenna_stats.py",
"type": "Python"
} | """more_antenna_stats
Revision ID: 50c966c5427a
Revises: edecd502cdd8
Create Date: 2019-07-19 19:59:08.371361+00:00
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "50c966c5427a"
down_revision = "edecd502cdd8"
branch_l... | HERA-TeamREPO_NAMEhera_mcPATH_START.@hera_mc_extracted@hera_mc-main@alembic@versions@50c966c5427a_more_antenna_stats.py@.PATH_END.py |
{
"filename": "truncnorm.py",
"repo_name": "google/jax",
"repo_path": "jax_extracted/jax-main/jax/scipy/stats/truncnorm.py",
"type": "Python"
} | # Copyright 2022 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | googleREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@scipy@stats@truncnorm.py@.PATH_END.py |
{
"filename": "test_cosmicray.py",
"repo_name": "astropy/ccdproc",
"repo_path": "ccdproc_extracted/ccdproc-main/ccdproc/tests/test_cosmicray.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from astropy import units as u
from astropy.utils import NumpyRNGContext
from astropy.utils.exceptions import AstropyDeprecationWarning
from ccdproc.core import (
background_deviation_box,
background_deviation_fil... | astropyREPO_NAMEccdprocPATH_START.@ccdproc_extracted@ccdproc-main@ccdproc@tests@test_cosmicray.py@.PATH_END.py |
{
"filename": "_meta.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattercarpet/_meta.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MetaValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="meta", parent_name="scattercarpet", **kwargs):
super(MetaValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
arra... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattercarpet@_meta.py@.PATH_END.py |
{
"filename": "WISPLFDatabaseManager.py",
"repo_name": "HSTWISP/wisp_analysis",
"repo_path": "wisp_analysis_extracted/wisp_analysis-master/WISPLFDatabaseManager.py",
"type": "Python"
} | import datetime
import numpy as np
import sqlite3
class WISPLFDatabaseManager:
"""
Utility class to manage persistence of line identification data during the
WISP line-finding process.
"""
validMutableFlags = [
'ZEROTH',
'CONTIN',
'MISC'
]
validFlags = [
'... | HSTWISPREPO_NAMEwisp_analysisPATH_START.@wisp_analysis_extracted@wisp_analysis-master@WISPLFDatabaseManager.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "astropy/halotools",
"repo_path": "halotools_extracted/halotools-master/halotools/empirical_models/component_model_templates/__init__.py",
"type": "Python"
} | from .binary_galprop_models import *
from .scatter_models import *
from .prim_galprop_model import PrimGalpropModel
| astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@halotools@empirical_models@component_model_templates@__init__.py@.PATH_END.py |
{
"filename": "misc.py",
"repo_name": "handley-lab/anesthetic",
"repo_path": "anesthetic_extracted/anesthetic-master/anesthetic/plotting/_matplotlib/misc.py",
"type": "Python"
} | import pandas.plotting._matplotlib.misc as misc
from anesthetic.plotting._matplotlib.core import _compress_weights
def scatter_matrix(frame, *args, **kwargs):
# noqa: disable=D103
frame = _compress_weights(kwargs, frame)
return misc.scatter_matrix(frame, *args, **kwargs)
def bootstrap_plot(series, *args... | handley-labREPO_NAMEanestheticPATH_START.@anesthetic_extracted@anesthetic-master@anesthetic@plotting@_matplotlib@misc.py@.PATH_END.py |
{
"filename": "fpfs_sim.py",
"repo_name": "mr-superonion/FPFS",
"repo_path": "FPFS_extracted/FPFS-master/bin/fpfs_sim.py",
"type": "Python"
} | #!/usr/bin/env python
#
# FPFS shear estimator
# Copyright 20220312 Xiangchong Li.
#
# 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 la... | mr-superonionREPO_NAMEFPFSPATH_START.@FPFS_extracted@FPFS-master@bin@fpfs_sim.py@.PATH_END.py |
{
"filename": "_hovertemplate.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterpolar/_hovertemplate.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HovertemplateValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="hovertemplate", parent_name="scatterpolar", **kwargs
):
super(HovertemplateValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterpolar@_hovertemplate.py@.PATH_END.py |
{
"filename": "_ticklen.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/polar/radialaxis/_ticklen.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicklenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="ticklen", parent_name="layout.polar.radialaxis", **kwargs
):
super(TicklenValidator, self).__init__(
plotly_name=plotly_name,
paren... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@polar@radialaxis@_ticklen.py@.PATH_END.py |
{
"filename": "_value.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/volume/colorbar/tickformatstop/_value.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ValueValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="value",
parent_name="volume.colorbar.tickformatstop",
**kwargs
):
super(ValueValidator, self).__init__(
plotly_name=plotl... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@volume@colorbar@tickformatstop@_value.py@.PATH_END.py |
{
"filename": "FILE_FORMATS.md",
"repo_name": "HITS-AIN/PINK",
"repo_path": "PINK_extracted/PINK-master/FILE_FORMATS.md",
"type": "Markdown"
} | # Binary Data Format
Every file can have multiple readable comment lines at first which all must have the character `#` as first letter.
All indices are decoded as 32-bit integer. The file format version is 2. Currently,
only 32-bit floating point numbers will be supported as data type, but we will be prepared for th... | HITS-AINREPO_NAMEPINKPATH_START.@PINK_extracted@PINK-master@FILE_FORMATS.md@.PATH_END.py |
{
"filename": "train.py",
"repo_name": "pytorch/vision",
"repo_path": "vision_extracted/vision-main/references/segmentation/train.py",
"type": "Python"
} | import datetime
import os
import time
import warnings
import presets
import torch
import torch.utils.data
import torchvision
import utils
from coco_utils import get_coco
from torch import nn
from torch.optim.lr_scheduler import PolynomialLR
from torchvision.transforms import functional as F, InterpolationMode
def ge... | pytorchREPO_NAMEvisionPATH_START.@vision_extracted@vision-main@references@segmentation@train.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "astrosmili/smili",
"repo_path": "smili_extracted/smili-master/smili/geomodel/__init__.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
'''
This is a sub-module of smili handling image fits data.
'''
__author__ = "Smili Developer Team"
from . import geomodel
f... | astrosmiliREPO_NAMEsmiliPATH_START.@smili_extracted@smili-master@smili@geomodel@__init__.py@.PATH_END.py |
{
"filename": "find_redshift_fix.py",
"repo_name": "sdss/mangadap",
"repo_path": "mangadap_extracted/mangadap-main/dev/find_redshift_fix.py",
"type": "Python"
} |
import numpy
from astropy.io import fits
from matplotlib import pyplot
from mangadap.util.bitmask import BitMask
from mangadap.config import defaults
sdssbits_file = defaults.sdss_maskbits_file()
targ1bm = BitMask.from_par_file(sdssbits_file, 'MANGA_TARGET1')
targ2bm = BitMask.from_par_file(sdssbits_file, 'MANGA_TA... | sdssREPO_NAMEmangadapPATH_START.@mangadap_extracted@mangadap-main@dev@find_redshift_fix.py@.PATH_END.py |
{
"filename": "_z.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/isosurface/_z.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ZValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="z", parent_name="isosurface", **kwargs):
super(ZValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@isosurface@_z.py@.PATH_END.py |
{
"filename": "_family.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/parcats/tickfont/_family.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="family", parent_name="parcats.tickfont", **kwargs):
super(FamilyValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@parcats@tickfont@_family.py@.PATH_END.py |
{
"filename": "_variant.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/parcoords/line/colorbar/tickfont/_variant.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="variant",
parent_name="parcoords.line.colorbar.tickfont",
**kwargs,
):
super(VariantValidator, self).__init__(
plot... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@parcoords@line@colorbar@tickfont@_variant.py@.PATH_END.py |
{
"filename": "_geometry.py",
"repo_name": "pytorch/vision",
"repo_path": "vision_extracted/vision-main/torchvision/prototype/transforms/_geometry.py",
"type": "Python"
} | from typing import Any, Dict, List, Optional, Sequence, Type, Union
import PIL.Image
import torch
from torchvision import tv_tensors
from torchvision.prototype.tv_tensors import Label, OneHotLabel
from torchvision.transforms.v2 import functional as F, Transform
from torchvision.transforms.v2._utils import (
_Fill... | pytorchREPO_NAMEvisionPATH_START.@vision_extracted@vision-main@torchvision@prototype@transforms@_geometry.py@.PATH_END.py |
{
"filename": "terra.py",
"repo_name": "ramstojh/terra",
"repo_path": "terra_extracted/terra-master/terra/terra.py",
"type": "Python"
} | """
A script for reproducing the observed abundances of a star from the solar abundances of Asplund + 2021.
"""
import pandas as pd
import numpy as np
from astropy import constants as const
import matplotlib.pyplot as plt
from tqdm import trange, tqdm
import pkg_resources
import os
pd.options.display.float_format = "... | ramstojhREPO_NAMEterraPATH_START.@terra_extracted@terra-master@terra@terra.py@.PATH_END.py |
{
"filename": "test_array.py",
"repo_name": "rapidsai/cuml",
"repo_path": "cuml_extracted/cuml-main/python/cuml/cuml/tests/test_array.py",
"type": "Python"
} | #
# Copyright (c) 2020-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | rapidsaiREPO_NAMEcumlPATH_START.@cuml_extracted@cuml-main@python@cuml@cuml@tests@test_array.py@.PATH_END.py |
{
"filename": "miscellaneous.py",
"repo_name": "shadden/celmech",
"repo_path": "celmech_extracted/celmech-master/celmech/miscellaneous.py",
"type": "Python"
} | import numpy as np
from sympy import symbols, series
from scipy.special import k0,k1,p_roots
import warnings
from . import clibcelmech
from .nbody_simulation_utilities import get_canonical_heliocentric_orbits
from ctypes import POINTER,c_int,c_double,c_long
_machine_eps = np.finfo(np.float64).eps
def get_symbol(latex... | shaddenREPO_NAMEcelmechPATH_START.@celmech_extracted@celmech-master@celmech@miscellaneous.py@.PATH_END.py |
{
"filename": "input_pipeline.py",
"repo_name": "google/flax",
"repo_path": "flax_extracted/flax-main/examples/wmt/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@wmt@input_pipeline.py@.PATH_END.py |
{
"filename": "TRES_options.py",
"repo_name": "amusecode/TRES",
"repo_path": "TRES_extracted/TRES-main/TRES_options.py",
"type": "Python"
} | import numpy as np
from amuse.units import units
#--------------------------------------------------------------------------------------------------------------------
# TRES general settings
REPORT_USER_WARNINGS = True
REPORT_DEBUG = False
REPORT_DT = False
REPORT_SN_EVOLUTION = False
REPORT_TRIPLE_EVOLUTION = False ... | amusecodeREPO_NAMETRESPATH_START.@TRES_extracted@TRES-main@TRES_options.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "ESA-Datalabs/XAMI-model",
"repo_path": "XAMI-model_extracted/XAMI-model-main/setup.py",
"type": "Python"
} | from setuptools import setup, find_packages
setup(
name='xami_model',
version='0.1',
packages=find_packages(),
install_requires=[
],
include_package_data=True,
package_data={
'': ['*.yaml', '*.yml', '*.png', '*.jpg'],
},
description='XAMI: XMM-Newton optical Artef... | ESA-DatalabsREPO_NAMEXAMI-modelPATH_START.@XAMI-model_extracted@XAMI-model-main@setup.py@.PATH_END.py |
{
"filename": "test_photometry.py",
"repo_name": "skypyproject/skypy",
"repo_path": "skypy_extracted/skypy-main/skypy/utils/tests/test_photometry.py",
"type": "Python"
} | import numpy as np
import pytest
from skypy.utils.photometry import HAS_SPECLITE
def test_magnitude_functions():
from skypy.utils.photometry import (luminosity_in_band,
luminosity_from_absolute_magnitude,
absolute_magnitude_from_lumi... | skypyprojectREPO_NAMEskypyPATH_START.@skypy_extracted@skypy-main@skypy@utils@tests@test_photometry.py@.PATH_END.py |
{
"filename": "testutils.py",
"repo_name": "aewallin/allantools",
"repo_path": "allantools_extracted/allantools-master/tests/testutils.py",
"type": "Python"
} | """
Useful collection of functions for the allantools test-suite
"""
import sys
import gzip
import numpy
# read a simple data-file with phase or frequency numbers on each line
def read_datafile(filename):
p = []
if filename[-2:]=='gz':
with gzip.open(filename,mode='rt') as f:
for line i... | aewallinREPO_NAMEallantoolsPATH_START.@allantools_extracted@allantools-master@tests@testutils.py@.PATH_END.py |
{
"filename": "NoiseScale.py",
"repo_name": "dokester/BayesicFitting",
"repo_path": "BayesicFitting_extracted/BayesicFitting-master/BayesicFitting/source/NoiseScale.py",
"type": "Python"
} | import numpy as numpy
from astropy import units
import math
from . import Tools
from .HyperParameter import HyperParameter
from .JeffreysPrior import JeffreysPrior
__author__ = "Do Kester"
__year__ = 2020
__license__ = "GPL3"
__version__ = "2.5.3"
__url__ = "https://www.bayesicfitting.nl"
__status__ = "Perpetual Beta... | dokesterREPO_NAMEBayesicFittingPATH_START.@BayesicFitting_extracted@BayesicFitting-master@BayesicFitting@source@NoiseScale.py@.PATH_END.py |
{
"filename": "_textcase.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/choroplethmapbox/hoverlabel/font/_textcase.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextcaseValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="textcase",
parent_name="choroplethmapbox.hoverlabel.font",
**kwargs,
):
super(TextcaseValidator, self).__init__(
p... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@choroplethmapbox@hoverlabel@font@_textcase.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "astronomyk/SimCADO",
"repo_path": "SimCADO_extracted/SimCADO-master/simcado/tests/tests_legacy_simcado/__init__.py",
"type": "Python"
} | astronomykREPO_NAMESimCADOPATH_START.@SimCADO_extracted@SimCADO-master@simcado@tests@tests_legacy_simcado@__init__.py@.PATH_END.py | |
{
"filename": "_opacitysrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/bar/marker/_opacitysrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OpacitysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="opacitysrc", parent_name="bar.marker", **kwargs):
super(OpacitysrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@bar@marker@_opacitysrc.py@.PATH_END.py |
{
"filename": "StepPotSetup.py",
"repo_name": "jronayne/PyTransport",
"repo_path": "PyTransport_extracted/PyTransport-master/Examples/SingleField/StepPotSetup.py",
"type": "Python"
} | ####################################### Setup file for the Step Potential example of Chen et al. ###########################################
import sympy as sym
import numpy as np
import math
import sys
#####################################################################################################################... | jronayneREPO_NAMEPyTransportPATH_START.@PyTransport_extracted@PyTransport-master@Examples@SingleField@StepPotSetup.py@.PATH_END.py |
{
"filename": "_weight.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/scene/yaxis/tickfont/_weight.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WeightValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="weight", parent_name="layout.scene.yaxis.tickfont", **kwargs
):
super(WeightValidator, self).__init__(
plotly_name=plotly_name,
par... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@scene@yaxis@tickfont@_weight.py@.PATH_END.py |
{
"filename": "test.py",
"repo_name": "mlujnie/simple",
"repo_path": "simple_extracted/simple-main/tests/test.py",
"type": "Python"
} | import unittest
class TestStringMethods(unittest.TestCase):
def test_import_simple(self):
from simple.simple import LognormalIntensityMock
lim = LognormalIntensityMock("./tests/test_lim_input.yaml")
print(lim.sigma_beam)
lim.run()
self.assertEqual(lim.N_mesh[0], 16)
... | mlujnieREPO_NAMEsimplePATH_START.@simple_extracted@simple-main@tests@test.py@.PATH_END.py |
{
"filename": "_len.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/choroplethmap/colorbar/_len.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="len", parent_name="choroplethmap.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@choroplethmap@colorbar@_len.py@.PATH_END.py |
{
"filename": "_namelengthsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/sankey/node/hoverlabel/_namelengthsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="namelengthsrc",
parent_name="sankey.node.hoverlabel",
**kwargs
):
super(NamelengthsrcValidator, self).__init__(
plot... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@sankey@node@hoverlabel@_namelengthsrc.py@.PATH_END.py |
{
"filename": "_sizesrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/funnel/hoverlabel/font/_sizesrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="sizesrc", parent_name="funnel.hoverlabel.font", **kwargs
):
super(SizesrcValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@funnel@hoverlabel@font@_sizesrc.py@.PATH_END.py |
{
"filename": "_cobyqa_py.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/optimize/_cobyqa_py.py",
"type": "Python"
} | import numpy as np
from threading import Lock
from ._optimize import _check_unknown_options
COBYQA_LOCK = Lock()
def _minimize_cobyqa(fun, x0, args=(), bounds=None, constraints=(),
callback=None, disp=False, maxfev=None, maxiter=None,
f_target=-np.inf, feasibility_tol=1e-8... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@optimize@_cobyqa_py.py@.PATH_END.py |
{
"filename": "repackage_great3_cut_info.py",
"repo_name": "GalSim-developers/GalSim",
"repo_path": "GalSim_extracted/GalSim-main/devel/external/repackage_great3_cut_info.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@devel@external@repackage_great3_cut_info.py@.PATH_END.py |
{
"filename": "test_stretch_state_mixin.py",
"repo_name": "glue-viz/glue",
"repo_path": "glue_extracted/glue-main/glue/viewers/common/tests/test_stretch_state_mixin.py",
"type": "Python"
} | import pytest
from astropy.visualization import LinearStretch, LogStretch
from glue.core.state_objects import State
from glue.viewers.common.stretch_state_mixin import StretchStateMixin
class ExampleStateWithStretch(State, StretchStateMixin):
pass
def test_not_set_up():
state = ExampleStateWithStretch()
... | glue-vizREPO_NAMEgluePATH_START.@glue_extracted@glue-main@glue@viewers@common@tests@test_stretch_state_mixin.py@.PATH_END.py |
{
"filename": "_templateitemname.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/updatemenu/button/_templateitemname.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TemplateitemnameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="templateitemname",
parent_name="layout.updatemenu.button",
**kwargs,
):
super(TemplateitemnameValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@updatemenu@button@_templateitemname.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterpolargl/marker/line/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="scatterpolargl.marker.line", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterpolargl@marker@line@_color.py@.PATH_END.py |
{
"filename": "_bordercolorsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/sankey/link/hoverlabel/_bordercolorsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BordercolorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="bordercolorsrc",
parent_name="sankey.link.hoverlabel",
**kwargs
):
super(BordercolorsrcValidator, self).__init__(
p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@sankey@link@hoverlabel@_bordercolorsrc.py@.PATH_END.py |
{
"filename": "RI_imaging_QuantifAI_MAP_estimation.ipynb",
"repo_name": "astro-informatics/QuantifAI",
"repo_path": "QuantifAI_extracted/QuantifAI-main/examples/RI_imaging_QuantifAI_MAP_estimation.ipynb",
"type": "Jupyter Notebook"
} | # Compute the MAP example with the `QuantifAI` model
In this notebook we:
- set hyperparameters,
- prepare the synthetic observations,
- define the model, likelihood and prior,
- estimate the MAP reconstruction through a convex optimisation algorithm,
- plot the MAP estimation result and the error.
```python
impor... | astro-informaticsREPO_NAMEQuantifAIPATH_START.@QuantifAI_extracted@QuantifAI-main@examples@RI_imaging_QuantifAI_MAP_estimation.ipynb@.PATH_END.py |
{
"filename": "_line.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/funnel/marker/_line.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LineValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="line", parent_name="funnel.marker", **kwargs):
super(LineValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@funnel@marker@_line.py@.PATH_END.py |
{
"filename": "executor.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/core/_numba/executor.py",
"type": "Python"
} | from __future__ import annotations
import functools
from typing import (
TYPE_CHECKING,
Any,
)
if TYPE_CHECKING:
from collections.abc import Callable
from pandas._typing import Scalar
import numpy as np
from pandas.compat._optional import import_optional_dependency
from pandas.core.util.numba_ impo... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@core@_numba@executor.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "andizq/sf3dmodels",
"repo_path": "sf3dmodels_extracted/sf3dmodels-master/sf3dmodels/tools/__init__.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package provides varied useful tools (Under development).
"""
# Packages may add whatever they like to this file, but
# should keep this content at the top.
# ----------------------------------------------------------------------------
from .._ast... | andizqREPO_NAMEsf3dmodelsPATH_START.@sf3dmodels_extracted@sf3dmodels-master@sf3dmodels@tools@__init__.py@.PATH_END.py |
{
"filename": "_rangebreaks.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/yaxis/_rangebreaks.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class RangebreaksValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(self, plotly_name="rangebreaks", parent_name="layout.yaxis", **kwargs):
super(RangebreaksValidator, self).__init__(
plotly_name=plotly_name,
parent_name... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@yaxis@_rangebreaks.py@.PATH_END.py |
{
"filename": "records.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/numpy/py2/numpy/core/records.py",
"type": "Python"
} | """
Record Arrays
=============
Record arrays expose the fields of structured arrays as properties.
Most commonly, ndarrays contain elements of a single type, e.g. floats,
integers, bools etc. However, it is possible for elements to be combinations
of these using structured types, such as::
>>> a = np.array([(1, 2... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@numpy@py2@numpy@core@records.py@.PATH_END.py |
{
"filename": "create_draft_message.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/tools/office365/create_draft_message.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import O365CreateDraftMessage
from langchain_community.tools.office365.create_draft_message import (
CreateDraftMessageSchema,
)
# Create a way to dynamically look up ... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@tools@office365@create_draft_message.py@.PATH_END.py |
{
"filename": "prop_define_entrance.py",
"repo_name": "ajeldorado/falco-python",
"repo_path": "falco-python_extracted/falco-python-master/falco/proper/prop_define_entrance.py",
"type": "Python"
} | # Copyright 2016, 2017 California Institute of Technology
# Users must agree to abide by the restrictions listed in the
# file "LegalStuff.txt" in the PROPER library directory.
#
# PROPER developed at Jet Propulsion Laboratory/California Inst. Technology
# Original IDL version by John Krist
# Python transla... | ajeldoradoREPO_NAMEfalco-pythonPATH_START.@falco-python_extracted@falco-python-master@falco@proper@prop_define_entrance.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "ryanhausen/fitsmap",
"repo_path": "fitsmap_extracted/fitsmap-master/setup.py",
"type": "Python"
} | """
MIT License
Copyright 2023 Ryan Hausen and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge... | ryanhausenREPO_NAMEfitsmapPATH_START.@fitsmap_extracted@fitsmap-master@setup.py@.PATH_END.py |
{
"filename": "rotations.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/astropy/modeling/rotations.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Implements rotations, including spherical rotations as defined in WCS Paper II [1]_.
`RotateNative2Celestial` and `RotateCelestial2Native` follow the convention in
WCS Paper II to rotate to/from a native sphere and the celestial sphere.
The implement... | astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@modeling@rotations.py@.PATH_END.py |
{
"filename": "anglescan3.py",
"repo_name": "wmpg/Supracenter",
"repo_path": "Supracenter_extracted/Supracenter-master/supra/Supracenter/anglescan3.py",
"type": "Python"
} | import numpy as np
from wmpl.Utils.TrajConversions import latLonAlt2ECEF, ecef2LatLonAlt
from supra.Utils.Classes import *
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
def findLayer(h, z_profile):
found_layer = None
for ll, layer in enumerate(z_profile):
if layer[0] <= h:
... | wmpgREPO_NAMESupracenterPATH_START.@Supracenter_extracted@Supracenter-master@supra@Supracenter@anglescan3.py@.PATH_END.py |
{
"filename": "_autotypenumbers.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/scene/zaxis/_autotypenumbers.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class AutotypenumbersValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="autotypenumbers", parent_name="layout.scene.zaxis", **kwargs
):
super(AutotypenumbersValidator, self).__init__(
plotly_name=plotly_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@scene@zaxis@_autotypenumbers.py@.PATH_END.py |
{
"filename": "test_dask_nearest_neighbors.py",
"repo_name": "rapidsai/cuml",
"repo_path": "cuml_extracted/cuml-main/python/cuml/cuml/tests/dask/test_dask_nearest_neighbors.py",
"type": "Python"
} | # Copyright (c) 2020-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | rapidsaiREPO_NAMEcumlPATH_START.@cuml_extracted@cuml-main@python@cuml@cuml@tests@dask@test_dask_nearest_neighbors.py@.PATH_END.py |
{
"filename": "pvextractor.py",
"repo_name": "radio-astro-tools/pvextractor",
"repo_path": "pvextractor_extracted/pvextractor-main/pvextractor/pvextractor.py",
"type": "Python"
} | from __future__ import print_function
import numpy as np
import warnings
from astropy import units as u
from astropy.io.fits import PrimaryHDU, ImageHDU, Header
from .utils.wcs_utils import get_spatial_scale, sanitize_wcs
from .geometry import extract_slice
from .geometry import path as paths
from .utils.wcs_slicing... | radio-astro-toolsREPO_NAMEpvextractorPATH_START.@pvextractor_extracted@pvextractor-main@pvextractor@pvextractor.py@.PATH_END.py |
{
"filename": "test_gs_fcoll.py",
"repo_name": "mirochaj/ares",
"repo_path": "ares_extracted/ares-main/tests/adv/test_gs_fcoll.py",
"type": "Python"
} | """
test_21cm_basic.py
Author: Jordan Mirocha
Affiliation: University of Colorado at Boulder
Created on: Mon Oct 1 15:23:53 2012
Description: Make sure the global 21-cm signal calculator works.
"""
import ares
import matplotlib.pyplot as pl
def test():
sim = ares.simulations.Global21cm(verbose=False, progres... | mirochajREPO_NAMEaresPATH_START.@ares_extracted@ares-main@tests@adv@test_gs_fcoll.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "astropenguin/ndradex",
"repo_path": "ndradex_extracted/ndradex-main/docs/conf.py",
"type": "Python"
} | # Project information
author = "Akio Taniguchi"
copyright = "2019-2023 Akio Taniguchi"
# General configuration
extensions = [
"myst_parser",
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx.ext.autosummary",
]
templates_path = ["_templates"]
exclude_patterns = ["_build",... | astropenguinREPO_NAMEndradexPATH_START.@ndradex_extracted@ndradex-main@docs@conf.py@.PATH_END.py |
{
"filename": "massdef.py",
"repo_name": "LSSTDESC/CCL",
"repo_path": "CCL_extracted/CCL-master/pyccl/halos/massdef.py",
"type": "Python"
} | __all__ = ("mass2radius_lagrangian", "convert_concentration", "MassDef",
"MassDef200m", "MassDef200c", "MassDef500c", "MassDefVir",
"MassDefFof", "mass_translator",)
from functools import cached_property
import numpy as np
from .. import CCLAutoRepr, CCLNamedClass, lib, check
from . import Conc... | LSSTDESCREPO_NAMECCLPATH_START.@CCL_extracted@CCL-master@pyccl@halos@massdef.py@.PATH_END.py |
{
"filename": "pymc_wrapper.py",
"repo_name": "sbi-dev/sbi",
"repo_path": "sbi_extracted/sbi-main/sbi/samplers/mcmc/pymc_wrapper.py",
"type": "Python"
} | from typing import Any, Callable, Optional
import numpy as np
import pymc
import pytensor.tensor as pt
import torch
from arviz.data import InferenceData
from sbi.utils.torchutils import tensor2numpy
class PyMCPotential(pt.Op): # type: ignore
"""PyTensor Op wrapping a callable potential function"""
itypes ... | sbi-devREPO_NAMEsbiPATH_START.@sbi_extracted@sbi-main@sbi@samplers@mcmc@pymc_wrapper.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "tslearn-team/tslearn",
"repo_path": "tslearn_extracted/tslearn-main/docs/conf.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
#
# tslearn documentation build configuration file, created by
# sphinx-quickstart on Mon May 8 21:34:49 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | tslearn-teamREPO_NAMEtslearnPATH_START.@tslearn_extracted@tslearn-main@docs@conf.py@.PATH_END.py |
{
"filename": "iaf.py",
"repo_name": "ML4GW/amplfi",
"repo_path": "amplfi_extracted/amplfi-main/amplfi/train/architectures/flows/iaf.py",
"type": "Python"
} | import torch
import torch.distributions as dist
from pyro.distributions.conditional import ConditionalComposeTransformModule
from pyro.distributions.transforms import ConditionalAffineAutoregressive
from pyro.nn import ConditionalAutoRegressiveNN
from . import FlowArchitecture
class InverseAutoregressiveFlow(FlowArc... | ML4GWREPO_NAMEamplfiPATH_START.@amplfi_extracted@amplfi-main@amplfi@train@architectures@flows@iaf.py@.PATH_END.py |
{
"filename": "test_cookbook.py",
"repo_name": "healpy/healpy",
"repo_path": "healpy_extracted/healpy-main/test/test_cookbook.py",
"type": "Python"
} | def test_is_seq():
import numpy as np
from healpy.cookbook import is_seq
assert not is_seq(None)
assert not is_seq(1)
assert not is_seq(1.)
assert not is_seq(np.array(1))
assert is_seq((1, 2, 3))
assert is_seq([1, 2, 3])
assert is_seq(np.array([1, 2, 3]))
assert is_seq(np.array(... | healpyREPO_NAMEhealpyPATH_START.@healpy_extracted@healpy-main@test@test_cookbook.py@.PATH_END.py |
{
"filename": "am.py",
"repo_name": "orlox/mesa_input_data",
"repo_path": "mesa_input_data_extracted/mesa_input_data-master/2016_double_bh/scripts/am.py",
"type": "Python"
} | #!/usr/bin/env python
from pylab import *
import matplotlib.pyplot as plt
from matplotlib import rc
import mesa as ms
import math
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes
from mpl_toolkits.axes_grid1.inset_locator import mark_inset
import matplotlib.patheffects as path_effects
import os
impor... | orloxREPO_NAMEmesa_input_dataPATH_START.@mesa_input_data_extracted@mesa_input_data-master@2016_double_bh@scripts@am.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "dingswin/psrvlbireduce",
"repo_path": "psrvlbireduce_extracted/psrvlbireduce-master/README.md",
"type": "Markdown"
} | About psrvlbireduce:
This project provides pipeline for VLBI data reduction, with special focus on VLBI astrometry.
The main data reduction code, written in python-based parseltongue (Kettenis et
al. 2006), is vlbi_astrometry.py calling classes and functions from
vlbireduce.py and support_vlbireduce.py. The latter two... | dingswinREPO_NAMEpsrvlbireducePATH_START.@psrvlbireduce_extracted@psrvlbireduce-master@README.md@.PATH_END.py |
{
"filename": "automatic_differentiation.ipynb",
"repo_name": "scikit-hep/iminuit",
"repo_path": "iminuit_extracted/iminuit-main/doc/notebooks/automatic_differentiation.ipynb",
"type": "Jupyter Notebook"
} | # Automatic differentiation with JAX
Here we look into automatic differentiation, which can speed up fits with very many parameters.
iminuit's minimization algorithm MIGRAD uses a mix of gradient descent and Newton's method to find the minimum. Both require a first derivative, which MIGRAD usually computes numericall... | scikit-hepREPO_NAMEiminuitPATH_START.@iminuit_extracted@iminuit-main@doc@notebooks@automatic_differentiation.ipynb@.PATH_END.py |
{
"filename": "io.py",
"repo_name": "HERA-Team/hera_cal",
"repo_path": "hera_cal_extracted/hera_cal-main/hera_cal/io.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Copyright 2019 the HERA Project
# Licensed under the MIT License
from __future__ import annotations
import numpy as np
from collections import OrderedDict as odict
import operator
import os
import copy
import warnings
import inspect
from functools import reduce
from collections.abc import Ite... | HERA-TeamREPO_NAMEhera_calPATH_START.@hera_cal_extracted@hera_cal-main@hera_cal@io.py@.PATH_END.py |
{
"filename": "Examples Green Taxi.ipynb",
"repo_name": "NannyML/nannyml",
"repo_path": "nannyml_extracted/nannyml-main/docs/example_notebooks/Examples Green Taxi.ipynb",
"type": "Jupyter Notebook"
} | ```python
# Uncomment if you are runnning this on Google Colab
# !pip install nannyml
# !pip install numpy==1.22
```
```python
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import mean_absolute_error
from lightgbm import LGBMRegressor, plot_importance
import nannyml as ... | NannyMLREPO_NAMEnannymlPATH_START.@nannyml_extracted@nannyml-main@docs@example_notebooks@Examples Green Taxi.ipynb@.PATH_END.py |
{
"filename": "sun_mask.py",
"repo_name": "TianlaiProject/tlpipe",
"repo_path": "tlpipe_extracted/tlpipe-master/tlpipe/timestream/sun_mask.py",
"type": "Python"
} | """Mask the data when signal of the Sun is strong.
Inheritance diagram
-------------------
.. inheritance-diagram:: Mask
:parts: 2
"""
import numpy as np
import ephem
import aipy as a
import timestream_task
class Mask(timestream_task.TimestreamTask):
"""Mask the data when signal of the Sun is strong."""
... | TianlaiProjectREPO_NAMEtlpipePATH_START.@tlpipe_extracted@tlpipe-master@tlpipe@timestream@sun_mask.py@.PATH_END.py |
{
"filename": "apero_loc_nirps_he.py",
"repo_name": "njcuk9999/apero-drs",
"repo_path": "apero-drs_extracted/apero-drs-main/apero/recipes/nirps_he/apero_loc_nirps_he.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
apero_loc_nirps_he.py [obs dir] [files]
APERO localisation calibration recipe for NIRPS HE
Created on 2019-05-14 at 09:40
@author: cook
"""
from typing import Any, Dict, List, Optional, Tuple, Union
from apero import lang
from apero.base import base
from apero.core ... | njcuk9999REPO_NAMEapero-drsPATH_START.@apero-drs_extracted@apero-drs-main@apero@recipes@nirps_he@apero_loc_nirps_he.py@.PATH_END.py |
{
"filename": "_templateitemname.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/streamtube/colorbar/tickformatstop/_templateitemname.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TemplateitemnameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="templateitemname",
parent_name="streamtube.colorbar.tickformatstop",
**kwargs,
):
super(TemplateitemnameValidator, self)._... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@streamtube@colorbar@tickformatstop@_templateitemname.py@.PATH_END.py |
{
"filename": "test_measurementset.py",
"repo_name": "lwa-project/lsl",
"repo_path": "lsl_extracted/lsl-main/tests/test_measurementset.py",
"type": "Python"
} | """
Unit test for the lsl.writer.measurementset module.
"""
import os
import time
import ephem
import unittest
import tempfile
import numpy as np
import shutil
from lsl.common import stations as lwa_common
from lsl.correlator import uvutils
from lsl.writer import measurementset
from lsl.astro import unix_to_taimjd
... | lwa-projectREPO_NAMElslPATH_START.@lsl_extracted@lsl-main@tests@test_measurementset.py@.PATH_END.py |
{
"filename": "_ticktextsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattercarpet/marker/colorbar/_ticktextsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicktextsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="ticktextsrc",
parent_name="scattercarpet.marker.colorbar",
**kwargs
):
super(TicktextsrcValidator, self).__init__(
plo... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattercarpet@marker@colorbar@_ticktextsrc.py@.PATH_END.py |
{
"filename": "prepare_ttv_fit.py",
"repo_name": "MNGuenther/allesfitter",
"repo_path": "allesfitter_extracted/allesfitter-master/allesfitter/prepare_ttv_fit.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 31 15:50:31 2020
@author:
Dr. Maximilian N. Günther
European Space Agency (ESA)
European Space Research and Technology Centre (ESTEC)
Keplerlaan 1, 2201 AZ Noordwijk, The Netherlands
Email: maximilian.guenther@esa.int
GitHub: mnguenther
Twitter: m_... | MNGuentherREPO_NAMEallesfitterPATH_START.@allesfitter_extracted@allesfitter-master@allesfitter@prepare_ttv_fit.py@.PATH_END.py |
{
"filename": "qc_wavelength.py",
"repo_name": "LCOGT/banzai-nres",
"repo_path": "banzai-nres_extracted/banzai-nres-main/banzai_nres/qc/qc_wavelength.py",
"type": "Python"
} | import numpy as np
from banzai.stages import Stage
from banzai.utils import qc
from banzai.logs import get_logger
from astropy import constants
from astropy import units
from xwavecal.utils.wavelength_utils import find_nearest
from banzai.utils.stats import robust_standard_deviation
logger = get_logger()
class Asse... | LCOGTREPO_NAMEbanzai-nresPATH_START.@banzai-nres_extracted@banzai-nres-main@banzai_nres@qc@qc_wavelength.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/numpy/py2/numpy/matrixlib/__init__.py",
"type": "Python"
} | """Sub-package containing the matrix class and related functions.
"""
from __future__ import division, absolute_import, print_function
from .defmatrix import *
__all__ = defmatrix.__all__
from numpy._pytesttester import PytestTester
test = PytestTester(__name__)
del PytestTester
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@numpy@py2@numpy@matrixlib@__init__.py@.PATH_END.py |
{
"filename": "SF_class.ipynb",
"repo_name": "oyaron/NGSF",
"repo_path": "NGSF_extracted/NGSF-main/SF_class.ipynb",
"type": "Jupyter Notebook"
} | ```python
#Make the json file into the first argument
import sys
sys.argv[1] = 'parameters.json'
from NGSF.sf_class import *
```
```python
from NGSF.params import Parameters
Parameters = Parameters(data)
```
```python
this_supernova = Superfit()
```
# Before the fit
```python
this_supernova.plot()
```
![p... | oyaronREPO_NAMENGSFPATH_START.@NGSF_extracted@NGSF-main@SF_class.ipynb@.PATH_END.py |
{
"filename": "main.py",
"repo_name": "cdslaborg/paramonte",
"repo_path": "paramonte_extracted/paramonte-main/example/fortran/pm_polation/getExtrap/main.py",
"type": "Python"
} | #!/usr/bin/env python
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import glob
import sys
linewidth = 2
fontsize = 17
for kind in ["neimean", "neinear", "neinext", "neiprev", "piwilin", "monopol", "rungeEffect"]:
crd = pd.read_csv(glob.glob("*."+kind+".crd.txt")[0], delimiter = ",")
... | cdslaborgREPO_NAMEparamontePATH_START.@paramonte_extracted@paramonte-main@example@fortran@pm_polation@getExtrap@main.py@.PATH_END.py |
{
"filename": "RSD_benchmark.ipynb",
"repo_name": "LSSTDESC/CCL",
"repo_path": "CCL_extracted/CCL-master/examples/RSD_benchmark.ipynb",
"type": "Jupyter Notebook"
} | ```python
import numpy as np
import pyccl as ccl
import py_cosmo_mad as csm
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import ticker, cm
from mpl_toolkits.mplot3d import axes3d
#from matplotlib.ticker import LinearLocator, FormatStrFormatter
```
--------------------------------------------... | LSSTDESCREPO_NAMECCLPATH_START.@CCL_extracted@CCL-master@examples@RSD_benchmark.ipynb@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.