metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "README.md",
"repo_name": "astro-datalab/notebooks-latest",
"repo_path": "notebooks-latest_extracted/notebooks-latest-master/06_EPO/e-TeenAstronomyCafe_Spanish/05_Gravitational_Lensing/README.md",
"type": "Markdown"
} | **05 Gravitational Lensing**
For information about the program, please visit: http://www.teenastronomycafe.org/
If you want to test this notebook you can:
[](https://colab.research.google.com/github/astro-datalab/notebooks-latest/blob/master/... | astro-datalabREPO_NAMEnotebooks-latestPATH_START.@notebooks-latest_extracted@notebooks-latest-master@06_EPO@e-TeenAstronomyCafe_Spanish@05_Gravitational_Lensing@README.md@.PATH_END.py |
{
"filename": "update_manager.py",
"repo_name": "sibirrer/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/lenstronomy/Workflow/update_manager.py",
"type": "Python"
} | import copy
import numpy as np
from lenstronomy.Sampling.parameters import Param
__all__ = ["UpdateManager"]
class UpdateManager(object):
"""This class manages the parameter constraints as they may evolve through the steps
of the modeling.
This includes: keeping certain parameters fixed during one model... | sibirrerREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@lenstronomy@Workflow@update_manager.py@.PATH_END.py |
{
"filename": "t01.py",
"repo_name": "spedas/pyspedas",
"repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/geopack/t01.py",
"type": "Python"
} | import logging
import numpy as np
from pytplot import get_data, store_data
from geopack import geopack, t01
def tt01(pos_var_gsm, parmod=None, suffix=''):
"""
tplot wrapper for the functional interface to Sheng Tian's implementation of the Tsyganenko 2001 and IGRF model:
https://github.com/tsssss/geopack... | spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@geopack@t01.py@.PATH_END.py |
{
"filename": "_x.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/ternary/domain/_x.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XValidator(_plotly_utils.basevalidators.InfoArrayValidator):
def __init__(self, plotly_name="x", parent_name="layout.ternary.domain", **kwargs):
super(XValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@ternary@domain@_x.py@.PATH_END.py |
{
"filename": "sigma_dA.py",
"repo_name": "HETDEX/elixer",
"repo_path": "elixer_extracted/elixer-main/elixer/Bayes/sigma_dA.py",
"type": "Python"
} | from datapath import *
import numpy as np
def sigma_dA ( fContam, fIncomp, cntLAErecovered, scale, bin, version, baserun ) :
if 0 <= version <= 2 :
if version == 'old' or version == 0 :
if bin == '1.9-2.5' or bin == 0 :
sigma2_dA = (fContam/0.025)**2 + (270000*scale)/cntLAErecovered
elif bin ==... | HETDEXREPO_NAMEelixerPATH_START.@elixer_extracted@elixer-main@elixer@Bayes@sigma_dA.py@.PATH_END.py |
{
"filename": "_visible.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/xaxis/rangeselector/button/_visible.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VisibleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name="visible",
parent_name="layout.xaxis.rangeselector.button",
**kwargs
):
super(VisibleValidator, self).__init__(
plotly_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@xaxis@rangeselector@button@_visible.py@.PATH_END.py |
{
"filename": "_lineposition.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/scene/xaxis/tickfont/_lineposition.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LinepositionValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(
self,
plotly_name="lineposition",
parent_name="layout.scene.xaxis.tickfont",
**kwargs,
):
super(LinepositionValidator, self).__init__(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@scene@xaxis@tickfont@_lineposition.py@.PATH_END.py |
{
"filename": "tools.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/tsa/arima/tools.py",
"type": "Python"
} | """
SARIMAX tools.
Author: Chad Fulton
License: BSD-3
"""
import numpy as np
def standardize_lag_order(order, title=None):
"""
Standardize lag order input.
Parameters
----------
order : int or array_like
Maximum lag order (if integer) or iterable of specific lag orders.
title : str, ... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@tsa@arima@tools.py@.PATH_END.py |
{
"filename": "analyze.py",
"repo_name": "jmd-dk/concept",
"repo_path": "concept_extracted/concept-master/test/lpt/analyze.py",
"type": "Python"
} | # This file has to be run in pure Python mode!
# Imports from the CO𝘕CEPT code
from commons import *
plt = get_matplotlib().pyplot
# Absolute path and name of this test
this_dir = os.path.dirname(os.path.realpath(__file__))
this_test = os.path.basename(os.path.dirname(this_dir))
# Begin analysis
masterprint(f'Anal... | jmd-dkREPO_NAMEconceptPATH_START.@concept_extracted@concept-master@test@lpt@analyze.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "JLBLine/CHIPS_wrappers",
"repo_path": "CHIPS_wrappers_extracted/CHIPS_wrappers-main/README.md",
"type": "Markdown"
} | # CHIPS_wrappers
Scripts to run CHIPS power spectrum estimator, and plot the outputs. This repo is under development, and does not have unit/integration tests as of yet.
## Installation
Real basic at the mo, you need to do
```bash
git clone https://github.com/JLBLine/CHIPS_wrappers.git
cd CHIPS_wrappers
pip install .
... | JLBLineREPO_NAMECHIPS_wrappersPATH_START.@CHIPS_wrappers_extracted@CHIPS_wrappers-main@README.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/map/layer/fill/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._outlinecolor import OutlinecolorValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._outlinecolor.OutlinecolorValidato... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@map@layer@fill@__init__.py@.PATH_END.py |
{
"filename": "_line.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/table/header/_line.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LineValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="line", parent_name="table.header", **kwargs):
super(LineValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@table@header@_line.py@.PATH_END.py |
{
"filename": "solvers.py",
"repo_name": "astro-informatics/DarkMappy",
"repo_path": "DarkMappy_extracted/DarkMappy-main/darkmappy/solvers.py",
"type": "Python"
} | import numpy as np
import optimusprimal as opt
import darkmappy.logs as lg
class PrimalDual:
"""
Class which handles all primal dual optimisation paradigms.
"""
def __init__(
self,
data,
phi,
psi,
options={
"tol": 1e-5,
"iter": 5000,
... | astro-informaticsREPO_NAMEDarkMappyPATH_START.@DarkMappy_extracted@DarkMappy-main@darkmappy@solvers.py@.PATH_END.py |
{
"filename": "tf_numpy_mlp.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/ops/numpy_ops/integration_test/benchmarks/tf_numpy_mlp.py",
"type": "Python"
} | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@ops@numpy_ops@integration_test@benchmarks@tf_numpy_mlp.py@.PATH_END.py |
{
"filename": "eismap.py",
"repo_name": "USNavalResearchLaboratory/eispac",
"repo_path": "eispac_extracted/eispac-main/eispac/core/eismap.py",
"type": "Python"
} | """
`~sunpy.map.Map` subclass for the EUV Imaging Spectrometer (EIS) on Hinode
"""
import sys
import pathlib
import numpy as np
import astropy.units as u
from astropy.io import fits
from astropy.nddata import StdDevUncertainty
from astropy.visualization import ImageNormalize, AsinhStretch, LinearStretch
import sunpy.m... | USNavalResearchLaboratoryREPO_NAMEeispacPATH_START.@eispac_extracted@eispac-main@eispac@core@eismap.py@.PATH_END.py |
{
"filename": "test_misc.py",
"repo_name": "radiocosmology/caput",
"repo_path": "caput_extracted/caput-master/tests/test_misc.py",
"type": "Python"
} | """Test the miscellaneous tools."""
import unittest
import tempfile
import os
import pytest
import shutil
from caput import misc
class TestLock(unittest.TestCase):
def setUp(self):
self.dir = tempfile.mkdtemp()
def test_lock_new(self):
"""Test the normal behaviour"""
base = "newfil... | radiocosmologyREPO_NAMEcaputPATH_START.@caput_extracted@caput-master@tests@test_misc.py@.PATH_END.py |
{
"filename": "dtau_mmwl.py",
"repo_name": "HajimeKawahara/exojax",
"repo_path": "exojax_extracted/exojax-master/src/exojax/spec/dtau_mmwl.py",
"type": "Python"
} | """compute dtau (opacity difference in atmospheric layers) using mean molecular weight
"""
import jax.numpy as jnp
from exojax.spec.hitrancia import interp_logacia_matrix
from exojax.spec.hminus import log_hminus_continuum
from exojax.atm.idealgas import number_density
from exojax.utils.constants import logkB, logm_u... | HajimeKawaharaREPO_NAMEexojaxPATH_START.@exojax_extracted@exojax-master@src@exojax@spec@dtau_mmwl.py@.PATH_END.py |
{
"filename": "_plot.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/sklearn/model_selection/_plot.py",
"type": "Python"
} | # Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
import numpy as np
from ..utils._optional_dependencies import check_matplotlib_support
from ..utils._plotting import _interval_max_min_ratio, _validate_score_name
from ._validation import learning_curve, validation_curve
class _BaseCurve... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@sklearn@model_selection@_plot.py@.PATH_END.py |
{
"filename": "cal_on_karl_results.py",
"repo_name": "HETDEX/hetdex_api",
"repo_path": "hetdex_api_extracted/hetdex_api-master/hetdex_tools/cal_on_karl_results.py",
"type": "Python"
} | """
Derive a scaling between the values in
from the ShotSensitivity API and the completeness
simulations Karl Gebhardt ran.
Daniel Farrow (MPE) 2021, 2022
"""
from numpy import (loadtxt, savetxt, transpose, interp, sqrt, exp,
mean, linspace, zeros, array, polyfit, polyval,
... | HETDEXREPO_NAMEhetdex_apiPATH_START.@hetdex_api_extracted@hetdex_api-master@hetdex_tools@cal_on_karl_results.py@.PATH_END.py |
{
"filename": "_extendsunburstcolors.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/_extendsunburstcolors.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ExtendsunburstcolorsValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="extendsunburstcolors", parent_name="layout", **kwargs
):
super(ExtendsunburstcolorsValidator, self).__init__(
plotly_name=plotly_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@_extendsunburstcolors.py@.PATH_END.py |
{
"filename": "_tracerefminus.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter/error_x/_tracerefminus.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TracerefminusValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="tracerefminus", parent_name="scatter.error_x", **kwargs
):
super(TracerefminusValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter@error_x@_tracerefminus.py@.PATH_END.py |
{
"filename": "pool.py",
"repo_name": "dstndstn/tractor",
"repo_path": "tractor_extracted/tractor-main/.circleci/circleci-build-ubuntu18.04/pool.py",
"type": "Python"
} | #
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Pool', 'ThreadPool']
#
# Imports
#
import threading
import queue
import itertools
import collections
import os
import tim... | dstndstnREPO_NAMEtractorPATH_START.@tractor_extracted@tractor-main@.circleci@circleci-build-ubuntu18.04@pool.py@.PATH_END.py |
{
"filename": "model.py",
"repo_name": "wilkinsdr/pylag",
"repo_path": "pylag_extracted/pylag-master/pylag/model.py",
"type": "Python"
} | """
pylag.model
Provides Model classes for fitting functions to data
v1.0 05/07/2019 - D.R. Wilkins
"""
import numpy as np
import lmfit
import copy
def param2array(params, variable_only=False):
"""
Convert a Parameters object into an array of the parameter values
"""
if variable_only:
return... | wilkinsdrREPO_NAMEpylagPATH_START.@pylag_extracted@pylag-master@pylag@model.py@.PATH_END.py |
{
"filename": "_surfacecolor.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatter3d/_surfacecolor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SurfacecolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(self, plotly_name="surfacecolor", parent_name="scatter3d", **kwargs):
super(SurfacecolorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatter3d@_surfacecolor.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/partners/groq/langchain_groq/__init__.py",
"type": "Python"
} | from langchain_groq.chat_models import ChatGroq
__all__ = ["ChatGroq"]
| langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@partners@groq@langchain_groq@__init__.py@.PATH_END.py |
{
"filename": "_textcasesrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/funnelarea/hoverlabel/font/_textcasesrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextcasesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="textcasesrc",
parent_name="funnelarea.hoverlabel.font",
**kwargs,
):
super(TextcasesrcValidator, self).__init__(
plotl... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@funnelarea@hoverlabel@font@_textcasesrc.py@.PATH_END.py |
{
"filename": "CentroidalVoronoiRelaxation.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/src/NodeGenerators/CentroidalVoronoiRelaxation.py",
"type": "Python"
} | # Apply various centroidal Voronoi relaxation methods to optimize NodeGenerators.
from Spheral2d import *
from generateMesh import *
#-------------------------------------------------------------------------------
# Relax nodes on fixed radii.
#-------------------------------------------------------------------------... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@src@NodeGenerators@CentroidalVoronoiRelaxation.py@.PATH_END.py |
{
"filename": "ipkernel.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/ipykernel/py3/ipykernel/inprocess/ipkernel.py",
"type": "Python"
} | """An in-process kernel"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import logging
import sys
from contextlib import contextmanager
from IPython.core.interactiveshell import InteractiveShellABC
from traitlets import Any, Enum, Instance, List, Type, default
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipykernel@py3@ipykernel@inprocess@ipkernel.py@.PATH_END.py |
{
"filename": "tec.py",
"repo_name": "revoltek/losoto",
"repo_path": "losoto_extracted/losoto-master/losoto/operations/tec.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import multiprocessing as mp
import numpy as np
import scipy.optimize
from scipy.interpolate import interp1d
from losoto.lib_unwrap import unwrap_2d
from losoto.lib_operations import *
from losoto._logging import logger as logging
logging.debug('Loading TEC modu... | revoltekREPO_NAMElosotoPATH_START.@losoto_extracted@losoto-master@losoto@operations@tec.py@.PATH_END.py |
{
"filename": "combine_cut_FASTpsrfits_freq_time_splitpol.py",
"repo_name": "qianlivan/RPPPS",
"repo_path": "RPPPS_extracted/RPPPS-master/combine_cut_FASTpsrfits_freq_time_splitpol.py",
"type": "Python"
} | import numpy as np
import pyfits
import os
import datetime
import time
import sys
from array import array
import matplotlib as mpl
import matplotlib.pyplot as plt
from pylab import *
##############################################################
# 20161008 adapted from cut_FASTpsrfits_freq_time_splitpol.p... | qianlivanREPO_NAMERPPPSPATH_START.@RPPPS_extracted@RPPPS-master@combine_cut_FASTpsrfits_freq_time_splitpol.py@.PATH_END.py |
{
"filename": "weaviate.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/retrievers/self_query/weaviate.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.query_constructors.weaviate import WeaviateTranslator
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling o... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@retrievers@self_query@weaviate.py@.PATH_END.py |
{
"filename": "_trirefine.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/lib/matplotlib/tri/_trirefine.py",
"type": "Python"
} | """
Mesh refinement for triangular grids.
"""
import numpy as np
from matplotlib import _api
from matplotlib.tri._triangulation import Triangulation
import matplotlib.tri._triinterpolate
class TriRefiner:
"""
Abstract base class for classes implementing mesh refinement.
A TriRefiner encapsulates a Tria... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@lib@matplotlib@tri@_trirefine.py@.PATH_END.py |
{
"filename": "use_case_38_1L2S_qflux.py",
"repo_name": "rpoleski/MulensModel",
"repo_path": "MulensModel_extracted/MulensModel-master/examples/use_cases/use_case_38_1L2S_qflux.py",
"type": "Python"
} | """
Fit a binary source event. Allow the flux ratio to be freely fit for KMTC data,
but then constrained for other datasets in the same band.
For example, suppose there is a short-term anomaly that is only covered by KMTC
data. Then, for a binary source fit, the KMTC data constrain q_flux but the
other datasets do not... | rpoleskiREPO_NAMEMulensModelPATH_START.@MulensModel_extracted@MulensModel-master@examples@use_cases@use_case_38_1L2S_qflux.py@.PATH_END.py |
{
"filename": "Scaling-Crossbar.io.md",
"repo_name": "crossbario/crossbar",
"repo_path": "crossbar_extracted/crossbar-master/docs-old/pages/administration/production/Scaling-Crossbar.io.md",
"type": "Markdown"
} | title: Scaling Crossbar.io
toc: [Documentation, Administration, Going to Production, Scaling Crossbar.io]
# Scaling Crossbar.io
The following discusses Crossbar.io scalability in terms of
* scale-up: utilizing faster and more cores on a single machine
* scale-out: utilizing multiple machines
and with regard to
* s... | crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@docs-old@pages@administration@production@Scaling-Crossbar.io.md@.PATH_END.py |
{
"filename": "rotation_measure_gauss.ipynb",
"repo_name": "me-manu/gammaALPs",
"repo_path": "gammaALPs_extracted/gammaALPs-master/docs/tutorials/rotation_measure_gauss.ipynb",
"type": "Jupyter Notebook"
} | [](https://colab.research.google.com/github/me-manu/gammaALPs/blob/master/docs/tutorials/rotation_measure_gauss.ipynb)
# Calculating the coherence length and rotation measure for Gaussian turbulent field
This tutorial demonstrates how to the co... | me-manuREPO_NAMEgammaALPsPATH_START.@gammaALPs_extracted@gammaALPs-master@docs@tutorials@rotation_measure_gauss.ipynb@.PATH_END.py |
{
"filename": "file_leff.py",
"repo_name": "grand-mother/grand",
"repo_path": "grand_extracted/grand-main/grand/io/file_leff.py",
"type": "Python"
} | from __future__ import annotations
from dataclasses import dataclass, fields
from logging import getLogger
from pathlib import Path
from typing import Union, cast
from numbers import Number
import os.path as osp
import numpy
from grand.io import io_node as io
__all__ = ["DataTable", "TabulatedAntennaModel"]
logge... | grand-motherREPO_NAMEgrandPATH_START.@grand_extracted@grand-main@grand@io@file_leff.py@.PATH_END.py |
{
"filename": "kde_plot4.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/doc/source/tutorial/stats/plots/kde_plot4.py",
"type": "Python"
} | from functools import partial
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
def my_kde_bandwidth(obj, fac=1./5):
"""We use Scott's Rule, multiplied by a constant factor."""
return np.power(obj.n, -1./(obj.d+4)) * fac
loc1, scale1, size1 = (-2, 1, 175)
loc2, scale2, size2 = (2, ... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@doc@source@tutorial@stats@plots@kde_plot4.py@.PATH_END.py |
{
"filename": "_transition.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/layout/slider/_transition.py",
"type": "Python"
} | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Transition(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.slider"
_path_str = "layout.slider.transition"
_valid_props = {"duration", "ea... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@layout@slider@_transition.py@.PATH_END.py |
{
"filename": "reproduce_pysm2_dust_pol.ipynb",
"repo_name": "galsci/pysm",
"repo_path": "pysm_extracted/pysm-main/docs/preprocess-templates/reproduce_pysm2_dust_pol.ipynb",
"type": "Jupyter Notebook"
} | # Reproduce PySM 2 small scales for dust polarization
The purpose of this notebook is to reproduce the analysis described in the [PySM 2 paper](https://arxiv.org/pdf/1608.02841.pdf) to prepare the input templates used in the Galactic dust and synchrotron models.
In summary we take input template maps from Planck or o... | galsciREPO_NAMEpysmPATH_START.@pysm_extracted@pysm-main@docs@preprocess-templates@reproduce_pysm2_dust_pol.ipynb@.PATH_END.py |
{
"filename": "_alignsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/pointcloud/hoverlabel/_alignsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class AlignsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="alignsrc", parent_name="pointcloud.hoverlabel", **kwargs
):
super(AlignsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@pointcloud@hoverlabel@_alignsrc.py@.PATH_END.py |
{
"filename": "bin_ground_schedule.ipynb",
"repo_name": "hpc4cmb/toast",
"repo_path": "toast_extracted/toast-main/tutorial/02_Simulated_Scan_Strategies/bin_ground_schedule.ipynb",
"type": "Jupyter Notebook"
} | # Binning a ground schedule
In this notebook, we take an observing schedule from `toast_ground_sim.py` and translate it into a depth map.
```python
# Capture C++ output in the jupyter cells
%reload_ext wurlitzer
```
First, we need a focalplane. If one does not already exist, TOAST `pipelines` includes a tool for ge... | hpc4cmbREPO_NAMEtoastPATH_START.@toast_extracted@toast-main@tutorial@02_Simulated_Scan_Strategies@bin_ground_schedule.ipynb@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "lee-group-cmu/cdetools",
"repo_path": "cdetools_extracted/cdetools-master/r/README.md",
"type": "Markdown"
} | cdetools: Tools for Conditional Density Estimates
===
Provides tools for evaluating conditional density estimates.
Calculates CDE loss, coverge, and HPD coverage.
Installation
===
Use the =devtools= package to install from Github
```{r}
devtools::install_github("tpospisi/cdetools/r")
``` | lee-group-cmuREPO_NAMEcdetoolsPATH_START.@cdetools_extracted@cdetools-master@r@README.md@.PATH_END.py |
{
"filename": "_y.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/heatmap/_y.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="y", parent_name="heatmap", **kwargs):
super(YValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@heatmap@_y.py@.PATH_END.py |
{
"filename": "config_test_12.py",
"repo_name": "swagnercarena/paltas",
"repo_path": "paltas_extracted/paltas-main/paltas/Configs/paper_2203_00690/config_test_12.py",
"type": "Python"
} | from paltas.Configs.paper_2203_00690.config_val import *
config_dict = copy.deepcopy(config_dict)
config_dict['subhalo']['parameters']['sigma_sub'] = norm(loc=2.4e-3,
scale=1.5e-4).rvs
config_dict['main_deflector']['parameters']['gamma'] = truncnorm(-197.2,
np.inf,loc=1.972,scale=0.01).rvs
config_dict['main_deflecto... | swagnercarenaREPO_NAMEpaltasPATH_START.@paltas_extracted@paltas-main@paltas@Configs@paper_2203_00690@config_test_12.py@.PATH_END.py |
{
"filename": "utility.py",
"repo_name": "sheydenreich/threepoint",
"repo_path": "threepoint_extracted/threepoint-main/python_scripts/utility.py",
"type": "Python"
} | """ Useful functions
"""
import numpy as np
def D(npix = 4096,pixsize = 1.):
""" Calculates D function in Kaiser-Squires relation for a grid
Args:
npix (int, optional): Number of pixels in one direction. Defaults to 4096.
pixsize (float, optional): Length of a pixel. Defaults to 1..
Ret... | sheydenreichREPO_NAMEthreepointPATH_START.@threepoint_extracted@threepoint-main@python_scripts@utility.py@.PATH_END.py |
{
"filename": "test_advanced_analysis.py",
"repo_name": "LSSTDESC/BlendingToolKit",
"repo_path": "BlendingToolKit_extracted/BlendingToolKit-main/tests/test_advanced_analysis.py",
"type": "Python"
} | """We have this unittests to avoid running the very time consuming advanced notebook."""
import multiprocessing as mp
import numpy as np
import btk
def get_psf_size(survey: btk.survey.Survey) -> float:
"""Return the PSF size in pixels."""
psf_size_arcsec = survey.get_filter("r").psf_fwhm.to_value("arcsec")... | LSSTDESCREPO_NAMEBlendingToolKitPATH_START.@BlendingToolKit_extracted@BlendingToolKit-main@tests@test_advanced_analysis.py@.PATH_END.py |
{
"filename": "_align.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/sankey/node/hoverlabel/_align.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class AlignValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="align", parent_name="sankey.node.hoverlabel", **kwargs
):
super(AlignValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@sankey@node@hoverlabel@_align.py@.PATH_END.py |
{
"filename": "_family.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/polar/radialaxis/title/font/_family.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="family",
parent_name="layout.polar.radialaxis.title.font",
**kwargs
):
super(FamilyValidator, self).__init__(
plotly_nam... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@polar@radialaxis@title@font@_family.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/scattermapbox/marker/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="scattermapbox.marker.colorbar.title.font",
**kwargs,
):
super(TextcaseValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattermapbox@marker@colorbar@title@font@_textcase.py@.PATH_END.py |
{
"filename": "JAX_CIGALE_emulator-kasia.ipynb",
"repo_name": "H-E-L-P/XID_plus",
"repo_path": "XID_plus_extracted/XID_plus-master/docs/build/doctrees/nbsphinx/notebooks/examples/SED_emulator/JAX_CIGALE_emulator-kasia.ipynb",
"type": "Jupyter Notebook"
} | # The JAX emulator: CIGALE prototype
In this notebook, I will prototype my idea for emulating radiative transfer codes with a Deepnet in order for it to be used inside xidplus. As `numpyro` uses JAX, the Deepnet wil ideally be trained with a JAX network. I will use CIGALE
### Advice from Kasia
Use the following module... | H-E-L-PREPO_NAMEXID_plusPATH_START.@XID_plus_extracted@XID_plus-master@docs@build@doctrees@nbsphinx@notebooks@examples@SED_emulator@JAX_CIGALE_emulator-kasia.ipynb@.PATH_END.py |
{
"filename": "PN-Hamiltonian-Spin-Orbit.ipynb",
"repo_name": "zachetienne/nrpytutorial",
"repo_path": "nrpytutorial_extracted/nrpytutorial-master/NRPyPN/PN-Hamiltonian-Spin-Orbit.ipynb",
"type": "Jupyter Notebook"
} | <script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-59152712-8');
</script>
# $H_{\rm SO}$, up to and including 3.5 post-Newtonian orde... | zachetienneREPO_NAMEnrpytutorialPATH_START.@nrpytutorial_extracted@nrpytutorial-master@NRPyPN@PN-Hamiltonian-Spin-Orbit.ipynb@.PATH_END.py |
{
"filename": "main.py",
"repo_name": "ML4GW/aframe",
"repo_path": "aframe_extracted/aframe-main/projects/plots/plots/legacy/main.py",
"type": "Python"
} | import logging
from pathlib import Path
from typing import Callable, List, Optional
import h5py
import jsonargparse
import numpy as np
from bokeh.io import save
from bokeh.layouts import gridplot
from ledger.events import EventSet, RecoveredInjectionSet
from ledger.injections import InjectionParameterSet
from plots.l... | ML4GWREPO_NAMEaframePATH_START.@aframe_extracted@aframe-main@projects@plots@plots@legacy@main.py@.PATH_END.py |
{
"filename": "_tickvals.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/parcoords/dimension/_tickvals.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickvalsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self, plotly_name="tickvals", parent_name="parcoords.dimension", **kwargs
):
super(TickvalsValidator, self).__init__(
plotly_name=plotly_name,
par... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@parcoords@dimension@_tickvals.py@.PATH_END.py |
{
"filename": "getpota_daily_ran.py",
"repo_name": "desihub/LSS",
"repo_path": "LSS_extracted/LSS-main/scripts/getpota_daily_ran.py",
"type": "Python"
} | '''
Find all of the potential assignments for randoms in all archived tiles
'''
import numpy as np
import os
from astropy.table import Table, join
import argparse
from fiberassign.hardware import load_hardware
from fiberassign.tiles import load_tiles
from fiberassign.targets import Targets, TargetsAvailable, Locations... | desihubREPO_NAMELSSPATH_START.@LSS_extracted@LSS-main@scripts@getpota_daily_ran.py@.PATH_END.py |
{
"filename": "SV1xi.ipynb",
"repo_name": "desihub/LSS",
"repo_path": "LSS_extracted/LSS-main/Sandbox/SV1xi.ipynb",
"type": "Jupyter Notebook"
} | Should work if you have done git clone https://github.com/desihub/LSS.git and edited the part appending to the path or just made sure you are in LSS/Sandbox
```python
import sys, os, glob, time
import numpy as np
import matplotlib.pyplot as plt
import fitsio
```
```python
sys.path.append('../py') #this works if yo... | desihubREPO_NAMELSSPATH_START.@LSS_extracted@LSS-main@Sandbox@SV1xi.ipynb@.PATH_END.py |
{
"filename": "_cluster.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattermapbox/_cluster.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ClusterValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="cluster", parent_name="scattermapbox", **kwargs):
super(ClusterValidator, 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@scattermapbox@_cluster.py@.PATH_END.py |
{
"filename": "_stream.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/scattermapbox/_stream.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Stream(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scattermapbox"
_path_str = "scattermapbox.stream"
_valid_props = {"maxpoints", "token"}
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@scattermapbox@_stream.py@.PATH_END.py |
{
"filename": "generalized_linear_model.py",
"repo_name": "dmlc/xgboost",
"repo_path": "xgboost_extracted/xgboost-master/demo/guide-python/generalized_linear_model.py",
"type": "Python"
} | """
Demo for GLM
============
"""
import os
import xgboost as xgb
##
# this script demonstrate how to fit generalized linear model in xgboost
# basically, we are using linear model, instead of tree for our boosters
##
CURRENT_DIR = os.path.dirname(__file__)
dtrain = xgb.DMatrix(
os.path.join(CURRENT_DIR, "../da... | dmlcREPO_NAMExgboostPATH_START.@xgboost_extracted@xgboost-master@demo@guide-python@generalized_linear_model.py@.PATH_END.py |
{
"filename": "trisurf.md",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/doc/python/trisurf.md",
"type": "Markdown"
} | ---
jupyter:
jupytext:
notebook_metadata_filter: all
text_representation:
extension: .md
format_name: markdown
format_version: '1.2'
jupytext_version: 1.4.2
kernelspec:
display_name: Python 3
language: python
name: python3
language_info:
codemirror_mode:
name:... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@doc@python@trisurf.md@.PATH_END.py |
{
"filename": "feature_extractor_byol.py",
"repo_name": "SKA-INAF/sclassifier",
"repo_path": "sclassifier_extracted/sclassifier-master/sclassifier/feature_extractor_byol.py",
"type": "Python"
} | #!/usr/bin/env python
from __future__ import print_function
##################################################
### MODULE IMPORT
##################################################
## STANDARD MODULES
import os
import sys
import subprocess
import string
import time
import signal
from threading import Thread
i... | SKA-INAFREPO_NAMEsclassifierPATH_START.@sclassifier_extracted@sclassifier-master@sclassifier@feature_extractor_byol.py@.PATH_END.py |
{
"filename": "_minexponent.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/polar/radialaxis/_minexponent.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MinexponentValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="minexponent", parent_name="layout.polar.radialaxis", **kwargs
):
super(MinexponentValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@polar@radialaxis@_minexponent.py@.PATH_END.py |
{
"filename": "random_cat_runner.py",
"repo_name": "CosmoStat/shapepipe",
"repo_path": "shapepipe_extracted/shapepipe-master/shapepipe/modules/random_cat_runner.py",
"type": "Python"
} | """RANDOM CAT RUNNER.
Module runner for ``random_cat``.
:Author: Martin Kilbinger <martin.kilbinger@cea.fr>
"""
from shapepipe.modules.module_decorator import module_runner
from shapepipe.modules.random_cat_package.random_cat import RandomCat
@module_runner(
version='1.1',
file_pattern=['image', 'pipeline... | CosmoStatREPO_NAMEshapepipePATH_START.@shapepipe_extracted@shapepipe-master@shapepipe@modules@random_cat_runner.py@.PATH_END.py |
{
"filename": "_legendrank.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/densitymapbox/_legendrank.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LegendrankValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="legendrank", parent_name="densitymapbox", **kwargs):
super(LegendrankValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_n... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@densitymapbox@_legendrank.py@.PATH_END.py |
{
"filename": "image_array.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/yt/data_objects/image_array.py",
"type": "Python"
} | import numpy as np
from unyt import unyt_array
from yt.config import ytcfg
from yt.visualization.image_writer import write_bitmap, write_image
class ImageArray(unyt_array):
r"""A custom Numpy ndarray used for images.
This differs from ndarray in that you can optionally specify an
info dictionary which i... | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@yt@data_objects@image_array.py@.PATH_END.py |
{
"filename": "_token.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/pointcloud/stream/_token.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TokenValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="token", parent_name="pointcloud.stream", **kwargs):
super(TokenValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@pointcloud@stream@_token.py@.PATH_END.py |
{
"filename": "thirdai_neuraldb.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/vectorstores/thirdai_neuraldb.ipynb",
"type": "Jupyter Notebook"
} | # ThirdAI NeuralDB
>[NeuralDB](https://www.thirdai.com/neuraldb-enterprise/) is a CPU-friendly and fine-tunable vector store developed by [ThirdAI](https://www.thirdai.com/).
## Initialization
There are two initialization methods:
- From Scratch: Basic model
- From Checkpoint: Load a model that was previously saved
... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@vectorstores@thirdai_neuraldb.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "purmortal/galcraft",
"repo_path": "galcraft_extracted/galcraft-main/GalCraft/modules/__init__.py",
"type": "Python"
} | purmortalREPO_NAMEgalcraftPATH_START.@galcraft_extracted@galcraft-main@GalCraft@modules@__init__.py@.PATH_END.py | |
{
"filename": "e33c1d5684cf_changed_parts_paper_table_to_parts.py",
"repo_name": "HERA-Team/hera_mc",
"repo_path": "hera_mc_extracted/hera_mc-main/alembic/versions/e33c1d5684cf_changed_parts_paper_table_to_parts.py",
"type": "Python"
} | """changed parts_paper table to parts
Revision ID: e33c1d5684cf
Revises: 3d3c72ecbc0d
Create Date: 2018-01-30 01:02:58.347378+00:00
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "e33c1d5684cf"
down_revision = "3d3c72ecbc0d"
branch_labels = None
depends_on = N... | HERA-TeamREPO_NAMEhera_mcPATH_START.@hera_mc_extracted@hera_mc-main@alembic@versions@e33c1d5684cf_changed_parts_paper_table_to_parts.py@.PATH_END.py |
{
"filename": "test_galkin.py",
"repo_name": "lenstronomy/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_GalKin/test_galkin.py",
"type": "Python"
} | """Tests for `galkin` module."""
import pytest
import unittest
import copy
import numpy.testing as npt
import numpy as np
import scipy.integrate as integrate
from lenstronomy.GalKin.galkin import Galkin
from lenstronomy.GalKin.light_profile import LightProfile
import lenstronomy.Util.param_util as param_util
from lens... | lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_GalKin@test_galkin.py@.PATH_END.py |
{
"filename": "gethdutype.py",
"repo_name": "Fermipy/fermipy",
"repo_path": "fermipy_extracted/fermipy-master/fermipy/scripts/gethdutype.py",
"type": "Python"
} | #!/usr/bin/env python
#
""" Identify the type of image stored in an HDU
"""
__facility__ = "gethdutype.py"
__abstract__ = __doc__
__author__ = "E. Charles"
__date__ = "$Date: 2015/05/06 21:20:31 $"
__version__ = "$Revision: 1.4 $, $Author: echarles $"
__release__ = "$Name: $"
import sys
import argparse... | FermipyREPO_NAMEfermipyPATH_START.@fermipy_extracted@fermipy-master@fermipy@scripts@gethdutype.py@.PATH_END.py |
{
"filename": "_showlegend.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/heatmap/_showlegend.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowlegendValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="showlegend", parent_name="heatmap", **kwargs):
super(ShowlegendValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@heatmap@_showlegend.py@.PATH_END.py |
{
"filename": "varying_pann.ipynb",
"repo_name": "miguelzuma/hi_class_public",
"repo_path": "hi_class_public_extracted/hi_class_public-master/notebooks/varying_pann.ipynb",
"type": "Jupyter Notebook"
} | ```python
# import necessary modules
# uncomment to get plots displayed in notebook
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from classy import Class
from scipy.optimize import fsolve
import math
```
```python
# esthetic definitions for the plots
font = {'size' : 16, '... | miguelzumaREPO_NAMEhi_class_publicPATH_START.@hi_class_public_extracted@hi_class_public-master@notebooks@varying_pann.ipynb@.PATH_END.py |
{
"filename": "metrics.py",
"repo_name": "aimalz/qp",
"repo_path": "qp_extracted/qp-master/qp/metrics.py",
"type": "Python"
} | import numpy as np
import qp
def calculate_moment(p, N, using=None, limits=None, dx=0.01, vb=False):
"""
Calculates a moment of a qp.PDF object
Parameters
----------
p: qp.PDF object
the PDF whose moment will be calculated
N: int
order of the moment to be calculated
limits... | aimalzREPO_NAMEqpPATH_START.@qp_extracted@qp-master@qp@metrics.py@.PATH_END.py |
{
"filename": "MasterPlot.py",
"repo_name": "mmicromegas/ransX",
"repo_path": "ransX_extracted/ransX-master/UTILS/RANSX/MasterPlot.py",
"type": "Python"
} | from EQUATIONS.ContinuityEquationWithMassFlux import ContinuityEquationWithMassFlux
from EQUATIONS.ContinuityEquationWithFavrianDilatation import ContinuityEquationWithFavrianDilatation
from EQUATIONS.MomentumEquationX import MomentumEquationX
from EQUATIONS.MomentumEquationY import MomentumEquationY
from EQUATIONS.Mo... | mmicromegasREPO_NAMEransXPATH_START.@ransX_extracted@ransX-master@UTILS@RANSX@MasterPlot.py@.PATH_END.py |
{
"filename": "naive_multiband.py",
"repo_name": "astroML/gatspy",
"repo_path": "gatspy_extracted/gatspy-master/gatspy/periodic/naive_multiband.py",
"type": "Python"
} | """
Naive Multiband Methods
This basically amounts to a band-by-band single band approach, followed by
some sort of majority vote among the peaks of the individual periodograms.
"""
from __future__ import division, print_function, absolute_import
__all__ = ['NaiveMultiband']
import numpy as np
from scipy.stats impor... | astroMLREPO_NAMEgatspyPATH_START.@gatspy_extracted@gatspy-master@gatspy@periodic@naive_multiband.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "yaojian95/ForSEplus",
"repo_path": "ForSEplus_extracted/ForSEplus-main/README.md",
"type": "Markdown"
} | # ForSEplus

\*Different realizations of small scales at 12 arcminutes in the second column.
- Simulate **stochastic, polarized(QU), non-Gaussian** thermal dust emission at **353GHz** up to **3 arcminutes**.
- plus version of... | yaojian95REPO_NAMEForSEplusPATH_START.@ForSEplus_extracted@ForSEplus-main@README.md@.PATH_END.py |
{
"filename": "SampleFileUtil.py",
"repo_name": "cosmo-ethz/CosmoHammer",
"repo_path": "CosmoHammer_extracted/CosmoHammer-master/cosmoHammer/util/SampleFileUtil.py",
"type": "Python"
} |
import pickle
import numpy as np
import cosmoHammer.Constants as c
class SampleFileUtil(object):
"""
Util for handling sample files
:param filePrefix: the prefix to use
:param master: True if the sampler instance is the master
:param reuseBurnin: True if the burn in data from a previous run should be used
... | cosmo-ethzREPO_NAMECosmoHammerPATH_START.@CosmoHammer_extracted@CosmoHammer-master@cosmoHammer@util@SampleFileUtil.py@.PATH_END.py |
{
"filename": "ruth4.py",
"repo_name": "adrn/gala",
"repo_path": "gala_extracted/gala-main/gala/integrate/pyintegrators/ruth4.py",
"type": "Python"
} | """ Leapfrog integration. """
# Project
from ..core import Integrator
from ..timespec import parse_time_specification
__all__ = ["Ruth4Integrator"]
class Ruth4Integrator(Integrator):
r"""
A 4th order symplectic integrator.
Given a function for computing time derivatives of the phase-space
coordinat... | adrnREPO_NAMEgalaPATH_START.@gala_extracted@gala-main@gala@integrate@pyintegrators@ruth4.py@.PATH_END.py |
{
"filename": "_title.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/streamtube/colorbar/_title.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Title(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "streamtube.colorbar"
_path_str = "streamtube.colorbar.title"
_valid_props = {"font", "side", ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@streamtube@colorbar@_title.py@.PATH_END.py |
{
"filename": "agama_stream.ipynb",
"repo_name": "ybillchen/particle_spray",
"repo_path": "particle_spray_extracted/particle_spray-main/agama_stream.ipynb",
"type": "Jupyter Notebook"
} | # Particle spray algorithm by Chen et al. (2024) via `agama`
Author: Yingtian "Bill" Chen
We provide a notebook to generate streams using the Chen+24 ([arXiv:2408.01496](https://arxiv.org/abs/2408.01496)) model via `agama`. This implementation is based on Eugene Vasiliev's [tutorial notebook](https://github.com/Galac... | ybillchenREPO_NAMEparticle_sprayPATH_START.@particle_spray_extracted@particle_spray-main@agama_stream.ipynb@.PATH_END.py |
{
"filename": "_lineposition.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/contourcarpet/colorbar/title/font/_lineposition.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LinepositionValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(
self,
plotly_name="lineposition",
parent_name="contourcarpet.colorbar.title.font",
**kwargs,
):
super(LinepositionValidator, self).__init__(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@contourcarpet@colorbar@title@font@_lineposition.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "desihub/desisim",
"repo_path": "desisim_extracted/desisim-main/py/desisim/test/__init__.py",
"type": "Python"
} | from __future__ import absolute_import, division, print_function
import unittest
def test_suite():
"""Returns unittest.TestSuite of desisim tests for use by setup.py"""
#- DEBUG Travis test failures
# return unittest.defaultTestLoader.loadTestsFromNames([
# # 'desisim.test.test_batch', #- OK... | desihubREPO_NAMEdesisimPATH_START.@desisim_extracted@desisim-main@py@desisim@test@__init__.py@.PATH_END.py |
{
"filename": "biased_isotropic_velocity.py",
"repo_name": "astropy/halotools",
"repo_path": "halotools_extracted/halotools-master/halotools/empirical_models/phase_space_models/analytic_models/satellites/nfw/kernels/biased_isotropic_velocity.py",
"type": "Python"
} | """
"""
import numpy as np
from scipy.integrate import quad as quad_integration
from .mass_profile import _g_integral
__all__ = ("dimensionless_radial_velocity_dispersion",)
def _jeans_integrand_term1(y, *args):
r"""First term in the Jeans integrand"""
bias_ratio = args[0] # = halo_conc/gal_conc
retur... | astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@halotools@empirical_models@phase_space_models@analytic_models@satellites@nfw@kernels@biased_isotropic_velocity.py@.PATH_END.py |
{
"filename": "modelparameters.py",
"repo_name": "rpoleski/MulensModel",
"repo_path": "MulensModel_extracted/MulensModel-master/source/MulensModel/modelparameters.py",
"type": "Python"
} | import numpy as np
from MulensModel.uniformcausticsampling import UniformCausticSampling
from MulensModel.orbits.orbit import Orbit
class ModelParameters(object):
"""
A class for the basic microlensing model parameters (t_0, u_0,
t_E, s, q, alpha, etc.). Can handle point lens or binary lens.
The pi_E... | rpoleskiREPO_NAMEMulensModelPATH_START.@MulensModel_extracted@MulensModel-master@source@MulensModel@modelparameters.py@.PATH_END.py |
{
"filename": "core.py",
"repo_name": "samuelyeewl/specmatch-emp",
"repo_path": "specmatch-emp_extracted/specmatch-emp-master/specmatchemp/core.py",
"type": "Python"
} | """
@filename core.py
SpecMatch-Emp core functions
"""
import os
import sys
from shutil import copy
import logging
import numpy as np
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.pyplot as plt
from specmatchemp import SPECMATCHDIR
from specmatchemp import SHIFT_REFERENCES
from specmatchemp ... | samuelyeewlREPO_NAMEspecmatch-empPATH_START.@specmatch-emp_extracted@specmatch-emp-master@specmatchemp@core.py@.PATH_END.py |
{
"filename": "model.py",
"repo_name": "IvS-KULeuven/IvSPythonRepository",
"repo_path": "IvSPythonRepository_extracted/IvSPythonRepository-master/sed/model.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Interface to the SED library.
The most basic usage of this module is:
>>> wave,flux = get_table(teff=10000,logg=4.0)
This will retrieve the model SED with the specified B{effective temperature} and
B{logg}, from the standard B{grid}, in standard B{units} and with zero
B{reddening}. All th... | IvS-KULeuvenREPO_NAMEIvSPythonRepositoryPATH_START.@IvSPythonRepository_extracted@IvSPythonRepository-master@sed@model.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattergeo/hoverlabel/font/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="scattergeo.hoverlabel.font", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattergeo@hoverlabel@font@_color.py@.PATH_END.py |
{
"filename": "test_file_alignment.py",
"repo_name": "h5py/h5py",
"repo_path": "h5py_extracted/h5py-master/h5py/tests/test_file_alignment.py",
"type": "Python"
} | import h5py
from .common import TestCase
def is_aligned(dataset, offset=4096):
# Here we check if the dataset is aligned
return dataset.id.get_offset() % offset == 0
def dataset_name(i):
return f"data{i:03}"
class TestFileAlignment(TestCase):
"""
Ensure that setting the file alignment has ... | h5pyREPO_NAMEh5pyPATH_START.@h5py_extracted@h5py-master@h5py@tests@test_file_alignment.py@.PATH_END.py |
{
"filename": "FormatConversion-checkpoint.ipynb",
"repo_name": "HaowenZhang/TRINITY",
"repo_path": "TRINITY_extracted/TRINITY-main/obs/Aird_qpdf_no_high/.ipynb_checkpoints/FormatConversion-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | ```python
#This notebook converts the data provided by James Aird to the format that can be read by our model.
import pandas as pd
import numpy as np
```
```python
data = np.loadtxt('./pledd_all.dat', comments='#')
z_low, z_high, mass_low, mass_high, logER, p, p_low, p_high, flag = data.transpose()
mass = 0.5 * (mas... | HaowenZhangREPO_NAMETRINITYPATH_START.@TRINITY_extracted@TRINITY-main@obs@Aird_qpdf_no_high@.ipynb_checkpoints@FormatConversion-checkpoint.ipynb@.PATH_END.py |
{
"filename": "_width.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattergl/error_y/_width.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="width", parent_name="scattergl.error_y", **kwargs):
super(WidthValidator, 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@scattergl@error_y@_width.py@.PATH_END.py |
{
"filename": "plot_Fig1.py",
"repo_name": "igomezv/simplemc_tests",
"repo_path": "simplemc_tests_extracted/simplemc_tests-main/simplemc/plots/plot_Fig1.py",
"type": "Python"
} | #!/usr/bin/env python
from RunBase import *
import pylab
T = LCDMCosmology(mnu=0)
zLOWZ = 0.32
zCMASS = 0.57
zLyaA = 2.34
zLyaC = 2.36
zl = arange(0, 3, 0.1)
pylab.figure(figsize=(8, 10))
pylab.subplot(3, 1, 1)
y1 = [T.DaOverrd(z) for z in zl]
pylab.errorbar(zCMASS, 9.519*(1+zCMASS), yerr=0.134 *
(1... | igomezvREPO_NAMEsimplemc_testsPATH_START.@simplemc_tests_extracted@simplemc_tests-main@simplemc@plots@plot_Fig1.py@.PATH_END.py |
{
"filename": "_legendwidth.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattersmith/_legendwidth.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LegendwidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="legendwidth", parent_name="scattersmith", **kwargs):
super(LegendwidthValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattersmith@_legendwidth.py@.PATH_END.py |
{
"filename": "_arrowhead.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/scene/annotation/_arrowhead.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ArrowheadValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="arrowhead", parent_name="layout.scene.annotation", **kwargs
):
super(ArrowheadValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@scene@annotation@_arrowhead.py@.PATH_END.py |
{
"filename": "test_radtran_calc_tau_rayleigh.py",
"repo_name": "Jingxuan97/nemesispy",
"repo_path": "nemesispy_extracted/nemesispy-main/nemesispy/test/test_radtran_calc_tau_rayleigh.py",
"type": "Python"
} | import numpy as np
from nemesispy.radtran.calc_tau_rayleigh import calc_tau_rayleigh
from nemesispy.radtran.forward_model import ForwardModel
from nemesispy.data.gcm.process_gcm import (nlon,nlat,xlon,xlat,npv,pv,\
tmap,h2omap,comap,co2map,ch4map,hemap,h2map,vmrmap,\
tmap_mod,h2omap_mod,comap_mod,co2map_mod,ch... | Jingxuan97REPO_NAMEnemesispyPATH_START.@nemesispy_extracted@nemesispy-main@nemesispy@test@test_radtran_calc_tau_rayleigh.py@.PATH_END.py |
{
"filename": "test_doc.py",
"repo_name": "mpi4py/mpi4py",
"repo_path": "mpi4py_extracted/mpi4py-master/test/test_doc.py",
"type": "Python"
} | from mpi4py import MPI
import mpiunittest as unittest
import sys
ModuleType = type(MPI)
ClassType = type(MPI.Comm)
FunctionType = type(MPI.Init)
StaticMethodType = type(MPI.buffer.allocate)
ClassMethodType = type(MPI.Comm.Get_parent)
MethodDescrType = type(MPI.Comm.Get_rank)
GetSetDescrType = type(MPI.Comm.rank)
def... | mpi4pyREPO_NAMEmpi4pyPATH_START.@mpi4py_extracted@mpi4py-master@test@test_doc.py@.PATH_END.py |
{
"filename": "dataclasses.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/core/langchain_core/pydantic_v1/dataclasses.py",
"type": "Python"
} | from langchain_core._api import warn_deprecated
try:
from pydantic.v1.dataclasses import * # noqa: F403
except ImportError:
from pydantic.dataclasses import * # type: ignore # noqa: F403
warn_deprecated(
"0.3.0",
removal="1.0.0",
alternative="pydantic.v1 or pydantic",
message=(
"As o... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@core@langchain_core@pydantic_v1@dataclasses.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "migueldvb/cine",
"repo_path": "cine_extracted/cine-master/cine/tests/__init__.py",
"type": "Python"
} | """
This package contains utilities to run the cine test suite.
"""
| migueldvbREPO_NAMEcinePATH_START.@cine_extracted@cine-master@cine@tests@__init__.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "andizq/discminer",
"repo_path": "discminer_extracted/discminer-main/README.md",
"type": "Markdown"
} | <p align="center">
<img src="https://raw.githubusercontent.com/andizq/andizq.github.io/master/discminer/discminer_logo.jpeg" width="500" height="" ></p>
<h2 align="center">The Channel Map Modelling Code</h2>
<div align="center">
<a href="https://github.com/andizq/discminer/blob/main/LICENSE"><img alt="License" src="h... | andizqREPO_NAMEdiscminerPATH_START.@discminer_extracted@discminer-main@README.md@.PATH_END.py |
{
"filename": "_newton_solver.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/sklearn/linear_model/_glm/_newton_solver.py",
"type": "Python"
} | # Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
"""
Newton solver for Generalized Linear Models
"""
import warnings
from abc import ABC, abstractmethod
import numpy as np
import scipy.linalg
import scipy.optimize
from ..._loss.loss import HalfSquaredError
from ...exceptions import Con... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@sklearn@linear_model@_glm@_newton_solver.py@.PATH_END.py |
{
"filename": "angle.py",
"repo_name": "GalSim-developers/GalSim",
"repo_path": "GalSim_extracted/GalSim-main/galsim/angle.py",
"type": "Python"
} | # Copyright (c) 2012-2023 by the GalSim developers team on GitHub
# https://github.com/GalSim-developers
#
# This file is part of GalSim: The modular galaxy image simulation toolkit.
# https://github.com/GalSim-developers/GalSim
#
# GalSim is free software: redistribution and use in source and binary forms,
# with or w... | GalSim-developersREPO_NAMEGalSimPATH_START.@GalSim_extracted@GalSim-main@galsim@angle.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.