metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "access.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/jedi/py2/jedi/evaluate/compiled/access.py",
"type": "Python"
} | import inspect
import types
import sys
from textwrap import dedent
import operator as op
from collections import namedtuple
from jedi._compatibility import unicode, is_py3, builtins, \
py_version, force_unicode, print_to_stderr
from jedi.evaluate.compiled.getattr_static import getattr_static
MethodDescriptorType... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@jedi@py2@jedi@evaluate@compiled@access.py@.PATH_END.py |
{
"filename": "json_to_cassandra.py",
"repo_name": "lsst-uk/lasair-lsst",
"repo_path": "lasair-lsst_extracted/lasair-lsst-main/utility/DP03/json_to_cassandra.py",
"type": "Python"
} | import os, sys, json, io, gzip
from cassandra.cluster import Cluster
from gkdbutils.ingesters.cassandra import executeLoad
from confluent_kafka import Producer
import settings
def insert_cassandra(obj, cassandra_session):
"""insert_casssandra.
Creates an insert for cassandra
a query for inserting it.
... | lsst-ukREPO_NAMElasair-lsstPATH_START.@lasair-lsst_extracted@lasair-lsst-main@utility@DP03@json_to_cassandra.py@.PATH_END.py |
{
"filename": "manifold_wrapper.py",
"repo_name": "dealii/dealii",
"repo_path": "dealii_extracted/dealii-master/contrib/python-bindings/tests/manifold_wrapper.py",
"type": "Python"
} | ## ------------------------------------------------------------------------
##
## SPDX-License-Identifier: LGPL-2.1-or-later
## Copyright (C) 2019 - 2023 by the deal.II authors
##
## This file is part of the deal.II library.
##
## Part of the source code is dual licensed under Apache-2.0 WITH
## LLVM-exception OR LGPL-... | dealiiREPO_NAMEdealiiPATH_START.@dealii_extracted@dealii-master@contrib@python-bindings@tests@manifold_wrapper.py@.PATH_END.py |
{
"filename": "triangle_collection.py",
"repo_name": "macrocosme/shwirl",
"repo_path": "shwirl_extracted/shwirl-master/shwirl/extern/vispy/visuals/collections/triangle_collection.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Nicolas P. Rougier
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
from . raw_triangle_... | macrocosmeREPO_NAMEshwirlPATH_START.@shwirl_extracted@shwirl-master@shwirl@extern@vispy@visuals@collections@triangle_collection.py@.PATH_END.py |
{
"filename": "plot_constraints.py",
"repo_name": "MikeSWang/Harmonia",
"repo_path": "Harmonia_extracted/Harmonia-master/application/pipeline/cosmological_reading/plot_constraints.py",
"type": "Python"
} | """Plot posterior evaluations across different datasets.
"""
import numpy as np
from matplotlib import pyplot as plt
from scipy.integrate import cumtrapz, simps
LINE_SCATTER_ALPHA = 1./10.
AREA_FILL_ALPHA = 1./2.
CONTOUR_FILL_ALPHA = 1./25.
ONE_SIGMA_QUANTILES = [0.158655, 0.841345]
SIGMA_LEVELS = [0.864665, 0.393469... | MikeSWangREPO_NAMEHarmoniaPATH_START.@Harmonia_extracted@Harmonia-master@application@pipeline@cosmological_reading@plot_constraints.py@.PATH_END.py |
{
"filename": "_bordercolor.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/xaxis/rangeselector/_bordercolor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="bordercolor",
parent_name="layout.xaxis.rangeselector",
**kwargs
):
super(BordercolorValidator, self).__init__(
plot... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@xaxis@rangeselector@_bordercolor.py@.PATH_END.py |
{
"filename": "doc_model_savemodelresult.py",
"repo_name": "lmfit/lmfit-py",
"repo_path": "lmfit-py_extracted/lmfit-py-master/examples/doc_model_savemodelresult.py",
"type": "Python"
} | # <examples/doc_model_savemodelresult.py>
import numpy as np
from lmfit.model import save_modelresult
from lmfit.models import GaussianModel
data = np.loadtxt('model1d_gauss.dat')
x = data[:, 0]
y = data[:, 1]
gmodel = GaussianModel()
result = gmodel.fit(y, x=x, amplitude=5, center=5, sigma=1)
save_modelresult(resu... | lmfitREPO_NAMElmfit-pyPATH_START.@lmfit-py_extracted@lmfit-py-master@examples@doc_model_savemodelresult.py@.PATH_END.py |
{
"filename": "fp.py",
"repo_name": "ChrisBeaumont/brut",
"repo_path": "brut_extracted/brut-master/figures/fp.py",
"type": "Python"
} | import json
import numpy as np
import matplotlib.pyplot as plt
from bubbly.extractors import RGBExtractor
from bubbly.dr1 import bubble_params
def hide_axes():
plt.gca().get_xaxis().set_visible(False)
plt.gca().get_yaxis().set_visible(False)
def ex(params):
rgb = RGBExtractor()
rgb.shp = (100, 100)
... | ChrisBeaumontREPO_NAMEbrutPATH_START.@brut_extracted@brut-master@figures@fp.py@.PATH_END.py |
{
"filename": "test_stringdtype.py",
"repo_name": "numpy/numpy",
"repo_path": "numpy_extracted/numpy-main/numpy/_core/tests/test_stringdtype.py",
"type": "Python"
} | import concurrent.futures
import itertools
import os
import pickle
import string
import sys
import tempfile
import numpy as np
import pytest
from numpy.dtypes import StringDType
from numpy._core.tests._natype import pd_NA
from numpy.testing import assert_array_equal, IS_WASM, IS_PYPY
@pytest.fixture
def string_list... | numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@numpy@_core@tests@test_stringdtype.py@.PATH_END.py |
{
"filename": "CODE_OF_CONDUCT.md",
"repo_name": "rhayes777/PyAutoFit",
"repo_path": "PyAutoFit_extracted/PyAutoFit-main/CODE_OF_CONDUCT.md",
"type": "Markdown"
} | # PyAutoFit Code of Conduct
**Table of Contents**
- [The Short Version](#the-short-version)
- [The Longer Version](#the-longer-version)
- [PyAutoFit Diversity Statement](#project-diversity-statement)
- [PyAutoFit Code of Conduct: Introduction & Scope](#project-code-of-conduct-introduction--scope)
- [Standards f... | rhayes777REPO_NAMEPyAutoFitPATH_START.@PyAutoFit_extracted@PyAutoFit-main@CODE_OF_CONDUCT.md@.PATH_END.py |
{
"filename": "thermo.ipynb",
"repo_name": "wlxu/RelicClass",
"repo_path": "RelicClass_extracted/RelicClass-master/notebooks/thermo.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
from scipy.interpolate import interp1d
import math
```
```python
# esthetic definitions... | wlxuREPO_NAMERelicClassPATH_START.@RelicClass_extracted@RelicClass-master@notebooks@thermo.ipynb@.PATH_END.py |
{
"filename": "dada_trigger.py",
"repo_name": "loostrum/darc",
"repo_path": "darc_extracted/darc-master/darc/dada_trigger.py",
"type": "Python"
} | #!/usr/bin/env python3
#
# dada_dbevent triggers
import os
import threading
import socket
import numpy as np
from astropy.time import Time, TimeDelta
from darc import DARCBase
from darc import util
from darc.definitions import TIME_UNIT
class DADATriggerException(Exception):
pass
class DADATrigger(DARCBase):... | loostrumREPO_NAMEdarcPATH_START.@darc_extracted@darc-master@darc@dada_trigger.py@.PATH_END.py |
{
"filename": "mobilenetv2.py",
"repo_name": "pytorch/vision",
"repo_path": "vision_extracted/vision-main/torchvision/models/mobilenetv2.py",
"type": "Python"
} | from functools import partial
from typing import Any, Callable, List, Optional
import torch
from torch import nn, Tensor
from ..ops.misc import Conv2dNormActivation
from ..transforms._presets import ImageClassification
from ..utils import _log_api_usage_once
from ._api import register_model, Weights, WeightsEnum
from... | pytorchREPO_NAMEvisionPATH_START.@vision_extracted@vision-main@torchvision@models@mobilenetv2.py@.PATH_END.py |
{
"filename": "let.py",
"repo_name": "spedas/pyspedas",
"repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/stereo/let.py",
"type": "Python"
} | from .load import load
# This routine was originally in stereo/__init__.py, until being moved to its own file.
# Please refer to __init__.py if you need to see the revision history before it was moved.
def let(trange=['2013-11-5', '2013-11-6'],
probe='a',
level='l1',
suffix='',
prefix=... | spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@stereo@let.py@.PATH_END.py |
{
"filename": "_y.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/isosurface/caps/_y.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Y(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "isosurface.caps"
_path_str = "isosurface.caps.y"
_valid_props = {"fill", "show"}
# fill
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@isosurface@caps@_y.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/tools/python3/Lib/sqlite3/__init__.py",
"type": "Python"
} | # pysqlite2/__init__.py: the pysqlite2 package.
#
# Copyright (C) 2005 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@python3@Lib@sqlite3@__init__.py@.PATH_END.py |
{
"filename": "calculate_sensitivity_from_Crab.ipynb",
"repo_name": "cta-observatory/cta-lstchain",
"repo_path": "cta-lstchain_extracted/cta-lstchain-main/notebooks/calculate_sensitivity_from_Crab.ipynb",
"type": "Jupyter Notebook"
} | ```python
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib as mpl
import numpy as np
import glob
import astropy.units as u
import tables
import gc
import time
from astropy.coordinates import SkyCoord, AltAz
from astropy.coordinates.erfa_astrom import ErfaAstromInterpolator, erfa_ast... | cta-observatoryREPO_NAMEcta-lstchainPATH_START.@cta-lstchain_extracted@cta-lstchain-main@notebooks@calculate_sensitivity_from_Crab.ipynb@.PATH_END.py |
{
"filename": "computeOccurrenceUncertainty-checkpoint.ipynb",
"repo_name": "stevepur/DR25-occurrence-public",
"repo_path": "DR25-occurrence-public_extracted/DR25-occurrence-public-main/GKbaseline/.ipynb_checkpoints/computeOccurrenceUncertainty-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | ```python
import os
import requests
import pandas as pd
from astropy.io import fits
from cStringIO import StringIO
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import gamma
from scipy.optimize import minimize
from scipy.interpolate import RectBivariateSpline
import emcee
import corner
import scip... | stevepurREPO_NAMEDR25-occurrence-publicPATH_START.@DR25-occurrence-public_extracted@DR25-occurrence-public-main@GKbaseline@.ipynb_checkpoints@computeOccurrenceUncertainty-checkpoint.ipynb@.PATH_END.py |
{
"filename": "LOFAR_preprocess.py",
"repo_name": "revoltek/LiLF",
"repo_path": "LiLF_extracted/LiLF-master/pipelines/LOFAR_preprocess.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys, os, re, glob, time
import numpy as np
import casacore.tables as pt
from astropy.time import Time
##########################################
from LiLF import lib_ms, lib_util, lib_log
logger_obj = lib_log.Logger('pipeline-preprocess')
logger = lib_log.logger
s... | revoltekREPO_NAMELiLFPATH_START.@LiLF_extracted@LiLF-master@pipelines@LOFAR_preprocess.py@.PATH_END.py |
{
"filename": "constants.py",
"repo_name": "Mauropieroni/GW_response",
"repo_path": "GW_response_extracted/GW_response-main/gw_response/constants.py",
"type": "Python"
} | import jax
import jax.numpy as jnp
import chex
from dataclasses import field
jax.config.update("jax_enable_x64", True)
@chex.dataclass(frozen=True)
class PhysicalConstants:
"""
A data class for storing physical constants used in unit conversions within
astronomical computations.
This class provides ... | MauropieroniREPO_NAMEGW_responsePATH_START.@GW_response_extracted@GW_response-main@gw_response@constants.py@.PATH_END.py |
{
"filename": "avalanche.py",
"repo_name": "anastasia-tsvetkova/lc_pulse_avalanche",
"repo_path": "lc_pulse_avalanche_extracted/lc_pulse_avalanche-master/lc_pulse_avalanche/avalanche.py",
"type": "Python"
} | import inspect
import sys
import math
from math import exp, log
import matplotlib.pyplot as plt
import numpy as np
from numpy.random import exponential, lognormal, normal, uniform
from scipy.stats import loguniform
import os, h5py
class LC(object):
"""
A class to generate gamma-ray burst light curves (GRB LCs... | anastasia-tsvetkovaREPO_NAMElc_pulse_avalanchePATH_START.@lc_pulse_avalanche_extracted@lc_pulse_avalanche-master@lc_pulse_avalanche@avalanche.py@.PATH_END.py |
{
"filename": "interpcc.py",
"repo_name": "mpeel/fastcc",
"repo_path": "fastcc_extracted/fastcc-master/interpcc.py",
"type": "Python"
} | # 2021-03-9
# 2021-03-10 CLC I start a new code to compute all cases.
# 2021-03-11 MP Reformat into functions
# 2021-03-16 MP Add IRAS, Planck HFIs
# 2021-03-18 MP If using Planck, halve the array to reduce CPU time
# 2021-03-19 MP Add regular grid interpolation to speed things up
import numpy as np
from a... | mpeelREPO_NAMEfastccPATH_START.@fastcc_extracted@fastcc-master@interpcc.py@.PATH_END.py |
{
"filename": "adopt.py",
"repo_name": "OpenAccess-AI-Collective/axolotl",
"repo_path": "axolotl_extracted/axolotl-main/src/axolotl/utils/optimizers/adopt.py",
"type": "Python"
} | """
Copied from https://github.com/iShohei220/adopt
ADOPT: Modified Adam Can Converge with Any β2 with the Optimal Rate (2024)
Taniguchi, Shohei and Harada, Keno and Minegishi, Gouki and Oshima, Yuta and Jeong, Seong Cheol and Nagahara, Go and Iiyama, Tomoshi and Suzuki, Masahiro and Iwasawa, Yusuke and Matsuo, Yutaka... | OpenAccess-AI-CollectiveREPO_NAMEaxolotlPATH_START.@axolotl_extracted@axolotl-main@src@axolotl@utils@optimizers@adopt.py@.PATH_END.py |
{
"filename": "_sizemode.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattergl/marker/_sizemode.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizemodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="sizemode", parent_name="scattergl.marker", **kwargs
):
super(SizemodeValidator, self).__init__(
plotly_name=plotly_name,
paren... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattergl@marker@_sizemode.py@.PATH_END.py |
{
"filename": "_size.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/ohlc/hoverlabel/font/_size.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="size", parent_name="ohlc.hoverlabel.font", **kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=paren... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@ohlc@hoverlabel@font@_size.py@.PATH_END.py |
{
"filename": "script_example_constaining_line_ratios.ipynb",
"repo_name": "thomasorb/orcs",
"repo_path": "orcs_extracted/orcs-master/docs/_build/html/script_example_constaining_line_ratios.ipynb",
"type": "Jupyter Notebook"
} | # Constraining line ratios
Some line doublets (e.g. [NII]6548,6583, [OIII]4959,5007) have known line ratios which then should be constrained to inject more information and optimize the unceratinty on the best fit parameters by minimizing the number of free parameters (especially if the SNR is low and if small variatio... | thomasorbREPO_NAMEorcsPATH_START.@orcs_extracted@orcs-master@docs@_build@html@script_example_constaining_line_ratios.ipynb@.PATH_END.py |
{
"filename": "LogTestComponent.py",
"repo_name": "ACS-Community/ACS",
"repo_path": "ACS_extracted/ACS-master/Benchmark/components/src/perftestImpl/LogTestComponent.py",
"type": "Python"
} | #*******************************************************************************
# ALMA - Atacama Large Millimiter Array
# (c) Associated Universities Inc., 2002
# (c) European Southern Observatory, 2002
# Copyright by ESO (in the framework of the ALMA collaboration)
# and Cosylab 2002, All rights reserved
#
# This li... | ACS-CommunityREPO_NAMEACSPATH_START.@ACS_extracted@ACS-master@Benchmark@components@src@perftestImpl@LogTestComponent.py@.PATH_END.py |
{
"filename": "hexbin_marginals.py",
"repo_name": "mwaskom/seaborn",
"repo_path": "seaborn_extracted/seaborn-master/examples/hexbin_marginals.py",
"type": "Python"
} | """
Hexbin plot with marginal distributions
=======================================
_thumb: .45, .4
"""
import numpy as np
import seaborn as sns
sns.set_theme(style="ticks")
rs = np.random.RandomState(11)
x = rs.gamma(2, size=1000)
y = -.5 * x + rs.normal(size=1000)
sns.jointplot(x=x, y=y, kind="hex", color="#4CB391... | mwaskomREPO_NAMEseabornPATH_START.@seaborn_extracted@seaborn-master@examples@hexbin_marginals.py@.PATH_END.py |
{
"filename": "test_enterprise_extensions.py",
"repo_name": "nanograv/enterprise_extensions",
"repo_path": "enterprise_extensions_extracted/enterprise_extensions-master/tests/test_enterprise_extensions.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `enterprise_extensions` package."""
import pytest
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
"""
# import requests
# return requests.get('https://github.com/audrey... | nanogravREPO_NAMEenterprise_extensionsPATH_START.@enterprise_extensions_extracted@enterprise_extensions-master@tests@test_enterprise_extensions.py@.PATH_END.py |
{
"filename": "arbor.py",
"repo_name": "ytree-project/ytree",
"repo_path": "ytree_extracted/ytree-main/ytree/frontends/lhalotree/arbor.py",
"type": "Python"
} | """
LHaloTreeArbor class and member functions
"""
#-----------------------------------------------------------------------------
# Copyright (c) ytree development team. All rights reserved.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with... | ytree-projectREPO_NAMEytreePATH_START.@ytree_extracted@ytree-main@ytree@frontends@lhalotree@arbor.py@.PATH_END.py |
{
"filename": "blending.py",
"repo_name": "danielacarrasco/GLACiAR",
"repo_path": "GLACiAR_extracted/GLACiAR-master/blending.py",
"type": "Python"
} | import numpy as np
import pickle
import dropouts
import os
from astropy.io import fits
def main(path_to_cat, niter, detection_band, cat, m1, redshift, xpos, ypos,
xpos_oc, ypos_oc, segm_science, m_oc, f_oc, id_oc, input_mag, zp,
bands, min_sn, dp, fw, fw2):
"""
Uses the information from the ... | danielacarrascoREPO_NAMEGLACiARPATH_START.@GLACiAR_extracted@GLACiAR-master@blending.py@.PATH_END.py |
{
"filename": "embedding_in_wx5_sgskip.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/galleries/examples/user_interfaces/embedding_in_wx5_sgskip.py",
"type": "Python"
} | """
==============
Embed in wx #5
==============
"""
import wx
import wx.lib.agw.aui as aui
import wx.lib.mixins.inspection as wit
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wxagg import \
NavigationToolbar2WxAgg as NavigationToolbar
from matp... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@galleries@examples@user_interfaces@embedding_in_wx5_sgskip.py@.PATH_END.py |
{
"filename": "one_time.py",
"repo_name": "misharash/class_public",
"repo_path": "class_public_extracted/class_public-master/scripts/one_time.py",
"type": "Python"
} |
# coding: utf-8
# In[1]:
# import necessary modules
# uncomment to get plots displayed in notebook
#%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from classy import Class
from scipy.optimize import fsolve
from scipy.interpolate import interp1d
import math
# In[2]:
# esthe... | misharashREPO_NAMEclass_publicPATH_START.@class_public_extracted@class_public-master@scripts@one_time.py@.PATH_END.py |
{
"filename": "_variantsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/sankey/link/hoverlabel/font/_variantsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="variantsrc",
parent_name="sankey.link.hoverlabel.font",
**kwargs,
):
super(VariantsrcValidator, self).__init__(
plotly_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@sankey@link@hoverlabel@font@_variantsrc.py@.PATH_END.py |
{
"filename": "doctest.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/tools/python3/Lib/doctest.py",
"type": "Python"
} | # Module doctest.
# Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org).
# Major enhancements and refactoring by:
# Jim Fulton
# Edward Loper
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
r"""Module doctest -- a framework for running examples in docstrings.
In... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@python3@Lib@doctest.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "brinckmann/montepython_public",
"repo_path": "montepython_public_extracted/montepython_public-master/montepython/likelihoods/polarbear/__init__.py",
"type": "Python"
} | import os
from math import pi
import numpy as np
from montepython.likelihood_class import Likelihood
class polarbear(Likelihood):
def __init__(self, path, data, command_line):
Likelihood.__init__(self, path, data, command_line)
# Read the four data points from the bandpower file
self.ba... | brinckmannREPO_NAMEmontepython_publicPATH_START.@montepython_public_extracted@montepython_public-master@montepython@likelihoods@polarbear@__init__.py@.PATH_END.py |
{
"filename": "GalaxiesFaintStars.py",
"repo_name": "dsavransky/EXOSIMS",
"repo_path": "EXOSIMS_extracted/EXOSIMS-master/EXOSIMS/BackgroundSources/GalaxiesFaintStars.py",
"type": "Python"
} | from EXOSIMS.Prototypes.BackgroundSources import BackgroundSources
import os
import inspect
import numpy as np
import astropy.units as u
from scipy.interpolate import griddata
from EXOSIMS.util._numpy_compat import copy_if_needed
class GalaxiesFaintStars(BackgroundSources):
"""
GalaxiesFaintStars class
T... | dsavranskyREPO_NAMEEXOSIMSPATH_START.@EXOSIMS_extracted@EXOSIMS-master@EXOSIMS@BackgroundSources@GalaxiesFaintStars.py@.PATH_END.py |
{
"filename": "magnitude_to_radius.py",
"repo_name": "sarahbrands/Kiwi-GA",
"repo_path": "Kiwi-GA_extracted/Kiwi-GA-master/magnitude_to_radius.py",
"type": "Python"
} | # Estimate the stellar radius given an effective temperature
# and magnitude. Requires filter transmissions and zero points.
# Created by Sarah Brands on 20 Dec 2019 (s.a.brands@uva.nl)
import __future__
import numpy as np
import sys
from scipy.interpolate import interp1d
def magnitude_to_radius(teff, band, obsmag, ... | sarahbrandsREPO_NAMEKiwi-GAPATH_START.@Kiwi-GA_extracted@Kiwi-GA-master@magnitude_to_radius.py@.PATH_END.py |
{
"filename": "generator_data_adapter.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/trainers/data_adapters/generator_data_adapter.py",
"type": "Python"
} | import itertools
from keras.src import tree
from keras.src.trainers.data_adapters import data_adapter_utils
from keras.src.trainers.data_adapters.data_adapter import DataAdapter
class GeneratorDataAdapter(DataAdapter):
"""Adapter for Python generators."""
def __init__(self, generator):
first_batches... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@trainers@data_adapters@generator_data_adapter.py@.PATH_END.py |
{
"filename": "crackfortran.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/numpy/py3/numpy/f2py/crackfortran.py",
"type": "Python"
} | #!/usr/bin/env python3
"""
crackfortran --- read fortran (77,90) code and extract declaration information.
Copyright 1999 -- 2011 Pearu Peterson all rights reserved.
Copyright 2011 -- present NumPy Developers.
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WA... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@numpy@py3@numpy@f2py@crackfortran.py@.PATH_END.py |
{
"filename": "cmd_train.py",
"repo_name": "i4Ds/sdo-cli",
"repo_path": "sdo-cli_extracted/sdo-cli-main/src/sdo/cmd/sood/ae/cmd_train.py",
"type": "Python"
} | from sdo.cli import pass_environment
from sdo.sood.algorithms.ae_2d import main
import click
@click.command("train", short_help="Trains an AE model")
@click.option("--target-size", type=click.IntRange(1, 512, clamp=True), default=128)
@click.option("--batch-size", type=click.IntRange(1, 512, clamp=True), default=16)... | i4DsREPO_NAMEsdo-cliPATH_START.@sdo-cli_extracted@sdo-cli-main@src@sdo@cmd@sood@ae@cmd_train.py@.PATH_END.py |
{
"filename": "atlas.py",
"repo_name": "snad-space/ztf-viewer",
"repo_path": "ztf-viewer_extracted/ztf-viewer-master/ztf_viewer/catalogs/conesearch/atlas.py",
"type": "Python"
} | from ztf_viewer.catalogs.conesearch._base import _BaseVizierQuery
class AtlasQuery(_BaseVizierQuery):
id_column = "ATOID"
type_column = "Class"
period_column = "fp-LSper"
columns = {
"__link": "Name",
"separation": "Separation, arcsec",
"fp-LSper": "Period, days",
"Clas... | snad-spaceREPO_NAMEztf-viewerPATH_START.@ztf-viewer_extracted@ztf-viewer-master@ztf_viewer@catalogs@conesearch@atlas.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/prefect/workers/__init__.py",
"type": "Python"
} | from .process import ProcessWorker
| PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@workers@__init__.py@.PATH_END.py |
{
"filename": "test_neo4j.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/unit_tests/vectorstores/test_neo4j.py",
"type": "Python"
} | """Test Neo4j functionality."""
from langchain_community.vectorstores.neo4j_vector import (
dict_to_yaml_str,
remove_lucene_chars,
)
def test_escaping_lucene() -> None:
"""Test escaping lucene characters"""
assert remove_lucene_chars("Hello+World") == "Hello World"
assert remove_lucene_chars("Hel... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@unit_tests@vectorstores@test_neo4j.py@.PATH_END.py |
{
"filename": "multitrace.py",
"repo_name": "ricardoclandim/NIRVANA",
"repo_path": "NIRVANA_extracted/NIRVANA-master/nirvana/models/multitrace.py",
"type": "Python"
} | """
Module with a class that fits multiple tracers to a single disk.
.. include common links, assuming primary doc root is up one directory
.. include:: ../include/links.rst
"""
import warnings
from IPython import embed
import numpy as np
from scipy import optimize
from matplotlib import pyplot, rc, patches, ticker... | ricardoclandimREPO_NAMENIRVANAPATH_START.@NIRVANA_extracted@NIRVANA-master@nirvana@models@multitrace.py@.PATH_END.py |
{
"filename": "fits.py",
"repo_name": "vortex-exoplanet/VIP",
"repo_path": "VIP_extracted/VIP-master/vip_hci/fits/fits.py",
"type": "Python"
} | #! /usr/bin/env python
"""
Module with various fits handling functions.
"""
__author__ = "C. A. Gomez Gonzalez, T. Bédrine, V. Christiaens, I. Hammond"
__all__ = ["open_fits", "info_fits", "write_fits", "verify_fits",
"byteswap_array"]
from os.path import isfile, exists
from os import remove
import nump... | vortex-exoplanetREPO_NAMEVIPPATH_START.@VIP_extracted@VIP-master@vip_hci@fits@fits.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "spacetelescope/calcos",
"repo_path": "calcos_extracted/calcos-master/setup.py",
"type": "Python"
} | #!/usr/bin/env python
from setuptools import setup, Extension
from numpy import get_include as numpy_includes
from pathlib import Path
def c_sources(parent: str) -> list[str]:
return [str(filename) for filename in Path(parent).glob("*.c")]
def c_includes(parent: str, depth: int = 1):
return [
paren... | spacetelescopeREPO_NAMEcalcosPATH_START.@calcos_extracted@calcos-master@setup.py@.PATH_END.py |
{
"filename": "text_dataset_utils_test.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/utils/text_dataset_utils_test.py",
"type": "Python"
} | import os
import random
import string
from keras.src import testing
from keras.src.utils import text_dataset_utils
class TextDatasetFromDirectoryTest(testing.TestCase):
def _prepare_directory(
self, num_classes=2, nested_dirs=False, count=16, length=20
):
# Get a unique temp directory
... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@utils@text_dataset_utils_test.py@.PATH_END.py |
{
"filename": "_showcoastlines.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/geo/_showcoastlines.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowcoastlinesValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="showcoastlines", parent_name="layout.geo", **kwargs
):
super(ShowcoastlinesValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@geo@_showcoastlines.py@.PATH_END.py |
{
"filename": "_colorssrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/pie/marker/_colorssrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorssrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="colorssrc", parent_name="pie.marker", **kwargs):
super(ColorssrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@pie@marker@_colorssrc.py@.PATH_END.py |
{
"filename": "test_simulator.py",
"repo_name": "peregrine-gw/saqqara",
"repo_path": "saqqara_extracted/saqqara-main/testing/test_simulator.py",
"type": "Python"
} | import unittest
import saqqara
import os
import numpy as np
import swyft
TEST_DATA_PATH = os.path.join(os.path.dirname(__file__), "test_data/")
class TestSimulator(unittest.TestCase):
def test_simulator(self):
config_path = (
os.path.join(os.path.dirname(saqqara.__file__), "defaults")
... | peregrine-gwREPO_NAMEsaqqaraPATH_START.@saqqara_extracted@saqqara-main@testing@test_simulator.py@.PATH_END.py |
{
"filename": "red_blue.py",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/emcee_ES/moves/red_blue.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
import numpy as np
from ..state import State
from .move import Move
__all__ = ["RedBlueMove"]
class RedBlueMove(Move):
"""
An abstract red-blue ensemble move with parallelization as described in
`Foreman-Mackey et al. (2013) <https://arxiv.org/abs/1202.3665>`_.
Args:
... | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@emcee_ES@moves@red_blue.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "kbarbary/extinction",
"repo_path": "extinction_extracted/extinction-main/testdata/README.md",
"type": "Markdown"
} | Test data
---------
This directory contains comparison files used in the tests.
These outputs from running the IDL procedure `FM_UNRED` from the
IDL Astro library: http://idlastro.gsfc.nasa.gov/ftp/pro/astro/
(`FM_UNRED` also requires the `CSPLINE` procedure.)
The script used to generate the output is included here.
| kbarbaryREPO_NAMEextinctionPATH_START.@extinction_extracted@extinction-main@testdata@README.md@.PATH_END.py |
{
"filename": "var_exts_framework.py",
"repo_name": "Keck-DataReductionPipelines/KPF-Pipeline",
"repo_path": "KPF-Pipeline_extracted/KPF-Pipeline-master/modules/var_exts/src/var_exts_framework.py",
"type": "Python"
} | import os
from os.path import exists
import numpy as np
import configparser as cp
import psycopg2
import ast
# Pipeline dependencies
from kpfpipe.logger import *
from kpfpipe.models.level0 import KPF0
from kpfpipe.primitives.level0 import KPF0_Primitive
from kpfpipe.pipelines.fits_primitives import to_fits
from keckdr... | Keck-DataReductionPipelinesREPO_NAMEKPF-PipelinePATH_START.@KPF-Pipeline_extracted@KPF-Pipeline-master@modules@var_exts@src@var_exts_framework.py@.PATH_END.py |
{
"filename": "wenss.py",
"repo_name": "HERA-Team/aipy",
"repo_path": "aipy_extracted/aipy-main/aipy/_src/wenss.py",
"type": "Python"
} | """
The WENSS Catalog.
Data files are in tab-separated format from Vizier.
To download in the correct format, open a catalog online in Vizier,
select'Tab-Separated-Values' as the Output layout in the drop-down box, set
the maximum entries to 'unlimited', and click 'Sexagesimal' under the box
for 'Target Name or Positi... | HERA-TeamREPO_NAMEaipyPATH_START.@aipy_extracted@aipy-main@aipy@_src@wenss.py@.PATH_END.py |
{
"filename": "llamacpp.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/embeddings/llamacpp.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.embeddings import LlamaCppEmbeddings
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@embeddings@llamacpp.py@.PATH_END.py |
{
"filename": "ReadParamsReaclib.py",
"repo_name": "mmicromegas/ransX",
"repo_path": "ransX_extracted/ransX-master/UTILS/REACLIB/ReadParamsReaclib.py",
"type": "Python"
} | import re # python regular expressions
class ReadParamsReaclib:
def __init__(self, filename):
file = open(filename, 'r')
next(file) # skip header line
next(file) # skip header line
input = []
for line in file:
prsvalue = re.search(r'\[(.*)\]', line).group(... | mmicromegasREPO_NAMEransXPATH_START.@ransX_extracted@ransX-master@UTILS@REACLIB@ReadParamsReaclib.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/densitymapbox/colorbar/title/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._text import TextValidator
from ._side import SideValidator
from ._font import FontValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@densitymapbox@colorbar@title@__init__.py@.PATH_END.py |
{
"filename": "_tstutils.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/optimize/_tstutils.py",
"type": "Python"
} | r"""
Parameters used in test and benchmark methods.
Collections of test cases suitable for testing 1-D root-finders
'original': The original benchmarking functions.
Real-valued functions of real-valued inputs on an interval
with a zero.
f1, .., f3 are continuous and infinitely differentiable
f4 h... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@optimize@_tstutils.py@.PATH_END.py |
{
"filename": "cosmology_library.py",
"repo_name": "franciscovillaescusa/Pylians",
"repo_path": "Pylians_extracted/Pylians-master/library/cosmology_library.py",
"type": "Python"
} | import numpy as np
import scipy.integrate as si
import sys,os,time
#################### FUNCTIONS USED TO COMPUTE INTEGRALS #####################
#we use this function to compute the comoving distance to a given redshift
def func(y,x,Omega_m,Omega_L):
return [1.0/np.sqrt(Omega_m*(1.0+x)**3+Omega_L)]
#############... | franciscovillaescusaREPO_NAMEPyliansPATH_START.@Pylians_extracted@Pylians-master@library@cosmology_library.py@.PATH_END.py |
{
"filename": "basic_ui.py",
"repo_name": "sherpa/sherpa",
"repo_path": "sherpa_extracted/sherpa-main/docs/_examples/ui/basic_ui.py",
"type": "Python"
} | from sherpa.ui import *
x = [100, 200, 300, 400]
y = [10, 12, 9, 13]
load_arrays(1, x, y)
print("# list_data_ids")
print(list_data_ids())
print("# get_data()")
print(repr(get_data()))
print("# get_data()")
print(get_data())
print("# get_stat_name/get_method_name")
print(get_stat_name())
print(get_method_name())
... | sherpaREPO_NAMEsherpaPATH_START.@sherpa_extracted@sherpa-main@docs@_examples@ui@basic_ui.py@.PATH_END.py |
{
"filename": "Sim1-multisim.ipynb",
"repo_name": "abhisrkckl/pint-noise",
"repo_path": "pint-noise_extracted/pint-noise-main/sim1-efac-equad/Sim1-multisim.ipynb",
"type": "Jupyter Notebook"
} | ```python
from pint.models import get_model
from pint.simulation import make_fake_toas_fromtim
from pint.logging import setup as setup_log
from pint.fitter import Fitter
from io import StringIO
import numpy as np
import astropy.units as u
import matplotlib.pyplot as plt
import corner
from joblib import delayed, Paral... | abhisrkcklREPO_NAMEpint-noisePATH_START.@pint-noise_extracted@pint-noise-main@sim1-efac-equad@Sim1-multisim.ipynb@.PATH_END.py |
{
"filename": "plot_triangle_planck.py",
"repo_name": "philbull/RadioFisher",
"repo_path": "RadioFisher_extracted/RadioFisher-master/plotting/plot_triangle_planck.py",
"type": "Python"
} | #!/usr/bin/python
"""
Make a triangle plot for a set of parameters.
"""
import numpy as np
import pylab as P
from rfwrapper import rf
import matplotlib.patches
import matplotlib.cm
import matplotlib.ticker
from units import *
from mpi4py import MPI
import os
import euclid
print "Obsolete."
exit()
USE_DETF_PLANCK_PRI... | philbullREPO_NAMERadioFisherPATH_START.@RadioFisher_extracted@RadioFisher-master@plotting@plot_triangle_planck.py@.PATH_END.py |
{
"filename": "_len.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/splom/marker/colorbar/_len.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="len", parent_name="splom.marker.colorbar", **kwargs
):
super(LenValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@splom@marker@colorbar@_len.py@.PATH_END.py |
{
"filename": "test_return_character.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/numpy/f2py/tests/test_return_character.py",
"type": "Python"
} | from __future__ import division, absolute_import, print_function
from numpy import array
from numpy.testing import run_module_suite, assert_, dec
from . import util
class TestReturnCharacter(util.F2PyTest):
def check_function(self, t):
tname = t.__doc__.split()[0]
if tname in ['t0', 't1', 's0', ... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@numpy@f2py@tests@test_return_character.py@.PATH_END.py |
{
"filename": "_unselected.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/scattermapbox/_unselected.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Unselected(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scattermapbox"
_path_str = "scattermapbox.unselected"
_valid_props = {"marker"}
# m... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@scattermapbox@_unselected.py@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/scatter3d/legendgrouptitle/_font.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatter3d.legendgrouptitle"
_path_str = "scatter3d.legendgrouptitle.font"
_valid_props = {
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@scatter3d@legendgrouptitle@_font.py@.PATH_END.py |
{
"filename": "test_ndcubesequence.py",
"repo_name": "sunpy/ndcube",
"repo_path": "ndcube_extracted/ndcube-main/ndcube/tests/test_ndcubesequence.py",
"type": "Python"
} |
import numpy as np
import pytest
import astropy.units as u
from astropy.time import Time, TimeDelta
from ndcube import NDCube, NDCubeSequence
from ndcube.tests import helpers
def derive_sliced_cube_dims(orig_cube_dims, tuple_item):
expected_cube_dims = list(orig_cube_dims)
len_cube_item = len(tuple_item) -... | sunpyREPO_NAMEndcubePATH_START.@ndcube_extracted@ndcube-main@ndcube@tests@test_ndcubesequence.py@.PATH_END.py |
{
"filename": "_name.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/xaxis/rangebreak/_name.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="name", parent_name="layout.xaxis.rangebreak", **kwargs
):
super(NameValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@xaxis@rangebreak@_name.py@.PATH_END.py |
{
"filename": "01_train_transferlearning_zoo1-checkpoint.ipynb",
"repo_name": "hfarias/mask_galaxy",
"repo_path": "mask_galaxy_extracted/mask_galaxy-master/redes/two_class_zoo1/.ipynb_checkpoints/01_train_transferlearning_zoo1-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | ```python
import os
import sys
import random
import math
import re
import time
import numpy as np
import cv2
import matplotlib
import matplotlib.pyplot as plt
# Root directory of the project
ROOT_DIR = os.path.abspath("../../")
# Import Mask RCNN
sys.path.append(ROOT_DIR) # To find local version of the library
from ... | hfariasREPO_NAMEmask_galaxyPATH_START.@mask_galaxy_extracted@mask_galaxy-master@redes@two_class_zoo1@.ipynb_checkpoints@01_train_transferlearning_zoo1-checkpoint.ipynb@.PATH_END.py |
{
"filename": "constants.py",
"repo_name": "janosch314/GWFish",
"repo_path": "GWFish_extracted/GWFish-main/GWFish/modules/constants.py",
"type": "Python"
} | import numpy as np
Mpc = 3.086e22
Msol = 1.9885e30
R_earth = 6.37e6
AU = 1.5e11
sidereal_day = 23.9344696
lunar_sidereal_period = 655.7198333
ecliptic = 23.45 * np.pi / 180.
c = 299792458.
G = 6.674e-11
h = 6.626e-34 | janosch314REPO_NAMEGWFishPATH_START.@GWFish_extracted@GWFish-main@GWFish@modules@constants.py@.PATH_END.py |
{
"filename": "e1_envs.py",
"repo_name": "mit-ll/spacegym-kspdg",
"repo_path": "spacegym-kspdg_extracted/spacegym-kspdg-main/src/kspdg/pe1/e1_envs.py",
"type": "Python"
} | # Copyright (c) 2024, MASSACHUSETTS INSTITUTE OF TECHNOLOGY
# Subject to FAR 52.227-11 – Patent Rights – Ownership by the Contractor (May 2014).
# SPDX-License-Identifier: MIT
from kspdg.pe1.pe1_base import PursuitEvadeGroup1Env
class PE1_E1_ParentEnv(PursuitEvadeGroup1Env):
def __init__(self, loadfile: str, **kw... | mit-llREPO_NAMEspacegym-kspdgPATH_START.@spacegym-kspdg_extracted@spacegym-kspdg-main@src@kspdg@pe1@e1_envs.py@.PATH_END.py |
{
"filename": "readmultispec.py",
"repo_name": "mzechmeister/viper",
"repo_path": "viper_extracted/viper-master/inst/readmultispec.py",
"type": "Python"
} | # Licensed under a GPLv3 style license - see LICENSE
"""readmultispec.py
Read IRAF (echelle) spectrum in multispec format from a FITS file.
Can read most multispec formats including linear, log, cubic spline,
Chebyshev or Legendre dispersion spectra.
Usage: retdict = readmultispec(fitsfile, reform=True)
Inputs:
fi... | mzechmeisterREPO_NAMEviperPATH_START.@viper_extracted@viper-master@inst@readmultispec.py@.PATH_END.py |
{
"filename": "compile_java.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/build/scripts/compile_java.py",
"type": "Python"
} | import argparse
import contextlib
from shutil import copytree
import os
import shutil
import subprocess as sp
import tarfile
import zipfile
import sys
# Explicitly enable local imports
# Don't forget to add imported scripts to inputs of the calling command!
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
i... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@build@scripts@compile_java.py@.PATH_END.py |
{
"filename": "logger.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/ipython/py3/IPython/core/logger.py",
"type": "Python"
} | """Logger class for IPython's logging facilities.
"""
#*****************************************************************************
# Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
# Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
#
# Distributed under the terms of the BSD License. ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipython@py3@IPython@core@logger.py@.PATH_END.py |
{
"filename": "create_time_con.py",
"repo_name": "shengjin/Nii",
"repo_path": "Nii_extracted/Nii-main/create_time_con.py",
"type": "Python"
} | import numpy as np
from inputsimobs import *
##########################
# observation time sequrence in days
# drop save random part
time_con0 = np.linspace(t0,t1,int(N_time_init))
#
seg_rand_min = 0.5
seg_rand_max = 1.5
fill_rand_min = 0.2
fill_rand_max = 1.8
def create_time_seg():
N_miss_seg = np.random.randint... | shengjinREPO_NAMENiiPATH_START.@Nii_extracted@Nii-main@create_time_con.py@.PATH_END.py |
{
"filename": "imred.py",
"repo_name": "saltastro/polsalt",
"repo_path": "polsalt_extracted/polsalt-master/polsalt/imred.py",
"type": "Python"
} |
"""
IMRED
Reduction script for SALT data -- this is
for science level reductions with variance frames
This includes step that are not yet included in the pipeline
and can be used for extended reductions of SALT data.
It does require the pysalt package to be installed
and up to date.
"""
# polSALT: fix Pfits w... | saltastroREPO_NAMEpolsaltPATH_START.@polsalt_extracted@polsalt-master@polsalt@imred.py@.PATH_END.py |
{
"filename": "toastit.py",
"repo_name": "plazar/TOASTER",
"repo_path": "TOASTER_extracted/TOASTER-master/toastit.py",
"type": "Python"
} | #!/usr/bin/env python
""" The data reduction pipeline. This script will archive files,
register file-info into the database, reduce data, and store
TOAs and processing information into the DB.
"""
import copy
import sys
import os
import os.path
import warnings
import tempfile
import shutil
import traceback
imp... | plazarREPO_NAMETOASTERPATH_START.@TOASTER_extracted@TOASTER-master@toastit.py@.PATH_END.py |
{
"filename": "LIGO_psds.py",
"repo_name": "damonge/schNell",
"repo_path": "schNell_extracted/schNell-master/plots/LIGO_psds.py",
"type": "Python"
} | import numpy as np
import schnell as snl
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font', **{'family': 'sans-serif',
'sans-serif': ['Helvetica']})
rc('text', usetex=True)
freqs = np.geomspace(8., 1010., 2048)
dets = [snl.GroundDetector('Hanford', 46.4, -119.4, 171.8,
... | damongeREPO_NAMEschNellPATH_START.@schNell_extracted@schNell-master@plots@LIGO_psds.py@.PATH_END.py |
{
"filename": "_family.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/histogram/legendgrouptitle/font/_family.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="family",
parent_name="histogram.legendgrouptitle.font",
**kwargs,
):
super(FamilyValidator, self).__init__(
plotly_name=... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@histogram@legendgrouptitle@font@_family.py@.PATH_END.py |
{
"filename": "_y.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattercarpet/marker/colorbar/_y.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="y", parent_name="scattercarpet.marker.colorbar", **kwargs
):
super(YValidator, self).__init__(
plotly_name=plotly_name,
parent_name=paren... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattercarpet@marker@colorbar@_y.py@.PATH_END.py |
{
"filename": "quadrature.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py2/scipy/integrate/quadrature.py",
"type": "Python"
} | from __future__ import division, print_function, absolute_import
import numpy as np
import math
import warnings
# trapz is a public function for scipy.integrate,
# even though it's actually a numpy function.
from numpy import trapz
from scipy.special import roots_legendre
from scipy.special import gammaln
from scipy.... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py2@scipy@integrate@quadrature.py@.PATH_END.py |
{
"filename": "_colorbar.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/splom/marker/_colorbar.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorbarValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="colorbar", parent_name="splom.marker", **kwargs):
super(ColorbarValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@splom@marker@_colorbar.py@.PATH_END.py |
{
"filename": "_line.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/histogram/marker/_line.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "histogram.marker"
_path_str = "histogram.marker.line"
_valid_props = {
"autocolorscale... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@histogram@marker@_line.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "BEAST-Fitting/beast",
"repo_path": "beast_extracted/beast-master/beast/observationmodel/tests/__init__.py",
"type": "Python"
} | BEAST-FittingREPO_NAMEbeastPATH_START.@beast_extracted@beast-master@beast@observationmodel@tests@__init__.py@.PATH_END.py | |
{
"filename": "__init__.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/yt/data_objects/level_sets/__init__.py",
"type": "Python"
} | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@yt@data_objects@level_sets@__init__.py@.PATH_END.py | |
{
"filename": "_textsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter3d/_textsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="textsrc", parent_name="scatter3d", **kwargs):
super(TextsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter3d@_textsrc.py@.PATH_END.py |
{
"filename": "split_gen.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/tools/proto_splitter/testdata/split_gen.py",
"type": "Python"
} | # Copyright 2023 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@tools@proto_splitter@testdata@split_gen.py@.PATH_END.py |
{
"filename": "osx_shlib.py",
"repo_name": "CosmoLike/cocoa",
"repo_path": "cocoa_extracted/cocoa-main/Cocoa/external_modules/code/planck/code/spt_clik/waf_tools/osx_shlib.py",
"type": "Python"
} | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def configure(ctx):
import sys
ctx.env.shsuffix = "so"
if sys.platform.lower()=="darwin":
ctx.env.shsuffix = "dylib" | CosmoLikeREPO_NAMEcocoaPATH_START.@cocoa_extracted@cocoa-main@Cocoa@external_modules@code@planck@code@spt_clik@waf_tools@osx_shlib.py@.PATH_END.py |
{
"filename": "animation.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/lib/matplotlib/animation.py",
"type": "Python"
} | import abc
import base64
import contextlib
from io import BytesIO, TextIOWrapper
import itertools
import logging
from pathlib import Path
import shutil
import subprocess
import sys
from tempfile import TemporaryDirectory
import uuid
import warnings
import numpy as np
from PIL import Image
import matplotlib as mpl
fro... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@lib@matplotlib@animation.py@.PATH_END.py |
{
"filename": "rms_norm.py",
"repo_name": "jax-ml/jax",
"repo_path": "jax_extracted/jax-main/examples/ffi/src/jax_ffi_example/rms_norm.py",
"type": "Python"
} | # Copyright 2024 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | jax-mlREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@examples@ffi@src@jax_ffi_example@rms_norm.py@.PATH_END.py |
{
"filename": "test_constructors.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/arrays/timedeltas/test_constructors.py",
"type": "Python"
} | import numpy as np
import pytest
from pandas.core.arrays import TimedeltaArray
class TestTimedeltaArrayConstructor:
def test_other_type_raises(self):
msg = r"dtype bool cannot be converted to timedelta64\[ns\]"
with pytest.raises(TypeError, match=msg):
TimedeltaArray._from_sequence(np... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@arrays@timedeltas@test_constructors.py@.PATH_END.py |
{
"filename": "hnsw.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/library/python/hnsw/hnsw/hnsw.py",
"type": "Python"
} | import sys
import os
from six import iteritems
from enum import IntEnum
from contextlib import contextmanager
import json
if sys.version_info >= (3,):
import importlib.util
def load_dynamic(name, path):
spec = importlib.util.spec_from_file_location(name, path)
module = importlib.util.module_fr... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@library@python@hnsw@hnsw@hnsw.py@.PATH_END.py |
{
"filename": "test_tpcf_estimators.py",
"repo_name": "astropy/halotools",
"repo_path": "halotools_extracted/halotools-master/halotools/mock_observables/two_point_clustering/tests/test_tpcf_estimators.py",
"type": "Python"
} | """ Module provides unit-testing for `~halotools.mock_observables.tpcf_estimators`.
"""
from __future__ import absolute_import, division, print_function
import pytest
import numpy as np
from ..tpcf_estimators import (
_test_for_zero_division,
_list_estimators,
_TP_estimator_requirements,
)
from ....custom... | astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@halotools@mock_observables@two_point_clustering@tests@test_tpcf_estimators.py@.PATH_END.py |
{
"filename": "PBH.py",
"repo_name": "bradkav/BlackHolesDarkDress",
"repo_path": "BlackHolesDarkDress_extracted/BlackHolesDarkDress-master/Nbody/PBH.py",
"type": "Python"
} | import numpy as np
import pygadgetic
import random
import math
from tqdm import tqdm
import os.path
from scipy.integrate import quad, cumtrapz
from scipy.interpolate import interp1d
from scipy.optimize import brenth
from matplotlib import pylab as pl
#-------------
#You should just be able to import whichever ed... | bradkavREPO_NAMEBlackHolesDarkDressPATH_START.@BlackHolesDarkDress_extracted@BlackHolesDarkDress-master@Nbody@PBH.py@.PATH_END.py |
{
"filename": "test_image.py",
"repo_name": "GeminiDRSoftware/DRAGONS",
"repo_path": "DRAGONS_extracted/DRAGONS-master/geminidr/core/tests/test_image.py",
"type": "Python"
} | """
Tests applied to primitives_image.py
"""
import pytest
import os
from numpy.testing import assert_array_equal
import astrodata, gemini_instruments
from geminidr.niri.primitives_niri_image import NIRIImage
object_mask_datasets = {"N20210512S0018_sourcesDetected.fits": "N20210512S0077_flatCorrected.fits"}
@pyt... | GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@geminidr@core@tests@test_image.py@.PATH_END.py |
{
"filename": "tests.py",
"repo_name": "spedas/pyspedas",
"repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/geotail/tests/tests.py",
"type": "Python"
} |
import os
import unittest
from pytplot import data_exists
import pyspedas
class LoadTestCases(unittest.TestCase):
def test_downloadonly(self):
files = pyspedas.projects.geotail.mgf(downloadonly=True)
self.assertTrue(os.path.exists(files[0]))
def test_load_mgf_data(self):
mgf_vars = p... | spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@geotail@tests@tests.py@.PATH_END.py |
{
"filename": "hernquist.py",
"repo_name": "LSSTDESC/CCL",
"repo_path": "CCL_extracted/CCL-master/pyccl/halos/profiles/hernquist.py",
"type": "Python"
} | __all__ = ("HaloProfileHernquist",)
import numpy as np
from scipy.special import sici
from . import HaloProfileMatter
class HaloProfileHernquist(HaloProfileMatter):
""" `Hernquist 1990
<https://ui.adsabs.harvard.edu/abs/1990ApJ...356..359H/abstract>`_
profile.
.. math::
\\rho(r) = \\frac{\\r... | LSSTDESCREPO_NAMECCLPATH_START.@CCL_extracted@CCL-master@pyccl@halos@profiles@hernquist.py@.PATH_END.py |
{
"filename": "simple_autocorrelate.py",
"repo_name": "astrostat/LIRA",
"repo_path": "LIRA_extracted/LIRA-master/lira/inst/docs/examples/PyProcUtils/simple_autocorrelate.py",
"type": "Python"
} | def autocorr(x,maxlag=-1):
result = numpy.correlate(x, x, mode='full')
if maxlag < 0:
endlag = len(result.size/2)
else :
endlag = maxlag
return result[result.size/2:endlag]
| astrostatREPO_NAMELIRAPATH_START.@LIRA_extracted@LIRA-master@lira@inst@docs@examples@PyProcUtils@simple_autocorrelate.py@.PATH_END.py |
{
"filename": "example.ipynb",
"repo_name": "heracles-ec/heracles",
"repo_path": "heracles_extracted/heracles-main/examples/example.ipynb",
"type": "Jupyter Notebook"
} | # Two-point statistics from *Heracles*
This notebook demonstrates how *Heracles* extracts the two-point statistics from a 3×2pt catalogue.
<div class="alert alert-info">
**Important note**
This notebook is only meant to give you an idea of **how *Heracles* works**.
It does **not** show everything that *Heracles* c... | heracles-ecREPO_NAMEheraclesPATH_START.@heracles_extracted@heracles-main@examples@example.ipynb@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.