metadata
dict
text
stringlengths
0
40.6M
id
stringlengths
14
255
{ "filename": "process_v1.2.ipynb", "repo_name": "nanograv/pint_pal", "repo_path": "pint_pal_extracted/pint_pal-main/nb_templates/process_v1.2.ipynb", "type": "Jupyter Notebook" }
# \[set-up\], imports Reminder (if working on the notebook server): make sure your copy of `pint_pal` is up to date and you're working on a development branch, e.g. `psr/J1234+5678/jks`. See README for more details. If not working on the notebook server, you may need to update required software packages (`pint`, `enter...
nanogravREPO_NAMEpint_palPATH_START.@pint_pal_extracted@pint_pal-main@nb_templates@process_v1.2.ipynb@.PATH_END.py
{ "filename": "clenshaw.py", "repo_name": "DedalusProject/dedalus", "repo_path": "dedalus_extracted/dedalus-master/dedalus/libraries/dedalus_sphere/clenshaw.py", "type": "Python" }
from scipy import sparse import numpy as np from . import jacobi # called from basis of ncc (i.e., r) # A, B are from basis that the ncc is in # arg_basis is the basis of the thing we're multiplying by # i.e., if we are doing u.grad X, then arg_basis is the basis of u def ncc_matrix(N, a_ncc, b_ncc, a_arg, b_arg, co...
DedalusProjectREPO_NAMEdedalusPATH_START.@dedalus_extracted@dedalus-master@dedalus@libraries@dedalus_sphere@clenshaw.py@.PATH_END.py
{ "filename": "README.md", "repo_name": "alphalyncis/doppler-imaging-maxentropy", "repo_path": "doppler-imaging-maxentropy_extracted/doppler-imaging-maxentropy-main/README.md", "type": "Markdown" }
# Doppler imaging with Maximum Entropy Repository for IGRINS Doppler imaging codes in Chen et al 2024. To run the codes, it is recommended to create a virtual environment and install the required packages in `requirements.txt`. This can be done by running the set up script `setup_env.sh` (run `chmod +x setup_env.sh`...
alphalyncisREPO_NAMEdoppler-imaging-maxentropyPATH_START.@doppler-imaging-maxentropy_extracted@doppler-imaging-maxentropy-main@README.md@.PATH_END.py
{ "filename": "README.md", "repo_name": "fchollet/keras", "repo_path": "keras_extracted/keras-master/.devcontainer/README.md", "type": "Markdown" }
# Dev container configurations This directory contains the configuration for dev containers, which is used to initialize the development environment in **Codespaces**, **Visual Studio Code**, and **JetBrains IDEs**. The environment is installed with all the necessary dependencies for development and is ready for linti...
fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@.devcontainer@README.md@.PATH_END.py
{ "filename": "colorbar.py", "repo_name": "waynebhayes/SpArcFiRe", "repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/matplotlib/colorbar.py", "type": "Python" }
''' Colorbar toolkit with two classes and a function: :class:`ColorbarBase` the base class with full colorbar drawing functionality. It can be used as-is to make a colorbar for a given colormap; a mappable object (e.g., image) is not needed. :class:`Colorbar` the derived class ...
waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@matplotlib@colorbar.py@.PATH_END.py
{ "filename": "config.py", "repo_name": "spedas/pyspedas", "repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/cluster/config.py", "type": "Python" }
import os CONFIG = {'local_data_dir': 'cluster_data/', 'remote_data_dir': 'https://spdf.gsfc.nasa.gov/pub/data/cluster/'} # override local data directory with environment variables if os.environ.get('SPEDAS_DATA_DIR'): CONFIG['local_data_dir'] = os.sep.join([os.environ['SPEDAS_DATA_DIR'], 'cluster']) i...
spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@cluster@config.py@.PATH_END.py
{ "filename": "devicetree.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/Pygments/py3/pygments/lexers/devicetree.py", "type": "Python" }
""" pygments.lexers.devicetree ~~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for Devicetree language. :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, bygroups, include, default, words from pygments.token imp...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@Pygments@py3@pygments@lexers@devicetree.py@.PATH_END.py
{ "filename": "_leaf.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/sunburst/_leaf.py", "type": "Python" }
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Leaf(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "sunburst" _path_str = "sunburst.leaf" _valid_props = {"opacity"} # opacity # ------- ...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@sunburst@_leaf.py@.PATH_END.py
{ "filename": "StarsAppearing.ipynb", "repo_name": "james-trayford/strauss", "repo_path": "strauss_extracted/strauss-main/examples/StarsAppearing.ipynb", "type": "Jupyter Notebook" }
### <u> Generate the "_Stars Appearing_" sonification used in the "_Audible Universe_" planetarium show </u> First, we import relevant modules: ```python %reload_ext autoreload %autoreload 2 import matplotlib.pyplot as plt import ffmpeg as ff import wavio as wav from strauss.sonification import Sonification from st...
james-trayfordREPO_NAMEstraussPATH_START.@strauss_extracted@strauss-main@examples@StarsAppearing.ipynb@.PATH_END.py
{ "filename": "readout_filter.py", "repo_name": "simonsobs/sotodlib", "repo_path": "sotodlib_extracted/sotodlib-master/sotodlib/toast/ops/readout_filter.py", "type": "Python" }
# Copyright (c) 2024-2024 Simons Observatory. # Full license can be found in the top level "LICENSE" file. import numpy as np from toast.utils import Logger, rate_from_times from toast.traits import trait_docs, Int, Unicode from toast.timing import function_timer from toast.observation import default_values as defaul...
simonsobsREPO_NAMEsotodlibPATH_START.@sotodlib_extracted@sotodlib-master@sotodlib@toast@ops@readout_filter.py@.PATH_END.py
{ "filename": "SphericalShellPotential.py", "repo_name": "jobovy/galpy", "repo_path": "galpy_extracted/galpy-main/galpy/potential/SphericalShellPotential.py", "type": "Python" }
############################################################################### # SphericalShellPotential.py: The gravitational potential of a thin, # spherical shell ############################################################################### import numpy from ..util import conversi...
jobovyREPO_NAMEgalpyPATH_START.@galpy_extracted@galpy-main@galpy@potential@SphericalShellPotential.py@.PATH_END.py
{ "filename": "igimf_epoch_12.py", "repo_name": "juzikong/photGalIMF", "repo_path": "photGalIMF_extracted/photGalIMF-main/simulation_results_from_galaxy_evol/example/igimf_epoch_12.py", "type": "Python" }
# File to define a custom IMF # The return value represents the chosen IMF value for the input mass def custom_imf(mass, time): # there is no time dependence for IGIMF if mass < 0.08: return 0 elif mass < 0.101: return -881912095498.0004 * mass + 126349388048.4443 elif mass < 0.10201: ...
juzikongREPO_NAMEphotGalIMFPATH_START.@photGalIMF_extracted@photGalIMF-main@simulation_results_from_galaxy_evol@example@igimf_epoch_12.py@.PATH_END.py
{ "filename": "tokenization.py", "repo_name": "OpenAccess-AI-Collective/axolotl", "repo_path": "axolotl_extracted/axolotl-main/src/axolotl/utils/tokenization.py", "type": "Python" }
"""Module for tokenization utilities""" import logging from termcolor import colored LOG = logging.getLogger("axolotl") def check_dataset_labels( dataset, tokenizer, num_examples=5, text_only=False, rl_mode=False, ): # the dataset is already shuffled, so let's just check the first 5 element...
OpenAccess-AI-CollectiveREPO_NAMEaxolotlPATH_START.@axolotl_extracted@axolotl-main@src@axolotl@utils@tokenization.py@.PATH_END.py
{ "filename": "config_helpers.py", "repo_name": "fjankowsk/meertrig", "repo_path": "meertrig_extracted/meertrig-master/meertrig/config_helpers.py", "type": "Python" }
# # 2020 Fabian Jankowski # Configuration file related helper functions. # import logging import os.path import yaml def get_config(filename): """ Load and parse a config file. Parameters ---------- filename: str The name of the config file to parse, relative to the config directory...
fjankowskREPO_NAMEmeertrigPATH_START.@meertrig_extracted@meertrig-master@meertrig@config_helpers.py@.PATH_END.py
{ "filename": "_lineposition.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/scene/zaxis/title/font/_lineposition.py", "type": "Python" }
import _plotly_utils.basevalidators class LinepositionValidator(_plotly_utils.basevalidators.FlaglistValidator): def __init__( self, plotly_name="lineposition", parent_name="layout.scene.zaxis.title.font", **kwargs, ): super(LinepositionValidator, self).__init__( ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@scene@zaxis@title@font@_lineposition.py@.PATH_END.py
{ "filename": "array_list.py", "repo_name": "macrocosme/shwirl", "repo_path": "shwirl_extracted/shwirl-master/shwirl/extern/vispy/visuals/collections/array_list.py", "type": "Python" }
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier. All rights reserved. # Distributed under the terms of the new BSD License. # ----------------------------------------------------------------------------- """ An ArrayList is...
macrocosmeREPO_NAMEshwirlPATH_START.@shwirl_extracted@shwirl-master@shwirl@extern@vispy@visuals@collections@array_list.py@.PATH_END.py
{ "filename": "Average_spectra_example.ipynb", "repo_name": "HERA-Team/hera_pspec", "repo_path": "hera_pspec_extracted/hera_pspec-main/examples/Average_spectra_example.ipynb", "type": "Jupyter Notebook" }
# Average spectra This example shows how to get the average power spectra with different choices of weights. ```python %matplotlib inline import numpy as np import matplotlib.pyplot as plt import os from pyuvdata import UVData import hera_pspec as hp from hera_pspec.data import DATA_PATH ``` ## Prepare power spec...
HERA-TeamREPO_NAMEhera_pspecPATH_START.@hera_pspec_extracted@hera_pspec-main@examples@Average_spectra_example.ipynb@.PATH_END.py
{ "filename": "make_diana_wice.py", "repo_name": "psheehan/pdspy", "repo_path": "pdspy_extracted/pdspy-master/pdspy/dust/data/make_diana_wice.py", "type": "Python" }
#!/usr/bin/env python3 from pdspy.dust import * import numpy water_ice = Dust() water_ice.set_optical_constants_from_henn("optical_constants/water_ice.txt") water_ice.set_density(0.92) silicates = Dust() silicates.set_optical_constants_from_draine("optical_constants/astronomical_silicates.txt") silicates.set_density...
psheehanREPO_NAMEpdspyPATH_START.@pdspy_extracted@pdspy-master@pdspy@dust@data@make_diana_wice.py@.PATH_END.py
{ "filename": "renames_v2.py", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/tools/compatibility/renames_v2.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@tools@compatibility@renames_v2.py@.PATH_END.py
{ "filename": "test_printfuncs.py", "repo_name": "lmfit/lmfit-py", "repo_path": "lmfit-py_extracted/lmfit-py-master/tests/test_printfuncs.py", "type": "Python" }
"""Tests for the print/report functions.""" import numpy as np import pytest import lmfit from lmfit import (Minimizer, Parameters, ci_report, conf_interval, fit_report, report_ci, report_fit) from lmfit.lineshapes import gaussian from lmfit.models import GaussianModel from lmfit.printfuncs import (...
lmfitREPO_NAMElmfit-pyPATH_START.@lmfit-py_extracted@lmfit-py-master@tests@test_printfuncs.py@.PATH_END.py
{ "filename": "_y.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/polar/domain/_y.py", "type": "Python" }
import _plotly_utils.basevalidators class YValidator(_plotly_utils.basevalidators.InfoArrayValidator): def __init__(self, plotly_name="y", parent_name="layout.polar.domain", **kwargs): super(YValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, e...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@polar@domain@_y.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/mesh3d/hoverlabel/__init__.py", "type": "Python" }
import sys from typing import TYPE_CHECKING if sys.version_info < (3, 7) or TYPE_CHECKING: from ._namelengthsrc import NamelengthsrcValidator from ._namelength import NamelengthValidator from ._font import FontValidator from ._bordercolorsrc import BordercolorsrcValidator from ._bordercolor import ...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@mesh3d@hoverlabel@__init__.py@.PATH_END.py
{ "filename": "ignore_errors_op.py", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/data/ops/ignore_errors_op.py", "type": "Python" }
# Copyright 2017 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@data@ops@ignore_errors_op.py@.PATH_END.py
{ "filename": "tridiagonal_matmul_ops_test.py", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/compiler/tests/tridiagonal_matmul_ops_test.py", "type": "Python" }
# Copyright 2022 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@compiler@tests@tridiagonal_matmul_ops_test.py@.PATH_END.py
{ "filename": "README.md", "repo_name": "Keck-DataReductionPipelines/OsirisDRP", "repo_path": "OsirisDRP_extracted/OsirisDRP-master/drizzle3D/README.md", "type": "Markdown" }
[11/5/2018] Purpose of this code: drizzle3D_fast.py is a code which used to perform the subpixel drizzling in order to recover the lost spatial information but still remain the coverage and S/N. It is especially useful for the users who use 0.1'' (100 mas) scale to observe the targets. Note that drizzle3D_fast.py onl...
Keck-DataReductionPipelinesREPO_NAMEOsirisDRPPATH_START.@OsirisDRP_extracted@OsirisDRP-master@drizzle3D@README.md@.PATH_END.py
{ "filename": "config.py", "repo_name": "sophiasosafiscella/highfluencetiming", "repo_path": "highfluencetiming_extracted/highfluencetiming-main/MeerGuard/coast_guard/config.py", "type": "Python" }
import sys import copy import os base_config_dir = os.path.join(os.path.dirname(__file__), 'configurations') receiver_config_dir = os.path.join(base_config_dir, 'receivers') # python3 with open(os.path.join(base_config_dir, "global.cfg")) as f: code = compile(f.read(), os.path.join(base_config_dir, "global.cfg"...
sophiasosafiscellaREPO_NAMEhighfluencetimingPATH_START.@highfluencetiming_extracted@highfluencetiming-main@MeerGuard@coast_guard@config.py@.PATH_END.py
{ "filename": "plot_1D_visibilities.py", "repo_name": "psheehan/pdspy", "repo_path": "pdspy_extracted/pdspy-master/pdspy/plotting/plot_1D_visibilities.py", "type": "Python" }
import pdspy.interferometry as uv import matplotlib.pyplot as plt import numpy def plot_1D_visibilities(visibilities, model, parameters, params, index=0, \ fig=None, plot_disk=False, color="k", markersize=8, linewidth=1, \ line_color="g", disk_only_color="gray", fontsize="medium"): r""" Plot th...
psheehanREPO_NAMEpdspyPATH_START.@pdspy_extracted@pdspy-master@pdspy@plotting@plot_1D_visibilities.py@.PATH_END.py
{ "filename": "README.md", "repo_name": "artis-mcrt/artis", "repo_path": "artis_extracted/artis-main/README.md", "type": "Markdown" }
# ARTIS [![DOI](https://zenodo.org/badge/11279591.svg)](https://zenodo.org/badge/latestdoi/11279591) [![CI](https://github.com/artis-mcrt/artis/actions/workflows/ci.yml/badge.svg)](https://github.com/artis-mcrt/artis/actions/workflows/ci.yml) [ARTIS](https://github.com/artis-mcrt/artis) ([Sim 2007](https://ui.adsabs....
artis-mcrtREPO_NAMEartisPATH_START.@artis_extracted@artis-main@README.md@.PATH_END.py
{ "filename": "_gridshape.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/polar/_gridshape.py", "type": "Python" }
import _plotly_utils.basevalidators class GridshapeValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="gridshape", parent_name="layout.polar", **kwargs): super(GridshapeValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_n...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@polar@_gridshape.py@.PATH_END.py
{ "filename": "_ticks.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/indicator/gauge/axis/_ticks.py", "type": "Python" }
import _plotly_utils.basevalidators class TicksValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="ticks", parent_name="indicator.gauge.axis", **kwargs ): super(TicksValidator, self).__init__( plotly_name=plotly_name, parent_nam...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@indicator@gauge@axis@_ticks.py@.PATH_END.py
{ "filename": "TreeRings_24Oct17.ipynb", "repo_name": "GalSim-developers/GalSim", "repo_path": "GalSim_extracted/GalSim-main/devel/treerings/TreeRings_24Oct17.ipynb", "type": "Jupyter Notebook" }
```python %cd ~ import pyfits,glob,time,scipy,sys import matplotlib matplotlib.use("PDF") from pylab import * thedir='devel/treerings/output/' %cd $thedir ``` /Users/cslage [Errno 2] No such file or directory: 'devel/treerings/output/' /Users/cslage /usr/local/lib/python2.7/site-packages/matplotlib/...
GalSim-developersREPO_NAMEGalSimPATH_START.@GalSim_extracted@GalSim-main@devel@treerings@TreeRings_24Oct17.ipynb@.PATH_END.py
{ "filename": "_color.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/carpet/aaxis/tickfont/_color.py", "type": "Python" }
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="carpet.aaxis.tickfont", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name=pa...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@carpet@aaxis@tickfont@_color.py@.PATH_END.py
{ "filename": "runlsc.py", "repo_name": "LCOGT/lcogtsnpipe", "repo_path": "lcogtsnpipe_extracted/lcogtsnpipe-master/trunk/bin/runlsc.py", "type": "Python" }
#!/usr/bin/env python from datetime import datetime, timedelta import os import time import lsc import subprocess32 from argparse import ArgumentParser commandsn = {'LSQ12fxd': ' -x 3 -y 3 --bkg 3 --size 6', 'PSNJ081753': ' -x 3 -y 3 --bkg 4 --size 8', 'SN2013ak:': ' -x 4 -y 4 --bkg 3 --size...
LCOGTREPO_NAMElcogtsnpipePATH_START.@lcogtsnpipe_extracted@lcogtsnpipe-master@trunk@bin@runlsc.py@.PATH_END.py
{ "filename": "test_prior.py", "repo_name": "gammapy/gammapy", "repo_path": "gammapy_extracted/gammapy-main/gammapy/modeling/models/tests/test_prior.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from numpy.testing import assert_allclose import astropy.units as u from gammapy.modeling.models import PRIOR_REGISTRY, GaussianPrior, Model, UniformPrior from gammapy.utils.testing import assert_quantity_allclose TEST_PRIORS = [ dict( ...
gammapyREPO_NAMEgammapyPATH_START.@gammapy_extracted@gammapy-main@gammapy@modeling@models@tests@test_prior.py@.PATH_END.py
{ "filename": "stop.py", "repo_name": "fritz-marshal/fritz", "repo_path": "fritz_extracted/fritz-main/launcher/commands/stop.py", "type": "Python" }
import subprocess def stop(): """✋ Shut Fritz down""" print("Shutting down Fritz...") # stop traefik if it is running running_container_images = ( subprocess.check_output(["docker", "ps", "-a", "--format", "{{.Image}}"]) .decode("utf-8") .strip() .split("\n") ) ...
fritz-marshalREPO_NAMEfritzPATH_START.@fritz_extracted@fritz-main@launcher@commands@stop.py@.PATH_END.py
{ "filename": "c_parser_wrapper.py", "repo_name": "pandas-dev/pandas", "repo_path": "pandas_extracted/pandas-main/pandas/io/parsers/c_parser_wrapper.py", "type": "Python" }
from __future__ import annotations from collections import defaultdict from typing import TYPE_CHECKING import warnings import numpy as np from pandas._libs import ( lib, parsers, ) from pandas.compat._optional import import_optional_dependency from pandas.errors import DtypeWarning from pandas.util._excepti...
pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@io@parsers@c_parser_wrapper.py@.PATH_END.py
{ "filename": "stratsi_eqm.py", "repo_name": "minkailin/stratsi", "repo_path": "stratsi_extracted/stratsi-master/caseA_eta0.01/stratsi_eqm.py", "type": "Python" }
""" stratified streaming instability equilibrium vertical profiles of horizontal velocities """ ''' import parameters and functions ''' from stratsi_params import * ''' process command line arguements ''' parser = argparse.ArgumentParser() parser.add_argument("--xlim", "-xl", nargs='*', help="set horizontal axis r...
minkailinREPO_NAMEstratsiPATH_START.@stratsi_extracted@stratsi-master@caseA_eta0.01@stratsi_eqm.py@.PATH_END.py
{ "filename": "kinematic_2D_likelihood.py", "repo_name": "sibirrer/lenstronomy", "repo_path": "lenstronomy_extracted/lenstronomy-main/lenstronomy/Sampling/Likelihoods/kinematic_2D_likelihood.py", "type": "Python" }
import numpy as np from scipy import signal from lenstronomy.Util.kin_sampling_util import KinNNImageAlign from lenstronomy.Sampling.Likelihoods import kinematic_NN_call __all__ = ["KinLikelihood"] class KinLikelihood(object): """Class to compute the likelihood associated to binned 2D kinematic maps.""" def...
sibirrerREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@lenstronomy@Sampling@Likelihoods@kinematic_2D_likelihood.py@.PATH_END.py
{ "filename": "test_simulator.py", "repo_name": "rasg-affiliates/healvis", "repo_path": "healvis_extracted/healvis-master/healvis/tests/test_simulator.py", "type": "Python" }
# -*- mode: python; coding: utf-8 -* # Copyright (c) 2019 Radio Astronomy Software Group # Licensed under the 3-clause BSD License import numpy as np import os import yaml import shutil from pyuvdata import UVData from healvis import sky_model, simulator, beam_model, utils from healvis.data import DATA_PATH import h...
rasg-affiliatesREPO_NAMEhealvisPATH_START.@healvis_extracted@healvis-master@healvis@tests@test_simulator.py@.PATH_END.py
{ "filename": "test_kdtree.py", "repo_name": "yt-project/yt", "repo_path": "yt_extracted/yt-main/yt/utilities/lib/cykdtree/tests/test_kdtree.py", "type": "Python" }
import tempfile import time import numpy as np from nose.tools import assert_raises import yt.utilities.lib.cykdtree as cykdtree from yt.utilities.lib.cykdtree.tests import ( make_points, make_points_neighbors, parametrize, ) @parametrize( npts=100, ndim=(2, 3), periodic=(False, True), use_sliding_m...
yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@utilities@lib@cykdtree@tests@test_kdtree.py@.PATH_END.py
{ "filename": "importstring.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/ipython/py3/IPython/utils/importstring.py", "type": "Python" }
# encoding: utf-8 """ A simple utility to import something by its string name. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. def import_item(name): """Import and return ``bar`` given the string ``foo.bar``. Calling ``bar = import_item("foo.bar")`` i...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipython@py3@IPython@utils@importstring.py@.PATH_END.py
{ "filename": "test_image.py", "repo_name": "mkelley/mskpy", "repo_path": "mskpy_extracted/mskpy-main/tests/test_image.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package contains utilities to run the test suite. """ import numpy as np from numpy import pi from mskpy import image class TestImageCore(): def test_imshift(self): a = np.arange(5.0).reshape((5, 1)) b = image.imshift(a, [0.5...
mkelleyREPO_NAMEmskpyPATH_START.@mskpy_extracted@mskpy-main@tests@test_image.py@.PATH_END.py
{ "filename": "test_plotter_interface_point.py", "repo_name": "Jammy2211/PyAutoLens", "repo_path": "PyAutoLens_extracted/PyAutoLens-main/test_autolens/point/model/test_plotter_interface_point.py", "type": "Python" }
import os import shutil from os import path import pytest from autolens.point.model.plotter_interface import PlotterInterfacePoint directory = path.dirname(path.realpath(__file__)) @pytest.fixture(name="plot_path") def make_plotter_interface_plotter_setup(): return path.join("{}".format(directory), "files") d...
Jammy2211REPO_NAMEPyAutoLensPATH_START.@PyAutoLens_extracted@PyAutoLens-main@test_autolens@point@model@test_plotter_interface_point.py@.PATH_END.py
{ "filename": "apero_fit_tellu_nirps_he.py", "repo_name": "njcuk9999/apero-drs", "repo_path": "apero-drs_extracted/apero-drs-main/apero/recipes/nirps_he/apero_fit_tellu_nirps_he.py", "type": "Python" }
#!/usr/bin/env python # -*- coding: utf-8 -*- """ apero_fit_tellu_nirps_he.py [obs dir] [files] Using all transmission files, we fit the absorption of a given science observation. Created on 2019-09-05 at 14:58 @author: cook """ from typing import Any, Dict, List, Optional, Tuple, Union import numpy as np from ape...
njcuk9999REPO_NAMEapero-drsPATH_START.@apero-drs_extracted@apero-drs-main@apero@recipes@nirps_he@apero_fit_tellu_nirps_he.py@.PATH_END.py
{ "filename": "citation_updater.py", "repo_name": "PlasmaPy/PlasmaPy", "repo_path": "PlasmaPy_extracted/PlasmaPy-main/.github/scripts/citation_updater.py", "type": "Python" }
"""Functionality to update citation information prior to making a release.""" import argparse import datetime import pathlib import re from ruamel.yaml import YAML def parse_arguments(): parser = argparse.ArgumentParser() parser.add_argument("citation_cff_file") parser.add_argument("citation_rst_file")...
PlasmaPyREPO_NAMEPlasmaPyPATH_START.@PlasmaPy_extracted@PlasmaPy-main@.github@scripts@citation_updater.py@.PATH_END.py
{ "filename": "table.py", "repo_name": "diehlpkpapers/dockerizeHPX", "repo_path": "dockerizeHPX_extracted/dockerizeHPX-main/fugaku/table.py", "type": "Python" }
import csv import numpy as np d_sing = [] d_reg = [] with open('singularity.csv', newline='') as csvfile: spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|') for row in spamreader: d_sing.append(float(row[0])) with open('regular.csv', newline='') as csvfile: spamreader = csv.reader(csv...
diehlpkpapersREPO_NAMEdockerizeHPXPATH_START.@dockerizeHPX_extracted@dockerizeHPX-main@fugaku@table.py@.PATH_END.py
{ "filename": "test_disk.py", "repo_name": "marblestation/posidonius", "repo_path": "posidonius_extracted/posidonius-master/posidonius/tests/test_disk.py", "type": "Python" }
import os import inspect import shutil import filecmp import posidonius from posidonius.tests import common from posidonius.tests.test_base import TestBase class Disk(TestBase): def setUp(self): TestBase.setUp(self) self.current_filename, ignore = os.path.splitext(os.path.basename(__file__)) # Fil...
marblestationREPO_NAMEposidoniusPATH_START.@posidonius_extracted@posidonius-master@posidonius@tests@test_disk.py@.PATH_END.py
{ "filename": "yaml-cpp.natvis.md", "repo_name": "rometsch/fargocpt", "repo_path": "fargocpt_extracted/fargocpt-master/src/yaml-cpp/contrib/yaml-cpp.natvis.md", "type": "Markdown" }
# MSVC debugger visualizer for YAML::Node ## How to use Add yaml-cpp.natvis to your Visual C++ project like any other source file. It will be included in the debug information, and improve debugger display on YAML::Node and contained types. ## Compatibility and Troubleshooting This has been tested for MSVC 2017. I...
rometschREPO_NAMEfargocptPATH_START.@fargocpt_extracted@fargocpt-master@src@yaml-cpp@contrib@yaml-cpp.natvis.md@.PATH_END.py
{ "filename": "test_fits.py", "repo_name": "gbrammer/grizli", "repo_path": "grizli_extracted/grizli-master/grizli/tests/test_fits.py", "type": "Python" }
""" Tests for spectra, don't implement now because will fail on travis where we haven't set up the full GRIZLI path and reference files """ import os import glob import unittest import numpy as np from grizli import utils, prep, multifit, fitting, GRIZLI_PATH class FittingTools(unittest.TestCase): def test_...
gbrammerREPO_NAMEgrizliPATH_START.@grizli_extracted@grizli-master@grizli@tests@test_fits.py@.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/__init__.py", "type": "Python" }
import sys from typing import TYPE_CHECKING if sys.version_info < (3, 7) or TYPE_CHECKING: from ._yaxis import YaxisValidator from ._xaxis import XaxisValidator from ._width import WidthValidator from ._waterfallmode import WaterfallmodeValidator from ._waterfallgroupgap import WaterfallgroupgapVal...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@__init__.py@.PATH_END.py
{ "filename": "test_distances.py", "repo_name": "sidchaini/DistClassiPy", "repo_path": "DistClassiPy_extracted/DistClassiPy-main/tests/test_distances.py", "type": "Python" }
# Note: A large portion of this code has been inspired # from https://github.com/aziele/statistical-distance/blob/f49212e/test.py from distclassipy.distances import Distance import numpy as np import pytest distance = Distance() # Test case 1: non-zero values in u and v. uv1 = [np.array([0.33, 0.21, 0.46]), np.arr...
sidchainiREPO_NAMEDistClassiPyPATH_START.@DistClassiPy_extracted@DistClassiPy-main@tests@test_distances.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "Keck-DataReductionPipelines/KPF-Pipeline", "repo_path": "KPF-Pipeline_extracted/KPF-Pipeline-master/database/modules/backfill_acf/__init__.py", "type": "Python" }
Keck-DataReductionPipelinesREPO_NAMEKPF-PipelinePATH_START.@KPF-Pipeline_extracted@KPF-Pipeline-master@database@modules@backfill_acf@__init__.py@.PATH_END.py
{ "filename": "test_tsne.py", "repo_name": "rapidsai/cuml", "repo_path": "cuml_extracted/cuml-main/python/cuml/cuml/tests/test_tsne.py", "type": "Python" }
# Copyright (c) 2019-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@test_tsne.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/cone/colorbar/tickfont/_textcase.py", "type": "Python" }
import _plotly_utils.basevalidators class TextcaseValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="textcase", parent_name="cone.colorbar.tickfont", **kwargs ): super(TextcaseValidator, self).__init__( plotly_name=plotly_name, ...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@cone@colorbar@tickfont@_textcase.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "mavrix93/LightCurvesClassifier", "repo_path": "LightCurvesClassifier_extracted/LightCurvesClassifier-master/lcc/bin/__init__.py", "type": "Python" }
mavrix93REPO_NAMELightCurvesClassifierPATH_START.@LightCurvesClassifier_extracted@LightCurvesClassifier-master@lcc@bin@__init__.py@.PATH_END.py
{ "filename": "_symbol.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterpolargl/marker/_symbol.py", "type": "Python" }
import _plotly_utils.basevalidators class SymbolValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="symbol", parent_name="scatterpolargl.marker", **kwargs ): super(SymbolValidator, self).__init__( plotly_name=plotly_name, parent...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterpolargl@marker@_symbol.py@.PATH_END.py
{ "filename": "ground_track.py", "repo_name": "cbassa/sattools", "repo_path": "sattools_extracted/sattools-main/python/ground_track.py", "type": "Python" }
#!/usr/bin/env python3 """ Script showing the position of the ISS at the time of the TLE and the ground track for the previous and the next orbit (original) source: https://github.com/galactics/beyond/blob/master/doc/source/_static/ground-track.py """ import sys import argparse import numpy as np import matplotlib....
cbassaREPO_NAMEsattoolsPATH_START.@sattools_extracted@sattools-main@python@ground_track.py@.PATH_END.py
{ "filename": "MPIPool.py", "repo_name": "mirochaj/ares", "repo_path": "ares_extracted/ares-main/ares/util/MPIPool.py", "type": "Python" }
import gc try: from mpi4py import MPI rank = MPI.COMM_WORLD.rank size = MPI.COMM_WORLD.size try: import dill MPI._p_pickle.dumps = dill.dumps MPI._p_pickle.loads = dill.loads except ImportError: pass except AttributeError: # named differently depending on versio...
mirochajREPO_NAMEaresPATH_START.@ares_extracted@ares-main@ares@util@MPIPool.py@.PATH_END.py
{ "filename": "_lineposition.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterpolargl/legendgrouptitle/font/_lineposition.py", "type": "Python" }
import _plotly_utils.basevalidators class LinepositionValidator(_plotly_utils.basevalidators.FlaglistValidator): def __init__( self, plotly_name="lineposition", parent_name="scatterpolargl.legendgrouptitle.font", **kwargs, ): super(LinepositionValidator, self).__init__(...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterpolargl@legendgrouptitle@font@_lineposition.py@.PATH_END.py
{ "filename": "Orbit fitter results GSC6214.ipynb", "repo_name": "logan-pearce/LOFTI", "repo_path": "LOFTI_extracted/LOFTI-master/Using_Astrometry/Orbit fitter results GSC6214.ipynb", "type": "Jupyter Notebook" }
```python %matplotlib inline import numpy as np from scipy import stats from numpy import tan, arctan, sqrt, cos, sin, arccos import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator, FormatStrFormatter import matplotlib.style import matplotlib as mpl #mpl.style.use('classic') import corner ``` `...
logan-pearceREPO_NAMELOFTIPATH_START.@LOFTI_extracted@LOFTI-master@Using_Astrometry@Orbit fitter results GSC6214.ipynb@.PATH_END.py
{ "filename": "inject.py", "repo_name": "transientskp/tkp", "repo_path": "tkp_extracted/tkp-master/tkp/inject.py", "type": "Python" }
""" This script is used to inject missing header info into a FITS file or CASA table. This can be useful to make your data processable by the TraP pipeline. """ import os.path import argparse from configparser import ConfigParser from tkp.config import parse_to_dict import astropy.io.fits as pyfits from casacore.table...
transientskpREPO_NAMEtkpPATH_START.@tkp_extracted@tkp-master@tkp@inject.py@.PATH_END.py
{ "filename": "skymodel.py", "repo_name": "radiocosmology/driftscan", "repo_path": "driftscan_extracted/driftscan-master/drift/core/skymodel.py", "type": "Python" }
import numpy as np from cora.core import skysim from cora.signal import corr21cm from cora.foreground import gaussianfg, galaxy _cr = None _reionisation = False class PointSources(gaussianfg.PointSources): """Scale up point source amplitude to a higher S_{cut} = 0.1 Jy""" A = 3.55e-5 nu_0 = 408.0 ...
radiocosmologyREPO_NAMEdriftscanPATH_START.@driftscan_extracted@driftscan-master@drift@core@skymodel.py@.PATH_END.py
{ "filename": "_mirror.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/scene/zaxis/_mirror.py", "type": "Python" }
import _plotly_utils.basevalidators class MirrorValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="mirror", parent_name="layout.scene.zaxis", **kwargs ): super(MirrorValidator, self).__init__( plotly_name=plotly_name, parent_na...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@scene@zaxis@_mirror.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "hpparvi/PyTransit", "repo_path": "PyTransit_extracted/PyTransit-master/pytransit/orbits/__init__.py", "type": "Python" }
# PyTransit: fast and easy exoplanet transit modelling in Python. # Copyright (C) 2010-2019 Hannu Parviainen # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Licen...
hpparviREPO_NAMEPyTransitPATH_START.@PyTransit_extracted@PyTransit-master@pytransit@orbits@__init__.py@.PATH_END.py
{ "filename": "test_astropy_observatory.py", "repo_name": "nanograv/PINT", "repo_path": "PINT_extracted/PINT-master/tests/test_astropy_observatory.py", "type": "Python" }
import pytest import logging import pytest import numpy as np import pint.observatory class TestAstropyObservatory: """ Test fallback from PINT observatories to astropy observatories.""" @classmethod def setup_class(cls): # name and ITRF of an observatory that PINT should know about c...
nanogravREPO_NAMEPINTPATH_START.@PINT_extracted@PINT-master@tests@test_astropy_observatory.py@.PATH_END.py
{ "filename": "_dash.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatterternary/line/_dash.py", "type": "Python" }
import _plotly_utils.basevalidators class DashValidator(_plotly_utils.basevalidators.DashValidator): def __init__(self, plotly_name="dash", parent_name="scatterternary.line", **kwargs): super(DashValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatterternary@line@_dash.py@.PATH_END.py
{ "filename": "_stream.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/indicator/_stream.py", "type": "Python" }
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Stream(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "indicator" _path_str = "indicator.stream" _valid_props = {"maxpoints", "token"} # maxpo...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@indicator@_stream.py@.PATH_END.py
{ "filename": "Reverse_modeling.ipynb", "repo_name": "HajimeKawahara/exojax", "repo_path": "exojax_extracted/exojax-master/documents/tutorials/Reverse_modeling.ipynb", "type": "Jupyter Notebook" }
# Reverse Modelling of an Emission Spectrum (opacity calculator = LPF) Here, we use the mock spectrum generated by the tutorial of "Foward modeling". ```python import pandas as pd import numpy as np import matplotlib.pyplot as plt import jax.numpy as jnp ``` ```python dat=pd.read_csv("spectrum.txt",delimiter=",",...
HajimeKawaharaREPO_NAMEexojaxPATH_START.@exojax_extracted@exojax-master@documents@tutorials@Reverse_modeling.ipynb@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/barpolar/hoverlabel/font/__init__.py", "type": "Python" }
import sys from typing import TYPE_CHECKING if sys.version_info < (3, 7) or TYPE_CHECKING: from ._weightsrc import WeightsrcValidator from ._weight import WeightValidator from ._variantsrc import VariantsrcValidator from ._variant import VariantValidator from ._textcasesrc import TextcasesrcValidat...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@barpolar@hoverlabel@font@__init__.py@.PATH_END.py
{ "filename": "lightcurve.py", "repo_name": "lgrcia/paper-nuance", "repo_path": "paper-nuance_extracted/paper-nuance-main/workflows/control_test_bls/scripts/lightcurve.py", "type": "Python" }
import numpy as np np.random.seed(0) # 2 min cadence time = np.arange(0, 6, 2 / 60 / 24) error = np.ones_like(time) * 0.0005 flux = np.random.normal(loc=1.0, scale=error[0], size=len(time)) np.save( snakemake.output[0], np.array([time, flux, error]), )
lgrciaREPO_NAMEpaper-nuancePATH_START.@paper-nuance_extracted@paper-nuance-main@workflows@control_test_bls@scripts@lightcurve.py@.PATH_END.py
{ "filename": "change_horizontal_resolution_of_restart_file.py", "repo_name": "ExeClim/Isca", "repo_path": "Isca_extracted/Isca-master/src/extra/python/scripts/change_horizontal_resolution_of_restart_file.py", "type": "Python" }
"""Script for changing the horizontal resolution of an FMS restart file""" import xarray as xar import numpy as np import gauss_grid as gg import scipy.interpolate as scinterp import pdb import mpl_toolkits.basemap as basemap import matplotlib.pyplot as plt import sh from netCDF4 import Dataset import copy_netcdf_attrs...
ExeClimREPO_NAMEIscaPATH_START.@Isca_extracted@Isca-master@src@extra@python@scripts@change_horizontal_resolution_of_restart_file.py@.PATH_END.py
{ "filename": "_tick0.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter/marker/colorbar/_tick0.py", "type": "Python" }
import _plotly_utils.basevalidators class Tick0Validator(_plotly_utils.basevalidators.AnyValidator): def __init__( self, plotly_name="tick0", parent_name="scatter.marker.colorbar", **kwargs ): super(Tick0Validator, self).__init__( plotly_name=plotly_name, parent_name=pa...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter@marker@colorbar@_tick0.py@.PATH_END.py
{ "filename": "tree.py", "repo_name": "shaoshanglqy/shap-shapley", "repo_path": "shap-shapley_extracted/shap-shapley-master/shap/explainers/tree.py", "type": "Python" }
import numpy as np import multiprocessing import sys import json import os import struct from distutils.version import LooseVersion from .explainer import Explainer from ..common import assert_import, record_import_error try: from .. import _cext except ImportError as e: record_import_error("cext", "C extensio...
shaoshanglqyREPO_NAMEshap-shapleyPATH_START.@shap-shapley_extracted@shap-shapley-master@shap@explainers@tree.py@.PATH_END.py
{ "filename": "mu_fft.py", "repo_name": "kapteyn-astro/kapteyn", "repo_path": "kapteyn_extracted/kapteyn-master/doc/source/EXAMPLES/mu_fft.py", "type": "Python" }
from kapteyn import maputils from matplotlib import pyplot as plt from numpy import fft, log, abs, angle f = maputils.FITSimage("m101.fits") yshift = -0.1 fig = plt.figure(figsize=(8,6)) fig.subplots_adjust(left=0.01, bottom=0.1, right=1.0, top=0.98, wspace=0.03, hspace=0.16) frame = fig.add_subp...
kapteyn-astroREPO_NAMEkapteynPATH_START.@kapteyn_extracted@kapteyn-master@doc@source@EXAMPLES@mu_fft.py@.PATH_END.py
{ "filename": "test_notebooks.py", "repo_name": "lwa-project/lsl", "repo_path": "lsl_extracted/lsl-main/tests/test_notebooks.py", "type": "Python" }
""" Unit tests for the various LSL IPython notebooks. """ import unittest import glob import sys import re import os from tempfile import mkdtemp from shutil import rmtree currentDir = os.path.abspath(os.getcwd()) if os.path.exists(os.path.join(currentDir, '..', 'docs', 'notebooks')): MODULE_BUILD = os.path.join(...
lwa-projectREPO_NAMElslPATH_START.@lsl_extracted@lsl-main@tests@test_notebooks.py@.PATH_END.py
{ "filename": "_ticktext.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/histogram2d/colorbar/_ticktext.py", "type": "Python" }
import _plotly_utils.basevalidators class TicktextValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__( self, plotly_name="ticktext", parent_name="histogram2d.colorbar", **kwargs ): super(TicktextValidator, self).__init__( plotly_name=plotly_name, pa...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@histogram2d@colorbar@_ticktext.py@.PATH_END.py
{ "filename": "test_vecm.py", "repo_name": "statsmodels/statsmodels", "repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/tsa/vector_ar/tests/test_vecm.py", "type": "Python" }
import numpy as np from numpy.testing import ( assert_, assert_allclose, assert_array_equal, assert_raises, assert_raises_regex, ) import pytest import statsmodels.datasets.interest_inflation.data as e6 from statsmodels.tools.testing import assert_equal from statsmodels.tsa.vector_ar.tests.JMulTi_r...
statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@tsa@vector_ar@tests@test_vecm.py@.PATH_END.py
{ "filename": "test_docstrings.py", "repo_name": "scikit-learn/scikit-learn", "repo_path": "scikit-learn_extracted/scikit-learn-main/sklearn/tests/test_docstrings.py", "type": "Python" }
import re from inspect import signature from typing import Optional import pytest # make it possible to discover experimental estimators when calling `all_estimators` from sklearn.experimental import ( enable_halving_search_cv, # noqa enable_iterative_imputer, # noqa ) from sklearn.utils.discovery import al...
scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@sklearn@tests@test_docstrings.py@.PATH_END.py
{ "filename": "fixtures.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/community/tests/integration_tests/retrievers/docarray/fixtures.py", "type": "Python" }
from __future__ import annotations from pathlib import Path from typing import TYPE_CHECKING, Any, Dict, Generator, Tuple import numpy as np import pytest from pydantic import Field if TYPE_CHECKING: from docarray.index import ( ElasticDocIndex, HnswDocumentIndex, InMemoryExactNNIndex, ...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@integration_tests@retrievers@docarray@fixtures.py@.PATH_END.py
{ "filename": "merge.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/document_loaders/merge.py", "type": "Python" }
from typing import TYPE_CHECKING, Any from langchain._api import create_importer if TYPE_CHECKING: from langchain_community.document_loaders import MergedDataLoader # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optional impor...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@document_loaders@merge.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattermapbox/stream/__init__.py", "type": "Python" }
import sys from typing import TYPE_CHECKING if sys.version_info < (3, 7) or TYPE_CHECKING: from ._token import TokenValidator from ._maxpoints import MaxpointsValidator else: from _plotly_utils.importers import relative_import __all__, __getattr__, __dir__ = relative_import( __name__, [], ["._...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattermapbox@stream@__init__.py@.PATH_END.py
{ "filename": "quantizers_test.py", "repo_name": "keras-team/keras", "repo_path": "keras_extracted/keras-master/keras/src/quantizers/quantizers_test.py", "type": "Python" }
from keras.src import ops from keras.src import quantizers from keras.src import random from keras.src import testing class QuantizersTest(testing.TestCase): def test_get_method(self): quantizer = quantizers.get("abs_max_quantizer", axis=-1) self.assertTrue(quantizer, quantizers.AbsMaxQuantizer) ...
keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@quantizers@quantizers_test.py@.PATH_END.py
{ "filename": "_color.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/treemap/textfont/_color.py", "type": "Python" }
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__(self, plotly_name="color", parent_name="treemap.textfont", **kwargs): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@treemap@textfont@_color.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/icicle/domain/__init__.py", "type": "Python" }
import sys from typing import TYPE_CHECKING if sys.version_info < (3, 7) or TYPE_CHECKING: from ._y import YValidator from ._x import XValidator from ._row import RowValidator from ._column import ColumnValidator else: from _plotly_utils.importers import relative_import __all__, __getattr__, _...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@icicle@domain@__init__.py@.PATH_END.py
{ "filename": "04c. Analysis (multiclass).ipynb", "repo_name": "sidchaini/LightCurveDistanceClassification", "repo_path": "LightCurveDistanceClassification_extracted/LightCurveDistanceClassification-main/notebooks/04. Analysis/04c. Analysis (multiclass).ipynb", "type": "Jupyter Notebook" }
```python import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import ast import os os.chdir("../../") import json import plotly.express as px import sys sys.path.append("scripts") import utils import distclassipy as dcpy cd = dcpy.Distance() ``` ```python with open("setti...
sidchainiREPO_NAMELightCurveDistanceClassificationPATH_START.@LightCurveDistanceClassification_extracted@LightCurveDistanceClassification-main@notebooks@04. Analysis@04c. Analysis (multiclass).ipynb@.PATH_END.py
{ "filename": "README.md", "repo_name": "ageller/firefly", "repo_path": "firefly_extracted/firefly-main/README.md", "type": "Markdown" }
# Firefly [![PyPI](https://img.shields.io/pypi/v/Firefly)](https://pypi.org/project/Firefly) <a href="https://ascl.net/1810.021"><img src="https://img.shields.io/badge/ascl-1810.021-blue.svg?colorB=262255" alt="ascl:1810.021" /></a> ![logo banner](https://github.com/ageller/Firefly/blob/main/docs/source/_static/four...
agellerREPO_NAMEfireflyPATH_START.@firefly_extracted@firefly-main@README.md@.PATH_END.py
{ "filename": "_style.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/splom/marker/colorbar/tickfont/_style.py", "type": "Python" }
import _plotly_utils.basevalidators class StyleValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="style", parent_name="splom.marker.colorbar.tickfont", **kwargs, ): super(StyleValidator, self).__init__( plotly_name=...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@splom@marker@colorbar@tickfont@_style.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "sibirrer/hierArc", "repo_path": "hierArc_extracted/hierArc-main/test/test_Sampling/test_ParamManager/__init__.py", "type": "Python" }
sibirrerREPO_NAMEhierArcPATH_START.@hierArc_extracted@hierArc-main@test@test_Sampling@test_ParamManager@__init__.py@.PATH_END.py
{ "filename": "slice-convgrad.py", "repo_name": "amrex-astro/MAESTRO", "repo_path": "MAESTRO_extracted/MAESTRO-master/Util/postprocessing/urca-tools/slice-convgrad.py", "type": "Python" }
#!/usr/bin/env python import yt from yt import derived_field import numpy as np import argparse parser = argparse.ArgumentParser() parser.add_argument('infile', type=str, help='Name of input plotfile.') parser.add_argument('-adiabatic', '--adiabatic', action='store_true', help='If supplied, plot adiabatic excess.') pa...
amrex-astroREPO_NAMEMAESTROPATH_START.@MAESTRO_extracted@MAESTRO-master@Util@postprocessing@urca-tools@slice-convgrad.py@.PATH_END.py
{ "filename": "isolating-segmentation-objects.md", "repo_name": "ultralytics/ultralytics", "repo_path": "ultralytics_extracted/ultralytics-main/docs/en/guides/isolating-segmentation-objects.md", "type": "Markdown" }
--- comments: true description: Learn to extract isolated objects from inference results using Ultralytics Predict Mode. Step-by-step guide for segmentation object isolation. keywords: Ultralytics, segmentation, object isolation, Predict Mode, YOLO11, machine learning, object detection, binary mask, image processing --...
ultralyticsREPO_NAMEultralyticsPATH_START.@ultralytics_extracted@ultralytics-main@docs@en@guides@isolating-segmentation-objects.md@.PATH_END.py
{ "filename": "core.py", "repo_name": "D-arioSpace/astroquery", "repo_path": "astroquery_extracted/astroquery-main/astroquery/esa/iso/core.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ ===================== ISO Astroquery Module ===================== European Space Astronomy Centre (ESAC) European Space Agency (ESA) """ import re from astroquery.utils.tap.core import TapPlus from astroquery.query import BaseQuery import shutil impo...
D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@esa@iso@core.py@.PATH_END.py
{ "filename": "mu_overlaym101.py", "repo_name": "kapteyn-astro/kapteyn", "repo_path": "kapteyn_extracted/kapteyn-master/doc/source/EXAMPLES/mu_overlaym101.py", "type": "Python" }
from kapteyn import maputils from matplotlib import pyplot as plt import numpy #order = input("Enter order of spline interpolation in range 0..5: ") order = 1 if order < 0: order = 0 if order > 5: order = 5 file1 = "m101OPT.fits" Basefits = maputils.FITSimage(file1) pxlim = (50,500); pylim = (50,500) Basefits.set_li...
kapteyn-astroREPO_NAMEkapteynPATH_START.@kapteyn_extracted@kapteyn-master@doc@source@EXAMPLES@mu_overlaym101.py@.PATH_END.py
{ "filename": "_showticklabels.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/scene/zaxis/_showticklabels.py", "type": "Python" }
import _plotly_utils.basevalidators class ShowticklabelsValidator(_plotly_utils.basevalidators.BooleanValidator): def __init__( self, plotly_name="showticklabels", parent_name="layout.scene.zaxis", **kwargs ): super(ShowticklabelsValidator, self).__init__( plotly_name=plotly_name, ...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@scene@zaxis@_showticklabels.py@.PATH_END.py
{ "filename": "gtk3_spreadsheet_sgskip.py", "repo_name": "matplotlib/matplotlib", "repo_path": "matplotlib_extracted/matplotlib-main/galleries/examples/user_interfaces/gtk3_spreadsheet_sgskip.py", "type": "Python" }
""" ================ GTK3 spreadsheet ================ Example of embedding Matplotlib in an application and interacting with a treeview to store data. Double-click on an entry to update plot data. """ import gi gi.require_version('Gtk', '3.0') gi.require_version('Gdk', '3.0') from gi.repository import Gdk, Gtk fr...
matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@galleries@examples@user_interfaces@gtk3_spreadsheet_sgskip.py@.PATH_END.py
{ "filename": "_shadow.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/parcoords/line/colorbar/title/font/_shadow.py", "type": "Python" }
import _plotly_utils.basevalidators class ShadowValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="shadow", parent_name="parcoords.line.colorbar.title.font", **kwargs, ): super(ShadowValidator, self).__init__( plotly_na...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@parcoords@line@colorbar@title@font@_shadow.py@.PATH_END.py
{ "filename": "test_pool.py", "repo_name": "sibirrer/lenstronomy", "repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_Sampling/test_Pool/test_pool.py", "type": "Python" }
import pytest from lenstronomy.Sampling.Pool.pool import choose_pool from lenstronomy.Sampling.Pool.multiprocessing import MultiPool class TestPool(object): def setup_method(self): pass def test_choose_pool(self): import schwimmbad pool = choose_pool(mpi=False, processes=1, use_dill=...
sibirrerREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_Sampling@test_Pool@test_pool.py@.PATH_END.py
{ "filename": "interface_orig.py", "repo_name": "amusecode/amuse", "repo_path": "amuse_extracted/amuse-main/src/amuse/community/mmc/interface_orig.py", "type": "Python" }
from amuse.community import * class mmc2Interface(CodeInterface): include_headers = ['worker_code.h'] def __init__(self, **keyword_arguments): CodeInterface.__init__(self, name_of_the_worker="mmc2_worker", **keyword_arguments) @legacy_function def echo_int(): function = L...
amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@src@amuse@community@mmc@interface_orig.py@.PATH_END.py
{ "filename": "make_figure_20.ipynb", "repo_name": "tcallister/autoregressive-bbh-inference", "repo_path": "autoregressive-bbh-inference_extracted/autoregressive-bbh-inference-main/figures/make_figure_20.ipynb", "type": "Jupyter Notebook" }
```python import matplotlib.pylab as plt import matplotlib as mpl import numpy as np import h5py from scipy.special import erf mpl.style.use('./plotting.mplstyle') from makeCorner import * ``` ```python # Load AR results: Gaussian Xeff_Xp_data = h5py.File("./../data/ar_Xeff_Xp_summary.hdf","r") ``` ```python plot_d...
tcallisterREPO_NAMEautoregressive-bbh-inferencePATH_START.@autoregressive-bbh-inference_extracted@autoregressive-bbh-inference-main@figures@make_figure_20.ipynb@.PATH_END.py
{ "filename": "TestClean.py", "repo_name": "saopicc/DDFacet", "repo_path": "DDFacet_extracted/DDFacet-master/DDFacet/Tests/ShortAcceptanceTests/TestClean.py", "type": "Python" }
''' DDFacet, a facet-based radio imaging package Copyright (C) 2013-2016 Cyril Tasse, l'Observatoire de Paris, SKA South Africa, Rhodes University 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; eit...
saopiccREPO_NAMEDDFacetPATH_START.@DDFacet_extracted@DDFacet-master@DDFacet@Tests@ShortAcceptanceTests@TestClean.py@.PATH_END.py
{ "filename": "_showlegend.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/histogram/_showlegend.py", "type": "Python" }
import _plotly_utils.basevalidators class ShowlegendValidator(_plotly_utils.basevalidators.BooleanValidator): def __init__(self, plotly_name="showlegend", parent_name="histogram", **kwargs): super(ShowlegendValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@histogram@_showlegend.py@.PATH_END.py