metadata
dict
text
stringlengths
0
40.6M
id
stringlengths
14
255
{ "filename": "download.py", "repo_name": "amusecode/amuse", "repo_path": "amuse_extracted/amuse-main/src/amuse/community/hermite_grx/download.py", "type": "Python" }
#!/usr/bin/env python import subprocess import os import urllib.request import urllib.parse import urllib.error from shutil import which import argparse class GetCodeFromHttp: filename_template = "{version}.tar.gz" name = ["Hermite_GRX"] url_template = [ "https://github.com/amusecode/Hermite_GRX/...
amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@src@amuse@community@hermite_grx@download.py@.PATH_END.py
{ "filename": "ex_sandwich3.py", "repo_name": "statsmodels/statsmodels", "repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/examples/ex_sandwich3.py", "type": "Python" }
"""Cluster Robust Standard Errors with Two Clusters Created on Sat Dec 17 08:39:16 2011 Author: Josef Perktold """ from urllib.request import urlretrieve import numpy as np from numpy.testing import assert_almost_equal import statsmodels.api as sm import statsmodels.stats.sandwich_covariance as sw #requires Peter...
statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@examples@ex_sandwich3.py@.PATH_END.py
{ "filename": "_visible.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/sunburst/_visible.py", "type": "Python" }
import _plotly_utils.basevalidators class VisibleValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="visible", parent_name="sunburst", **kwargs): super(VisibleValidator, 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@sunburst@_visible.py@.PATH_END.py
{ "filename": "show.py", "repo_name": "enthought/mayavi", "repo_path": "mayavi_extracted/mayavi-master/mayavi/tools/show.py", "type": "Python" }
# Author: Prabhu Ramachandran <prabhu[at]aero[dot]iitb[dot]ac[dot]in> # Copyright (c) 2008, Enthought, Inc. # License: BSD Style. from traits.etsconfig.api import ETSConfig from pyface.api import GUI, ApplicationWindow from traits.api import HasTraits, Button, Any from traitsui.api import View, Group, Item from pyface...
enthoughtREPO_NAMEmayaviPATH_START.@mayavi_extracted@mayavi-master@mayavi@tools@show.py@.PATH_END.py
{ "filename": "test_gradients.py", "repo_name": "astro-informatics/s2wav", "repo_path": "s2wav_extracted/s2wav-main/tests/test_gradients.py", "type": "Python" }
import jax jax.config.update("jax_enable_x64", True) import pytest import jax.numpy as jnp from jax.test_util import check_grads import s2fft from s2wav.transforms import wavelet, wavelet_c, wavelet_precompute, construct from s2wav import filters, samples L_to_test = [8] N_to_test = [3] J_min_to_test = [2] reality = ...
astro-informaticsREPO_NAMEs2wavPATH_START.@s2wav_extracted@s2wav-main@tests@test_gradients.py@.PATH_END.py
{ "filename": "read_distributed_grid.py", "repo_name": "bwvdnbro/CMacIonize", "repo_path": "CMacIonize_extracted/CMacIonize-master/tools/read_distributed_grid.py", "type": "Python" }
import numpy as np import h5py import re # precompiled regular expressions for reading in int and length arrays intarray = re.compile("\[([0-9]*), ([0-9]*), ([0-9]*)\]") lengtharray = re.compile( "\[([\-0-9\.e\+]*) m, ([\-0-9\.e\+]*) m, ([\-0-9\.e\+]*) m\]" ) ## # @brief Read quantities from a distributed snapsho...
bwvdnbroREPO_NAMECMacIonizePATH_START.@CMacIonize_extracted@CMacIonize-master@tools@read_distributed_grid.py@.PATH_END.py
{ "filename": "version.py", "repo_name": "caseyjlaw/rtpipe", "repo_path": "rtpipe_extracted/rtpipe-master/rtpipe/version.py", "type": "Python" }
__version__ = '1.60'
caseyjlawREPO_NAMErtpipePATH_START.@rtpipe_extracted@rtpipe-master@rtpipe@version.py@.PATH_END.py
{ "filename": "test_gmm_poisson.py", "repo_name": "statsmodels/statsmodels", "repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/sandbox/regression/tests/test_gmm_poisson.py", "type": "Python" }
''' TestGMMMultTwostepDefault() has lower precision ''' from statsmodels.compat.python import lmap import numpy as np import pandas from scipy import stats import pytest from statsmodels.regression.linear_model import OLS from statsmodels.sandbox.regression import gmm from numpy.testing import assert_allclose, ass...
statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@sandbox@regression@tests@test_gmm_poisson.py@.PATH_END.py
{ "filename": "_xhoverformat.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/surface/_xhoverformat.py", "type": "Python" }
import _plotly_utils.basevalidators class XhoverformatValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="xhoverformat", parent_name="surface", **kwargs): super(XhoverformatValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_n...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@surface@_xhoverformat.py@.PATH_END.py
{ "filename": "demo_plotting_BHNS_distributions_for_LVK.ipynb", "repo_name": "FloorBroekgaarden/Double-Compact-Object-Mergers", "repo_path": "Double-Compact-Object-Mergers_extracted/Double-Compact-Object-Mergers-main/demo_read_hdf5_file/demo_plotting_BHNS_distributions_for_LVK.ipynb", "type": "Jupyter Notebook"...
```python # import sys # sys.path.append('../Scripts') # from PostProcessingScripts import * # import pandas as pd # import string # just to make the cells appear wider: from IPython.core.display import display, HTML display(HTML("<style>.container { width:100% !important; }</style>")) import h5py as h5 import nu...
FloorBroekgaardenREPO_NAMEDouble-Compact-Object-MergersPATH_START.@Double-Compact-Object-Mergers_extracted@Double-Compact-Object-Mergers-main@demo_read_hdf5_file@demo_plotting_BHNS_distributions_for_LVK.ipynb@.PATH_END.py
{ "filename": "embed.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/ipywidgets/py3/ipywidgets/embed.py", "type": "Python" }
# Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. # # # Parts of this code is from IPyVolume (24.05.2017), used here under # this copyright and license with permission from the author # (see https://github.com/jupyter-widgets/ipywidgets/pull/1387) """ Functions for ge...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipywidgets@py3@ipywidgets@embed.py@.PATH_END.py
{ "filename": "set-individual-constraints__div.md", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage/set-individual-constraints__div.md", "type": "Markdown" }
Set constraints individually for each feature as a string (the number of features is n). Format ``` "(<constraint_0>, <constraint_2>, .., <constraint_n-1>)" ```
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage@set-individual-constraints__div.md@.PATH_END.py
{ "filename": "synchrotron_self_compton.py", "repo_name": "cosimoNigro/agnpy", "repo_path": "agnpy_extracted/agnpy-master/agnpy/compton/synchrotron_self_compton.py", "type": "Python" }
# module containing the synchrotron self Compton radiative process import numpy as np from astropy.constants import c, sigma_T import astropy.units as u from .kernels import isotropic_kernel from ..synchrotron import Synchrotron from ..utils.math import ( axes_reshaper, gamma_e_to_integrate, nu_to_integrate...
cosimoNigroREPO_NAMEagnpyPATH_START.@agnpy_extracted@agnpy-master@agnpy@compton@synchrotron_self_compton.py@.PATH_END.py
{ "filename": "test_gradient_boosting.py", "repo_name": "scikit-learn/scikit-learn", "repo_path": "scikit-learn_extracted/scikit-learn-main/sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py", "type": "Python" }
import copyreg import io import pickle import re import warnings from unittest.mock import Mock import joblib import numpy as np import pytest from joblib.numpy_pickle import NumpyPickler from numpy.testing import assert_allclose, assert_array_equal import sklearn from sklearn._loss.loss import ( AbsoluteError, ...
scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@sklearn@ensemble@_hist_gradient_boosting@tests@test_gradient_boosting.py@.PATH_END.py
{ "filename": "utils_lbol.py", "repo_name": "nuclear-multimessenger-astronomy/nmma", "repo_path": "nmma_extracted/nmma-main/nmma/em/utils_lbol.py", "type": "Python" }
import numpy as np from scipy.integrate import quad import astropy.constants def arnett_lc_get_int_A_non_vec(x, y): r = quad(lambda z: 2 * z * np.exp(-2 * z * y + z**2), 0, x) int_A = r[0] return int_A arnett_lc_get_int_A = np.vectorize(arnett_lc_get_int_A_non_vec, excluded=["y"]) def arnett_lc_get_in...
nuclear-multimessenger-astronomyREPO_NAMEnmmaPATH_START.@nmma_extracted@nmma-main@nmma@em@utils_lbol.py@.PATH_END.py
{ "filename": "_variantsrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/isosurface/hoverlabel/font/_variantsrc.py", "type": "Python" }
import _plotly_utils.basevalidators class VariantsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="variantsrc", parent_name="isosurface.hoverlabel.font", **kwargs, ): super(VariantsrcValidator, self).__init__( plotly_n...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@isosurface@hoverlabel@font@_variantsrc.py@.PATH_END.py
{ "filename": "incomplete_beta.py", "repo_name": "oliverphilcox/HIPSTER", "repo_path": "HIPSTER_extracted/HIPSTER-master/python/wcdm/incomplete_beta.py", "type": "Python" }
# This is an adaptation by Daniel Eisenstein of GSL code in # beta_cont_frac_gsl(a, b, x). # This file is distributed under the GNU Public License import numpy as np ######### An adaptation of the GSL beta function code def beta_cont_frac_gsl(a, b, x): # This computes B_x(a,b) using a continued fraction appr...
oliverphilcoxREPO_NAMEHIPSTERPATH_START.@HIPSTER_extracted@HIPSTER-master@python@wcdm@incomplete_beta.py@.PATH_END.py
{ "filename": "io_utils.py", "repo_name": "threeML/threeML", "repo_path": "threeML_extracted/threeML-master/threeML/io/cern_root_utils/io_utils.py", "type": "Python" }
import ROOT import contextlib def get_list_of_keys(root_file, dir=""): """ Given a ROOT file, it returns the list of object names contained in the file in the provided directory. :param root_file: a ROOT.TFile instance :param dir: the directory (default: "", i.e., the root of the file) :return: a...
threeMLREPO_NAMEthreeMLPATH_START.@threeML_extracted@threeML-master@threeML@io@cern_root_utils@io_utils.py@.PATH_END.py
{ "filename": "arxiv.py", "repo_name": "showyourwork/showyourwork", "repo_path": "showyourwork_extracted/showyourwork-main/src/showyourwork/workflow/scripts/arxiv.py", "type": "Python" }
""" Wraps the :doc:`pdf` script to build the article PDF, then tars everything in the ``src/tex`` directory into the tarball ``arxiv.tar.gz`` for easy arXiv submission. """ import shutil import subprocess import tarfile from pathlib import Path from tempfile import TemporaryDirectory from showyourwork import paths ...
showyourworkREPO_NAMEshowyourworkPATH_START.@showyourwork_extracted@showyourwork-main@src@showyourwork@workflow@scripts@arxiv.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "bwvdnbro/CMacIonize", "repo_path": "CMacIonize_extracted/CMacIonize-master/python/__init__.py", "type": "Python" }
#! /usr/bin/python ################################################################################ # This file is part of CMacIonize # Copyright (C) 2016 Bert Vandenbroucke (bert.vandenbroucke@gmail.com) # # CMacIonize is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gene...
bwvdnbroREPO_NAMECMacIonizePATH_START.@CMacIonize_extracted@CMacIonize-master@python@__init__.py@.PATH_END.py
{ "filename": "_colorscale.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattergl/marker/line/_colorscale.py", "type": "Python" }
import _plotly_utils.basevalidators class ColorscaleValidator(_plotly_utils.basevalidators.ColorscaleValidator): def __init__( self, plotly_name="colorscale", parent_name="scattergl.marker.line", **kwargs ): super(ColorscaleValidator, self).__init__( plotly_name=plotly_name, ...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattergl@marker@line@_colorscale.py@.PATH_END.py
{ "filename": "test_tracers.py", "repo_name": "LSSTDESC/CCL", "repo_path": "CCL_extracted/CCL-master/benchmarks/test_tracers.py", "type": "Python" }
import numpy as np import pyccl as ccl import pytest def get_prediction(ells, chi_i, chi_f, alpha, beta, gamma, der_bessel, der_angles): exponent = 2 * gamma - alpha - 2 * beta - 1 fl = np.ones_like(ells) if der_bessel == -1: fl *= 1. / (ells + 0.5)**4 if der_angles == 2: ...
LSSTDESCREPO_NAMECCLPATH_START.@CCL_extracted@CCL-master@benchmarks@test_tracers.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "sebastian-zieba/PACMAN", "repo_path": "PACMAN_extracted/PACMAN-master/src/pacman/lib/models/__init__.py", "type": "Python" }
from . import constant from . import constants_cj from . import divide_white from . import eclipse from . import exponential_visit from . import gp_matern32 from . import gp_sho from . import logarithmic_visit from . import model_ramp from . import polynomial1 from . import polynomial2 from . import sine1 from . import...
sebastian-ziebaREPO_NAMEPACMANPATH_START.@PACMAN_extracted@PACMAN-master@src@pacman@lib@models@__init__.py@.PATH_END.py
{ "filename": "utils.py", "repo_name": "AlexLaroche7/xp_vae", "repo_path": "xp_vae_extracted/xp_vae-main/xp_vae/utils.py", "type": "Python" }
import torch import numpy as np from numpy.typing import NDArray import copy import random rng = np.random.default_rng() class DataGenerator(torch.utils.data.Dataset): def __init__(self, batch_size: int, xp: NDArray, xp_err: NDArray ): self.batc...
AlexLaroche7REPO_NAMExp_vaePATH_START.@xp_vae_extracted@xp_vae-main@xp_vae@utils.py@.PATH_END.py
{ "filename": "Check_fields.ipynb", "repo_name": "desy-multimessenger/nuztf", "repo_path": "nuztf_extracted/nuztf-main/notebooks/Check_fields.ipynb", "type": "Jupyter Notebook" }
```python %matplotlib inline from ztfquery import fields, query from astropy import time import datetime ``` ```python fields_to_check = [1568, 522] ``` ```python for field_number in fields_to_check: print(field_number, fields.has_field_reference(field_number)) ``` 1568 {'zg': True, 'zr': True, 'zi': True}...
desy-multimessengerREPO_NAMEnuztfPATH_START.@nuztf_extracted@nuztf-main@notebooks@Check_fields.ipynb@.PATH_END.py
{ "filename": "scriptQTestEdit.py", "repo_name": "bill-cotton/Obit", "repo_path": "Obit_extracted/Obit-master/ObitSystem/ObitSD/share/scripts/scriptQTestEdit.py", "type": "Python" }
# Program to test editing of OTF data from python in Obit # Test for Richard Prestages Q band data import OTF, OTFUtil, OErr, OSystem from Obit import Bomb # Init Obit err=OErr.OErr() ObitSys=OSystem.OSystem ("Python", 1, 103, 1, ["None"], 1, ["../PythonData/"], 1, 0, err) OErr.printErrMsg(err, "Error with Obit start...
bill-cottonREPO_NAMEObitPATH_START.@Obit_extracted@Obit-master@ObitSystem@ObitSD@share@scripts@scriptQTestEdit.py@.PATH_END.py
{ "filename": "Usage_Example.py", "repo_name": "beastraban/INSANE", "repo_path": "INSANE_extracted/INSANE-main/INSANE/src/INSANE/Usage_Example.py", "type": "Python" }
# -*- coding: utf-8 -*- """ Created on Sun Jun 28 13:18:31 2015 @author: Spawn """ from __future__ import division from __future__ import print_function import sys import platform from INSANE.BackgroundGeometry import BackgroundSolver import os """ Here we need to define the parameters to run the script: I am defining...
beastrabanREPO_NAMEINSANEPATH_START.@INSANE_extracted@INSANE-main@INSANE@src@INSANE@Usage_Example.py@.PATH_END.py
{ "filename": "distributed_datamodel.py", "repo_name": "amusecode/amuse", "repo_path": "amuse_extracted/amuse-main/src/amuse/community/distributed/distributed_datamodel.py", "type": "Python" }
from amuse.datamodel import Particles, Particle class Resources(Particles): def __getitem__(self, index): keys = self.get_all_keys_in_store()[index] index = self.get_all_indices_in_store()[index] if hasattr(keys, '__iter__'): return self._subset(keys) else: ...
amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@src@amuse@community@distributed@distributed_datamodel.py@.PATH_END.py
{ "filename": "plot_freq.py", "repo_name": "gwastro/pycbc", "repo_path": "pycbc_extracted/pycbc-master/examples/waveform/plot_freq.py", "type": "Python" }
import matplotlib.pyplot as pp from pycbc import waveform for phase_order in [2, 3, 4, 5, 6, 7]: hp, hc = waveform.get_td_waveform(approximant='SpinTaylorT4', mass1=10, mass2=10, phase_order=phase_order, delta_t=1.0...
gwastroREPO_NAMEpycbcPATH_START.@pycbc_extracted@pycbc-master@examples@waveform@plot_freq.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "astropy/astropy", "repo_path": "astropy_extracted/astropy-main/astropy/utils/masked/tests/__init__.py", "type": "Python" }
astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@utils@masked@tests@__init__.py@.PATH_END.py
{ "filename": "test_likelihood.py", "repo_name": "rfeldmann/leopy", "repo_path": "leopy_extracted/leopy-master/leopy/test/test_likelihood.py", "type": "Python" }
"""Simple test cases for the leopy.likelihood module. This module is part of LEO-Py -- \ Likelihood Estimation of Observational data with Python Copyright 2019 University of Zurich, Robert Feldmann LEO-Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public ...
rfeldmannREPO_NAMEleopyPATH_START.@leopy_extracted@leopy-master@leopy@test@test_likelihood.py@.PATH_END.py
{ "filename": "test_loader.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/traitlets/py3/tests/config/test_loader.py", "type": "Python" }
"""Tests for traitlets.config.loader""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import annotations import copy import os import pickle from itertools import chain from tempfile import mkstemp from unittest import TestCase import pytest fro...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@traitlets@py3@tests@config@test_loader.py@.PATH_END.py
{ "filename": "test_create_skymodel_chunk_map.py", "repo_name": "JLBLine/WODEN", "repo_path": "WODEN_extracted/WODEN-master/cmake_testing/wodenpy/skymodel/test_create_skymodel_chunk_map.py", "type": "Python" }
""" """ from sys import path import os import unittest import numpy as np ##This is where our code lives # code_dir = os.environ['CMAKE_CURRENT_SOURCE_DIR'] # ##Code we are testing from wodenpy.skymodel import read_yaml_skymodel # import wodenpy from wodenpy.skymodel.woden_skymodel import Component_Type_Counter, Co...
JLBLineREPO_NAMEWODENPATH_START.@WODEN_extracted@WODEN-master@cmake_testing@wodenpy@skymodel@test_create_skymodel_chunk_map.py@.PATH_END.py
{ "filename": "test_reshape.py", "repo_name": "pandas-dev/pandas", "repo_path": "pandas_extracted/pandas-main/pandas/tests/indexes/base_class/test_reshape.py", "type": "Python" }
""" Tests for ndarray-like method on the base Index class """ import numpy as np import pytest from pandas import Index import pandas._testing as tm class TestReshape: def test_repeat(self): repeats = 2 index = Index([1, 2, 3]) expected = Index([1, 1, 2, 2, 3, 3]) result = index...
pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@indexes@base_class@test_reshape.py@.PATH_END.py
{ "filename": "plot_structure.py", "repo_name": "dullemond/radmc3d-2.0", "repo_path": "radmc3d-2.0_extracted/radmc3d-2.0-master/examples/run_ppdisk_analytic_2/plot_structure.py", "type": "Python" }
import problem_setup as p import numpy as np from mpl_toolkits.mplot3d import axes3d from matplotlib import pyplot as plt from matplotlib import cm from radmc3dPy.image import * from radmc3dPy.analyze import * from radmc3dPy.natconst import * # # Make sure to have done the following beforhand: # # First compile RADMC...
dullemondREPO_NAMEradmc3d-2.0PATH_START.@radmc3d-2.0_extracted@radmc3d-2.0-master@examples@run_ppdisk_analytic_2@plot_structure.py@.PATH_END.py
{ "filename": "test_astrometry_net.py", "repo_name": "astropy/astroquery", "repo_path": "astroquery_extracted/astroquery-main/astroquery/astrometry_net/tests/test_astrometry_net.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import json import pytest from .. import AstrometryNet DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') def data_path(filename): return os.path.join(DATA_DIR, filename) def test_api_key_property(): """ Check that an e...
astropyREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@astrometry_net@tests@test_astrometry_net.py@.PATH_END.py
{ "filename": "dustpylib.ipynb", "repo_name": "stammler/dustpy", "repo_path": "dustpy_extracted/dustpy-master/examples/dustpylib.ipynb", "type": "Jupyter Notebook" }
# Library: dustpylib `dustpylib` is a library with auxiliary tools and extensions for `DustPy`, containing for example interfaces to radiative transfer tools. It is a community project, to which everyone can upload their own `DustPy` customizations. For more details, please have a look at the [dustpylib documentation...
stammlerREPO_NAMEdustpyPATH_START.@dustpy_extracted@dustpy-master@examples@dustpylib.ipynb@.PATH_END.py
{ "filename": "T_S_I_B_.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_B_.py", "type": "Python" }
from .T_S_I_V_ import table_T_S_I_V_ class table_T_S_I_B_(table_T_S_I_V_): pass
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@fonttools@fontTools@ttLib@tables@T_S_I_B_.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "benstahl92/LOSSPhotPypeline", "repo_path": "LOSSPhotPypeline_extracted/LOSSPhotPypeline-master/LOSSPhotPypeline/utils/__init__.py", "type": "Python" }
# internal imports from LOSSPhotPypeline.utils.astroCatalog import astroCatalog from LOSSPhotPypeline.utils.LPP_utils import * from LOSSPhotPypeline.utils.plotLC import plotLC
benstahl92REPO_NAMELOSSPhotPypelinePATH_START.@LOSSPhotPypeline_extracted@LOSSPhotPypeline-master@LOSSPhotPypeline@utils@__init__.py@.PATH_END.py
{ "filename": "paper_plots.py", "repo_name": "daniel-muthukrishna/astrorapid", "repo_path": "astrorapid_extracted/astrorapid-master/paper_plots/paper_plots.py", "type": "Python" }
# MAKE DATA # orig_lc, timesX, y_predict = classify_lasair_light_curves(object_names=[ # 'ZTF18abxftqm', # TDE # 'ZTF19aadnmgf', # SNIa # 'ZTF18acmzpbf', # SNIa # ]) # # with open('paper_plot_real_data.pickle', 'wb') as f: # pickle.dump([orig_lc, timesX, y_predict], f) # PLOT FOR PAPER import pickle...
daniel-muthukrishnaREPO_NAMEastrorapidPATH_START.@astrorapid_extracted@astrorapid-master@paper_plots@paper_plots.py@.PATH_END.py
{ "filename": "distance.py", "repo_name": "scipy/scipy", "repo_path": "scipy_extracted/scipy-main/scipy/spatial/distance.py", "type": "Python" }
""" Distance computations (:mod:`scipy.spatial.distance`) ===================================================== .. sectionauthor:: Damian Eads Function reference ------------------ Distance matrix computation from a collection of raw observation vectors stored in a rectangular array. .. autosummary:: :toctree: g...
scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@spatial@distance.py@.PATH_END.py
{ "filename": "bigfile.py", "repo_name": "bccp/nbodykit", "repo_path": "nbodykit_extracted/nbodykit-master/nbodykit/source/mesh/bigfile.py", "type": "Python" }
from __future__ import absolute_import # the future import is important. or in python 2.7 we try to # import this module itself. Due to the unfortnate name conflict! from nbodykit.base.mesh import MeshSource from nbodykit import CurrentMPIComm from nbodykit.utils import JSONDecoder from bigfile import FileMPI from pme...
bccpREPO_NAMEnbodykitPATH_START.@nbodykit_extracted@nbodykit-master@nbodykit@source@mesh@bigfile.py@.PATH_END.py
{ "filename": "setup.py", "repo_name": "timstaley/drive-ami", "repo_path": "drive-ami_extracted/drive-ami-master/setup.py", "type": "Python" }
#!/usr/bin/env python from setuptools import setup import versioneer requirements = ['pexpect>=4.0.1,<5', 'astropy>=1.0,<2', 'colorlog', ] setup( name="drive-ami", version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), packages=['driveami'], scripts...
timstaleyREPO_NAMEdrive-amiPATH_START.@drive-ami_extracted@drive-ami-master@setup.py@.PATH_END.py
{ "filename": "CompatibleFaceSpecificThermalEnergyPolicyInst.cc.py", "repo_name": "LLNL/spheral", "repo_path": "spheral_extracted/spheral-main/src/SVPH/CompatibleFaceSpecificThermalEnergyPolicyInst.cc.py", "type": "Python" }
text = """ //------------------------------------------------------------------------------ // Explicit instantiation. //------------------------------------------------------------------------------ #include "SVPH/CompatibleFaceSpecificThermalEnergyPolicy.cc" #include "Geometry/Dimension.hh" namespace Spheral { tem...
LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@src@SVPH@CompatibleFaceSpecificThermalEnergyPolicyInst.cc.py@.PATH_END.py
{ "filename": "momento_vector_index.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/vectorstores/momento_vector_index.py", "type": "Python" }
from typing import TYPE_CHECKING, Any from langchain._api import create_importer if TYPE_CHECKING: from langchain_community.vectorstores import MomentoVectorIndex # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optional imports...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@vectorstores@momento_vector_index.py@.PATH_END.py
{ "filename": "test_gaiatap.py", "repo_name": "astropy/astroquery", "repo_path": "astroquery_extracted/astroquery-main/astroquery/gaia/tests/test_gaiatap.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ ============= Gaia TAP plus ============= @author: Juan Carlos Segovia @contact: juan.carlos.segovia@sciops.esa.int European Space Astronomy Centre (ESAC) European Space Agency (ESA) Created on 30 jun. 2016 """ import datetime import os import zip...
astropyREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@gaia@tests@test_gaiatap.py@.PATH_END.py
{ "filename": "you.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/llms/you.py", "type": "Python" }
import os from typing import Any, Dict, Generator, Iterator, List, Literal, Optional import requests from langchain_core.callbacks.manager import CallbackManagerForLLMRun from langchain_core.language_models.llms import LLM from langchain_core.outputs import GenerationChunk from pydantic import Field SMART_ENDPOINT = ...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@llms@you.py@.PATH_END.py
{ "filename": "mynormalize.py", "repo_name": "Alymantara/pydoppler", "repo_path": "pydoppler_extracted/pydoppler-master/pydoppler/mynormalize.py", "type": "Python" }
# The Normalize class is largely based on code provided by Sarah Graves. import numpy as np import numpy.ma as ma import matplotlib.cbook as cbook from matplotlib.colors import Normalize class MyNormalize(Normalize): ''' A Normalize class for imshow that allows different stretching functions for astrono...
AlymantaraREPO_NAMEpydopplerPATH_START.@pydoppler_extracted@pydoppler-master@pydoppler@mynormalize.py@.PATH_END.py
{ "filename": "_dss.py", "repo_name": "sfarrens/sfof", "repo_path": "sfof_extracted/sfof-master/sfof/python/euclid/dm/_dss.py", "type": "Python" }
# /home/sartor/pymodule/euclid/dm/_dss.py # -*- coding: utf-8 -*- # PyXB bindings for NM:44ff076caf94dd1666a330718f99f59b80790879 # Generated 2014-07-24 16:26:39.931924 by PyXB version 1.2.3 # Namespace http://euclid.esa.org/schema/sys/dss [xmlns:dss] import pyxb import pyxb.binding import pyxb.binding.saxer import io...
sfarrensREPO_NAMEsfofPATH_START.@sfof_extracted@sfof-master@sfof@python@euclid@dm@_dss.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/isosurface/lighting/__init__.py", "type": "Python" }
import sys from typing import TYPE_CHECKING if sys.version_info < (3, 7) or TYPE_CHECKING: from ._vertexnormalsepsilon import VertexnormalsepsilonValidator from ._specular import SpecularValidator from ._roughness import RoughnessValidator from ._fresnel import FresnelValidator from ._facenormalsep...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@isosurface@lighting@__init__.py@.PATH_END.py
{ "filename": "mle_rates_for_realtime.py", "repo_name": "Swift-BAT/NITRATES", "repo_path": "NITRATES_extracted/NITRATES-main/nitrates/analysis_seeds/mle_rates_for_realtime.py", "type": "Python" }
import numpy as np from astropy.io import fits from astropy.table import Table, vstack from scipy import optimize, stats import argparse import os import multiprocessing as mp from ..lib.logllh_ebins_funcs import get_cnt_ebins_normed, log_pois_prob from ..response.ray_trace_funcs import ray_trace_square from ..lib.drm...
Swift-BATREPO_NAMENITRATESPATH_START.@NITRATES_extracted@NITRATES-main@nitrates@analysis_seeds@mle_rates_for_realtime.py@.PATH_END.py
{ "filename": "perf_crawl.py", "repo_name": "mpi4py/mpi4py", "repo_path": "mpi4py_extracted/mpi4py-master/demo/futures/perf_crawl.py", "type": "Python" }
""" Compare the speed of downloading URLs sequentially vs. using futures. """ import sys import time import functools try: from urllib.request import urlopen except ImportError: from urllib2 import urlopen try: from concurrent.futures import ThreadPoolExecutor except ImportError: ThreadPoolExecutor =...
mpi4pyREPO_NAMEmpi4pyPATH_START.@mpi4py_extracted@mpi4py-master@demo@futures@perf_crawl.py@.PATH_END.py
{ "filename": "PathVariable.py", "repo_name": "rat-pac/rat-pac", "repo_path": "rat-pac_extracted/rat-pac-master/python/SCons/Variables/PathVariable.py", "type": "Python" }
"""SCons.Variables.PathVariable This file defines an option type for SCons implementing path settings. To be used whenever a a user-specified path override should be allowed. Arguments to PathVariable are: option-name = name of this option on the command line (e.g. "prefix") option-help = help string for optio...
rat-pacREPO_NAMErat-pacPATH_START.@rat-pac_extracted@rat-pac-master@python@SCons@Variables@PathVariable.py@.PATH_END.py
{ "filename": "test_matching.py", "repo_name": "LSSTDESC/BlendingToolKit", "repo_path": "BlendingToolKit_extracted/BlendingToolKit-main/tests/test_matching.py", "type": "Python" }
from astropy.table import Table from btk.match import PixelHungarianMatcher def test_matching(): x1 = [12.0, 31.0] y1 = [10.0, 30.0] x2 = [34.0, 12.1, 20.1] y2 = [33.0, 10.1, 22.0] t1 = Table() t1["x_peak"] = x1 t1["y_peak"] = y1 t2 = Table() t2["x_peak"] = x2 t2["y_peak"] =...
LSSTDESCREPO_NAMEBlendingToolKitPATH_START.@BlendingToolKit_extracted@BlendingToolKit-main@tests@test_matching.py@.PATH_END.py
{ "filename": "pgf.py", "repo_name": "matplotlib/matplotlib", "repo_path": "matplotlib_extracted/matplotlib-main/galleries/users_explain/text/pgf.py", "type": "Python" }
r""" .. redirect-from:: /tutorials/text/pgf .. _pgf: ************************************************************ Text rendering with XeLaTeX/LuaLaTeX via the ``pgf`` backend ************************************************************ Using the ``pgf`` backend, Matplotlib can export figures as pgf drawing commands...
matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@galleries@users_explain@text@pgf.py@.PATH_END.py
{ "filename": "_tickformatstopdefaults.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/isosurface/colorbar/_tickformatstopdefaults.py", "type": "Python" }
import _plotly_utils.basevalidators class TickformatstopdefaultsValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__( self, plotly_name="tickformatstopdefaults", parent_name="isosurface.colorbar", **kwargs, ): super(TickformatstopdefaultsValidator, se...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@isosurface@colorbar@_tickformatstopdefaults.py@.PATH_END.py
{ "filename": "create_trajectories.py", "repo_name": "nuc-astro/winnet", "repo_path": "winnet_extracted/winnet-master/data/Example_data/Example_BigBang_many/create_trajectories.py", "type": "Python" }
# Import packages import os, shutil import numpy as np import matplotlib.pyplot as plt # Determining the trajectory of standart Big Bang. # We need to know: # - Temperature evolution # - Density evolution # - Electron fraction at weak freezeout etas = np.logspace(-12,-7,num=100) for e in etas: # The tr...
nuc-astroREPO_NAMEwinnetPATH_START.@winnet_extracted@winnet-master@data@Example_data@Example_BigBang_many@create_trajectories.py@.PATH_END.py
{ "filename": "get_speedups.py", "repo_name": "manodeep/Corrfunc", "repo_path": "Corrfunc_extracted/Corrfunc-master/paper/scripts/get_speedups.py", "type": "Python" }
#!/usr/bin/env python from __future__ import print_function, division import numpy as np try: import pandas as pd except ImportError: pd = None try: import cPickle as pickle except ImportError: import pickle from Corrfunc.io import read_catalog import multiprocessing max_threads = multiprocess...
manodeepREPO_NAMECorrfuncPATH_START.@Corrfunc_extracted@Corrfunc-master@paper@scripts@get_speedups.py@.PATH_END.py
{ "filename": "OSystem.py", "repo_name": "bill-cotton/Obit", "repo_path": "Obit_extracted/Obit-master/ObitSystem/Obit/python/OSystem.py", "type": "Python" }
# $Id$ #----------------------------------------------------------------------- # Copyright (C) 2004-2019 # Associated Universities, Inc. Washington DC, USA. # # 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 So...
bill-cottonREPO_NAMEObitPATH_START.@Obit_extracted@Obit-master@ObitSystem@Obit@python@OSystem.py@.PATH_END.py
{ "filename": "binomialFPEffectiveness-checkpoint.ipynb", "repo_name": "stevepur/DR25-occurrence-public", "repo_path": "DR25-occurrence-public_extracted/DR25-occurrence-public-main/GKbaseline_gaiaRadCut/.ipynb_checkpoints/binomialFPEffectiveness-checkpoint.ipynb", "type": "Jupyter Notebook" }
Reliability is given by $$ R = \frac{N_{\mathrm{truePC}}}{N_{\mathrm{obsPC}}} = 1 - \frac{N_{\mathrm{obsFP}}}{N_{\mathrm{obsPC}}} \left( \frac{1 - E}{E} \right) = 1 - \frac{F_{\mathrm{obsFP}}}{F_{\mathrm{obsPC}}} \left( \frac{1 - E}{E} \right) $$ where $E = N_{\mathrm{obsFP}}/N_{\mathrm{trueFP}}$ is the false positiv...
stevepurREPO_NAMEDR25-occurrence-publicPATH_START.@DR25-occurrence-public_extracted@DR25-occurrence-public-main@GKbaseline_gaiaRadCut@.ipynb_checkpoints@binomialFPEffectiveness-checkpoint.ipynb@.PATH_END.py
{ "filename": "kepler.py", "repo_name": "clemson-cal/sailfish", "repo_path": "sailfish_extracted/sailfish-master/sailfish/physics/kepler.py", "type": "Python" }
""" Code to solve the Kepler two-body problem, and its inverse. """ from typing import NamedTuple from math import sin, cos, sqrt, atan2, pi, floor """ Newton's gravitational constant is G=1.0, so mass M really means G M. """ NEWTON_G = 1.0 class PointMass(NamedTuple): """ The mass, 2D position, and 2D velo...
clemson-calREPO_NAMEsailfishPATH_START.@sailfish_extracted@sailfish-master@sailfish@physics@kepler.py@.PATH_END.py
{ "filename": "medium_filter.py", "repo_name": "dfm/python-bls", "repo_path": "python-bls_extracted/python-bls-main/medium_filter.py", "type": "Python" }
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy import scipy.ndimage #this shit only works with DFM's injected LCs def find_da_gap_bitch(lc,pidx): gaps = [] gap = [] #pr #print lc[:,pidx] #flux = lc[:,pidx] flux = lc for i in range(len(lc)-1): if numpy.isnan(flux...
dfmREPO_NAMEpython-blsPATH_START.@python-bls_extracted@python-bls-main@medium_filter.py@.PATH_END.py
{ "filename": "_font.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/waterfall/hoverlabel/_font.py", "type": "Python" }
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Font(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "waterfall.hoverlabel" _path_str = "waterfall.hoverlabel.font" _valid_props = {"color", "colors...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@waterfall@hoverlabel@_font.py@.PATH_END.py
{ "filename": "error.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/fonttools/fontTools/voltLib/error.py", "type": "Python" }
class VoltLibError(Exception): def __init__(self, message, location): Exception.__init__(self, message) self.location = location def __str__(self): message = Exception.__str__(self) if self.location: path, line, column = self.location return "%s:%d:%d: %s...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@fonttools@fontTools@voltLib@error.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "Keck-DataReductionPipelines/KPF-Pipeline", "repo_path": "KPF-Pipeline_extracted/KPF-Pipeline-master/kpfpipe/models/metadata/__init__.py", "type": "Python" }
Keck-DataReductionPipelinesREPO_NAMEKPF-PipelinePATH_START.@KPF-Pipeline_extracted@KPF-Pipeline-master@kpfpipe@models@metadata@__init__.py@.PATH_END.py
{ "filename": "_width.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/surface/contours/z/_width.py", "type": "Python" }
import _plotly_utils.basevalidators class WidthValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="width", parent_name="surface.contours.z", **kwargs): super(WidthValidator, 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@surface@contours@z@_width.py@.PATH_END.py
{ "filename": "vis_header.py", "repo_name": "OxfordSKA/OSKAR", "repo_path": "OSKAR_extracted/OSKAR-master/python/oskar/vis_header.py", "type": "Python" }
# -*- coding: utf-8 -*- # # Copyright (c) 2016-2020, The University of Oxford # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright...
OxfordSKAREPO_NAMEOSKARPATH_START.@OSKAR_extracted@OSKAR-master@python@oskar@vis_header.py@.PATH_END.py
{ "filename": "_hoverinfo.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/heatmapgl/_hoverinfo.py", "type": "Python" }
import _plotly_utils.basevalidators class HoverinfoValidator(_plotly_utils.basevalidators.FlaglistValidator): def __init__(self, plotly_name="hoverinfo", parent_name="heatmapgl", **kwargs): super(HoverinfoValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@heatmapgl@_hoverinfo.py@.PATH_END.py
{ "filename": "CONTRIBUTING.md", "repo_name": "RadioAstronomySoftwareGroup/pyuvdata", "repo_path": "pyuvdata_extracted/pyuvdata-main/.github/CONTRIBUTING.md", "type": "Markdown" }
# Contributing to pyuvdata Thank you for considering contributing to pyuvdata! It's our community of users and contributors that makes pyuvdata powerful and relevant. pyuvdata is an open source project, driven by our community of contributors. There are many ways to contribute, including writing tutorials, improving ...
RadioAstronomySoftwareGroupREPO_NAMEpyuvdataPATH_START.@pyuvdata_extracted@pyuvdata-main@.github@CONTRIBUTING.md@.PATH_END.py
{ "filename": "OErr.py", "repo_name": "bill-cotton/Obit", "repo_path": "Obit_extracted/Obit-master/ObitSystem/Obit/python/OErr.py", "type": "Python" }
# $Id$ #----------------------------------------------------------------------- # Copyright (C) 2004,2019 # Associated Universities, Inc. Washington DC, USA. # # 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 So...
bill-cottonREPO_NAMEObitPATH_START.@Obit_extracted@Obit-master@ObitSystem@Obit@python@OErr.py@.PATH_END.py
{ "filename": "kitti.py", "repo_name": "pytorch/vision", "repo_path": "vision_extracted/vision-main/torchvision/datasets/kitti.py", "type": "Python" }
import csv import os from pathlib import Path from typing import Any, Callable, List, Optional, Tuple, Union from PIL import Image from .utils import download_and_extract_archive from .vision import VisionDataset class Kitti(VisionDataset): """`KITTI <http://www.cvlibs.net/datasets/kitti/eval_object.php?obj_ben...
pytorchREPO_NAMEvisionPATH_START.@vision_extracted@vision-main@torchvision@datasets@kitti.py@.PATH_END.py
{ "filename": "shot_sensitivity.py", "repo_name": "HETDEX/hetdex_api", "repo_path": "hetdex_api_extracted/hetdex_api-master/hetdex_api/flux_limits/shot_sensitivity.py", "type": "Python" }
""" Unlike the sensitivity cubes, this module generates flux limit estimates on the fly from the Fiber class. AUTHOR: Daniel Farrow """ import logging from os.path import isfile, join from tempfile import NamedTemporaryFile from numpy import (arange, meshgrid, ones, array, sum, sqrt, square, newaxis, ...
HETDEXREPO_NAMEhetdex_apiPATH_START.@hetdex_api_extracted@hetdex_api-master@hetdex_api@flux_limits@shot_sensitivity.py@.PATH_END.py
{ "filename": "ssh_cluster.py", "repo_name": "lsst-uk/lasair-lsst", "repo_path": "lasair-lsst_extracted/lasair-lsst-main/utility/parallel/ssh_cluster.py", "type": "Python" }
""" Make a cluster from nodes, where you can ssh to any node from the head node with no auth. The input is a set of hosts and a set of commands to be executed on them. Uses the parallel-SSH library https://pypi.org/project/parallel-ssh/ To see how it works, try the "busy" example WARNING: there is a ~60 second lag betw...
lsst-ukREPO_NAMElasair-lsstPATH_START.@lasair-lsst_extracted@lasair-lsst-main@utility@parallel@ssh_cluster.py@.PATH_END.py
{ "filename": "main.py", "repo_name": "cdslaborg/paramonte", "repo_path": "paramonte_extracted/paramonte-main/benchmark/fortran/pm_sampleCov/setCov_vs_setCovMean/main.py", "type": "Python" }
#!/usr/bin/env python import matplotlib.pyplot as plt import pandas as pd import numpy as np import os dirname = os.path.basename(os.getcwd()) fontsize = 14 df = pd.read_csv("main.out", delimiter = ",") colnames = list(df.columns.values) ############################################################################...
cdslaborgREPO_NAMEparamontePATH_START.@paramonte_extracted@paramonte-main@benchmark@fortran@pm_sampleCov@setCov_vs_setCovMean@main.py@.PATH_END.py
{ "filename": "io.py", "repo_name": "yt-project/yt", "repo_path": "yt_extracted/yt-main/yt/frontends/amrvac/io.py", "type": "Python" }
""" AMRVAC-specific IO functions """ import os import numpy as np from more_itertools import always_iterable from yt.geometry.selection_routines import GridSelector from yt.utilities.io_handler import BaseIOHandler from yt.utilities.on_demand_imports import _f90nml as f90nml def read_amrvac_namelist(parfiles): ...
yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@frontends@amrvac@io.py@.PATH_END.py
{ "filename": "processOSPREI.py", "repo_name": "ckay314/OSPREI", "repo_path": "OSPREI_extracted/OSPREI-master/processCode/processOSPREI.py", "type": "Python" }
import numpy as np import math import matplotlib.pyplot as plt from matplotlib import cm, colors from mpl_toolkits.axes_grid1 import make_axes_locatable import sys import os from scipy.interpolate import CubicSpline from scipy.stats import norm, pearsonr from scipy import ndimage import datetime import matplotlib.dates...
ckay314REPO_NAMEOSPREIPATH_START.@OSPREI_extracted@OSPREI-master@processCode@processOSPREI.py@.PATH_END.py
{ "filename": "test_sersic_highn_alias2.py", "repo_name": "GalSim-developers/GalSim", "repo_path": "GalSim_extracted/GalSim-main/devel/external/test_sersic_highn/test_sersic_highn_alias2.py", "type": "Python" }
# Copyright (c) 2012-2023 by the GalSim developers team on GitHub # https://github.com/GalSim-developers # # This file is part of GalSim: The modular galaxy image simulation toolkit. # https://github.com/GalSim-developers/GalSim # # GalSim is free software: redistribution and use in source and binary forms, # with or w...
GalSim-developersREPO_NAMEGalSimPATH_START.@GalSim_extracted@GalSim-main@devel@external@test_sersic_highn@test_sersic_highn_alias2.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/isosurface/hoverlabel/font/_shadow.py", "type": "Python" }
import _plotly_utils.basevalidators class ShadowValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="shadow", parent_name="isosurface.hoverlabel.font", **kwargs ): super(ShadowValidator, self).__init__( plotly_name=plotly_name, paren...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@isosurface@hoverlabel@font@_shadow.py@.PATH_END.py
{ "filename": "combine_match_results.py", "repo_name": "samuelyeewl/specmatch-emp", "repo_path": "specmatch-emp_extracted/specmatch-emp-master/tests/combine_match_results.py", "type": "Python" }
#!/usr/bin/env python import pandas as pd import os import sys import re from argparse import ArgumentParser from specmatchemp import library if __name__ == '__main__': # Argument parser psr = ArgumentParser(description="Combine match results") psr.add_argument('libpath', type=str, help="Path to library ...
samuelyeewlREPO_NAMEspecmatch-empPATH_START.@specmatch-emp_extracted@specmatch-emp-master@tests@combine_match_results.py@.PATH_END.py
{ "filename": "bandpass_calibration.py", "repo_name": "RTIP/artip", "repo_path": "artip_extracted/artip-master/casa_scripts/bandpass_calibration.py", "type": "Python" }
import sys script_parameters_start_index = sys.argv.index('-c') + 2 parameters = sys.argv[script_parameters_start_index:] ms_dataset = parameters[0] output_path = parameters[1] field = parameters[2] refant = parameters[3] solint = float(parameters[4]) phase_calib_minsnr = float(parameters[5]) phase_calib_solint = flo...
RTIPREPO_NAMEartipPATH_START.@artip_extracted@artip-master@casa_scripts@bandpass_calibration.py@.PATH_END.py
{ "filename": "_z.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/surface/contours/_z.py", "type": "Python" }
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Z(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "surface.contours" _path_str = "surface.contours.z" _valid_props = { "color", "end...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@surface@contours@_z.py@.PATH_END.py
{ "filename": "_scalegroup.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/funnelarea/_scalegroup.py", "type": "Python" }
import _plotly_utils.basevalidators class ScalegroupValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="scalegroup", parent_name="funnelarea", **kwargs): super(ScalegroupValidator, 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@funnelarea@_scalegroup.py@.PATH_END.py
{ "filename": "polynomial.py", "repo_name": "waynebhayes/SpArcFiRe", "repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/numpy/lib/polynomial.py", "type": "Python" }
""" Functions to operate on polynomials. """ from __future__ import division, absolute_import, print_function __all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd', 'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d', 'polyfit', 'RankWarning'] import re import warnings import numpy.core....
waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@numpy@lib@polynomial.py@.PATH_END.py
{ "filename": "profiles.py", "repo_name": "gammapy/gammapy", "repo_path": "gammapy_extracted/gammapy-main/gammapy/astro/darkmatter/profiles.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Dark matter profiles.""" import abc import html import numpy as np import astropy.units as u from gammapy.modeling import Parameter, Parameters from gammapy.utils.integrate import trapz_loglog __all__ = [ "BurkertProfile", "DMProfile", "Ein...
gammapyREPO_NAMEgammapyPATH_START.@gammapy_extracted@gammapy-main@gammapy@astro@darkmatter@profiles.py@.PATH_END.py
{ "filename": "jobs.py", "repo_name": "PrefectHQ/prefect", "repo_path": "prefect_extracted/prefect-main/src/integrations/prefect-dbt/prefect_dbt/cloud/jobs.py", "type": "Python" }
"""Module containing tasks and flows for interacting with dbt Cloud jobs""" import asyncio import shlex import time from json import JSONDecodeError from typing import Any, Awaitable, Callable, Dict, List, Optional, Union from httpx import HTTPStatusError from pydantic import Field from typing_extensions import Liter...
PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@integrations@prefect-dbt@prefect_dbt@cloud@jobs.py@.PATH_END.py
{ "filename": "simulations.py", "repo_name": "smsharma/dark-photons-perturbations", "repo_path": "dark-photons-perturbations_extracted/dark-photons-perturbations-master/grf/simulations.py", "type": "Python" }
import numpy as np import pandas as pd from scipy.interpolate import interp1d from scipy.misc import derivative import astropy.units as u import astropy.constants as c from astropy.cosmology import FlatLambdaCDM, z_at_value from tqdm import * from grf.grf import TransitionProbabilities from classy import Class from nb...
smsharmaREPO_NAMEdark-photons-perturbationsPATH_START.@dark-photons-perturbations_extracted@dark-photons-perturbations-master@grf@simulations.py@.PATH_END.py
{ "filename": "test_base_standard.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/partners/openai/tests/integration_tests/embeddings/test_base_standard.py", "type": "Python" }
"""Standard LangChain interface tests""" from typing import Type from langchain_core.embeddings import Embeddings from langchain_tests.integration_tests.embeddings import EmbeddingsIntegrationTests from langchain_openai import OpenAIEmbeddings class TestOpenAIStandard(EmbeddingsIntegrationTests): @property ...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@partners@openai@tests@integration_tests@embeddings@test_base_standard.py@.PATH_END.py
{ "filename": "_selected.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/scattersmith/_selected.py", "type": "Python" }
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Selected(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "scattersmith" _path_str = "scattersmith.selected" _valid_props = {"marker", "textfont"} ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@scattersmith@_selected.py@.PATH_END.py
{ "filename": "test_patching.py", "repo_name": "neuraloperator/neuraloperator", "repo_path": "neuraloperator_extracted/neuraloperator-main/neuralop/training/tests/test_patching.py", "type": "Python" }
import torch import pytest from ..patching import MultigridPatching2D, make_patches from neuralop.tests.test_utils import DummyModel # Input shape params batch_size = 16 channels = 1 side_len = 128 @pytest.mark.parametrize('levels', [1, 2, 3]) @pytest.mark.parametrize('padding_fraction', [0, 0.1, 0.2]) def test_make...
neuraloperatorREPO_NAMEneuraloperatorPATH_START.@neuraloperator_extracted@neuraloperator-main@neuralop@training@tests@test_patching.py@.PATH_END.py
{ "filename": "_line.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/selection/_line.py", "type": "Python" }
import _plotly_utils.basevalidators class LineValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="line", parent_name="layout.selection", **kwargs): super(LineValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@selection@_line.py@.PATH_END.py
{ "filename": "regrid.py", "repo_name": "sherpa/sherpa", "repo_path": "sherpa_extracted/sherpa-main/sherpa/models/regrid.py", "type": "Python" }
# -*- coding: utf-8 -*- # Copyright (C) 2017 - 2024 # Smithsonian Astrophysical Observatory # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at yo...
sherpaREPO_NAMEsherpaPATH_START.@sherpa_extracted@sherpa-main@sherpa@models@regrid.py@.PATH_END.py
{ "filename": "lscsn.py", "repo_name": "LCOGT/lcogtsnpipe", "repo_path": "lcogtsnpipe_extracted/lcogtsnpipe-master/trunk/bin/lscsn.py", "type": "Python" }
#!/usr/bin/env python description = ">> New automated sn measurement" usage = "%prog image [options] " import time from numpy import array,log10 import numpy as np import lsc import glob import os import sys import shutil import string import re from astropy.io.fits import getheader from astropy.io import fits from op...
LCOGTREPO_NAMElcogtsnpipePATH_START.@lcogtsnpipe_extracted@lcogtsnpipe-master@trunk@bin@lscsn.py@.PATH_END.py
{ "filename": "cris.py", "repo_name": "spedas/pyspedas", "repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/ace/cris.py", "type": "Python" }
from .load import load from pytplot import options from pyspedas.utilities.datasets import find_datasets # This routine was originally in ace/__init__.py, until being moved to its own file. # Please refer to __init__.py if you need to see the revision history before it was moved. def cris(trange=['2018-11-5', '2018-1...
spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@ace@cris.py@.PATH_END.py
{ "filename": "adclass.py", "repo_name": "GeminiDRSoftware/DRAGONS", "repo_path": "DRAGONS_extracted/DRAGONS-master/gemini_instruments/gpi/adclass.py", "type": "Python" }
from astrodata import astro_data_tag, astro_data_descriptor, TagSet from ..gemini import AstroDataGemini class AstroDataGpi(AstroDataGemini): __keyword_dict = dict(array_section='DATASEC', detector_section='DATASEC', exposure_time='ITIME', ...
GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@gemini_instruments@gpi@adclass.py@.PATH_END.py
{ "filename": "CustomHotRegion_Accreting.py", "repo_name": "xpsi-group/xpsi", "repo_path": "xpsi_extracted/xpsi-main/examples/examples_modeling_tutorial/modules/CustomHotRegion_Accreting.py", "type": "Python" }
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jun 6 16:46:36 2024 @author: bas """ import xpsi from xpsi import Parameter import numpy as np class CustomHotRegion_Accreting(xpsi.HotRegion): """Custom implementation of HotRegion. Accreting Atmosphere model by Anna Bobrikova. The paramete...
xpsi-groupREPO_NAMExpsiPATH_START.@xpsi_extracted@xpsi-main@examples@examples_modeling_tutorial@modules@CustomHotRegion_Accreting.py@.PATH_END.py
{ "filename": "version.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py2/scipy/version.py", "type": "Python" }
# THIS FILE IS GENERATED FROM SCIPY SETUP.PY short_version = '1.2.3' version = '1.2.3' full_version = '1.2.3' git_revision = 'bc29b5bf5f8a1f5370407a4e33005277a53ef40b' release = True if not release: version = full_version
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py2@scipy@version.py@.PATH_END.py
{ "filename": "_colorsrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/waterfall/hoverlabel/font/_colorsrc.py", "type": "Python" }
import _plotly_utils.basevalidators class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="colorsrc", parent_name="waterfall.hoverlabel.font", **kwargs ): super(ColorsrcValidator, self).__init__( plotly_name=plotly_name, par...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@waterfall@hoverlabel@font@_colorsrc.py@.PATH_END.py
{ "filename": "_legend.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/ohlc/_legend.py", "type": "Python" }
import _plotly_utils.basevalidators class LegendValidator(_plotly_utils.basevalidators.SubplotidValidator): def __init__(self, plotly_name="legend", parent_name="ohlc", **kwargs): super(LegendValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, d...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@ohlc@_legend.py@.PATH_END.py
{ "filename": "test_foregrounds.py", "repo_name": "HERA-Team/hera_sim", "repo_path": "hera_sim_extracted/hera_sim-main/hera_sim/tests/test_foregrounds.py", "type": "Python" }
import pytest import numpy as np from astropy import units from contextlib import ExitStack as does_not_raise from uvtools.utils import FFT, fourier_freqs from hera_sim import DATA_PATH, foregrounds from hera_sim.interpolators import Beam, Tsky @pytest.fixture(scope="function") def omega_p(): beamfile = DATA_PA...
HERA-TeamREPO_NAMEhera_simPATH_START.@hera_sim_extracted@hera_sim-main@hera_sim@tests@test_foregrounds.py@.PATH_END.py
{ "filename": "ticket.py", "repo_name": "crossbario/crossbar", "repo_path": "crossbar_extracted/crossbar-master/crossbar/router/auth/ticket.py", "type": "Python" }
##################################################################################### # # Copyright (c) typedef int GmbH # SPDX-License-Identifier: EUPL-1.2 # ##################################################################################### from typing import Union, Dict, Any from txaio import make_logger, as_f...
crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@crossbar@router@auth@ticket.py@.PATH_END.py