metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "scan_parameter.ipynb",
"repo_name": "Mauropieroni/fastPTA",
"repo_path": "fastPTA_extracted/fastPTA-main/examples/scan_parameter.ipynb",
"type": "Jupyter Notebook"
} | ### Start importing all libraries
```python
# Global
import tqdm
import numpy as np
import matplotlib.pyplot as plt
# Local
import examples_utils as eu
import fastPTA.utils as ut
import fastPTA.plotting_functions as pf
from fastPTA.Fisher_code import compute_fisher
```
No GPU/TPU found, falling back to CPU. (Se... | MauropieroniREPO_NAMEfastPTAPATH_START.@fastPTA_extracted@fastPTA-main@examples@scan_parameter.ipynb@.PATH_END.py |
{
"filename": "load_dataset.py",
"repo_name": "freelunchtheorem/Conditional_Density_Estimation",
"repo_path": "Conditional_Density_Estimation_extracted/Conditional_Density_Estimation-master/cde/evaluation/eurostoxx_eval/load_dataset.py",
"type": "Python"
} | import numpy as np
import os
import pandas as pd
from scipy.interpolate import InterpolatedUnivariateSpline
from cde.utils.io import load_time_series_csv
DATA_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../data'))
EURO_OIS_CSV = os.path.join(DATA_DIR, "2_Eurostoxx50/eur_ois.csv")
EUROSTOXX... | freelunchtheoremREPO_NAMEConditional_Density_EstimationPATH_START.@Conditional_Density_Estimation_extracted@Conditional_Density_Estimation-master@cde@evaluation@eurostoxx_eval@load_dataset.py@.PATH_END.py |
{
"filename": "factory.py",
"repo_name": "threeML/astromodels",
"repo_path": "astromodels_extracted/astromodels-master/astromodels/xspec/factory.py",
"type": "Python"
} | from __future__ import print_function
import collections
import sys
import time
import astropy.units as u
import os
import re
import warnings
from astromodels.core.my_yaml import my_yaml
from astromodels.functions.function import get_function_class
from astromodels.utils import get_user_data_path
class XSpecNotAvail... | threeMLREPO_NAMEastromodelsPATH_START.@astromodels_extracted@astromodels-master@astromodels@xspec@factory.py@.PATH_END.py |
{
"filename": "__version__.py",
"repo_name": "saberyoung/haffet",
"repo_path": "haffet_extracted/haffet-master/sdapy/__version__.py",
"type": "Python"
} | name = 'HAFFET'
version = '0.1.2'
description = 'HAFFET: Hybrid Analytic Flux FittEr for Transients'
python_requires='>=2.7'
url='https://github.com/saberyoung/HAFFET.git'
author='Sheng Yang'
author_email='saberyoung@gmail.com'
| saberyoungREPO_NAMEhaffetPATH_START.@haffet_extracted@haffet-master@sdapy@__version__.py@.PATH_END.py |
{
"filename": "main.py",
"repo_name": "taehoryu/TDEmass",
"repo_path": "TDEmass_extracted/TDEmass-master/main.py",
"type": "Python"
} | import numpy as np
import scipy as sp
import glob
import os
import os.path
import errno
import colorsys
import re
import sys
import math
sys.path.insert(0, 'module/')
import module
import constant
import plot_module as pm
fileDir = os.path.dirname(os.path.realpath('__file__'))
########################################... | taehoryuREPO_NAMETDEmassPATH_START.@TDEmass_extracted@TDEmass-master@main.py@.PATH_END.py |
{
"filename": "movie_maker.py",
"repo_name": "enthought/mayavi",
"repo_path": "mayavi_extracted/mayavi-master/tvtk/pyface/movie_maker.py",
"type": "Python"
} | import os
from glob import glob
from contextlib import contextmanager
from traits.api import Bool, Directory, HasTraits, Instance, Int, Str
from traits.util.home_directory import get_home_directory
class MovieMaker(HasTraits):
record = Bool(False, desc='if a movie should be recorded')
scene = Instance('tvtk.... | enthoughtREPO_NAMEmayaviPATH_START.@mayavi_extracted@mayavi-master@tvtk@pyface@movie_maker.py@.PATH_END.py |
{
"filename": "compress_fast_metadata.py",
"repo_name": "SWIFTSIM/SOAP",
"repo_path": "SOAP_extracted/SOAP-master/compression/compress_fast_metadata.py",
"type": "Python"
} | import numpy as np
import h5py
import multiprocessing as mp
import argparse
import time
import os
import shutil
import yaml
script_folder = os.path.realpath(__file__).removesuffix("/compress_fast_metadata.py")
with open(f"{script_folder}/filters.yml", "r") as ffile:
filterdict = yaml.safe_load(ffile)
with open(f... | SWIFTSIMREPO_NAMESOAPPATH_START.@SOAP_extracted@SOAP-master@compression@compress_fast_metadata.py@.PATH_END.py |
{
"filename": "gen_dists.py",
"repo_name": "TRASAL/frbpoppy",
"repo_path": "frbpoppy_extracted/frbpoppy-master/frbpoppy/gen_dists.py",
"type": "Python"
} | """Define general distributions from which to get random numbers."""
import numpy as np
#import numexpr as ne
from scipy.stats import truncnorm
#global rng
#rng = np.random.default_rng()
def powerlaw(low, high, power, shape=1):
"""
Return random variables distributed according to power law.
The power law... | TRASALREPO_NAMEfrbpoppyPATH_START.@frbpoppy_extracted@frbpoppy-master@frbpoppy@gen_dists.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "rapidsai/cuml",
"repo_path": "cuml_extracted/cuml-main/python/cuml/cuml/dask/metrics/__init__.py",
"type": "Python"
} | #
# Copyright (c) 2020-2023, NVIDIA CORPORATION.
#
# 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 ag... | rapidsaiREPO_NAMEcumlPATH_START.@cuml_extracted@cuml-main@python@cuml@cuml@dask@metrics@__init__.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "Keck-DataReductionPipelines/KPF-Pipeline",
"repo_path": "KPF-Pipeline_extracted/KPF-Pipeline-master/modules/flat_fielding/src/__init__.py",
"type": "Python"
} | Keck-DataReductionPipelinesREPO_NAMEKPF-PipelinePATH_START.@KPF-Pipeline_extracted@KPF-Pipeline-master@modules@flat_fielding@src@__init__.py@.PATH_END.py | |
{
"filename": "sklearn_is_fitted.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/examples/developing_estimators/sklearn_is_fitted.py",
"type": "Python"
} | """
========================================
`__sklearn_is_fitted__` as Developer API
========================================
The `__sklearn_is_fitted__` method is a convention used in scikit-learn for
checking whether an estimator object has been fitted or not. This method is
typically implemented in custom estimato... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@examples@developing_estimators@sklearn_is_fitted.py@.PATH_END.py |
{
"filename": "_warnings.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/traitlets/py3/tests/_warnings.py",
"type": "Python"
} | # From scikit-image: https://github.com/scikit-image/scikit-image/blob/c2f8c4ab123ebe5f7b827bc495625a32bb225c10/skimage/_shared/_warnings.py
# Licensed under modified BSD license
from __future__ import annotations
__all__ = ["all_warnings", "expected_warnings"]
import inspect
import os
import re
import sys
import war... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@traitlets@py3@tests@_warnings.py@.PATH_END.py |
{
"filename": "EvtSubscribe_pull.py",
"repo_name": "mhammond/pywin32",
"repo_path": "pywin32_extracted/pywin32-main/win32/Demos/EvtSubscribe_pull.py",
"type": "Python"
} | ## Demonstrates how to create a "pull" subscription
import win32con
import win32event
import win32evtlog
query_text = '*[System[Provider[@Name="Microsoft-Windows-Winlogon"]]]'
h = win32event.CreateEvent(None, 0, 0, None)
s = win32evtlog.EvtSubscribe(
"System",
win32evtlog.EvtSubscribeStartAtOldestRecord,
... | mhammondREPO_NAMEpywin32PATH_START.@pywin32_extracted@pywin32-main@win32@Demos@EvtSubscribe_pull.py@.PATH_END.py |
{
"filename": "CCD.py",
"repo_name": "mtalapinto/moes",
"repo_path": "platospec/optics/CCD.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
def load():
detector_size = 4096
pix_size = 15e-3
return detector_size, pix_size
def mm2pix(ws):
pix_size_arr = np.full(len(ws), 13.5e-3)
detector_size_x = 2048.
detector_size_y = 2048.
#ws['x'] = -ws['x']
ws['y'] = ws['y'] / pix_size... | mtalapintoREPO_NAMEmoesPATH_START.@platospec@optics@CCD.py@.PATH_END.py |
{
"filename": "writing_a_custom_training_loop_in_torch.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/guides/writing_a_custom_training_loop_in_torch.py",
"type": "Python"
} | """
Title: Writing a training loop from scratch in PyTorch
Author: [fchollet](https://twitter.com/fchollet)
Date created: 2023/06/25
Last modified: 2023/06/25
Description: Writing low-level training & evaluation loops in PyTorch.
Accelerator: None
"""
"""
## Setup
"""
import os
# This guide can only be run with the ... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@guides@writing_a_custom_training_loop_in_torch.py@.PATH_END.py |
{
"filename": "00 - Swyft in 15 minutes.ipynb",
"repo_name": "undark-lab/swyft",
"repo_path": "swyft_extracted/swyft-master/notebooks/00 - Swyft in 15 minutes.ipynb",
"type": "Jupyter Notebook"
} | # Swyft in 15 Minutes
We discuss seven key steps of a typical Swyft workflow.
## 1. Installing Swyft
We can use `pip` to install the lightning branch (latest development branch) of Swyft.
```python
#!pip install https://github.com/undark-lab/swyft.git
```
```python
import numpy as np
from scipy import stats
impo... | undark-labREPO_NAMEswyftPATH_START.@swyft_extracted@swyft-master@notebooks@00 - Swyft in 15 minutes.ipynb@.PATH_END.py |
{
"filename": "eigenproblem.py",
"repo_name": "minkailin/stratsi",
"repo_path": "stratsi_extracted/stratsi-master/caseA_Z0.1/eigenproblem.py",
"type": "Python"
} | from dedalus.tools.cache import CachedAttribute
from dedalus.core.field import Field
import dedalus.public as de
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import interp1d
import scipy.sparse.linalg
tol = 1e-12
class Eigenproblem():
def __init__(self, EVP, sparse=False):
"""
... | minkailinREPO_NAMEstratsiPATH_START.@stratsi_extracted@stratsi-master@caseA_Z0.1@eigenproblem.py@.PATH_END.py |
{
"filename": "_textcase.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/densitymap/colorbar/title/font/_textcase.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextcaseValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="textcase",
parent_name="densitymap.colorbar.title.font",
**kwargs,
):
super(TextcaseValidator, self).__init__(
plo... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@densitymap@colorbar@title@font@_textcase.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/bar/marker/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._showscale import ShowscaleValidator
from ._reversescale import ReversescaleValidator
from ._pattern import PatternValidator
from ._opacitysrc import OpacitysrcValidator
from ._opacity import OpacityVal... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@bar@marker@__init__.py@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/scattergeo/marker/colorbar/title/_font.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scattergeo.marker.colorbar.title"
_path_str = "scattergeo.marker.colorbar.title.font"
_valid_p... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@scattergeo@marker@colorbar@title@_font.py@.PATH_END.py |
{
"filename": "test_iau_fullstack.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/astropy/coordinates/tests/test_iau_fullstack.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from contextlib import nullcontext
import erfa
import numpy as np
import pytest
from numpy import testing as npt
from astropy import units as u
from astropy.coordinates import EarthLocation, SkyCoord, golden_spiral_grid
from astropy.coor... | astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@coordinates@tests@test_iau_fullstack.py@.PATH_END.py |
{
"filename": "bankvetotest.py",
"repo_name": "gwastro/pycbc",
"repo_path": "pycbc_extracted/pycbc-master/test/bankvetotest.py",
"type": "Python"
} | from pycbc.types import *
from pycbc.noise.gaussian import *
from pycbc.filter import *
from pycbc.waveform import *
from pycbc.vetoes import *
import pycbc.psd
sr = 4096.0
dt = 1.0/sr
bl = 256
df = 1.0/bl
N = int(sr * bl)
n = int(N/2 + 1)
psd = pycbc.psd.from_string("aLIGOZeroDetHighPower", n, df, 14)
strain = noise... | gwastroREPO_NAMEpycbcPATH_START.@pycbc_extracted@pycbc-master@test@bankvetotest.py@.PATH_END.py |
{
"filename": "Example_FI.ipynb",
"repo_name": "yfperezg/frisbhee",
"repo_path": "frisbhee_extracted/frisbhee-main/Dark_Matter/Example_FI.ipynb",
"type": "Jupyter Notebook"
} | ```python
###################################################################################################
# #
# Primordial Black Hole Evaporation + DM Production #
# ... | yfperezgREPO_NAMEfrisbheePATH_START.@frisbhee_extracted@frisbhee-main@Dark_Matter@Example_FI.ipynb@.PATH_END.py |
{
"filename": "sample_test.py",
"repo_name": "vaexio/vaex",
"repo_path": "vaex_extracted/vaex-master/tests/sample_test.py",
"type": "Python"
} | from common import *
import collections
def test_sample(ds_local):
ds = ds_local
x = np.arange(10).tolist()
dss = ds.sample(frac=1, random_state=42)
assert dss.x.tolist() != x
assert list(sorted(dss.x.tolist())) == x
dss = ds.sample(n=1, random_state=42)
assert len(dss) == 1
dss = ds.... | vaexioREPO_NAMEvaexPATH_START.@vaex_extracted@vaex-master@tests@sample_test.py@.PATH_END.py |
{
"filename": "test_cb_zip_bomb.py",
"repo_name": "crossbario/crossbar",
"repo_path": "crossbar_extracted/crossbar-master/test/functests/cbtests/test_cb_zip_bomb.py",
"type": "Python"
} | ##############################################################################
#
# Copyright (C) Tavendo GmbH. All rights reserved.
#
###############################################################################
from __future__ import print_function
from __future__ import absolute_import
from autobahn.wamp import ... | crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@test@functests@cbtests@test_cb_zip_bomb.py@.PATH_END.py |
{
"filename": "_showtickprefix.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/yaxis/_showtickprefix.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowtickprefixValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="showtickprefix", parent_name="layout.yaxis", **kwargs
):
super(ShowtickprefixValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@yaxis@_showtickprefix.py@.PATH_END.py |
{
"filename": "transforms_test.py",
"repo_name": "google/flax",
"repo_path": "flax_extracted/flax-main/tests/nnx/transforms_test.py",
"type": "Python"
} | # Copyright 2024 The Flax 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 wri... | googleREPO_NAMEflaxPATH_START.@flax_extracted@flax-main@tests@nnx@transforms_test.py@.PATH_END.py |
{
"filename": "generate_Pk_example_w_tensors.py",
"repo_name": "miguelzuma/hi_class_public",
"repo_path": "hi_class_public_extracted/hi_class_public-master/external_Pk/generate_Pk_example_w_tensors.py",
"type": "Python"
} | #!/usr/bin/python
from __future__ import print_function
import sys
from math import exp
# README:
#
# This is an example python script for the external_Pk mode of Class.
# It generates the primordial spectrum of LambdaCDM.
# It can be edited and used directly, though keeping a copy of it is recommended.
#
# Two (maybe... | miguelzumaREPO_NAMEhi_class_publicPATH_START.@hi_class_public_extracted@hi_class_public-master@external_Pk@generate_Pk_example_w_tensors.py@.PATH_END.py |
{
"filename": "log.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/tools/python3/Lib/asyncio/log.py",
"type": "Python"
} | """Logging configuration."""
import logging
# Name the logger after the package.
logger = logging.getLogger(__package__)
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@python3@Lib@asyncio@log.py@.PATH_END.py |
{
"filename": "_ticklabelposition.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/barpolar/marker/colorbar/_ticklabelposition.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicklabelpositionValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="ticklabelposition",
parent_name="barpolar.marker.colorbar",
**kwargs,
):
super(TicklabelpositionValidator, self).__in... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@barpolar@marker@colorbar@_ticklabelposition.py@.PATH_END.py |
{
"filename": "tpu_test_wrapper_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/tpu/tpu_test_wrapper_test.py",
"type": "Python"
} | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@tpu@tpu_test_wrapper_test.py@.PATH_END.py |
{
"filename": "test_regression.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/optimize/tests/test_regression.py",
"type": "Python"
} | """Regression tests for optimize.
"""
import numpy as np
from numpy.testing import assert_almost_equal
from pytest import raises as assert_raises
import scipy.optimize
class TestRegression:
def test_newton_x0_is_0(self):
# Regression test for gh-1601
tgt = 1
res = scipy.optimize.newton(... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@optimize@tests@test_regression.py@.PATH_END.py |
{
"filename": "cleft_kexpanded_resummed_fftw.py",
"repo_name": "sfschen/velocileptors",
"repo_path": "velocileptors_extracted/velocileptors-master/velocileptors/EPT/cleft_kexpanded_resummed_fftw.py",
"type": "Python"
} | import numpy as np
import time
from scipy.interpolate import interp1d
from scipy.signal import savgol_filter
from velocileptors.Utils.spherical_bessel_transform_fftw import SphericalBesselTransform
from velocileptors.Utils.pnw_dst import pnw_dst
from velocileptors.EPT.cleft_kexpanded_fftw import KECLEFT
class RKEC... | sfschenREPO_NAMEvelocileptorsPATH_START.@velocileptors_extracted@velocileptors-master@velocileptors@EPT@cleft_kexpanded_resummed_fftw.py@.PATH_END.py |
{
"filename": "get_version.py",
"repo_name": "htjb/globalemu",
"repo_path": "globalemu_extracted/globalemu-master/bin/get_version.py",
"type": "Python"
} | #!/usr/bin/env python
"""Get Version.
This script will print the version of the current project.
"""
import sys
from check_version import run_on_commandline, readme_file, get_current_version
def main():
"""Print the current version of the project."""
# Get current version from readme
current_version = ... | htjbREPO_NAMEglobalemuPATH_START.@globalemu_extracted@globalemu-master@bin@get_version.py@.PATH_END.py |
{
"filename": "_style.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/sunburst/insidetextfont/_style.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class StyleValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="style", parent_name="sunburst.insidetextfont", **kwargs
):
super(StyleValidator, self).__init__(
plotly_name=plotly_name,
parent_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@sunburst@insidetextfont@_style.py@.PATH_END.py |
{
"filename": "_linecolor.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/yaxis/_linecolor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LinecolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(self, plotly_name="linecolor", parent_name="layout.yaxis", **kwargs):
super(LinecolorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@yaxis@_linecolor.py@.PATH_END.py |
{
"filename": "logger.py",
"repo_name": "n-claes/legolas",
"repo_path": "legolas_extracted/legolas-master/post_processing/pylbo/utilities/logger.py",
"type": "Python"
} | import logging
import sys
pylboLogger = logging.getLogger("pylbo")
def init_logger():
"""
Initialises the pylbo logger.
"""
sh = logging.StreamHandler(stream=sys.stdout)
fmt = logging.Formatter("%(asctime)s - |%(levelname)-8s| %(message)s")
sh.setFormatter(fmt)
pylboLogger.addHandler(hdlr... | n-claesREPO_NAMElegolasPATH_START.@legolas_extracted@legolas-master@post_processing@pylbo@utilities@logger.py@.PATH_END.py |
{
"filename": "make_moment.py",
"repo_name": "andizq/sf3dmodels",
"repo_path": "sf3dmodels_extracted/sf3dmodels-master/examples/filaments/filament+env/make_moment.py",
"type": "Python"
} | from astropy.io import fits
from astropy.wcs import WCS
from spectral_cube import SpectralCube
import matplotlib.pyplot as plt
fn = 'img_fil+env_CO_J1-0_LTE_jypxl_4e4pInt.fits'
hdu = fits.open(fn)[0]
hdu.header['CUNIT3'] = 'm/s'
w = WCS(hdu.header)
cube = SpectralCube(data=hdu.data.squeeze(), wcs=w.dropaxis(3))
m0 =... | andizqREPO_NAMEsf3dmodelsPATH_START.@sf3dmodels_extracted@sf3dmodels-master@examples@filaments@filament+env@make_moment.py@.PATH_END.py |
{
"filename": "test_lcdm.py",
"repo_name": "sibirrer/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_Cosmo/test_lcdm.py",
"type": "Python"
} | __author__ = "sibirrer"
import numpy.testing as npt
import pytest
from lenstronomy.Cosmo.lcdm import LCDM
class TestFlatLCDM(object):
def setup_method(self):
self.cosmo = LCDM(z_lens=0.5, z_source=1.5, flat=True)
self.cosmo_k = LCDM(z_lens=0.5, z_source=1.5, flat=False)
def test_D_d(self):
... | sibirrerREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_Cosmo@test_lcdm.py@.PATH_END.py |
{
"filename": "PlotPlanetPosition.ipynb",
"repo_name": "pmaxted/pycheops",
"repo_path": "pycheops_extracted/pycheops-master/pycheops/examples/Notebooks/PlotPlanetPosition.ipynb",
"type": "Jupyter Notebook"
} | ```python
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from pycheops.funcs import xyz_planet
from numpy import linspace
t = np.linspace(0,1,1000)
sini = 0.998
ecc = 0.34
omdeg = 45
x, y, z = xyz_planet(t,0,1,sini,ecc,omdeg)
fig, ax = plt.subplots(2,2,figsize=(8,7))
ax[0][0].plot(x, y)
ax[0][... | pmaxtedREPO_NAMEpycheopsPATH_START.@pycheops_extracted@pycheops-master@pycheops@examples@Notebooks@PlotPlanetPosition.ipynb@.PATH_END.py |
{
"filename": "panzoom.py",
"repo_name": "macrocosme/shwirl",
"repo_path": "shwirl_extracted/shwirl-master/shwirl/extern/vispy/scene/cameras/panzoom.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from __future__ import division
import numpy as np
from .base_camera import BaseCamera
from ...geometry import Rect
from ...visuals.transforms import STTransform, MatrixTran... | macrocosmeREPO_NAMEshwirlPATH_START.@shwirl_extracted@shwirl-master@shwirl@extern@vispy@scene@cameras@panzoom.py@.PATH_END.py |
{
"filename": "descriptor_pool.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/protobuf/py3/google/protobuf/descriptor_pool.py",
"type": "Python"
} | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@protobuf@py3@google@protobuf@descriptor_pool.py@.PATH_END.py |
{
"filename": "install_scripts.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/setuptools/py2/setuptools/command/install_scripts.py",
"type": "Python"
} | from distutils import log
import distutils.command.install_scripts as orig
import os
import sys
from pkg_resources import Distribution, PathMetadata, ensure_directory
class install_scripts(orig.install_scripts):
"""Do normal script install, plus any egg_info wrapper scripts"""
def initialize_options(self):
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@setuptools@py2@setuptools@command@install_scripts.py@.PATH_END.py |
{
"filename": "tpu_ApproxTopK.py",
"repo_name": "google/jax",
"repo_path": "jax_extracted/jax-main/jax/_src/internal_test_util/export_back_compat_test_data/tpu_ApproxTopK.py",
"type": "Python"
} | # Copyright 2023 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | googleREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@_src@internal_test_util@export_back_compat_test_data@tpu_ApproxTopK.py@.PATH_END.py |
{
"filename": "_tickfont.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/barpolar/marker/colorbar/_tickfont.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Tickfont(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "barpolar.marker.colorbar"
_path_str = "barpolar.marker.colorbar.tickfont"
_valid_props = {... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@barpolar@marker@colorbar@_tickfont.py@.PATH_END.py |
{
"filename": "_customdata.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattercarpet/_customdata.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CustomdataValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="customdata", parent_name="scattercarpet", **kwargs):
super(CustomdataValidator, self).__init__(
plotly_name=plotly_name,
parent_name=paren... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattercarpet@_customdata.py@.PATH_END.py |
{
"filename": "CONTRIBUTING.md",
"repo_name": "numba/numba-scipy",
"repo_path": "numba-scipy_extracted/numba-scipy-main/CONTRIBUTING.md",
"type": "Markdown"
} |
We welcome people who want to make contributions to numba-scipy, big or small!
Even simple documentation improvements are encouraged.
# Asking questions
The best place to ask questions is on the Numba project [gitter IRC channel](
https://gitter.im/numba/numba)
# Contributing patches
Please fork the numba-scipy re... | numbaREPO_NAMEnumba-scipyPATH_START.@numba-scipy_extracted@numba-scipy-main@CONTRIBUTING.md@.PATH_END.py |
{
"filename": "_xanchor.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/isosurface/colorbar/_xanchor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XanchorValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="xanchor", parent_name="isosurface.colorbar", **kwargs
):
super(XanchorValidator, self).__init__(
plotly_name=plotly_name,
paren... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@isosurface@colorbar@_xanchor.py@.PATH_END.py |
{
"filename": "_freetype.py",
"repo_name": "macrocosme/shwirl",
"repo_path": "shwirl_extracted/shwirl-master/shwirl/extern/vispy/util/fonts/_freetype.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... | macrocosmeREPO_NAMEshwirlPATH_START.@shwirl_extracted@shwirl-master@shwirl@extern@vispy@util@fonts@_freetype.py@.PATH_END.py |
{
"filename": "rain_keck_data.py",
"repo_name": "jsnguyen/rain",
"repo_path": "rain_extracted/rain-main/rain_keck_data.py",
"type": "Python"
} | import os
import time
import glob
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits
from tqdm import tqdm
from rain import rain
def distortion(index_x, index_y, x_dist, y_dist):
'''
-- Description:
performs the distortion correction according to x_dist and y_dist
assumes ... | jsnguyenREPO_NAMErainPATH_START.@rain_extracted@rain-main@rain_keck_data.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "AstroUGent/shadowfax",
"repo_path": "shadowfax_extracted/shadowfax-master/README.md",
"type": "Markdown"
} | # Shadowfax
A moving mesh hydrodynamical integration code. More information on installation
and running can be found in the wiki.
More information on the method can be found in the code paper (Vandenbroucke
& De Rijcke, 2016), and on <http://www.dwarfs.ugent.be/shadowfax/>.
Detailed compilation instructions are foun... | AstroUGentREPO_NAMEshadowfaxPATH_START.@shadowfax_extracted@shadowfax-master@README.md@.PATH_END.py |
{
"filename": "fits_utils.py",
"repo_name": "LCOGT/banzai",
"repo_path": "banzai_extracted/banzai-main/banzai/utils/fits_utils.py",
"type": "Python"
} | import datetime
from typing import Optional
import requests
from collections.abc import Iterable
from collections import OrderedDict
from banzai import logs
import numpy as np
from astropy.io import fits
from astropy.coordinates import SkyCoord
from astropy import units
from tenacity import retry, wait_exponential, s... | LCOGTREPO_NAMEbanzaiPATH_START.@banzai_extracted@banzai-main@banzai@utils@fits_utils.py@.PATH_END.py |
{
"filename": "CloudPhinder.py",
"repo_name": "omgspace/CloudPhinder",
"repo_path": "CloudPhinder_extracted/CloudPhinder-master/CloudPhinder.py",
"type": "Python"
} | #!/usr/bin/env python
"""
Algorithm that identifies the largest possible self-gravitating iso-density contours
of a certain particle type. This newer version relies on the load_from_snapshot routine from GIZMO.
Usage: CloudPhinder.py <snapshot... | omgspaceREPO_NAMECloudPhinderPATH_START.@CloudPhinder_extracted@CloudPhinder-master@CloudPhinder.py@.PATH_END.py |
{
"filename": "ensemble_demo.ipynb",
"repo_name": "jfcrenshaw/pzflow",
"repo_path": "pzflow_extracted/pzflow-main/docs/tutorials/ensemble_demo.ipynb",
"type": "Jupyter Notebook"
} | [](https://colab.research.google.com/github/jfcrenshaw/pzflow/blob/main/docs/tutorials/ensemble_demo.ipynb)
[](https://github.com/jfcrenshaw/pzflow/blob/ma... | jfcrenshawREPO_NAMEpzflowPATH_START.@pzflow_extracted@pzflow-main@docs@tutorials@ensemble_demo.ipynb@.PATH_END.py |
{
"filename": "gcc_build_bitness.py",
"repo_name": "numpy/numpy",
"repo_path": "numpy_extracted/numpy-main/numpy/_build_utils/gcc_build_bitness.py",
"type": "Python"
} | #!python
""" Detect bitness (32 or 64) of Mingw-w64 gcc build target on Windows.
"""
import re
from subprocess import run
def main():
res = run(['gcc', '-v'], check=True, text=True, capture_output=True)
target = re.search(r'^Target: (.*)$', res.stderr, flags=re.M).groups()[0]
if target.startswith('i686')... | numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@numpy@_build_utils@gcc_build_bitness.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "duvall3/rat-pac",
"repo_path": "rat-pac_extracted/rat-pac-master/python/SCons/compat/__init__.py",
"type": "Python"
} | #
# 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
# "Software"), to deal in the Software without restriction, including
# without limitati... | duvall3REPO_NAMErat-pacPATH_START.@rat-pac_extracted@rat-pac-master@python@SCons@compat@__init__.py@.PATH_END.py |
{
"filename": "logging.py",
"repo_name": "sherpa/sherpa",
"repo_path": "sherpa_extracted/sherpa-main/sherpa/utils/logging.py",
"type": "Python"
} | #
# Copyright (C) 2015-2020 Smithsonian Astrophysical Observatory
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later versio... | sherpaREPO_NAMEsherpaPATH_START.@sherpa_extracted@sherpa-main@sherpa@utils@logging.py@.PATH_END.py |
{
"filename": "MultiPlotSpeedTest.py",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/pyqtgraph/examples/MultiPlotSpeedTest.py",
"type": "Python"
} | #!/usr/bin/python
"""
Test the speed of rapidly updating multiple plot curves
"""
from time import perf_counter
import numpy as np
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore
# pg.setConfigOptions(useOpenGL=True)
app = pg.mkQApp("MultiPlot Speed Test")
plot = pg.plot()
plot.setWindowTitle('pyqtgraph exa... | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@pyqtgraph@examples@MultiPlotSpeedTest.py@.PATH_END.py |
{
"filename": "test_graph_based.py",
"repo_name": "facebookresearch/faiss",
"repo_path": "faiss_extracted/faiss-main/tests/test_graph_based.py",
"type": "Python"
} | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
""" a few tests for graph-based indices (HNSW, nndescent and NSG)"""
import numpy as np
import unittest
import faiss
import tempfile
import... | facebookresearchREPO_NAMEfaissPATH_START.@faiss_extracted@faiss-main@tests@test_graph_based.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "CobayaSampler/cobaya",
"repo_path": "cobaya_extracted/cobaya-master/cobaya/likelihoods/planck_2015_lowTEB/__init__.py",
"type": "Python"
} | from cobaya.likelihoods.base_classes import Planck2015Clik
class planck_2015_lowTEB(Planck2015Clik):
r"""
Low-$\ell$ polarization likelihood of Planck's 2015 data release
\cite{Aghanim:2015xee}.
"""
pass
| CobayaSamplerREPO_NAMEcobayaPATH_START.@cobaya_extracted@cobaya-master@cobaya@likelihoods@planck_2015_lowTEB@__init__.py@.PATH_END.py |
{
"filename": "_sourcelayer.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/map/layer/_sourcelayer.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SourcelayerValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="sourcelayer", parent_name="layout.map.layer", **kwargs
):
super(SourcelayerValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@map@layer@_sourcelayer.py@.PATH_END.py |
{
"filename": "constants.py",
"repo_name": "franpoz/SHERLOCK",
"repo_path": "SHERLOCK_extracted/SHERLOCK-master/sherlockpipe/constants.py",
"type": "Python"
} | """Constants used by SHERLOCK"""
import os
USER_HOME_ELEANOR_CACHE = os.path.join(os.path.expanduser('~'), '.eleanor/')
"""The directory where SHERLOCK will store the eleanor internal data"""
MOMENTUM_DUMP_QUALITY_FLAG = 2 ** 5
"""Quality flag value for momentum dumps"""
| franpozREPO_NAMESHERLOCKPATH_START.@SHERLOCK_extracted@SHERLOCK-master@sherlockpipe@constants.py@.PATH_END.py |
{
"filename": "_weightsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/pie/title/font/_weightsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WeightsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="weightsrc", parent_name="pie.title.font", **kwargs):
super(WeightsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@pie@title@font@_weightsrc.py@.PATH_END.py |
{
"filename": "_bordercolor.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattergeo/hoverlabel/_bordercolor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="bordercolor", parent_name="scattergeo.hoverlabel", **kwargs
):
super(BordercolorValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattergeo@hoverlabel@_bordercolor.py@.PATH_END.py |
{
"filename": "_text.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterpolargl/marker/colorbar/title/_text.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="text",
parent_name="scatterpolargl.marker.colorbar.title",
**kwargs,
):
super(TextValidator, self).__init__(
plotly_name=p... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterpolargl@marker@colorbar@title@_text.py@.PATH_END.py |
{
"filename": "_marker.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/choroplethmap/unselected/_marker.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MarkerValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="marker", parent_name="choroplethmap.unselected", **kwargs
):
super(MarkerValidator, self).__init__(
plotly_name=plotly_name,
paren... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@choroplethmap@unselected@_marker.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "saopicc/DDFacet",
"repo_path": "DDFacet_extracted/DDFacet-master/DDFacet/Imager/MultiSliceDeconv/__init__.py",
"type": "Python"
} | '''
DDFacet, a facet-based radio imaging package
Copyright (C) 2013-2016 Cyril Tasse, l'Observatoire de Paris,
SKA South Africa, Rhodes University
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; eit... | saopiccREPO_NAMEDDFacetPATH_START.@DDFacet_extracted@DDFacet-master@DDFacet@Imager@MultiSliceDeconv@__init__.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "icrar/daliuge",
"repo_path": "daliuge_extracted/daliuge-master/daliuge-common/dlg/__init__.py",
"type": "Python"
} | #
# ICRAR - International Centre for Radio Astronomy Research
# (c) UWA - The University of Western Australia, 2020
# 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-common@dlg@__init__.py@.PATH_END.py |
{
"filename": "adaptive_boundary_mesh.py",
"repo_name": "sibirrer/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/lenstronomy/LensModel/Microlensing/adaptive_boundary_mesh.py",
"type": "Python"
} | from lenstronomy.Cosmo.micro_lensing import einstein_radius, source_size
from lenstronomy.LensModel.lens_model import LensModel
import numpy as np
import math
def splitting_centers(x, y, side_length, n_p):
"""Takes square centered at center = (x, y) with side_length = side length.
(float) and divides it i... | sibirrerREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@lenstronomy@LensModel@Microlensing@adaptive_boundary_mesh.py@.PATH_END.py |
{
"filename": "spectralfeaturedb.py",
"repo_name": "sdss/mangadap",
"repo_path": "mangadap_extracted/mangadap-main/mangadap/par/spectralfeaturedb.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
Container class for databases of spectral features. This implements
the base class used by :class:`mangadap.par.artifactdb.ArtifactDB`,
:class:`mangadap.par.emissionlinedb.EmissionLineDB`,
:class:`mangadap.par.emissionmomentsdb... | sdssREPO_NAMEmangadapPATH_START.@mangadap_extracted@mangadap-main@mangadap@par@spectralfeaturedb.py@.PATH_END.py |
{
"filename": "state.py",
"repo_name": "glue-viz/glue",
"repo_path": "glue_extracted/glue-main/glue/viewers/common/state.py",
"type": "Python"
} | from echo import CallbackProperty, ListCallbackProperty
from glue.core.state_objects import State
__all__ = ['ViewerState', 'LayerState']
class ViewerState(State):
"""
A base class for all viewer states.
"""
layers = ListCallbackProperty(docstring='A collection of all layers in the viewer')
tit... | glue-vizREPO_NAMEgluePATH_START.@glue_extracted@glue-main@glue@viewers@common@state.py@.PATH_END.py |
{
"filename": "numcosmo_class.py",
"repo_name": "NumCosmo/NumCosmo",
"repo_path": "NumCosmo_extracted/NumCosmo-master/numcosmo_py/external/pyssc/numcosmo_class.py",
"type": "Python"
} | #
# numcosmo_class.py
#
# Tue Feb 20 11:08:00 2024
# Copyright 2024 Sandro Dias Pinto Vitenti
# <vitenti@uel.br>
#
# numcosmo_class.py
# Copyright (C) 2024 Sandro Dias Pinto Vitenti <vitenti@uel.br>
#
# numcosmo is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public Lic... | NumCosmoREPO_NAMENumCosmoPATH_START.@NumCosmo_extracted@NumCosmo-master@numcosmo_py@external@pyssc@numcosmo_class.py@.PATH_END.py |
{
"filename": "twod.py",
"repo_name": "ricardoclandim/NIRVANA",
"repo_path": "NIRVANA_extracted/NIRVANA-master/nirvana/models/twod.py",
"type": "Python"
} | """
Implements two-dimensional functions for modeling.
.. include:: ../include/links.rst
"""
import warnings
from IPython import embed
import numpy as np
from scipy import special
from astropy.modeling import functional_models
class Sersic2D(functional_models.Sersic2D):
"""
A 2D Sersic distribution.
Ar... | ricardoclandimREPO_NAMENIRVANAPATH_START.@NIRVANA_extracted@NIRVANA-master@nirvana@models@twod.py@.PATH_END.py |
{
"filename": "lg4_envs.py",
"repo_name": "mit-ll/spacegym-kspdg",
"repo_path": "spacegym-kspdg_extracted/spacegym-kspdg-main/src/kspdg/private_src/python3_12/Linux_x86_64/kspdg_envs/lbg1/lg4_envs.py",
"type": "Python"
} | # Pyarmor 8.5.11 (trial), 000000, non-profits, 2024-12-09T10:19:38.357730
from kspdg.private_src.python3_12.Linux_x86_64.pyarmor_runtime_000000 import __pyarmor__
__pyarmor__(__name__, __file__, b'PY000000\x00\x03\x0c\x00\xcb\r\r\n\x80\x00\x01\x00\x08\x00\x00\x00\x04\x00\x00\x00@\x00\x00\x00\xef4\x00\x00\x12\t\x04\x00\... | mit-llREPO_NAMEspacegym-kspdgPATH_START.@spacegym-kspdg_extracted@spacegym-kspdg-main@src@kspdg@private_src@python3_12@Linux_x86_64@kspdg_envs@lbg1@lg4_envs.py@.PATH_END.py |
{
"filename": "_base_funcs.py",
"repo_name": "lberaldoesilva/naif",
"repo_path": "naif_extracted/naif-main/naif/_base_funcs.py",
"type": "Python"
} | import numpy as np
import math
from scipy import integrate
twopi = 2.*np.pi
#--------------------
def chi_p(t, p=1):
""" Window function \chi_p(t)
Parameters
----------
t: float array (size N)
Time symmetric, from -T/2 to T/2
p: int, optional
p parameter
Returns
-------
... | lberaldoesilvaREPO_NAMEnaifPATH_START.@naif_extracted@naif-main@naif@_base_funcs.py@.PATH_END.py |
{
"filename": "__main__.py",
"repo_name": "saopicc/DDFacet",
"repo_path": "DDFacet_extracted/DDFacet-master/SkyModel/__main__.py",
"type": "Python"
} | def clustercat_main():
from SkyModel import ClusterCat
ClusterCat.driver()
def dsm_main():
from SkyModel import dsm
dsm.driver()
def dsreg_main():
from SkyModel import dsreg
dsreg.driver()
def extractpsources_main():
from SkyModel import ExtractPSources
ExtractPSources.driver()
def g... | saopiccREPO_NAMEDDFacetPATH_START.@DDFacet_extracted@DDFacet-master@SkyModel@__main__.py@.PATH_END.py |
{
"filename": "catalog.py",
"repo_name": "fred3m/astro-toyz",
"repo_path": "astro-toyz_extracted/astro-toyz-master/astrotoyz/catalog.py",
"type": "Python"
} | """
Catalog Tools for Astro-Toyz.
For now, all catalogs are stored in a sqlite database in the web app's db directory.
In the future a more robust I/O module will be implemented to allow users
more flexibility in reading and saving their object catalogs
"""
# Copyright 2015 by Fred Moolekamp
# License: LGPLv3
from __fu... | fred3mREPO_NAMEastro-toyzPATH_START.@astro-toyz_extracted@astro-toyz-master@astrotoyz@catalog.py@.PATH_END.py |
{
"filename": "base2d.py",
"repo_name": "epfl-radio-astro/scatternet",
"repo_path": "scatternet_extracted/scatternet-main/scatternet/kymatioex/base2d.py",
"type": "Python"
} | import numpy as np
import tensorflow as tf
from kymatio.keras import Scattering2D
'''
A subclass of the kymatio Scattering2D designed to easily enable extensions in tensorflow.
Explicitly combines the class interface with the tensorflow backend.
'''
class ExtendedScattering2D(Scattering2D):
def __init__(self, J, L=... | epfl-radio-astroREPO_NAMEscatternetPATH_START.@scatternet_extracted@scatternet-main@scatternet@kymatioex@base2d.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterpolargl/marker/colorbar/tickformatstop/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._value import ValueValidator
from ._templateitemname import TemplateitemnameValidator
from ._name import NameValidator
from ._enabled import EnabledValidator
from ._dtickrange import DtickrangeValidator... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterpolargl@marker@colorbar@tickformatstop@__init__.py@.PATH_END.py |
{
"filename": "butterpy_test.py",
"repo_name": "zclaytor/butterpy",
"repo_path": "butterpy_extracted/butterpy-main/tests/butterpy_test.py",
"type": "Python"
} | import os
import pytest
import numpy as np
from astropy.table import Table
from butterpy import Surface, read_pickle, read_fits
cwd = os.path.dirname(os.path.abspath(__file__))
@pytest.fixture(scope="session")
def default_surface_regions():
np.random.seed(88)
s = Surface()
s.emerge_regions(
acti... | zclaytorREPO_NAMEbutterpyPATH_START.@butterpy_extracted@butterpy-main@tests@butterpy_test.py@.PATH_END.py |
{
"filename": "_theta0.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterpolar/_theta0.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class Theta0Validator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="theta0", parent_name="scatterpolar", **kwargs):
super(Theta0Validator, 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@scatterpolar@_theta0.py@.PATH_END.py |
{
"filename": "reverseContourPen.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/fonttools/fontTools/pens/reverseContourPen.py",
"type": "Python"
} | from fontTools.misc.arrayTools import pairwise
from fontTools.pens.filterPen import ContourFilterPen
__all__ = ["reversedContour", "ReverseContourPen"]
class ReverseContourPen(ContourFilterPen):
"""Filter pen that passes outline data to another pen, but reversing
the winding direction of all contours. Compo... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@fonttools@fontTools@pens@reverseContourPen.py@.PATH_END.py |
{
"filename": "test_examples.py",
"repo_name": "gwpy/gwpy",
"repo_path": "gwpy_extracted/gwpy-main/examples/test_examples.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2019-2020)
#
# This file is part of GWpy.
#
# GWpy 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)... | gwpyREPO_NAMEgwpyPATH_START.@gwpy_extracted@gwpy-main@examples@test_examples.py@.PATH_END.py |
{
"filename": "JohnsonCookDamageFactories.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/src/Damage/JohnsonCookDamageFactories.py",
"type": "Python"
} | #-------------------------------------------------------------------------------
# JohnsonCookDamageFactories -- implements a number of factory functions for
# the JohnsonCookDamage model. Primarily these fill in the D1 and D2 fields
# appropriately.
# Specific factories provided are:
# JohnsonCookDamageConst... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@src@Damage@JohnsonCookDamageFactories.py@.PATH_END.py |
{
"filename": "general.py",
"repo_name": "JWST-Templates/jwst_templates",
"repo_path": "jwst_templates_extracted/jwst_templates-main/general.py",
"type": "Python"
} | ''' Helper functions to analyze data from the JWST TEMPLATES Early Release Science
(ERS) program. See our website: https://sites.google.com/view/jwst-templates/?pli=1
and our code https://github.com/JWST-Templates'''
def get_targnames():
# Let's use common nomenclature everywhere to make life easier
return((... | JWST-TemplatesREPO_NAMEjwst_templatesPATH_START.@jwst_templates_extracted@jwst_templates-main@general.py@.PATH_END.py |
{
"filename": "_fixedrange.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/carpet/baxis/_fixedrange.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FixedrangeValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="fixedrange", parent_name="carpet.baxis", **kwargs):
super(FixedrangeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_n... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@carpet@baxis@_fixedrange.py@.PATH_END.py |
{
"filename": "manual_flagger.py",
"repo_name": "miguelcarcamov/csromer",
"repo_path": "csromer_extracted/csromer-master/src/csromer/transformers/flaggers/manual_flagger.py",
"type": "Python"
} | from dataclasses import dataclass
from typing import Union
import numpy as np
from ...base import Dataset
from .flagger import Flagger
dataclass(init=True, repr=True)
class ManualFlagger(Flagger):
outlier_idxs: Union[np.ndarray, list, int] = []
def __post__init__(self):
super().__post_init__()
... | miguelcarcamovREPO_NAMEcsromerPATH_START.@csromer_extracted@csromer-master@src@csromer@transformers@flaggers@manual_flagger.py@.PATH_END.py |
{
"filename": "test_py_ode_spline.py",
"repo_name": "NumCosmo/NumCosmo",
"repo_path": "NumCosmo_extracted/NumCosmo-master/tests/test_py_ode_spline.py",
"type": "Python"
} | #!/usr/bin/env python
#
# test_py_ode_spline.py
#
# Fri May 19 10:00:00 2023
# Copyright 2023 Sandro Dias Pinto Vitenti
# <vitenti@uel.br>
#
# test_py_ode_spline.py
# Copyright (C) 2023 Sandro Dias Pinto Vitenti <vitenti@uel.br>
#
# numcosmo is free software: you can redistribute it and/or modify it
# under the terms... | NumCosmoREPO_NAMENumCosmoPATH_START.@NumCosmo_extracted@NumCosmo-master@tests@test_py_ode_spline.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "dmlc/xgboost",
"repo_path": "xgboost_extracted/xgboost-master/python-package/xgboost/dask/utils.py",
"type": "Python"
} | """Utilities for the XGBoost Dask interface."""
import logging
import warnings
from typing import Any, Dict, Optional, Tuple
import distributed
from ..collective import Config
LOGGER = logging.getLogger("[xgboost.dask]")
def get_n_threads(local_param: Dict[str, Any], worker: "distributed.Worker") -> int:
"""G... | dmlcREPO_NAMExgboostPATH_START.@xgboost_extracted@xgboost-master@python-package@xgboost@dask@utils.py@.PATH_END.py |
{
"filename": "show_filters.py",
"repo_name": "mattcraigie/UnsupervisedLearningPV",
"repo_path": "UnsupervisedLearningPV_extracted/UnsupervisedLearningPV-master/show_filters.py",
"type": "Python"
} | import os
import torch
import matplotlib.pyplot as plt
from matplotlib.colors import Normalize
from scattering_transform.filters import ClippedMorlet
from models import NFSTRegressor
import yaml
import argparse
import numpy as np
import pandas as pd
import shutil
def plot_filter_transformations(filters_final, filters... | mattcraigieREPO_NAMEUnsupervisedLearningPVPATH_START.@UnsupervisedLearningPV_extracted@UnsupervisedLearningPV-master@show_filters.py@.PATH_END.py |
{
"filename": "test_predict.py",
"repo_name": "bd-j/prospector",
"repo_path": "prospector_extracted/prospector-main/tests/test_predict.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import pytest
from prospect.sources import CSPSpecBasis
from prospect.models import SpecModel, templates
from prospect.observation import Spectrum, Photometry, Lines
@pytest.fixture(scope="module")
def build_sps():
sps = CSPSpecBasis(zcontinuous=1... | bd-jREPO_NAMEprospectorPATH_START.@prospector_extracted@prospector-main@tests@test_predict.py@.PATH_END.py |
{
"filename": "softmax.py",
"repo_name": "google/jax",
"repo_path": "jax_extracted/jax-main/jax/experimental/pallas/ops/gpu/softmax.py",
"type": "Python"
} | # Copyright 2023 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | googleREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@experimental@pallas@ops@gpu@softmax.py@.PATH_END.py |
{
"filename": "_familysrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/pie/title/font/_familysrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="familysrc", parent_name="pie.title.font", **kwargs):
super(FamilysrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@pie@title@font@_familysrc.py@.PATH_END.py |
{
"filename": "_showtickprefix.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/densitymap/colorbar/_showtickprefix.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowtickprefixValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="showtickprefix", parent_name="densitymap.colorbar", **kwargs
):
super(ShowtickprefixValidator, self).__init__(
plotly_name=plotly_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@densitymap@colorbar@_showtickprefix.py@.PATH_END.py |
{
"filename": "metadata_dir.py",
"repo_name": "lsst/rubin_sim",
"repo_path": "rubin_sim_extracted/rubin_sim-main/rubin_sim/maf/metadata_dir.py",
"type": "Python"
} | __all__ = ("metadata_dir",)
import argparse
import glob
import os
import shutil
import matplotlib
matplotlib.use("Agg")
from . import batches as batches
from .db import ResultsDb
from .metric_bundles import MetricBundleGroup
from .slicers import HealpixSlicer, make_wfd_subset_slicer
def metadata_dir():
"""
... | lsstREPO_NAMErubin_simPATH_START.@rubin_sim_extracted@rubin_sim-main@rubin_sim@maf@metadata_dir.py@.PATH_END.py |
{
"filename": "classes.py",
"repo_name": "florian-lienhard/MM-LSD",
"repo_path": "MM-LSD_extracted/MM-LSD-main/helper_functions/classes.py",
"type": "Python"
} | import numpy as np
import itertools
import pandas as pd
import matplotlib.pyplot as plt
from astropy.io import fits
from scipy.signal import find_peaks
from scipy.sparse import csc_matrix
from scipy.sparse.linalg import inv, spsolve
from scipy.interpolate import interp1d,LSQUnivariateSpline
from scipy.optimize impor... | florian-lienhardREPO_NAMEMM-LSDPATH_START.@MM-LSD_extracted@MM-LSD-main@helper_functions@classes.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "mattyowl/fitScalingRelation",
"repo_path": "fitScalingRelation_extracted/fitScalingRelation-master/README.md",
"type": "Markdown"
} | # fitScalingRelation
This is a code for fitting galaxy cluster scaling relations using orthogonal or bisector regression and MCMC. It takes
into account errors on both variables and intrinsic scatter. The algorithm is described in [Hilton et al.
(2012; MNRAS, 424, 2086)](http://adsabs.harvard.edu/abs/2012MNRAS.424.20... | mattyowlREPO_NAMEfitScalingRelationPATH_START.@fitScalingRelation_extracted@fitScalingRelation-master@README.md@.PATH_END.py |
{
"filename": "prop_errormap.py",
"repo_name": "ajeldorado/falco-python",
"repo_path": "falco-python_extracted/falco-python-master/falco/proper/prop_errormap.py",
"type": "Python"
} | # Copyright 2016, 2017 California Institute of Technology
# Users must agree to abide by the restrictions listed in the
# file "LegalStuff.txt" in the PROPER library directory.
#
# PROPER developed at Jet Propulsion Laboratory/California Inst. Technology
# Original IDL version by John Krist
# Python transla... | ajeldoradoREPO_NAMEfalco-pythonPATH_START.@falco-python_extracted@falco-python-master@falco@proper@prop_errormap.py@.PATH_END.py |
{
"filename": "test_pickle.py",
"repo_name": "AstroVPK/kali",
"repo_path": "kali_extracted/kali-master/tests/test_pickle.py",
"type": "Python"
} | import math
import numpy as np
import copy
import unittest
import random
import psutil
import os
import sys
import cPickle as pickle
import tempfile
import shutil
import pdb
import matplotlib.pyplot as plt
import matplotlib.cm as colormap
try:
import kali.carma
except ImportError:
print 'Cannot import kali.ca... | AstroVPKREPO_NAMEkaliPATH_START.@kali_extracted@kali-master@tests@test_pickle.py@.PATH_END.py |
{
"filename": "nmf_interp.py",
"repo_name": "christopherlovell/sengi",
"repo_path": "sengi_extracted/sengi-master/data/nmf_interp.py",
"type": "Python"
} | import numpy as np
from sklearn.decomposition import PCA, NMF
from grids.h5py_utils import load_h5py
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mpl_toolkits.axes_grid1.inset_locator import (inset_axes, InsetPosition,
ma... | christopherlovellREPO_NAMEsengiPATH_START.@sengi_extracted@sengi-master@data@nmf_interp.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.