metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "compare_ion.py",
"repo_name": "sirocco-rt/sirocco",
"repo_path": "sirocco_extracted/sirocco-main/py_progs/compare_ion.py",
"type": "Python"
} | #!/usr/bin/env python
'''
This routine is used for diagnosing isses with spectra produced during ionization cycles
Command line usage (if any):
usage: Compare.py root1 root2
Description:
This routine compares two spectral files created in
ionization cycles, specifically the log_spec_tot files
Prima... | sirocco-rtREPO_NAMEsiroccoPATH_START.@sirocco_extracted@sirocco-main@py_progs@compare_ion.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "glue-viz/glue",
"repo_path": "glue_extracted/glue-main/doc/conf.py",
"type": "Python"
} | # Configuration file for the Sphinx documentation builder.
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = "Glue"
copyright = "2012-2023, Chris Beaumont, Thomas Robitaille, Michelle Borkin"
aut... | glue-vizREPO_NAMEgluePATH_START.@glue_extracted@glue-main@doc@conf.py@.PATH_END.py |
{
"filename": "x64_context_test.py",
"repo_name": "jax-ml/jax",
"repo_path": "jax_extracted/jax-main/tests/x64_context_test.py",
"type": "Python"
} | # Copyright 2021 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | jax-mlREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@tests@x64_context_test.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "icrar/daliuge",
"repo_path": "daliuge_extracted/daliuge-master/daliuge-engine/dlg/lifecycle/__init__.py",
"type": "Python"
} | #
# ICRAR - International Centre for Radio Astronomy Research
# (c) UWA - The University of Western Australia, 2015
# 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@lifecycle@__init__.py@.PATH_END.py |
{
"filename": "tool_main_step2_model_plot_get.py",
"repo_name": "shihyuntang/igrins_rv",
"repo_path": "igrins_rv_extracted/igrins_rv-master/Tool/tool_main_step2_model_plot_get.py",
"type": "Python"
} | import sys
sys.path.append("..") # Adds higher directory to python modules path.
from Engine.importmodule import *
from Engine.importmodule import read_prepdata
from Engine.IO_AB import setup_templates, init_fitsread, stellarmodel_setup, setup_outdir
from Engine.clips import basicclip_above
from Engine.cont... | shihyuntangREPO_NAMEigrins_rvPATH_START.@igrins_rv_extracted@igrins_rv-master@Tool@tool_main_step2_model_plot_get.py@.PATH_END.py |
{
"filename": "test_interpreter.py",
"repo_name": "xraypy/xraylarch",
"repo_path": "xraylarch_extracted/xraylarch-master/tests/test_interpreter.py",
"type": "Python"
} | #!/usr/bin/env python
"""
Base TestCase for asteval
"""
import ast
import os
import textwrap
import time
import unittest
from sys import version_info
from tempfile import NamedTemporaryFile
from io import StringIO
from larch import Interpreter
HAS_NUMPY = False
try:
# noinspection PyUnresolvedReferences
imp... | xraypyREPO_NAMExraylarchPATH_START.@xraylarch_extracted@xraylarch-master@tests@test_interpreter.py@.PATH_END.py |
{
"filename": "urls.py",
"repo_name": "lsst-uk/lasair-lsst",
"repo_path": "lasair-lsst_extracted/lasair-lsst-main/webserver/lasair/apps/search/urls.py",
"type": "Python"
} | from . import views
from django.urls import path
from django.views.generic import TemplateView
urlpatterns = [
path('simple_search', TemplateView.as_view(template_name='simple_search.html')),
path('search/', views.search, name='search'),
path('search/<query>', views.search, name='search'),
]
| lsst-ukREPO_NAMElasair-lsstPATH_START.@lasair-lsst_extracted@lasair-lsst-main@webserver@lasair@apps@search@urls.py@.PATH_END.py |
{
"filename": "11166_rval_100015.py",
"repo_name": "shreeyesh-biswal/Rvalue_3D",
"repo_path": "Rvalue_3D_extracted/Rvalue_3D-main/Codes/X-class/AR_11166/11166_rval_100015.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 10 18:49:10 2023
@author: shreeyeshbiswal
"""
import os
import numpy as np
import matplotlib as mpl
from matplotlib import pyplot as plt
from matplotlib.pyplot import figure
AR = "11166"
core_dir = "/home/shreeyeshbiswal/IDLWorkspace/Dataset_PF/"
... | shreeyesh-biswalREPO_NAMERvalue_3DPATH_START.@Rvalue_3D_extracted@Rvalue_3D-main@Codes@X-class@AR_11166@11166_rval_100015.py@.PATH_END.py |
{
"filename": "AUTHORS.md",
"repo_name": "rpoleski/MulensModel",
"repo_path": "MulensModel_extracted/MulensModel-master/AUTHORS.md",
"type": "Markdown"
} | MulensModel is developed as an open-source code with contributions from many individuals. These contributions are of various kinds and we would like to thank and give credit to all those people.
Main contributors:
* [Radek Poleski](https://github.com/rpoleski)
* [Yee Jennifer](https://github.com/jenniferyee)
People w... | rpoleskiREPO_NAMEMulensModelPATH_START.@MulensModel_extracted@MulensModel-master@AUTHORS.md@.PATH_END.py |
{
"filename": "210_DataLoading_Automatic.md",
"repo_name": "rometsch/fargocpt",
"repo_path": "fargocpt_extracted/fargocpt-master/docs_source/source/Examples/210_DataLoading_Automatic.md",
"type": "Markdown"
} | ## Loading data from the simulation output - the automatic way
This notebook teaches you how to load data from the simulation output using a helper tool.
We will use the data from the simulation in the quickstart example, so make sure you ran this beforehand.
We'll first create a Data object and ask what's available... | rometschREPO_NAMEfargocptPATH_START.@fargocpt_extracted@fargocpt-master@docs_source@source@Examples@210_DataLoading_Automatic.md@.PATH_END.py |
{
"filename": "exc.py",
"repo_name": "simonsobs/apluggy",
"repo_path": "apluggy_extracted/apluggy-main/tests/stack/sync/exc.py",
"type": "Python"
} | class Thrown(Exception):
'''To be thrown to the context manager.
An argument of `contextmanager.gen.throw()`.
'''
pass
class Raised(Exception):
pass
| simonsobsREPO_NAMEapluggyPATH_START.@apluggy_extracted@apluggy-main@tests@stack@sync@exc.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "PlasmaPy/PlasmaPy",
"repo_path": "PlasmaPy_extracted/PlasmaPy-main/tests/utils/_pytest_helpers/__init__.py",
"type": "Python"
} | PlasmaPyREPO_NAMEPlasmaPyPATH_START.@PlasmaPy_extracted@PlasmaPy-main@tests@utils@_pytest_helpers@__init__.py@.PATH_END.py | |
{
"filename": "e2_envs.py",
"repo_name": "mit-ll/spacegym-kspdg",
"repo_path": "spacegym-kspdg_extracted/spacegym-kspdg-main/src/kspdg/pe1/e2_envs.py",
"type": "Python"
} | # Copyright (c) 2024, MASSACHUSETTS INSTITUTE OF TECHNOLOGY
# Subject to FAR 52.227-11 – Patent Rights – Ownership by the Contractor (May 2014).
# SPDX-License-Identifier: MIT
import time
from numpy.random import rand
from kspdg.pe1.pe1_base import PursuitEvadeGroup1Env
class PE1_E2_ParentEnv(PursuitEvadeGroup1Env):... | mit-llREPO_NAMEspacegym-kspdgPATH_START.@spacegym-kspdg_extracted@spacegym-kspdg-main@src@kspdg@pe1@e2_envs.py@.PATH_END.py |
{
"filename": "tests.py",
"repo_name": "spedas/pyspedas",
"repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/mica/tests/tests.py",
"type": "Python"
} | import os
import unittest
from pytplot import data_exists
import pyspedas
class LoadTestCases(unittest.TestCase):
def test_load_none_data(self):
induction_vars = pyspedas.projects.mica.induction()
self.assertTrue(induction_vars == None)
def test_load_notplot(self):
induction_vars = py... | spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@mica@tests@tests.py@.PATH_END.py |
{
"filename": "beam.py",
"repo_name": "transientskp/tkp",
"repo_path": "tkp_extracted/tkp-master/tkp/telescope/lofar/beam.py",
"type": "Python"
} | """
Beam characterization calculations.
For more information and the math behind this code go to the `LOFAR imaging
capabilities page
<http://www.astron.nl/radio-observatory/astronomers/lofar-imaging-capabilities-sensitivity/lofar-imaging-capabilities/lofa>`_.
"""
import math
def fwhm(lambda_, d, alpha1=1.3):
""... | transientskpREPO_NAMEtkpPATH_START.@tkp_extracted@tkp-master@tkp@telescope@lofar@beam.py@.PATH_END.py |
{
"filename": "plot_learning_curve.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/examples/model_selection/plot_learning_curve.py",
"type": "Python"
} | """
=========================================================
Plotting Learning Curves and Checking Models' Scalability
=========================================================
In this example, we show how to use the class
:class:`~sklearn.model_selection.LearningCurveDisplay` to easily plot learning
curves. In addit... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@examples@model_selection@plot_learning_curve.py@.PATH_END.py |
{
"filename": "test_Sk.py",
"repo_name": "sambit-giri/BCemu",
"repo_path": "BCemu_extracted/BCemu-master/tests/test_Sk.py",
"type": "Python"
} | import numpy as np
import pickle
from BCemu import *
### Cosmology
Ob, Om = 0.0463, 0.2793
bcmdict = {'log10Mc': 13.32,
'mu' : 0.93,
'thej' : 4.235,
'gamma' : 2.25,
'delta' : 6.40,
'eta' : 0.15,
'deta' : 0.14,
}
k_eval = 10**np.linspace(-1,1.08,50)
def test_BCM_7pa... | sambit-giriREPO_NAMEBCemuPATH_START.@BCemu_extracted@BCemu-master@tests@test_Sk.py@.PATH_END.py |
{
"filename": "sb1_base.py",
"repo_name": "ARCLab-MIT/kspdg",
"repo_path": "kspdg_extracted/kspdg-main/src/kspdg/sb1/sb1_base.py",
"type": "Python"
} | # Copyright (c) 2023, MASSACHUSETTS INSTITUTE OF TECHNOLOGY
# Subject to FAR 52.227-11 – Patent Rights – Ownership by the Contractor (May 2014).
# SPDX-License-Identifier: MIT
import gymnasium as gym
import numpy as np
from typing import List, Dict
from copy import deepcopy
import kspdg.utils.utils as U
from kspdg.p... | ARCLab-MITREPO_NAMEkspdgPATH_START.@kspdg_extracted@kspdg-main@src@kspdg@sb1@sb1_base.py@.PATH_END.py |
{
"filename": "test_st_stdout.py",
"repo_name": "simonsobs/nextline-rdb",
"repo_path": "nextline-rdb_extracted/nextline-rdb-main/src/nextline_rdb/alembic/models/rev_f9a742bb2297/strategies/tests/test_st_stdout.py",
"type": "Python"
} | from hypothesis import given
from hypothesis import strategies as st
from sqlalchemy import select
from sqlalchemy.orm import selectinload
from nextline_rdb.db import DB
from ... import Model, Stdout
from .. import st_model_stdout
@given(st.data())
async def test_st_model_stdout(data: st.DataObject) -> None:
st... | simonsobsREPO_NAMEnextline-rdbPATH_START.@nextline-rdb_extracted@nextline-rdb-main@src@nextline_rdb@alembic@models@rev_f9a742bb2297@strategies@tests@test_st_stdout.py@.PATH_END.py |
{
"filename": "octree_raytracing.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/yt/utilities/lib/octree_raytracing.py",
"type": "Python"
} | from itertools import product
import numpy as np
from yt.funcs import mylog
from yt.utilities.lib._octree_raytracing import _OctreeRayTracing
class OctreeRayTracing:
octree = None
data_source = None
log_fields = None
fields = None
# Internal data
_cell_index = None
_tvalues = None
... | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@utilities@lib@octree_raytracing.py@.PATH_END.py |
{
"filename": "Figure56.ipynb",
"repo_name": "birnstiel/dsharp_opac",
"repo_path": "dsharp_opac_extracted/dsharp_opac-master/notebooks/Figure56.ipynb",
"type": "Jupyter Notebook"
} | # Figure 5 & 6: Size Averaged $\lambda$ dependence, Size Distributions
```python
%run header.py
```
```python
d = np.load(opacity.get_datafile('default_opacities_smooth.npz'))
a = d['a']
lam = d['lam']
k_abs = d['k_abs']
k_sca = d['k_sca']
```
```python
# Download one of the Weingartner & Draine 20... | birnstielREPO_NAMEdsharp_opacPATH_START.@dsharp_opac_extracted@dsharp_opac-master@notebooks@Figure56.ipynb@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "rhysrb/Pq_server",
"repo_path": "Pq_server_extracted/Pq_server-master/README.md",
"type": "Markdown"
} | # Pq_server
v1.3 28th August 2020
Fixes for flux values of exactly 0 Jy and more than 10 photometry measurements in a single filter.
Proper i-band quasar templates included - useful for z~6 calculations.
Slight improvements to plotting routines - filters presented as a list rather than a smushed line under the plo... | rhysrbREPO_NAMEPq_serverPATH_START.@Pq_server_extracted@Pq_server-master@README.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "maxmahlke/ssos",
"repo_path": "ssos_extracted/ssos-master/ssos/__init__.py",
"type": "Python"
} | name = "ssos"
__version__ = "1.3.5"
GREETING = (
"""
* + ssos %s
+ x
' https://ssos.readthedocs.io
* + _.::' |
:_.' - o - ssos --default : Copy default settings to CWD
| | ssos --help : Print detailed help
O - * ' ... | maxmahlkeREPO_NAMEssosPATH_START.@ssos_extracted@ssos-master@ssos@__init__.py@.PATH_END.py |
{
"filename": "reddening.py",
"repo_name": "IvS-KULeuven/IvSPythonRepository",
"repo_path": "IvSPythonRepository_extracted/IvSPythonRepository-master/sed/reddening.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Definitions of interstellar reddening curves
Section 1. General interface
============================
Use the general interface to get different curves:
>>> wave = np.r_[1e3:1e5:10]
>>> for name in ['chiar2006','fitzpatrick1999','fitzpatrick2004','cardelli1989','seaton1979']:
... wave_... | IvS-KULeuvenREPO_NAMEIvSPythonRepositoryPATH_START.@IvSPythonRepository_extracted@IvSPythonRepository-master@sed@reddening.py@.PATH_END.py |
{
"filename": "classification.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/tutorials/classification.ipynb",
"type": "Jupyter Notebook"
} | ---
title: Tagging
sidebar_class_name: hidden
---
[](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/use_cases/tagging.ipynb)
# Classify Text into Labels
Tagging means labeling a document with classes such ... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@tutorials@classification.ipynb@.PATH_END.py |
{
"filename": "_size.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatterpolargl/marker/colorbar/title/font/_size.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="size",
parent_name="scatterpolargl.marker.colorbar.title.font",
**kwargs
):
super(SizeValidator, self).__init__(
plotly_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatterpolargl@marker@colorbar@title@font@_size.py@.PATH_END.py |
{
"filename": "gadget.py",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/src/amuse/io/gadget.py",
"type": "Python"
} | import struct
import numpy
from collections import namedtuple
from amuse.io import base
from amuse.units import units
from amuse.units import nbody_system
from amuse.support.core import late
from amuse import datamodel
class GadgetFileFormatProcessor(base.FortranFileFormatProcessor):
"""
Process a Gadget bi... | amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@src@amuse@io@gadget.py@.PATH_END.py |
{
"filename": "test_cascade.py",
"repo_name": "ChrisBeaumont/brut",
"repo_path": "brut_extracted/brut-master/bubbly/test/test_cascade.py",
"type": "Python"
} | from sklearn.datasets import make_moons
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.metrics import recall_score
import numpy as np
import pytest
from ..cascade import CascadedBooster, _recall_bias, _fpos_bias
from ..util import false_pos
def test_recall_bias():
df = np.arange(5)
f... | ChrisBeaumontREPO_NAMEbrutPATH_START.@brut_extracted@brut-master@bubbly@test@test_cascade.py@.PATH_END.py |
{
"filename": "line_intensity.py",
"repo_name": "sambit-giri/tools21cm",
"repo_path": "tools21cm_extracted/tools21cm-master/src/tools21cm/line_intensity.py",
"type": "Python"
} | import numpy as np
from glob import glob
import astropy
from astropy import constants, units
from astropy.cosmology import Planck18
from .nbody_file import halo_list_to_grid
def M_HI_on_grid(z, mass, pos_xyz, box_dim, n_grid, cosmo=None,
recipe='Padmanabhan2017', **kwargs):
"""
Assign HI line... | sambit-giriREPO_NAMEtools21cmPATH_START.@tools21cm_extracted@tools21cm-master@src@tools21cm@line_intensity.py@.PATH_END.py |
{
"filename": "conftest.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/indexes/multi/conftest.py",
"type": "Python"
} | import numpy as np
import pytest
from pandas import (
Index,
MultiIndex,
)
# Note: identical the "multi" entry in the top-level "index" fixture
@pytest.fixture
def idx():
# a MultiIndex used to test the general functionality of the
# general functionality of this object
major_axis = Index(["foo",... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@indexes@multi@conftest.py@.PATH_END.py |
{
"filename": "wbd.py",
"repo_name": "spedas/pyspedas",
"repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/cluster/wbd.py",
"type": "Python"
} | from .load import load
from typing import List, Union, Optional
def wbd(trange:List[str]=['2003-11-01/14:00:00','2003-11-01/14:05:00'],
probe:Union[str,List[str]]='1',
datatype:str='waveform',
prefix:str='',
suffix:str='',
get_support_data:bool=False,
varformat:str=None... | spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@cluster@wbd.py@.PATH_END.py |
{
"filename": "SUSHI Test Notebook (old version).ipynb",
"repo_name": "jmlascar/SUSHI",
"repo_path": "SUSHI_extracted/SUSHI-main/older_version/SUSHI Test Notebook (old version).ipynb",
"type": "Jupyter Notebook"
} | This notebook shows an example of SUSHI being used to unmix the components of the toymodel described in Lascar, Acero, Bobin 2023.
```python
# Imports
%matplotlib inline
#autorealod library when an external lib is changed.
import sys, os
%load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.p... | jmlascarREPO_NAMESUSHIPATH_START.@SUSHI_extracted@SUSHI-main@older_version@SUSHI Test Notebook (old version).ipynb@.PATH_END.py |
{
"filename": "_fill.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatter/_fill.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FillValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="fill", parent_name="scatter", **kwargs):
super(FillValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edi... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatter@_fill.py@.PATH_END.py |
{
"filename": "_base.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/joblib/joblib/externals/loky/_base.py",
"type": "Python"
} | ###############################################################################
# Modification of concurrent.futures.Future
#
# author: Thomas Moreau and Olivier Grisel
#
# adapted from concurrent/futures/_base.py (17/02/2017)
# * Do not use yield from
# * Use old super syntax
#
# Copyright 2009 Brian Quinlan. All Ri... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@joblib@joblib@externals@loky@_base.py@.PATH_END.py |
{
"filename": "miriad_test.py",
"repo_name": "HERA-Team/aipy",
"repo_path": "aipy_extracted/aipy-main/tests/miriad_test.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Copyright (c) 2010 Aaron Parsons
# Licensed under the GPLv3
import pytest
import numpy as np
from aipy import miriad
from aipy import _miriad
@pytest.fixture(scope="function")
def test_file_r(tmp_path):
filename1 = str(tmp_path / "test1.uv")
filename2 = str(tmp_path / "test2.uv")
... | HERA-TeamREPO_NAMEaipyPATH_START.@aipy_extracted@aipy-main@tests@miriad_test.py@.PATH_END.py |
{
"filename": "conftest.py",
"repo_name": "NASA-Planetary-Science/sbpy",
"repo_path": "sbpy_extracted/sbpy-main/sbpy/conftest.py",
"type": "Python"
} | """Configure Test Suite.
This file is used to configure the behavior of pytest when using the Astropy
test infrastructure. It needs to live inside the package in order for it to
get picked up when running the tests inside an interpreter using
packagename.test
"""
import os
try:
from pytest_astropy_header.displa... | NASA-Planetary-ScienceREPO_NAMEsbpyPATH_START.@sbpy_extracted@sbpy-main@sbpy@conftest.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "simonsobs/socs",
"repo_path": "socs_extracted/socs-main/socs/agents/ibootbar/__init__.py",
"type": "Python"
} | simonsobsREPO_NAMEsocsPATH_START.@socs_extracted@socs-main@socs@agents@ibootbar@__init__.py@.PATH_END.py | |
{
"filename": "test_util.py",
"repo_name": "adrn/gala",
"repo_path": "gala_extracted/gala-main/gala/tests/test_util.py",
"type": "Python"
} | # Third-party
import pytest
# Project
from ..util import ImmutableDict
def test_immutabledict():
a = dict(a=5, c=6)
b = ImmutableDict(**a)
with pytest.raises(TypeError):
b['test'] = 5
| adrnREPO_NAMEgalaPATH_START.@gala_extracted@gala-main@gala@tests@test_util.py@.PATH_END.py |
{
"filename": "arbitrary_fn.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/docstore/arbitrary_fn.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.docstore.arbitrary_fn import DocstoreFn
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional import... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@docstore@arbitrary_fn.py@.PATH_END.py |
{
"filename": "CustomPrior_trueback.py",
"repo_name": "ThomasEdwardRiley/xpsi-pre-transfer",
"repo_path": "xpsi-pre-transfer_extracted/xpsi-pre-transfer-master/examples/true_background/CustomPrior_trueback.py",
"type": "Python"
} | from __future__ import print_function, division
import numpy as np
import math
from scipy.stats import truncnorm
import xpsi
from xpsi.global_imports import _G, _csq, _km, _M_s, _2pi, gravradius
class CustomPrior(xpsi.Prior):
""" A custom (joint) prior distribution.
Currently tailored to the NICER light-cur... | ThomasEdwardRileyREPO_NAMExpsi-pre-transferPATH_START.@xpsi-pre-transfer_extracted@xpsi-pre-transfer-master@examples@true_background@CustomPrior_trueback.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/pointcloud/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._ysrc import YsrcValidator
from ._yboundssrc import YboundssrcValidator
from ._ybounds import YboundsValidator
from ._yaxis import YaxisValidator
from ._y import YValidator
from ._xysrc import XysrcValidator
from ._xy import XyValidator
fro... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@pointcloud@__init__.py@.PATH_END.py |
{
"filename": "limbdark.py",
"repo_name": "rodluger/starry",
"repo_path": "starry_extracted/starry-master/starry/_core/ops/limbdark/limbdark.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
__all__ = ["LimbDarkOp"]
from ....compat import Apply, theano, tt
from .base_op import LimbDarkBaseOp
class LimbDarkOp(LimbDarkBaseOp):
__props__ = ()
func_file = "./limbdark.cc"
func_name = "APPLY_SPECIFIC(limbdark)"
def make_node(self, c, b, r, los):
in_args = []
... | rodlugerREPO_NAMEstarryPATH_START.@starry_extracted@starry-master@starry@_core@ops@limbdark@limbdark.py@.PATH_END.py |
{
"filename": "CmdLine.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/tools/cython/Cython/Compiler/CmdLine.py",
"type": "Python"
} | #
# Cython - Command Line Parsing
#
from __future__ import absolute_import
import os
import sys
from . import Options
usage = """\
Cython (http://cython.org) is a compiler for code written in the
Cython language. Cython is based on Pyrex by Greg Ewing.
Usage: cython [options] sourcefile.{pyx,py} ...
Options:
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@cython@Cython@Compiler@CmdLine.py@.PATH_END.py |
{
"filename": "test_spectrum.py",
"repo_name": "tardis-sn/tardis",
"repo_path": "tardis_extracted/tardis-main/tardis/montecarlo/tests/test_spectrum.py",
"type": "Python"
} | import pytest
import numpy as np
import pandas as pd
import os
from astropy import units as u, constants as c
import astropy.tests.helper as test_helper
from numpy.testing import assert_almost_equal
from tardis.montecarlo.spectrum import (
TARDISSpectrum,
)
BIN = 5
TESTDATA = [
{
"nu": u.Quantity(np.l... | tardis-snREPO_NAMEtardisPATH_START.@tardis_extracted@tardis-main@tardis@montecarlo@tests@test_spectrum.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "petigura/terra",
"repo_path": "terra_extracted/terra-master/terra/FFA/__init__.py",
"type": "Python"
} | petiguraREPO_NAMEterraPATH_START.@terra_extracted@terra-master@terra@FFA@__init__.py@.PATH_END.py | |
{
"filename": "test_regions.py",
"repo_name": "spacetelescope/jdaviz",
"repo_path": "jdaviz_extracted/jdaviz-main/jdaviz/configs/cubeviz/plugins/tests/test_regions.py",
"type": "Python"
} | """This module tests region handling specific to Cubeviz.
Generic handling logic already covered in
jdaviz/configs/imviz/tests/test_regions.py
"""
import numpy as np
import pytest
from astropy import units as u
from astropy.coordinates import SkyCoord
from regions import PixCoord, CirclePixelRegion, CircleSkyRegion, El... | spacetelescopeREPO_NAMEjdavizPATH_START.@jdaviz_extracted@jdaviz-main@jdaviz@configs@cubeviz@plugins@tests@test_regions.py@.PATH_END.py |
{
"filename": "minimizer.py",
"repo_name": "IvS-KULeuven/IvSPythonRepository",
"repo_path": "IvSPythonRepository_extracted/IvSPythonRepository-master/sigproc/lmfit/minimizer.py",
"type": "Python"
} | """
Simple minimizer is a wrapper around scipy.leastsq, allowing a
user to build a fitting model as a function of general purpose
Fit Parameters that can be fixed or floated, bounded, and written
as a simple expression of other Fit Parameters.
The user sets up a model in terms of instance of Parameters, writes a
func... | IvS-KULeuvenREPO_NAMEIvSPythonRepositoryPATH_START.@IvSPythonRepository_extracted@IvSPythonRepository-master@sigproc@lmfit@minimizer.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "kennethcarrell/ATARRI",
"repo_path": "ATARRI_extracted/ATARRI-main/README.md",
"type": "Markdown"
} | # ATARRI
A TESS Archive RR Lyrae Classifier
## Look in the [doc](doc/) directory for information about:
- [Installing](doc/Installation.pdf) this package
- [Using](doc/UserManual.pdf) this package
- A [Science-Use Guidebook](doc/Guidebook.pdf) for this package.
###### Example usage:
```python
import tkinter
from ATA... | kennethcarrellREPO_NAMEATARRIPATH_START.@ATARRI_extracted@ATARRI-main@README.md@.PATH_END.py |
{
"filename": "astropyconst13.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/constants/astropyconst13.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astronomical and physics constants for Astropy v1.3 and earlier.
See :mod:`astropy.constants` for a complete listing of constants
defined in Astropy.
"""
from __future__ import (absolute_import, division, print_function,
unico... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@constants@astropyconst13.py@.PATH_END.py |
{
"filename": "_ticks.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterternary/marker/colorbar/_ticks.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicksValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="ticks",
parent_name="scatterternary.marker.colorbar",
**kwargs,
):
super(TicksValidator, self).__init__(
plotly_name=... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterternary@marker@colorbar@_ticks.py@.PATH_END.py |
{
"filename": "_len.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/contour/colorbar/_len.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="len", parent_name="contour.colorbar", **kwargs):
super(LenValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@contour@colorbar@_len.py@.PATH_END.py |
{
"filename": "tools.py",
"repo_name": "pcubillos/pyratbay",
"repo_path": "pyratbay_extracted/pyratbay-master/pyratbay/tools/tools.py",
"type": "Python"
} | # Copyright (c) 2021 Patricio Cubillos
# Pyrat Bay is open-source software under the GNU GPL-2.0 license (see LICENSE)
__all__ = [
'log_error',
'cd',
'tmp_reset',
'binsearch',
'divisors',
'unpack',
'u',
'get_param',
'ifirst', 'ilast',
'isfile',
'file_exists',
'path',
... | pcubillosREPO_NAMEpyratbayPATH_START.@pyratbay_extracted@pyratbay-master@pyratbay@tools@tools.py@.PATH_END.py |
{
"filename": "LocalProxy.py",
"repo_name": "bill-cotton/Obit",
"repo_path": "Obit_extracted/Obit-master/ObitSystem/ObitTalk/python/LocalProxy.py",
"type": "Python"
} | # Copyright (C) 2007 Associated Universities, Inc
# Copyright (C) 2005 Joint Institute for VLBI in Europe
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# ... | bill-cottonREPO_NAMEObitPATH_START.@Obit_extracted@Obit-master@ObitSystem@ObitTalk@python@LocalProxy.py@.PATH_END.py |
{
"filename": "py_dataset_adapter_test.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/trainers/data_adapters/py_dataset_adapter_test.py",
"type": "Python"
} | import math
import time
import jax
import numpy as np
import pytest
import tensorflow as tf
import torch
from absl.testing import parameterized
from keras.src import backend
from keras.src import testing
from keras.src.testing.test_utils import named_product
from keras.src.trainers.data_adapters import py_dataset_ada... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@trainers@data_adapters@py_dataset_adapter_test.py@.PATH_END.py |
{
"filename": "global_clock_corrections.py",
"repo_name": "nanograv/PINT",
"repo_path": "PINT_extracted/PINT-master/src/pint/observatory/global_clock_corrections.py",
"type": "Python"
} | """Tools for working with clock corrections obtained from a global location.
The goal is for PINT (and other programs) to be able to download up-to-date
observatory clock corrections from a central location, which observatories
or third parties will update as new clock correction data becomes available.
The global re... | nanogravREPO_NAMEPINTPATH_START.@PINT_extracted@PINT-master@src@pint@observatory@global_clock_corrections.py@.PATH_END.py |
{
"filename": "daily_test.py",
"repo_name": "gwastro/pycbc",
"repo_path": "pycbc_extracted/pycbc-master/examples/workflow/data_checker/daily_test.py",
"type": "Python"
} | #!/usr/bin/env python
# Copyright (C) 2013 Ian W. Harry
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This prog... | gwastroREPO_NAMEpycbcPATH_START.@pycbc_extracted@pycbc-master@examples@workflow@data_checker@daily_test.py@.PATH_END.py |
{
"filename": "test_log_exoctk.py",
"repo_name": "ExoCTK/exoctk",
"repo_path": "exoctk_extracted/exoctk-main/exoctk/tests/test_log_exoctk.py",
"type": "Python"
} | #! /usr/bin/env python
"""Tests for the ``log_exoctk`` module.
Authors
-------
Matthew Bourque
Use
---
These tests can be run via the command line (omit the ``-s`` to
suppress verbose output to stdout):
::
pytest -s test_log_exoctk.py
"""
import os
import astropy
import sqlite3
from exo... | ExoCTKREPO_NAMEexoctkPATH_START.@exoctk_extracted@exoctk-main@exoctk@tests@test_log_exoctk.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "EliseJ/astroABC",
"repo_path": "astroABC_extracted/astroABC-master/setup.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys
from pkg_resources import parse_version
from setuptools import setup, find_packages
numpy_min_version = '1.8'
def get_numpy_status():
"""
Returns a dictionary containing a boolean specifying whether NumPy
is up-to-date, along with the version string (e... | EliseJREPO_NAMEastroABCPATH_START.@astroABC_extracted@astroABC-master@setup.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "adrn/schwimmbad",
"repo_path": "schwimmbad_extracted/schwimmbad-main/docs/conf.py",
"type": "Python"
} | import importlib.metadata
project = "schwimmbad"
copyright = "2016-2024, Adrian Price-Whelan"
author = "Adrian Price-Whelan"
version = release = importlib.metadata.version("schwimmbad")
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sph... | adrnREPO_NAMEschwimmbadPATH_START.@schwimmbad_extracted@schwimmbad-main@docs@conf.py@.PATH_END.py |
{
"filename": "mcrotations.py",
"repo_name": "astropy/halotools",
"repo_path": "halotools_extracted/halotools-master/halotools/utils/mcrotations.py",
"type": "Python"
} | """
A set of rotation utilites that apply monte carlo
roations to collections of 2- and 3-dimensional vectors
"""
from __future__ import division, print_function, absolute_import, unicode_literals
import numpy as np
from astropy.utils.misc import NumpyRNGContext
from .vector_utilities import elementwise_norm, elementwi... | astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@halotools@utils@mcrotations.py@.PATH_END.py |
{
"filename": "analysis.py",
"repo_name": "zblz/naima",
"repo_path": "naima_extracted/naima-main/src/naima/analysis.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from pathlib import Path
import astropy.units as u
import h5py
import numpy as np
from astropy import log
from astropy.io.misc.hdf5 import read_table_hdf5, write_table_hdf5
from astropy.table import Table
from .plot import find_ML
try:
imp... | zblzREPO_NAMEnaimaPATH_START.@naima_extracted@naima-main@src@naima@analysis.py@.PATH_END.py |
{
"filename": "recipes_BUNDLE.py",
"repo_name": "GeminiDRSoftware/DRAGONS",
"repo_path": "DRAGONS_extracted/DRAGONS-master/geminidr/ghost/recipes/sq/recipes_BUNDLE.py",
"type": "Python"
} | """
Recipes available to data with tags ``['GHOST', `BUNDLE`]``.
Recipes imported from :any:`qa.recipes_BUNDLE`.
"""
recipe_tags = set(['GHOST', 'BUNDLE', 'RAW', 'UNPREPARED'])
def processBundle(p):
"""
This recipe processes GHOST observation bundles.
Parameters
----------
p : Primitives object
... | GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@geminidr@ghost@recipes@sq@recipes_BUNDLE.py@.PATH_END.py |
{
"filename": "_yanchor.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter3d/marker/colorbar/_yanchor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YanchorValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="yanchor", parent_name="scatter3d.marker.colorbar", **kwargs
):
super(YanchorValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter3d@marker@colorbar@_yanchor.py@.PATH_END.py |
{
"filename": "common.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/integrate/_ivp/common.py",
"type": "Python"
} | from itertools import groupby
from warnings import warn
import numpy as np
from scipy.sparse import find, coo_matrix
EPS = np.finfo(float).eps
def validate_first_step(first_step, t0, t_bound):
"""Assert that first_step is valid and return it."""
if first_step <= 0:
raise ValueError("`first_step` mus... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@integrate@_ivp@common.py@.PATH_END.py |
{
"filename": "scimath.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/numpy/py2/numpy/lib/scimath.py",
"type": "Python"
} | """
Wrapper functions to more user-friendly calling of certain math functions
whose output data-type is different than the input data-type in certain
domains of the input.
For example, for functions like `log` with branch cuts, the versions in this
module provide the mathematically valid answers in the complex plane::... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@numpy@py2@numpy@lib@scimath.py@.PATH_END.py |
{
"filename": "_hovertemplatesrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/splom/_hovertemplatesrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HovertemplatesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="hovertemplatesrc", parent_name="splom", **kwargs):
super(HovertemplatesrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@splom@_hovertemplatesrc.py@.PATH_END.py |
{
"filename": "main_sequence_kernels.py",
"repo_name": "ArgonneCPAC/diffstar",
"repo_path": "diffstar_extracted/diffstar-main/diffstar/kernels/main_sequence_kernels.py",
"type": "Python"
} | """
"""
from collections import OrderedDict, namedtuple
import numpy as np
from diffmah.defaults import MAH_K
from diffmah.individual_halo_assembly import (
_calc_halo_history,
_calc_halo_history_scalar,
_rolling_plaw_vs_logt,
)
from jax import jit as jjit
from jax import lax
from jax import numpy as jnp
... | ArgonneCPACREPO_NAMEdiffstarPATH_START.@diffstar_extracted@diffstar-main@diffstar@kernels@main_sequence_kernels.py@.PATH_END.py |
{
"filename": "strings_test.py",
"repo_name": "vaexio/vaex",
"repo_path": "vaex_extracted/vaex-master/tests/strings_test.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
import sys
import re
import vaex
import numpy as np
import pyarrow as pa
import pytest
from common import small_buffer
@pytest.mark.skipif(vaex.utils.osname == 'windows',
reason="windows' snprintf seems buggy")
def test_format():
num1 = np.array([1, 2, 3], dtype=int)
... | vaexioREPO_NAMEvaexPATH_START.@vaex_extracted@vaex-master@tests@strings_test.py@.PATH_END.py |
{
"filename": "merge.py",
"repo_name": "dirac-institute/hybrid_sso_catalogue",
"repo_path": "hybrid_sso_catalogue_extracted/hybrid_sso_catalogue-main/hybridcat/merge.py",
"type": "Python"
} | from scipy.spatial import cKDTree
import numpy as np
import pandas as pd
import dask
from dask.distributed import Client, wait
@dask.delayed
def merge_magnitude_bin(sim, real, min_mag, max_mag, k=100, d_max=0.1, output_folder="output/"):
"""Merge the simulated solar system catalogue with the real MPCORB data for ... | dirac-instituteREPO_NAMEhybrid_sso_cataloguePATH_START.@hybrid_sso_catalogue_extracted@hybrid_sso_catalogue-main@hybridcat@merge.py@.PATH_END.py |
{
"filename": "imaging_plots.py",
"repo_name": "tvwenger/wisp",
"repo_path": "wisp_extracted/wisp-master/wisp/imaging_plots.py",
"type": "Python"
} | """
imaging_plots.py - WISP plotting utilities for imaging
Copyright(C) 2018-2022 by
Trey V. Wenger; tvwenger@gmail.com
GNU General Public License v3 (GNU GPLv3)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software... | tvwengerREPO_NAMEwispPATH_START.@wisp_extracted@wisp-master@wisp@imaging_plots.py@.PATH_END.py |
{
"filename": "plotting.py",
"repo_name": "epfl-radio-astro/scatternet",
"repo_path": "scatternet_extracted/scatternet-main/scatternet/utils/plotting.py",
"type": "Python"
} | import matplotlib.pyplot as plt
from sklearn import svm, metrics
from sklearn.preprocessing import StandardScaler
def plot_features(x0, x_in, y_in, feature_matrix, indices, feature_labels,label_list):
n_output_coeffs = feature_matrix.shape[1]
plt.clf()
fig, axs = plt.subplots(len(indices),n_output_coeffs+2... | epfl-radio-astroREPO_NAMEscatternetPATH_START.@scatternet_extracted@scatternet-main@scatternet@utils@plotting.py@.PATH_END.py |
{
"filename": "google_jobs.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/utilities/google_jobs.py",
"type": "Python"
} | """Util that calls Google Scholar Search."""
from typing import Any, Dict, Optional, cast
from langchain_core.utils import convert_to_secret_str, get_from_dict_or_env
from pydantic import BaseModel, ConfigDict, SecretStr, model_validator
class GoogleJobsAPIWrapper(BaseModel):
"""Wrapper for SerpApi's Google Sch... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@utilities@google_jobs.py@.PATH_END.py |
{
"filename": "evolve_triple_with_wind.py",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/examples/textbook/evolve_triple_with_wind.py",
"type": "Python"
} | """
N-body integration of N particles with a Salpeter initial mass
function between Mmin and Mmax and with stellar evolution with
metallicity z.
"""
import sys
import numpy
from optparse import OptionParser
from prepare_figure import single_frame
from distinct_colours import get_distinct
from amuse.units imp... | amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@examples@textbook@evolve_triple_with_wind.py@.PATH_END.py |
{
"filename": "identity_test.py",
"repo_name": "triton-inference-server/server",
"repo_path": "server_extracted/server-main/qa/L0_backend_identity/identity_test.py",
"type": "Python"
} | #!/usr/bin/python
# Copyright 2019-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# ... | triton-inference-serverREPO_NAMEserverPATH_START.@server_extracted@server-main@qa@L0_backend_identity@identity_test.py@.PATH_END.py |
{
"filename": "test_event_list.py",
"repo_name": "threeML/threeML",
"repo_path": "threeML_extracted/threeML-master/threeML/test/test_event_list.py",
"type": "Python"
} | from __future__ import division
from past.utils import old_div
import os
import numpy as np
import pytest
from .conftest import get_test_datasets_directory
from threeML.io.file_utils import within_directory
from threeML.utils.time_interval import TimeIntervalSet
from threeML.utils.time_series.event_list import EventLi... | threeMLREPO_NAMEthreeMLPATH_START.@threeML_extracted@threeML-master@threeML@test@test_event_list.py@.PATH_END.py |
{
"filename": "_variant.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattermap/marker/colorbar/tickfont/_variant.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="variant",
parent_name="scattermap.marker.colorbar.tickfont",
**kwargs,
):
super(VariantValidator, self).__init__(
p... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattermap@marker@colorbar@tickfont@_variant.py@.PATH_END.py |
{
"filename": "point_source_cached.py",
"repo_name": "lenstronomy/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/lenstronomy/PointSource/point_source_cached.py",
"type": "Python"
} | __all__ = ["PointSourceCached"]
class PointSourceCached(object):
"""This class is the same as PointSource() except that it saves image and source
positions in cache.
This speeds-up repeated calls for the same source and lens model and avoids duplicating the lens equation solving.
Attention: cache nee... | lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@lenstronomy@PointSource@point_source_cached.py@.PATH_END.py |
{
"filename": "developer.md",
"repo_name": "fritz-marshal/fritz",
"repo_path": "fritz_extracted/fritz-main/doc/developer.md",
"type": "Markdown"
} | # Developer Guidelines
## How to contribute
Contributions to Fritz are made through [GitHub Pull Requests](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests), a set of proposed commits (or patches).
To prepare, you should:
- Create your own fork the [fritz repository]... | fritz-marshalREPO_NAMEfritzPATH_START.@fritz_extracted@fritz-main@doc@developer.md@.PATH_END.py |
{
"filename": "provisional.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/hypothesis/py3/hypothesis/provisional.py",
"type": "Python"
} | # This file is part of Hypothesis, which may be found at
# https://github.com/HypothesisWorks/hypothesis/
#
# Copyright the Hypothesis Authors.
# Individual contributors are listed in AUTHORS.rst and the git log.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@hypothesis@py3@hypothesis@provisional.py@.PATH_END.py |
{
"filename": "test_materials.py",
"repo_name": "Jashcraf/poke",
"repo_path": "poke_extracted/poke-main/tests/test_materials.py",
"type": "Python"
} | import numpy as np
import poke.materials as mat
def test_create_index_model():
# TODO: The file import system doesn't work on the GH Actions test
# prealloc lists
reference = []
test = []
# pick a complex material and a dielectric
materials = ['Al','HfO2']
# load refractive indices fro... | JashcrafREPO_NAMEpokePATH_START.@poke_extracted@poke-main@tests@test_materials.py@.PATH_END.py |
{
"filename": "earth_signal.py",
"repo_name": "cosmo-ethz/hide",
"repo_path": "hide_extracted/hide-master/hide/plugins/earth_signal.py",
"type": "Python"
} | # HIDE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# HIDE is distributed in the hope that it will be useful,
# but WITHOUT ANY W... | cosmo-ethzREPO_NAMEhidePATH_START.@hide_extracted@hide-master@hide@plugins@earth_signal.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "stephane-caron/qpsolvers",
"repo_path": "qpsolvers_extracted/qpsolvers-main/qpsolvers/__init__.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: LGPL-3.0-or-later
# Copyright 2016-2022 Stéphane Caron and the qpsolvers contributors
"""Quadratic programming solvers in Python with a unified API."""
from ._internals import available_solvers
from .active_set import ActiveSet
from .exception... | stephane-caronREPO_NAMEqpsolversPATH_START.@qpsolvers_extracted@qpsolvers-main@qpsolvers@__init__.py@.PATH_END.py |
{
"filename": "_legendwidth.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/contourcarpet/_legendwidth.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LegendwidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="legendwidth", parent_name="contourcarpet", **kwargs
):
super(LegendwidthValidator, self).__init__(
plotly_name=plotly_name,
par... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@contourcarpet@_legendwidth.py@.PATH_END.py |
{
"filename": "python__staged_predict__output-type__intro.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage/python__staged_predict__output-type__intro.md",
"type": "Markdown"
} |
Generator that produces predictions with a sequentially growing subset of trees from the model. The type of generated values depends on the number of input objects:
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage@python__staged_predict__output-type__intro.md@.PATH_END.py |
{
"filename": "imaging.py",
"repo_name": "psheehan/pdspy",
"repo_path": "pdspy_extracted/pdspy-master/pdspy/imaging/imaging.py",
"type": "Python"
} | import numpy
import astropy
import h5py
from ..constants.physics import c
class Image:
def __init__(self,image=None,x=None,y=None,header=None,wave=None, \
freq=None,unc=None,velocity=None):
if (type(image) != type(None)):
self.image = image
if (type(x) != type(None)):
... | psheehanREPO_NAMEpdspyPATH_START.@pdspy_extracted@pdspy-master@pdspy@imaging@imaging.py@.PATH_END.py |
{
"filename": "plate.py",
"repo_name": "sdss/marvin",
"repo_path": "marvin_extracted/marvin-main/python/marvin/tools/plate.py",
"type": "Python"
} | #!/usr/bin/env python
# encoding: utf-8
# Created by Brian Cherinka on 2016-05-17 10:17:35
# Licensed under a 3-clause BSD license.
# Revision History:
# Initial Version: 2016-05-17 10:17:35 by Brian Cherinka
# Last Modified On: 2016-05-17 10:17:35 by Brian
from __future__ import division, print_function
im... | sdssREPO_NAMEmarvinPATH_START.@marvin_extracted@marvin-main@python@marvin@tools@plate.py@.PATH_END.py |
{
"filename": "transformer.py",
"repo_name": "ultralytics/ultralytics",
"repo_path": "ultralytics_extracted/ultralytics-main/ultralytics/nn/modules/transformer.py",
"type": "Python"
} | # Ultralytics YOLO 🚀, AGPL-3.0 license
"""Transformer modules."""
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.init import constant_, xavier_uniform_
from .conv import Conv
from .utils import _get_clones, inverse_sigmoid, multi_scale_deformable_attn_pytorch
__all__ =... | ultralyticsREPO_NAMEultralyticsPATH_START.@ultralytics_extracted@ultralytics-main@ultralytics@nn@modules@transformer.py@.PATH_END.py |
{
"filename": "bug_report.md",
"repo_name": "AndrewAnnex/SpiceyPy",
"repo_path": "SpiceyPy_extracted/SpiceyPy-main/.github/ISSUE_TEMPLATE/bug_report.md",
"type": "Markdown"
} | ---
name: Bug report
about: Create a report to help us improve SpiceyPy!
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is. If this is an installation issue please first consult the common installation issues and solutions hosted in the documentation at: ht... | AndrewAnnexREPO_NAMESpiceyPyPATH_START.@SpiceyPy_extracted@SpiceyPy-main@.github@ISSUE_TEMPLATE@bug_report.md@.PATH_END.py |
{
"filename": "activation_benchmark.py",
"repo_name": "fchollet/keras",
"repo_path": "keras_extracted/keras-master/benchmarks/layer_benchmark/activation_benchmark.py",
"type": "Python"
} | """Benchmark activation layers.
To run benchmarks, see the following command for an example, please change the
flag to your custom value:
```
python3 -m benchmarks.layer_benchmark.activation_benchmark \
--benchmark_name=benchmark_elu \
--num_samples=2048 \
--batch_size=256 \
--jit_compile=True
```
"""... | fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@benchmarks@layer_benchmark@activation_benchmark.py@.PATH_END.py |
{
"filename": "example_parallel_M.py",
"repo_name": "CaymanUnterborn/ExoPlex",
"repo_path": "ExoPlex_extracted/ExoPlex-master/Examples/example_parallel_M.py",
"type": "Python"
} |
# This file is part of ExoPlex - a self consistent planet builder
# Copyright (C) 2017 - by the ExoPlex team, released under the GNU
# GPL v2 or later.
"""
This example uses parallel processing to quickly calculate the best fit radius and pressure, temperature and density profiles
for a planet of a given mass, its un... | CaymanUnterbornREPO_NAMEExoPlexPATH_START.@ExoPlex_extracted@ExoPlex-master@Examples@example_parallel_M.py@.PATH_END.py |
{
"filename": "_textfont.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterpolargl/_textfont.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="textfont", parent_name="scatterpolargl", **kwargs):
super(TextfontValidator, 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@scatterpolargl@_textfont.py@.PATH_END.py |
{
"filename": "_domain.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/sankey/_domain.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class DomainValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="domain", parent_name="sankey", **kwargs):
super(DomainValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@sankey@_domain.py@.PATH_END.py |
{
"filename": "mcmc.py",
"repo_name": "jcforbes/gidget",
"repo_path": "gidget_extracted/gidget-master/mcmc.py",
"type": "Python"
} | import sys
import copy
import emcee
import triangle
import pickle
from mpi4py import MPI
from emcee.utils import MPIPool
import numpy as np
import exper
import readoutput
import os, glob
import matplotlib.pyplot as plt
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
chainDirRel = 'mcmcChain06h'
analysisDir = os.environ[... | jcforbesREPO_NAMEgidgetPATH_START.@gidget_extracted@gidget-master@mcmc.py@.PATH_END.py |
{
"filename": "_yref.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/splom/marker/colorbar/_yref.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YrefValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="yref", parent_name="splom.marker.colorbar", **kwargs
):
super(YrefValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@splom@marker@colorbar@_yref.py@.PATH_END.py |
{
"filename": "adapting_population_parameters.py",
"repo_name": "TRASAL/frbpoppy",
"repo_path": "frbpoppy_extracted/frbpoppy-master/examples/adapting_population_parameters.py",
"type": "Python"
} | """Example of changing parameters."""
from frbpoppy import CosmicPopulation, Survey
import frbpoppy.gen_dists as gd
# Set up a population
cosmic_pop = CosmicPopulation(1e4, generate=False)
# ... or adapt the population per parameter, e.g.
cosmic_pop.set_dist(z_max=2.5)
# Or to adapt the luminosity
cosmic_pop.set_lum(m... | TRASALREPO_NAMEfrbpoppyPATH_START.@frbpoppy_extracted@frbpoppy-master@examples@adapting_population_parameters.py@.PATH_END.py |
{
"filename": "ext_lomb_scargle_orig.py",
"repo_name": "quatrope/feets",
"repo_path": "feets_extracted/feets-master/res/paper/reports/fats_vs_feets/ext_lomb_scargle_orig.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2017 Juan Cabral
# 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 withou... | quatropeREPO_NAMEfeetsPATH_START.@feets_extracted@feets-master@res@paper@reports@fats_vs_feets@ext_lomb_scargle_orig.py@.PATH_END.py |
{
"filename": "equation_losses.py",
"repo_name": "neuraloperator/neuraloperator",
"repo_path": "neuraloperator_extracted/neuraloperator-main/neuralop/losses/equation_losses.py",
"type": "Python"
} | import torch
import torch.nn.functional as F
from .data_losses import central_diff_2d
class BurgersEqnLoss(object):
"""
Computes loss for Burgers' equation.
"""
def __init__(self, visc=0.01, method="fdm", loss=F.mse_loss, domain_length=1.0):
super().__init__()
self.visc = visc
... | neuraloperatorREPO_NAMEneuraloperatorPATH_START.@neuraloperator_extracted@neuraloperator-main@neuralop@losses@equation_losses.py@.PATH_END.py |
{
"filename": "transmissionCurve.py",
"repo_name": "lsst/ip_isr",
"repo_path": "ip_isr_extracted/ip_isr-main/python/lsst/ip/isr/transmissionCurve.py",
"type": "Python"
} | # This file is part of ip_isr.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This program is free software: you can ... | lsstREPO_NAMEip_isrPATH_START.@ip_isr_extracted@ip_isr-main@python@lsst@ip@isr@transmissionCurve.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "RafiKueng/SpaghettiLens",
"repo_path": "SpaghettiLens_extracted/SpaghettiLens-master/_backup2/apps/lenses/__init__.py",
"type": "Python"
} | RafiKuengREPO_NAMESpaghettiLensPATH_START.@SpaghettiLens_extracted@SpaghettiLens-master@_backup2@apps@lenses@__init__.py@.PATH_END.py | |
{
"filename": "set_paths.py",
"repo_name": "ivastar/clear",
"repo_path": "clear_extracted/clear-master/set_paths.py",
"type": "Python"
} |
#! /usr/bin/env python
"""Sets the paths for the CLEAR project, replacing all those that are
hardcoded in the following repos:
clear
mywfc3
threedhst
unicorn
Example:
To get a path, import the dictionary and get key.
from set_paths import paths
path_to_outputs = paths['path_to_outputs... | ivastarREPO_NAMEclearPATH_START.@clear_extracted@clear-master@set_paths.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.