metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "test_import.py",
"repo_name": "natashabatalha/PandExo",
"repo_path": "PandExo_extracted/PandExo-master/test_import.py",
"type": "Python"
} | import pandexo.engine.justdoit as jdi # THIS IS THE HOLY GRAIL OF PANDEXO
exo_dict = jdi.load_exo_dict()
exo_dict['observation']['sat_level'] = 80 #saturation level in percent of full well
exo_dict['observation']['sat_unit'] = '%'
exo_dict['observation']['noccultations'] = 2 #number of transits
exo_dict['observat... | natashabatalhaREPO_NAMEPandExoPATH_START.@PandExo_extracted@PandExo-master@test_import.py@.PATH_END.py |
{
"filename": "interpolated.py",
"repo_name": "exoplanet-dev/exoplanet",
"repo_path": "exoplanet_extracted/exoplanet-main/src/exoplanet/light_curves/interpolated.py",
"type": "Python"
} | __all__ = ["InterpolatedLightCurve"]
import numpy as np
from exoplanet.compat import tensor as pt
def interp(n, x, xmin, xmax, dx, func):
"""One-dimensional regularly spaced cubic interpolation
Args:
n (int): The axis of the output that should be interpolated
x (tensor): The x coordinates w... | exoplanet-devREPO_NAMEexoplanetPATH_START.@exoplanet_extracted@exoplanet-main@src@exoplanet@light_curves@interpolated.py@.PATH_END.py |
{
"filename": "data_inspect_2458055.ipynb",
"repo_name": "HERA-Team/H1C_IDR3_Notebooks",
"repo_path": "H1C_IDR3_Notebooks-main/data_inspect/data_inspect_2458055.ipynb",
"type": "Jupyter Notebook"
} | ```python
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
import matplotlib.patches as mpatches
import matplotlib.gridspec as gridspec
import numpy as np
from pyuvdata import UVCal, UVData
import os
import sys
import glob
import uvtools as uvt
from astropy.time import ... | HERA-TeamREPO_NAMEH1C_IDR3_NotebooksPATH_START.@H1C_IDR3_Notebooks-main@data_inspect@data_inspect_2458055.ipynb@.PATH_END.py |
{
"filename": "_smoothing.py",
"repo_name": "deepmind/optax",
"repo_path": "optax_extracted/optax-main/optax/losses/_smoothing.py",
"type": "Python"
} | # Copyright 2019 DeepMind Technologies Limited. 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 ... | deepmindREPO_NAMEoptaxPATH_START.@optax_extracted@optax-main@optax@losses@_smoothing.py@.PATH_END.py |
{
"filename": "base.py",
"repo_name": "showyourwork/showyourwork",
"repo_path": "showyourwork_extracted/showyourwork-main/src/showyourwork/exceptions/base.py",
"type": "Python"
} | import sys
import traceback
from .. import paths
from ..logging import get_logger
def redirect_exception(*args, **kwargs):
"""
Redirect the traceback exception printout to the log file.
"""
exc = traceback.format_exception(*args, **kwargs)
exc = "".join(exc)
get_logger().debug(exc)
def cus... | showyourworkREPO_NAMEshowyourworkPATH_START.@showyourwork_extracted@showyourwork-main@src@showyourwork@exceptions@base.py@.PATH_END.py |
{
"filename": "join_test.py",
"repo_name": "vaexio/vaex",
"repo_path": "vaex_extracted/vaex-master/tests/join_test.py",
"type": "Python"
} | import pytest
import vaex
import numpy as np
import pyarrow as pa
from common import small_buffer
df_a = vaex.from_arrays(a=np.array(['A', 'B', 'C']),
x=np.array([0., 1., 2.]),
y=np.ma.array([0., 9., 2.], mask=[False, True, False]),
m=np.ma.array(... | vaexioREPO_NAMEvaexPATH_START.@vaex_extracted@vaex-master@tests@join_test.py@.PATH_END.py |
{
"filename": "cutouts.py",
"repo_name": "legacysurvey/imagine",
"repo_path": "imagine_extracted/imagine-main/map/cutouts.py",
"type": "Python"
} | from __future__ import print_function
if __name__ == '__main__':
import sys
sys.path.insert(0, 'django-1.9')
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'viewer.settings'
import django
import os
import fitsio
import numpy as np
from map.utils import send_file
from map.views import needs_layer... | legacysurveyREPO_NAMEimaginePATH_START.@imagine_extracted@imagine-main@map@cutouts.py@.PATH_END.py |
{
"filename": "testCAndCPP.py",
"repo_name": "terryyin/lizard",
"repo_path": "lizard_extracted/lizard-master/test/test_languages/testCAndCPP.py",
"type": "Python"
} | import unittest
from lizard_languages import CLikeReader
from ..testHelpers import get_cpp_fileinfo, get_cpp_function_list
class Test_C_Token_extension(unittest.TestCase):
def test_connecting_macro(self):
extended = CLikeReader(None).preprocess(("a##b c", ))
#tbd
class Test_c_cpp_lizard(unittest.... | terryyinREPO_NAMElizardPATH_START.@lizard_extracted@lizard-master@test@test_languages@testCAndCPP.py@.PATH_END.py |
{
"filename": "test_cli.py",
"repo_name": "morpheus-project/morpheus",
"repo_path": "morpheus_extracted/morpheus-master/morpheus/tests/test_cli.py",
"type": "Python"
} | # MIT License
# Copyright 2019 Ryan Hausen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publis... | morpheus-projectREPO_NAMEmorpheusPATH_START.@morpheus_extracted@morpheus-master@morpheus@tests@test_cli.py@.PATH_END.py |
{
"filename": "_forest.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/sklearn/ensemble/_forest.py",
"type": "Python"
} | """
Forest of trees-based ensemble methods.
Those methods include random forests and extremely randomized trees.
The module structure is the following:
- The ``BaseForest`` base class implements a common ``fit`` method for all
the estimators in the module. The ``fit`` method of the base ``Forest``
class calls th... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@sklearn@ensemble@_forest.py@.PATH_END.py |
{
"filename": "test_observatory.py",
"repo_name": "rasg-affiliates/21cmSense",
"repo_path": "21cmSense_extracted/21cmSense-main/tests/test_observatory.py",
"type": "Python"
} | """Test the observatory module."""
import re
from pathlib import Path
import numpy as np
import pytest
import pyuvdata
from astropy import units
from astropy.coordinates import EarthLocation
from py21cmsense import Observatory
from py21cmsense.baseline_filters import BaselineRange
from py21cmsense.beam import Gaussi... | rasg-affiliatesREPO_NAME21cmSensePATH_START.@21cmSense_extracted@21cmSense-main@tests@test_observatory.py@.PATH_END.py |
{
"filename": "yahoo_finance_news.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/tools/yahoo_finance_news.ipynb",
"type": "Jupyter Notebook"
} | # Yahoo Finance News
This notebook goes over how to use the `yahoo_finance_news` tool with an agent.
## Setting up
First, you need to install `yfinance` python package.
```python
%pip install --upgrade --quiet yfinance
```
## Example with Chain
```python
import os
os.environ["OPENAI_API_KEY"] = "..."
```
... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@tools@yahoo_finance_news.ipynb@.PATH_END.py |
{
"filename": "_side.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/parcoords/line/colorbar/title/_side.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SideValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="side", parent_name="parcoords.line.colorbar.title", **kwargs
):
super(SideValidator, self).__init__(
plotly_name=plotly_name,
pare... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@parcoords@line@colorbar@title@_side.py@.PATH_END.py |
{
"filename": "circ.py",
"repo_name": "SAMI-Galaxy-Survey/sami",
"repo_path": "sami_extracted/sami-master/utils/circ.py",
"type": "Python"
} | from __future__ import print_function
"""
Functions to calculate the:
1) drizzle overlap between a square and a circle (function `resample_circle`
by Jon Nielsen 2012)
2) Gaussian overlap between a circular Gaussian and a square grid (function
`inteGrauss2d` by Francesco D'Eugenio 2017)
These calculations are t... | SAMI-Galaxy-SurveyREPO_NAMEsamiPATH_START.@sami_extracted@sami-master@utils@circ.py@.PATH_END.py |
{
"filename": "full_analysis.py",
"repo_name": "CosmicFish/CosmicFish",
"repo_path": "CosmicFish_extracted/CosmicFish-master/python/apps/full_analysis.py",
"type": "Python"
} | #----------------------------------------------------------------------------------------
#
# This file is part of CosmicFish.
#
# Copyright (C) 2015-2017 by the CosmicFish authors
#
# The CosmicFish code is free software;
# You can use it, redistribute it, and/or modify it under the terms
# of the GNU General Public L... | CosmicFishREPO_NAMECosmicFishPATH_START.@CosmicFish_extracted@CosmicFish-master@python@apps@full_analysis.py@.PATH_END.py |
{
"filename": "igimf_epoch_49.py",
"repo_name": "juzikong/photGalIMF",
"repo_path": "photGalIMF_extracted/photGalIMF-main/simulation_results_from_galaxy_evol/example/igimf_epoch_49.py",
"type": "Python"
} | # File to define a custom IMF
# The return value represents the chosen IMF value for the input mass
def custom_imf(mass, time): # there is no time dependence for IGIMF
if mass < 0.08:
return 0
elif mass < 0.101:
return -881912095498.0004 * mass + 126349388048.4443
elif mass < 0.10201:
... | juzikongREPO_NAMEphotGalIMFPATH_START.@photGalIMF_extracted@photGalIMF-main@simulation_results_from_galaxy_evol@example@igimf_epoch_49.py@.PATH_END.py |
{
"filename": "uniformcausticsampling.py",
"repo_name": "rpoleski/MulensModel",
"repo_path": "MulensModel_extracted/MulensModel-master/source/MulensModel/uniformcausticsampling.py",
"type": "Python"
} | import numpy as np
import math
import warnings
from MulensModel.utils import Utils
class UniformCausticSampling(object):
"""
Uniform sampling of a binary lens caustic.
Note that calculations take some time for given (s, q).
Keep that in mind, when optimizing your fitting routine.
Arguments :
... | rpoleskiREPO_NAMEMulensModelPATH_START.@MulensModel_extracted@MulensModel-master@source@MulensModel@uniformcausticsampling.py@.PATH_END.py |
{
"filename": "make_glass.py",
"repo_name": "pec27/lizard",
"repo_path": "lizard_extracted/lizard-master/example_scripts/make_glass.py",
"type": "Python"
} | """
Script to use the P^3M solver to make a glass file
"""
from __future__ import print_function
from lizard.p3m import CubicPeriodicForceSplit
import numpy as np
from lizard.ngb_kernel import *
from numpy.random import RandomState
from scipy.spatial import cKDTree
from lizard.grid import *
from lizard.log import Verbo... | pec27REPO_NAMElizardPATH_START.@lizard_extracted@lizard-master@example_scripts@make_glass.py@.PATH_END.py |
{
"filename": "paris.py",
"repo_name": "dstndstn/tractor",
"repo_path": "tractor_extracted/tractor-main/projects/bigboss/paris.py",
"type": "Python"
} | from __future__ import print_function
import matplotlib
matplotlib.use('Agg')
import pylab as plt
import numpy as np
from astrometry.util.pyfits_utils import *
from astrometry.util.file import *
from astrometry.libkd.spherematch import *
def plot_cmd(allmags, i2mags, band, catflags, classstar):
print('i2 mags shape',... | dstndstnREPO_NAMEtractorPATH_START.@tractor_extracted@tractor-main@projects@bigboss@paris.py@.PATH_END.py |
{
"filename": "_cauto.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter3d/marker/line/_cauto.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CautoValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="cauto", parent_name="scatter3d.marker.line", **kwargs
):
super(CautoValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter3d@marker@line@_cauto.py@.PATH_END.py |
{
"filename": "dota8.md",
"repo_name": "ultralytics/ultralytics",
"repo_path": "ultralytics_extracted/ultralytics-main/docs/en/datasets/obb/dota8.md",
"type": "Markdown"
} | ---
comments: true
description: Explore the DOTA8 dataset - a small, versatile oriented object detection dataset ideal for testing and debugging object detection models using Ultralytics YOLO11.
keywords: DOTA8 dataset, Ultralytics, YOLO11, object detection, debugging, training models, oriented object detection, datase... | ultralyticsREPO_NAMEultralyticsPATH_START.@ultralytics_extracted@ultralytics-main@docs@en@datasets@obb@dota8.md@.PATH_END.py |
{
"filename": "mo_summary_metrics.py",
"repo_name": "lsst/rubin_sim",
"repo_path": "rubin_sim_extracted/rubin_sim-main/rubin_sim/maf/metrics/mo_summary_metrics.py",
"type": "Python"
} | __all__ = (
"power_law_dndh",
"neo_dndh_granvik",
"neo_dndh_grav",
"pha_dndh_granvik",
"pha_dndh_grav",
"integrate_over_h",
"sum_over_h",
"TotalNumberSSO",
"ValueAtHMetric",
"MeanValueAtHMetric",
"MoCompletenessMetric",
"MoCompletenessAtTimeMetric",
)
import warnings
im... | lsstREPO_NAMErubin_simPATH_START.@rubin_sim_extracted@rubin_sim-main@rubin_sim@maf@metrics@mo_summary_metrics.py@.PATH_END.py |
{
"filename": "_title.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/treemap/marker/colorbar/_title.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Title(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "treemap.marker.colorbar"
_path_str = "treemap.marker.colorbar.title"
_valid_props = {"font", ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@treemap@marker@colorbar@_title.py@.PATH_END.py |
{
"filename": "vol-lines.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/doc/source/cookbook/vol-lines.py",
"type": "Python"
} | import numpy as np
import yt
from yt.units import kpc
from yt.visualization.volume_rendering.api import LineSource
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
sc = yt.create_scene(ds)
np.random.seed(1234567)
nlines = 50
vertices = (np.random.random([nlines, 2, 3]) - 0.5) * 200 * kpc
colors = np.random.ran... | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@doc@source@cookbook@vol-lines.py@.PATH_END.py |
{
"filename": "_maxpoints.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/sankey/stream/_maxpoints.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MaxpointsValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="maxpoints", parent_name="sankey.stream", **kwargs):
super(MaxpointsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@sankey@stream@_maxpoints.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "gbrammer/msaexp",
"repo_path": "msaexp_extracted/msaexp-main/docs/conf.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
#
# Astropy documentation build configuration file.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this file.
#
# All configurati... | gbrammerREPO_NAMEmsaexpPATH_START.@msaexp_extracted@msaexp-main@docs@conf.py@.PATH_END.py |
{
"filename": "build_py.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/numpy/py2/numpy/distutils/command/build_py.py",
"type": "Python"
} | from __future__ import division, absolute_import, print_function
from distutils.command.build_py import build_py as old_build_py
from numpy.distutils.misc_util import is_string
class build_py(old_build_py):
def run(self):
build_src = self.get_finalized_command('build_src')
if build_src.py_modules... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@numpy@py2@numpy@distutils@command@build_py.py@.PATH_END.py |
{
"filename": "test_atlas.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/integration_tests/vectorstores/test_atlas.py",
"type": "Python"
} | """Test Atlas functionality."""
import time
from langchain_community.vectorstores import AtlasDB
from tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings
ATLAS_TEST_API_KEY = "7xDPkYXSYDc1_ErdTPIcoAR9RNd8YDlkS3nVNXcVoIMZ6"
def test_atlas() -> None:
"""Test end to end construction and sea... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@integration_tests@vectorstores@test_atlas.py@.PATH_END.py |
{
"filename": "test_util.py",
"repo_name": "pyro-ppl/pyro",
"repo_path": "pyro_extracted/pyro-master/tests/contrib/forecast/test_util.py",
"type": "Python"
} | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
import pytest
import torch
from torch.distributions import transform_to
import pyro.distributions as dist
from pyro.contrib.forecast.util import (
UNIVARIATE_DISTS,
UNIVARIATE_TRANSFORMS,
prefix_condition,
reshape_batc... | pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@tests@contrib@forecast@test_util.py@.PATH_END.py |
{
"filename": "_nca.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/sklearn/neighbors/_nca.py",
"type": "Python"
} | """
Neighborhood Component Analysis
"""
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
import sys
import time
from numbers import Integral, Real
from warnings import warn
import numpy as np
from scipy.optimize import minimize
from ..base import (
BaseEstimator,
ClassNamePrefi... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@sklearn@neighbors@_nca.py@.PATH_END.py |
{
"filename": "residual_tests.py",
"repo_name": "markusbonse/applefy",
"repo_path": "applefy_extracted/applefy-main/applefy/gaussianity/residual_tests.py",
"type": "Python"
} | """
Functions to evaluate the noise in high-contrast-imaging residuals. Note, none
of the tests implemented here can proof that the residual noise is Gaussian.
But they can provide useful insides whether the noise deviates for Gaussian.
"""
from typing import Union, Tuple
import numpy as np
from scipy import stats
fro... | markusbonseREPO_NAMEapplefyPATH_START.@applefy_extracted@applefy-main@applefy@gaussianity@residual_tests.py@.PATH_END.py |
{
"filename": "runDensityBMP.py",
"repo_name": "treecode/Bonsai",
"repo_path": "Bonsai_extracted/Bonsai-master/tools/postProcessTools/density/runDensityBMP.py",
"type": "Python"
} | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
import subprocess
import Image, ImageDraw, ImageFont
#Get the imaging library from:
#http://www.pythonware.com/products/pil/
# python setup.py install
print "Usage: program folder-with-density-files"
fileNameBase = str(sys.argv[1])
dirName = ... | treecodeREPO_NAMEBonsaiPATH_START.@Bonsai_extracted@Bonsai-master@tools@postProcessTools@density@runDensityBMP.py@.PATH_END.py |
{
"filename": "lstchain_merge_run_summaries.py",
"repo_name": "cta-observatory/cta-lstchain",
"repo_path": "cta-lstchain_extracted/cta-lstchain-main/lstchain/scripts/lstchain_merge_run_summaries.py",
"type": "Python"
} | """
Create a summary of all runs from daily run summaries,
adding pointing information.
It is also possible to append a single night to an already
existing merged summary file when date is especified.
"""
import logging
from argparse import ArgumentParser
from datetime import datetime
from pathlib import Path
import... | cta-observatoryREPO_NAMEcta-lstchainPATH_START.@cta-lstchain_extracted@cta-lstchain-main@lstchain@scripts@lstchain_merge_run_summaries.py@.PATH_END.py |
{
"filename": "stellar_blends_muygps_classification_max_all.ipynb",
"repo_name": "cae0027/Stellar-Blends",
"repo_path": "Stellar-Blends_extracted/Stellar-Blends-main/ce/model-comparison/stellar_blends_muygps_classification_max_all.ipynb",
"type": "Jupyter Notebook"
} | # Stellar Blends Classification
### In this notebook we run the un-normalized and normalized datasets through the MuyGPyS classifier (a python classifying function that uses the MuyGPS Gaussian process hyperparameter estimation method), and compare the resulting accuracies.
**Note:** Must have run `data_normalizatio... | cae0027REPO_NAMEStellar-BlendsPATH_START.@Stellar-Blends_extracted@Stellar-Blends-main@ce@model-comparison@stellar_blends_muygps_classification_max_all.ipynb@.PATH_END.py |
{
"filename": "test_orbit_astrometry_HD10009.py",
"repo_name": "iancze/PSOAP",
"repo_path": "PSOAP_extracted/PSOAP-master/tests/test_orbit_astrometry_HD10009.py",
"type": "Python"
} | import pytest
import os
import pkg_resources
import numpy as np
from psoap import orbit_astrometry
from psoap import constants as C
from astropy.time import Time
import matplotlib.pyplot as plt
import matplotlib
# Create plots of all of the orbits
from astropy.io import ascii
# Create plots of all of the orbits
# ... | ianczeREPO_NAMEPSOAPPATH_START.@PSOAP_extracted@PSOAP-master@tests@test_orbit_astrometry_HD10009.py@.PATH_END.py |
{
"filename": "analyzer.py",
"repo_name": "ML4GW/aframe",
"repo_path": "aframe_extracted/aframe-main/projects/plots/plots/vizapp/infer/analyzer.py",
"type": "Python"
} | from pathlib import Path
from typing import Dict, List, Sequence
import h5py
import numpy as np
import torch
from gwpy.timeseries import TimeSeries
from ledger.injections import InterferometerResponseSet, waveform_class_factory
from plots.vizapp.infer.utils import get_indices, get_strain_fname
from utils.preprocessin... | ML4GWREPO_NAMEaframePATH_START.@aframe_extracted@aframe-main@projects@plots@plots@vizapp@infer@analyzer.py@.PATH_END.py |
{
"filename": "binpaper2020.py",
"repo_name": "AstroSheppard/WFC3-analysis",
"repo_path": "WFC3-analysis_extracted/WFC3-analysis-main/LATE/verification/binpaper2020.py",
"type": "Python"
} | from __future__ import print_function
import sys
import numpy as np
import pandas as pd
import scipy.stats as st
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.ticker import ScalarFormatter
sys.path.append('./MCcubed')
import MCcubed as mc3
def comp_methods(visit, binsize, bin, wave):
... | AstroSheppardREPO_NAMEWFC3-analysisPATH_START.@WFC3-analysis_extracted@WFC3-analysis-main@LATE@verification@binpaper2020.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "duvall3/rat-pac",
"repo_path": "rat-pac_extracted/rat-pac-master/python/SCons/__init__.py",
"type": "Python"
} | """SCons
The main package for the SCons software construction utility.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Softwar... | duvall3REPO_NAMErat-pacPATH_START.@rat-pac_extracted@rat-pac-master@python@SCons@__init__.py@.PATH_END.py |
{
"filename": "simulation.py",
"repo_name": "nu-radio/NuRadioMC",
"repo_path": "NuRadioMC_extracted/NuRadioMC-master/NuRadioReco/eventbrowser/apps/simulation.py",
"type": "Python"
} | from __future__ import absolute_import, division, print_function # , unicode_literals
from dash import html
import NuRadioReco.eventbrowser.apps.simulation_plots.sim_electric_field_trace
import NuRadioReco.eventbrowser.apps.simulation_plots.sim_electric_field_spectrum
import NuRadioReco.eventbrowser.apps.simulation_pl... | nu-radioREPO_NAMENuRadioMCPATH_START.@NuRadioMC_extracted@NuRadioMC-master@NuRadioReco@eventbrowser@apps@simulation.py@.PATH_END.py |
{
"filename": "move_template.py",
"repo_name": "plazar/TOASTER",
"repo_path": "TOASTER_extracted/TOASTER-master/toolkit/templates/move_template.py",
"type": "Python"
} | #!/usr/bin/env python
"""
move_template.py
Move a template and update the database accordingly.
Patrick Lazarus, Mar 10, 2014
"""
import os
import shutil
from toaster import utils
from toaster.toolkit.templates import general
from toaster.utils import notify
from toaster import database
from toaster import errors
... | plazarREPO_NAMETOASTERPATH_START.@TOASTER_extracted@TOASTER-master@toolkit@templates@move_template.py@.PATH_END.py |
{
"filename": "command.py",
"repo_name": "jax-ml/jax",
"repo_path": "jax_extracted/jax-main/build/tools/command.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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | jax-mlREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@build@tools@command.py@.PATH_END.py |
{
"filename": "_xside.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/grid/_xside.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XsideValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="xside", parent_name="layout.grid", **kwargs):
super(XsideValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@grid@_xside.py@.PATH_END.py |
{
"filename": "text-processing__feature_calcers.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/references/text-processing__feature_calcers.md",
"type": "Markdown"
} | # Feature calcers and corresponding options
The following is a list of options for the --feature-calcers`for the Command-line version parameter (these options are set in `option_name`):
- {{ dictionary__feature-calcers__BoW }} (Bag of words) — Boolean (0/1) features reflecting whether the object contains the token_id... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@references@text-processing__feature_calcers.md@.PATH_END.py |
{
"filename": "test_regrid.py",
"repo_name": "sherpa/sherpa",
"repo_path": "sherpa_extracted/sherpa-main/sherpa/models/tests/test_regrid.py",
"type": "Python"
} | # Copyright 2018, 2020, 2021, 2022, 2023
# Smithsonian Astrophysical Observatory
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of... | sherpaREPO_NAMEsherpaPATH_START.@sherpa_extracted@sherpa-main@sherpa@models@tests@test_regrid.py@.PATH_END.py |
{
"filename": "detector_stacks.py",
"repo_name": "PlasmaPy/PlasmaPy",
"repo_path": "PlasmaPy_extracted/PlasmaPy-main/src/plasmapy/diagnostics/charged_particle_radiography/detector_stacks.py",
"type": "Python"
} | """
Objects representing stacks of film and/or filter layers for charged particle
detectors.
"""
__all__ = [
"Stack",
"Layer",
]
import astropy.units as u
import numpy as np
from scipy.interpolate import interp1d
class Layer:
r"""
A layer in a detector film stack.
The layer could either be an ... | PlasmaPyREPO_NAMEPlasmaPyPATH_START.@PlasmaPy_extracted@PlasmaPy-main@src@plasmapy@diagnostics@charged_particle_radiography@detector_stacks.py@.PATH_END.py |
{
"filename": "_cmax.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattercarpet/marker/line/_cmax.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CmaxValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="cmax", parent_name="scattercarpet.marker.line", **kwargs
):
super(CmaxValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattercarpet@marker@line@_cmax.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "lenstronomy/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_ImSim/test_Numerics/__init__.py",
"type": "Python"
} | lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_ImSim@test_Numerics@__init__.py@.PATH_END.py | |
{
"filename": "conversion.py",
"repo_name": "jobovy/galpy",
"repo_path": "galpy_extracted/galpy-main/galpy/util/conversion.py",
"type": "Python"
} | ###############################################################################
#
# conversion: utilities to convert from galpy 'natural units' to physical
# units
#
###############################################################################
import copy
import math as m
import numbers
import warnings
fr... | jobovyREPO_NAMEgalpyPATH_START.@galpy_extracted@galpy-main@galpy@util@conversion.py@.PATH_END.py |
{
"filename": "overscanLickObs.py",
"repo_name": "ishivvers/TheKastShiv",
"repo_path": "TheKastShiv_extracted/TheKastShiv-master/tools/overscanLickObs.py",
"type": "Python"
} | #!/usr/bin/python
# Version 1.0 -- Elinor Gates, 2015 Nov 24
# - obtained from https://mthamilton.ucolick.org/techdocs/instruments/kast/kast_obsHints.html
#
# Modified by Isaac Shivvers, 2016 Oct 4
# - no procedural changes, only made it useable by KastShiv
from astropy.io import fits,ascii
import numpy as np
impo... | ishivversREPO_NAMETheKastShivPATH_START.@TheKastShiv_extracted@TheKastShiv-master@tools@overscanLickObs.py@.PATH_END.py |
{
"filename": "test_ccd.py",
"repo_name": "wfirst-cgi/emccd_detect",
"repo_path": "emccd_detect_extracted/emccd_detect-master/arcticpy_folder/test_arcticpy/test_ccd.py",
"type": "Python"
} | import numpy as np
import pytest
import arcticpy as ac
class TestCCD:
def test__single_electron_fractional_height_from_electrons(
self,
):
parallel_ccd = ac.CCD(
full_well_depth=10000.0, well_notch_depth=0.0, well_fill_power=1.0
)
electron_fractional_volumes = (
... | wfirst-cgiREPO_NAMEemccd_detectPATH_START.@emccd_detect_extracted@emccd_detect-master@arcticpy_folder@test_arcticpy@test_ccd.py@.PATH_END.py |
{
"filename": "index_lookup.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/layers/preprocessing/index_lookup.py",
"type": "Python"
} | import collections
import numpy as np
from keras.src import backend
from keras.src.layers.layer import Layer
from keras.src.utils import argument_validation
from keras.src.utils import numerical_utils
from keras.src.utils import tf_utils
from keras.src.utils.module_utils import tensorflow as tf
class IndexLookup(La... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@layers@preprocessing@index_lookup.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "sdss/marvin",
"repo_path": "marvin_extracted/marvin-main/tests/misc/__init__.py",
"type": "Python"
} | sdssREPO_NAMEmarvinPATH_START.@marvin_extracted@marvin-main@tests@misc@__init__.py@.PATH_END.py | |
{
"filename": "run_Gaussian_beam.py",
"repo_name": "JLBLine/WODEN",
"repo_path": "WODEN_extracted/WODEN-master/docs/sphinx/operating_principles/run_Gaussian_beam.py",
"type": "Python"
} | from astropy.io import fits
import numpy as np
from astropy.wcs import WCS
from copy import deepcopy
import erfa
from subprocess import call
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
def add_colourbar(fig=None,ax=None,im=None,label=False,top=False):
"""
Adds a colo... | JLBLineREPO_NAMEWODENPATH_START.@WODEN_extracted@WODEN-master@docs@sphinx@operating_principles@run_Gaussian_beam.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/astropy/wcs/wcsapi/wrappers/__init__.py",
"type": "Python"
} | from .base import BaseWCSWrapper
from .sliced_wcs import *
| astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@wcs@wcsapi@wrappers@__init__.py@.PATH_END.py |
{
"filename": "asdf_cutouts.py",
"repo_name": "spacetelescope/astrocut",
"repo_path": "astrocut_extracted/astrocut-main/astrocut/asdf_cutouts.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""This module implements cutout functionality similar to fitscut, but for the ASDF file format."""
import copy
import pathlib
from typing import Union, Tuple
import requests
import asdf
import astropy
import gwcs
import numpy as np
import s3fs
from s3pa... | spacetelescopeREPO_NAMEastrocutPATH_START.@astrocut_extracted@astrocut-main@astrocut@asdf_cutouts.py@.PATH_END.py |
{
"filename": "Results_ft.ipynb",
"repo_name": "astromer-science/main-code",
"repo_path": "main-code_extracted/main-code-main/presentation/notebooks/Results_ft.ipynb",
"type": "Jupyter Notebook"
} | ```python
cd /home
```
/home
```python
import matplotlib.pyplot as plt
import tensorflow as tf
import pandas as pd
import numpy as np
import pickle
import json
import os
from sklearn.metrics import r2_score, mean_squared_error
from core.astromer import get_ASTROMER, train, predict
from core.data import pretr... | astromer-scienceREPO_NAMEmain-codePATH_START.@main-code_extracted@main-code-main@presentation@notebooks@Results_ft.ipynb@.PATH_END.py |
{
"filename": "orbit_conventional.py",
"repo_name": "iancze/PSOAP",
"repo_path": "PSOAP_extracted/PSOAP-master/attic/orbit_conventional.py",
"type": "Python"
} | import numpy as np
from scipy.optimize import fsolve, minimize
from psoap import constants as C
class Binary:
'''
A binary orbit that delivers astrometric position, relative astrometric position (B relative to A), and radial velocities of A and B.
'''
def __init__(self, a, e, i, omega, Omega, T0, M_to... | ianczeREPO_NAMEPSOAPPATH_START.@PSOAP_extracted@PSOAP-master@attic@orbit_conventional.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "exoplanet-dev/celerite2",
"repo_path": "celerite2_extracted/celerite2-main/python/celerite2/pymc3/__init__.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
__all__ = ["terms", "GaussianProcess"]
def __set_compiler_flags():
import theano
def add_flag(current, new):
if new in current:
return current
return f"{current} {new}"
current = theano.config.gcc__cxxflags
current = add_flag(current, "-Wno-c++11-... | exoplanet-devREPO_NAMEcelerite2PATH_START.@celerite2_extracted@celerite2-main@python@celerite2@pymc3@__init__.py@.PATH_END.py |
{
"filename": "_textsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/waterfall/_textsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="textsrc", parent_name="waterfall", **kwargs):
super(TextsrcValidator, 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@waterfall@_textsrc.py@.PATH_END.py |
{
"filename": "style.py",
"repo_name": "macrocosme/shwirl",
"repo_path": "shwirl_extracted/shwirl-master/shwirl/extern/vispy/util/svg/style.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Nicolas P. Rougier
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
from . color import ... | macrocosmeREPO_NAMEshwirlPATH_START.@shwirl_extracted@shwirl-master@shwirl@extern@vispy@util@svg@style.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "davidharvey1986/pyRRG",
"repo_path": "pyRRG_extracted/pyRRG-master/unittests/bugFixPyRRG/lib/python3.7/site-packages/pip/_internal/commands/__init__.py",
"type": "Python"
} | """
Package containing all pip commands
"""
# The following comment should be removed at some point in the future.
# mypy: disallow-untyped-defs=False
# There is currently a bug in python/typeshed mentioned at
# https://github.com/python/typeshed/issues/3906 which causes the
# return type of difflib.get_close_matches ... | davidharvey1986REPO_NAMEpyRRGPATH_START.@pyRRG_extracted@pyRRG-master@unittests@bugFixPyRRG@lib@python3.7@site-packages@pip@_internal@commands@__init__.py@.PATH_END.py |
{
"filename": "proc_daemon.py",
"repo_name": "icrar/daliuge",
"repo_path": "daliuge_extracted/daliuge-master/daliuge-engine/dlg/manager/proc_daemon.py",
"type": "Python"
} | #
# ICRAR - International Centre for Radio Astronomy Research
# (c) UWA - The University of Western Australia, 2016
# Copyright by UWA (in the framework of the ICRAR)
# All rights reserved
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser G... | icrarREPO_NAMEdaliugePATH_START.@daliuge_extracted@daliuge-master@daliuge-engine@dlg@manager@proc_daemon.py@.PATH_END.py |
{
"filename": "_bgcolor.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/waterfall/hoverlabel/_bgcolor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BgcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="bgcolor", parent_name="waterfall.hoverlabel", **kwargs
):
super(BgcolorValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@waterfall@hoverlabel@_bgcolor.py@.PATH_END.py |
{
"filename": "psf_estimation.py",
"repo_name": "torluca/morphofit",
"repo_path": "morphofit_extracted/morphofit-master/morphofit/psf_estimation.py",
"type": "Python"
} | #! /usr/bin/env python
# Copyright (C) 2019 ETH Zurich, Institute for Particle Physics and Astrophysics
# Author: Luca Tortorelli
# System imports
from __future__ import (print_function, division, absolute_import,
unicode_literals)
# External modules
import os
from astropy.io import fits
fro... | torlucaREPO_NAMEmorphofitPATH_START.@morphofit_extracted@morphofit-master@morphofit@psf_estimation.py@.PATH_END.py |
{
"filename": "python-reference_catboost_plot_predictions.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/concepts/python-reference_catboost_plot_predictions.md",
"type": "Markdown"
} | # plot_predictions
{% include [plot_predictions-plot_predictions__desc__full](../_includes/work_src/reusage-python/plot_predictions__desc__full.md) %}
## {{ dl--parameters }} {#parameters}
### data
#### Description
The data to plot predictions for.
For example, use a two-document slice of the original dataset (re... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@concepts@python-reference_catboost_plot_predictions.md@.PATH_END.py |
{
"filename": "try_ifort.py",
"repo_name": "CosmoLike/cocoa",
"repo_path": "cocoa_extracted/cocoa-main/Cocoa/external_modules/code/planck/code/spt_clik/waf_tools/try_ifort.py",
"type": "Python"
} | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
import sys
from waflib import Options
import os.path as osp
from waflib import Logs
from waflib import Context
from waflib import Errors
### common tools
def show_linkline(ctx,flavour,wafname):
ctx... | CosmoLikeREPO_NAMEcocoaPATH_START.@cocoa_extracted@cocoa-main@Cocoa@external_modules@code@planck@code@spt_clik@waf_tools@try_ifort.py@.PATH_END.py |
{
"filename": "ex_mixed_lls_timecorr.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/sandbox/examples/ex_mixed_lls_timecorr.py",
"type": "Python"
} | """Example using OneWayMixed with within group intertemporal correlation
Created on Sat Dec 03 10:15:55 2011
Author: Josef Perktold
This example constructs a linear model with individual specific random
effects, and uses OneWayMixed to estimate it.
This is a variation on ex_mixed_lls_0.py.
Here we use time dummies... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@sandbox@examples@ex_mixed_lls_timecorr.py@.PATH_END.py |
{
"filename": "plotMag3Dsmooth.py",
"repo_name": "folsomcp/ZDIpy",
"repo_path": "ZDIpy_extracted/ZDIpy-main/utils/plotMag3Dsmooth.py",
"type": "Python"
} | #!/usr/bin/python3
#
#Plot a magnetic field from set of magnetic spherical harmonic coefficients
#cofficiants are read in from a file, and plotted in 3D using matplotlib (if possible)
import numpy as np
try:
import core.geometryStellar as geometryStellar
import core.magneticGeom as magneticGeom
import core... | folsomcpREPO_NAMEZDIpyPATH_START.@ZDIpy_extracted@ZDIpy-main@utils@plotMag3Dsmooth.py@.PATH_END.py |
{
"filename": "TensorMetadataAddStats.md",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/lite/g3doc/api_docs/python/tflite_support/metadata_schema_py_generated/TensorMetadataAddStats.md",
"type": "Markdown"
} | page_type: reference
<link rel="stylesheet" href="/site-assets/css/style.css">
<!-- DO NOT EDIT! Automatically generated file. -->
<div itemscope itemtype="http://developers.google.com/ReferenceObject">
<meta itemprop="name" content="tflite_support.metadata_schema_py_generated.TensorMetadataAddStats" />
<meta itempr... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@lite@g3doc@api_docs@python@tflite_support@metadata_schema_py_generated@TensorMetadataAddStats.md@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "jona2510/BCNN",
"repo_path": "BCNN_extracted/BCNN-main/README.md",
"type": "Markdown"
} | Bayesian and Convolutional Neural Networks (BCNN)
| jona2510REPO_NAMEBCNNPATH_START.@BCNN_extracted@BCNN-main@README.md@.PATH_END.py |
{
"filename": "metrics_utils.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/metrics/metrics_utils.py",
"type": "Python"
} | from enum import Enum
import numpy as np
from keras.src import backend
from keras.src import ops
from keras.src.losses.loss import squeeze_or_expand_to_same_rank
from keras.src.utils.python_utils import to_list
NEG_INF = -1e10
def assert_thresholds_range(thresholds):
if thresholds is not None:
invalid_... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@metrics@metrics_utils.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/splom/hoverlabel/font/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._sizesrc import SizesrcValidator
from ._size import SizeValidator
from ._familysrc import FamilysrcValidator
from ._family import FamilyValidator
from ._colorsrc import ColorsrcValidator
from ._color import ColorValidator
else:
from _plotly_uti... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@splom@hoverlabel@font@__init__.py@.PATH_END.py |
{
"filename": "getdist_test.py",
"repo_name": "cmbant/CosmoMC",
"repo_path": "CosmoMC_extracted/CosmoMC-master/python/getdist/tests/getdist_test.py",
"type": "Python"
} | import tempfile
import os
import numpy as np
import unittest
import subprocess
import shutil
from getdist import loadMCSamples, plots, IniFile
from getdist.tests.test_distributions import Test2DDistributions, Gaussian1D, Gaussian2D
from getdist.mcsamples import MCSamples
from getdist.styles.tab10 import style_name as t... | cmbantREPO_NAMECosmoMCPATH_START.@CosmoMC_extracted@CosmoMC-master@python@getdist@tests@getdist_test.py@.PATH_END.py |
{
"filename": "RS_2014_liquids.py",
"repo_name": "geodynamics/burnman",
"repo_path": "burnman_extracted/burnman-main/burnman/minerals/RS_2014_liquids.py",
"type": "Python"
} | # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for
# the Earth and Planetary Sciences
# Copyright (C) 2012 - 2021 by the BurnMan team, released under the GNU
# GPL v2 or later.
"""
RS_2014_liquids
^^^^^^^^^^^^^^^
Liquids from Ramo and Stixrude (2014) FPMD simulations.
There are some typos ... | geodynamicsREPO_NAMEburnmanPATH_START.@burnman_extracted@burnman-main@burnman@minerals@RS_2014_liquids.py@.PATH_END.py |
{
"filename": "quality_control.py",
"repo_name": "transientskp/lpf",
"repo_path": "lpf_extracted/lpf-main/lpf/quality_control/quality_control.py",
"type": "Python"
} | import numpy as np
import torch
from lpf.bolts.torch import nanmax, nanmean
class QualityControl:
def __init__(
self, rfi_threshold: float = 5, corruption_threshold: float = 1e5,
) -> None:
self.rfi_threshold = rfi_threshold
self.corruption_threshold = corruption_threshold
def fil... | transientskpREPO_NAMElpfPATH_START.@lpf_extracted@lpf-main@lpf@quality_control@quality_control.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "smsharma/fermi-gce-flows",
"repo_path": "fermi-gce-flows_extracted/fermi-gce-flows-main/sbi/utils/__init__.py",
"type": "Python"
} | # flake8: noqa
from sbi.user_input.user_input_checks import (
check_estimator_arg,
validate_theta_and_x,
)
from sbi.user_input.user_input_checks_utils import MultipleIndependent
from sbi.utils.conditional_density import (
conditional_corrcoeff,
eval_conditional_density,
)
from sbi.utils.get_nn_models im... | smsharmaREPO_NAMEfermi-gce-flowsPATH_START.@fermi-gce-flows_extracted@fermi-gce-flows-main@sbi@utils@__init__.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "toros-astro/corral",
"repo_path": "corral_extracted/corral-master/docs/source/conf.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
#
# Corral documentation build configuration file, created by
# sphinx-quickstart on Wed Nov 18 17:22:43 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | toros-astroREPO_NAMEcorralPATH_START.@corral_extracted@corral-master@docs@source@conf.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/treemap/outsidetextfont/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._weightsrc import WeightsrcValidator
from ._weight import WeightValidator
from ._variantsrc import VariantsrcValidator
from ._variant import VariantValidator
from ._textcasesrc import TextcasesrcValidat... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@treemap@outsidetextfont@__init__.py@.PATH_END.py |
{
"filename": "_name.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/polar/angularaxis/tickformatstop/_name.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="name",
parent_name="layout.polar.angularaxis.tickformatstop",
**kwargs
):
super(NameValidator, self).__init__(
plotly_name... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@polar@angularaxis@tickformatstop@_name.py@.PATH_END.py |
{
"filename": "the_gp_sfh_module.ipynb",
"repo_name": "kartheikiyer/dense_basis",
"repo_path": "dense_basis_extracted/dense_basis-master/docs/_build/html/_sources/tutorials/the_gp_sfh_module.ipynb",
"type": "Jupyter Notebook"
} | # The GP-SFH module
## Creating different shapes using SFH-tuples
The `dense_basis` code contains a module for creating smooth star formation history from a tuple consisting of (M$_*$, SFR, {$t_X$}) - the stellar mass, star formation rate, and a set of lookback times at which the galaxy forms N equally spaced quantil... | kartheikiyerREPO_NAMEdense_basisPATH_START.@dense_basis_extracted@dense_basis-master@docs@_build@html@_sources@tutorials@the_gp_sfh_module.ipynb@.PATH_END.py |
{
"filename": "_metasrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/heatmapgl/_metasrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MetasrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="metasrc", parent_name="heatmapgl", **kwargs):
super(MetasrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@heatmapgl@_metasrc.py@.PATH_END.py |
{
"filename": "test_quinoa.py",
"repo_name": "telegraphic/fits2hdf",
"repo_path": "fits2hdf_extracted/fits2hdf-master/aadnc_benchmarks/quinoa_idea/test_quinoa.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
test_quinoa.py
"""
from quinoa import *
def generate_data():
d = np.linspace(1e4, 1e5, 100)
d_range = 1e9
noise_ratio = 1e3
data = np.sin(np.outer(d, d)) * d_range
noise = np.random.random((100,100)) * d_range / noise_ratio
return data + noise
def test_dither():
... | telegraphicREPO_NAMEfits2hdfPATH_START.@fits2hdf_extracted@fits2hdf-master@aadnc_benchmarks@quinoa_idea@test_quinoa.py@.PATH_END.py |
{
"filename": "interpolation.py",
"repo_name": "spicy-oil/hfs_fit",
"repo_path": "hfs_fit_extracted/hfs_fit-master/hfs_fit/interpolation.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
import LU as lu
def Gaussian(x, mu, sig, A):
'''
Standard unnormalised gussian
'''
return A * np.exp(-(x - mu)**2/(2*sig**2))
#%% The coefficients for linear interpolation
def A(x, x_i1, x_i):
return (x_i1 - x) / (x_i1 - x_i)
def B(x, x_i1, x_i):
... | spicy-oilREPO_NAMEhfs_fitPATH_START.@hfs_fit_extracted@hfs_fit-master@hfs_fit@interpolation.py@.PATH_END.py |
{
"filename": "sinusoid.py",
"repo_name": "LucaMalavolta/PyORBIT",
"repo_path": "PyORBIT_extracted/PyORBIT-main/pyorbit/common/sinusoid.py",
"type": "Python"
} | from pyorbit.subroutines.common import *
from pyorbit.common.abstract_common import *
class CommonSinusoid(AbstractCommon):
"""
Inherited class from AbstractCommon
"""
model_class = 'sinusoid'
parameters_dictionary = {
'sine_period': # Orbital period of the planet
{
... | LucaMalavoltaREPO_NAMEPyORBITPATH_START.@PyORBIT_extracted@PyORBIT-main@pyorbit@common@sinusoid.py@.PATH_END.py |
{
"filename": "visu.py",
"repo_name": "antoinemarchal/ROHSA",
"repo_path": "ROHSA_extracted/ROHSA-master/publication/SIMU/visu.py",
"type": "Python"
} | import numpy as np
from matplotlib.ticker import FuncFormatter
import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatter
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib.colors as colors
from astropy.io import fits
from astropy import units
from astropy import constants as c... | antoinemarchalREPO_NAMEROHSAPATH_START.@ROHSA_extracted@ROHSA-master@publication@SIMU@visu.py@.PATH_END.py |
{
"filename": "_method.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/slider/step/_method.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MethodValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="method", parent_name="layout.slider.step", **kwargs
):
super(MethodValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@slider@step@_method.py@.PATH_END.py |
{
"filename": "__main__.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/pip/__main__.py",
"type": "Python"
} | import sys
from .runner import run
if __name__ == '__main__':
exit = run()
if exit:
sys.exit(exit)
| waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@pip@__main__.py@.PATH_END.py |
{
"filename": "plot_test.py",
"repo_name": "micbia/serenet",
"repo_path": "serenet_extracted/serenet-main/utils_plot/plot_test.py",
"type": "Python"
} | import numpy as np, matplotlib.pyplot as plt, os
import matplotlib.gridspec as gridspec
import tools21cm as t2c
from matplotlib import colors
import sys
sys.path.append('/jmain02/home/J2AD005/jck02/mxb47-jck02/SegU-Net')
from utils_network.data_generator import LightConeGenerator_SegRec
class MidpointNormalize(colors... | micbiaREPO_NAMEserenetPATH_START.@serenet_extracted@serenet-main@utils_plot@plot_test.py@.PATH_END.py |
{
"filename": "_line.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/layout/shape/_line.py",
"type": "Python"
} | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Line(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.shape"
_path_str = "layout.shape.line"
_valid_props = {"color", "dash", "width"}
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@layout@shape@_line.py@.PATH_END.py |
{
"filename": "test_image_dask.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/astropy/io/fits/tests/test_image_dask.py",
"type": "Python"
} | # Tests related to writing dask arrays to FITS files in an efficient way
import numpy as np
import pytest
from astropy.io import fits
from astropy.io.fits import ImageHDU, PrimaryHDU
da = pytest.importorskip("dask.array")
@pytest.fixture
def dask_array_in_mem():
return da.random.uniform(-1000, 1000, (1322, 755... | astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@io@fits@tests@test_image_dask.py@.PATH_END.py |
{
"filename": "_unselected.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/violin/_unselected.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class UnselectedValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="unselected", parent_name="violin", **kwargs):
super(UnselectedValidator, 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@violin@_unselected.py@.PATH_END.py |
{
"filename": "testMedialGenerator2d.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/tests/functional/Generators/testMedialGenerator2d.py",
"type": "Python"
} | import mpi
from Spheral2d import *
from MedialGenerator import *
from CompositeNodeDistribution import *
from SpheralTestUtilities import *
from VoronoiDistributeNodes import distributeNodes2d as distributeNodes
from siloPointmeshDump import *
commandLine(hmin = 1e-5,
hmax = 1e6,
rhosca... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@tests@functional@Generators@testMedialGenerator2d.py@.PATH_END.py |
{
"filename": "_cone.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/_cone.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ConeValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="cone", parent_name="", **kwargs):
super(ConeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_class_s... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@_cone.py@.PATH_END.py |
{
"filename": "_legendgrouptitle.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/barpolar/_legendgrouptitle.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LegendgrouptitleValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="legendgrouptitle", parent_name="barpolar", **kwargs
):
super(LegendgrouptitleValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@barpolar@_legendgrouptitle.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "andresmegias/radex-python",
"repo_path": "radex-python_extracted/radex-python-main/README.md",
"type": "Markdown"
} | # RADEX Line Fitter
Python interface for using the software RADEX to fit observed transition lines. It consists of a Python 3 script, `radexfit.py`, which is used with RADEX locally.
You can check the user guide ([`userguide.pdf`](https://github.com/andresmegias/radex-python/blob/main/userguide.pdf)) and the example ... | andresmegiasREPO_NAMEradex-pythonPATH_START.@radex-python_extracted@radex-python-main@README.md@.PATH_END.py |
{
"filename": "Trajectory.py",
"repo_name": "wmpg/WesternMeteorPyLib",
"repo_path": "WesternMeteorPyLib_extracted/WesternMeteorPyLib-master/wmpl/Trajectory/Trajectory.py",
"type": "Python"
} | """ PyLIG trajectory solver
Estimates meteor trajectory from given observed points.
"""
from __future__ import print_function, division, absolute_import
import time
import copy
import sys
import os
import datetime
import collections
import pickle
import json
from operator import attrgetter
import base64
import has... | wmpgREPO_NAMEWesternMeteorPyLibPATH_START.@WesternMeteorPyLib_extracted@WesternMeteorPyLib-master@wmpl@Trajectory@Trajectory.py@.PATH_END.py |
{
"filename": "sharedport.py",
"repo_name": "crossbario/crossbar",
"repo_path": "crossbar_extracted/crossbar-master/crossbar/common/twisted/sharedport.py",
"type": "Python"
} | #####################################################################################
#
# Copyright (c) typedef int GmbH
# SPDX-License-Identifier: EUPL-1.2
#
#####################################################################################
import sys
import socket
import platform
from twisted.internet import f... | crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@crossbar@common@twisted@sharedport.py@.PATH_END.py |
{
"filename": "mcsamples.py",
"repo_name": "cmbant/CosmoMC",
"repo_path": "CosmoMC_extracted/CosmoMC-master/python/getdist/mcsamples.py",
"type": "Python"
} | import os
import glob
import logging
import copy
import pickle
import math
import time
from typing import Mapping, Any, Optional, Union, Iterable
import numpy as np
from scipy.stats import norm
import getdist
from getdist import chains, types, covmat, ParamInfo, IniFile, ParamNames, cobaya_interface
from getdist.densi... | cmbantREPO_NAMECosmoMCPATH_START.@CosmoMC_extracted@CosmoMC-master@python@getdist@mcsamples.py@.PATH_END.py |
{
"filename": "ragged_autograph.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/ops/ragged/ragged_autograph.py",
"type": "Python"
} | # Copyright 2023 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@ops@ragged@ragged_autograph.py@.PATH_END.py |
{
"filename": "test_script_BANE.py",
"repo_name": "PaulHancock/Aegean",
"repo_path": "Aegean_extracted/Aegean-main/tests/integration/test_script_BANE.py",
"type": "Python"
} | #! /usr/bin/env python
from AegeanTools.CLI import BANE
image_SIN = 'tests/test_files/1904-66_SIN.fits'
image_AIT = 'tests/test_files/1904-66_AIT.fits'
tempfile = 'dlme'
def test_help():
BANE.main()
def test_cite():
BANE.main(['--cite'])
def test_invalid_file():
BANE.main([tempfile])
def test_nocl... | PaulHancockREPO_NAMEAegeanPATH_START.@Aegean_extracted@Aegean-main@tests@integration@test_script_BANE.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.