metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "multiprocess_test_deconfuser.py",
"repo_name": "MIT-STARLab/deconfuser",
"repo_path": "deconfuser_extracted/deconfuser-main/multiprocess_test_deconfuser.py",
"type": "Python"
} | import numpy as np
import multiprocessing
import itertools
import argparse
import os
import deconfuser.sample_planets as sample_planets
import deconfuser.orbit_fitting as orbit_fitting
import deconfuser.orbit_grouping as orbit_grouping
import deconfuser.partition_ranking as partition_ranking
mu_sun = 4*np.pi**2 #Sun'... | MIT-STARLabREPO_NAMEdeconfuserPATH_START.@deconfuser_extracted@deconfuser-main@multiprocess_test_deconfuser.py@.PATH_END.py |
{
"filename": "test_close_scene.py",
"repo_name": "enthought/mayavi",
"repo_path": "mayavi_extracted/mayavi-master/integrationtests/mayavi/test_close_scene.py",
"type": "Python"
} | #!/usr/bin/env mayavi2
# Author: Prabhu Ramachandran <prabhu [at] aero . iitb . ac . in>
# Copyright (c) 2008, Prabhu Ramachandran
# License: BSD Style.
"""This tests that closing a hidden TVTK scene window does not crash or
raise PyDeadObjectErrors.
"""
from common import TestCase
class TestCloseScene(TestCase):
... | enthoughtREPO_NAMEmayaviPATH_START.@mayavi_extracted@mayavi-master@integrationtests@mayavi@test_close_scene.py@.PATH_END.py |
{
"filename": "funcs.py",
"repo_name": "jtdinsmore/leakagelib",
"repo_path": "leakagelib_extracted/leakagelib-main/src/funcs.py",
"type": "Python"
} | import numpy as np
from scipy.interpolate import RegularGridInterpolator
from .settings import *
KERNEL_ZS = np.array([
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 1, 0,-4, 0, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0],
... | jtdinsmoreREPO_NAMEleakagelibPATH_START.@leakagelib_extracted@leakagelib-main@src@funcs.py@.PATH_END.py |
{
"filename": "idl_function.py",
"repo_name": "SAIL-Labs/AMICAL",
"repo_path": "AMICAL_extracted/AMICAL-main/amical/mf_pipeline/idl_function.py",
"type": "Python"
} | """
@author: Anthony Soulain (University of Sydney)
-------------------------------------------------------------------------
AMICAL: Aperture Masking Interferometry Calibration and Analysis Library
-------------------------------------------------------------------------
Matched filter sub-pipeline method.
All requ... | SAIL-LabsREPO_NAMEAMICALPATH_START.@AMICAL_extracted@AMICAL-main@amical@mf_pipeline@idl_function.py@.PATH_END.py |
{
"filename": "test_convolution.py",
"repo_name": "sibirrer/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_ImSim/test_Numerics/test_convolution.py",
"type": "Python"
} | __author__ = "sibirrer"
import numpy as np
import numpy.testing as npt
from lenstronomy.ImSim.Numerics.convolution import (
MultiGaussianConvolution,
PixelKernelConvolution,
SubgridKernelConvolution,
MGEConvolution,
)
from lenstronomy.LightModel.light_model import LightModel
import lenstronomy.Util.uti... | sibirrerREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_ImSim@test_Numerics@test_convolution.py@.PATH_END.py |
{
"filename": "base.py",
"repo_name": "ML4GW/amplfi",
"repo_path": "amplfi_extracted/amplfi-main/amplfi/train/data/datasets/base.py",
"type": "Python"
} | import logging
import os
import sys
from typing import Dict, List, Optional, Sequence
import h5py
import lightning.pytorch as pl
import torch
from ml4gw.dataloading import Hdf5TimeSeriesDataset, InMemoryDataset
from ml4gw.transforms import ChannelWiseScaler, Whiten
from ...augmentations import PsdEstimator, WaveformP... | ML4GWREPO_NAMEamplfiPATH_START.@amplfi_extracted@amplfi-main@amplfi@train@data@datasets@base.py@.PATH_END.py |
{
"filename": "simRTC.py",
"repo_name": "jacotay7/pyRTC",
"repo_path": "pyRTC_extracted/pyRTC-main/examples/scao/simRTC.py",
"type": "Python"
} | # %% Imports
import matplotlib.pyplot as plt
import time
from tqdm import tqdm
#%%
import sys
tmp = sys.stdout
from pyRTC import *
from pyRTC.hardware.OOPAOInterface import OOPAOInterface
from OOPAO.calibration.compute_KL_modal_basis import compute_KL_basis
RECALIBRATE = False
sys.stdout = tmp
import logging
import mat... | jacotay7REPO_NAMEpyRTCPATH_START.@pyRTC_extracted@pyRTC-main@examples@scao@simRTC.py@.PATH_END.py |
{
"filename": "report_header.md",
"repo_name": "litebird/litebird_sim",
"repo_path": "litebird_sim_extracted/litebird_sim-master/templates/report_header.md",
"type": "Markdown"
} | # {{ name }}
{% if description -%}
{{description}}
{% endif %}
The simulation starts at t0={{ start_time }} and lasts {{ duration_s
}} seconds.
The seed used for the random number generator is {{ random_seed }}.
[TOC]
| litebirdREPO_NAMElitebird_simPATH_START.@litebird_sim_extracted@litebird_sim-master@templates@report_header.md@.PATH_END.py |
{
"filename": "_cornerradius.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/treemap/marker/_cornerradius.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CornerradiusValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="cornerradius", parent_name="treemap.marker", **kwargs
):
super(CornerradiusValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@treemap@marker@_cornerradius.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "Fermipy/fermipy",
"repo_path": "fermipy_extracted/fermipy-master/fermipy/__init__.py",
"type": "Python"
} | from __future__ import absolute_import, division, print_function
import os
import subprocess
__version__ = "unknown"
try:
from .version import get_git_version
__version__ = get_git_version()
except Exception as message:
print(message)
__author__ = "Matthew Wood"
try:
import pyLikelihood
except Impor... | FermipyREPO_NAMEfermipyPATH_START.@fermipy_extracted@fermipy-master@fermipy@__init__.py@.PATH_END.py |
{
"filename": "conditional_abunmatch_bin_based.py",
"repo_name": "astropy/halotools",
"repo_path": "halotools_extracted/halotools-master/halotools/empirical_models/abunmatch/conditional_abunmatch_bin_based.py",
"type": "Python"
} | """ Module storing the Numpy kernel for conditional abundance matching
"""
import numpy as np
from astropy.utils import NumpyRNGContext
from ...utils import inverse_transformation_sampling as its
from ...utils import unsorting_indices
__author__ = ('Andrew Hearin', 'Duncan Campbell')
__all__ = ('conditional_abunmatch... | astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@halotools@empirical_models@abunmatch@conditional_abunmatch_bin_based.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/agents/agent_toolkits/sql/__init__.py",
"type": "Python"
} | """SQL agent."""
| langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@agents@agent_toolkits@sql@__init__.py@.PATH_END.py |
{
"filename": "_dtickrange.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/polar/radialaxis/tickformatstop/_dtickrange.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class DtickrangeValidator(_plotly_utils.basevalidators.InfoArrayValidator):
def __init__(
self,
plotly_name="dtickrange",
parent_name="layout.polar.radialaxis.tickformatstop",
**kwargs,
):
super(DtickrangeValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@polar@radialaxis@tickformatstop@_dtickrange.py@.PATH_END.py |
{
"filename": "fits_array_code.py",
"repo_name": "myrafproject/myrafproject",
"repo_path": "myrafproject_extracted/myrafproject-main/source/code/fits_array_code.py",
"type": "Python"
} | from myraflib import FitsArray
fa = FitsArray.from_pattern("PATTERN/OF/FILES/*.fits")
fa.hedit(
["Ke1y", "Key2"], ["Value1", "Value2"], ["Comment1", "Comment2"]
)
aligned_fa = fa.align(reference=0)
| myrafprojectREPO_NAMEmyrafprojectPATH_START.@myrafproject_extracted@myrafproject-main@source@code@fits_array_code.py@.PATH_END.py |
{
"filename": "creating_databases.py",
"repo_name": "DebduttaPaul/luminosity_function_of_sGRBs",
"repo_path": "luminosity_function_of_sGRBs_extracted/luminosity_function_of_sGRBs-master/creating_databases.py",
"type": "Python"
} | from __future__ import division
from astropy.io import ascii
from astropy.table import Table
from scipy.stats import pearsonr as R
from scipy.stats import spearmanr as S
from scipy.stats import kendalltau as T
from scipy.optimize import curve_fit
from scipy.integrate import quad
import debduttaS_functions as mf
import ... | DebduttaPaulREPO_NAMEluminosity_function_of_sGRBsPATH_START.@luminosity_function_of_sGRBs_extracted@luminosity_function_of_sGRBs-master@creating_databases.py@.PATH_END.py |
{
"filename": "_sizemode.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterpolargl/marker/_sizemode.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizemodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="sizemode", parent_name="scatterpolargl.marker", **kwargs
):
super(SizemodeValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterpolargl@marker@_sizemode.py@.PATH_END.py |
{
"filename": "sequential.py",
"repo_name": "astroufsc/chimera",
"repo_path": "chimera_extracted/chimera-master/src/chimera/controllers/scheduler/sequential.py",
"type": "Python"
} | from chimera.controllers.scheduler.ischeduler import IScheduler
from chimera.controllers.scheduler.model import Session, Program
from sqlalchemy import desc
import logging
log = logging.getLogger(__name__)
from queue import Queue
class SequentialScheduler(IScheduler):
def __init__(self):
self.rq = No... | astroufscREPO_NAMEchimeraPATH_START.@chimera_extracted@chimera-master@src@chimera@controllers@scheduler@sequential.py@.PATH_END.py |
{
"filename": "fitclass.py",
"repo_name": "rychallener/ThERESA",
"repo_path": "ThERESA_extracted/ThERESA-master/theresa/lib/fitclass.py",
"type": "Python"
} | import os
import sys
import numpy as np
import pickle
import configparser as cp
import configclass as cc
import scipy.constants as sc
import utils
class Fit:
"""
A class to hold attributes and methods related to fitting a model
or set of models to data.
"""
def read_config(self, cfile):
""... | rychallenerREPO_NAMEThERESAPATH_START.@ThERESA_extracted@ThERESA-master@theresa@lib@fitclass.py@.PATH_END.py |
{
"filename": "drivers.py",
"repo_name": "simonsobs/socs",
"repo_path": "socs_extracted/socs-main/socs/agents/scpi_psu/drivers.py",
"type": "Python"
} | # Tucker Elleflot
import socket
import time
from socs.common.prologix_interface import PrologixInterface
# append new model strings as needed
ONE_CHANNEL_MODELS = ['2280S-60-3', '2280S-32-6', '9171',
'9172', '9181', '9182', '9183', '9184', '9185']
TWO_CHANNEL_MODELS = ['9173', '9174']
THREE_CHA... | simonsobsREPO_NAMEsocsPATH_START.@socs_extracted@socs-main@socs@agents@scpi_psu@drivers.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "MichelleLochner/astronomaly",
"repo_path": "astronomaly_extracted/astronomaly-main/setup.py",
"type": "Python"
} | import setuptools
import re
import os
VERSIONFILE = os.path.join("astronomaly", "_version.py")
verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
verstr = mo.group(1)
else:
raise RuntimeError("Unable to find version string in %... | MichelleLochnerREPO_NAMEastronomalyPATH_START.@astronomaly_extracted@astronomaly-main@setup.py@.PATH_END.py |
{
"filename": "kernelIntegrals.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/tests/unit/Kernel/kernelIntegrals.py",
"type": "Python"
} | # Test out integrating kernels that are half-filled.
from math import *
from Spheral import *
class Wintegral(ScalarFunctor):
def __init__(self, W, ndim, useGradientAsKernel):
assert ndim in (1, 2, 3)
self.W = W
self.ndim = ndim
self.useGradientAsKernel = useGradientAsKernel
... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@tests@unit@Kernel@kernelIntegrals.py@.PATH_END.py |
{
"filename": "folded.py",
"repo_name": "pyro-ppl/pyro",
"repo_path": "pyro_extracted/pyro-master/pyro/distributions/folded.py",
"type": "Python"
} | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
from torch.distributions import constraints
from torch.distributions.transforms import AbsTransform
from pyro.distributions.torch import TransformedDistribution
class FoldedDistribution(TransformedDistribution):
"""
Equi... | pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@pyro@distributions@folded.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/jedi/py2/jedi/evaluate/context/__init__.py",
"type": "Python"
} | from jedi.evaluate.context.module import ModuleContext
from jedi.evaluate.context.klass import ClassContext
from jedi.evaluate.context.function import FunctionContext, FunctionExecutionContext
from jedi.evaluate.context.instance import AnonymousInstance, BoundMethod, \
CompiledInstance, AbstractInstanceContext, Tre... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@jedi@py2@jedi@evaluate@context@__init__.py@.PATH_END.py |
{
"filename": "ring.py",
"repo_name": "mpi4py/mpi4py",
"repo_path": "mpi4py_extracted/mpi4py-master/demo/profiling/ring.py",
"type": "Python"
} | #!/usr/bin/env python
if False:
import mpi4py
name = "name" # lib{name}.so
path = []
mpi4py.profile(name, path=path)
from mpi4py import MPI
comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
src = rank-1
dest = rank+1
if rank == 0:
src = size-1
if rank == size-1:
dest = 0
... | mpi4pyREPO_NAMEmpi4pyPATH_START.@mpi4py_extracted@mpi4py-master@demo@profiling@ring.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/__init__.py",
"type": "Python"
} | # Copyright 2015 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@__init__.py@.PATH_END.py |
{
"filename": "Untitled-checkpoint.ipynb",
"repo_name": "stevepur/DR25-occurrence-public",
"repo_path": "DR25-occurrence-public_extracted/DR25-occurrence-public-main/GKbaseline_gaiaRadCut/.ipynb_checkpoints/Untitled-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | ```python
import numpy as np
import requests
import pandas as pd
import matplotlib.pyplot as plt
from scipy.interpolate import griddata
import matplotlib.patches as patches
```
```python
stellarCatalog =
stellarCatalog =
pcCatalog = "koiCatalogs/dr25_GK_PCs.csv"
period_rng = (50, 400)
rp_rng = (0.75, 2.5)
bergerG... | stevepurREPO_NAMEDR25-occurrence-publicPATH_START.@DR25-occurrence-public_extracted@DR25-occurrence-public-main@GKbaseline_gaiaRadCut@.ipynb_checkpoints@Untitled-checkpoint.ipynb@.PATH_END.py |
{
"filename": "results_arma.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/tsa/tests/results/results_arma.py",
"type": "Python"
} | """
Results for ARMA models. Produced by gretl.
"""
import os
from numpy import genfromtxt
current_path = os.path.dirname(os.path.abspath(__file__))
with open(current_path+"/yhat_exact_nc.csv", "rb") as fd:
yhat_mle = genfromtxt(fd, delimiter=",", skip_header=1, dtype=float)
with open(current_path+"/yhat_css_nc... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@tsa@tests@results@results_arma.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "D-arioSpace/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/esa/iso/tests/__init__.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
=====================
ISO Astroquery Module
=====================
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
"""
| D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@esa@iso@tests@__init__.py@.PATH_END.py |
{
"filename": "pysep.py",
"repo_name": "sdss/lvmagp",
"repo_path": "lvmagp_extracted/lvmagp-main/python/lvmagp/images/processors/detection/pysep.py",
"type": "Python"
} | import asyncio
from functools import partial
from typing import Tuple, TYPE_CHECKING, Any, Optional
from astropy.table import Table, Column
import logging
import numpy as np
import numpy.typing as npt
import pandas as pd
from .sourcedetection import SourceDetection
from lvmagp.images import Image
if TYPE_CHECKING:
... | sdssREPO_NAMElvmagpPATH_START.@lvmagp_extracted@lvmagp-main@python@lvmagp@images@processors@detection@pysep.py@.PATH_END.py |
{
"filename": "_title.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/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... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattermap@marker@colorbar@_title.py@.PATH_END.py |
{
"filename": "test_diagonal_cosmo_bnn_prior.py",
"repo_name": "jiwoncpark/baobab",
"repo_path": "baobab_extracted/baobab-master/baobab/tests/test_bnn_priors/test_diagonal_cosmo_bnn_prior.py",
"type": "Python"
} | import unittest
class TestDiagonalCosmoBNNPrior(unittest.TestCase):
"""A suite of tests alerting us for breakge, e.g. errors in
instantiation of classes or execution of scripts, for DiagonalBNNPrior
"""
def test_tdlmc_diagonal_cosmo_config(self):
"""Tests instantiation of TDLMC diagonal Config... | jiwoncparkREPO_NAMEbaobabPATH_START.@baobab_extracted@baobab-master@baobab@tests@test_bnn_priors@test_diagonal_cosmo_bnn_prior.py@.PATH_END.py |
{
"filename": "_fields.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/hypothesis/py3/hypothesis/extra/django/_fields.py",
"type": "Python"
} | # This file is part of Hypothesis, which may be found at
# https://github.com/HypothesisWorks/hypothesis/
#
# Copyright the Hypothesis Authors.
# Individual contributors are listed in AUTHORS.rst and the git log.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@hypothesis@py3@hypothesis@extra@django@_fields.py@.PATH_END.py |
{
"filename": "LICENSE.md",
"repo_name": "kboone/avocado",
"repo_path": "avocado_extracted/avocado-master/LICENSE.md",
"type": "Markdown"
} | MIT License
Copyright (c) 2019 Kyle Boone
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distri... | kbooneREPO_NAMEavocadoPATH_START.@avocado_extracted@avocado-master@LICENSE.md@.PATH_END.py |
{
"filename": "Comentarios_paper-checkpoint.ipynb",
"repo_name": "Monsalves-Gonzalez-N/Paper_OGLE",
"repo_path": "Paper_OGLE_extracted/Paper_OGLE-main/.ipynb_checkpoints/Comentarios_paper-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | ```python
# Importaciones de bibliotecas estándar
# Importaciones de bibliotecas de sistema
import os
import gc
import time
import shutil
# Importaciones de bibliotecas de terceros
import wget
import scipy.signal
import h5py
import psutil
import ray
# Importaciones de TensorFlow
import tensorflow as tf
from tensorflo... | Monsalves-Gonzalez-NREPO_NAMEPaper_OGLEPATH_START.@Paper_OGLE_extracted@Paper_OGLE-main@.ipynb_checkpoints@Comentarios_paper-checkpoint.ipynb@.PATH_END.py |
{
"filename": "_btype.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/contourcarpet/_btype.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BtypeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="btype", parent_name="contourcarpet", **kwargs):
super(BtypeValidator, 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@contourcarpet@_btype.py@.PATH_END.py |
{
"filename": "extract_problempar.py",
"repo_name": "piernik-dev/piernik",
"repo_path": "piernik_extracted/piernik-master/python/extract_problempar.py",
"type": "Python"
} | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import h5py
from colored_io import die, prtinfo, prtwarn
# This script reads problem.par field from provided
# h5/res file, extracts it and saves it in CWD,
# so it can be used in new run.
if (len(sys.argv) > 1):
hdf5_filename = sys.argv[1]
prtinf... | piernik-devREPO_NAMEpiernikPATH_START.@piernik_extracted@piernik-master@python@extract_problempar.py@.PATH_END.py |
{
"filename": "test_pickling.py",
"repo_name": "dmlc/xgboost",
"repo_path": "xgboost_extracted/xgboost-master/tests/python/test_pickling.py",
"type": "Python"
} | import json
import os
import pickle
import numpy as np
import xgboost as xgb
kRows = 100
kCols = 10
def generate_data():
X = np.random.randn(kRows, kCols)
y = np.random.randn(kRows)
return X, y
class TestPickling:
def run_model_pickling(self, xgb_params) -> str:
X, y = generate_data()
... | dmlcREPO_NAMExgboostPATH_START.@xgboost_extracted@xgboost-master@tests@python@test_pickling.py@.PATH_END.py |
{
"filename": "nvidia_riva.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/tools/nvidia_riva.ipynb",
"type": "Jupyter Notebook"
} | # NVIDIA Riva: ASR and TTS
## NVIDIA Riva
[NVIDIA Riva](https://www.nvidia.com/en-us/ai-data-science/products/riva/) is a GPU-accelerated multilingual speech and translation AI software development kit for building fully customizable, real-time conversational AI pipelines—including automatic speech recognition (ASR), ... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@tools@nvidia_riva.ipynb@.PATH_END.py |
{
"filename": "grid_potential.py",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/examples/simple/grid_potential.py",
"type": "Python"
} | # -*- coding: ascii -*-
from __future__ import print_function
from amuse.units import units, nbody_system
from amuse.datamodel import Particle
from amuse.community.athena.interface import Athena
from amuse.community.hermite.interface import Hermite
from matplotlib import pyplot
def hydro_grid_in_potential_well(mass=... | amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@examples@simple@grid_potential.py@.PATH_END.py |
{
"filename": "apero.py",
"repo_name": "njcuk9999/lbl",
"repo_path": "lbl_extracted/lbl-main/lbl/science/apero.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# CODE NAME HERE
# CODE DESCRIPTION HERE
Created on 2021-11-01
@author: cook
"""
import warnings
from typing import Tuple
import numpy as np
from lbl.core import base
from lbl.core import base_classes
from lbl.core import io
from lbl.core import math as mp
from lbl... | njcuk9999REPO_NAMElblPATH_START.@lbl_extracted@lbl-main@lbl@science@apero.py@.PATH_END.py |
{
"filename": "degradation.py",
"repo_name": "RobertJaro/InstrumentToInstrument",
"repo_path": "InstrumentToInstrument_extracted/InstrumentToInstrument-master/itipy/data/stereo/degradation.py",
"type": "Python"
} | import glob
import os
from multiprocessing import Pool
import matplotlib.pyplot as plt
import numpy as np
from dateutil.parser import parse
from tqdm import tqdm
import matplotlib.dates as mdates
from itipy.data.editor import LoadMapEditor, NormalizeRadiusEditor, MapToDataEditor, EITCheckEditor, RemoveOffLimbEditor,... | RobertJaroREPO_NAMEInstrumentToInstrumentPATH_START.@InstrumentToInstrument_extracted@InstrumentToInstrument-master@itipy@data@stereo@degradation.py@.PATH_END.py |
{
"filename": "_stream.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/contour/_stream.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Stream(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "contour"
_path_str = "contour.stream"
_valid_props = {"maxpoints", "token"}
# maxpoints... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@contour@_stream.py@.PATH_END.py |
{
"filename": "argilla.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/callbacks/argilla.ipynb",
"type": "Jupyter Notebook"
} | # Argilla
>[Argilla](https://argilla.io/) is an open-source data curation platform for LLMs.
> Using Argilla, everyone can build robust language models through faster data curation
> using both human and machine feedback. We provide support for each step in the MLOps cycle,
> from data labeling to model monitoring.
... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@callbacks@argilla.ipynb@.PATH_END.py |
{
"filename": "test_max_tree.py",
"repo_name": "scikit-image/scikit-image",
"repo_path": "scikit-image_extracted/scikit-image-main/skimage/morphology/tests/test_max_tree.py",
"type": "Python"
} | import numpy as np
from skimage.morphology import max_tree, area_closing, area_opening
from skimage.morphology import max_tree_local_maxima, diameter_opening
from skimage.morphology import diameter_closing
from skimage.util import invert
from skimage._shared.testing import assert_array_equal, TestCase
eps = 1e-12
d... | scikit-imageREPO_NAMEscikit-imagePATH_START.@scikit-image_extracted@scikit-image-main@skimage@morphology@tests@test_max_tree.py@.PATH_END.py |
{
"filename": "_hoverlabel.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/surface/_hoverlabel.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Hoverlabel(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "surface"
_path_str = "surface.hoverlabel"
_valid_props = {
"align",
"ali... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@surface@_hoverlabel.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/densitymap/colorbar/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._yref import YrefValidator
from ._ypad import YpadValidator
from ._yanchor import YanchorValidator
from ._y import YValidator
from ._xref import XrefValidator
from ._xpad import XpadValidator
fr... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@densitymap@colorbar@__init__.py@.PATH_END.py |
{
"filename": "export.md",
"repo_name": "ultralytics/ultralytics",
"repo_path": "ultralytics_extracted/ultralytics-main/docs/en/modes/export.md",
"type": "Markdown"
} | ---
comments: true
description: Learn how to export your YOLO11 model to various formats like ONNX, TensorRT, and CoreML. Achieve maximum compatibility and performance.
keywords: YOLO11, Model Export, ONNX, TensorRT, CoreML, Ultralytics, AI, Machine Learning, Inference, Deployment
---
# Model Export with Ultralytics Y... | ultralyticsREPO_NAMEultralyticsPATH_START.@ultralytics_extracted@ultralytics-main@docs@en@modes@export.md@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "lynx-x-ray-observatory/soxs",
"repo_path": "soxs_extracted/soxs-main/setup.py",
"type": "Python"
} | #!/usr/bin/env python
import glob
import os
import numpy as np
from setuptools import find_packages, setup
from setuptools.extension import Extension
if os.name == "nt":
std_libs = []
else:
std_libs = ["m"]
scripts = glob.glob("scripts/*")
cython_extensions = [
Extension(
"soxs.lib.broaden_lines... | lynx-x-ray-observatoryREPO_NAMEsoxsPATH_START.@soxs_extracted@soxs-main@setup.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "jakevdp/nfft",
"repo_path": "nfft_extracted/nfft-master/README.md",
"type": "Markdown"
} | # nfft package
[](https://travis-ci.org/jakevdp/nfft/)[](https://pypi.python.org/pypi/nfft)
[](https:... | jakevdpREPO_NAMEnfftPATH_START.@nfft_extracted@nfft-master@README.md@.PATH_END.py |
{
"filename": "time_gaussian.py",
"repo_name": "GalSim-developers/GalSim",
"repo_path": "GalSim_extracted/GalSim-main/devel/external/time_photon_shooting/time_gaussian.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@time_photon_shooting@time_gaussian.py@.PATH_END.py |
{
"filename": "hashutils.py",
"repo_name": "timothydmorton/VESPA",
"repo_path": "VESPA_extracted/VESPA-master/vespa/hashutils.py",
"type": "Python"
} | try:
import numpy as np
import hashlib
from hashlib import sha1
from numpy import all, array, uint8
except ImportError:
np, hashlib, sha1 = (None, None, None)
all, array, uint8 = (None, None, None)
class hashable(object):
r'''Hashable wrapper for ndarray objects.
Instances of nda... | timothydmortonREPO_NAMEVESPAPATH_START.@VESPA_extracted@VESPA-master@vespa@hashutils.py@.PATH_END.py |
{
"filename": "2-particle-NBody-2d.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/tests/functional/Gravity/2-particle-NBody-2d.py",
"type": "Python"
} | #-------------------------------------------------------------------------------
# Set up a pair of equal mass N-body points in a simple circular orbit of each
# other.
#-------------------------------------------------------------------------------
from Spheral2d import *
from SpheralTestUtilities import *
from Sphera... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@tests@functional@Gravity@2-particle-NBody-2d.py@.PATH_END.py |
{
"filename": "_size.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/densitymap/hoverlabel/font/_size.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="size", parent_name="densitymap.hoverlabel.font", **kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_name... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@densitymap@hoverlabel@font@_size.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/matplotlib/py3/matplotlib/style/__init__.py",
"type": "Python"
} | from .core import available, context, library, reload_library, use
__all__ = ["available", "context", "library", "reload_library", "use"]
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@matplotlib@py3@matplotlib@style@__init__.py@.PATH_END.py |
{
"filename": "_cmid.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/bar/marker/_cmid.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CmidValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="cmid", parent_name="bar.marker", **kwargs):
super(CmidValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@bar@marker@_cmid.py@.PATH_END.py |
{
"filename": "_textcase.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter3d/hoverlabel/font/_textcase.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextcaseValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="textcase", parent_name="scatter3d.hoverlabel.font", **kwargs
):
super(TextcaseValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter3d@hoverlabel@font@_textcase.py@.PATH_END.py |
{
"filename": "deprecation_test.py",
"repo_name": "jax-ml/jax",
"repo_path": "jax_extracted/jax-main/tests/deprecation_test.py",
"type": "Python"
} | # Copyright 2022 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@tests@deprecation_test.py@.PATH_END.py |
{
"filename": "hello-world.py",
"repo_name": "OxfordSKA/OSKAR",
"repo_path": "OSKAR_extracted/OSKAR-master/docs/python/hello-world.py",
"type": "Python"
} | #!/usr/bin/env python3
"""Script to run a simple test example of an OSKAR simulation."""
import matplotlib
matplotlib.use("Agg")
# pylint: disable=wrong-import-position
import matplotlib.pyplot as plt
import numpy
import oskar
# Basic settings. (Note that the sky model is set up later.)
params = {
"simulator": {... | OxfordSKAREPO_NAMEOSKARPATH_START.@OSKAR_extracted@OSKAR-master@docs@python@hello-world.py@.PATH_END.py |
{
"filename": "models_architecture.py",
"repo_name": "zivmaaya/NeuralCMS",
"repo_path": "NeuralCMS_extracted/NeuralCMS-main/models_architecture.py",
"type": "Python"
} | import torch
import torch.nn as nn
class FCNN(nn.Module):
def __init__(self, input_size, output_size):
super().__init__()
self.input_size = input_size
self.output_size = output_size
self.hidden_1 = 2 * 512
self.hidden_2 = 2 * 256
self.hidden_3 = 2 * 128
sel... | zivmaayaREPO_NAMENeuralCMSPATH_START.@NeuralCMS_extracted@NeuralCMS-main@models_architecture.py@.PATH_END.py |
{
"filename": "glyph.py",
"repo_name": "enthought/mayavi",
"repo_path": "mayavi_extracted/mayavi-master/docs/source/mayavi/auto/glyph.py",
"type": "Python"
} | #!/usr/bin/env python
"""
This script demonstrates using the Mayavi core API to add a VectorCutPlane,
split the pipeline using a MaskPoints filter and then view the filtered data
with the Glyph module.
"""
# Author: Prabhu Ramachandran <prabhu_r@users.sf.net>
# Copyright (c) 2005-2020, Enthought, Inc.
# License: BSD St... | enthoughtREPO_NAMEmayaviPATH_START.@mayavi_extracted@mayavi-master@docs@source@mayavi@auto@glyph.py@.PATH_END.py |
{
"filename": "materialize_test.py",
"repo_name": "vaexio/vaex",
"repo_path": "vaex_extracted/vaex-master/tests/materialize_test.py",
"type": "Python"
} | from common import *
def test_materialize_virtual(ds_local):
ds = ds_local
print(ds)
ds['new_r'] = np.sqrt(ds.x**2 + ds.y**2)
assert 'new_r' in ds.virtual_columns
assert hasattr(ds, 'new_r')
ds = ds.materialize(ds.new_r)
assert 'new_r' not in ds.virtual_columns
assert 'new_r' in ds.colu... | vaexioREPO_NAMEvaexPATH_START.@vaex_extracted@vaex-master@tests@materialize_test.py@.PATH_END.py |
{
"filename": "paramdesc.py",
"repo_name": "j0r1/GRALE2",
"repo_path": "GRALE2_extracted/GRALE2-master/pygrale/grale/paramdesc.py",
"type": "Python"
} | """This module contains tools for parametric inversion: something to analyze
a description of a lens model that can be optimized parametrically, and
a routine to start such a description based on an existing lens model."""
from .constants import *
from . import lenses
import pprint
import copy
import math
import uuid
... | j0r1REPO_NAMEGRALE2PATH_START.@GRALE2_extracted@GRALE2-master@pygrale@grale@paramdesc.py@.PATH_END.py |
{
"filename": "2_polynomial_tutorial.ipynb",
"repo_name": "frescigno/magpy_rv",
"repo_path": "magpy_rv_extracted/magpy_rv-main/source/tutorials/2_polynomial_tutorial.ipynb",
"type": "Jupyter Notebook"
} | # Tutorial 2 - Simple Model
This second tutorial explains the basics of creating a simple model along with the GP and running it through an MCMC to refine the model and GP parameters. It also introduces users to the mixing plots, the corner plots, and the saving function.
```python
import numpy as np
from magpy_rv.m... | frescignoREPO_NAMEmagpy_rvPATH_START.@magpy_rv_extracted@magpy_rv-main@source@tutorials@2_polynomial_tutorial.ipynb@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "andreicuceu/vega",
"repo_path": "vega_extracted/vega-master/vega/models/fvoigt_models/README.md",
"type": "Markdown"
} | # Fvoigt for HCD modelling
## Building fvoigt_models :
Use the code in the directory build_Fvoigt and read the README.md
## Adding files in fvoigt_models :
**always** : Fvoigt_whatever.txt :smile:
## How to use fvoigt_models :
Modification in the file **.ini :
* In [model] use model-pk = *pk_hcd*
* Add a new s... | andreicuceuREPO_NAMEvegaPATH_START.@vega_extracted@vega-master@vega@models@fvoigt_models@README.md@.PATH_END.py |
{
"filename": "transpose.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/lite/testing/op_tests/transpose.py",
"type": "Python"
} | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@lite@testing@op_tests@transpose.py@.PATH_END.py |
{
"filename": "flim_models.py",
"repo_name": "HETDEX/hetdex_api",
"repo_path": "hetdex_api_extracted/hetdex_api-master/hetdex_api/flux_limits/flim_models.py",
"type": "Python"
} | """
This module stores different models
to convert between the values in the
sensitivity cubes and the flux at
50% detection completeness. It also
stores the tools to interpolate over
simulation results.
.. moduleauthor:: Daniel Farrow <dfarrow@mpe.mpg.de>
"""
from glob import glob
from os.path import join
from ... | HETDEXREPO_NAMEhetdex_apiPATH_START.@hetdex_api_extracted@hetdex_api-master@hetdex_api@flux_limits@flim_models.py@.PATH_END.py |
{
"filename": "popen_fork.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/tools/python3/Lib/multiprocessing/popen_fork.py",
"type": "Python"
} | import os
import signal
from . import util
__all__ = ['Popen']
#
# Start child process using fork
#
class Popen(object):
method = 'fork'
def __init__(self, process_obj):
util._flush_std_streams()
self.returncode = None
self.finalizer = None
self._launch(process_obj)
def... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@python3@Lib@multiprocessing@popen_fork.py@.PATH_END.py |
{
"filename": "_circle.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/mapbox/layer/_circle.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CircleValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="circle", parent_name="layout.mapbox.layer", **kwargs
):
super(CircleValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@mapbox@layer@_circle.py@.PATH_END.py |
{
"filename": "test_ncdim.py",
"repo_name": "joshspeagle/dynesty",
"repo_path": "dynesty_extracted/dynesty-master/tests/test_ncdim.py",
"type": "Python"
} | import numpy as np
from numpy import linalg
import numpy.testing as npt
import dynesty
import pytest
import itertools
from dynesty import utils as dyfunc
from utils import get_rstate, get_printing
"""
A rudimentary test that ncdim parameter works
"""
nlive = 500
printing = get_printing
def bootstrap_tol(results, rst... | joshspeagleREPO_NAMEdynestyPATH_START.@dynesty_extracted@dynesty-master@tests@test_ncdim.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "axgoujon/convex_ridge_regularizers",
"repo_path": "convex_ridge_regularizers_extracted/convex_ridge_regularizers-main/hyperparameter_tuning/README.md",
"type": "Markdown"
} | Given a score function, the script [validate_coarse_to_fine.py](https://github.com/axgoujon/convex_ridge_regularizers/blob/main/validate_coarse_to_fine.py) allows one to tune two hyperparameters with the simple coarse-to-fine approach given in the [paper](https://ieeexplore.ieee.org/document/10223264) (or [open access ... | axgoujonREPO_NAMEconvex_ridge_regularizersPATH_START.@convex_ridge_regularizers_extracted@convex_ridge_regularizers-main@hyperparameter_tuning@README.md@.PATH_END.py |
{
"filename": "primitives_gmos_spect.py",
"repo_name": "GeminiDRSoftware/DRAGONS",
"repo_path": "DRAGONS_extracted/DRAGONS-master/geminidr/gmos/primitives_gmos_spect.py",
"type": "Python"
} | #
# gemini_python
#
# primtives_gmos_spect.py
# ------------------------------------------------------------------------------
import gc
import os
import numpy as np
from importlib import import_modu... | GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@geminidr@gmos@primitives_gmos_spect.py@.PATH_END.py |
{
"filename": "_dx.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/waterfall/_dx.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class DxValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="dx", parent_name="waterfall", **kwargs):
super(DxValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=k... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@waterfall@_dx.py@.PATH_END.py |
{
"filename": "misc.py",
"repo_name": "ytree-project/ytree",
"repo_path": "ytree_extracted/ytree-main/ytree/frontends/rockstar/misc.py",
"type": "Python"
} | """
RockstarArbor miscellany
"""
#-----------------------------------------------------------------------------
# Copyright (c) ytree development team. All rights reserved.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#... | ytree-projectREPO_NAMEytreePATH_START.@ytree_extracted@ytree-main@ytree@frontends@rockstar@misc.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/yt/analysis_modules/halo_mass_function/__init__.py",
"type": "Python"
} | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@yt@analysis_modules@halo_mass_function@__init__.py@.PATH_END.py | |
{
"filename": "time.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/tests/fixtures/time.py",
"type": "Python"
} | from datetime import timedelta
from typing import Callable, Optional, Union
import pendulum
import pytest
from pendulum import DateTime
from pendulum.tz.timezone import Timezone
@pytest.fixture
def frozen_time(monkeypatch: pytest.MonkeyPatch) -> pendulum.DateTime:
frozen = pendulum.now("UTC")
def frozen_tim... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@tests@fixtures@time.py@.PATH_END.py |
{
"filename": "base.py",
"repo_name": "florpi/sunbird",
"repo_path": "sunbird_extracted/sunbird-main/sunbird/emulators/models/base.py",
"type": "Python"
} | import torch
import numpy as np
from typing import Dict
from pathlib import Path
import yaml
import lightning as pl
from torch.optim.lr_scheduler import ReduceLROnPlateau
from flax.traverse_util import unflatten_dict
import sunbird.emulators.models as models
def convert_state_dict_from_pt(
model,
state,
):
... | florpiREPO_NAMEsunbirdPATH_START.@sunbird_extracted@sunbird-main@sunbird@emulators@models@base.py@.PATH_END.py |
{
"filename": "test_extract.py",
"repo_name": "LCOGT/banzai-nres",
"repo_path": "banzai-nres_extracted/banzai-nres-main/banzai_nres/tests/test_extract.py",
"type": "Python"
} | import numpy as np
from banzai.data import CCDData
from banzai_nres.frames import NRESObservationFrame
from banzai_nres.extract import WeightedExtract, GetOptimalExtractionWeights
from banzai import context
class TestExtract:
def test_rejects_on_no_weights(self):
con = context.Context({})
assert ... | LCOGTREPO_NAMEbanzai-nresPATH_START.@banzai-nres_extracted@banzai-nres-main@banzai_nres@tests@test_extract.py@.PATH_END.py |
{
"filename": "test_task_run_state_change_events.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/tests/events/client/instrumentation/test_task_run_state_change_events.py",
"type": "Python"
} | import pendulum
from prefect import flow, task
from prefect.client.orchestration import PrefectClient
from prefect.client.schemas.objects import State
from prefect.events.clients import AssertingEventsClient
from prefect.events.schemas.events import Resource
from prefect.events.worker import EventsWorker
from prefect.... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@tests@events@client@instrumentation@test_task_run_state_change_events.py@.PATH_END.py |
{
"filename": "passband.py",
"repo_name": "mikecokina/elisa",
"repo_path": "elisa_extracted/elisa-master/src/elisa/observer/passband.py",
"type": "Python"
} | import sys
import numpy as np
import pandas as pd
from scipy import interpolate
from .. import settings
def init_bolometric_passband():
"""
initializing bolometric passband and its wavelength boundaries
:return: Tuple;
"""
df = pd.DataFrame(
{
settings.PASSBAND_DATAFRAME_THRO... | mikecokinaREPO_NAMEelisaPATH_START.@elisa_extracted@elisa-master@src@elisa@observer@passband.py@.PATH_END.py |
{
"filename": "constraint.py",
"repo_name": "pmelchior/scarlet",
"repo_path": "scarlet_extracted/scarlet-master/scarlet/constraint.py",
"type": "Python"
} | from functools import partial
import numpy as np
import proxmin
from . import operator
from .cache import Cache
class Constraint:
"""Constraint base class
Constraints encode expected properties of the solution.
Mathematically, they are the consequence of adding potentially
non-differentiable penalt... | pmelchiorREPO_NAMEscarletPATH_START.@scarlet_extracted@scarlet-master@scarlet@constraint.py@.PATH_END.py |
{
"filename": "_outsidetextfont.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/pie/_outsidetextfont.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OutsidetextfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="outsidetextfont", parent_name="pie", **kwargs):
super(OutsidetextfontValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@pie@_outsidetextfont.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/ternary/aaxis/title/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._text import TextValidator
from ._font import FontValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._text.TextVal... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@ternary@aaxis@title@__init__.py@.PATH_END.py |
{
"filename": "_zhoverformat.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/contour/_zhoverformat.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ZhoverformatValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="zhoverformat", parent_name="contour", **kwargs):
super(ZhoverformatValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_n... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@contour@_zhoverformat.py@.PATH_END.py |
{
"filename": "SortAndDivideRedistributeNodes2d.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/src/PYB11/Distributed/SortAndDivideRedistributeNodes2d.py",
"type": "Python"
} | #-------------------------------------------------------------------------------
# SortAndDivideRedistributeNodes2d
#-------------------------------------------------------------------------------
from PYB11Generator import *
from SortAndDivideRedistributeNodes import *
@PYB11template()
@PYB11template_dict({"Dimension... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@src@PYB11@Distributed@SortAndDivideRedistributeNodes2d.py@.PATH_END.py |
{
"filename": "_yhoverformat.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/surface/_yhoverformat.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YhoverformatValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="yhoverformat", parent_name="surface", **kwargs):
super(YhoverformatValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_n... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@surface@_yhoverformat.py@.PATH_END.py |
{
"filename": "_dtick.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/icicle/marker/colorbar/_dtick.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class DtickValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(
self, plotly_name="dtick", parent_name="icicle.marker.colorbar", **kwargs
):
super(DtickValidator, self).__init__(
plotly_name=plotly_name,
parent_name=par... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@icicle@marker@colorbar@_dtick.py@.PATH_END.py |
{
"filename": "validation.py",
"repo_name": "ML4GW/aframe",
"repo_path": "aframe_extracted/aframe-main/projects/data/data/waveforms/validation.py",
"type": "Python"
} | from jsonargparse import ArgumentParser
from data.waveforms.rejection import rejection_sample
from ledger.injections import WaveformSet, waveform_class_factory
parser = ArgumentParser()
parser.add_function_arguments(rejection_sample)
parser.add_argument("--output_file", "-o", type=str)
def main(args):
args = ar... | ML4GWREPO_NAMEaframePATH_START.@aframe_extracted@aframe-main@projects@data@data@waveforms@validation.py@.PATH_END.py |
{
"filename": "test_api.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/tslibs/test_api.py",
"type": "Python"
} | """Tests that the tslibs API is locked down"""
from pandas._libs import tslibs
def test_namespace():
submodules = [
"base",
"ccalendar",
"conversion",
"dtypes",
"fields",
"nattype",
"np_datetime",
"offsets",
"parsing",
"period",
... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@tslibs@test_api.py@.PATH_END.py |
{
"filename": "fit_transformer_final.ipynb",
"repo_name": "astrockragh/Mangrove",
"repo_path": "Mangrove_extracted/Mangrove-main/transform/fit_transformer_final.ipynb",
"type": "Jupyter Notebook"
} | ```python
import torch, os, pickle, time
import torch_geometric as tg
from torch_geometric.data import Data
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from tqdm import tqdm
import os.path as osp
import networkx as nx
path='~/../../tigress/cj1223/merger_trees/isotrees/'
transform_path='~/../.... | astrockraghREPO_NAMEMangrovePATH_START.@Mangrove_extracted@Mangrove-main@transform@fit_transformer_final.ipynb@.PATH_END.py |
{
"filename": "test_chandra2ixpe.py",
"repo_name": "lucabaldini/ixpeobssim",
"repo_path": "ixpeobssim_extracted/ixpeobssim-main/tests/test_chandra2ixpe.py",
"type": "Python"
} | #!/usr/bin/env python
#
# Copyright (C) 2018, the ixpeobssim team.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
#... | lucabaldiniREPO_NAMEixpeobssimPATH_START.@ixpeobssim_extracted@ixpeobssim-main@tests@test_chandra2ixpe.py@.PATH_END.py |
{
"filename": "DaySequence.py",
"repo_name": "james-trayford/strauss",
"repo_path": "strauss_extracted/strauss-main/examples/DaySequence.py",
"type": "Python"
} | #!/usr/bin/env python
# coding: utf-8
# ### <u> Generate the sunrise to sunset sonification used in the "_Audible Universe_" planetarium show </u>
import matplotlib.pyplot as plt
import ffmpeg as ff
import wavio as wav
from strauss.sonification import Sonification
from strauss.sources import Objects
from strauss impo... | james-trayfordREPO_NAMEstraussPATH_START.@strauss_extracted@strauss-main@examples@DaySequence.py@.PATH_END.py |
{
"filename": "test_testing.py",
"repo_name": "scikit-image/scikit-image",
"repo_path": "scikit-image_extracted/scikit-image-main/skimage/_shared/tests/test_testing.py",
"type": "Python"
} | """Testing decorators module"""
import inspect
import re
import warnings
import pytest
from numpy.testing import assert_equal
from skimage._shared.testing import (
doctest_skip_parser,
run_in_parallel,
assert_stacklevel,
)
from skimage._shared import testing
from skimage._shared._dependency_checks import ... | scikit-imageREPO_NAMEscikit-imagePATH_START.@scikit-image_extracted@scikit-image-main@skimage@_shared@tests@test_testing.py@.PATH_END.py |
{
"filename": "joint_categorical.py",
"repo_name": "jmschrei/pomegranate",
"repo_path": "pomegranate_extracted/pomegranate-master/pomegranate/distributions/joint_categorical.py",
"type": "Python"
} | # joint_categorical.py
# Contact: Jacob Schreiber <jmschreiber91@gmail.com>
import numpy
import torch
from .._utils import _cast_as_tensor
from .._utils import _cast_as_parameter
from .._utils import _update_parameter
from .._utils import _check_parameter
from .._utils import _reshape_weights
from ._distribution imp... | jmschreiREPO_NAMEpomegranatePATH_START.@pomegranate_extracted@pomegranate-master@pomegranate@distributions@joint_categorical.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "fchollet/keras",
"repo_path": "keras_extracted/keras-master/keras/api/utils/bounding_boxes/__init__.py",
"type": "Python"
} | """DO NOT EDIT.
This file was autogenerated. Do not edit it by hand,
since your modifications would be overwritten.
"""
from keras.src.layers.preprocessing.image_preprocessing.bounding_boxes.converters import (
affine_transform,
)
from keras.src.layers.preprocessing.image_preprocessing.bounding_boxes.converters i... | fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@api@utils@bounding_boxes@__init__.py@.PATH_END.py |
{
"filename": "finetune.py",
"repo_name": "mwalmsley/zoobot",
"repo_path": "zoobot_extracted/zoobot-main/zoobot/tensorflow/training/finetune.py",
"type": "Python"
} | import logging
import os
import tensorflow as tf
from tensorflow.keras import layers
from zoobot.tensorflow.training import training_config
def run_finetuning(config, encoder, train_dataset, val_dataset, test_dataset, save_dir):
new_head = linear_classifier(config['finetune']['encoder_dim'], config['finetune']... | mwalmsleyREPO_NAMEzoobotPATH_START.@zoobot_extracted@zoobot-main@zoobot@tensorflow@training@finetune.py@.PATH_END.py |
{
"filename": "CAMB.py",
"repo_name": "Valcin/BE_HaPPy",
"repo_path": "BE_HaPPy_extracted/BE_HaPPy-master/coefficients/other neutrinos masses/0.13eV/CAMB.py",
"type": "Python"
} | import numpy as np
import camb
import sys,os
################################## INPUT ######################################
# neutrino parameters
hierarchy = 'degenerate' #'degenerate', 'normal', 'inverted'
Mnu = 0.13 #eV
Nnu = 3 #number of massive neutrinos
Neff = 3.046
#~ Neff = 0.00641
# ... | ValcinREPO_NAMEBE_HaPPyPATH_START.@BE_HaPPy_extracted@BE_HaPPy-master@coefficients@other neutrinos masses@0.13eV@CAMB.py@.PATH_END.py |
{
"filename": "_utils.py",
"repo_name": "21cmfast/21cmFAST",
"repo_path": "21cmFAST_extracted/21cmFAST-master/src/py21cmfast/_utils.py",
"type": "Python"
} | """Utilities that help with wrapping various C structures."""
import glob
import h5py
import logging
import numpy as np
import warnings
from abc import ABCMeta, abstractmethod
from bidict import bidict
from cffi import FFI
from enum import IntEnum
from hashlib import md5
from os import makedirs, path
from pathlib impo... | 21cmfastREPO_NAME21cmFASTPATH_START.@21cmFAST_extracted@21cmFAST-master@src@py21cmfast@_utils.py@.PATH_END.py |
{
"filename": "_sort.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/icicle/_sort.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SortValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="sort", parent_name="icicle", **kwargs):
super(SortValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_ty... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@icicle@_sort.py@.PATH_END.py |
{
"filename": "interface_generator.py",
"repo_name": "yacobozdalkiran/CLASS_mod",
"repo_path": "CLASS_mod_extracted/CLASS_mod-main/class_public-master/python/interface_generator.py",
"type": "Python"
} | """
Automatically reads header files to generate an interface
"""
from __future__ import division, print_function
import sys
import logging
try:
from collections import OrderedDict as od
except ImportError:
try:
from ordereddict import OrderedDict as od
except ImportError:
raise ImportError(... | yacobozdalkiranREPO_NAMECLASS_modPATH_START.@CLASS_mod_extracted@CLASS_mod-main@class_public-master@python@interface_generator.py@.PATH_END.py |
{
"filename": "_line.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/scatter3d/_line.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatter3d"
_path_str = "scatter3d.line"
_valid_props = {
"autocolorscale",
"ca... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@scatter3d@_line.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.