metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "diverging.py",
"repo_name": "jiffyclub/palettable",
"repo_path": "palettable_extracted/palettable-master/palettable/cmocean/diverging.py",
"type": "Python"
} | """
Diverging color maps from the cmocean package:
https://github.com/matplotlib/cmocean.
"""
from __future__ import absolute_import
import itertools
from . import cmoceanpalette
from . import colormaps
from .. import utils
_PALETTE_TYPE = 'diverging'
_NAMES_TO_DATA = {
'Balance': colormaps._BALANCE,
'Curl'... | jiffyclubREPO_NAMEpalettablePATH_START.@palettable_extracted@palettable-master@palettable@cmocean@diverging.py@.PATH_END.py |
{
"filename": "lens_distribution.py",
"repo_name": "sibirrer/hierArc",
"repo_path": "hierArc_extracted/hierArc-main/hierarc/Sampling/Distributions/lens_distribution.py",
"type": "Python"
} | import numpy as np
class LensDistribution(object):
"""Class to draw lens parameters of individual lens from distributions."""
def __init__(
self,
lambda_mst_distribution="NONE",
gamma_in_sampling=False,
gamma_in_distribution="NONE",
log_m2l_sampling=False,
log_... | sibirrerREPO_NAMEhierArcPATH_START.@hierArc_extracted@hierArc-main@hierarc@Sampling@Distributions@lens_distribution.py@.PATH_END.py |
{
"filename": "test_pub_sub_client.py",
"repo_name": "mwvgroup/Pitt-Google-Broker",
"repo_path": "Pitt-Google-Broker_extracted/Pitt-Google-Broker-master/tests/test_pub_sub_client.py",
"type": "Python"
} | """This file provides tests for the ``broker.pub_sub_client`` module."""
import os
from pathlib import Path
import unittest
from deepdiff import DeepDiff
from broker import pub_sub_client as psc
from broker.alert_ingestion.gen_valid_schema import _load_Avro
PROJECT_ID = os.getenv('GOOGLE_CLOUD_PROJECT')
test_alerts_... | mwvgroupREPO_NAMEPitt-Google-BrokerPATH_START.@Pitt-Google-Broker_extracted@Pitt-Google-Broker-master@tests@test_pub_sub_client.py@.PATH_END.py |
{
"filename": "histograms_plot.ipynb",
"repo_name": "snad-space/zwad",
"repo_path": "zwad_extracted/zwad-master/notebooks/histograms_plot.ipynb",
"type": "Jupyter Notebook"
} | ```python
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import sys
import warnings
warnings.filterwarnings("ignore")
from zwad.utils import latex_feature_names
```
# Pretty $\LaTeX$ feature names, colors and field l... | snad-spaceREPO_NAMEzwadPATH_START.@zwad_extracted@zwad-master@notebooks@histograms_plot.ipynb@.PATH_END.py |
{
"filename": "config.py",
"repo_name": "crossbario/crossbar",
"repo_path": "crossbar_extracted/crossbar-master/crossbar/shell/config.py",
"type": "Python"
} | ###############################################################################
#
# Crossbar.io Shell
# Copyright (c) typedef int GmbH. Licensed under EUPLv1.2.
#
###############################################################################
import os
from six.moves import configparser
# pair a node from a node publ... | crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@crossbar@shell@config.py@.PATH_END.py |
{
"filename": "bench_kmeans.py",
"repo_name": "facebookresearch/faiss",
"repo_path": "faiss_extracted/faiss-main/benchs/bench_all_ivf/bench_kmeans.py",
"type": "Python"
} | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import numpy as np
import faiss
import argparse
import datasets
from datasets import sanitize
###################################... | facebookresearchREPO_NAMEfaissPATH_START.@faiss_extracted@faiss-main@benchs@bench_all_ivf@bench_kmeans.py@.PATH_END.py |
{
"filename": "monkeypatch.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/pytest/py2/_pytest/monkeypatch.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
""" monkeypatching and mocking functionality. """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import re
import sys
import warnings
from contextlib import contextmanager
import six
import pytest
from _pytest.fixtures i... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@pytest@py2@_pytest@monkeypatch.py@.PATH_END.py |
{
"filename": "AUTHORS.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/libs/openjpeg/AUTHORS.md",
"type": "Markdown"
} | # Authors of OpenJPEG
See also [THANKS](https://github.com/uclouvain/openjpeg/blob/master/THANKS.md)
David Janssens designed and implemented the first version of OpenJPEG.
Kaori Hagihara designed and implemented the first version of OpenJPIP.
Jerome Fimes implemented the alpha version of OpenJPEG 2.0.
Giuseppe Baru... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@libs@openjpeg@AUTHORS.md@.PATH_END.py |
{
"filename": "test_gpu_examples.py",
"repo_name": "huggingface/peft",
"repo_path": "peft_extracted/peft-main/tests/test_gpu_examples.py",
"type": "Python"
} | # Copyright 2023-present the HuggingFace Inc. team.
# 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 a... | huggingfaceREPO_NAMEpeftPATH_START.@peft_extracted@peft-main@tests@test_gpu_examples.py@.PATH_END.py |
{
"filename": "_version.py",
"repo_name": "NickSwainston/pulsar_spectra",
"repo_path": "pulsar_spectra_extracted/pulsar_spectra-main/pulsar_spectra/_version.py",
"type": "Python"
} | __version__ = '2.0.4' | NickSwainstonREPO_NAMEpulsar_spectraPATH_START.@pulsar_spectra_extracted@pulsar_spectra-main@pulsar_spectra@_version.py@.PATH_END.py |
{
"filename": "_stream.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/surface/_stream.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Stream(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "surface"
_path_str = "surface.stream"
_valid_props = {"maxpoints", "token"}
# maxpoints... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@surface@_stream.py@.PATH_END.py |
{
"filename": "_sizesrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter/marker/_sizesrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="sizesrc", parent_name="scatter.marker", **kwargs):
super(SizesrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter@marker@_sizesrc.py@.PATH_END.py |
{
"filename": "Results_file_save.py",
"repo_name": "astrom-tom/SPARTAN",
"repo_path": "SPARTAN_extracted/SPARTAN-master/spartan/Results_file_save.py",
"type": "Python"
} | '''
The SPARTAN Project
-------------------
This module save results in the disk
@author: R. THOMAS
@year: 2016
@place: UV/LAM/UCBJ
@License: GPL v3.0 - see LICENCE.txt
'''
##Python LIB
import os
import sys
##############
###Third party
import numpy
import h5py
###############
def save_to_file_fail(resfile, galaxy, ... | astrom-tomREPO_NAMESPARTANPATH_START.@SPARTAN_extracted@SPARTAN-master@spartan@Results_file_save.py@.PATH_END.py |
{
"filename": "_ticksuffix.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/bar/marker/colorbar/_ticksuffix.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicksuffixValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="ticksuffix", parent_name="bar.marker.colorbar", **kwargs
):
super(TicksuffixValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@bar@marker@colorbar@_ticksuffix.py@.PATH_END.py |
{
"filename": "YT_volrender_tutorial2.ipynb",
"repo_name": "geodynamics/Rayleigh",
"repo_path": "Rayleigh_extracted/Rayleigh-main/post_processing/YT_volrender_tutorial2.ipynb",
"type": "Jupyter Notebook"
} | # Tutorial 2: Converting Spherical Quantities to Cartesian Quantities before Volume Rendering
This notebook provides an example of how to take Rayleigh Spherical_3D output quantities (e.g. V_r, V_theta, V_phi or B_r, B_theta, B_phi) and convert them into Cartesian quantities (e.g. V_x, V_y, V_z or B_x, B_y, B_z). This... | geodynamicsREPO_NAMERayleighPATH_START.@Rayleigh_extracted@Rayleigh-main@post_processing@YT_volrender_tutorial2.ipynb@.PATH_END.py |
{
"filename": "_duration.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/slider/transition/_duration.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class DurationValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="duration", parent_name="layout.slider.transition", **kwargs
):
super(DurationValidator, self).__init__(
plotly_name=plotly_name,
p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@slider@transition@_duration.py@.PATH_END.py |
{
"filename": "analyse_Z.ipynb",
"repo_name": "astrockragh/Mangrove",
"repo_path": "Mangrove_extracted/Mangrove-main/analysis/analyse_Z.ipynb",
"type": "Jupyter Notebook"
} | ```python
import pickle, os, torch
import os.path as osp
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from sklearn.metrics import r2_score
from mpl_toolkits.axes_grid1 import make_axes_locatable
```
```python
from matplotlib.ticker import NullFormatter
from scipy import stats
from matpl... | astrockraghREPO_NAMEMangrovePATH_START.@Mangrove_extracted@Mangrove-main@analysis@analyse_Z.ipynb@.PATH_END.py |
{
"filename": "plot_routines.py",
"repo_name": "tcassanelli/pyoof",
"repo_path": "pyoof_extracted/pyoof-master/pyoof/plot_routines.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Tomas Cassanelli
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
from mpl_toolkits.axes_grid1 import make_axes_locatable
from scipy import interpolate
from astropy.table import Table
from astropy import units as apu
imp... | tcassanelliREPO_NAMEpyoofPATH_START.@pyoof_extracted@pyoof-master@pyoof@plot_routines.py@.PATH_END.py |
{
"filename": "autocall.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/ipython/py2/IPython/core/autocall.py",
"type": "Python"
} | # encoding: utf-8
"""
Autocall capabilities for IPython.core.
Authors:
* Brian Granger
* Fernando Perez
* Thomas Kluyver
Notes
-----
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipython@py2@IPython@core@autocall.py@.PATH_END.py |
{
"filename": "model_base.py",
"repo_name": "simonsobs/nextline-rdb",
"repo_path": "nextline-rdb_extracted/nextline-rdb-main/src/nextline_rdb/alembic/models/rev_f9a742bb2297/base/model_base.py",
"type": "Python"
} | from sqlalchemy import MetaData
from sqlalchemy.orm import DeclarativeBase
from .convention import NAMING_CONVENTION
from .repr_ import ReprMixin
metadata = MetaData(naming_convention=dict(NAMING_CONVENTION))
class Model(ReprMixin, DeclarativeBase):
metadata = metadata
| simonsobsREPO_NAMEnextline-rdbPATH_START.@nextline-rdb_extracted@nextline-rdb-main@src@nextline_rdb@alembic@models@rev_f9a742bb2297@base@model_base.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "changhoonhahn/pySpectrum",
"repo_path": "pySpectrum_extracted/pySpectrum-master/pyspectrum/__init__.py",
"type": "Python"
} | import os
# Path to data files required for cosmos
_PYSPEC_DAT_DIR=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'dat')
def dat_dir():
return _PYSPEC_DAT_DIR
| changhoonhahnREPO_NAMEpySpectrumPATH_START.@pySpectrum_extracted@pySpectrum-master@pyspectrum@__init__.py@.PATH_END.py |
{
"filename": "ftrl_test.py",
"repo_name": "fchollet/keras",
"repo_path": "keras_extracted/keras-master/keras/src/optimizers/ftrl_test.py",
"type": "Python"
} | # flake8: noqa
import numpy as np
from keras.src import backend
from keras.src import testing
from keras.src.optimizers.ftrl import Ftrl
class FtrlTest(testing.TestCase):
def test_config(self):
optimizer = Ftrl(
learning_rate=0.05,
learning_rate_power=-0.2,
initial_a... | fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@optimizers@ftrl_test.py@.PATH_END.py |
{
"filename": "flows.py",
"repo_name": "pyro-ppl/numpyro",
"repo_path": "numpyro_extracted/numpyro-master/numpyro/distributions/flows.py",
"type": "Python"
} | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from jax import lax
import jax.numpy as jnp
from numpyro.distributions.constraints import real_vector
from numpyro.distributions.transforms import Transform
from numpyro.util import fori_loop
def _clamp_preserve_gradients(x, min, ma... | pyro-pplREPO_NAMEnumpyroPATH_START.@numpyro_extracted@numpyro-master@numpyro@distributions@flows.py@.PATH_END.py |
{
"filename": "pacs.py",
"repo_name": "astroumd/miriad",
"repo_path": "miriad_extracted/miriad-master/src/scripts/python/pacs.py",
"type": "Python"
} | #! /usr/bin/env python
#
# use this if you need just to produce offline figures
# import matplotlib
# matplotlib.use('Agg')
import numpy as np
#import matplotlib.pyplot as plt
import matplotlib.pylab as plt
#
from scipy.interpolate import spline
import pylab
__version__ = "PACS data reduction scr... | astroumdREPO_NAMEmiriadPATH_START.@miriad_extracted@miriad-master@src@scripts@python@pacs.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/icicle/marker/colorbar/_tickformatstops.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickformatstopsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self,
plotly_name="tickformatstops",
parent_name="icicle.marker.colorbar",
**kwargs,
):
super(TickformatstopsValidator, self).__init__(... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@icicle@marker@colorbar@_tickformatstops.py@.PATH_END.py |
{
"filename": "representations.py",
"repo_name": "mwalmsley/zoobot",
"repo_path": "zoobot_extracted/zoobot-main/zoobot/pytorch/training/representations.py",
"type": "Python"
} | import logging
import pytorch_lightning as pl
from timm import create_model
class ZoobotEncoder(pl.LightningModule):
def __init__(self, encoder):
super().__init__()
logging.info('ZoobotEncoder: using provided in-memory encoder')
self.encoder = encoder # plain pytorch module e.g. Sequent... | mwalmsleyREPO_NAMEzoobotPATH_START.@zoobot_extracted@zoobot-main@zoobot@pytorch@training@representations.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "hongwanliu/DarkHistory",
"repo_path": "DarkHistory_extracted/DarkHistory-master/docs/html/_static/conf.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# DarkHistory documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 7 16:43:07 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
... | hongwanliuREPO_NAMEDarkHistoryPATH_START.@DarkHistory_extracted@DarkHistory-master@docs@html@_static@conf.py@.PATH_END.py |
{
"filename": "astroTimeLegacy.py",
"repo_name": "sczesla/PyAstronomy",
"repo_path": "PyAstronomy_extracted/PyAstronomy-master/src/pyasl/asl/astroTimeLegacy.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
from __future__ import print_function, division
import datetime
import numpy
from numpy import sin, cos, tan, sqrt, arcsin
from PyAstronomy.pyaC import pyaErrors as PE
import six.moves as smo
def weekday(date):
"""
Return weekday by name
Parameters
----------
date : DATETI... | sczeslaREPO_NAMEPyAstronomyPATH_START.@PyAstronomy_extracted@PyAstronomy-master@src@pyasl@asl@astroTimeLegacy.py@.PATH_END.py |
{
"filename": "spectrum.py",
"repo_name": "CASTOR-telescope/ETC",
"repo_path": "ETC_extracted/ETC-master/castor_etc/spectrum.py",
"type": "Python"
} | """
Generate and handle spectral data and normalizations.
Includes:
- redshifting wavelengths
- blackbody radiation, power-law spectrum generation
- user-input spectrum
- Gaussian and Lorentzian emission/absorption lines
- generic spiral and elliptical galaxy spectra
- stellar spectra from the Pickles cata... | CASTOR-telescopeREPO_NAMEETCPATH_START.@ETC_extracted@ETC-master@castor_etc@spectrum.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "lucatelli/morphen",
"repo_path": "morphen_extracted/morphen-main/README.md",
"type": "Markdown"
} | ```
%&&&&&+ +&&&&&&&*+
#@@@@@+ *#@@@@@# *+
*@@#*@@% *@@@%%@@+ %#&&@#% &##&&#&% +#@#&&##%+ +&& &@@* &###&%%%* +%&+ &@%
+@@@% &@@%@@#+ #@% %@@* @@& +@@% ... | lucatelliREPO_NAMEmorphenPATH_START.@morphen_extracted@morphen-main@README.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/scene/camera/center/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._z import ZValidator
from ._y import YValidator
from ._x import XValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@scene@camera@center@__init__.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "google/jax",
"repo_path": "jax_extracted/jax-main/cloud_tpu_colabs/README.md",
"type": "Markdown"
} | # JAX on Cloud TPU examples
The same JAX code that runs on CPU and GPU can also be run on TPU. Cloud TPUs
have the advantage of quickly giving you access to multiple TPU accelerators,
including in [Colab](https://research.google.com/colaboratory/). All of the
example notebooks here use
[`jax.pmap`](https://jax.readthe... | googleREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@cloud_tpu_colabs@README.md@.PATH_END.py |
{
"filename": "mlp_lazy.py",
"repo_name": "google/flax",
"repo_path": "flax_extracted/flax-main/examples/linen_design_test/mlp_lazy.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@linen_design_test@mlp_lazy.py@.PATH_END.py |
{
"filename": "test_datetimes.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/reshape/concat/test_datetimes.py",
"type": "Python"
} | import datetime as dt
from datetime import datetime
import dateutil
import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
DatetimeIndex,
Index,
MultiIndex,
Series,
Timestamp,
concat,
date_range,
to_timedelta,
)
import pandas._testing as tm
class Tes... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@reshape@concat@test_datetimes.py@.PATH_END.py |
{
"filename": "Tutorial-GRMHD_Equations-Cartesian.ipynb",
"repo_name": "zachetienne/nrpytutorial",
"repo_path": "nrpytutorial_extracted/nrpytutorial-master/Tutorial-GRMHD_Equations-Cartesian.ipynb",
"type": "Jupyter Notebook"
} | <script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-59152712-8');
</script>
# Equations of General Relativistic Magnetohydrodynamics (G... | zachetienneREPO_NAMEnrpytutorialPATH_START.@nrpytutorial_extracted@nrpytutorial-master@Tutorial-GRMHD_Equations-Cartesian.ipynb@.PATH_END.py |
{
"filename": "brighterFatterKernel.py",
"repo_name": "lsst/ip_isr",
"repo_path": "ip_isr_extracted/ip_isr-main/python/lsst/ip/isr/brighterFatterKernel.py",
"type": "Python"
} | # This file is part of ip_isr.
#
# 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 can ... | lsstREPO_NAMEip_isrPATH_START.@ip_isr_extracted@ip_isr-main@python@lsst@ip@isr@brighterFatterKernel.py@.PATH_END.py |
{
"filename": "common.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/benchmarks/benchmarks/common.py",
"type": "Python"
} | """
Airspeed Velocity benchmark utilities
"""
import sys
import os
import re
import time
import textwrap
import subprocess
import itertools
import random
class Benchmark:
"""
Base class with sensible options
"""
pass
def is_xslow():
try:
return int(os.environ.get('SCIPY_XSLOW', '0'))
... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@benchmarks@benchmarks@common.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatter/textfont/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._sizesrc import SizesrcValidator
from ._size import SizeValidator
from ._familysrc import FamilysrcValidator
from ._family import FamilyValidator
from ._colorsrc import ColorsrcValidator
from ._color import ColorValidator
else:
from _plotly_uti... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatter@textfont@__init__.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "EranOfek/AstroPack",
"repo_path": "AstroPack_extracted/AstroPack-main/matlab/util/+tools/+array/README.md",
"type": "Markdown"
} | #
| EranOfekREPO_NAMEAstroPackPATH_START.@AstroPack_extracted@AstroPack-main@matlab@util@+tools@+array@README.md@.PATH_END.py |
{
"filename": "test_utils.py",
"repo_name": "Starfish-develop/Starfish",
"repo_path": "Starfish_extracted/Starfish-master/tests/test_grid_tools/test_utils.py",
"type": "Python"
} | import multiprocessing as mp
import numpy as np
import pytest
from Starfish.grid_tools import (
chunk_list,
air_to_vacuum,
vacuum_to_air,
vacuum_to_air_SLOAN,
idl_float,
)
class TestChunking:
def test_chunk_list_shape(self, grid_points):
chunked = chunk_list(grid_points)
asse... | Starfish-developREPO_NAMEStarfishPATH_START.@Starfish_extracted@Starfish-master@tests@test_grid_tools@test_utils.py@.PATH_END.py |
{
"filename": "processing.py",
"repo_name": "htjb/margarine",
"repo_path": "margarine_extracted/margarine-master/margarine/processing.py",
"type": "Python"
} | from tensorflow_probability import distributions as tfd
import tensorflow as tf
import random
@tf.function(jit_compile=True)
def _forward_transform(x, min=0, max=1):
r"""
Tranforms input samples. Normalise between 0 and 1 and then tranform
onto samples of standard normal distribution (i.e. base of
tf... | htjbREPO_NAMEmargarinePATH_START.@margarine_extracted@margarine-master@margarine@processing.py@.PATH_END.py |
{
"filename": "concentration.py",
"repo_name": "dylancromer/maszcal",
"repo_path": "maszcal_extracted/maszcal-main/spec/concentration.py",
"type": "Python"
} | import pytest
import numpy as np
import maszcal.concentration
import maszcal.cosmology
def describe_ConModel():
def describe_c():
def it_converts_the_masses_appropriately():
con_model = maszcal.concentration.ConModel(mass_def='500c')
masses = np.logspace(14, 16, 3)
re... | dylancromerREPO_NAMEmaszcalPATH_START.@maszcal_extracted@maszcal-main@spec@concentration.py@.PATH_END.py |
{
"filename": "reproduce.py",
"repo_name": "realfastvla/rfpipe",
"repo_path": "rfpipe_extracted/rfpipe-main/rfpipe/reproduce.py",
"type": "Python"
} | from __future__ import print_function, division, absolute_import, unicode_literals
from builtins import bytes, dict, object, range, map, input, str
from future.utils import itervalues, viewitems, iteritems, listvalues, listitems
from io import open
import pickle
import os.path
import numpy as np
from kalman_detector i... | realfastvlaREPO_NAMErfpipePATH_START.@rfpipe_extracted@rfpipe-main@rfpipe@reproduce.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "zclaytor/butterpy",
"repo_path": "butterpy_extracted/butterpy-main/setup.py",
"type": "Python"
} | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
readme = fh.read()
version = {}
with open("butterpy/version.py") as fp:
exec(fp.read(), version)
setup(
name="butterpy",
version=version["__version__"],
author="Zachary R. Claytor <zclaytor@hawaii.edu> and Miles Lucas ... | zclaytorREPO_NAMEbutterpyPATH_START.@butterpy_extracted@butterpy-main@setup.py@.PATH_END.py |
{
"filename": "yesno.py",
"repo_name": "msiebert1/UCSC_spectral_pipeline",
"repo_path": "UCSC_spectral_pipeline_extracted/UCSC_spectral_pipeline-master/spectral_reduction/tmath/wombat/yesno.py",
"type": "Python"
} | def yesno(default):
from tmath.wombat.getch import getch
answer=''
while (answer != 'y') and (answer != 'n'):
print('(y)es or (n)o? (default/return = {}) '.format(default))
reply=getch()
reply=reply.strip()
if len(reply) == 0:
reply=default
answer=reply.lo... | msiebert1REPO_NAMEUCSC_spectral_pipelinePATH_START.@UCSC_spectral_pipeline_extracted@UCSC_spectral_pipeline-master@spectral_reduction@tmath@wombat@yesno.py@.PATH_END.py |
{
"filename": "_array.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/bar/error_y/_array.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ArrayValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="array", parent_name="bar.error_y", **kwargs):
super(ArrayValidator, 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@error_y@_array.py@.PATH_END.py |
{
"filename": "_weightsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/pie/outsidetextfont/_weightsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WeightsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="weightsrc", parent_name="pie.outsidetextfont", **kwargs
):
super(WeightsrcValidator, self).__init__(
plotly_name=plotly_name,
parent... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@pie@outsidetextfont@_weightsrc.py@.PATH_END.py |
{
"filename": "LOAO_Routine.tmp.py",
"repo_name": "SilverRon/gppy",
"repo_path": "gppy_extracted/gppy-main/LOAO_Routine.tmp.py",
"type": "Python"
} | # %% [markdown]
# # IMSNG_Rougine.ipynb
# - Automatically Process the image data from GECKO facilities and search for transients in the subtracted images with `gpPy`
# - Author: Gregory S.H. Paek (23.04.24)
# %% [markdown]
# ## Library
# %%
from __future__ import print_function, division, absolute_import
import os, s... | SilverRonREPO_NAMEgppyPATH_START.@gppy_extracted@gppy-main@LOAO_Routine.tmp.py@.PATH_END.py |
{
"filename": "gains.py",
"repo_name": "ratt-ru/QuartiCal",
"repo_path": "QuartiCal_extracted/QuartiCal-main/testing/fixtures/gains.py",
"type": "Python"
} | import pytest
import dask
@pytest.fixture(scope="module")
def cmp_calibration_graph_outputs(add_calibration_graph_outputs):
return dask.compute(*add_calibration_graph_outputs)
@pytest.fixture(scope="module")
def cmp_gain_xds_lod(cmp_calibration_graph_outputs):
return cmp_calibration_graph_outputs[0]
@pyte... | ratt-ruREPO_NAMEQuartiCalPATH_START.@QuartiCal_extracted@QuartiCal-main@testing@fixtures@gains.py@.PATH_END.py |
{
"filename": "psf_fit.py",
"repo_name": "kevin218/POET",
"repo_path": "POET_extracted/POET-master/code/lib/psf_fit.py",
"type": "Python"
} | import numpy as np
from astropy.io import fits as pf
import scipy.ndimage.interpolation as si
import scipy.optimize as so
import gaussian as g
import time
"""
File:
-----
psf_fit.py
Description:
------------
Routines for creating PSF (from a supersampled PSF) and fitting of
PSF images to d... | kevin218REPO_NAMEPOETPATH_START.@POET_extracted@POET-master@code@lib@psf_fit.py@.PATH_END.py |
{
"filename": "table_mode.md",
"repo_name": "jbroll/starbase",
"repo_path": "starbase_extracted/starbase-master/docs/table_mode.md",
"type": "Markdown"
} |
### table_mode - set the table i/o mode.
SYNOPSIS
--------
```
#include <../tablelib/table.h>
void table_mode(TableHead t, int m, int x);
```
PARAMETERS
----------
* `"TableHead` t" - Not Documented.
* `"int` m" - Not Documented.
* `"int` x" - Not Documented.
DESCRIPTION
-----------
The table mode ... | jbrollREPO_NAMEstarbasePATH_START.@starbase_extracted@starbase-master@docs@table_mode.md@.PATH_END.py |
{
"filename": "test_pickle.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/lib/matplotlib/tests/test_pickle.py",
"type": "Python"
} | from io import BytesIO
import ast
import os
import sys
import pickle
import pickletools
import numpy as np
import pytest
import matplotlib as mpl
from matplotlib import cm
from matplotlib.testing import subprocess_run_helper, is_ci_environment
from matplotlib.testing.decorators import check_figures_equal
from matplot... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@lib@matplotlib@tests@test_pickle.py@.PATH_END.py |
{
"filename": "act.py",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/act.py",
"type": "Python"
} | # Form implementation generated from reading ui file 'act.ui'
#
# Created by: PyQt6 UI code generator 6.6.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Activi... | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@act.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "nasa/Kamodo",
"repo_path": "Kamodo_extracted/Kamodo-master/README.md",
"type": "Markdown"
} |  
# The CCMC Kamodo Analysis Suite
## Online Documentation
https://nasa.github.io/Kamodo/
## Vision Statement
Kamodo is an official NASA open-source pytho... | nasaREPO_NAMEKamodoPATH_START.@Kamodo_extracted@Kamodo-master@README.md@.PATH_END.py |
{
"filename": "2_RunningTheCode.ipynb",
"repo_name": "natashabatalha/virga",
"repo_path": "virga_extracted/virga-master/docs/notebooks/2_RunningTheCode.ipynb",
"type": "Jupyter Notebook"
} | # Running the Code
In this tutorial you will learn:
1. How to run the code!
You should already be familiar with:
1. How to pick condensates to run in a cloud model
2. What is $f_{sed}$ and what number is right for my model?
3. What are the chemical limitations in the code
4. How to compute initial Mie scatter... | natashabatalhaREPO_NAMEvirgaPATH_START.@virga_extracted@virga-master@docs@notebooks@2_RunningTheCode.ipynb@.PATH_END.py |
{
"filename": "recipes_IMAGE.py",
"repo_name": "GeminiDRSoftware/DRAGONS",
"repo_path": "DRAGONS_extracted/DRAGONS-master/geminidr/niri/recipes/sq/recipes_IMAGE.py",
"type": "Python"
} | """
Recipes available to data with tags ['NIRI', 'IMAGE'].
Default is "reduce".
"""
recipe_tags = {'NIRI', 'IMAGE'}
def reduce(p):
"""
This recipe process NIRI data up to and including alignment and stacking.
A single stacked output image is produced.
It will attempt to do dark and flat correction if a... | GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@geminidr@niri@recipes@sq@recipes_IMAGE.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/agents/agent_toolkits/playwright/__init__.py",
"type": "Python"
} | """Playwright browser toolkit."""
from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.agent_toolkits.playwright.toolkit import (
PlayWrightBrowserToolkit,
)
# Create a way to dynamically look up deprecated imports.
# Used to con... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@agents@agent_toolkits@playwright@__init__.py@.PATH_END.py |
{
"filename": "test_ramp_extraction.py",
"repo_name": "spacetelescope/jdaviz",
"repo_path": "jdaviz_extracted/jdaviz-main/jdaviz/configs/rampviz/tests/test_ramp_extraction.py",
"type": "Python"
} | import pytest
from regions import CirclePixelRegion, PixCoord
from jdaviz.core.marks import Lines
from jdaviz.configs.imviz.plugins.parsers import HAS_ROMAN_DATAMODELS
@pytest.mark.skipif(not HAS_ROMAN_DATAMODELS, reason="roman_datamodels is not installed")
def test_previews_roman(rampviz_helper, roman_level_1_ramp):... | spacetelescopeREPO_NAMEjdavizPATH_START.@jdaviz_extracted@jdaviz-main@jdaviz@configs@rampviz@tests@test_ramp_extraction.py@.PATH_END.py |
{
"filename": "constraints.py",
"repo_name": "timothydmorton/VESPA",
"repo_path": "VESPA_extracted/VESPA-master/vespa/stars/constraints.py",
"type": "Python"
} | from __future__ import print_function,division
import logging
import copy
try:
import numpy as np
except ImportError:
np = None
from ..hashutils import hasharray, hashcombine, hashdict
class Constraint(object):
"""
Base class for all constraints to be applied to StarPopulations.
"""
arrays = ... | timothydmortonREPO_NAMEVESPAPATH_START.@VESPA_extracted@VESPA-master@vespa@stars@constraints.py@.PATH_END.py |
{
"filename": "tips_tricks.ipynb",
"repo_name": "afeinstein20/eleanor",
"repo_path": "eleanor_extracted/eleanor-main/notebooks/tips_tricks.ipynb",
"type": "Jupyter Notebook"
} | [1.1 Choosing an Aperture](#first-bullet)
[1.2 Adding or Removing Flux Correction Terms](#second-bullet)
[1.3 Running eleanor Locally](#fourth-bullet)
[1.4 Targets Without TIC IDs](#fifth-bullet)
[1.5 Handling Saturated Targets](#sixth-bullet)
[1.6 Example: Rediscovering $\pi$ Mensae c](#seventh-bullet)
# 1.1 Cho... | afeinstein20REPO_NAMEeleanorPATH_START.@eleanor_extracted@eleanor-main@notebooks@tips_tricks.ipynb@.PATH_END.py |
{
"filename": "blockchain.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/document_loaders/blockchain.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import BlockchainDocumentLoader
from langchain_community.document_loaders.blockchain import BlockchainType
# Create a way to dynamically look up deprecated imports.
# U... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@document_loaders@blockchain.py@.PATH_END.py |
{
"filename": "_align.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattercarpet/hoverlabel/_align.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class AlignValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="align", parent_name="scattercarpet.hoverlabel", **kwargs
):
super(AlignValidator, self).__init__(
plotly_name=plotly_name,
parent... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattercarpet@hoverlabel@_align.py@.PATH_END.py |
{
"filename": "test_esa_hubble.py",
"repo_name": "D-arioSpace/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/esa/hubble/tests/test_esa_hubble.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
==============
eHST Tap Tests
==============
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
"""
import os
import shutil
import gzip
from pathlib import Path
from unittest.mock import MagicMock
from unittest.mock import patch
imp... | D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@esa@hubble@tests@test_esa_hubble.py@.PATH_END.py |
{
"filename": "_cmin.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterpolar/marker/line/_cmin.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CminValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="cmin", parent_name="scatterpolar.marker.line", **kwargs
):
super(CminValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterpolar@marker@line@_cmin.py@.PATH_END.py |
{
"filename": "_showticklabels.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter3d/marker/colorbar/_showticklabels.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowticklabelsValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name="showticklabels",
parent_name="scatter3d.marker.colorbar",
**kwargs,
):
super(ShowticklabelsValidator, self).__init__(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter3d@marker@colorbar@_showticklabels.py@.PATH_END.py |
{
"filename": "instrument.py",
"repo_name": "lsst-ts/ts_wep",
"repo_path": "ts_wep_extracted/ts_wep-main/python/lsst/ts/wep/instrument.py",
"type": "Python"
} | # This file is part of ts_wep.
#
# Developed for the LSST Telescope and Site Systems.
# 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 ... | lsst-tsREPO_NAMEts_wepPATH_START.@ts_wep_extracted@ts_wep-main@python@lsst@ts@wep@instrument.py@.PATH_END.py |
{
"filename": "ImageViewTemplate_generic.py",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/pyqtgraph/imageview/ImageViewTemplate_generic.py",
"type": "Python"
} | # Form implementation generated from reading ui file '../pyqtgraph/imageview/ImageViewTemplate.ui'
#
# Created by: PyQt6 UI code generator 6.1.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from ..Qt import QtCore... | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@pyqtgraph@imageview@ImageViewTemplate_generic.py@.PATH_END.py |
{
"filename": "load_LWAOV_data_into_EPIC.py",
"repo_name": "epic-astronomy/EPIC",
"repo_path": "EPIC_extracted/EPIC-master/main/load_LWAOV_data_into_EPIC.py",
"type": "Python"
} | from glob import glob
import numpy as NP
import h5py
import data_interface as DI
import progressbar as PGB
import ipdb as PDB
basedir = '/data5/LWA_OV_data/'
reformatted_data_dir = 'data_reformatted/'
subdir = 'jun11/47mhz/'
fglob = basedir + reformatted_data_dir + subdir + '*.dada.hdf5'
progress = PGB.ProgressBar(wi... | epic-astronomyREPO_NAMEEPICPATH_START.@EPIC_extracted@EPIC-master@main@load_LWAOV_data_into_EPIC.py@.PATH_END.py |
{
"filename": "local_plots.py",
"repo_name": "NuSpaceSim/nuSpaceSim",
"repo_path": "nuSpaceSim_extracted/nuSpaceSim-main/src/nuspacesim/simulation/eas_optical/local_plots.py",
"type": "Python"
} | # The Clear BSD License
#
# Copyright (c) 2021 Alexander Reustle and the NuSpaceSim Team
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the disclaimer
# below) provided that the following conditions are met:
#
# ... | NuSpaceSimREPO_NAMEnuSpaceSimPATH_START.@nuSpaceSim_extracted@nuSpaceSim-main@src@nuspacesim@simulation@eas_optical@local_plots.py@.PATH_END.py |
{
"filename": "transpose_conv.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/lite/testing/op_tests/transpose_conv.py",
"type": "Python"
} | # Copyright 2019 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@lite@testing@op_tests@transpose_conv.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/surface/hoverlabel/font/_family.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="family", parent_name="surface.hoverlabel.font", **kwargs
):
super(FamilyValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@surface@hoverlabel@font@_family.py@.PATH_END.py |
{
"filename": "ellipse.py",
"repo_name": "lpsinger/ligo.skymap",
"repo_path": "ligo.skymap_extracted/ligo.skymap-main/ligo/skymap/postprocess/ellipse.py",
"type": "Python"
} | #
# Copyright (C) 2013-2024 Leo Singer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distribute... | lpsingerREPO_NAMEligo.skymapPATH_START.@ligo.skymap_extracted@ligo.skymap-main@ligo@skymap@postprocess@ellipse.py@.PATH_END.py |
{
"filename": "test_interpolators.py",
"repo_name": "astropy/photutils",
"repo_path": "photutils_extracted/photutils-main/photutils/background/tests/test_interpolators.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for the interpolators module.
"""
import astropy.units as u
import numpy as np
import pytest
from astropy.utils.exceptions import AstropyDeprecationWarning
from photutils.background.background_2d import Background2D
from photutils.background.in... | astropyREPO_NAMEphotutilsPATH_START.@photutils_extracted@photutils-main@photutils@background@tests@test_interpolators.py@.PATH_END.py |
{
"filename": "coi_digger.py",
"repo_name": "mbejger/polgraw-allsky",
"repo_path": "polgraw-allsky_extracted/polgraw-allsky-master/coincidences/src/coi_digger.py",
"type": "Python"
} | import numpy as np
import sys
import os
import subprocess
import re
import itertools
import tempfile
from configparser import ConfigParser, ExtendedInterpolation
# Parser initialisation
p = ConfigParser(interpolation=ExtendedInterpolation())
# Parse the ini file
p.read(sys.argv[1])
band = sys.argv[2]
hemi = s... | mbejgerREPO_NAMEpolgraw-allskyPATH_START.@polgraw-allsky_extracted@polgraw-allsky-master@coincidences@src@coi_digger.py@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/mesh3d/hoverlabel/_font.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="font", parent_name="mesh3d.hoverlabel", **kwargs):
super(FontValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@mesh3d@hoverlabel@_font.py@.PATH_END.py |
{
"filename": "example-2.py",
"repo_name": "fjdu/myRadex",
"repo_path": "myRadex_extracted/myRadex-master/example-2.py",
"type": "Python"
} | import myRadex
import numpy as np
import pandas as pd
pd.set_option('display.max_columns', None)
pd.set_option('display.width', 2000)
a = myRadex.MyRadexModel(
dir_transition_rates='/Users/fjdu/_o/radex/data/',
filename_molecule='hco+.dat')
a.run_one_params(
Tkin=20.0, dv_CGS=1e5,
dens_X_CGS=1e0, Ncol... | fjduREPO_NAMEmyRadexPATH_START.@myRadex_extracted@myRadex-master@example-2.py@.PATH_END.py |
{
"filename": "q_ball.py",
"repo_name": "jtksai/PyCOOL",
"repo_path": "PyCOOL_extracted/PyCOOL-master/models/q_ball.py",
"type": "Python"
} | import numpy as np
pi = np.pi
"""
###############################################################################
# Define a scalar field model and a lattice
###############################################################################
"""
class Model:
"""Model class that defines the scalar field. Change these... | jtksaiREPO_NAMEPyCOOLPATH_START.@PyCOOL_extracted@PyCOOL-master@models@q_ball.py@.PATH_END.py |
{
"filename": "_maxpoints.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/surface/stream/_maxpoints.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MaxpointsValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="maxpoints", parent_name="surface.stream", **kwargs):
super(MaxpointsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@surface@stream@_maxpoints.py@.PATH_END.py |
{
"filename": "check_imports.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/partners/prompty/scripts/check_imports.py",
"type": "Python"
} | import sys
import traceback
from importlib.machinery import SourceFileLoader
if __name__ == "__main__":
files = sys.argv[1:]
has_failure = False
for file in files:
try:
SourceFileLoader("x", file).load_module()
except Exception:
has_faillure = True
print(... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@partners@prompty@scripts@check_imports.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/layout/coloraxis/colorbar/_ticklabeloverflow.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicklabeloverflowValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="ticklabeloverflow",
parent_name="layout.coloraxis.colorbar",
**kwargs,
):
super(TicklabeloverflowValidator, self).__i... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@coloraxis@colorbar@_ticklabeloverflow.py@.PATH_END.py |
{
"filename": "xlsx2table.py",
"repo_name": "jbroll/starbase",
"repo_path": "starbase_extracted/starbase-master/python/xlsx2table.py",
"type": "Python"
} | #!/usr/bin/env python
#
import sys
import re
import os
include starbase.py
program = os.path.splitext(os.path.basename(sys.argv[0]))[0]
if len(sys.argv) <= 1 :
print """
usage: %s file sheet range [-data]
""" % program
sys.exit(1)
file = sys.argv[1]
if not os.path.isfile(file) and program != "table... | jbrollREPO_NAMEstarbasePATH_START.@starbase_extracted@starbase-master@python@xlsx2table.py@.PATH_END.py |
{
"filename": "scriptFixVLSS.py",
"repo_name": "bill-cotton/Obit",
"repo_path": "Obit_extracted/Obit-master/ObitSystem/Obit/share/scripts/scriptFixVLSS.py",
"type": "Python"
} | # python/Obit script to relabel the headers in VLSS images to J2000
# Arguments:
# 1) Name of Image to be updated
import sys, Obit, Image, ImageDesc, OSystem, OErr
# Init Obit
err=OErr.OErr()
#ObitSys=OSystem.OSystem ("Feather", 1, 100, 1, ["../AIPSdata/"], 1, ["../PythonData/"], 1, 0, err)
ObitSys=OSystem.OSystem ("... | bill-cottonREPO_NAMEObitPATH_START.@Obit_extracted@Obit-master@ObitSystem@Obit@share@scripts@scriptFixVLSS.py@.PATH_END.py |
{
"filename": "2022_10_19_093902_6d548701edef_add_created_by.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/prefect/server/database/_migrations/versions/postgresql/2022_10_19_093902_6d548701edef_add_created_by.py",
"type": "Python"
} | """add_created_by
Revision ID: 6d548701edef
Revises: ad4b1b4d1e9d
Create Date: 2022-10-19 09:39:02.371032
"""
import sqlalchemy as sa
from alembic import op
import prefect
# revision identifiers, used by Alembic.
revision = "6d548701edef"
down_revision = "ad4b1b4d1e9d"
branch_labels = None
depends_on = None
def ... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@server@database@_migrations@versions@postgresql@2022_10_19_093902_6d548701edef_add_created_by.py@.PATH_END.py |
{
"filename": "test_3D.py",
"repo_name": "AFD-Illinois/iharm3d",
"repo_path": "iharm3d_extracted/iharm3d-master/prob/old_problems/mhdmodes3d/test/test_3D.py",
"type": "Python"
} | ################################################################################
# #
# SOD SHOCKTUBE #
# ... | AFD-IllinoisREPO_NAMEiharm3dPATH_START.@iharm3d_extracted@iharm3d-master@prob@old_problems@mhdmodes3d@test@test_3D.py@.PATH_END.py |
{
"filename": "expand_import_all.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/pythran/pythran/transformations/expand_import_all.py",
"type": "Python"
} | """ ExpandImportAll replaces import * by all their modules. """
from pythran.passmanager import Transformation
from pythran.tables import MODULES
import gast as ast
class ExpandImportAll(Transformation):
'''
Expands all import when '*' detected
>>> import gast as ast
>>> from pythran import passman... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@pythran@pythran@transformations@expand_import_all.py@.PATH_END.py |
{
"filename": "converters.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/layers/preprocessing/image_preprocessing/bounding_boxes/converters.py",
"type": "Python"
} | from keras.src.api_export import keras_export
from keras.src.layers.preprocessing.image_preprocessing.bounding_boxes.bounding_box import ( # noqa: E501
BoundingBox,
)
from keras.src.utils import backend_utils
@keras_export("keras.utils.bounding_boxes.convert_format")
def convert_format(
boxes, source, target... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@layers@preprocessing@image_preprocessing@bounding_boxes@converters.py@.PATH_END.py |
{
"filename": "python-reference_utils_get_gpu_device_count.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/concepts/python-reference_utils_get_gpu_device_count.md",
"type": "Markdown"
} | # get_gpu_device_count
{% include [utils-utils__get-gpu-device-count__desc](../_includes/work_src/reusage-python/utils__get-gpu-device-count__desc.md) %}
{% note info %}
- The returned value is <q>0</q> if the installed or compiled package does not support training on GPU.
- Use the `CUDA_VISIBLE_DEVICES` environme... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@concepts@python-reference_utils_get_gpu_device_count.md@.PATH_END.py |
{
"filename": "_ticktext.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/bar/marker/colorbar/_ticktext.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicktextValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self, plotly_name="ticktext", parent_name="bar.marker.colorbar", **kwargs
):
super(TicktextValidator, self).__init__(
plotly_name=plotly_name,
par... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@bar@marker@colorbar@_ticktext.py@.PATH_END.py |
{
"filename": "temper_file.py",
"repo_name": "sambit-giri/tools21cm",
"repo_path": "tools21cm_extracted/tools21cm-master/src/tools21cm/temper_file.py",
"type": "Python"
} | from . import const
import numpy as np
from .helper_functions import print_msg
class TemperFile:
'''
A C2Ray Temper3D file.
Use the read_from_file method to load an Temper3D file, or
pass the filename to the constructor.
Some useful attributes of this class are:
* temper (numpy array... | sambit-giriREPO_NAMEtools21cmPATH_START.@tools21cm_extracted@tools21cm-master@src@tools21cm@temper_file.py@.PATH_END.py |
{
"filename": "test_special.py",
"repo_name": "numba/numba-scipy",
"repo_path": "numba-scipy_extracted/numba-scipy-main/numba_scipy/tests/test_special.py",
"type": "Python"
} | import itertools
import warnings
import pytest
from unittest.mock import patch, Mock
import numpy as np
from numpy.testing import assert_allclose
import numba
from numba.types import float64
import scipy.special as sc
from numba_scipy.special import signatures as special_signatures
from numba_scipy.special.signatures... | numbaREPO_NAMEnumba-scipyPATH_START.@numba-scipy_extracted@numba-scipy-main@numba_scipy@tests@test_special.py@.PATH_END.py |
{
"filename": "test_events.py",
"repo_name": "StingraySoftware/stingray",
"repo_path": "stingray_extracted/stingray-main/stingray/tests/test_events.py",
"type": "Python"
} | import importlib
import copy
import os
import pytest
import numpy as np
from astropy.time import Time
from ..events import EventList
from ..lightcurve import Lightcurve
curdir = os.path.abspath(os.path.dirname(__file__))
datadir = os.path.join(curdir, "data")
_HAS_XARRAY = importlib.util.find_spec("xarray") is not N... | StingraySoftwareREPO_NAMEstingrayPATH_START.@stingray_extracted@stingray-main@stingray@tests@test_events.py@.PATH_END.py |
{
"filename": "paper.md",
"repo_name": "1313e/CMasher",
"repo_path": "CMasher_extracted/CMasher-master/joss_paper/paper.md",
"type": "Markdown"
} | ---
title: "CMasher: Scientific colormaps for making accessible, informative and 'cmashing' plots"
tags:
- Python
- colormaps
- data visualization
- plotting
- science
authors:
- name: Ellert van der Velden
orcid: 0000-0002-1559-9832
affiliation: "1, 2"
affiliations:
- name: Centre for Astrophysics ... | 1313eREPO_NAMECMasherPATH_START.@CMasher_extracted@CMasher-master@joss_paper@paper.md@.PATH_END.py |
{
"filename": "input_setup.fock.py",
"repo_name": "dnarayanan/powderday",
"repo_path": "powderday_extracted/powderday-master/convenience/computers/input_setup.fock.py",
"type": "Python"
} | #script intended to set up the qsub files and model*.py files assuming
#sphgr physical properties have been written out to an npz file, and
#that the system we're running on is Haverford's Fock cluster.
import numpy as np
from subprocess import call
import pdb,ipdb
from sphgr_progen import progen
#====================... | dnarayananREPO_NAMEpowderdayPATH_START.@powderday_extracted@powderday-master@convenience@computers@input_setup.fock.py@.PATH_END.py |
{
"filename": "outputs.py",
"repo_name": "joezuntz/cosmosis",
"repo_path": "cosmosis_extracted/cosmosis-main/cosmosis/postprocessing/outputs.py",
"type": "Python"
} | from . import lazy_pylab as pylab
class MiniTable:
"""
A simple class for storing and writing out a table of data.
This is to avoid imposing a dependency on astropy tables.
"""
def __init__(self, cols):
self.cols = cols
self.rows = []
def to_astropy(self):
from astrop... | joezuntzREPO_NAMEcosmosisPATH_START.@cosmosis_extracted@cosmosis-main@cosmosis@postprocessing@outputs.py@.PATH_END.py |
{
"filename": "util.py",
"repo_name": "simonsobs/sorunlib",
"repo_path": "sorunlib_extracted/sorunlib-main/src/sorunlib/util.py",
"type": "Python"
} | import os
import re
from sorunlib.config import load_config
from ocs import site_config
from ocs.ocs_client import OCSClient
from ocs.client_http import ControlClientError
class CrossbarConnectionError(Exception):
pass
def _load_site_config(filename=None):
"""Load a site config file, searching for default... | simonsobsREPO_NAMEsorunlibPATH_START.@sorunlib_extracted@sorunlib-main@src@sorunlib@util.py@.PATH_END.py |
{
"filename": "models_mg.py",
"repo_name": "Guo-Jian-Wang/colfi",
"repo_path": "colfi_extracted/colfi-master/colfi/models_mg.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
from . import cosmic_params, fcnet_mdn
from . import data_processor as dp
from . import data_simulator as ds
from .models_mdn import OneBranchMDN, MultiBranchMDN
from .models_ann import Loader
import numpy as np
import torch
from torch.distributions import Categorical
def gaussian_sampler(ome... | Guo-Jian-WangREPO_NAMEcolfiPATH_START.@colfi_extracted@colfi-master@colfi@models_mg.py@.PATH_END.py |
{
"filename": "fitting_specify.py",
"repo_name": "dartoon/galight",
"repo_path": "galight_extracted/galight-master/galight/fitting_specify.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 14 12:16:43 2020
@author: Xuheng Ding
"""
import numpy as np
import copy
import lenstronomy
from packaging import version
import warnings
class FittingSpecify(object):
"""
A class to generate the materials for the 'FittingSequence', define... | dartoonREPO_NAMEgalightPATH_START.@galight_extracted@galight-master@galight@fitting_specify.py@.PATH_END.py |
{
"filename": "dataloaders.py",
"repo_name": "pyro-ppl/pyro",
"repo_path": "pyro_extracted/pyro-master/pyro/contrib/mue/dataloaders.py",
"type": "Python"
} | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import torch
from torch.utils.data import Dataset
alphabets = {
"amino-acid": np.array(
[
"R",
"H",
"K",
"D",
"E",
"S",
... | pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@pyro@contrib@mue@dataloaders.py@.PATH_END.py |
{
"filename": "future.py",
"repo_name": "TRASAL/frbpoppy",
"repo_path": "frbpoppy_extracted/frbpoppy-master/tests/lognlogs/future.py",
"type": "Python"
} | """Check the log N log F slope for future surveys."""
import numpy as np
import matplotlib.pyplot as plt
from frbpoppy import CosmicPopulation, Survey, SurveyPopulation, hist
from frbpoppy import unpickle, pprint
from tests.convenience import plot_aa_style, rel_path
MAKE = True
SURVEYS = ('parkes-htru', 'fast-crafts... | TRASALREPO_NAMEfrbpoppyPATH_START.@frbpoppy_extracted@frbpoppy-master@tests@lognlogs@future.py@.PATH_END.py |
{
"filename": "axioms.py",
"repo_name": "ESDS-Leipzig/sen2nbar",
"repo_path": "sen2nbar_extracted/sen2nbar-main/sen2nbar/axioms.py",
"type": "Python"
} | fiso = dict(
B02=0.0774,
B03=0.1306,
B04=0.1690,
B05=0.2085,
B06=0.2316,
B07=0.2599,
B08=0.3093,
B11=0.3430,
B12=0.2658,
)
fgeo = dict(
B02=0.0079,
B03=0.0178,
B04=0.0227,
B05=0.0256,
B06=0.0273,
B07=0.0294,
B08=0.0330,
B11=0.0453,
B12=0.0387,
)
... | ESDS-LeipzigREPO_NAMEsen2nbarPATH_START.@sen2nbar_extracted@sen2nbar-main@sen2nbar@axioms.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.