metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "sextractor_engine.py",
"repo_name": "emhuff/Balrog",
"repo_path": "Balrog_extracted/Balrog-master/sextractor_engine.py",
"type": "Python"
} | #!/usr/bin/env python
#import subprocess
#import sys
#import time
import os
import balrog
import copy
#import utils
#from defaults import *
class DEFAULT:
IMAGE = 'NONE'
WEIGHT = 'NONE'
CHECK = 'NONE'
CHECK_NAME = 'NONE'
BALROG_DIR = '/'.join( os.path.realpath(__file__).split('/')[:-1] )
AST... | emhuffREPO_NAMEBalrogPATH_START.@Balrog_extracted@Balrog-master@sextractor_engine.py@.PATH_END.py |
{
"filename": "_uid.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/choroplethmapbox/_uid.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class UidValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="uid", parent_name="choroplethmapbox", **kwargs):
super(UidValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@choroplethmapbox@_uid.py@.PATH_END.py |
{
"filename": "_backend.py",
"repo_name": "crossbario/crossbar",
"repo_path": "crossbar_extracted/crossbar-master/crossbar/network/_backend.py",
"type": "Python"
} | # coding=utf8
##############################################################################
#
# Crossbar.io
# Copyright (C) Crossbar.io Technologies GmbH. All rights reserved.
#
##############################################################################
import inspect
import os
import r... | crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@crossbar@network@_backend.py@.PATH_END.py |
{
"filename": "amrvac_reader.py",
"repo_name": "amrvac/amrvac",
"repo_path": "amrvac_extracted/amrvac-master/tools/python/amrvac_pytools/datfiles/reading/amrvac_reader.py",
"type": "Python"
} | """
Main class to load in MPI-AMRVAC native .dat files.
@author: Niels Claes (niels.claes@kuleuven.be)
@author: Clément Robert (clement.robert@oca.eu)
Last edit: 13 October 2019
"""
import sys, os
import numpy as np
import copy
import matplotlib.pyplot as plt
from amrvac_pytools.datfiles.reading import d... | amrvacREPO_NAMEamrvacPATH_START.@amrvac_extracted@amrvac-master@tools@python@amrvac_pytools@datfiles@reading@amrvac_reader.py@.PATH_END.py |
{
"filename": "pessto.py",
"repo_name": "astrocatalogs/supernovae",
"repo_path": "supernovae_extracted/supernovae-master/tasks/pessto.py",
"type": "Python"
} | """Import tasks for the PESSTO spectroscopic program.
"""
import csv
import os
from astrocats.catalog.utils import pbar
from astrocats.catalog.photometry import PHOTOMETRY
from ..supernova import SUPERNOVA
def do_pessto(catalog):
task_str = catalog.get_current_task_str()
pessto_path = os.path.join(
... | astrocatalogsREPO_NAMEsupernovaePATH_START.@supernovae_extracted@supernovae-master@tasks@pessto.py@.PATH_END.py |
{
"filename": "_coloraxis.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattergeo/marker/_coloraxis.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColoraxisValidator(_plotly_utils.basevalidators.SubplotidValidator):
def __init__(
self, plotly_name="coloraxis", parent_name="scattergeo.marker", **kwargs
):
super(ColoraxisValidator, self).__init__(
plotly_name=plotly_name,
pa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattergeo@marker@_coloraxis.py@.PATH_END.py |
{
"filename": "cpu_hessenberg_lapack_gehrd.py",
"repo_name": "google/jax",
"repo_path": "jax_extracted/jax-main/jax/_src/internal_test_util/export_back_compat_test_data/cpu_hessenberg_lapack_gehrd.py",
"type": "Python"
} | # Copyright 2024 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | googleREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@_src@internal_test_util@export_back_compat_test_data@cpu_hessenberg_lapack_gehrd.py@.PATH_END.py |
{
"filename": "spectral_normalization_test.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/layers/normalization/spectral_normalization_test.py",
"type": "Python"
} | import numpy as np
import pytest
from keras.src import backend
from keras.src import initializers
from keras.src import layers
from keras.src import models
from keras.src import testing
class SpectralNormalizationTest(testing.TestCase):
@pytest.mark.requires_trainable_backend
def test_basic_spectralnorm(self... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@layers@normalization@spectral_normalization_test.py@.PATH_END.py |
{
"filename": "DownloadUtils.py",
"repo_name": "timkahlke/BASTA",
"repo_path": "BASTA_extracted/BASTA-master/basta/DownloadUtils.py",
"type": "Python"
} | #!/usr/bin/env python
import os
import sys
import hashlib
import logging
import wget
############
#
# Download utilities
#
####
# COPYRIGHT DISCALIMER:
# 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 Sof... | timkahlkeREPO_NAMEBASTAPATH_START.@BASTA_extracted@BASTA-master@basta@DownloadUtils.py@.PATH_END.py |
{
"filename": "get_weights_realspace.py",
"repo_name": "rreischke/OneCovariance",
"repo_path": "OneCovariance_extracted/OneCovariance-main/input/arbitrary_summary/script_weights/get_weights_realspace.py",
"type": "Python"
} | import numpy as np
from scipy.special import jv
N_fourier = int(1e5) # at how many ells should the Fourier space filter be evaluated
fourier_ell = np.geomspace(1,1e5,N_fourier) # define the ell, this range is more than enough
N_real = int(1e5) # at how many theta should the real space filter be evaluated
theta_type_g... | rreischkeREPO_NAMEOneCovariancePATH_START.@OneCovariance_extracted@OneCovariance-main@input@arbitrary_summary@script_weights@get_weights_realspace.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "numpy/numpy",
"repo_path": "numpy_extracted/numpy-main/numpy/_core/tests/examples/cython/setup.py",
"type": "Python"
} | """
Provide python-space access to the functions exposed in numpy/__init__.pxd
for testing.
"""
import Cython
import numpy as np
from numpy._utils import _pep440
from distutils.core import setup
from Cython.Build import cythonize
from setuptools.extension import Extension
import os
macros = [
("NPY_NO_DEPRECATED_... | numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@numpy@_core@tests@examples@cython@setup.py@.PATH_END.py |
{
"filename": "Train parallax and proper motion error_bigger_train.ipynb",
"repo_name": "jan-rybizki/Galaxia_wrap",
"repo_path": "Galaxia_wrap_extracted/Galaxia_wrap-master/notebook/Train parallax and proper motion error_bigger_train.ipynb",
"type": "Jupyter Notebook"
} | ```python
%pylab inline
from astropy.io import fits
from sklearn.ensemble import ExtraTreesRegressor
import pickle
from numpy.lib.recfunctions import stack_arrays
```
Populating the interactive namespace from numpy and matplotlib
/home/rybizki/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarni... | jan-rybizkiREPO_NAMEGalaxia_wrapPATH_START.@Galaxia_wrap_extracted@Galaxia_wrap-master@notebook@Train parallax and proper motion error_bigger_train.ipynb@.PATH_END.py |
{
"filename": "4_draw.py",
"repo_name": "COSMOGRAIL/PyCS",
"repo_path": "PyCS_extracted/PyCS-master/demo/demo1/4_draw.py",
"type": "Python"
} | import pycs
import myopt
# Two things to "draw" here :
# 1) make say 200 plain copies of the data.
# These will be used to evaluate the intrinsic variance of the optimizers
# and compute the best point estimates for the delays.
lcs = pycs.gen.util.readpickle("data/trialcurves.pkl")
pycs.sim.draw.multidraw(lcs, onl... | COSMOGRAILREPO_NAMEPyCSPATH_START.@PyCS_extracted@PyCS-master@demo@demo1@4_draw.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "simonsobs/nextline-rdb",
"repo_path": "nextline-rdb_extracted/nextline-rdb-main/tests/schema/mutations/__init__.py",
"type": "Python"
} | simonsobsREPO_NAMEnextline-rdbPATH_START.@nextline-rdb_extracted@nextline-rdb-main@tests@schema@mutations@__init__.py@.PATH_END.py | |
{
"filename": "plot_postproduct_corner_TEMPLATE.ipynb",
"repo_name": "substellar/brewster",
"repo_path": "brewster_extracted/brewster-master/plot_postproduct_corner_TEMPLATE.ipynb",
"type": "Jupyter Notebook"
} | ```python
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.image as mgimg
import scipy as sp
import numpy as np
import emcee
import testkit
import corner
import pickle as pickle
from IPython.display import display
%matplotlib inline
import brewtools
```
```python
runname ="YOUR RUN NAME HER... | substellarREPO_NAMEbrewsterPATH_START.@brewster_extracted@brewster-master@plot_postproduct_corner_TEMPLATE.ipynb@.PATH_END.py |
{
"filename": "test_aci_worker.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/integrations/prefect-azure/tests/test_aci_worker.py",
"type": "Python"
} | import asyncio
import uuid
from typing import Dict, List, Tuple, Union
from unittest.mock import MagicMock, Mock
import dateutil.parser
import prefect_azure.container_instance
import pytest
from anyio.abc import TaskStatus
from azure.core.exceptions import HttpResponseError
from azure.identity import ClientSecretCrede... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@integrations@prefect-azure@tests@test_aci_worker.py@.PATH_END.py |
{
"filename": "rFourier.py",
"repo_name": "federicomarulli/CosmoBolognaLib",
"repo_path": "CosmoBolognaLib_extracted/CosmoBolognaLib-master/External/CLASS/external/RealSpaceInterface/Calc2D/rFourier.py",
"type": "Python"
} | import numpy as np
import numpy.fft as fft
def realFourier(step, Value):
FValue = np.fft.fftshift(
np.fft.rfft2(Value), axes=(0)) #shifting only the x axes
kx = np.fft.fftshift(np.fft.fftfreq(Value.shape[0], d=step)) * 2 * np.pi
ky = np.fft.rfftfreq(Value.shape[0], d=step) * 2 * np.pi
return... | federicomarulliREPO_NAMECosmoBolognaLibPATH_START.@CosmoBolognaLib_extracted@CosmoBolognaLib-master@External@CLASS@external@RealSpaceInterface@Calc2D@rFourier.py@.PATH_END.py |
{
"filename": "uvcal.py",
"repo_name": "RadioAstronomySoftwareGroup/pyuvdata",
"repo_path": "pyuvdata_extracted/pyuvdata-main/src/pyuvdata/uvcal/uvcal.py",
"type": "Python"
} | # Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""Primary container for radio interferometer calibration solutions."""
import copy
import os
import threading
import warnings
import numpy as np
from docstring_parser import DocstringStyle
from .. import Telescope, paramet... | RadioAstronomySoftwareGroupREPO_NAMEpyuvdataPATH_START.@pyuvdata_extracted@pyuvdata-main@src@pyuvdata@uvcal@uvcal.py@.PATH_END.py |
{
"filename": "coco_to_yolo_converter.py",
"repo_name": "ESA-Datalabs/XAMI-dataset",
"repo_path": "XAMI-dataset_extracted/XAMI-dataset-main/xami_dataset/xami_utils/coco_to_yolo_converter.py",
"type": "Python"
} | import json
import os
import shutil
from . import dataset_utils
import matplotlib.pyplot as plt
import numpy as np
import cv2
import yaml
class COCOToYOLOConverter:
def __init__(self, input_path, output_path, annotations_file, plot_yolo_masks=False):
self.input_path = input_path
self.output_path = ... | ESA-DatalabsREPO_NAMEXAMI-datasetPATH_START.@XAMI-dataset_extracted@XAMI-dataset-main@xami_dataset@xami_utils@coco_to_yolo_converter.py@.PATH_END.py |
{
"filename": "_indexing_functions.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/numpy/py3/numpy/array_api/_indexing_functions.py",
"type": "Python"
} | from __future__ import annotations
from ._array_object import Array
from ._dtypes import _integer_dtypes
import numpy as np
def take(x: Array, indices: Array, /, *, axis: Optional[int] = None) -> Array:
"""
Array API compatible wrapper for :py:func:`np.take <numpy.take>`.
See its docstring for more info... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@numpy@py3@numpy@array_api@_indexing_functions.py@.PATH_END.py |
{
"filename": "scalar.py",
"repo_name": "ellawang44/Breidablik",
"repo_path": "Breidablik_extracted/Breidablik-master/breidablik/interpolate/scalar.py",
"type": "Python"
} | import numpy as np
import os
class Scalar:
"""Scalar class used to scale data. Can create a scalar, scale input data, save and load previous scalars.
"""
def __init__(self):
self.mean = None
self.std = None
def fit(self, data):
"""Create scalar.
Parameters
---... | ellawang44REPO_NAMEBreidablikPATH_START.@Breidablik_extracted@Breidablik-master@breidablik@interpolate@scalar.py@.PATH_END.py |
{
"filename": "_tickprefix.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/choroplethmapbox/colorbar/_tickprefix.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickprefixValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="tickprefix",
parent_name="choroplethmapbox.colorbar",
**kwargs
):
super(TickprefixValidator, self).__init__(
plotly_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@choroplethmapbox@colorbar@_tickprefix.py@.PATH_END.py |
{
"filename": "_sizesrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/sunburst/outsidetextfont/_sizesrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="sizesrc", parent_name="sunburst.outsidetextfont", **kwargs
):
super(SizesrcValidator, self).__init__(
plotly_name=plotly_name,
parent_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@sunburst@outsidetextfont@_sizesrc.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattergeo/marker/colorbar/title/font/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="color",
parent_name="scattergeo.marker.colorbar.title.font",
**kwargs,
):
super(ColorValidator, self).__init__(
plotly_nam... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattergeo@marker@colorbar@title@font@_color.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "numpy/numpy",
"repo_path": "numpy_extracted/numpy-main/numpy/lib/tests/__init__.py",
"type": "Python"
} | numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@numpy@lib@tests@__init__.py@.PATH_END.py | |
{
"filename": "_y.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatterpolargl/marker/colorbar/_y.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="y", parent_name="scatterpolargl.marker.colorbar", **kwargs
):
super(YValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatterpolargl@marker@colorbar@_y.py@.PATH_END.py |
{
"filename": "stishovite_model_Carpenter_2000.py",
"repo_name": "geodynamics/burnman",
"repo_path": "burnman_extracted/burnman-main/contrib/anisotropic_stishovite/stishovite_model_Carpenter_2000.py",
"type": "Python"
} | import numpy as np
from scipy.integrate import cumulative_trapezoid
import matplotlib.pyplot as plt
from burnman.minerals.HP_2011_ds62 import stv
from string import ascii_lowercase
# Expressions for the bare elastic constant values
# are taken from Table 2
# All units are GPa
def C11(P_GPa):
return 578 + 5.38 * ... | geodynamicsREPO_NAMEburnmanPATH_START.@burnman_extracted@burnman-main@contrib@anisotropic_stishovite@stishovite_model_Carpenter_2000.py@.PATH_END.py |
{
"filename": "ss-vae.ipynb",
"repo_name": "pyro-ppl/pyro",
"repo_path": "pyro_extracted/pyro-master/tutorial/source/ss-vae.ipynb",
"type": "Jupyter Notebook"
} | # The Semi-Supervised VAE
## Introduction
Most of the models we've covered in the tutorials are unsupervised:
- [Variational Autoencoder (VAE)](vae.ipynb)
- [DMM](dmm.ipynb)
- [Attend-Infer-Repeat](air.ipynb)
We've also covered a simple supervised model:
- [Bayesian Regression](bayesian_regression.ipynb)
The semi... | pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@tutorial@source@ss-vae.ipynb@.PATH_END.py |
{
"filename": "_shadow.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/table/cells/font/_shadow.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShadowValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="shadow", parent_name="table.cells.font", **kwargs):
super(ShadowValidator, 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@table@cells@font@_shadow.py@.PATH_END.py |
{
"filename": "pfailsimulations.py",
"repo_name": "desihub/LSS",
"repo_path": "LSS_extracted/LSS-main/scripts/pfailsimulations.py",
"type": "Python"
} | import numpy as np
import scipy
import sys
from scipy import stats
from scipy.stats import norm
from scipy.stats import binom
import fitsio
import glob
import os
import matplotlib.pyplot as plt
import statistics
import argparse
import astropy
from astropy.table import Table
from astropy.table import join
from astropy.t... | desihubREPO_NAMELSSPATH_START.@LSS_extracted@LSS-main@scripts@pfailsimulations.py@.PATH_END.py |
{
"filename": "batch.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/integrations/prefect-aws/prefect_aws/batch.py",
"type": "Python"
} | """Tasks for interacting with AWS Batch"""
from typing import Any, Dict, Optional
from prefect import task
from prefect._internal.compatibility.async_dispatch import async_dispatch
from prefect.logging import get_run_logger
from prefect.utilities.asyncutils import run_sync_in_worker_thread
from prefect_aws.credential... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@integrations@prefect-aws@prefect_aws@batch.py@.PATH_END.py |
{
"filename": "lossFunctions.py",
"repo_name": "bruce-chappell/SunnyNet",
"repo_path": "SunnyNet_extracted/SunnyNet-main/networkUtils/lossFunctions.py",
"type": "Python"
} | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class WeightedMSE(nn.Module):
'''
A weighted MSE based on height in the atmosphere in Mm
'loss_w_range': (tuple), # range in Mm to weight loss function (not working since we switched to column mass)
... | bruce-chappellREPO_NAMESunnyNetPATH_START.@SunnyNet_extracted@SunnyNet-main@networkUtils@lossFunctions.py@.PATH_END.py |
{
"filename": "test_evrard_collapse.py",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/examples/applications/test_evrard_collapse.py",
"type": "Python"
} | import sys
import os.path
from optparse import OptionParser
try:
from matplotlib import pyplot
HAS_MATPLOTLIB = True
from amuse.plot import plot, xlabel, ylabel
except ImportError:
HAS_MATPLOTLIB = False
from amuse.test.amusetest import get_path_to_results
from amuse.units import units
from amuse.unit... | amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@examples@applications@test_evrard_collapse.py@.PATH_END.py |
{
"filename": "keras_saveable.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/saving/keras_saveable.py",
"type": "Python"
} | import io
class KerasSaveable:
# Note: renaming this function will cause old pickles to be broken.
# This is probably not a huge deal, as pickle should not be a recommended
# saving format -- it should only be supported for use with distributed
# computing frameworks.
def _obj_type(self):
... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@saving@keras_saveable.py@.PATH_END.py |
{
"filename": "_astropy_init.py",
"repo_name": "tardis-sn/tardis",
"repo_path": "tardis_extracted/tardis-main/tardis/_astropy_init.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
__all__ = ["__version__", "__githash__", "test"]
# this indicates whether or not we are in the package's setup.py
try:
_ASTROPY_SETUP_
except NameError:
from sys import version_info
if version_info[0] >= 3:
import builtins
else:
... | tardis-snREPO_NAMEtardisPATH_START.@tardis_extracted@tardis-main@tardis@_astropy_init.py@.PATH_END.py |
{
"filename": "create_network.py",
"repo_name": "vblanka24/Ba_star_classification_PaperIII",
"repo_path": "Ba_star_classification_PaperIII_extracted/Ba_star_classification_PaperIII-main/create_network.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
import os, sys, random
from classify_lib import *
from eli5.permutation_importance import get_score_importances
from sklearn import metrics
if len(sys.argv) > 3:
mod_dir = sys.argv[1]
n_tries = sys.argv[2]
else: # input here
mod_dir = "NN1_monash"
n_tr... | vblanka24REPO_NAMEBa_star_classification_PaperIIIPATH_START.@Ba_star_classification_PaperIII_extracted@Ba_star_classification_PaperIII-main@create_network.py@.PATH_END.py |
{
"filename": "test_mbs.py",
"repo_name": "litebird/litebird_sim",
"repo_path": "litebird_sim_extracted/litebird_sim-master/test/test_mbs.py",
"type": "Python"
} | # -*- encoding: utf-8 -*-
from pathlib import Path
from tempfile import NamedTemporaryFile, TemporaryDirectory
import litebird_sim as lbs
import healpy as hp
import numpy as np
PARAMETER_FILE = """
[map_based_sims]
[map_based_sims.general]
save = false
nside = 16
gaussian_smooth = true
bandpass_int = true... | litebirdREPO_NAMElitebird_simPATH_START.@litebird_sim_extracted@litebird_sim-master@test@test_mbs.py@.PATH_END.py |
{
"filename": "fit_helioscope_data.py",
"repo_name": "sebhoof/SolarAxionFlux",
"repo_path": "SolarAxionFlux_extracted/SolarAxionFlux-master/python/fit_helioscope_data.py",
"type": "Python"
} | from mpi4py import MPI
import os
import sys
import time
import numpy as np
from datetime import date
from scipy.optimize import minimize
from iminuit import Minuit
os.environ["OMP_NUM_THREADS"] = "1"
gagg0 = 0.6 # = 0.6e-10 GeV^{-1}
if len(sys.argv) > 1:
gagg0 = float(sys.argv[1])
code_path = "."
output_path = "... | sebhoofREPO_NAMESolarAxionFluxPATH_START.@SolarAxionFlux_extracted@SolarAxionFlux-master@python@fit_helioscope_data.py@.PATH_END.py |
{
"filename": "_showticksuffix.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/volume/colorbar/_showticksuffix.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowticksuffixValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="showticksuffix", parent_name="volume.colorbar", **kwargs
):
super(ShowticksuffixValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@volume@colorbar@_showticksuffix.py@.PATH_END.py |
{
"filename": "distance.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/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... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@scipy@spatial@distance.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/surface/_visible.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VisibleValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="visible", parent_name="surface", **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@surface@_visible.py@.PATH_END.py |
{
"filename": "test_config.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/tests/cli/test_config.py",
"type": "Python"
} | import sys
import pytest
import toml
from typer import Exit
import prefect.context
import prefect.settings
from prefect.context import use_profile
from prefect.settings import (
PREFECT_API_DATABASE_TIMEOUT,
PREFECT_API_KEY,
PREFECT_CLIENT_RETRY_EXTRA_CODES,
PREFECT_LOGGING_TO_API_MAX_LOG_SIZE,
PR... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@tests@cli@test_config.py@.PATH_END.py |
{
"filename": "_dy.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/bar/_dy.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class DyValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="dy", parent_name="bar", **kwargs):
super(DyValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
anim=kwargs.pop("... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@bar@_dy.py@.PATH_END.py |
{
"filename": "test_xml.py",
"repo_name": "jdswinbank/Comet",
"repo_path": "Comet_extracted/Comet-master/comet/utility/test/test_xml.py",
"type": "Python"
} | # Comet VOEvent Broker.
# Tests for XML parsing.
import textwrap
import lxml.etree as etree
from io import BytesIO
from twisted.trial import unittest
from comet.testutils import DUMMY_IAMALIVE, DUMMY_VOEVENT, DUMMY_EVENT_IVOID
from comet.utility import xml_document, ParseError
from comet.utility import VOEventMessag... | jdswinbankREPO_NAMECometPATH_START.@Comet_extracted@Comet-master@comet@utility@test@test_xml.py@.PATH_END.py |
{
"filename": "one-hot-encoding-features.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage-common-phrases/one-hot-encoding-features.md",
"type": "Markdown"
} | **Command-line version parameters:** `--one-hot-max-size`
**Python parameters:** `one_hot_max_size`
**R parameters:** `one_hot_max_size`
#### Description
{% include [reusage-cli__one-hot-max-size__desc-div](../reusage/cli__one-hot-max-size__desc-div.md) %}
**Default value**
{% include [reusage-default-values-one-... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage-common-phrases@one-hot-encoding-features.md@.PATH_END.py |
{
"filename": "_name.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/sankey/link/colorscale/_name.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="name", parent_name="sankey.link.colorscale", **kwargs
):
super(NameValidator, self).__init__(
plotly_name=plotly_name,
parent_name=par... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@sankey@link@colorscale@_name.py@.PATH_END.py |
{
"filename": "dpr.py",
"repo_name": "Jayshil/pycdata",
"repo_path": "pycdata_extracted/pycdata-main/pycdata/dpr.py",
"type": "Python"
} | import numpy as np
from astroquery.mast import Observations
from astropy.io import fits
from astropy.table import Table
from astropy.time import Time
from pycheops.core import load_config
import os
# Path of the current directory
p1 = os.getcwd()
# Path of the pycheops cache directory
config = load_config()
p3 = conf... | JayshilREPO_NAMEpycdataPATH_START.@pycdata_extracted@pycdata-main@pycdata@dpr.py@.PATH_END.py |
{
"filename": "spectral_smdisk_3d.py",
"repo_name": "bek0s/gbkfit",
"repo_path": "gbkfit_extracted/gbkfit-master/src/gbkfit/model/gmodels/spectral_smdisk_3d.py",
"type": "Python"
} |
from collections.abc import Sequence
from . import _detail, _smdisk, common, traits
from .core import SpectralComponent3D
from gbkfit.utils import parseutils
__all__ = [
'SpectralSMDisk3D'
]
class SpectralSMDisk3D(SpectralComponent3D):
@staticmethod
def type():
return 'smdisk'
@classmeth... | bek0sREPO_NAMEgbkfitPATH_START.@gbkfit_extracted@gbkfit-master@src@gbkfit@model@gmodels@spectral_smdisk_3d.py@.PATH_END.py |
{
"filename": "AthenaWrapper.py",
"repo_name": "PrincetonUniversity/athena",
"repo_path": "athena_extracted/athena-master/tst/regression/scripts/utils/RiemannSolver/AthenaWrapper.py",
"type": "Python"
} | from scripts.utils.EquationOfState.eos import Ideal, SimpleHydrogen
from .riemann import riemann_problem
import os
import sys
sys.path.insert(0, '../../../../../vis/python')
import athena_read # noqa
def athinput2riemann(athinput, eos=None):
"""Uses parameters from "athinput" to define a Riemann problem with a
... | PrincetonUniversityREPO_NAMEathenaPATH_START.@athena_extracted@athena-master@tst@regression@scripts@utils@RiemannSolver@AthenaWrapper.py@.PATH_END.py |
{
"filename": "_style.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/barpolar/marker/colorbar/tickfont/_style.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class StyleValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="style",
parent_name="barpolar.marker.colorbar.tickfont",
**kwargs,
):
super(StyleValidator, self).__init__(
plotly_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@barpolar@marker@colorbar@tickfont@_style.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/sankey/stream/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._token import TokenValidator
from ._maxpoints import MaxpointsValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@sankey@stream@__init__.py@.PATH_END.py |
{
"filename": "spherical_convolution.py",
"repo_name": "neuraloperator/neuraloperator",
"repo_path": "neuraloperator_extracted/neuraloperator-main/neuralop/layers/spherical_convolution.py",
"type": "Python"
} | from typing import List, Optional, Union
import torch
from torch import nn
from torch_harmonics import RealSHT, InverseRealSHT
import tensorly as tl
from tensorly.plugins import use_opt_einsum
from tltorch.factorized_tensors.core import FactorizedTensor
from neuralop.utils import validate_scaling_factor
from .base_s... | neuraloperatorREPO_NAMEneuraloperatorPATH_START.@neuraloperator_extracted@neuraloperator-main@neuralop@layers@spherical_convolution.py@.PATH_END.py |
{
"filename": "mol_dens.py",
"repo_name": "rlaugier/SCIFYsim",
"repo_path": "SCIFYsim_extracted/SCIFYsim-master/scifysim/mol_dens.py",
"type": "Python"
} | import numpy as np
import logging
logit = logging.getLogger(__name__)
def set_logging_level(level=logging.WARNING):
logit.setLevel(level=level)
logit.info("Setting the logging level to %s"%(level))
def mol_dens( temp, pres, rhum, co2, ph2o=None,
wvdens=False):
"""
**PURPOSE:**
Returns... | rlaugierREPO_NAMESCIFYsimPATH_START.@SCIFYsim_extracted@SCIFYsim-master@scifysim@mol_dens.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "LSSTDESC/Imsim",
"repo_path": "Imsim_extracted/Imsim-main/imsim/utils.py",
"type": "Python"
} | """Shared functionality"""
import warnings
from functools import wraps
import erfa
from astropy.utils import iers
# These need conda (via stackvana). Not pip-installable
from lsst.afw import cameraGeom
from lsst.geom import Point2D
import numpy as np
# Disable auto downloads of IERS correction and leap second data... | LSSTDESCREPO_NAMEImsimPATH_START.@Imsim_extracted@Imsim-main@imsim@utils.py@.PATH_END.py |
{
"filename": "OrbitalElements.ipynb",
"repo_name": "tigerchenlu98/rebound",
"repo_path": "rebound_extracted/rebound-main/ipython_examples/OrbitalElements.ipynb",
"type": "Jupyter Notebook"
} | # Orbital Elements
**Note: All angles for orbital elements are in radians**
We can add particles to a simulation by specifying cartesian components:
```python
import rebound
sim = rebound.Simulation()
sim.add(m=1., x=1., vz = 2.)
```
Any components not passed automatically default to 0. REBOUND can also accept o... | tigerchenlu98REPO_NAMEreboundPATH_START.@rebound_extracted@rebound-main@ipython_examples@OrbitalElements.ipynb@.PATH_END.py |
{
"filename": "channels.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/jupyter-client/py2/jupyter_client/blocking/channels.py",
"type": "Python"
} | """Blocking channels
Useful for test suites and blocking terminal interfaces.
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
try:
from queue import Queue, Empty # Py 3
except ImportError:
from Queue import Queue, Empty # Py 2
class ZMQSocketChanne... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@jupyter-client@py2@jupyter_client@blocking@channels.py@.PATH_END.py |
{
"filename": "chromium.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/document_loaders/chromium.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import AsyncChromiumLoader
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional im... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@document_loaders@chromium.py@.PATH_END.py |
{
"filename": "atom_web_download.py",
"repo_name": "tardis-sn/tardis",
"repo_path": "tardis_extracted/tardis-main/tardis/io/atom_data/atom_web_download.py",
"type": "Python"
} | import os
import logging
from tardis.io.util import get_internal_data_path, download_from_url
from tardis.io.config_internal import get_data_dir
import yaml
logger = logging.getLogger(__name__)
def get_atomic_repo_config():
"""
Get the repo configuration dictionary for the atomic data
Returns
-----... | tardis-snREPO_NAMEtardisPATH_START.@tardis_extracted@tardis-main@tardis@io@atom_data@atom_web_download.py@.PATH_END.py |
{
"filename": "adr-02.md",
"repo_name": "skypyproject/skypy",
"repo_path": "skypy_extracted/skypy-main/docs/arch/adr-02.md",
"type": "Markdown"
} | # ADR 2: Mpc or Mpc/h
February 6, 2020
## Context
We need to decide on a unit convention as to whether units include the factor /h or not (for instance Mpc or Mpc/h as a unit of distance). For further discussion see e.g. 10.1017/pasa.2013.31
## Decision Drivers
- Flexibility: Mpc/h allows results to be easily propaga... | skypyprojectREPO_NAMEskypyPATH_START.@skypy_extracted@skypy-main@docs@arch@adr-02.md@.PATH_END.py |
{
"filename": "widget_string.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/ipywidgets/py2/ipywidgets/widgets/widget_string.py",
"type": "Python"
} | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""String class.
Represents a unicode string using a widget.
"""
from .widget_description import DescriptionWidget
from .valuewidget import ValueWidget
from .widget import CallbackDispatcher, register
from .widget_co... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipywidgets@py2@ipywidgets@widgets@widget_string.py@.PATH_END.py |
{
"filename": "test_utility_events_clients.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/tests/events/client/test_utility_events_clients.py",
"type": "Python"
} | from typing import Type
import pytest
from prefect.events import Event
from prefect.events.clients import AssertingEventsClient, EventsClient, NullEventsClient
async def test_null_events_client_does_nothing(example_event_1: Event):
async with NullEventsClient() as client:
await client.emit(example_event... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@tests@events@client@test_utility_events_clients.py@.PATH_END.py |
{
"filename": "security_enums.py",
"repo_name": "mhammond/pywin32",
"repo_path": "pywin32_extracted/pywin32-main/win32/Demos/security/security_enums.py",
"type": "Python"
} | import ntsecuritycon
import win32security
import winnt
class Enum:
def __init__(self, *const_names):
"""Accepts variable number of constant names that can be found in either
win32security, ntsecuritycon, or winnt."""
for const_name in const_names:
try:
const_val... | mhammondREPO_NAMEpywin32PATH_START.@pywin32_extracted@pywin32-main@win32@Demos@security@security_enums.py@.PATH_END.py |
{
"filename": "test_lapack.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/linalg/tests/test_lapack.py",
"type": "Python"
} | #
# Created by: Pearu Peterson, September 2002
#
from functools import reduce
import random
from numpy.testing import (assert_equal, assert_array_almost_equal, assert_,
assert_allclose, assert_almost_equal,
assert_array_equal)
import pytest
from pytest import rais... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@linalg@tests@test_lapack.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "sblunt/orbitize",
"repo_path": "orbitize_extracted/orbitize-main/tests/__init__.py",
"type": "Python"
} | sbluntREPO_NAMEorbitizePATH_START.@orbitize_extracted@orbitize-main@tests@__init__.py@.PATH_END.py | |
{
"filename": "python__eval-metrics__purpose.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage/python__eval-metrics__purpose.md",
"type": "Markdown"
} |
Calculate the specified metrics for the specified dataset.
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage@python__eval-metrics__purpose.md@.PATH_END.py |
{
"filename": "commands.py",
"repo_name": "toros-astro/corral",
"repo_path": "corral_extracted/corral-master/tests/commands.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2017, Cabral, Juan; Sanchez, Bruno & Berois, Martín
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of sourc... | toros-astroREPO_NAMEcorralPATH_START.@corral_extracted@corral-master@tests@commands.py@.PATH_END.py |
{
"filename": "test_analytics_task.py",
"repo_name": "mikecokina/elisa",
"repo_path": "elisa_extracted/elisa-master/unittests/test_analytics_task.py",
"type": "Python"
} | # keep it first
# due to stupid astropy units/constants implementation
from unittests import set_astropy_units
from unittest import mock
import numpy as np
from elisa import units as u
from elisa.analytics import LCData, LCBinaryAnalyticsTask, RVData, RVBinaryAnalyticsTask
from elisa.analytics.params.parameters impor... | mikecokinaREPO_NAMEelisaPATH_START.@elisa_extracted@elisa-master@unittests@test_analytics_task.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/volume/colorbar/tickfont/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._size import SizeValidator
from ._family import FamilyValidator
from ._color import ColorValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__,
[],
["._siz... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@volume@colorbar@tickfont@__init__.py@.PATH_END.py |
{
"filename": "moments_3d_omega_weights.py",
"repo_name": "spedas/pyspedas",
"repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/particles/moments/moments_3d_omega_weights.py",
"type": "Python"
} | import numpy as np
def moments_3d_omega_weights(theta, phi, dtheta, dphi):
"""
Helper function used by moments_3d
Parameters
----------
theta: numpy.ndarray
theta bin values
phi: numpy.ndarray
phi bin values
dtheta: numpy.ndarray
Widths of... | spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@particles@moments@moments_3d_omega_weights.py@.PATH_END.py |
{
"filename": "util.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/fonttools/fontTools/subset/util.py",
"type": "Python"
} | """Private utility methods used by the subset modules"""
def _add_method(*clazzes):
"""Returns a decorator function that adds a new method to one or
more classes."""
def wrapper(method):
done = []
for clazz in clazzes:
if clazz in done:
continue # Support mult... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@fonttools@fontTools@subset@util.py@.PATH_END.py |
{
"filename": "DebugFlags.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/tools/cython/Cython/Compiler/DebugFlags.py",
"type": "Python"
} | # Can be enabled at the command line with --debug-xxx.
debug_disposal_code = 0
debug_temp_alloc = 0
debug_coercion = 0
# Write comments into the C code that show where temporary variables
# are allocated and released.
debug_temp_code_comments = 0
# Write a call trace of the code generation phase into the C code.
deb... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@cython@Cython@Compiler@DebugFlags.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/README.md",
"type": "Markdown"
} | # 🦜️🧑🤝🧑 LangChain Community
[](https://pepy.tech/project/langchain_community)
[](https://opensource.org/licenses/MIT)
## Quick Install
```bash
pip install langchain-communit... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@README.md@.PATH_END.py |
{
"filename": "modellib_utils.py",
"repo_name": "lime-rt/lime",
"repo_path": "lime_extracted/lime-master/python/modellib_utils.py",
"type": "Python"
} | #!/usr/bin/python
#
# modellib_utils.py
# This file is part of LIME, the versatile line modeling engine.
#
# This module is intended to provide sufficient direct access to 'modellib_classes' to allow the CASA task 'limesolver' to run. Note that modellib.py cannot be used for this purpose because that assumes the exi... | lime-rtREPO_NAMElimePATH_START.@lime_extracted@lime-master@python@modellib_utils.py@.PATH_END.py |
{
"filename": "observation.py",
"repo_name": "Magritte-code/pomme",
"repo_path": "pomme_extracted/pomme-main/src/pomme/observation.py",
"type": "Python"
} | import torch
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits
from astropy import units
from ipywidgets import interact
from radio_beam import Beam as RadioBeam
from astropy.convolution import convolve
# class Observation:
# def... | Magritte-codeREPO_NAMEpommePATH_START.@pomme_extracted@pomme-main@src@pomme@observation.py@.PATH_END.py |
{
"filename": "data.py",
"repo_name": "igmhub/picca",
"repo_path": "picca_extracted/picca-master/py/picca/data.py",
"type": "Python"
} | """This module defines data structure to deal with line of sight data.
This module provides with three classes (QSO, Forest, Delta)
to manage the line-of-sight data.
See the respective docstrings for more details
"""
import numpy as np
from itertools import repeat
import warnings
from . import constants
from .utils i... | igmhubREPO_NAMEpiccaPATH_START.@picca_extracted@picca-master@py@picca@data.py@.PATH_END.py |
{
"filename": "calculator.py",
"repo_name": "NannyML/nannyml",
"repo_path": "nannyml_extracted/nannyml-main/nannyml/stats/avg/calculator.py",
"type": "Python"
} | # Author: Nikolaos Perrakis <nikos@nannyml.com>
#
# License: Apache Software License 2.0
"""Simple Statistics Average Calculator."""
from typing import Any, Dict, List, Optional, Union
import numpy as np
import pandas as pd
from pandas import MultiIndex
from nannyml.base import AbstractCalculator, _list_missin... | NannyMLREPO_NAMEnannymlPATH_START.@nannyml_extracted@nannyml-main@nannyml@stats@avg@calculator.py@.PATH_END.py |
{
"filename": "abscal_inspect_2458134.ipynb",
"repo_name": "HERA-Team/H1C_IDR3_Notebooks",
"repo_path": "H1C_IDR3_Notebooks-main/abscal_inspect/abscal_inspect_2458134.ipynb",
"type": "Jupyter Notebook"
} | # Stage 2 Absolute Calibration Nightly Notebook
**Josh Dillon**, Last Revised 9/23/20
```python
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from hera_cal import io, redcal, apply_cal, abscal, utils
from hera_cal.smooth_cal import build_time_blacklist
from hera_qm.metrics_io import load_metri... | HERA-TeamREPO_NAMEH1C_IDR3_NotebooksPATH_START.@H1C_IDR3_Notebooks-main@abscal_inspect@abscal_inspect_2458134.ipynb@.PATH_END.py |
{
"filename": "CHANGELOG.md",
"repo_name": "ofionnad/radiowinds",
"repo_path": "radiowinds_extracted/radiowinds-master/CHANGELOG.md",
"type": "Markdown"
} | ### v1.2.0
20.07.2020
DOF
Update the package, fixed some installation bugs etc.
### v1.1.0
29.04.2019
DOF
Update for new release with all previous changes
----------------------------------
### v1.0.1
28.04.2019
DOF
Changed the generateinterpolatedGrid() to include the variable number from tecplot
-----------... | ofionnadREPO_NAMEradiowindsPATH_START.@radiowinds_extracted@radiowinds-master@CHANGELOG.md@.PATH_END.py |
{
"filename": "admin.py",
"repo_name": "RafiKueng/SpaghettiLens",
"repo_path": "SpaghettiLens_extracted/SpaghettiLens-master/_backup2/apps/spaghetti/admin.py",
"type": "Python"
} | #from django.contrib import admin
# Register your models here.
| RafiKuengREPO_NAMESpaghettiLensPATH_START.@SpaghettiLens_extracted@SpaghettiLens-master@_backup2@apps@spaghetti@admin.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "ANSalcedo/Beyond2ptMock",
"repo_path": "Beyond2ptMock_extracted/Beyond2ptMock-main/README.md",
"type": "Markdown"
} | # Beyond-2pt parameter masked data challenge
This data challenge for analyses of galaxy redshift surveys consists of galaxy mock catalogs constructed from N-body halo catalogs using HOD-based galaxy assignments. The aim of this challenge is to provide a benchmark data set for emerging statistics and analysis technique... | ANSalcedoREPO_NAMEBeyond2ptMockPATH_START.@Beyond2ptMock_extracted@Beyond2ptMock-main@README.md@.PATH_END.py |
{
"filename": "_astropy_init.py",
"repo_name": "Astroua/SCIMES",
"repo_path": "SCIMES_extracted/SCIMES-master/scimes/_astropy_init.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
__all__ = ['__version__', '__githash__', 'test']
# this indicates whether or not we are in the package's setup.py
try:
_ASTROPY_SETUP_
except NameError:
from sys import version_info
if version_info[0] >= 3:
import builtins
else:
... | AstrouaREPO_NAMESCIMESPATH_START.@SCIMES_extracted@SCIMES-master@scimes@_astropy_init.py@.PATH_END.py |
{
"filename": "_tickformat.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter/marker/colorbar/_tickformat.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickformatValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="tickformat", parent_name="scatter.marker.colorbar", **kwargs
):
super(TickformatValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter@marker@colorbar@_tickformat.py@.PATH_END.py |
{
"filename": "mesa-linter.py",
"repo_name": "MESAHub/mesa",
"repo_path": "mesa_extracted/mesa-main/linters/mesa-linter.py",
"type": "Python"
} | from __future__ import print_function
import sys
import re
def search(filename, checks, summary=False):
count = 0
with open(str(filename), "r") as f:
for ldx, line in enumerate(f):
if any(line.startswith(i) for i in ["! ", "c ", "C ", "* "]):
# Skip comment lines
... | MESAHubREPO_NAMEmesaPATH_START.@mesa_extracted@mesa-main@linters@mesa-linter.py@.PATH_END.py |
{
"filename": "snr.py",
"repo_name": "gwastro/pycbc",
"repo_path": "pycbc_extracted/pycbc-master/pycbc/results/snr.py",
"type": "Python"
} | # Copyright (C) 2022
# Tito Dal Canton, Gareth Cabourn Davies, Ian Harry
#
# 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 versio... | gwastroREPO_NAMEpycbcPATH_START.@pycbc_extracted@pycbc-master@pycbc@results@snr.py@.PATH_END.py |
{
"filename": "test_imports.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/core/tests/unit_tests/load/test_imports.py",
"type": "Python"
} | from langchain_core.load import __all__
EXPECTED_ALL = ["dumpd", "dumps", "load", "loads", "Serializable"]
def test_all_imports() -> None:
assert set(__all__) == set(EXPECTED_ALL)
| langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@core@tests@unit_tests@load@test_imports.py@.PATH_END.py |
{
"filename": "_textfont.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/scatterpolar/selected/_textfont.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Textfont(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatterpolar.selected"
_path_str = "scatterpolar.selected.textfont"
_valid_props = {"color... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@scatterpolar@selected@_textfont.py@.PATH_END.py |
{
"filename": "test_utils.py",
"repo_name": "zblz/naima",
"repo_path": "naima_extracted/naima-main/src/naima/tests/test_utils.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import astropy.units as u
import numpy as np
from astropy.io import ascii
from astropy.tests.helper import pytest
from astropy.utils.data import get_pkg_data_filename
from numpy.testing import assert_allclose
from ..utils import (
build_data_table,
... | zblzREPO_NAMEnaimaPATH_START.@naima_extracted@naima-main@src@naima@tests@test_utils.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "21cmfast/21CMMC",
"repo_path": "21CMMC_extracted/21CMMC-master/src/py21cmmc/__init__.py",
"type": "Python"
} | """21CMMC: a package for running MCMC analyses using 21cmFAST."""
__version__ = "1.0.0dev3"
from .analyse import get_samples, load_primitive_chain
from .core import (
Core21cmEMU,
CoreCMB,
CoreCoevalModule,
CoreForest,
CoreLightConeModule,
CoreLuminosityFunction,
NotAChain,
NotSetupErro... | 21cmfastREPO_NAME21CMMCPATH_START.@21CMMC_extracted@21CMMC-master@src@py21cmmc@__init__.py@.PATH_END.py |
{
"filename": "deprecated.py",
"repo_name": "glue-viz/glue",
"repo_path": "glue_extracted/glue-main/glue/core/data_factories/deprecated.py",
"type": "Python"
} | from glue.core.data_factories.hdf5 import is_hdf5, extract_hdf5_datasets
from glue.core.data_factories.fits import is_fits, is_image_hdu
from glue.core.coordinates import coordinates_from_header
from glue.core.data import Component, Data
from glue.config import data_factory
from glue.utils import file_format
__all__ ... | glue-vizREPO_NAMEgluePATH_START.@glue_extracted@glue-main@glue@core@data_factories@deprecated.py@.PATH_END.py |
{
"filename": "solver.py",
"repo_name": "jrenaud90/TidalPy",
"repo_path": "TidalPy_extracted/TidalPy-main/TidalPy/radial_solver/numerical/solver.py",
"type": "Python"
} | import warnings
from typing import List, Union, Tuple
import numpy as np
from TidalPy.constants import G
from TidalPy.exceptions import AttributeNotSetError, IntegrationFailed
from TidalPy.utilities.integration import get_integrator, _nb2cy, cyrk_solver
from TidalPy.utilities.performance import nbList
from .collapse... | jrenaud90REPO_NAMETidalPyPATH_START.@TidalPy_extracted@TidalPy-main@TidalPy@radial_solver@numerical@solver.py@.PATH_END.py |
{
"filename": "_hoverinfosrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/surface/_hoverinfosrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HoverinfosrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="hoverinfosrc", parent_name="surface", **kwargs):
super(HoverinfosrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@surface@_hoverinfosrc.py@.PATH_END.py |
{
"filename": "spectral_quantity.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/astropy/coordinates/spectral_quantity.py",
"type": "Python"
} | import numpy as np
from astropy.units import Unit, si
from astropy.units import equivalencies as eq
from astropy.units.decorators import quantity_input
from astropy.units.quantity import Quantity, SpecificTypeQuantity
__all__ = ["SpectralQuantity"]
# We don't want to run doctests in the docstrings we inherit from Qu... | astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@coordinates@spectral_quantity.py@.PATH_END.py |
{
"filename": "_side.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/yaxis/_side.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SideValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="side", parent_name="layout.yaxis", **kwargs):
super(SideValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@yaxis@_side.py@.PATH_END.py |
{
"filename": "test_barycorrpy.py",
"repo_name": "shbhuk/barycorrpy",
"repo_path": "barycorrpy_extracted/barycorrpy-master/barycorrpy/tests/test_barycorrpy.py",
"type": "Python"
} | import unittest
from barycorrpy import get_BC_vel , exposure_meter_BC_vel
import numpy as np
from astropy.time import Time
from barycorrpy import utc_tdb
class Barycorrpy_tests(unittest.TestCase):
def test_hip_id(self):
JDUTC = 2458000 # Also accepts float input for JDUTC. Verify scale and format
... | shbhukREPO_NAMEbarycorrpyPATH_START.@barycorrpy_extracted@barycorrpy-master@barycorrpy@tests@test_barycorrpy.py@.PATH_END.py |
{
"filename": "sdy.py",
"repo_name": "google/jax",
"repo_path": "jax_extracted/jax-main/jax/extend/mlir/dialects/sdy.py",
"type": "Python"
} | # Copyright 2024 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | googleREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@extend@mlir@dialects@sdy.py@.PATH_END.py |
{
"filename": "preds_analysis_ood.py",
"repo_name": "devinamhn/RadioGalaxies-BNNs",
"repo_path": "RadioGalaxies-BNNs_extracted/RadioGalaxies-BNNs-main/radiogalaxies_bnns/eval/ood/preds_analysis_ood.py",
"type": "Python"
} | import torch
import sys
sys.path.append('/share/nas2/dmohan/mcmc/hamildev/hamiltorch')
import hamiltorch
import torch.nn as nn
import torch.nn.functional as F
from pathlib import Path
import numpy as np
import torchvision
# import torchvision.transforms as transforms
from torchvision import datasets
from torchvisio... | devinamhnREPO_NAMERadioGalaxies-BNNsPATH_START.@RadioGalaxies-BNNs_extracted@RadioGalaxies-BNNs-main@radiogalaxies_bnns@eval@ood@preds_analysis_ood.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "DoddyPhysics/HMcode",
"repo_path": "HMcode_extracted/HMcode-master/README.md",
"type": "Markdown"
} | # <a name="top"></a>WarmAndFuzzy
*[Warm and Fuzzy DM](#WarmFuzzy)
*[HMcode Original](#original)
-------------------------------
### <a name="WarmFuzzy"></a>Warm and Fuzzy DM
This addition is by David J.E. Marsh.
This modification is described in detail in the paper, WarmAndFuzzy: the halo model beyond CDM. When usi... | DoddyPhysicsREPO_NAMEHMcodePATH_START.@HMcode_extracted@HMcode-master@README.md@.PATH_END.py |
{
"filename": "write_table.py",
"repo_name": "annayqho/TheCannon",
"repo_path": "TheCannon_extracted/TheCannon-master/code/lamost/xcalib_5labels/make_lamost_catalog/write_table.py",
"type": "Python"
} | import numpy as np
print("loading test data")
id_test = np.load("id_all.npz")['arr_0']
label_test = np.load("label_all.npz")['arr_0'].T
err_test = np.load("errs_all.npz")['arr_0'].T
npix_test = np.load("npix_all.npz")['arr_0']
# when a fit fails, I set the error to -9999
print("loading test errs")
teff_err_test = np.... | annayqhoREPO_NAMETheCannonPATH_START.@TheCannon_extracted@TheCannon-master@code@lamost@xcalib_5labels@make_lamost_catalog@write_table.py@.PATH_END.py |
{
"filename": "_align.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/densitymap/hoverlabel/_align.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class AlignValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="align", parent_name="densitymap.hoverlabel", **kwargs
):
super(AlignValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@densitymap@hoverlabel@_align.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/surface/lighting/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._specular import SpecularValidator
from ._roughness import RoughnessValidator
from ._fresnel import FresnelValidator
from ._diffuse import DiffuseValidator
from ._ambient import AmbientValidator
else:
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@surface@lighting@__init__.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.