metadata
dict
text
stringlengths
0
40.6M
id
stringlengths
14
255
{ "filename": "posterior_ensemble.py", "repo_name": "mackelab/sbi", "repo_path": "sbi_extracted/sbi-main/sbi/utils/posterior_ensemble.py", "type": "Python" }
# This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed # under the Apache License Version 2.0, see <https://www.apache.org/licenses/> import warnings from typing import List, Optional, Union from torch import Tensor from torch.distributions import Distribution from sbi.inference.poster...
mackelabREPO_NAMEsbiPATH_START.@sbi_extracted@sbi-main@sbi@utils@posterior_ensemble.py@.PATH_END.py
{ "filename": "CONTRIBUTING.md", "repo_name": "mperrin/poppy", "repo_path": "poppy_extracted/poppy-master/CONTRIBUTING.md", "type": "Markdown" }
Please open a new issue or new pull request for bugs, feedback, or new features you would like to see. If there is an issue you would like to work on, please leave a comment and we will be happy to assist. New contributions and contributors are very welcome! New to github or open source projects? If you are unsure abo...
mperrinREPO_NAMEpoppyPATH_START.@poppy_extracted@poppy-master@CONTRIBUTING.md@.PATH_END.py
{ "filename": "FITSBeamInterpolator.py", "repo_name": "ratt-ru/CubiCal", "repo_path": "CubiCal_extracted/CubiCal-master/cubical/degridder/FITSBeamInterpolator.py", "type": "Python" }
# CubiCal: a radio interferometric calibration suite # (c) 2017 Rhodes University & Jonathan S. Kenyon # http://github.com/ratt-ru/CubiCal # This code is distributed under the terms of GPLv2, see LICENSE.md for details from __future__ import absolute_import from __future__ import division from __future__ import print_f...
ratt-ruREPO_NAMECubiCalPATH_START.@CubiCal_extracted@CubiCal-master@cubical@degridder@FITSBeamInterpolator.py@.PATH_END.py
{ "filename": "readme.md", "repo_name": "logan-pearce/LOFTI", "repo_path": "LOFTI_extracted/LOFTI-master/Using_Position_Vector/readme.md", "type": "Markdown" }
# LOFTI #### Or: Logan's OFTI This is my implementation of Orbits for the Impatient developed by Blunt et.al. 2017 (http://iopscience.iop.org/article/10.3847/1538-3881/aa6930/pdf). It was developed independantly from that group's efforts based on this paper. This is the version of LOFTI that fits in 6-d phasespace, ...
logan-pearceREPO_NAMELOFTIPATH_START.@LOFTI_extracted@LOFTI-master@Using_Position_Vector@readme.md@.PATH_END.py
{ "filename": "example_script_m.py", "repo_name": "wfirst-cgi/emccd_detect", "repo_path": "emccd_detect_extracted/emccd_detect-master/emccd_detect/example_script_m.py", "type": "Python" }
# -*- coding: utf-8 -*- """Example script for EMCCDDetect calls.""" import os import sys from pathlib import Path import numpy as np import matplotlib.pyplot as plt from astropy.io import fits from emccd_detect.emccd_detect import EMCCDDetect, emccd_detect def imagesc(data, title=None, vmin=None, vmax=None, cmap='...
wfirst-cgiREPO_NAMEemccd_detectPATH_START.@emccd_detect_extracted@emccd_detect-master@emccd_detect@example_script_m.py@.PATH_END.py
{ "filename": "discriminator.py", "repo_name": "xwzhang98/SREmulator", "repo_path": "SREmulator_extracted/SREmulator-main/map2map/map2map/models/discriminator.py", "type": "Python" }
import math import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from scipy.special import hyp2f1 from functools import partial class Downsample(nn.Module): def __init__( self, in_channels, use_conv, out_channels=None, padding=0, pad...
xwzhang98REPO_NAMESREmulatorPATH_START.@SREmulator_extracted@SREmulator-main@map2map@map2map@models@discriminator.py@.PATH_END.py
{ "filename": "human.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/llms/human.py", "type": "Python" }
from typing import Any, Callable, List, Mapping, Optional from langchain_core.callbacks import CallbackManagerForLLMRun from langchain_core.language_models.llms import LLM from pydantic import Field from langchain_community.llms.utils import enforce_stop_tokens def _display_prompt(prompt: str) -> None: """Displ...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@llms@human.py@.PATH_END.py
{ "filename": "demo_starglm_agent.ipynb", "repo_name": "Yu-Yang-Li/StarWhisper", "repo_path": "StarWhisper_extracted/StarWhisper-main/Agent_demo/demo_starglm_agent.ipynb", "type": "Jupyter Notebook" }
### clone代码 ```python !git clone https://github.com/modelscope/modelscope-agent.git ``` ### 安装特定依赖 ```python !cd modelscope-agent && pip install -r requirements.txt ! pip install transformers_stream_generator ! pip install invisible-watermark>=2.0 ``` ```python import os os.chdir('modelscope-agent/demo') impo...
Yu-Yang-LiREPO_NAMEStarWhisperPATH_START.@StarWhisper_extracted@StarWhisper-main@Agent_demo@demo_starglm_agent.ipynb@.PATH_END.py
{ "filename": "jump.py", "repo_name": "spacetelescope/jwst", "repo_path": "jwst_extracted/jwst-main/jwst/jump/jump.py", "type": "Python" }
import logging import numpy as np from stcal.jump.jump import detect_jumps from stdatamodels.jwst.datamodels import dqflags from ..lib import reffile_utils log = logging.getLogger(__name__) log.setLevel(logging.DEBUG) def run_detect_jumps(output_model, gain_model, readnoise_model, rejection_thr...
spacetelescopeREPO_NAMEjwstPATH_START.@jwst_extracted@jwst-main@jwst@jump@jump.py@.PATH_END.py
{ "filename": "einsum_utils.py", "repo_name": "neuraloperator/neuraloperator", "repo_path": "neuraloperator_extracted/neuraloperator-main/neuralop/layers/einsum_utils.py", "type": "Python" }
import torch import opt_einsum import tensorly as tl from tensorly.plugins import use_opt_einsum tl.set_backend('pytorch') use_opt_einsum('optimal') def einsum_complexhalf_two_input(eq, a, b): """ Compute (two-input) einsum for complexhalf tensors. Because torch.einsum currently does not support complex32...
neuraloperatorREPO_NAMEneuraloperatorPATH_START.@neuraloperator_extracted@neuraloperator-main@neuralop@layers@einsum_utils.py@.PATH_END.py
{ "filename": "gps_test.py", "repo_name": "LSSTDESC/snmachine", "repo_path": "snmachine_extracted/snmachine-main/test/gps_test.py", "type": "Python" }
""" Tests related to Gaussian Processes module. """ import os import numpy as np import pytest import pandas as pd from snmachine import example_data, gps # Import test data example_data_path = os.path.join(example_data, 'example_data_for_tests.pckl') example_data = pd.read_pickle(example_data_path) # Start the ...
LSSTDESCREPO_NAMEsnmachinePATH_START.@snmachine_extracted@snmachine-main@test@gps_test.py@.PATH_END.py
{ "filename": "axislabels.py", "repo_name": "waynebhayes/SpArcFiRe", "repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/visualization/wcsaxes/axislabels.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import print_function, division, absolute_import import numpy as np from matplotlib.text import Text import matplotlib.transforms as mtransforms from .frame import RectangularFrame class AxisLabels(Text): def __init__(self, frame...
waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@visualization@wcsaxes@axislabels.py@.PATH_END.py
{ "filename": "_coloraxis.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/cone/_coloraxis.py", "type": "Python" }
import _plotly_utils.basevalidators class ColoraxisValidator(_plotly_utils.basevalidators.SubplotidValidator): def __init__(self, plotly_name="coloraxis", parent_name="cone", **kwargs): super(ColoraxisValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@cone@_coloraxis.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "wmpg/Supracenter", "repo_path": "Supracenter_extracted/Supracenter-master/supra/__init__.py", "type": "Python" }
wmpgREPO_NAMESupracenterPATH_START.@Supracenter_extracted@Supracenter-master@supra@__init__.py@.PATH_END.py
{ "filename": "drf.py", "repo_name": "Keck-DataReductionPipelines/OsirisDRP", "repo_path": "OsirisDRP_extracted/OsirisDRP-master/tests/drptestbones/drf.py", "type": "Python" }
# -*- coding: utf-8 -*- """ Functions for parsing and understanding DRFs. """ import os import xml.etree.ElementTree as et __all__ = ['expand_osiris_path'] def expand_osiris_path(path): """Expand an OSIRIS path which might contain environment variables.""" return os.path.normpath(os.path.expanduser(os.path.ex...
Keck-DataReductionPipelinesREPO_NAMEOsirisDRPPATH_START.@OsirisDRP_extracted@OsirisDRP-master@tests@drptestbones@drf.py@.PATH_END.py
{ "filename": "dome.py", "repo_name": "astroufsc/chimera", "repo_path": "chimera_extracted/chimera-master/src/chimera/instruments/dome.py", "type": "Python" }
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # chimera - observatory automation system # Copyright (C) 2006-2007 P. Henrique Silva <henrique@astro.ufsc.br> # Copyright (C) 2006-2007 Antonio Kanaan <kanaan@astro.ufsc.br> # This program is free software; you can redistribute it and/or # modify it under the ter...
astroufscREPO_NAMEchimeraPATH_START.@chimera_extracted@chimera-master@src@chimera@instruments@dome.py@.PATH_END.py
{ "filename": "test_metacal.py", "repo_name": "GalSim-developers/GalSim", "repo_path": "GalSim_extracted/GalSim-main/tests/test_metacal.py", "type": "Python" }
# Copyright (c) 2012-2023 by the GalSim developers team on GitHub # https://github.com/GalSim-developers # # This file is part of GalSim: The modular galaxy image simulation toolkit. # https://github.com/GalSim-developers/GalSim # # GalSim is free software: redistribution and use in source and binary forms, # with or w...
GalSim-developersREPO_NAMEGalSimPATH_START.@GalSim_extracted@GalSim-main@tests@test_metacal.py@.PATH_END.py
{ "filename": "subhalo_model_factory.py", "repo_name": "astropy/halotools", "repo_path": "halotools_extracted/halotools-master/halotools/empirical_models/factories/subhalo_model_factory.py", "type": "Python" }
""" Module storing the `~halotools.empirical_models.SubhaloModelFactory` class that governs how all subhalo-based models are built. """ from copy import copy from warnings import warn import collections from ..factories import ModelFactory, SubhaloMockFactory from .. import model_helpers from ...sim_manager import ...
astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@halotools@empirical_models@factories@subhalo_model_factory.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "statsmodels/statsmodels", "repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/regression/tests/results/__init__.py", "type": "Python" }
statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@regression@tests@results@__init__.py@.PATH_END.py
{ "filename": "propagate.py", "repo_name": "jrenaud90/TidalPy", "repo_path": "TidalPy_extracted/TidalPy-main/TidalPy/radial_solver/matrix/propagate.py", "type": "Python" }
""" Propagation of tidal solution using the fundamental matrix References ---------- SVC16 : Sabadini, Vermeerson, & Cambiotti (2016, DOI: 10.1007/978-94-017-7552-6) HH14 : Henning & Hurford (2014, DOI: 10.1088/0004-637X/789/1/30) ID : IcyDwarf Code by Marc Neveu (https://github.com/MarcNeveu/IcyDwarf/blob/master/...
jrenaud90REPO_NAMETidalPyPATH_START.@TidalPy_extracted@TidalPy-main@TidalPy@radial_solver@matrix@propagate.py@.PATH_END.py
{ "filename": "readme.md", "repo_name": "STEllAR-GROUP/octotiger", "repo_path": "octotiger_extracted/octotiger-master/tools/docker/base_image/readme.md", "type": "Markdown" }
# Supported tags and respective `Dockerfile` links * `prerequisites-clang9-debug`, LLVM 9.0.0, HPX, Vc, and Boost built in Debug mode * [Dockerfile](https://github.com/STEllAR-GROUP/octotiger/blob/master/tools/docker/base_image/prerequisites-clang.dockerfile) * build arguments: `UBUNTU_RELEASE=18.04` `LLVM_RELEASE=9....
STEllAR-GROUPREPO_NAMEoctotigerPATH_START.@octotiger_extracted@octotiger-master@tools@docker@base_image@readme.md@.PATH_END.py
{ "filename": "_tickcolor.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattermap/marker/colorbar/_tickcolor.py", "type": "Python" }
import _plotly_utils.basevalidators class TickcolorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="tickcolor", parent_name="scattermap.marker.colorbar", **kwargs, ): super(TickcolorValidator, self).__init__( plotly_na...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattermap@marker@colorbar@_tickcolor.py@.PATH_END.py
{ "filename": "_clicktoshow.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/annotation/_clicktoshow.py", "type": "Python" }
import _plotly_utils.basevalidators class ClicktoshowValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="clicktoshow", parent_name="layout.annotation", **kwargs ): super(ClicktoshowValidator, self).__init__( plotly_name=plotly_name, ...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@annotation@_clicktoshow.py@.PATH_END.py
{ "filename": "test_arpack.py", "repo_name": "scipy/scipy", "repo_path": "scipy_extracted/scipy-main/scipy/sparse/linalg/_eigen/arpack/tests/test_arpack.py", "type": "Python" }
__usage__ = """ To run tests locally: python tests/test_arpack.py [-l<int>] [-v<int>] """ import threading import itertools import numpy as np from numpy.testing import assert_allclose, assert_equal, suppress_warnings from pytest import raises as assert_raises import pytest from numpy import dot, conj, random fr...
scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@sparse@linalg@_eigen@arpack@tests@test_arpack.py@.PATH_END.py
{ "filename": "master_script.py", "repo_name": "benrendle/AIMS", "repo_path": "AIMS_extracted/AIMS-master/AIMS-Py35/Binary_Grid_Generation/master_script.py", "type": "Python" }
# Makes script that extracts the tgz files ######################################## def get_lines(filename): lines = [] with open(filename) as f: for line in f: lines.append(line.rstrip("\n")) return lines ########################################## root = "/home/miglioa/GridCLESAIMS_D" # location of .tgz f...
benrendleREPO_NAMEAIMSPATH_START.@AIMS_extracted@AIMS-master@AIMS-Py35@Binary_Grid_Generation@master_script.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/indicator/delta/font/_family.py", "type": "Python" }
import _plotly_utils.basevalidators class FamilyValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="family", parent_name="indicator.delta.font", **kwargs ): super(FamilyValidator, self).__init__( plotly_name=plotly_name, parent_name...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@indicator@delta@font@_family.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "ratt-ru/QuartiCal", "repo_path": "QuartiCal_extracted/QuartiCal-main/quartical/weights/__init__.py", "type": "Python" }
ratt-ruREPO_NAMEQuartiCalPATH_START.@QuartiCal_extracted@QuartiCal-main@quartical@weights@__init__.py@.PATH_END.py
{ "filename": "runtime.py", "repo_name": "desihub/LSS", "repo_path": "LSS_extracted/LSS-main/py/LSS/DESI_ke/runtime.py", "type": "Python" }
import os import sys import time import warnings from astropy.io.fits.verify import VerifyWarning from astropy.utils.metadata import MergeConflictWarning # Suppress verify warnings, e.g. HIERARCH card length. warnings.simplefilter('ignore', category=VerifyWarning) warnings.simplefilter('ignore', category=MergeCo...
desihubREPO_NAMELSSPATH_START.@LSS_extracted@LSS-main@py@LSS@DESI_ke@runtime.py@.PATH_END.py
{ "filename": "tracer_relativistic_effects.ipynb", "repo_name": "MikeSWang/HorizonGRound", "repo_path": "HorizonGRound_extracted/HorizonGRound-master/application/publication/tracer_relativistic_effects.ipynb", "type": "Jupyter Notebook" }
# Relativistic Effects in Tracer Clustering We consider relativistic corrections to the power spectrum multipoles as constrained by luminosity function results, and compare it to other effects such as redshift-space distortions (RSD) and scale-dependent linear bias from local primordial non-Gaussianity $f_\mathrm{NL}$...
MikeSWangREPO_NAMEHorizonGRoundPATH_START.@HorizonGRound_extracted@HorizonGRound-master@application@publication@tracer_relativistic_effects.ipynb@.PATH_END.py
{ "filename": "formatter_locator.py", "repo_name": "waynebhayes/SpArcFiRe", "repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/visualization/wcsaxes/formatter_locator.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import print_function, division, absolute_import # This file defines the AngleFormatterLocator class which is a class that # provides both a method for a formatter and one for a locator, for a given # label spacing. The advantage of keepi...
waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@visualization@wcsaxes@formatter_locator.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "xraypy/xraylarch", "repo_path": "xraylarch_extracted/xraylarch-master/larch/xafs/__init__.py", "type": "Python" }
__DOC__ = ''' XAFS Functions for Larch, essentially Ifeffit 2 The functions here include (but are not limited to): function description ------------ ------------------------------ pre_edge pre_edge subtraction, normalization autobk XAFS background subtraction (mu(E) to chi(k)) xftf ...
xraypyREPO_NAMExraylarchPATH_START.@xraylarch_extracted@xraylarch-master@larch@xafs@__init__.py@.PATH_END.py
{ "filename": "_subplots.py", "repo_name": "waynebhayes/SpArcFiRe", "repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/matplotlib/axes/_subplots.py", "type": "Python" }
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from six.moves import map from matplotlib.gridspec import GridSpec, SubplotSpec from matplotlib import docstring import matplotlib.artist as martist from matplotlib.axes._axes import Axes import wa...
waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@matplotlib@axes@_subplots.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "lenstronomy/lenstronomy", "repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_Util/__init__.py", "type": "Python" }
lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_Util@__init__.py@.PATH_END.py
{ "filename": "account.py", "repo_name": "jabesq-org/pyatmo", "repo_path": "pyatmo_extracted/pyatmo-master/src/pyatmo/account.py", "type": "Python" }
"""Support for a Netatmo account.""" from __future__ import annotations import logging from typing import TYPE_CHECKING, Any from uuid import uuid4 from pyatmo import modules from pyatmo.const import ( GETEVENTS_ENDPOINT, GETHOMECOACHDATA_ENDPOINT, GETHOMESDATA_ENDPOINT, GETHOMESTATUS_ENDPOINT, G...
jabesq-orgREPO_NAMEpyatmoPATH_START.@pyatmo_extracted@pyatmo-master@src@pyatmo@account.py@.PATH_END.py
{ "filename": "eventsManager.py", "repo_name": "GeminiDRSoftware/DRAGONS", "repo_path": "DRAGONS_extracted/DRAGONS-master/recipe_system/adcc/servers/eventsManager.py", "type": "Python" }
# # QAP Gemini # # eventsManager.py # ------------------------------------------------------------------------------ import json import time import re from astrodata import AstroData # ---...
GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@recipe_system@adcc@servers@eventsManager.py@.PATH_END.py
{ "filename": "_uirevision.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/mesh3d/_uirevision.py", "type": "Python" }
import _plotly_utils.basevalidators class UirevisionValidator(_plotly_utils.basevalidators.AnyValidator): def __init__(self, plotly_name="uirevision", parent_name="mesh3d", **kwargs): super(UirevisionValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@mesh3d@_uirevision.py@.PATH_END.py
{ "filename": "common.py", "repo_name": "pandas-dev/pandas", "repo_path": "pandas_extracted/pandas-main/pandas/tests/apply/common.py", "type": "Python" }
from pandas.core.groupby.base import transformation_kernels # There is no Series.cumcount or DataFrame.cumcount series_transform_kernels = [ x for x in sorted(transformation_kernels) if x != "cumcount" ] frame_transform_kernels = [x for x in sorted(transformation_kernels) if x != "cumcount"]
pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@apply@common.py@.PATH_END.py
{ "filename": "_omnibus.py", "repo_name": "maximtrp/scikit-posthocs", "repo_path": "scikit-posthocs_extracted/scikit-posthocs-master/scikit_posthocs/_omnibus.py", "type": "Python" }
# -*- coding: utf-8 -*- from typing import Optional, Union, List, cast import itertools as it import numpy as np from numpy.typing import ArrayLike import scipy.stats as ss from pandas import DataFrame, Categorical, Series from scikit_posthocs._posthocs import __convert_to_df, __convert_to_block_df def test_mackwolf...
maximtrpREPO_NAMEscikit-posthocsPATH_START.@scikit-posthocs_extracted@scikit-posthocs-master@scikit_posthocs@_omnibus.py@.PATH_END.py
{ "filename": "_ybingroup.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/histogram2d/_ybingroup.py", "type": "Python" }
import _plotly_utils.basevalidators class YbingroupValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="ybingroup", parent_name="histogram2d", **kwargs): super(YbingroupValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@histogram2d@_ybingroup.py@.PATH_END.py
{ "filename": "plot_fig7.py", "repo_name": "masoncarney/stepped_luneburg", "repo_path": "stepped_luneburg_extracted/stepped_luneburg-master/paper/fig7/plot_fig7.py", "type": "Python" }
import os, sys import numpy as np import pylab as pl from matplotlib.ticker import MultipleLocator ''' Script to plot enclosed intensity vs. theta exponent for multiple Luneburg lens runs. Theta corresponds to the angle away from the initial wavefront focal point. ''' #################################################...
masoncarneyREPO_NAMEstepped_luneburgPATH_START.@stepped_luneburg_extracted@stepped_luneburg-master@paper@fig7@plot_fig7.py@.PATH_END.py
{ "filename": "core.py", "repo_name": "gammapy/gammapy", "repo_path": "gammapy_extracted/gammapy-main/gammapy/makers/core.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst import abc import html import numpy as np __all__ = ["Maker"] class Maker(abc.ABC): """Abstract maker base class.""" @property @abc.abstractmethod def tag(self): pass @abc.abstractmethod def run(self): pass ...
gammapyREPO_NAMEgammapyPATH_START.@gammapy_extracted@gammapy-main@gammapy@makers@core.py@.PATH_END.py
{ "filename": "fred.py", "repo_name": "dentalfloss1/RaTS", "repo_path": "RaTS_extracted/RaTS-master/RaTS/fred.py", "type": "Python" }
import numpy as np class fred: """fred lightcurve class""" def __init__(self): self.edges=[1,0] # 1 is a definite edge, tophat is the default and has a definite beginning and end. Therefore it is [1,1] def earliest_crit_time(self, start_survey, tau): return start_survey - tau ...
dentalfloss1REPO_NAMERaTSPATH_START.@RaTS_extracted@RaTS-master@RaTS@fred.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/client/__init__.py", "type": "Python" }
tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@client@__init__.py@.PATH_END.py
{ "filename": "b1.py", "repo_name": "nickhand/pyRSD", "repo_path": "pyRSD_extracted/pyRSD-master/pyRSD/rsd/power/qso/derivatives/b1.py", "type": "Python" }
from . import PqsoDerivative from pyRSD.rsd.tools import k_AP, mu_AP class dPqso_db1(PqsoDerivative): """ The partial derivative of :func:`QuasarSpectrum.power` with respect to ``b1`` """ param = 'b1' @staticmethod def eval(m, pars, k, mu): kprime = k_AP(k, mu, m.alpha_perp, m.al...
nickhandREPO_NAMEpyRSDPATH_START.@pyRSD_extracted@pyRSD-master@pyRSD@rsd@power@qso@derivatives@b1.py@.PATH_END.py
{ "filename": "test_aggregator_tracer.py", "repo_name": "Jammy2211/PyAutoLens", "repo_path": "PyAutoLens_extracted/PyAutoLens-main/test_autolens/aggregator/test_aggregator_tracer.py", "type": "Python" }
import autolens as al from test_autolens.aggregator.conftest import clean, aggregator_from database_file = "db_tracer" def test__tracer_randomly_drawn_via_pdf_gen_from( masked_imaging_7x7, samples, model, ): analysis = al.AnalysisImaging(dataset=masked_imaging_7x7) agg = aggregator_from( ...
Jammy2211REPO_NAMEPyAutoLensPATH_START.@PyAutoLens_extracted@PyAutoLens-main@test_autolens@aggregator@test_aggregator_tracer.py@.PATH_END.py
{ "filename": "spacy_embeddings.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/embeddings/spacy_embeddings.py", "type": "Python" }
from typing import TYPE_CHECKING, Any from langchain._api import create_importer if TYPE_CHECKING: from langchain_community.embeddings import SpacyEmbeddings # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optional imports. DEP...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@embeddings@spacy_embeddings.py@.PATH_END.py
{ "filename": "_transpose.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/heatmap/_transpose.py", "type": "Python" }
import _plotly_utils.basevalidators class TransposeValidator(_plotly_utils.basevalidators.BooleanValidator): def __init__(self, plotly_name="transpose", parent_name="heatmap", **kwargs): super(TransposeValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@heatmap@_transpose.py@.PATH_END.py
{ "filename": "prepare_from_db.py", "repo_name": "minzastro/unidam", "repo_path": "unidam_extracted/unidam-master/unidam/tools/prepare_from_db.py", "type": "Python" }
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 17 13:31:04 2018 @author: mints """ from sqlconnection import SQLConnection conn = SQLConnection('convert', database='sage_gap') for row in conn.exec_dict('select * from catalogs', return_all=True): #keep = [] #for key in ['id', 'ra', 'd...
minzastroREPO_NAMEunidamPATH_START.@unidam_extracted@unidam-master@unidam@tools@prepare_from_db.py@.PATH_END.py
{ "filename": "PathOption.py", "repo_name": "rat-pac/rat-pac", "repo_path": "rat-pac_extracted/rat-pac-master/python/SCons/Options/PathOption.py", "type": "Python" }
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitati...
rat-pacREPO_NAMErat-pacPATH_START.@rat-pac_extracted@rat-pac-master@python@SCons@Options@PathOption.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "mhammond/pywin32", "repo_path": "pywin32_extracted/pywin32-main/adodbapi/__init__.py", "type": "Python" }
# nopycln: file # undecidable cases due to explicit re-exports https://github.com/hadialqattan/pycln/issues/205 """adodbapi - A python DB API 2.0 (PEP 249) interface to Microsoft ADO Copyright (C) 2002 Henrik Ekelund, version 2.1 by Vernon Cole * http://sourceforge.net/projects/adodbapi """ import time # Re-exports ...
mhammondREPO_NAMEpywin32PATH_START.@pywin32_extracted@pywin32-main@adodbapi@__init__.py@.PATH_END.py
{ "filename": "testPolygon.py", "repo_name": "LLNL/spheral", "repo_path": "spheral_extracted/spheral-main/tests/unit/Geometry/testPolygon.py", "type": "Python" }
#ATS:test(SELF, label="Polygon unit tests") # Unit tests for the Polygon class import unittest import functools from math import * from SpheralTestUtilities import fuzzyEqual from Spheral2d import * # Create a global random number generator. import random random.seed(402) rangen = random.Random() plots = [] #=====...
LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@tests@unit@Geometry@testPolygon.py@.PATH_END.py
{ "filename": "demo_data_time_evo.py", "repo_name": "eelregit/pmwd", "repo_path": "pmwd_extracted/pmwd-master/docs/papers/adjoint/demo_data_time_evo.py", "type": "Python" }
import numpy as np import jax.numpy as jnp from tqdm.notebook import tqdm import h5py import jax from pmwd import ( Configuration, SimpleLCDM, boltzmann, white_noise, linear_modes, lpt, nbody, scatter, ) from pmwd.nbody import nbody_init, nbody_step ptcl_spacing = 10. ptcl_grid_shape = (...
eelregitREPO_NAMEpmwdPATH_START.@pmwd_extracted@pmwd-master@docs@papers@adjoint@demo_data_time_evo.py@.PATH_END.py
{ "filename": "_ticks.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/xaxis/minor/_ticks.py", "type": "Python" }
import _plotly_utils.basevalidators class TicksValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="ticks", parent_name="layout.xaxis.minor", **kwargs): super(TicksValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@xaxis@minor@_ticks.py@.PATH_END.py
{ "filename": "imessage.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/chat_loaders/imessage.py", "type": "Python" }
from typing import TYPE_CHECKING, Any from langchain._api import create_importer if TYPE_CHECKING: from langchain_community.chat_loaders.imessage import IMessageChatLoader # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optiona...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@chat_loaders@imessage.py@.PATH_END.py
{ "filename": "test_sampler.py", "repo_name": "minaskar/pocomc", "repo_path": "pocomc_extracted/pocomc-main/tests/test_sampler.py", "type": "Python" }
import unittest import numpy as np from scipy.stats import norm from pocomc.sampler import Sampler from pocomc.prior import Prior class SamplerTestCase(unittest.TestCase): @staticmethod def log_likelihood_single(x): return np.sum(-0.5 * np.log(2 * np.pi) - 0.5 * x ** 2) @staticmethod def log...
minaskarREPO_NAMEpocomcPATH_START.@pocomc_extracted@pocomc-main@tests@test_sampler.py@.PATH_END.py
{ "filename": "target.py", "repo_name": "ashleychontos/pySYD", "repo_path": "pySYD_extracted/pySYD-master/dev/target.py", "type": "Python" }
import os import glob import numpy as np import pandas as pd from astropy.stats import mad_std from scipy.optimize import curve_fit from astropy.timeseries import LombScargle as lomb from scipy.interpolate import InterpolatedUnivariateSpline from astropy.convolution import Box1DKernel, Gaussian1DKernel, convolve, convo...
ashleychontosREPO_NAMEpySYDPATH_START.@pySYD_extracted@pySYD-master@dev@target.py@.PATH_END.py
{ "filename": "mutual_node.py", "repo_name": "rodluger/planetplanet", "repo_path": "planetplanet_extracted/planetplanet-master/scripts/mutual_node.py", "type": "Python" }
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' mutual_node.py |github| ----------------------- For random draws from the prior, computes the duration of a mutual transit between TRAPPIST-1 b and c as a function of the difference in their longitude of ascending nodes. With some scatter, the difference in this angle ...
rodlugerREPO_NAMEplanetplanetPATH_START.@planetplanet_extracted@planetplanet-master@scripts@mutual_node.py@.PATH_END.py
{ "filename": "event_list.py", "repo_name": "wilkinsdr/pylag", "repo_path": "pylag_extracted/pylag-master/pylag/event_list.py", "type": "Python" }
""" pylag.event_list Class for handling FITS event lists v1.0 - 09/04/2018 - D.R. Wilkins """ from .simulator import * from .lightcurve import * from .lag_frequency_spectrum import * from .lag_energy_spectrum import * import numpy as np try: import astropy.io.fits as pyfits except: import pyfits from scipy...
wilkinsdrREPO_NAMEpylagPATH_START.@pylag_extracted@pylag-master@pylag@event_list.py@.PATH_END.py
{ "filename": "mlp_ood.py", "repo_name": "devinamhn/RadioGalaxies-BNNs", "repo_path": "RadioGalaxies-BNNs_extracted/RadioGalaxies-BNNs-main/radiogalaxies_bnns/eval/ood/mlp_ood.py", "type": "Python" }
import torch import torch.optim as optim import numpy as np import torch.nn.functional as F import matplotlib.pyplot as plt import csv import scipy import pandas as pd import seaborn as sns from radiogalaxies_bnns.inference.models import LeNet, LeNetDrop import radiogalaxies_bnns.inference.utils as utils from radiogal...
devinamhnREPO_NAMERadioGalaxies-BNNsPATH_START.@RadioGalaxies-BNNs_extracted@RadioGalaxies-BNNs-main@radiogalaxies_bnns@eval@ood@mlp_ood.py@.PATH_END.py
{ "filename": "fs_tools.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/build/scripts/fs_tools.py", "type": "Python" }
from __future__ import print_function import os import platform import sys import shutil import errno # Explicitly enable local imports # Don't forget to add imported scripts to inputs of the calling command! sys.path.append(os.path.dirname(os.path.abspath(__file__))) import process_command_files as pcf def link_or...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@build@scripts@fs_tools.py@.PATH_END.py
{ "filename": "_textfont.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/scattergl/_textfont.py", "type": "Python" }
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Textfont(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "scattergl" _path_str = "scattergl.textfont" _valid_props = {"color", "colorsrc", "family",...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@scattergl@_textfont.py@.PATH_END.py
{ "filename": "plot_iris_exercise.py", "repo_name": "scikit-learn/scikit-learn", "repo_path": "scikit-learn_extracted/scikit-learn-main/examples/exercises/plot_iris_exercise.py", "type": "Python" }
""" ================================ SVM Exercise ================================ A tutorial exercise for using different SVM kernels. This exercise is used in the :ref:`using_kernels_tut` part of the :ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`. """ # Authors: The scikit-learn develop...
scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@examples@exercises@plot_iris_exercise.py@.PATH_END.py
{ "filename": "DiaSources.py", "repo_name": "lsst-uk/lasair-lsst", "repo_path": "lasair-lsst_extracted/lasair-lsst-main/utility/DP03/lasair_schema/DiaSources.py", "type": "Python" }
schema = { "name": "DiaSources", "fields": [ { "name": "diaSourceId", "type": "long", "doc": "Unique id." }, { "name": "ccdVisitId", "type": "long", "doc": "Id of the ccdVisit where this diaSource was measured. Note that we are allowing a diaSource to belong to multip...
lsst-ukREPO_NAMElasair-lsstPATH_START.@lasair-lsst_extracted@lasair-lsst-main@utility@DP03@lasair_schema@DiaSources.py@.PATH_END.py
{ "filename": "decomposer_base.py", "repo_name": "PAHdb/pyPAHdb", "repo_path": "pyPAHdb_extracted/pyPAHdb-master/pypahdb/decomposer_base.py", "type": "Python" }
#!/usr/bin/env python3 """ decomposer_base.py Using a precomputed matrix of theoretically calculated PAH emission spectra, an input spectrum is fitted and decomposed into contributing PAH subclasses using a non-negative least-squares (NNLS) approach. This file is part of pypahdb - see the module docs for more informa...
PAHdbREPO_NAMEpyPAHdbPATH_START.@pyPAHdb_extracted@pyPAHdb-master@pypahdb@decomposer_base.py@.PATH_END.py
{ "filename": "layer.py", "repo_name": "huggingface/peft", "repo_path": "peft_extracted/peft-main/src/peft/tuners/xlora/layer.py", "type": "Python" }
# Copyright 2024-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...
huggingfaceREPO_NAMEpeftPATH_START.@peft_extracted@peft-main@src@peft@tuners@xlora@layer.py@.PATH_END.py
{ "filename": "index.md", "repo_name": "nichollsh/AGNI", "repo_path": "AGNI_extracted/AGNI-main/docs/src/examples/index.md", "type": "Markdown" }
# Example outputs ## Pure steam runaway greenhouse effect By assuming the atmosphere temperature profile follows a dry adiabat and the water vapour-condensate coexistance curve defined by the Clausius-Claperyron relation, we see a characteristic relationship between the outgoing longwave radiation (OLR) and the surfac...
nichollshREPO_NAMEAGNIPATH_START.@AGNI_extracted@AGNI-main@docs@src@examples@index.md@.PATH_END.py
{ "filename": "_autobinx.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/histogram2d/_autobinx.py", "type": "Python" }
import _plotly_utils.basevalidators class AutobinxValidator(_plotly_utils.basevalidators.BooleanValidator): def __init__(self, plotly_name="autobinx", parent_name="histogram2d", **kwargs): super(AutobinxValidator, 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@histogram2d@_autobinx.py@.PATH_END.py
{ "filename": "test_imports.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/partners/openai/tests/unit_tests/embeddings/test_imports.py", "type": "Python" }
from langchain_openai.embeddings import __all__ EXPECTED_ALL = ["OpenAIEmbeddings", "AzureOpenAIEmbeddings"] def test_all_imports() -> None: assert sorted(EXPECTED_ALL) == sorted(__all__)
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@partners@openai@tests@unit_tests@embeddings@test_imports.py@.PATH_END.py
{ "filename": "make_WebSky_LRG_mocks.py", "repo_name": "NoahSailer/MaPar", "repo_path": "MaPar_extracted/MaPar-main/mocks/websky/make_WebSky_LRG_mocks.py", "type": "Python" }
# Code to create mock LRG maps. # Must run fetch_WebSky_products.sh and make_WebSky_LRG_subcatalogs.py first. from scipy.special import erfc import numpy as np import healpy as hp import copy from scipy.interpolate import interp1d def make_map(catalog,dN_dz,nside=2048,lnM_min=20,lnM_max=80,mask=None,f=1,Mc=10**12.89)...
NoahSailerREPO_NAMEMaParPATH_START.@MaPar_extracted@MaPar-main@mocks@websky@make_WebSky_LRG_mocks.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/volume/slices/y/__init__.py", "type": "Python" }
import sys if sys.version_info < (3, 7): from ._show import ShowValidator from ._locationssrc import LocationssrcValidator from ._locations import LocationsValidator from ._fill import FillValidator else: from _plotly_utils.importers import relative_import __all__, __getattr__, __dir__ = relat...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@volume@slices@y@__init__.py@.PATH_END.py
{ "filename": "download.py", "repo_name": "cta-observatory/ctapipe", "repo_path": "ctapipe_extracted/ctapipe-main/src/ctapipe/utils/download.py", "type": "Python" }
import logging import os from pathlib import Path from urllib.parse import urlparse import requests from tqdm.auto import tqdm from .filelock import FileLock __all__ = ["download_file", "download_cached", "download_file_cached"] log = logging.getLogger(__name__) def download_file(url, path, auth=None, chunk_size=...
cta-observatoryREPO_NAMEctapipePATH_START.@ctapipe_extracted@ctapipe-main@src@ctapipe@utils@download.py@.PATH_END.py
{ "filename": "_tickfont.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/layout/coloraxis/colorbar/_tickfont.py", "type": "Python" }
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Tickfont(_BaseLayoutHierarchyType): # class properties # -------------------- _parent_path_str = "layout.coloraxis.colorbar" _path_str = "layout.coloraxis.colorbar.tickfont" _valid_prop...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@layout@coloraxis@colorbar@_tickfont.py@.PATH_END.py
{ "filename": "test_automations.py", "repo_name": "PrefectHQ/prefect", "repo_path": "prefect_extracted/prefect-main/tests/events/client/cli/test_automations.py", "type": "Python" }
import sys from datetime import timedelta from typing import Generator, List from unittest import mock from uuid import UUID, uuid4 import orjson import pytest import yaml from typer import Exit from prefect.events.actions import CancelFlowRun, DoNothing, PauseAutomation from prefect.events.schemas.automations import...
PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@tests@events@client@cli@test_automations.py@.PATH_END.py
{ "filename": "_r.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/slider/pad/_r.py", "type": "Python" }
import _plotly_utils.basevalidators class RValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="r", parent_name="layout.slider.pad", **kwargs): super(RValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_t...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@slider@pad@_r.py@.PATH_END.py
{ "filename": "test_scheduling.py", "repo_name": "astropy/astroplan", "repo_path": "astroplan_extracted/astroplan-main/astroplan/tests/test_scheduling.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from astropy.time import Time import astropy.units as u from astropy.coordinates import SkyCoord, EarthLocation import pytest from ..utils import time_grid_from_range from ..observer import Observer from ..target import FixedTarget, ge...
astropyREPO_NAMEastroplanPATH_START.@astroplan_extracted@astroplan-main@astroplan@tests@test_scheduling.py@.PATH_END.py
{ "filename": "README.md", "repo_name": "minoshim/qasMHD", "repo_path": "qasMHD_extracted/qasMHD-main/1D/SERIAL/wave/README.md", "type": "Markdown" }
## Wave Propagation Problem This problem demonstrates the propagation of MHD waves in homogeneous plasma to confirm that the code successfully satisfies the linear dispersion.<br> Random white noise is added to the magnetic field and pressure, and their perturabations propagate as the Alfven and magnetosonic waves. Ex...
minoshimREPO_NAMEqasMHDPATH_START.@qasMHD_extracted@qasMHD-main@1D@SERIAL@wave@README.md@.PATH_END.py
{ "filename": "_templateitemname.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/shape/_templateitemname.py", "type": "Python" }
import _plotly_utils.basevalidators class TemplateitemnameValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="templateitemname", parent_name="layout.shape", **kwargs ): super(TemplateitemnameValidator, self).__init__( plotly_name=plotly_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@shape@_templateitemname.py@.PATH_END.py
{ "filename": "data_inspect_2458203.ipynb", "repo_name": "HERA-Team/H1C_IDR3_Notebooks", "repo_path": "H1C_IDR3_Notebooks-main/data_inspect/data_inspect_2458203.ipynb", "type": "Jupyter Notebook" }
```python import matplotlib import matplotlib.pyplot as plt from matplotlib.ticker import FormatStrFormatter import matplotlib.patches as mpatches import matplotlib.gridspec as gridspec import numpy as np from pyuvdata import UVCal, UVData import os import sys import glob import uvtools as uvt from astropy.time import ...
HERA-TeamREPO_NAMEH1C_IDR3_NotebooksPATH_START.@H1C_IDR3_Notebooks-main@data_inspect@data_inspect_2458203.ipynb@.PATH_END.py
{ "filename": "_isomin.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/isosurface/_isomin.py", "type": "Python" }
import _plotly_utils.basevalidators class IsominValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="isomin", parent_name="isosurface", **kwargs): super(IsominValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@isosurface@_isomin.py@.PATH_END.py
{ "filename": "PeriodicityDetector_quickstart.ipynb", "repo_name": "SPARTA-dev/SPARTA", "repo_path": "SPARTA_extracted/SPARTA-master/examples/PeriodicityDetector_quickstart.ipynb", "type": "Jupyter Notebook" }
# Periodicity detector class tutorial ----------------------------------- ### 1 Using the PeriodicityDetector class to run PDC on simulated velocity times series `Observations` class enables one to load observation data from a given folder and place it into a TimeSeries object, or to load an existing time series. I...
SPARTA-devREPO_NAMESPARTAPATH_START.@SPARTA_extracted@SPARTA-master@examples@PeriodicityDetector_quickstart.ipynb@.PATH_END.py
{ "filename": "testing.py", "repo_name": "ytree-project/ytree", "repo_path": "ytree_extracted/ytree-main/ytree/utilities/testing.py", "type": "Python" }
""" testing utilities """ #----------------------------------------------------------------------------- # Copyright (c) ytree development team. All rights reserved. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #-------...
ytree-projectREPO_NAMEytreePATH_START.@ytree_extracted@ytree-main@ytree@utilities@testing.py@.PATH_END.py
{ "filename": "test_util.py", "repo_name": "jax-ml/jax", "repo_path": "jax_extracted/jax-main/jax/_src/test_util.py", "type": "Python" }
# Copyright 2018 The JAX Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
jax-mlREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@_src@test_util.py@.PATH_END.py
{ "filename": "mlflow.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/chat_models/mlflow.py", "type": "Python" }
import json import logging from typing import ( Any, Callable, Dict, Iterator, List, Literal, Mapping, Optional, Sequence, Type, Union, cast, ) from urllib.parse import urlparse from langchain_core.callbacks import CallbackManagerForLLMRun from langchain_core.language_mo...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@chat_models@mlflow.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "macrocosme/shwirl", "repo_path": "shwirl_extracted/shwirl-master/shwirl/extern/vispy/visuals/collections/__init__.py", "type": "Python" }
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------- """ Collections ...
macrocosmeREPO_NAMEshwirlPATH_START.@shwirl_extracted@shwirl-master@shwirl@extern@vispy@visuals@collections@__init__.py@.PATH_END.py
{ "filename": "credentials.py", "repo_name": "PrefectHQ/prefect", "repo_path": "prefect_extracted/prefect-main/src/integrations/prefect-docker/prefect_docker/credentials.py", "type": "Python" }
"""Module containing docker credentials.""" import docker from pydantic import Field, SecretStr from prefect.blocks.core import Block from prefect.logging import get_run_logger from prefect.utilities.asyncutils import run_sync_in_worker_thread class DockerRegistryCredentials(Block): """ Block used to manage...
PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@integrations@prefect-docker@prefect_docker@credentials.py@.PATH_END.py
{ "filename": "bin_convert.py", "repo_name": "IAS-Astrophysics/athenak", "repo_path": "athenak_extracted/athenak-main/vis/python/bin_convert.py", "type": "Python" }
""" Functions to: (1) convert bin --> Python dictionary (2) convert Python dictionary --> athdf(xdmf) files This module contains a collection of helper functions for reading and writing athena file data formats. More information is provided in the function docstrings. ---- In order to translate a binary file int...
IAS-AstrophysicsREPO_NAMEathenakPATH_START.@athenak_extracted@athenak-main@vis@python@bin_convert.py@.PATH_END.py
{ "filename": "workQueue_knl_config.py", "repo_name": "LSSTDESC/gen3_workflow", "repo_path": "gen3_workflow_extracted/gen3_workflow-master/python/desc/gen3_workflow/config/workQueue_knl_config.py", "type": "Python" }
"""Parsl config for WorkQueueExecutor using a SlurmProvider""" import parsl from parsl.executors import WorkQueueExecutor, ThreadPoolExecutor from parsl.providers import SlurmProvider from parsl.launchers import SrunLauncher PROVIDER_OPTIONS = dict(nodes_per_block=2, exclusive=True, ...
LSSTDESCREPO_NAMEgen3_workflowPATH_START.@gen3_workflow_extracted@gen3_workflow-master@python@desc@gen3_workflow@config@workQueue_knl_config.py@.PATH_END.py
{ "filename": "roperator.py", "repo_name": "pandas-dev/pandas", "repo_path": "pandas_extracted/pandas-main/pandas/core/roperator.py", "type": "Python" }
""" Reversed Operations not available in the stdlib operator module. Defining these instead of using lambdas allows us to reference them by name. """ from __future__ import annotations import operator def radd(left, right): return right + left def rsub(left, right): return right - left def rmul(left, ri...
pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@core@roperator.py@.PATH_END.py
{ "filename": "detection.py", "repo_name": "vortex-exoplanet/VIP", "repo_path": "VIP_extracted/VIP-master/vip_hci/metrics/detection.py", "type": "Python" }
#! /usr/bin/env python """ Module with detection algorithms. """ __author__ = 'Carlos Alberto Gomez Gonzalez, Valentin Christiaens' __all__ = ['detection', 'mask_source_centers', 'mask_sources', 'peak_coordinates'] import numpy as np import pandas as pn from hciplot import plot_frames...
vortex-exoplanetREPO_NAMEVIPPATH_START.@VIP_extracted@VIP-master@vip_hci@metrics@detection.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "pmelchior/skymapper", "repo_path": "skymapper_extracted/skymapper-main/skymapper/survey/__init__.py", "type": "Python" }
import os, numpy as np from .. import register_survey, with_metaclass, with_metaclass class BaseSurvey(object): def contains(self, ra, dec): """Whether ra, dec are inside the survey footprint""" if not hasattr(ra, '__iter__'): ra = (ra,) return np.zeros(len(ra), dtype='bool') #...
pmelchiorREPO_NAMEskymapperPATH_START.@skymapper_extracted@skymapper-main@skymapper@survey@__init__.py@.PATH_END.py
{ "filename": "test_regression.py", "repo_name": "waynebhayes/SpArcFiRe", "repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/scipy/optimize/tests/test_regression.py", "type": "Python" }
"""Regression tests for optimize. """ from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_almost_equal from pytest import raises as assert_raises import scipy.optimize class TestRegression(object): def test_newton_x0_is_0(self): # Regres...
waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@scipy@optimize@tests@test_regression.py@.PATH_END.py
{ "filename": "sfr_forensics.py", "repo_name": "ICRAR/shark", "repo_path": "shark_extracted/shark-master/standard_plots/sfr_forensics.py", "type": "Python" }
# # ICRAR - International Centre for Radio Astronomy Research # (c) UWA - The University of Western Australia, 2018 # Copyright by UWA (in the framework of the ICRAR) # # 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 Fre...
ICRARREPO_NAMEsharkPATH_START.@shark_extracted@shark-master@standard_plots@sfr_forensics.py@.PATH_END.py
{ "filename": "Line_analysis.py", "repo_name": "madamow/pyEW", "repo_path": "pyEW_extracted/pyEW-master/pyew/lib/Line_analysis.py", "type": "Python" }
import numpy as np from Gauss_Voigt import * from IO_functions import * def pm_width(x, x01, s1, w_factor): # s1 is fwhm iu = np.abs(x - x01 - w_factor * np.abs(s1)).argmin() il = np.abs(x - x01 + w_factor * np.abs(s1)).argmin() if iu == il or np.abs(iu - il) < 3.: il = 0 iu = len(x) ...
madamowREPO_NAMEpyEWPATH_START.@pyEW_extracted@pyEW-master@pyew@lib@Line_analysis.py@.PATH_END.py
{ "filename": "base_slicer.py", "repo_name": "lsst/rubin_sim", "repo_path": "rubin_sim_extracted/rubin_sim-main/rubin_sim/maf/slicers/base_slicer.py", "type": "Python" }
# Base class for all 'Slicer' objects. # __all__ = ("SlicerRegistry", "BaseSlicer") import inspect import json import warnings from io import StringIO import numpy as np import numpy.ma as ma from rubin_sim.maf.utils import get_date_version class SlicerRegistry(type): """ Meta class for slicers, to build a...
lsstREPO_NAMErubin_simPATH_START.@rubin_sim_extracted@rubin_sim-main@rubin_sim@maf@slicers@base_slicer.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "PyEllips/pyElli", "repo_path": "pyElli_extracted/pyElli-master/src/elli/importer/__init__.py", "type": "Python" }
import chardet def detect_encoding(fname: str) -> str: r"""Detects the encoding of file fname. Args: fname (str): Filename Returns: str: Encoding identifier string. """ with open(fname, "rb") as f: raw_data = f.read() result = chardet.detect(raw_data) return result["enc...
PyEllipsREPO_NAMEpyElliPATH_START.@pyElli_extracted@pyElli-master@src@elli@importer@__init__.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "yqiuu/spectuner", "repo_path": "spectuner_extracted/spectuner-master/spectuner/identify/__init__.py", "type": "Python" }
from .identify import * from .ident_result import * from .peaks import *
yqiuuREPO_NAMEspectunerPATH_START.@spectuner_extracted@spectuner-master@spectuner@identify@__init__.py@.PATH_END.py
{ "filename": "buildtiles.py", "repo_name": "rainwoodman/gaepsi2", "repo_path": "gaepsi2_extracted/gaepsi2-master/utils/buildtiles.py", "type": "Python" }
import bigfile import numpy from matplotlib.figure import Figure from itertools import product from tiles import tilename f = bigfile.BigFile('image') f1 = bigfile.BigFile('image2') w = f.open('W') v = f.open('V') h = f.open('header') tp = h.attrs['TilePadding'] size = h.attrs['ImageSize'] h.attrs['Level'] = 0 ntile ...
rainwoodmanREPO_NAMEgaepsi2PATH_START.@gaepsi2_extracted@gaepsi2-master@utils@buildtiles.py@.PATH_END.py
{ "filename": "reset_stage_metadata.py", "repo_name": "pyDANDIA/pyDANDIA", "repo_path": "pyDANDIA_extracted/pyDANDIA-main/pyDANDIA/reset_stage_metadata.py", "type": "Python" }
import os import sys from pyDANDIA import metadata def reset_red_status_for_stage(red_dir,stage_number): """Function to reset the reduction status table entries for a given stage. Note that the status for all images will be set to zero (process) except for entries that were flagged as -1 (do not process) b...
pyDANDIAREPO_NAMEpyDANDIAPATH_START.@pyDANDIA_extracted@pyDANDIA-main@pyDANDIA@reset_stage_metadata.py@.PATH_END.py
{ "filename": "test_ultradeep.py", "repo_name": "GeminiDRSoftware/DRAGONS", "repo_path": "DRAGONS_extracted/DRAGONS-master/geminidr/niri/recipes/sq/tests/test_ultradeep.py", "type": "Python" }
import pytest import os from astrodata.testing import download_from_archive from recipe_system.reduction.coreReduce import Reduce niri_deep_dataset = [f"N20210512S{i:04d}.fits" for i in range(17, 35)] niri_dark = "N20210512S0246_dark.fits" @pytest.mark.slow def test_ultradeep_recipe_niri(change_working_dir, path_t...
GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@geminidr@niri@recipes@sq@tests@test_ultradeep.py@.PATH_END.py
{ "filename": "test_connect.py", "repo_name": "astropy/astropy", "repo_path": "astropy_extracted/astropy-main/astropy/io/fits/tests/test_connect.py", "type": "Python" }
import gc import warnings import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal from astropy import units as u from astropy.io import fits from astropy.io.fits import ( BinTableHDU, HDUList, ImageHDU, PrimaryHDU, connect, table_to_hdu, ) from astropy.io...
astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@io@fits@tests@test_connect.py@.PATH_END.py