metadata
dict
text
stringlengths
0
40.6M
id
stringlengths
14
255
{ "filename": "_variantsrc.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/cone/hoverlabel/font/_variantsrc.py", "type": "Python" }
import _plotly_utils.basevalidators class VariantsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="variantsrc", parent_name="cone.hoverlabel.font", **kwargs ): super(VariantsrcValidator, self).__init__( plotly_name=plotly_name, pa...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@cone@hoverlabel@font@_variantsrc.py@.PATH_END.py
{ "filename": "README-cpp.md", "repo_name": "cshsgy/ExoCubed", "repo_path": "ExoCubed_extracted/ExoCubed-main/doc/README-cpp.md", "type": "Markdown" }
## Modern C++ programming ### From C to C++ coding style - use full path name starting from the `src` folder for include guard - use `snprintf` instead of `sprintf` - use `rand_r` instead of `rand` - use `strtok_r` instead of `strtok`
cshsgyREPO_NAMEExoCubedPATH_START.@ExoCubed_extracted@ExoCubed-main@doc@README-cpp.md@.PATH_END.py
{ "filename": "_title.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattermap/marker/colorbar/_title.py", "type": "Python" }
import _plotly_utils.basevalidators class TitleValidator(_plotly_utils.basevalidators.TitleValidator): def __init__( self, plotly_name="title", parent_name="scattermap.marker.colorbar", **kwargs ): super(TitleValidator, self).__init__( plotly_name=plotly_name, parent_na...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattermap@marker@colorbar@_title.py@.PATH_END.py
{ "filename": "A01read_ari.py", "repo_name": "nu-radio/NuRadioMC", "repo_path": "NuRadioMC_extracted/NuRadioMC-master/NuRadioMC/examples/04_read_ari_files/A01read_ari.py", "type": "Python" }
import logging import numpy as np import argparse import matplotlib.pyplot as plt from NuRadioReco.utilities import units import NuRadioReco.detector.detector as detector import NuRadioReco.modules.io.eventReader from NuRadioReco.framework.parameters import stationParameters as stnp logging.basicConfig(level=logging...
nu-radioREPO_NAMENuRadioMCPATH_START.@NuRadioMC_extracted@NuRadioMC-master@NuRadioMC@examples@04_read_ari_files@A01read_ari.py@.PATH_END.py
{ "filename": "_core.py", "repo_name": "jax-ml/jax", "repo_path": "jax_extracted/jax-main/jax/experimental/key_reuse/_core.py", "type": "Python" }
# Copyright 2023 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@experimental@key_reuse@_core.py@.PATH_END.py
{ "filename": "mpi.py", "repo_name": "jonaselgammal/GPry", "repo_path": "GPry_extracted/GPry-main/gpry/mpi.py", "type": "Python" }
# Defining some helpers for parallelisation. import dill from mpi4py import MPI import numpy as np from numpy.random import SeedSequence, default_rng, Generator # Use dill pickler (can seriealize more stuff, e.g. lambdas) MPI.pickle.__init__(dill.dumps, dill.loads) # Define some interfaces comm = MPI.COMM_WORLD SIZE ...
jonaselgammalREPO_NAMEGPryPATH_START.@GPry_extracted@GPry-main@gpry@mpi.py@.PATH_END.py
{ "filename": "kendra.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/retrievers/kendra.py", "type": "Python" }
import re from abc import ABC, abstractmethod from typing import ( Any, Callable, Dict, List, Literal, Optional, Sequence, Union, ) from langchain_core.callbacks import CallbackManagerForRetrieverRun from langchain_core.documents import Document from langchain_core.retrievers import Bas...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@retrievers@kendra.py@.PATH_END.py
{ "filename": "shear.py", "repo_name": "ggalloni/cobaya", "repo_path": "cobaya_extracted/cobaya-master/cobaya/likelihoods/des_y1/shear.py", "type": "Python" }
from cobaya.likelihoods.base_classes import DES class shear(DES): r""" Cosmic shear data from the first year of the Dark Energy Survey (DES Y1) \cite{Abbott:2017wau}. """ bibtex_file = 'des_y1.bibtex'
ggalloniREPO_NAMEcobayaPATH_START.@cobaya_extracted@cobaya-master@cobaya@likelihoods@des_y1@shear.py@.PATH_END.py
{ "filename": "HP_2011_ds62.py", "repo_name": "CaymanUnterborn/ExoPlex", "repo_path": "ExoPlex_extracted/ExoPlex-master/ExoPlex/burnman/minerals/HP_2011_ds62.py", "type": "Python" }
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit # for the Earth and Planetary Sciences # Copyright (C) 2012 - 2021 by the BurnMan team, released under the GNU # GPL v2 or later. """ HP_2011_ds62 ^^^^^^^^^^^^ Endmember minerals from Holland and Powell 2011 and references therein. Update to ...
CaymanUnterbornREPO_NAMEExoPlexPATH_START.@ExoPlex_extracted@ExoPlex-master@ExoPlex@burnman@minerals@HP_2011_ds62.py@.PATH_END.py
{ "filename": "test_viewers.py", "repo_name": "spacetelescope/jdaviz", "repo_path": "jdaviz_extracted/jdaviz-main/jdaviz/configs/imviz/tests/test_viewers.py", "type": "Python" }
import numpy as np import pytest from regions import CirclePixelRegion, PixCoord from jdaviz.app import Application from jdaviz.core.config import get_configuration from jdaviz.configs.imviz.helper import Imviz from jdaviz.configs.imviz.plugins.viewers import ImvizImageView from jdaviz.configs.imviz.tests.utils import...
spacetelescopeREPO_NAMEjdavizPATH_START.@jdaviz_extracted@jdaviz-main@jdaviz@configs@imviz@tests@test_viewers.py@.PATH_END.py
{ "filename": "MdB.py", "repo_name": "Morisset/pyCloudy", "repo_path": "pyCloudy_extracted/pyCloudy-master/pyCloudy/db/MdB.py", "type": "Python" }
import os import sys import subprocess import numpy as np from getpass import getpass import pyCloudy as pc from pyCloudy.utils.init import LIST_ELEM from pyCloudy.utils.logging import my_logging if pc.config.INSTALLED['pandas']: import pandas as pd import pandas.io.sql as psql from io import StringIO def _...
MorissetREPO_NAMEpyCloudyPATH_START.@pyCloudy_extracted@pyCloudy-master@pyCloudy@db@MdB.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/densitymapbox/hoverlabel/font/_shadow.py", "type": "Python" }
import _plotly_utils.basevalidators class ShadowValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="shadow", parent_name="densitymapbox.hoverlabel.font", **kwargs, ): super(ShadowValidator, self).__init__( plotly_name=pl...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@densitymapbox@hoverlabel@font@_shadow.py@.PATH_END.py
{ "filename": "_text.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/surface/legendgrouptitle/_text.py", "type": "Python" }
import _plotly_utils.basevalidators class TextValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="text", parent_name="surface.legendgrouptitle", **kwargs ): super(TextValidator, self).__init__( plotly_name=plotly_name, parent_name=p...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@surface@legendgrouptitle@_text.py@.PATH_END.py
{ "filename": "test_decorators.py", "repo_name": "NuSpaceSim/nuSpaceSim", "repo_path": "nuSpaceSim_extracted/nuSpaceSim-main/test/utils/test_decorators.py", "type": "Python" }
import numpy as np # from nuspacesim import results_table from nuspacesim.utils import decorators # def test_nss_result_store(): # @decorators.nss_result_store("columnA", "columnB") # def test_base_f(input1, input2): # """this is the docstring""" # return input1 + input2, input1 * input2 # # ...
NuSpaceSimREPO_NAMEnuSpaceSimPATH_START.@nuSpaceSim_extracted@nuSpaceSim-main@test@utils@test_decorators.py@.PATH_END.py
{ "filename": "update_benchmarks.py", "repo_name": "andycasey/ges-idr5", "repo_path": "ges-idr5_extracted/ges-idr5-master/scripts/update_benchmarks.py", "type": "Python" }
""" Update the benchmark parameters to include some values -- even if they are uncertain -- and to include a less-biased value for HD 140283. """ from astropy.table import Table input_path = "../fits-templates/benchmarks/GES_iDR5_FGKMCoolWarm_Benchmarks_AcceptedParams_01082016.fits" output_path = "../fits-templates/...
andycaseyREPO_NAMEges-idr5PATH_START.@ges-idr5_extracted@ges-idr5-master@scripts@update_benchmarks.py@.PATH_END.py
{ "filename": "test_serializable.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/community/tests/unit_tests/load/test_serializable.py", "type": "Python" }
import importlib import inspect import pkgutil from types import ModuleType from langchain_core.load.mapping import SERIALIZABLE_MAPPING def import_all_modules(package_name: str) -> dict: package = importlib.import_module(package_name) classes: dict = {} def _handle_module(module: ModuleType) -> None: ...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@unit_tests@load@test_serializable.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "RadioAstronomySoftwareGroup/pyuvdata", "repo_path": "pyuvdata_extracted/pyuvdata-main/src/pyuvdata/data/__init__.py", "type": "Python" }
"""Init file for data directory.""" DATA_PATH = __path__[0]
RadioAstronomySoftwareGroupREPO_NAMEpyuvdataPATH_START.@pyuvdata_extracted@pyuvdata-main@src@pyuvdata@data@__init__.py@.PATH_END.py
{ "filename": "deprecated_module.py", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/util/deprecated_module.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@python@util@deprecated_module.py@.PATH_END.py
{ "filename": "corner_modified.py", "repo_name": "t-brandt/orvara", "repo_path": "orvara_extracted/orvara-master/orvara/corner_modified.py", "type": "Python" }
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import import logging import numpy as np import matplotlib.pyplot as pl from matplotlib.ticker import MaxNLocator, NullLocator from matplotlib.colors import LinearSegmentedColormap, colorConverter from matplotlib.ticker import ScalarFormatter tr...
t-brandtREPO_NAMEorvaraPATH_START.@orvara_extracted@orvara-master@orvara@corner_modified.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/layout/yaxis/minor/_tick0.py", "type": "Python" }
import _plotly_utils.basevalidators class Tick0Validator(_plotly_utils.basevalidators.AnyValidator): def __init__(self, plotly_name="tick0", parent_name="layout.yaxis.minor", **kwargs): super(Tick0Validator, 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@layout@yaxis@minor@_tick0.py@.PATH_END.py
{ "filename": "chktrcmp.py", "repo_name": "Caltech-IPAC/Montage", "repo_path": "Montage_extracted/Montage-main/lib/src/freetype-2.5.4/src/tools/chktrcmp.py", "type": "Python" }
#!/usr/bin/env python # # Check trace components in FreeType 2 source. # Author: suzuki toshiya, 2009, 2013 # # This code is explicitly into the public domain. import sys import os import re SRC_FILE_LIST = [] USED_COMPONENT = {} KNOWN_COMPONENT = {} SRC_FILE_DIRS = [ "src" ] TRACE_DEF_FILES = [ "include/inter...
Caltech-IPACREPO_NAMEMontagePATH_START.@Montage_extracted@Montage-main@lib@src@freetype-2.5.4@src@tools@chktrcmp.py@.PATH_END.py
{ "filename": "process_ps_pt.py", "repo_name": "FRBs/zdm", "repo_path": "zdm_extracted/zdm-main/papers/GWFRB/process_ps_pt.py", "type": "Python" }
""" This script processes the output from "calc_PS_all_GW.py" Copy over the p-values for that script to the right-most column of "summary_2hr.txt". If you wish to perform calculations for a different time window, do that too. The idea is to calculate the effective extra trials from considering other GW events. """ i...
FRBsREPO_NAMEzdmPATH_START.@zdm_extracted@zdm-main@papers@GWFRB@process_ps_pt.py@.PATH_END.py
{ "filename": "dust.py", "repo_name": "SAMI-Galaxy-Survey/sami", "repo_path": "sami_extracted/sami-master/dr/dust.py", "type": "Python" }
""" Functions for defining the effect of Milky Way dust on SAMI observations. For a variety of published maps (currently 2) this module will download the maps and use them to measure the E(B-V) value at the position of a SAMI observation. Then for different parameterisations of the dust attenuation law it will calcula...
SAMI-Galaxy-SurveyREPO_NAMEsamiPATH_START.@sami_extracted@sami-master@dr@dust.py@.PATH_END.py
{ "filename": "visualisation.md", "repo_name": "PaulHancock/Robbie", "repo_path": "Robbie_extracted/Robbie-main/docs/source/visualisation.md", "type": "Markdown" }
(visualisation)= ## Visualisation ### Running locally with Docker To start the Docker container containing the Bokeh server, run the following script in the main Nextflow directory: ``` bash ./run_robbie_viewer.sh ``` This will run the viewer using the images output from Robbie within the default ``results`` directo...
PaulHancockREPO_NAMERobbiePATH_START.@Robbie_extracted@Robbie-main@docs@source@visualisation.md@.PATH_END.py
{ "filename": "datasets.py", "repo_name": "enthought/mayavi", "repo_path": "mayavi_extracted/mayavi-master/mayavi/tests/datasets.py", "type": "Python" }
# Author: Suyog Dutt Jain <suyog.jain@aero.iitb.ac.in> # Prabhu Ramachandran <prabhu_r@users.sf.net> # Copyright (c) 2008, Enthought, Inc. # License: BSD Style. # Standard library imports. import numpy from numpy import linspace, cos, sin, pi, empty, sqrt,array,arange,random # Enthought library imports from...
enthoughtREPO_NAMEmayaviPATH_START.@mayavi_extracted@mayavi-master@mayavi@tests@datasets.py@.PATH_END.py
{ "filename": "frierson_debug.py", "repo_name": "ExeClim/Isca", "repo_path": "Isca_extracted/Isca-master/exp/debug/frierson_debug.py", "type": "Python" }
import os import numpy as np from isca import IscaCodeBase, DiagTable, Experiment, Namelist, GFDL_BASE #To run Isca with the Intel debugger, three changes should be made, as are in the below example. # 1. Set NCORES=1 # 2. set the 'debug=True' argument in the 'cb.compile' # 3. Add the 'run_idb=True' option to the f...
ExeClimREPO_NAMEIscaPATH_START.@Isca_extracted@Isca-master@exp@debug@frierson_debug.py@.PATH_END.py
{ "filename": "multimodal_prompts.ipynb", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/docs/docs/how_to/multimodal_prompts.ipynb", "type": "Jupyter Notebook" }
# How to use multimodal prompts Here we demonstrate how to use prompt templates to format [multimodal](/docs/concepts/multimodality/) inputs to models. In this example we will ask a [model](/docs/concepts/chat_models/#multimodality) to describe an image. ```python import base64 import httpx image_url = "https://...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@how_to@multimodal_prompts.ipynb@.PATH_END.py
{ "filename": "layer.py", "repo_name": "huggingface/peft", "repo_path": "peft_extracted/peft-main/src/peft/tuners/ln_tuning/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@ln_tuning@layer.py@.PATH_END.py
{ "filename": "conf.py", "repo_name": "stammler/dustpy", "repo_path": "dustpy_extracted/dustpy-master/docs_source/source/conf.py", "type": "Python" }
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
stammlerREPO_NAMEdustpyPATH_START.@dustpy_extracted@dustpy-master@docs_source@source@conf.py@.PATH_END.py
{ "filename": "breebs.md", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/providers/breebs.md", "type": "Markdown" }
# Breebs (Open Knowledge) >[Breebs](https://www.breebs.com/) is an open collaborative knowledge platform. >Anybody can create a `Breeb`, a knowledge capsule based on PDFs stored on a Google Drive folder. >A `Breeb` can be used by any LLM/chatbot to improve its expertise, reduce hallucinations and give access to sourc...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@providers@breebs.md@.PATH_END.py
{ "filename": "arraysetops.py", "repo_name": "waynebhayes/SpArcFiRe", "repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/numpy/lib/arraysetops.py", "type": "Python" }
""" Set operations for arrays based on sorting. :Contains: unique, isin, ediff1d, intersect1d, setxor1d, in1d, union1d, setdiff1d :Notes: For floating point arrays, inaccurate results may appear due to usual round-off and floating point comparison issues. Speed could be gained in some operations by ...
waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@numpy@lib@arraysetops.py@.PATH_END.py
{ "filename": "test_resampled.py", "repo_name": "mj-will/nessai", "repo_path": "nessai_extracted/nessai-main/tests/test_flows/test_distributions/test_resampled.py", "type": "Python" }
from unittest.mock import MagicMock, create_autospec from nessai.flows.distributions import ResampledGaussian def test_finalise(): """Test the finalise method""" dist = create_autospec(ResampledGaussian) dist.estimate_normalisation_constant = MagicMock() ResampledGaussian.finalise(dist, n_samples=1...
mj-willREPO_NAMEnessaiPATH_START.@nessai_extracted@nessai-main@tests@test_flows@test_distributions@test_resampled.py@.PATH_END.py
{ "filename": "paper.md", "repo_name": "kevin218/Eureka", "repo_path": "Eureka_extracted/Eureka-main/joss/paper.md", "type": "Markdown" }
--- title: '`Eureka!`: An End-to-End Pipeline for JWST Time-Series Observations' tags: - Python - JWST - HST - astronomy - exoplanets - spectroscopy - photometry authors: - name: Taylor J. Bell orcid: 0000-0003-4177-2149 affiliation: 1 - name: Eva-Maria Ahrer orcid: 0000-0003-0973-8426 ...
kevin218REPO_NAMEEurekaPATH_START.@Eureka_extracted@Eureka-main@joss@paper.md@.PATH_END.py
{ "filename": "utils.py", "repo_name": "joshspeagle/dynesty", "repo_path": "dynesty_extracted/dynesty-master/py/dynesty/utils.py", "type": "Python" }
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A collection of useful functions. """ import sys import warnings import math import copy import time import os import shutil from collections import namedtuple from functools import partial import pickle as pickle_module # To allow replacing of the pickler import nump...
joshspeagleREPO_NAMEdynestyPATH_START.@dynesty_extracted@dynesty-master@py@dynesty@utils.py@.PATH_END.py
{ "filename": "_ticksuffix.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattercarpet/marker/colorbar/_ticksuffix.py", "type": "Python" }
import _plotly_utils.basevalidators class TicksuffixValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="ticksuffix", parent_name="scattercarpet.marker.colorbar", **kwargs ): super(TicksuffixValidator, self).__init__( plo...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattercarpet@marker@colorbar@_ticksuffix.py@.PATH_END.py
{ "filename": "sigma_so.py", "repo_name": "nickhand/pyRSD", "repo_path": "pyRSD_extracted/pyRSD-master/pyRSD/rsd/power/gal/derivatives/sigma_so.py", "type": "Python" }
from . import PgalDerivative import numpy from pyRSD.rsd.tools import k_AP, mu_AP class dPgal_dsigma_so(PgalDerivative): """ The partial derivative of :func:`GalaxySpectrum.power` with respect to ``sigma_so`` """ param = 'sigma_so' @staticmethod def eval(m, pars, k, mu): if not m....
nickhandREPO_NAMEpyRSDPATH_START.@pyRSD_extracted@pyRSD-master@pyRSD@rsd@power@gal@derivatives@sigma_so.py@.PATH_END.py
{ "filename": "PCA_features.ipynb", "repo_name": "snad-space/zwad", "repo_path": "zwad_extracted/zwad-master/notebooks/PCA_features.ipynb", "type": "Jupyter Notebook" }
```python %matplotlib inline %config InlineBackend.figure_format = 'retina' import os import numpy as np import matplotlib.pyplot as plt import pandas as pd from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA import sys from collections import OrderedDict import warnings warnings.fi...
snad-spaceREPO_NAMEzwadPATH_START.@zwad_extracted@zwad-master@notebooks@PCA_features.ipynb@.PATH_END.py
{ "filename": "ex-2.16.py", "repo_name": "mpi4py/mpi4py", "repo_path": "mpi4py_extracted/mpi4py-master/demo/mpi-ref-v1/ex-2.16.py", "type": "Python" }
## mpiexec -n 4 python ex-2.16.py # Jacobi code # version of parallel code using sendrecv and null processes. # -------------------------------------------------------------------- from mpi4py import MPI try: import numpy except ImportError: raise SystemExit # -----------------------------------------------...
mpi4pyREPO_NAMEmpi4pyPATH_START.@mpi4py_extracted@mpi4py-master@demo@mpi-ref-v1@ex-2.16.py@.PATH_END.py
{ "filename": "Untitled2.ipynb", "repo_name": "FloorBroekgaarden/Double-Compact-Object-Mergers", "repo_path": "Double-Compact-Object-Mergers_extracted/Double-Compact-Object-Mergers-main/plottingCode/Detectable_Distributions_GWTC-3/Untitled2.ipynb", "type": "Jupyter Notebook" }
```python import numpy as np import matplotlib.pyplot as plt import sys import h5py as h5 import numpy as np from scipy import stats import scipy #Quick fudge to make import from ../Scripts work sys.path.append('../../Scripts') #Custom imports # for color map import seaborn as sns # for reading datafiles import pa...
FloorBroekgaardenREPO_NAMEDouble-Compact-Object-MergersPATH_START.@Double-Compact-Object-Mergers_extracted@Double-Compact-Object-Mergers-main@plottingCode@Detectable_Distributions_GWTC-3@Untitled2.ipynb@.PATH_END.py
{ "filename": "test_cwrappers.py", "repo_name": "AWehrhahn/PyReduce", "repo_path": "PyReduce_extracted/PyReduce-master/test/test_cwrappers.py", "type": "Python" }
# -*- coding: utf-8 -*- import numpy as np import pytest from pyreduce.cwrappers import slitfunc, slitfunc_curved def test_slitfunc_vert(): img = np.full((100, 100), 1, dtype=float) ycen = np.full(100, 0, dtype=float) lambda_sp = 0 lambda_sf = 0.1 osample = 1 # Run it once the way it is supp...
AWehrhahnREPO_NAMEPyReducePATH_START.@PyReduce_extracted@PyReduce-master@test@test_cwrappers.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "saopicc/killMS", "repo_path": "killMS_extracted/killMS-master/killMS/Gridder/__init__.py", "type": "Python" }
#!/usr/bin/env python """ killMS, a package for calibration in radio interferometry. Copyright (C) 2013-2017 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 ...
saopiccREPO_NAMEkillMSPATH_START.@killMS_extracted@killMS-master@killMS@Gridder@__init__.py@.PATH_END.py
{ "filename": "ternary_ops_test.py", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/compiler/tests/ternary_ops_test.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@compiler@tests@ternary_ops_test.py@.PATH_END.py
{ "filename": "fit_gaussian_process.py", "repo_name": "daniel-muthukrishna/astrorapid", "repo_path": "astrorapid_extracted/astrorapid-master/astrorapid/fit_gaussian_process.py", "type": "Python" }
import os import pickle import numpy as np import matplotlib.pyplot as plt import multiprocessing as mp import celerite from celerite import terms from scipy.optimize import minimize def combined_neg_log_like(params, fluxes, gp_lcs, passbands): loglike = 0 for pb in passbands: gp_lcs[pb].set_parameter...
daniel-muthukrishnaREPO_NAMEastrorapidPATH_START.@astrorapid_extracted@astrorapid-master@astrorapid@fit_gaussian_process.py@.PATH_END.py
{ "filename": "exceptions.py", "repo_name": "cosmo-ethz/CosmoHammer", "repo_path": "CosmoHammer_extracted/CosmoHammer-master/cosmoHammer/exceptions.py", "type": "Python" }
#Created on Nov 11, 2013 #author: jakeret class LikelihoodComputationException(Exception): ''' Exception for likelihood computation ''' def __init__(self): ''' Constructor ''' pass class InvalidLikelihoodException(LikelihoodComputationException): """ Except...
cosmo-ethzREPO_NAMECosmoHammerPATH_START.@CosmoHammer_extracted@CosmoHammer-master@cosmoHammer@exceptions.py@.PATH_END.py
{ "filename": "_ids.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/heatmap/_ids.py", "type": "Python" }
import _plotly_utils.basevalidators class IdsValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__(self, plotly_name="ids", parent_name="heatmap", **kwargs): super(IdsValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_ty...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@heatmap@_ids.py@.PATH_END.py
{ "filename": "plasticc_make_predictions.py", "repo_name": "LSSTDESC/snmachine", "repo_path": "snmachine_extracted/snmachine-main/snmachine/utils/plasticc_make_predictions.py", "type": "Python" }
LSSTDESCREPO_NAMEsnmachinePATH_START.@snmachine_extracted@snmachine-main@snmachine@utils@plasticc_make_predictions.py@.PATH_END.py
{ "filename": "slsqp.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/optimize/slsqp.py", "type": "Python" }
# This file is not meant for public use and will be removed in SciPy v2.0.0. # Use the `scipy.optimize` namespace for importing the functions # included below. import warnings from . import _slsqp_py __all__ = [ # noqa: F822 'OptimizeResult', 'append', 'approx_derivative', 'approx_jacobian', 'ar...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@optimize@slsqp.py@.PATH_END.py
{ "filename": "classic.py", "repo_name": "eggplantbren/DNest4", "repo_path": "DNest4_extracted/DNest4-master/python/dnest4/classic.py", "type": "Python" }
import copy import numpy as np import numpy.random as rng from .loading import * def logsumexp(values): biggest = np.max(values) x = values - biggest result = np.log(np.sum(np.exp(x))) + biggest return result def logdiffexp(x1, x2): biggest = x1 xx1 = x1 - biggest xx2 = x2 - biggest result = np.log(np.exp(xx1...
eggplantbrenREPO_NAMEDNest4PATH_START.@DNest4_extracted@DNest4-master@python@dnest4@classic.py@.PATH_END.py
{ "filename": "_end.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/surface/contours/y/_end.py", "type": "Python" }
import _plotly_utils.basevalidators class EndValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="end", parent_name="surface.contours.y", **kwargs): super(EndValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@surface@contours@y@_end.py@.PATH_END.py
{ "filename": "writer.py", "repo_name": "waynebhayes/SpArcFiRe", "repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/utils/xml/writer.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Contains a class that makes it simple to stream out well-formed and nicely-indented XML. """ from __future__ import (absolute_import, division, print_function, unicode_literals) from ...extern import six # STDLIB import context...
waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@utils@xml@writer.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "koustavchandra/gwforge", "repo_path": "gwforge_extracted/gwforge-main/GWForge/inject/__init__.py", "type": "Python" }
koustavchandraREPO_NAMEgwforgePATH_START.@gwforge_extracted@gwforge-main@GWForge@inject@__init__.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "pynucastro/pynucastro", "repo_path": "pynucastro_extracted/pynucastro-main/pynucastro/networks/__init__.py", "type": "Python" }
"""The pynucastro modules that support the creation of networks. There are several main submodules here: :meth:`rate_collection <pynucastro.networks.rate_collection>`: this is simply a collection of rates that knows about the links connecting nuclei. This is used as the base for the different classes the write code t...
pynucastroREPO_NAMEpynucastroPATH_START.@pynucastro_extracted@pynucastro-main@pynucastro@networks@__init__.py@.PATH_END.py
{ "filename": "conf.py", "repo_name": "icecube/skyllh", "repo_path": "skyllh_extracted/skyllh-master/doc/sphinx/conf.py", "type": "Python" }
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
icecubeREPO_NAMEskyllhPATH_START.@skyllh_extracted@skyllh-master@doc@sphinx@conf.py@.PATH_END.py
{ "filename": "c_backend_spherical.py", "repo_name": "astro-informatics/s2fft", "repo_path": "s2fft_extracted/s2fft-main/s2fft/transforms/c_backend_spherical.py", "type": "Python" }
import healpy import jax.numpy as jnp import numpy as np # C backend functions for which to provide JAX frontend. import pyssht from jax import core, custom_vjp from jax.interpreters import ad from s2fft.sampling import reindex from s2fft.utils import quadrature_jax @custom_vjp def ssht_inverse( flm: jnp.ndarra...
astro-informaticsREPO_NAMEs2fftPATH_START.@s2fft_extracted@s2fft-main@s2fft@transforms@c_backend_spherical.py@.PATH_END.py
{ "filename": "test_models.py", "repo_name": "pyro-ppl/pyro", "repo_path": "pyro_extracted/pyro-master/tests/contrib/mue/test_models.py", "type": "Python" }
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 import numpy as np import pytest import torch from torch.optim import Adam import pyro from pyro.contrib.mue.dataloaders import BiosequenceDataset from pyro.contrib.mue.models import FactorMuE, ProfileHMM from pyro.optim import MultiS...
pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@tests@contrib@mue@test_models.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/histogram/error_x/__init__.py", "type": "Python" }
import sys from typing import TYPE_CHECKING if sys.version_info < (3, 7) or TYPE_CHECKING: from ._width import WidthValidator from ._visible import VisibleValidator from ._valueminus import ValueminusValidator from ._value import ValueValidator from ._type import TypeValidator from ._tracerefmi...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@histogram@error_x@__init__.py@.PATH_END.py
{ "filename": "tencentvectordb.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/retrievers/self_query/tencentvectordb.py", "type": "Python" }
from typing import TYPE_CHECKING, Any from langchain._api import create_importer if TYPE_CHECKING: from langchain_community.query_constructors.tencentvectordb import ( TencentVectorDBTranslator, ) # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprec...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@retrievers@self_query@tencentvectordb.py@.PATH_END.py
{ "filename": "cubed_m_24_fluid_scf_perts_off_newt_2_cl.py", "repo_name": "PoulinV/AxiCLASS", "repo_path": "AxiCLASS_extracted/AxiCLASS-master/output/cubed_m_24_fluid_scf_perts_off_newt_2_cl.py", "type": "Python" }
import matplotlib.pyplot as plt import numpy as np import itertools files = ['/home/charlotte/class_perso-ScalarField/class_perso-ScalarField/output/cubed_m_24_fluid_scf_perts_off_newt_2_cl.dat'] data = [] for data_file in files: data.append(np.loadtxt(data_file)) roots = ['cubed_m_24_fluid_scf_perts_off_newt_2_cl...
PoulinVREPO_NAMEAxiCLASSPATH_START.@AxiCLASS_extracted@AxiCLASS-master@output@cubed_m_24_fluid_scf_perts_off_newt_2_cl.py@.PATH_END.py
{ "filename": "lru_cache_test.py", "repo_name": "google/jax", "repo_path": "jax_extracted/jax-main/tests/lru_cache_test.py", "type": "Python" }
# Copyright 2024 The JAX Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
googleREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@tests@lru_cache_test.py@.PATH_END.py
{ "filename": "addcol2ms.py", "repo_name": "revoltek/LiLF", "repo_path": "LiLF_extracted/LiLF-master/scripts/addcol2ms.py", "type": "Python" }
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (C) 2018 - Francesco de Gasperin # # 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 2 of the License, or # (at your opti...
revoltekREPO_NAMELiLFPATH_START.@LiLF_extracted@LiLF-master@scripts@addcol2ms.py@.PATH_END.py
{ "filename": "faq.md", "repo_name": "sbi-dev/sbi", "repo_path": "sbi_extracted/sbi-main/docs/docs/faq.md", "type": "Markdown" }
# Frequently asked questions 1. [What should I do when my 'posterior samples are outside of the prior support' in SNPE?](faq/question_01_leakage.md) 2. [Can the algorithms deal with invalid data, e.g., NaN or inf?](faq/question_02_nans.md) 3. [When using multiple workers, I get a pickling error. Can I still use multip...
sbi-devREPO_NAMEsbiPATH_START.@sbi_extracted@sbi-main@docs@docs@faq.md@.PATH_END.py
{ "filename": "marked_npairs_xy_z.py", "repo_name": "astropy/halotools", "repo_path": "halotools_extracted/halotools-master/halotools/mock_observables/pair_counters/marked_npairs_xy_z.py", "type": "Python" }
r""" Module containing the `~halotools.mock_observables.npairs_3d` function used to count pairs as a function of separation. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import multiprocessing from functools import partial from .npairs_xy_z import _npairs_...
astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@halotools@mock_observables@pair_counters@marked_npairs_xy_z.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "Keck-DataReductionPipelines/OsirisDRP", "repo_path": "OsirisDRP_extracted/OsirisDRP-master/tests/drptestbones/__init__.py", "type": "Python" }
Keck-DataReductionPipelinesREPO_NAMEOsirisDRPPATH_START.@OsirisDRP_extracted@OsirisDRP-master@tests@drptestbones@__init__.py@.PATH_END.py
{ "filename": "quantize_model_test_base.py", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/compiler/mlir/quantization/stablehlo/python/integration_test/quantize_model_test_base.py", "type": "Python" }
# Copyright 2023 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@mlir@quantization@stablehlo@python@integration_test@quantize_model_test_base.py@.PATH_END.py
{ "filename": "_line.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattergl/_line.py", "type": "Python" }
import _plotly_utils.basevalidators class LineValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="line", parent_name="scattergl", **kwargs): super(LineValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, dat...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattergl@_line.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "gwastro/pycbc", "repo_path": "pycbc_extracted/pycbc-master/pycbc/inference/__init__.py", "type": "Python" }
# pylint: disable=unused-import from . import (models, sampler, io) from . import (burn_in, entropy, gelman_rubin, geweke, option_utils)
gwastroREPO_NAMEpycbcPATH_START.@pycbc_extracted@pycbc-master@pycbc@inference@__init__.py@.PATH_END.py
{ "filename": "_adapters.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/setuptools/py3/pkg_resources/_vendor/importlib_resources/_adapters.py", "type": "Python" }
from contextlib import suppress from io import TextIOWrapper from . import abc class SpecLoaderAdapter: """ Adapt a package spec to adapt the underlying loader. """ def __init__(self, spec, adapter=lambda spec: spec.loader): self.spec = spec self.loader = adapter(spec) def __get...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@setuptools@py3@pkg_resources@_vendor@importlib_resources@_adapters.py@.PATH_END.py
{ "filename": "_colorsrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/streamtube/hoverlabel/font/_colorsrc.py", "type": "Python" }
import _plotly_utils.basevalidators class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="colorsrc", parent_name="streamtube.hoverlabel.font", **kwargs ): super(ColorsrcValidator, self).__init__( plotly_name=plotly_name, pa...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@streamtube@hoverlabel@font@_colorsrc.py@.PATH_END.py
{ "filename": "calc_error.py", "repo_name": "zachetienne/nrpytutorial", "repo_path": "nrpytutorial_extracted/nrpytutorial-master/UnitTesting/calc_error.py", "type": "Python" }
import logging from mpmath import log10, fabs, mp from datetime import date from UnitTesting.standard_constants import precision from UnitTesting.create_dict_string import create_dict_string # calc_error loops through each item in self.calculated_dict and self.trusted_values_dict_entry, # and makes sure that the diff...
zachetienneREPO_NAMEnrpytutorialPATH_START.@nrpytutorial_extracted@nrpytutorial-master@UnitTesting@calc_error.py@.PATH_END.py
{ "filename": "feature_request.md", "repo_name": "nlesc-dirac/sagecal", "repo_path": "sagecal_extracted/sagecal-master/.github/ISSUE_TEMPLATE/feature_request.md", "type": "Markdown" }
--- name: Feature request about: Suggest an idea for this project --- **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want t...
nlesc-diracREPO_NAMEsagecalPATH_START.@sagecal_extracted@sagecal-master@.github@ISSUE_TEMPLATE@feature_request.md@.PATH_END.py
{ "filename": "_labelalias.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/densitymap/colorbar/_labelalias.py", "type": "Python" }
import _plotly_utils.basevalidators class LabelaliasValidator(_plotly_utils.basevalidators.AnyValidator): def __init__( self, plotly_name="labelalias", parent_name="densitymap.colorbar", **kwargs ): super(LabelaliasValidator, self).__init__( plotly_name=plotly_name, par...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@densitymap@colorbar@_labelalias.py@.PATH_END.py
{ "filename": "test_profile_plots.py", "repo_name": "yt-project/yt", "repo_path": "yt_extracted/yt-main/yt/visualization/tests/test_profile_plots.py", "type": "Python" }
import os import shutil import tempfile import unittest import pytest import yt from yt.testing import assert_allclose_units, fake_random_ds from yt.visualization.api import PhasePlot class TestPhasePlotAPI: @classmethod def setup_class(cls): cls.ds = fake_random_ds( 16, fields=("density...
yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@visualization@tests@test_profile_plots.py@.PATH_END.py
{ "filename": "irafnames.py", "repo_name": "iraf-community/pyraf", "repo_path": "pyraf_extracted/pyraf-main/pyraf/irafnames.py", "type": "Python" }
"""module irafnames.py -- define how names of IRAF packages and tasks get included in the user's namespace. Uses a plug-in strategy so behavior can be changed. R. White, 1999 March 26 """ import __main__ from .tools import irafglobals from . import iraf def _addName(task, module): """Add a task object to the...
iraf-communityREPO_NAMEpyrafPATH_START.@pyraf_extracted@pyraf-main@pyraf@irafnames.py@.PATH_END.py
{ "filename": "test_background_subtraction.py", "repo_name": "LCOGT/banzai-nres", "repo_path": "banzai-nres_extracted/banzai-nres-main/banzai_nres/tests/test_background_subtraction.py", "type": "Python" }
from banzai_nres.frames import NRESObservationFrame from banzai.data import CCDData import numpy as np from banzai_nres.background import BackgroundSubtractor from banzai import context import pytest @pytest.fixture def seed(): np.random.seed(11248) def test_background_subtraction_on_noisy_data(seed): nx, n...
LCOGTREPO_NAMEbanzai-nresPATH_START.@banzai-nres_extracted@banzai-nres-main@banzai_nres@tests@test_background_subtraction.py@.PATH_END.py
{ "filename": "normalize_is_none.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/pythran/pythran/transformations/normalize_is_none.py", "type": "Python" }
""" NormalizeIsNone detects is None patterns. """ from pythran.passmanager import Transformation from pythran.analyses import Ancestors from pythran.syntax import PythranSyntaxError from functools import reduce import gast as ast def is_none(expr): # py3 if isinstance(expr, ast.Constant) and expr.value is N...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@pythran@pythran@transformations@normalize_is_none.py@.PATH_END.py
{ "filename": "_tickangle.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/barpolar/marker/colorbar/_tickangle.py", "type": "Python" }
import _plotly_utils.basevalidators class TickangleValidator(_plotly_utils.basevalidators.AngleValidator): def __init__( self, plotly_name="tickangle", parent_name="barpolar.marker.colorbar", **kwargs ): super(TickangleValidator, self).__init__( plotly_name=plotly_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@barpolar@marker@colorbar@_tickangle.py@.PATH_END.py
{ "filename": "xi_data_2d_eBOSS_broadband_test.py", "repo_name": "Samreay/Barry", "repo_path": "Barry_extracted/Barry-master/config/examples/xi_data_2d_eBOSS_broadband_test.py", "type": "Python" }
import sys sys.path.append("..") sys.path.append("../..") from barry.samplers import NautilusSampler from barry.config import setup from barry.models import CorrBeutler2017 from barry.datasets.dataset_correlation_function import CorrelationFunction_eBOSS_LRGpCMASS from barry.fitter import Fitter import numpy as np imp...
SamreayREPO_NAMEBarryPATH_START.@Barry_extracted@Barry-master@config@examples@xi_data_2d_eBOSS_broadband_test.py@.PATH_END.py
{ "filename": "_hoverlabel.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/scatter3d/_hoverlabel.py", "type": "Python" }
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Hoverlabel(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "scatter3d" _path_str = "scatter3d.hoverlabel" _valid_props = { "align", ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@scatter3d@_hoverlabel.py@.PATH_END.py
{ "filename": "pupmed.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/retrievers/pupmed.py", "type": "Python" }
from typing import TYPE_CHECKING, Any from langchain._api import create_importer if TYPE_CHECKING: from langchain_community.retrievers import PubMedRetriever # 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@retrievers@pupmed.py@.PATH_END.py
{ "filename": "kernel_utils.py", "repo_name": "rapidsai/cuml", "repo_path": "cuml_extracted/cuml-main/python/cuml/cuml/common/kernel_utils.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 ag...
rapidsaiREPO_NAMEcumlPATH_START.@cuml_extracted@cuml-main@python@cuml@cuml@common@kernel_utils.py@.PATH_END.py
{ "filename": "TestDeepClean.py", "repo_name": "saopicc/DDFacet", "repo_path": "DDFacet_extracted/DDFacet-master/DDFacet/Tests/VeryLongAcceptanceTests/TestDeepClean.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@VeryLongAcceptanceTests@TestDeepClean.py@.PATH_END.py
{ "filename": "communication.py", "repo_name": "jmd-dk/concept", "repo_path": "concept_extracted/concept-master/src/communication.py", "type": "Python" }
# This file is part of CO𝘕CEPT, the cosmological 𝘕-body code in Python. # Copyright © 2015–2024 Jeppe Mosgaard Dakin. # # CO𝘕CEPT 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 Lice...
jmd-dkREPO_NAMEconceptPATH_START.@concept_extracted@concept-master@src@communication.py@.PATH_END.py
{ "filename": "_hoverongaps.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/contour/_hoverongaps.py", "type": "Python" }
import _plotly_utils.basevalidators class HoverongapsValidator(_plotly_utils.basevalidators.BooleanValidator): def __init__(self, plotly_name="hoverongaps", parent_name="contour", **kwargs): super(HoverongapsValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_nam...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@contour@_hoverongaps.py@.PATH_END.py
{ "filename": "_labelpadding.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/carpet/baxis/_labelpadding.py", "type": "Python" }
import _plotly_utils.basevalidators class LabelpaddingValidator(_plotly_utils.basevalidators.IntegerValidator): def __init__( self, plotly_name="labelpadding", parent_name="carpet.baxis", **kwargs ): super(LabelpaddingValidator, self).__init__( plotly_name=plotly_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@carpet@baxis@_labelpadding.py@.PATH_END.py
{ "filename": "_arrayminus.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/histogram/error_y/_arrayminus.py", "type": "Python" }
import _plotly_utils.basevalidators class ArrayminusValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__( self, plotly_name="arrayminus", parent_name="histogram.error_y", **kwargs ): super(ArrayminusValidator, self).__init__( plotly_name=plotly_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@histogram@error_y@_arrayminus.py@.PATH_END.py
{ "filename": "test_netiterintegrate.py", "repo_name": "JohannesBuchner/UltraNest", "repo_path": "UltraNest_extracted/UltraNest-master/tests/test_netiterintegrate.py", "type": "Python" }
from __future__ import print_function, division import os import numpy as np from ultranest.store import TextPointStore from ultranest.netiter import PointPile, TreeNode, count_tree, print_tree, dump_tree from ultranest.netiter import SingleCounter, MultiCounter, BreadthFirstIterator def integrate_singleblock(num_li...
JohannesBuchnerREPO_NAMEUltraNestPATH_START.@UltraNest_extracted@UltraNest-master@tests@test_netiterintegrate.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "wmpg/WesternMeteorPyLib", "repo_path": "WesternMeteorPyLib_extracted/WesternMeteorPyLib-master/wmpl/MetSim/__init__.py", "type": "Python" }
wmpgREPO_NAMEWesternMeteorPyLibPATH_START.@WesternMeteorPyLib_extracted@WesternMeteorPyLib-master@wmpl@MetSim@__init__.py@.PATH_END.py
{ "filename": "st_instance.py", "repo_name": "simonsobs/nextline-rdb", "repo_path": "nextline-rdb_extracted/nextline-rdb-main/src/nextline_rdb/alembic/models/rev_4dc6a93dfed8/strategies/st_instance.py", "type": "Python" }
from typing import Optional from hypothesis import strategies as st from .. import Model @st.composite def st_model_instance_list( draw: st.DrawFn, min_size: int = 0, max_size: Optional[int] = None, ) -> list[Model]: '''A strategy for a list of `Model` instances. Instances of `Script` and `Run`...
simonsobsREPO_NAMEnextline-rdbPATH_START.@nextline-rdb_extracted@nextline-rdb-main@src@nextline_rdb@alembic@models@rev_4dc6a93dfed8@strategies@st_instance.py@.PATH_END.py
{ "filename": "run_test.py", "repo_name": "zachetienne/nrpytutorial", "repo_path": "nrpytutorial_extracted/nrpytutorial-master/UnitTesting/run_test.py", "type": "Python" }
# Step 1.a: Initialize core Python/UnitTesting modules from UnitTesting.calc_error import calc_error from UnitTesting.evaluate_globals import evaluate_globals from UnitTesting.first_time_print import first_time_print from UnitTesting.cse_simplify_and_evaluate_sympy_expressions import cse_simplify_and_evaluate_sympy_exp...
zachetienneREPO_NAMEnrpytutorialPATH_START.@nrpytutorial_extracted@nrpytutorial-master@UnitTesting@run_test.py@.PATH_END.py
{ "filename": "_variant.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/funnelarea/title/font/_variant.py", "type": "Python" }
import _plotly_utils.basevalidators class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="variant", parent_name="funnelarea.title.font", **kwargs ): super(VariantValidator, self).__init__( plotly_name=plotly_name, par...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@funnelarea@title@font@_variant.py@.PATH_END.py
{ "filename": "job_server.py", "repo_name": "amusecode/amuse", "repo_path": "amuse_extracted/amuse-main/src/amuse/ext/job_server.py", "type": "Python" }
""" JobServer: class for job farming using amuse communication channels usage: start jobserver jobserver=JobServer(hosts=<list of hostnames> [ ,channel_type="mpi", preamble="<commands>", retry_jobs=True/ False] ) submit job job=jobserver.submit_job(somework, (args,)) wait for one result (encounters all): jobs...
amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@src@amuse@ext@job_server.py@.PATH_END.py
{ "filename": "Subversion.py", "repo_name": "rat-pac/rat-pac", "repo_path": "rat-pac_extracted/rat-pac-master/python/SCons/Tool/Subversion.py", "type": "Python" }
"""SCons.Tool.Subversion.py Tool-specific initialization for Subversion. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Found...
rat-pacREPO_NAMErat-pacPATH_START.@rat-pac_extracted@rat-pac-master@python@SCons@Tool@Subversion.py@.PATH_END.py
{ "filename": "_variant.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/histogram2d/legendgrouptitle/font/_variant.py", "type": "Python" }
import _plotly_utils.basevalidators class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="variant", parent_name="histogram2d.legendgrouptitle.font", **kwargs, ): super(VariantValidator, self).__init__( plo...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@histogram2d@legendgrouptitle@font@_variant.py@.PATH_END.py
{ "filename": "simple_dust_2023.py", "repo_name": "sdss/idlspec2d", "repo_path": "idlspec2d_extracted/idlspec2d-master/python/boss_drp/prep/simple_dust_2023.py", "type": "Python" }
import h5py import healpy as hp import numpy as np import json from os import getenv import os.path as ptt def find_nearest_idx(value,array): value = np.atleast_1d(value) array = np.asarray(array) idx = np.full(len(value), -1) for i, val in enumerate(value): idx[i] = (np.abs(array - val)).argm...
sdssREPO_NAMEidlspec2dPATH_START.@idlspec2d_extracted@idlspec2d-master@python@boss_drp@prep@simple_dust_2023.py@.PATH_END.py
{ "filename": "_thicknessmode.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/histogram2d/colorbar/_thicknessmode.py", "type": "Python" }
import _plotly_utils.basevalidators class ThicknessmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="thicknessmode", parent_name="histogram2d.colorbar", **kwargs ): super(ThicknessmodeValidator, self).__init__( plotly_name=plotly_name...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@histogram2d@colorbar@_thicknessmode.py@.PATH_END.py
{ "filename": "tpu_outside_compilation_test.py", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/tpu/tpu_outside_compilation_test.py", "type": "Python" }
# Copyright 2020 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@tpu@tpu_outside_compilation_test.py@.PATH_END.py
{ "filename": "test_frame.py", "repo_name": "waynebhayes/SpArcFiRe", "repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/visualization/wcsaxes/tests/test_frame.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np import matplotlib.pyplot as plt from ....wcs import WCS from ....tests.helper import remote_data from .. import WCSAxes from ..frame import BaseFrame from ....tests.image_tests import IMAGE_REFERENCE_DIR from .test_imag...
waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@visualization@wcsaxes@tests@test_frame.py@.PATH_END.py
{ "filename": "_linewidth.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/xaxis/_linewidth.py", "type": "Python" }
import _plotly_utils.basevalidators class LinewidthValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="linewidth", parent_name="layout.xaxis", **kwargs): super(LinewidthValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name,...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@xaxis@_linewidth.py@.PATH_END.py
{ "filename": "resample.py", "repo_name": "astropy/specutils", "repo_path": "specutils_extracted/specutils-main/specutils/manipulation/resample.py", "type": "Python" }
from abc import ABC, abstractmethod import numpy as np from astropy.nddata import VarianceUncertainty, InverseVariance from astropy.units import Quantity from scipy.interpolate import CubicSpline from ..spectra import Spectrum1D, SpectralAxis __all__ = ['ResamplerBase', 'FluxConservingResampler', 'LinearI...
astropyREPO_NAMEspecutilsPATH_START.@specutils_extracted@specutils-main@specutils@manipulation@resample.py@.PATH_END.py
{ "filename": "copy_injection_recovery.py", "repo_name": "ThibeauWouters/TurboPE-BNS", "repo_path": "TurboPE-BNS_extracted/TurboPE-BNS-main/injections/outdir_NRTv2/injection_38/copy_injection_recovery.py", "type": "Python" }
""" Idea: try different learning rate schemes to try and fix the injections """ import psutil p = psutil.Process() p.cpu_affinity([0]) import os os.environ['CUDA_VISIBLE_DEVICES'] = "3" os.environ["XLA_PYTHON_CLIENT_MEM_FRACTION"] = "0.10" import numpy as np import argparse # Regular imports import argparse import cop...
ThibeauWoutersREPO_NAMETurboPE-BNSPATH_START.@TurboPE-BNS_extracted@TurboPE-BNS-main@injections@outdir_NRTv2@injection_38@copy_injection_recovery.py@.PATH_END.py