metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "_style.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/bar/textfont/_style.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class StyleValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="style", parent_name="bar.textfont", **kwargs):
super(StyleValidator, 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@bar@textfont@_style.py@.PATH_END.py |
{
"filename": "test_fluxcal.py",
"repo_name": "SAMI-Galaxy-Survey/sami",
"repo_path": "sami_extracted/sami-master/tests/test_fluxcal.py",
"type": "Python"
} | import pytest
from sami.qc import fluxcal
def test_get_sdss_data():
result = fluxcal.get_sdss_stellar_mags(["a"], [(15.5, 0.5)], automatic=True)
print(result)
assert result == ("name,objID,ra,dec,type,psfMag_u,psfMagErr_u,psfMag_g,psfMagErr_g,psfMag_r,psfMagErr_r,psfMag_i,psfMagErr_i,psfMag_z,psfMagErr_... | SAMI-Galaxy-SurveyREPO_NAMEsamiPATH_START.@sami_extracted@sami-master@tests@test_fluxcal.py@.PATH_END.py |
{
"filename": "test_deferredCharge.py",
"repo_name": "lsst/cp_pipe",
"repo_path": "cp_pipe_extracted/cp_pipe-main/tests/test_deferredCharge.py",
"type": "Python"
} | #
# LSST Data Management System
#
# Copyright 2008-2017 AURA/LSST.
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# 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 Softwa... | lsstREPO_NAMEcp_pipePATH_START.@cp_pipe_extracted@cp_pipe-main@tests@test_deferredCharge.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "oliverphilcox/HIPSTER",
"repo_path": "HIPSTER_extracted/HIPSTER-master/docs/conf.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | oliverphilcoxREPO_NAMEHIPSTERPATH_START.@HIPSTER_extracted@HIPSTER-master@docs@conf.py@.PATH_END.py |
{
"filename": "test_to_series.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/indexes/datetimes/methods/test_to_series.py",
"type": "Python"
} | import numpy as np
from pandas import (
DatetimeIndex,
Series,
)
import pandas._testing as tm
class TestToSeries:
def test_to_series(self):
naive = DatetimeIndex(["2013-1-1 13:00", "2013-1-2 14:00"], name="B")
idx = naive.tz_localize("US/Pacific")
expected = Series(np.array(idx.t... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@indexes@datetimes@methods@test_to_series.py@.PATH_END.py |
{
"filename": "plot.py",
"repo_name": "jdhenshaw/acorns",
"repo_path": "acorns_extracted/acorns-master/examples/plot.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
from acorns import Acorns
from matplotlib.pyplot import cm
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import colors
import sys
datadirectory = './'
datafilename = datadirectory+'fits_final_pdbi.dat'
# Load in data
dataarr = np.loadtxt(datafilename)... | jdhenshawREPO_NAMEacornsPATH_START.@acorns_extracted@acorns-master@examples@plot.py@.PATH_END.py |
{
"filename": "apply-node-js.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/concepts/apply-node-js.md",
"type": "Markdown"
} | # CatBoost Model Node package
A Node.js package for applying pretrained CatBoost models.
## Installation
Install the package. You have two options:
- Install from npm registry:
```sh
npm i catboost
```
- Build package from source.
{% include [get-source-code-from-github](../_in... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@concepts@apply-node-js.md@.PATH_END.py |
{
"filename": "convert_bahamas_hdf5_particles_to_bigfile_grid.py",
"repo_name": "sjforeman/bskit",
"repo_path": "bskit_extracted/bskit-master/scripts/grids/convert_bahamas_hdf5_particles_to_bigfile_grid.py",
"type": "Python"
} | """Convert BAHAMAS HDF5 particle snapshot to density grid in bigfile format.
Output format is a grid of 1+\delta(\vec{x}), *NOT* corrected for the CIC mass
assignment (this needs to be corrected separately before any statistics are measured).
"""
import numpy as np
import matplotlib.pyplot as plt
import argparse
impo... | sjforemanREPO_NAMEbskitPATH_START.@bskit_extracted@bskit-master@scripts@grids@convert_bahamas_hdf5_particles_to_bigfile_grid.py@.PATH_END.py |
{
"filename": "depthwise_conv_op_d9m_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/kernel_tests/nn_ops/depthwise_conv_op_d9m_test.py",
"type": "Python"
} | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@kernel_tests@nn_ops@depthwise_conv_op_d9m_test.py@.PATH_END.py |
{
"filename": "compare_Cls.py",
"repo_name": "CosmicFish/CosmicFish",
"repo_path": "CosmicFish_extracted/CosmicFish-master/camb/mgcamb/tests/python/compare_Cls.py",
"type": "Python"
} | import CAMB_plots_lib.CAMB_comp_plots as Cplt
import CAMB_plots_lib.plot_colors as pltcol
import matplotlib.pyplot as plt
import numpy as np
import math
import sys
# parse command line arguments
root1 = sys.argv[1]
root2 = sys.argv[2]
outroot = sys.argv[3]
print "Comparing: ", root1, " and ", root2
i... | CosmicFishREPO_NAMECosmicFishPATH_START.@CosmicFish_extracted@CosmicFish-master@camb@mgcamb@tests@python@compare_Cls.py@.PATH_END.py |
{
"filename": "test_exposure.py",
"repo_name": "StingraySoftware/HENDRICS",
"repo_path": "HENDRICS_extracted/HENDRICS-main/hendrics/tests/test_exposure.py",
"type": "Python"
} | import numpy as np
from hendrics import exposure
def test_exposure_calculation1():
"""Test if the exposure calculator works correctly."""
times = np.array([1.0, 2.0, 3.0])
events = np.array([2.0])
priors = np.array([2.0])
dt = np.array([1.0, 1.0, 1.0])
expo = exposure.get_livetime_per_bin(tim... | StingraySoftwareREPO_NAMEHENDRICSPATH_START.@HENDRICS_extracted@HENDRICS-main@hendrics@tests@test_exposure.py@.PATH_END.py |
{
"filename": "_layer.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/shape/_layer.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LayerValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="layer", parent_name="layout.shape", **kwargs):
super(LayerValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@shape@_layer.py@.PATH_END.py |
{
"filename": "parallelize.py",
"repo_name": "vaexio/vaex",
"repo_path": "vaex_extracted/vaex-master/packages/vaex-core/vaex/misc/parallelize.py",
"type": "Python"
} | from __future__ import print_function
# -*- coding: utf-8 -*-
import threading
import queue
import sys
import os
import pickle
from io import StringIO
import traceback
import time
import signal
import multiprocessing
pickle_encoding = "hex"
pickle_protocol = 2
def log(*args):
#print "LOG: " + " ".join([str(k) for... | vaexioREPO_NAMEvaexPATH_START.@vaex_extracted@vaex-master@packages@vaex-core@vaex@misc@parallelize.py@.PATH_END.py |
{
"filename": "generateGCMfigure.py",
"repo_name": "nespinoza/wasp39-terminators",
"repo_path": "wasp39-terminators_extracted/wasp39-terminators-main/figure3/generateGCMfigure.py",
"type": "Python"
} | import netCDF4 as nc
import numpy as np
import matplotlib.pylab as plt
from matplotlib.lines import Line2D
from matplotlib.offsetbox import AnchoredText
import astropy.units as u
# ============================================= Setting up grid for plotting ===========================================
fig = plt.figure(fi... | nespinozaREPO_NAMEwasp39-terminatorsPATH_START.@wasp39-terminators_extracted@wasp39-terminators-main@figure3@generateGCMfigure.py@.PATH_END.py |
{
"filename": "constants.py",
"repo_name": "JALusk/Lumiere",
"repo_path": "Lumiere_extracted/Lumiere-master/superbol/constants.py",
"type": "Python"
} | """Constants for use by the bolometric correction routine
"""
# Coefficients for polynomial fit to bolometric correction - color relation
coeff_BminusV = [-0.823, 5.027, -13.409, 20.133, -18.096, 9.084, -1.950]
coeff_VminusI = [-1.355, 6.262, -2.676, -22.973, 35.524, -15.340]
coeff_BminusI = [-1.096, 3.038, -2.246, -0... | JALuskREPO_NAMELumierePATH_START.@Lumiere_extracted@Lumiere-master@superbol@constants.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/bar/selected/marker/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="bar.selected.marker", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@bar@selected@marker@_color.py@.PATH_END.py |
{
"filename": "fantasy.py",
"repo_name": "einsteinpy/einsteinpy",
"repo_path": "einsteinpy_extracted/einsteinpy-main/src/einsteinpy/integrators/fantasy.py",
"type": "Python"
} | import warnings
import numpy as np
from .utils import _Z, _flow_A, _flow_B, _flow_mixed
class GeodesicIntegrator:
"""
Geodesic Integrator, based on [1]_.
This module uses Forward Mode Automatic Differentiation
to calculate metric derivatives to machine precision
leading to stable simulations.
... | einsteinpyREPO_NAMEeinsteinpyPATH_START.@einsteinpy_extracted@einsteinpy-main@src@einsteinpy@integrators@fantasy.py@.PATH_END.py |
{
"filename": "test_basic.py",
"repo_name": "Smithsonian/ngehtsim",
"repo_path": "ngehtsim_extracted/ngehtsim-main/tests/test_basic.py",
"type": "Python"
} | #######################################################
# imports
import numpy as np
import ehtim as eh
import yaml
import os
import ngehtsim.obs.obs_generator as og
import ngehtsim.const_def as const
#######################################################
# make an observation generator
# input settings file
yamlfi... | SmithsonianREPO_NAMEngehtsimPATH_START.@ngehtsim_extracted@ngehtsim-main@tests@test_basic.py@.PATH_END.py |
{
"filename": "tmUtils.py",
"repo_name": "nicokurtovic/SIMIO",
"repo_path": "SIMIO_extracted/SIMIO-main/codes/analysis_scripts/tmUtils.py",
"type": "Python"
} | """
Utilities for getting TMCDB data and plotting time-series data.
2013-09-16 thunter: added support for vector quantities, such as IFProc0 GAINS, including showing
the requested index in the title and in the plot filename
2013-01-08 pmerino: changes for the definitive structure of directories of m... | nicokurtovicREPO_NAMESIMIOPATH_START.@SIMIO_extracted@SIMIO-main@codes@analysis_scripts@tmUtils.py@.PATH_END.py |
{
"filename": "_uid.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/histogram2dcontour/_uid.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class UidValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="uid", parent_name="histogram2dcontour", **kwargs):
super(UidValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@histogram2dcontour@_uid.py@.PATH_END.py |
{
"filename": "Tutorial - Calculating Standard Metrics - Binary Classification.ipynb",
"repo_name": "NannyML/nannyml",
"repo_path": "nannyml_extracted/nannyml-main/docs/example_notebooks/Tutorial - Calculating Standard Metrics - Binary Classification.ipynb",
"type": "Jupyter Notebook"
} | ```python
import nannyml as nml
from IPython.display import display
reference_df, analysis_df, analysis_targets_df = nml.load_synthetic_car_loan_dataset()
analysis_df = analysis_df.merge(analysis_targets_df, left_index=True, right_index=True)
display(reference_df.head(3))
```
<div>
<style scoped>
.dataframe tb... | NannyMLREPO_NAMEnannymlPATH_START.@nannyml_extracted@nannyml-main@docs@example_notebooks@Tutorial - Calculating Standard Metrics - Binary Classification.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/pydantic_v1/__init__.py",
"type": "Python"
} | from importlib import metadata
from langchain_core._api import warn_deprecated
## Create namespaces for pydantic v1 and v2.
# This code must stay at the top of the file before other modules may
# attempt to import pydantic since it adds pydantic_v1 and pydantic_v2 to sys.modules.
#
# This hack is done for the followi... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@pydantic_v1@__init__.py@.PATH_END.py |
{
"filename": "mixing_AGN_jet_simple.ipynb",
"repo_name": "me-manu/gammaALPs",
"repo_path": "gammaALPs_extracted/gammaALPs-master/docs/tutorials/mixing_AGN_jet_simple.ipynb",
"type": "Jupyter Notebook"
} | [](https://colab.research.google.com/github/me-manu/gammaALPs/blob/master/docs/tutorials/mixing_AGN_jet_simple.ipynb)
# Mixing in AGN jet with simple toroidal magnetic field
In this example, we will consider the conversion in the AGN jet and th... | me-manuREPO_NAMEgammaALPsPATH_START.@gammaALPs_extracted@gammaALPs-master@docs@tutorials@mixing_AGN_jet_simple.ipynb@.PATH_END.py |
{
"filename": "_enabled.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/densitymap/colorbar/tickformatstop/_enabled.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class EnabledValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name="enabled",
parent_name="densitymap.colorbar.tickformatstop",
**kwargs,
):
super(EnabledValidator, self).__init__(
plotl... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@densitymap@colorbar@tickformatstop@_enabled.py@.PATH_END.py |
{
"filename": "readme.md",
"repo_name": "bd-j/forcepho",
"repo_path": "forcepho_extracted/forcepho-main/tests/galsim_tests/test_psf/psf_images/hst/readme.md",
"type": "Markdown"
} | # HST PSFs
Location for HST PSFs images, named `<band>_psf.fits`.
Current PSFs empirically generated from stars in combined HLF GOODS-S mosaics. | bd-jREPO_NAMEforcephoPATH_START.@forcepho_extracted@forcepho-main@tests@galsim_tests@test_psf@psf_images@hst@readme.md@.PATH_END.py |
{
"filename": "test_fitstime.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/astropy/io/fits/tests/test_fitstime.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from astropy.coordinates import EarthLocation
from astropy.io import fits
from astropy.io.fits.fitstime import (
GLOBAL_TIME_INFO,
is_time_column_keyword,
time_to_fits,
)
from astropy.table import Column, QTab... | astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@io@fits@tests@test_fitstime.py@.PATH_END.py |
{
"filename": "oft.md",
"repo_name": "huggingface/peft",
"repo_path": "peft_extracted/peft-main/docs/source/package_reference/oft.md",
"type": "Markdown"
} | <!--Copyright 2023 The HuggingFace Team. 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 applicable law or agreed... | huggingfaceREPO_NAMEpeftPATH_START.@peft_extracted@peft-main@docs@source@package_reference@oft.md@.PATH_END.py |
{
"filename": "test_descriptors.py",
"repo_name": "GeminiDRSoftware/DRAGONS",
"repo_path": "DRAGONS_extracted/DRAGONS-master/gemini_instruments/gemini/tests/test_descriptors.py",
"type": "Python"
} | #!/usr/bin/env python
import datetime
import pytest
import astrodata
import astrodata.testing
import gemini_instruments
DESCRIPTORS_TYPES = [
('airmass', float),
('amp_read_area', list),
('ao_seeing', float),
('array_name', list),
('array_section', list),
('azimuth', float),
('calibration_... | GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@gemini_instruments@gemini@tests@test_descriptors.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "ratt-ru/QuartiCal",
"repo_path": "QuartiCal_extracted/QuartiCal-main/quartical/interpolation/__init__.py",
"type": "Python"
} | ratt-ruREPO_NAMEQuartiCalPATH_START.@QuartiCal_extracted@QuartiCal-main@quartical@interpolation@__init__.py@.PATH_END.py | |
{
"filename": "format.py",
"repo_name": "dzesmin/TEA",
"repo_path": "TEA_extracted/TEA-master/tea/format.py",
"type": "Python"
} |
############################# BEGIN FRONTMATTER ################################
# #
# TEA - calculates Thermochemical Equilibrium Abundances of chemical species #
# ... | dzesminREPO_NAMETEAPATH_START.@TEA_extracted@TEA-master@tea@format.py@.PATH_END.py |
{
"filename": "_scalar_mediator_spectra.py",
"repo_name": "LoganAMorrison/Hazma",
"repo_path": "Hazma_extracted/Hazma-master/hazma/scalar_mediator/_scalar_mediator_spectra.py",
"type": "Python"
} | import numpy as np
from hazma import spectra
from hazma.parameters import muon_mass as mmu
from hazma.parameters import electron_mass as me
from hazma.scalar_mediator.scalar_mediator_decay_spectrum import (
scalar_mediator_decay_spectrum,
)
SM_DECAY_MODES = ["pi pi", "mu mu", "pi0 pi0", "g g", "e e g", "pi pi g... | LoganAMorrisonREPO_NAMEHazmaPATH_START.@Hazma_extracted@Hazma-master@hazma@scalar_mediator@_scalar_mediator_spectra.py@.PATH_END.py |
{
"filename": "2022_08_06_130009_296e2665785f_expand_deployment_schema_for_improved_ux.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/prefect/server/database/_migrations/versions/sqlite/2022_08_06_130009_296e2665785f_expand_deployment_schema_for_improved_ux.py",
"type": ... | """Expand deployment schema for improved ux
Revision ID: 296e2665785f
Revises: 53c19b31aa09
Create Date: 2022-08-06 13:00:09.419944
"""
import sqlalchemy as sa
from alembic import op
import prefect
# revision identifiers, used by Alembic.
revision = "296e2665785f"
down_revision = "53c19b31aa09"
branch_labels = Non... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@server@database@_migrations@versions@sqlite@2022_08_06_130009_296e2665785f_expand_deployment_schema_for_improved_ux.py@.PATH_END.py |
{
"filename": "multinest_sampler.py",
"repo_name": "lenstronomy/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/lenstronomy/Sampling/Samplers/multinest_sampler.py",
"type": "Python"
} | __author__ = "aymgal"
import os
import json
import shutil
import numpy as np
from lenstronomy.Sampling.Samplers.base_nested_sampler import NestedSampler
__all__ = ["MultiNestSampler"]
class MultiNestSampler(NestedSampler):
"""Wrapper for nested sampling algorithm MultInest by F.
Feroz & M. Hobson
pape... | lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@lenstronomy@Sampling@Samplers@multinest_sampler.py@.PATH_END.py |
{
"filename": "resolvers.py",
"repo_name": "davidharvey1986/pyRRG",
"repo_path": "pyRRG_extracted/pyRRG-master/unittests/bugFixPyRRG/lib/python3.7/site-packages/pip/_vendor/resolvelib/resolvers.py",
"type": "Python"
} | import collections
from .providers import AbstractResolver
from .structs import DirectedGraph
RequirementInformation = collections.namedtuple(
"RequirementInformation", ["requirement", "parent"]
)
class ResolverException(Exception):
"""A base class for all exceptions raised by this module.
Exceptions ... | davidharvey1986REPO_NAMEpyRRGPATH_START.@pyRRG_extracted@pyRRG-master@unittests@bugFixPyRRG@lib@python3.7@site-packages@pip@_vendor@resolvelib@resolvers.py@.PATH_END.py |
{
"filename": "order_trace_result_combine.py",
"repo_name": "Keck-DataReductionPipelines/KPF-Pipeline",
"repo_path": "KPF-Pipeline_extracted/KPF-Pipeline-master/modules/order_trace/src/order_trace_result_combine.py",
"type": "Python"
} | # Standard dependencies
"""
This module defines class `OrderTraceCombine` which combines multiple order trace tabular results
into one table.
Attributes:
OrderTraceCombine
Description:
* Method `__init__`:
OrderTraceCombine constructor, the following arguments are passed ... | Keck-DataReductionPipelinesREPO_NAMEKPF-PipelinePATH_START.@KPF-Pipeline_extracted@KPF-Pipeline-master@modules@order_trace@src@order_trace_result_combine.py@.PATH_END.py |
{
"filename": "Sort_files.py",
"repo_name": "CIERA-Transients/POTPyRI",
"repo_path": "POTPyRI_extracted/POTPyRI-master/Sort_files.py",
"type": "Python"
} | #!/usr/bin/env python
"Function to sort files for main_pipeline."
"Authors: Owen Eskandari, Kerry Paterson"
__version__ = "2.7" #last updated 18/08/2021
from astropy.io import fits
from astropy.table import Table
import os
import time
import shutil
import importlib
import tel_params
import numpy as np
# Sort the ca... | CIERA-TransientsREPO_NAMEPOTPyRIPATH_START.@POTPyRI_extracted@POTPyRI-master@Sort_files.py@.PATH_END.py |
{
"filename": "file_utils.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/utils/file_utils.py",
"type": "Python"
} | import hashlib
import os
import re
import shutil
import tarfile
import urllib
import warnings
import zipfile
from urllib.request import urlretrieve
from keras.src.api_export import keras_export
from keras.src.backend import config
from keras.src.utils import io_utils
from keras.src.utils.module_utils import gfile
from... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@utils@file_utils.py@.PATH_END.py |
{
"filename": "onsite_create_drs4_time_file.py",
"repo_name": "cta-observatory/cta-lstchain",
"repo_path": "cta-lstchain_extracted/cta-lstchain-main/lstchain/scripts/onsite/onsite_create_drs4_time_file.py",
"type": "Python"
} | #!/usr//bin/env python
"""
Onsite script for creating a drs4 time sampling correction file to be run as a command line:
--> onsite_create_drs4_time_file
"""
import argparse
import subprocess
from pathlib import Path
import lstchain
from lstchain.onsite import (
DEFAULT_BASE_PATH,
DEFAULT_CONFIG,
CAT... | cta-observatoryREPO_NAMEcta-lstchainPATH_START.@cta-lstchain_extracted@cta-lstchain-main@lstchain@scripts@onsite@onsite_create_drs4_time_file.py@.PATH_END.py |
{
"filename": "haxe.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/Pygments/py3/pygments/lexers/haxe.py",
"type": "Python"
} | """
pygments.lexers.haxe
~~~~~~~~~~~~~~~~~~~~
Lexers for Haxe and related stuff.
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import ExtendedRegexLexer, RegexLexer, include, bygroups, \
default
fr... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@Pygments@py3@pygments@lexers@haxe.py@.PATH_END.py |
{
"filename": "_showgrid.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/polar/angularaxis/_showgrid.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowgridValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="showgrid", parent_name="layout.polar.angularaxis", **kwargs
):
super(ShowgridValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@polar@angularaxis@_showgrid.py@.PATH_END.py |
{
"filename": "LICENSE.md",
"repo_name": "JuliaDiff/ForwardDiff.jl",
"repo_path": "ForwardDiff.jl_extracted/ForwardDiff.jl-master/LICENSE.md",
"type": "Markdown"
} | ForwardDiff.jl is licensed under the MIT License:
> Copyright (c) 2015: Jarrett Revels, Theodore Papamarkou, Miles Lubin, and other contributors
>
> 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 Soft... | JuliaDiffREPO_NAMEForwardDiff.jlPATH_START.@ForwardDiff.jl_extracted@ForwardDiff.jl-master@LICENSE.md@.PATH_END.py |
{
"filename": "how_to_add_to_example_gallery.md",
"repo_name": "arviz-devs/arviz",
"repo_path": "arviz_extracted/arviz-main/doc/source/contributing/how_to_add_to_example_gallery.md",
"type": "Markdown"
} | # How to add to the Example Gallery
`Matplotlib` file is required for the chart to appear in the {ref}`example_gallery`. `Bokeh` uses the same metadata as long as the Plot Title and `{plot_name}` are the same.
**Use the templates below to create new charts.**
| {Metadata} | Description |
| --- | --- |
| Plot Title |... | arviz-devsREPO_NAMEarvizPATH_START.@arviz_extracted@arviz-main@doc@source@contributing@how_to_add_to_example_gallery.md@.PATH_END.py |
{
"filename": "gpu_training.py",
"repo_name": "dmlc/xgboost",
"repo_path": "xgboost_extracted/xgboost-master/demo/dask/gpu_training.py",
"type": "Python"
} | """
Example of training with Dask on GPU
====================================
"""
import dask
import dask_cudf
from dask import array as da
from dask import dataframe as dd
from dask.distributed import Client
from dask_cuda import LocalCUDACluster
from xgboost import dask as dxgb
from xgboost.dask import DaskDMatrix
... | dmlcREPO_NAMExgboostPATH_START.@xgboost_extracted@xgboost-master@demo@dask@gpu_training.py@.PATH_END.py |
{
"filename": "Frame_Histogram_Info.py",
"repo_name": "francescoa97outlook/pyExoRaMa",
"repo_path": "pyExoRaMa_extracted/pyExoRaMa-main/GUI_Plot/Frame_Histogram_Info.py",
"type": "Python"
} | import tkinter as tk
from tkinter import messagebox as msgbox
def helpButtonFunc():
msgbox.showinfo(title="INFO", message="Plot and statistical options: \nModify the number of bins to be used for the planet mass/radius histograms, and how to represent the counts (linear or logarithmic scale).")
class Frame_Hist... | francescoa97outlookREPO_NAMEpyExoRaMaPATH_START.@pyExoRaMa_extracted@pyExoRaMa-main@GUI_Plot@Frame_Histogram_Info.py@.PATH_END.py |
{
"filename": "test_generate_observation_with_FPT.py",
"repo_name": "Smithsonian/ngehtsim",
"repo_path": "ngehtsim_extracted/ngehtsim-main/tests/test_generate_observation_with_FPT.py",
"type": "Python"
} | #######################################################
# imports
import numpy as np
import matplotlib.pyplot as plt
import ngehtsim.obs.obs_generator as og
#######################################################
# generate an observation with FPT
# input settings file
yamlfile = './tests/data_generation_with_FPT/se... | SmithsonianREPO_NAMEngehtsimPATH_START.@ngehtsim_extracted@ngehtsim-main@tests@test_generate_observation_with_FPT.py@.PATH_END.py |
{
"filename": "test_factory.py",
"repo_name": "PlasmaPy/PlasmaPy",
"repo_path": "PlasmaPy_extracted/PlasmaPy-main/tests/particles/test_factory.py",
"type": "Python"
} | import astropy.units as u
import pytest
from plasmapy.particles import deuteron, electron, proton
from plasmapy.particles._factory import _physical_particle_factory
from plasmapy.particles.exceptions import InvalidParticleError
from plasmapy.particles.particle_class import CustomParticle, Particle
from plasmapy.partic... | PlasmaPyREPO_NAMEPlasmaPyPATH_START.@PlasmaPy_extracted@PlasmaPy-main@tests@particles@test_factory.py@.PATH_END.py |
{
"filename": "test_jeans_instability.py",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/examples/applications/test_jeans_instability.py",
"type": "Python"
} | from amuse.community.athena.interface import Athena
from amuse.units import generic_unit_converter
# from amuse.units import generic_unit_system
from amuse.units import units
from amuse.units import constants
from amuse.test import amusetest
import numpy
try:
from amuse import plot
from matplotlib import pypl... | amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@examples@applications@test_jeans_instability.py@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/image/legendgrouptitle/_font.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="font", parent_name="image.legendgrouptitle", **kwargs
):
super(FontValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@image@legendgrouptitle@_font.py@.PATH_END.py |
{
"filename": "fishing_residuals.ipynb",
"repo_name": "richteague/gofish",
"repo_path": "gofish_extracted/gofish-master/docs/user/fishing_residuals.ipynb",
"type": "Jupyter Notebook"
} | # Searching For (Sub-)Structure in Disks
There is a wealth of information that is hidden in the line emission. While `GoFish` is useful for teasing our low level emission from noisy data, we can also harness the velocity structure to tease out subtle deivations in the background physical or dynamical structure.
This ... | richteagueREPO_NAMEgofishPATH_START.@gofish_extracted@gofish-master@docs@user@fishing_residuals.ipynb@.PATH_END.py |
{
"filename": "cltt_terms.py",
"repo_name": "miguelzuma/hi_class_public",
"repo_path": "hi_class_public_extracted/hi_class_public-master/scripts/cltt_terms.py",
"type": "Python"
} |
# coding: utf-8
# In[ ]:
# import necessary modules
# uncomment to get plots displayed in notebook
#%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from classy import Class
from scipy.optimize import fsolve
from scipy.interpolate import interp1d
import math
# In[ ]:
# esthe... | miguelzumaREPO_NAMEhi_class_publicPATH_START.@hi_class_public_extracted@hi_class_public-master@scripts@cltt_terms.py@.PATH_END.py |
{
"filename": "_familysrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/mesh3d/hoverlabel/font/_familysrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="familysrc", parent_name="mesh3d.hoverlabel.font", **kwargs
):
super(FamilysrcValidator, self).__init__(
plotly_name=plotly_name,
par... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@mesh3d@hoverlabel@font@_familysrc.py@.PATH_END.py |
{
"filename": "light_model_base.py",
"repo_name": "Herculens/herculens",
"repo_path": "herculens_extracted/herculens-main/herculens/LightModel/light_model_base.py",
"type": "Python"
} | # Describes a light model, as a list of light profiles
#
# Copyright (c) 2023, herculens developers and contributors
# Copyright (c) 2018, Simon Birrer & lenstronomy contributors
# based on the LightModel module from lenstronomy (version 1.9.3)
__author__ = 'sibirrer', 'austinpeel', 'aymgal'
import numpy as np
impo... | HerculensREPO_NAMEherculensPATH_START.@herculens_extracted@herculens-main@herculens@LightModel@light_model_base.py@.PATH_END.py |
{
"filename": "reducers.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/redis/py3/redis/commands/search/reducers.py",
"type": "Python"
} | from typing import Union
from .aggregation import Asc, Desc, Reducer, SortDirection
class FieldOnlyReducer(Reducer):
"""See https://redis.io/docs/interact/search-and-query/search/aggregations/"""
def __init__(self, field: str) -> None:
super().__init__(field)
self._field = field
class coun... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@redis@py3@redis@commands@search@reducers.py@.PATH_END.py |
{
"filename": "_style.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/newshape/label/font/_style.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class StyleValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="style", parent_name="layout.newshape.label.font", **kwargs
):
super(StyleValidator, self).__init__(
plotly_name=plotly_name,
pare... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@newshape@label@font@_style.py@.PATH_END.py |
{
"filename": "problem.py",
"repo_name": "tigerchenlu98/rebound",
"repo_path": "rebound_extracted/rebound-main/python_examples/simple_orbit/problem.py",
"type": "Python"
} | # Import the rebound module
import rebound
# Create Simulation object
sim = rebound.Simulation()
# Add particle to rebound
sim.add( m=1. )
sim.add( m=1e-3, a=1., e=0.1 ) # Planet 1
sim.add( a=1.4, e=0.1 ) # Massless test particle
# Output orbits in Jacobi coordinates
for o in sim.orbits(): print... | tigerchenlu98REPO_NAMEreboundPATH_START.@rebound_extracted@rebound-main@python_examples@simple_orbit@problem.py@.PATH_END.py |
{
"filename": "firas_interface.py",
"repo_name": "smsharma/dark-photons-perturbations",
"repo_path": "dark-photons-perturbations_extracted/dark-photons-perturbations-master/cluster/firas_interface.py",
"type": "Python"
} | import sys
sys.path.append("../")
import argparse
import pickle
import numpy as np
from tqdm import *
from grf.grf import FIRAS
from grf.pk_interp import PowerSpectrumGridInterpolator
from grf.units import *
output_dir = "/scratch/sm8383/chi2_arys/firas_dp_scan_"
# output_dir = "/tigress/smsharma/chi2_arys/firas_dp... | smsharmaREPO_NAMEdark-photons-perturbationsPATH_START.@dark-photons-perturbations_extracted@dark-photons-perturbations-master@cluster@firas_interface.py@.PATH_END.py |
{
"filename": "_utils.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/io/_utils.py",
"type": "Python"
} | import plotly
import plotly.graph_objs as go
from plotly.offline import get_plotlyjs_version
def validate_coerce_fig_to_dict(fig, validate):
from plotly.basedatatypes import BaseFigure
if isinstance(fig, BaseFigure):
fig_dict = fig.to_dict()
elif isinstance(fig, dict):
if validate:
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@io@_utils.py@.PATH_END.py |
{
"filename": "modularity_example.py",
"repo_name": "astertaylor/SAMUS",
"repo_path": "SAMUS_extracted/SAMUS-main/build/lib/SAMUS/examples/modularity_example.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 15 15:56:54 2022
@author: Aster Taylor
This script provides a demonstration of how to add functions to the SAMUS class
which provide data outputs. All functions must either take no inputs or take
'self', and use class variables. This script provides examples of both, and... | astertaylorREPO_NAMESAMUSPATH_START.@SAMUS_extracted@SAMUS-main@build@lib@SAMUS@examples@modularity_example.py@.PATH_END.py |
{
"filename": "Tutorial-Start_to_Finish-GiRaFFE_HO-1D_tests.ipynb",
"repo_name": "zachetienne/nrpytutorial",
"repo_path": "nrpytutorial_extracted/nrpytutorial-master/in_progress-GiRaFFE_NRPy/old/Tutorial-Start_to_Finish-GiRaFFE_HO-1D_tests.ipynb",
"type": "Jupyter Notebook"
} | <script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-59152712-8');
</script>
# Start-to-Finish Example: $\text{GiRaFFE_HO}$ 1D tests
##... | zachetienneREPO_NAMEnrpytutorialPATH_START.@nrpytutorial_extracted@nrpytutorial-master@in_progress-GiRaFFE_NRPy@old@Tutorial-Start_to_Finish-GiRaFFE_HO-1D_tests.ipynb@.PATH_END.py |
{
"filename": "igm_model.py",
"repo_name": "ACCarnall/bagpipes",
"repo_path": "bagpipes_extracted/bagpipes-master/bagpipes/models/igm_model.py",
"type": "Python"
} | from __future__ import print_function, division, absolute_import
import numpy as np
from .. import config
def interp_discont(x, xp, fp, xdiscont, left=None, right=None):
"""Interpolates separately on both sides of a discontinuity, not over it"""
i = np.searchsorted(x, xdiscont)
ip = np.searchsorted(xp, ... | ACCarnallREPO_NAMEbagpipesPATH_START.@bagpipes_extracted@bagpipes-master@bagpipes@models@igm_model.py@.PATH_END.py |
{
"filename": "io_example.ipynb",
"repo_name": "HERA-Team/hera_cal",
"repo_path": "hera_cal_extracted/hera_cal-main/scripts/notebooks/io_example.ipynb",
"type": "Jupyter Notebook"
} | # I/O using `HERAData` and `HERACal`
by Josh Dillon (jsdillon@berkeley.edu)
```python
from __future__ import absolute_import, division, print_function
import numpy as np
import os
from hera_cal.io import HERAData, HERACal
from hera_cal.data import DATA_PATH
uvh5_file_1 = os.path.join(DATA_PATH, "zen.2458116.61019.xx... | HERA-TeamREPO_NAMEhera_calPATH_START.@hera_cal_extracted@hera_cal-main@scripts@notebooks@io_example.ipynb@.PATH_END.py |
{
"filename": "lgmres.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/sparse/linalg/_isolve/lgmres.py",
"type": "Python"
} | # Copyright (C) 2009, Pauli Virtanen <pav@iki.fi>
# Distributed under the same license as SciPy.
import warnings
import numpy as np
from numpy.linalg import LinAlgError
from scipy.linalg import get_blas_funcs
from .utils import make_system
from ._gcrotmk import _fgmres
__all__ = ['lgmres']
def lgmres(A, b, x0=None... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@sparse@linalg@_isolve@lgmres.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "AlexandreAdam/score_models",
"repo_path": "score_models_extracted/score_models-master/README.md",
"type": "Markdown"
} | # Score Models for Pytorch
[](https://badge.fury.io/py/score_models)
[](https://codecov.io/gh/AlexandreAdam/torch_score_models)
A storage for score-based models. Th... | AlexandreAdamREPO_NAMEscore_modelsPATH_START.@score_models_extracted@score_models-master@README.md@.PATH_END.py |
{
"filename": "fgfilter.py",
"repo_name": "radiocosmology/draco",
"repo_path": "draco_extracted/draco-master/draco/analysis/fgfilter.py",
"type": "Python"
} | """Tasks for foreground filtering data."""
import numpy as np
from caput import config
from ..core import containers, io, task
class _ProjectFilterBase(task.SingleTask):
"""A base class for projecting data to/from a different basis.
Attributes
----------
mode : string
Which projection to pe... | radiocosmologyREPO_NAMEdracoPATH_START.@draco_extracted@draco-master@draco@analysis@fgfilter.py@.PATH_END.py |
{
"filename": "process_tudelft_data.py",
"repo_name": "spaceml-org/karman",
"repo_path": "karman_extracted/karman-main/scripts/input_data_prep/process_tudelft_data.py",
"type": "Python"
} | import datetime
import os
import bisect
import numpy as np
import argparse
import pandas as pd
import time
import sys
from glob import glob
from tqdm import tqdm
from pyfiglet import Figlet
from termcolor import colored
LEAP_DATES = ((1981, 6, 30), (1982, 6, 30), (1983, 6, 30),
(1985, 6, 30), (1987, 1... | spaceml-orgREPO_NAMEkarmanPATH_START.@karman_extracted@karman-main@scripts@input_data_prep@process_tudelft_data.py@.PATH_END.py |
{
"filename": "_step.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/xaxis/rangeselector/button/_step.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class StepValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="step",
parent_name="layout.xaxis.rangeselector.button",
**kwargs
):
super(StepValidator, self).__init__(
plotly_name=p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@xaxis@rangeselector@button@_step.py@.PATH_END.py |
{
"filename": "test_gsm2016.py",
"repo_name": "telegraphic/pygdsm",
"repo_path": "pygdsm_extracted/pygdsm-master/tests/test_gsm2016.py",
"type": "Python"
} | import sys
sys.path.append("/workdata/pygdsm")
import pylab as plt
import healpy as hp
import numpy as np
from datetime import datetime
import pytest
from pygdsm import GlobalSkyModel16, GSMObserver16
from pygdsm import GlobalSkyModel, GSMObserver
def test_compare_gsm_to_old():
g = GlobalSkyModel16(freq_unit='... | telegraphicREPO_NAMEpygdsmPATH_START.@pygdsm_extracted@pygdsm-master@tests@test_gsm2016.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "ma-xu/pointMLP-pytorch",
"repo_path": "pointMLP-pytorch_extracted/pointMLP-pytorch-main/pointnet2_ops_lib/setup.py",
"type": "Python"
} | import glob
import os
import os.path as osp
from setuptools import find_packages, setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
this_dir = osp.dirname(osp.abspath(__file__))
_ext_src_root = osp.join("pointnet2_ops", "_ext-src")
_ext_sources = glob.glob(osp.join(_ext_src_root, "src", "*.cpp... | ma-xuREPO_NAMEpointMLP-pytorchPATH_START.@pointMLP-pytorch_extracted@pointMLP-pytorch-main@pointnet2_ops_lib@setup.py@.PATH_END.py |
{
"filename": "st_run.py",
"repo_name": "simonsobs/nextline-rdb",
"repo_path": "nextline-rdb_extracted/nextline-rdb-main/src/nextline_rdb/alembic/models/rev_f3edea6dbde2/strategies/st_run.py",
"type": "Python"
} | import datetime as dt
from collections.abc import Iterable
from typing import Callable, Optional, cast
from hypothesis import strategies as st
from nextline_rdb.utils import mark_last
from nextline_test_utils.strategies import st_datetimes, st_graphql_ints, st_none_or
from .. import Run, Script
from .utils import st... | simonsobsREPO_NAMEnextline-rdbPATH_START.@nextline-rdb_extracted@nextline-rdb-main@src@nextline_rdb@alembic@models@rev_f3edea6dbde2@strategies@st_run.py@.PATH_END.py |
{
"filename": "CubeWidget-m101.ipynb",
"repo_name": "HETDEX/hetdex_api",
"repo_path": "hetdex_api_extracted/hetdex_api-master/notebooks/old_notebooks/CubeWidget-m101.ipynb",
"type": "Jupyter Notebook"
} | ## CubeWidget - M101 Example
The CubeWidget provides a visual interface to a Fits datacube using ginga/astrowidgets/ipywidgets. It is developed to function on any FITS cube in which the 1st data axis represents the spectral dim provided the WCS is included. Click on any spatial region to see the spectrum at that pixel... | HETDEXREPO_NAMEhetdex_apiPATH_START.@hetdex_api_extracted@hetdex_api-master@notebooks@old_notebooks@CubeWidget-m101.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "nanograv/PTMCMCSampler",
"repo_path": "PTMCMCSampler_extracted/PTMCMCSampler-master/PTMCMCSampler/__init__.py",
"type": "Python"
} | from PTMCMCSampler import PTMCMCSampler # noqa: F401
from .version import version
__version__ = version
| nanogravREPO_NAMEPTMCMCSamplerPATH_START.@PTMCMCSampler_extracted@PTMCMCSampler-master@PTMCMCSampler@__init__.py@.PATH_END.py |
{
"filename": "quality.py",
"repo_name": "transientskp/tkp",
"repo_path": "tkp_extracted/tkp-master/tkp/telescope/generic/quality.py",
"type": "Python"
} | import numpy as np
import logging
import tkp.db.quality as dbquality
logger = logging.getLogger(__name__)
def reject_check_generic_data(accessor):
"""
Args:
accessor: tkp.db.accessor image accessor
Returns: A rejection reason if the image is bad, None otherwise
"""
flat = reject_check_fla... | transientskpREPO_NAMEtkpPATH_START.@tkp_extracted@tkp-master@tkp@telescope@generic@quality.py@.PATH_END.py |
{
"filename": "__version__.py",
"repo_name": "EhsanGharibNezhad/TelescopeML",
"repo_path": "TelescopeML_extracted/TelescopeML-main/TelescopeML/__version__.py",
"type": "Python"
} | # %% VERSIONS
# Default/Latest/Current version
__version__ = '0.0.5'
# Cleaned the codes and included more specific names for the parameters
# Edited the notebooks and transferred all funcs into the StatVisAnalyzer module
# Edited the name of functions in StatVisAnalyzer
# Added a module named DeepTuner to BOHB tuning ... | EhsanGharibNezhadREPO_NAMETelescopeMLPATH_START.@TelescopeML_extracted@TelescopeML-main@TelescopeML@__version__.py@.PATH_END.py |
{
"filename": "test_circstats.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/stats/tests/test_circstats.py",
"type": "Python"
} | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import pytest
import numpy as np
from numpy.testing import assert_equal
from numpy.testing.utils import assert_allclose
from astropy import units as u
try:
import scipy.stats
except ImportError:
HAS_... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@stats@tests@test_circstats.py@.PATH_END.py |
{
"filename": "loss_scale_optimizer_test.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/optimizers/loss_scale_optimizer_test.py",
"type": "Python"
} | import numpy as np
from absl.testing import parameterized
from keras.src import backend
from keras.src import ops
from keras.src import testing
from keras.src.optimizers.loss_scale_optimizer import LossScaleOptimizer
from keras.src.optimizers.sgd import SGD
class LossScaleOptimizerTest(testing.TestCase):
def _sk... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@optimizers@loss_scale_optimizer_test.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "candebellavita/vkompth",
"repo_path": "vkompth_extracted/vkompth-master/MAXI_J1348-630/README.md",
"type": "Markdown"
} | # Example of how to use the model
We assume that you followed the instructions and you were able to compile and load the model.
We provide a number of files under the subdirectory `MAXI_J1348-630/` that you can use to experiment with the model. We first show below how to load the data, define and fit the model, and p... | candebellavitaREPO_NAMEvkompthPATH_START.@vkompth_extracted@vkompth-master@MAXI_J1348-630@README.md@.PATH_END.py |
{
"filename": "_shadowsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/densitymapbox/hoverlabel/font/_shadowsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShadowsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="shadowsrc",
parent_name="densitymapbox.hoverlabel.font",
**kwargs,
):
super(ShadowsrcValidator, self).__init__(
plotly_n... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@densitymapbox@hoverlabel@font@_shadowsrc.py@.PATH_END.py |
{
"filename": "test_kolmogorov.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/special/tests/test_kolmogorov.py",
"type": "Python"
} | import itertools
import numpy as np
from numpy.testing import assert_
from scipy.special._testutils import FuncData
from scipy.special import kolmogorov, kolmogi, smirnov, smirnovi
from scipy.special._ufuncs import (_kolmogc, _kolmogci, _kolmogp,
_smirnovc, _smirnovci, _smirnovp)
_... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@special@tests@test_kolmogorov.py@.PATH_END.py |
{
"filename": "basecamp.py",
"repo_name": "rodluger/everest",
"repo_path": "everest_extracted/everest-master/everest/basecamp.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
:py:mod:`basecamp.py` - The Everest base class
----------------------------------------------
The :py:obj:`everest` engine. All :py:obj:`everest` models
inherit from :py:class:`Basecamp`.
'''
from __future__ import division, print_function, absolute_import, \
uni... | rodlugerREPO_NAMEeverestPATH_START.@everest_extracted@everest-master@everest@basecamp.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "QEF/q-e",
"repo_path": "q-e_extracted/q-e-master/KCW/examples/example05.1/nspin4_noSOC_noMAG/0_dft/README.md",
"type": "Markdown"
} | # Run the calculations in the following way:
pw.x < scf.pwi | tee scf.pwo
pw.x < bands.pwi | tee bands.pwo
bands.x < bands.in | tee bands.out
gnuplot plot_bands.gnu
| QEFREPO_NAMEq-ePATH_START.@q-e_extracted@q-e-master@KCW@examples@example05.1@nspin4_noSOC_noMAG@0_dft@README.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "adolliou/euispice_coreg",
"repo_path": "euispice_coreg_extracted/euispice_coreg-main/euispice_coreg/synras/__init__.py",
"type": "Python"
} | adolliouREPO_NAMEeuispice_coregPATH_START.@euispice_coreg_extracted@euispice_coreg-main@euispice_coreg@synras@__init__.py@.PATH_END.py | |
{
"filename": "runner.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/tests/runner.py",
"type": "Python"
} | """Implements the Astropy TestRunner which is a thin wrapper around py.test."""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import inspect
import os
import copy
import shlex
import sys
import tempfile
import warnings
from collections import OrderedDict
... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@tests@runner.py@.PATH_END.py |
{
"filename": "CHANGES.md",
"repo_name": "adrn/SuperFreq",
"repo_path": "SuperFreq_extracted/SuperFreq-main/CHANGES.md",
"type": "Markdown"
} | This file keeps track of changes between tagged versions of SuperFreq.
0.2 (unreleased)
------------------
- None yet
0.1.2 (2016-07-17)
------------------
- Fixed references to Gary (renamed to Gala)
0.1.1 (2015-06-10)
------------------
- Fix MANIFEST.in to include cextern files.
0.1 (2015-06-08)
-------------... | adrnREPO_NAMESuperFreqPATH_START.@SuperFreq_extracted@SuperFreq-main@CHANGES.md@.PATH_END.py |
{
"filename": "_showarrow.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/scene/annotation/_showarrow.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowarrowValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="showarrow", parent_name="layout.scene.annotation", **kwargs
):
super(ShowarrowValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@scene@annotation@_showarrow.py@.PATH_END.py |
{
"filename": "transform.py",
"repo_name": "mikecokina/elisa",
"repo_path": "elisa_extracted/elisa-master/src/elisa/single_system/orbit/transform.py",
"type": "Python"
} | from ... import units as u
from elisa.base.transform import (
TransformProperties,
quantity_transform,
WHEN_FLOAT64
)
class OrbitProperties(TransformProperties):
@staticmethod
def rotational_period(value):
"""
Transform and validate rotational period of single star system.
... | mikecokinaREPO_NAMEelisaPATH_START.@elisa_extracted@elisa-master@src@elisa@single_system@orbit@transform.py@.PATH_END.py |
{
"filename": "pick_test_obj.py",
"repo_name": "annayqho/TheCannon",
"repo_path": "TheCannon_extracted/TheCannon-master/code/lamost/abundances/pick_test_obj.py",
"type": "Python"
} | """ Select test objects by their distance from the average of the 10 nearest-
neighbor APOGEE labels in the training set. """
import numpy as np
import os
import glob
def calc_dist(lamost_point, training_points, coeffs):
""" dists from one lamost point to all training points """
diff2 = (training_points - lam... | annayqhoREPO_NAMETheCannonPATH_START.@TheCannon_extracted@TheCannon-master@code@lamost@abundances@pick_test_obj.py@.PATH_END.py |
{
"filename": "Growth_with_w.py",
"repo_name": "yacobozdalkiran/CLASS_mod",
"repo_path": "CLASS_mod_extracted/CLASS_mod-main/class_public-master/scripts/Growth_with_w.py",
"type": "Python"
} | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
#get_ipython().run_line_magic('matplotlib', 'inline')
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from classy import Class
from scipy import interpolate
# In[ ]:
w0vec = [-0.7, -1.0, -1.3]
wavec = [-0.2,0.0,0.2]
#w0vec = [-1.0]
#wavec = [0.0... | yacobozdalkiranREPO_NAMECLASS_modPATH_START.@CLASS_mod_extracted@CLASS_mod-main@class_public-master@scripts@Growth_with_w.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/image/legendgrouptitle/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._font import Font
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(__name__, [], ["._font.Font"])
| plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@image@legendgrouptitle@__init__.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "toda-cosmo/RSD",
"repo_path": "RSD_extracted/RSD-main/README.md",
"type": "Markdown"
} | #Read me
Now writing...
When you want to change the setting, please modify "setting.ini".
| toda-cosmoREPO_NAMERSDPATH_START.@RSD_extracted@RSD-main@README.md@.PATH_END.py |
{
"filename": "sbdynt.py",
"repo_name": "small-body-dynamics/SBDynT",
"repo_path": "SBDynT_extracted/SBDynT-main/src/sbdynt.py",
"type": "Python"
} | from horizons_api import *
from tools import *
from resonances import *
from run_reb import *
from plotting_scripts import *
from hard_coded_constants import *
from add_orbits import *
from machine_learning import *
from proper_elements import *
from tno import *
import rebound
# Globally disable two rebound-specific... | small-body-dynamicsREPO_NAMESBDynTPATH_START.@SBDynT_extracted@SBDynT-main@src@sbdynt.py@.PATH_END.py |
{
"filename": "_lineposition.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/histogram2dcontour/hoverlabel/font/_lineposition.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LinepositionValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(
self,
plotly_name="lineposition",
parent_name="histogram2dcontour.hoverlabel.font",
**kwargs,
):
super(LinepositionValidator, self).__init__(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@histogram2dcontour@hoverlabel@font@_lineposition.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "tardis-sn/carsus",
"repo_path": "carsus_extracted/carsus-master/carsus/io/cmfgen/__init__.py",
"type": "Python"
} | from carsus.io.cmfgen.base import (CMFGENOscillatorStrengthsParser,
CMFGENEnergyLevelsParser,
CMFGENCollisionalStrengthsParser,
CMFGENPhoCrossSectionsParser,
CMFGENHydLParser,
... | tardis-snREPO_NAMEcarsusPATH_START.@carsus_extracted@carsus-master@carsus@io@cmfgen@__init__.py@.PATH_END.py |
{
"filename": "_colorsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/splom/marker/_colorsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="colorsrc", parent_name="splom.marker", **kwargs):
super(ColorsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@splom@marker@_colorsrc.py@.PATH_END.py |
{
"filename": "_legendgroup.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/candlestick/_legendgroup.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LegendgroupValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="legendgroup", parent_name="candlestick", **kwargs):
super(LegendgroupValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@candlestick@_legendgroup.py@.PATH_END.py |
{
"filename": "rv.py",
"repo_name": "PaulHancock/Robbie",
"repo_path": "Robbie_extracted/Robbie-main/viewer/rv.py",
"type": "Python"
} | #! /usr/bin/env python3
from astropy.io import fits
from astropy.wcs import WCS
import numpy as np
import glob
import pandas as pd
from astropy.io.votable import parse
from functools import lru_cache
import datetime
import argparse
from bokeh.plotting import figure, show, output_file
from bokeh import palettes
from b... | PaulHancockREPO_NAMERobbiePATH_START.@Robbie_extracted@Robbie-main@viewer@rv.py@.PATH_END.py |
{
"filename": "skymask.py",
"repo_name": "sdss/target_selection",
"repo_path": "target_selection_extracted/target_selection-main/python/target_selection/cartons/skymask.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: Tom Dwelly
# @Date: 2020-03-24
# @Filename: masking.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
# flake8: noqa
# isort: skip_file
import os
import numpy as np
import healpy as hp
from pymoc import MOC
import pymangle as mangl... | sdssREPO_NAMEtarget_selectionPATH_START.@target_selection_extracted@target_selection-main@python@target_selection@cartons@skymask.py@.PATH_END.py |
{
"filename": "_shadowsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/funnel/hoverlabel/font/_shadowsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShadowsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="shadowsrc", parent_name="funnel.hoverlabel.font", **kwargs
):
super(ShadowsrcValidator, self).__init__(
plotly_name=plotly_name,
par... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@funnel@hoverlabel@font@_shadowsrc.py@.PATH_END.py |
{
"filename": "base.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/vectorstores/redis/base.py",
"type": "Python"
} | """Wrapper around Redis vector database."""
from __future__ import annotations
import logging
import os
import uuid
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
List,
Mapping,
Optional,
Tuple,
Type,
Union,
cast,
)
import numpy as np
import yaml
fr... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@vectorstores@redis@base.py@.PATH_END.py |
{
"filename": "understanding_closure_phases_chromatic_AiryBeam_version.ipynb",
"repo_name": "nithyanandan/PRISim",
"repo_path": "PRISim_extracted/PRISim-master/prisim/examples/codes/BispectrumPhase/understanding_closure_phases_chromatic_AiryBeam_version.ipynb",
"type": "Jupyter Notebook"
} | ```python
import pprint, copy
import numpy as NP
import numpy.ma as MA
import matplotlib.pyplot as PLT
from matplotlib.patches import Circle, Wedge, Polygon
import yaml, argparse, warnings
import astropy.units as U
import astropy.cosmology as cosmology
import astropy.constants as FCNST
import astropy.cosmology as cosmo... | nithyanandanREPO_NAMEPRISimPATH_START.@PRISim_extracted@PRISim-master@prisim@examples@codes@BispectrumPhase@understanding_closure_phases_chromatic_AiryBeam_version.ipynb@.PATH_END.py |
{
"filename": "tMsOut.py",
"repo_name": "lofar-astron/DP3",
"repo_path": "DP3_extracted/DP3-master/steps/test/integration/tMsOut.py",
"type": "Python"
} | # Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: GPL-3.0-or-later
import os
import re
# Append current directory to system path in order to import testconfig
import sys
from subprocess import check_call
import pytest
sys.path.append(".")
import testconfig as tcf
fr... | lofar-astronREPO_NAMEDP3PATH_START.@DP3_extracted@DP3-master@steps@test@integration@tMsOut.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.