metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "tests.py",
"repo_name": "ldolan05/ACID",
"repo_path": "ACID_extracted/ACID-main/tests/tests.py",
"type": "Python"
} | from astropy.io import fits
import ACID_code.ACID as acid
import numpy as np
import matplotlib.pyplot as plt
import glob
def test_run_e2ds():
e2ds_files = glob.glob('tests/data/*e2ds_A*.fits')
linelist = 'example/example_linelist.txt'
save_path = 'no save'
velocities = np.arange(-25, 25, 0.82)
... | ldolan05REPO_NAMEACIDPATH_START.@ACID_extracted@ACID-main@tests@tests.py@.PATH_END.py |
{
"filename": "uldm.py",
"repo_name": "sibirrer/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/lenstronomy/LensModel/Profiles/uldm.py",
"type": "Python"
} | __author__ = "lucateo"
# this file contains a class to compute the Ultra Light Dark Matter soliton profile
import numpy as np
from scipy.special import gamma, hyp2f1
from lenstronomy.LensModel.Profiles.base_profile import LensProfileBase
__all__ = ["Uldm"]
class Uldm(LensProfileBase):
"""
This class contain... | sibirrerREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@lenstronomy@LensModel@Profiles@uldm.py@.PATH_END.py |
{
"filename": "_dtickrange.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/icicle/marker/colorbar/tickformatstop/_dtickrange.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class DtickrangeValidator(_plotly_utils.basevalidators.InfoArrayValidator):
def __init__(
self,
plotly_name="dtickrange",
parent_name="icicle.marker.colorbar.tickformatstop",
**kwargs,
):
super(DtickrangeValidator, self).__init__(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@icicle@marker@colorbar@tickformatstop@_dtickrange.py@.PATH_END.py |
{
"filename": "bulkDataNTtest.py",
"repo_name": "ACS-Community/ACS",
"repo_path": "ACS_extracted/ACS-master/LGPL/CommonSoftware/bulkDataNT/src/bulkDataNTtest.py",
"type": "Python"
} | #! /usr/bin/env python
#*******************************************************************************
# ALMA - Atacama Large Millimiter Array
# (c) Associated Universities Inc., 2010
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# Lice... | ACS-CommunityREPO_NAMEACSPATH_START.@ACS_extracted@ACS-master@LGPL@CommonSoftware@bulkDataNT@src@bulkDataNTtest.py@.PATH_END.py |
{
"filename": "vimba_c.py",
"repo_name": "alliedvision/VimbaPython",
"repo_path": "VimbaPython_extracted/VimbaPython-master/vimba/c_binding/vimba_c.py",
"type": "Python"
} | """BSD 2-Clause License
Copyright (c) 2019, Allied Vision Technologies GmbH
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, thi... | alliedvisionREPO_NAMEVimbaPythonPATH_START.@VimbaPython_extracted@VimbaPython-master@vimba@c_binding@vimba_c.py@.PATH_END.py |
{
"filename": "_legendgroup.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/ohlc/_legendgroup.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LegendgroupValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="legendgroup", parent_name="ohlc", **kwargs):
super(LegendgroupValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@ohlc@_legendgroup.py@.PATH_END.py |
{
"filename": "modeling_2D.py",
"repo_name": "gammapy/gammapy",
"repo_path": "gammapy_extracted/gammapy-main/examples/tutorials/analysis-2d/modeling_2D.py",
"type": "Python"
} | """
2D map fitting
==============
Source modelling and fitting in stacked observations using the high level interface.
Prerequisites
-------------
- To understand how a general modelling and fitting works in gammapy,
please refer to the :doc:`/tutorials/analysis-3d/analysis_3d` tutorial.
Context
-------
We oft... | gammapyREPO_NAMEgammapyPATH_START.@gammapy_extracted@gammapy-main@examples@tutorials@analysis-2d@modeling_2D.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "1313e/PRISM",
"repo_path": "PRISM_extracted/PRISM-master/prism/emulator/__init__.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Emulator
========
Contains the definition of *PRISM*'s :class:`~Emulator` base class and various
specialized :class:`~Emulator` subclasses.
"""
# %% IMPORTS
# Import base Emulator class
from ._emulator import Emulator
# Import specialized Emulator subclasses
# All declaration
__all__ =... | 1313eREPO_NAMEPRISMPATH_START.@PRISM_extracted@PRISM-master@prism@emulator@__init__.py@.PATH_END.py |
{
"filename": "tempita.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/_build_utils/tempita.py",
"type": "Python"
} | import sys
import os
import argparse
from Cython import Tempita as tempita
# XXX: If this import ever fails (does it really?), vendor either
# cython.tempita or numpy/npy_tempita.
def process_tempita(fromfile, outfile=None):
"""Process tempita templated file and write out the result.
The template file is ex... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@_build_utils@tempita.py@.PATH_END.py |
{
"filename": "sampling.py",
"repo_name": "astro-informatics/QuantifAI",
"repo_path": "QuantifAI_extracted/QuantifAI-main/quantifai/sampling.py",
"type": "Python"
} | import torch
import math
import numpy as np
from typing import Callable
def ULA_kernel(
X: torch.Tensor, delta: float, grad_likelihood_prior: Callable
) -> torch.Tensor:
"""ULA sampling algorithm kernel
Args:
X (torch.Tensor): Tensor to update
delta (float): Step size for the ULA algorit... | astro-informaticsREPO_NAMEQuantifAIPATH_START.@QuantifAI_extracted@QuantifAI-main@quantifai@sampling.py@.PATH_END.py |
{
"filename": "drm_funcs.py",
"repo_name": "Swift-BAT/NITRATES",
"repo_path": "NITRATES_extracted/NITRATES-main/nitrates/lib/drm_funcs.py",
"type": "Python"
} | import numpy as np
from astropy.io import fits
import os
from ..lib.logllh_ebins_funcs import get_cnt_ebins_normed, get_cnt_ebins
def get_drm_arr(drm_dir):
drm_fnames = np.array([fn for fn in os.listdir(drm_dir) if "drm_" in fn])
imxs = np.array([float(fn.split("_")[1]) for fn in drm_fnames])
imys = np.a... | Swift-BATREPO_NAMENITRATESPATH_START.@NITRATES_extracted@NITRATES-main@nitrates@lib@drm_funcs.py@.PATH_END.py |
{
"filename": "recipe_divide_a0v.py",
"repo_name": "igrins/plp",
"repo_path": "plp_extracted/plp-master/igrins/recipes/recipe_divide_a0v.py",
"type": "Python"
} | from .argh_helper import argh
from .process_divide_a0v import process_band
from ..libs.recipe_factory import new_recipe_class, new_recipe_func
_recipe_class_divide_a0v = new_recipe_class("RecipeDivideA0V",
("EXTENDED_*", "STELLAR_*"),
... | igrinsREPO_NAMEplpPATH_START.@plp_extracted@plp-master@igrins@recipes@recipe_divide_a0v.py@.PATH_END.py |
{
"filename": "gradDivVectorFieldListPairWiseInst.cc.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/src/FieldOperations/gradDivVectorFieldListPairWiseInst.cc.py",
"type": "Python"
} | text = """
//------------------------------------------------------------------------------
// Explicit instantiation.
//------------------------------------------------------------------------------
#include "FieldOperations/gradDivVectorFieldListPairWise.cc"
#include "Geometry/Dimension.hh"
namespace Spheral {
//==... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@src@FieldOperations@gradDivVectorFieldListPairWiseInst.cc.py@.PATH_END.py |
{
"filename": "result.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/io/votable/validator/result.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Contains a class to handle a validation result for a single VOTable
file.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from ....extern import six
from ....extern.six.moves import http_client, urllib
from ....e... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@io@votable@validator@result.py@.PATH_END.py |
{
"filename": "sample.py",
"repo_name": "POSYDON-code/POSYDON",
"repo_path": "POSYDON_extracted/POSYDON-main/posydon/active_learning/psy_cris/sample.py",
"type": "Python"
} | """The definition of the `Sampler` class in PSY-CRIS."""
__authors__ = [
"Kyle Akira Rocha <kylerocha2024@u.northwestern.edu>",
"Scott Coughlin <scottcoughlin2014@u.northwestern.edu>",
]
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import time
import sys
from collections import Ord... | POSYDON-codeREPO_NAMEPOSYDONPATH_START.@POSYDON_extracted@POSYDON-main@posydon@active_learning@psy_cris@sample.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatterternary/selected/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._textfont import TextfontValidator
from ._marker import MarkerValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._textfont.TextfontValidator", "._marker.MarkerValid... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatterternary@selected@__init__.py@.PATH_END.py |
{
"filename": "densvar.py",
"repo_name": "desihub/LSS",
"repo_path": "LSS_extracted/LSS-main/Sandbox/imaging/densvar.py",
"type": "Python"
} | import fitsio
import astropy.io.fits as fits
import healpy as hp
import numpy as np
from matplotlib import pyplot as plt
pixfn = '/global/cfs/cdirs/desi/target/catalogs/dr9m/0.44.0/pixweight/main/resolve/dark/pixweight-dark.fits'
hdr = fits.getheader(pixfn,1)
nside,nest = hdr['HPXNSIDE'],hdr['HPXNEST']
pri... | desihubREPO_NAMELSSPATH_START.@LSS_extracted@LSS-main@Sandbox@imaging@densvar.py@.PATH_END.py |
{
"filename": "_borderwidth.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattermap/marker/colorbar/_borderwidth.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BorderwidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="borderwidth",
parent_name="scattermap.marker.colorbar",
**kwargs,
):
super(BorderwidthValidator, self).__init__(
pl... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattermap@marker@colorbar@_borderwidth.py@.PATH_END.py |
{
"filename": "hou_config_funcs.py",
"repo_name": "meyeralexj/gubas",
"repo_path": "gubas_extracted/gubas-master/hou_config_funcs.py",
"type": "Python"
} | def hou_config_read(filename):
CFG=cfp.ConfigParser()
CFG.read(filename)
# get flags
fahnestock_flag=CFG.getboolean("Initial Conditions","Fahnestock Input File Flag")
C_flag=CFG.getboolean("Initial Conditions","B into A Euler Flag")
Cc_flag=CFG.getboolean("Initial Conditions","A into N Eule... | meyeralexjREPO_NAMEgubasPATH_START.@gubas_extracted@gubas-master@hou_config_funcs.py@.PATH_END.py |
{
"filename": "_ticklen.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/histogram/marker/colorbar/_ticklen.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicklenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="ticklen", parent_name="histogram.marker.colorbar", **kwargs
):
super(TicklenValidator, self).__init__(
plotly_name=plotly_name,
par... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@histogram@marker@colorbar@_ticklen.py@.PATH_END.py |
{
"filename": "6_paper_imaging_plots_SIM2.py",
"repo_name": "eogarvin/MLCCS",
"repo_path": "MLCCS_extracted/MLCCS-main/tests/6_paper_imaging_plots_SIM2.py",
"type": "Python"
} |
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 19 2023
@author: emily
This script intends to plot results for several experiments conducted on different alpha values.
"""
## LIBRARIES
import gc
import pandas as pd
import numpy as np
import seaborn as sns
from functools import partial
from itertools import chain, ... | eogarvinREPO_NAMEMLCCSPATH_START.@MLCCS_extracted@MLCCS-main@tests@6_paper_imaging_plots_SIM2.py@.PATH_END.py |
{
"filename": "_sizesrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattergeo/hoverlabel/font/_sizesrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="sizesrc", parent_name="scattergeo.hoverlabel.font", **kwargs
):
super(SizesrcValidator, self).__init__(
plotly_name=plotly_name,
paren... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattergeo@hoverlabel@font@_sizesrc.py@.PATH_END.py |
{
"filename": "test_memory.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/tests/unit_tests/schema/test_memory.py",
"type": "Python"
} | from langchain.schema.memory import __all__
EXPECTED_ALL = ["BaseMemory"]
def test_all_imports() -> None:
assert set(__all__) == set(EXPECTED_ALL)
| langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@tests@unit_tests@schema@test_memory.py@.PATH_END.py |
{
"filename": "cli__approx-on-full-history__first-sentence.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage/cli__approx-on-full-history__first-sentence.md",
"type": "Markdown"
} |
The principles for calculating the approximated values.
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage@cli__approx-on-full-history__first-sentence.md@.PATH_END.py |
{
"filename": "test_ufunc.py",
"repo_name": "numpy/numpy",
"repo_path": "numpy_extracted/numpy-main/numpy/_core/tests/test_ufunc.py",
"type": "Python"
} | import warnings
import itertools
import sys
import ctypes as ct
import pickle
import pytest
from pytest import param
import numpy as np
import numpy._core.umath as ncu
import numpy._core._umath_tests as umt
import numpy.linalg._umath_linalg as uml
import numpy._core._operand_flag_tests as opflag_tests
import numpy._c... | numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@numpy@_core@tests@test_ufunc.py@.PATH_END.py |
{
"filename": "decorators.py",
"repo_name": "gwpy/gwpy",
"repo_path": "gwpy_extracted/gwpy-main/gwpy/utils/decorators.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2014-2020)
#
# This file is part of GWpy.
#
# GWpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option)... | gwpyREPO_NAMEgwpyPATH_START.@gwpy_extracted@gwpy-main@gwpy@utils@decorators.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/chains/qa_with_sources/__init__.py",
"type": "Python"
} | """Load question answering with sources chains."""
from langchain.chains.qa_with_sources.loading import load_qa_with_sources_chain
__all__ = ["load_qa_with_sources_chain"]
| langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@chains@qa_with_sources@__init__.py@.PATH_END.py |
{
"filename": "test_jplsbdb.py",
"repo_name": "D-arioSpace/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/jplsbdb/tests/test_jplsbdb.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import os
from astroquery.utils.mocks import MockResponse
import astropy.units as u
from astropy.tests.helper import assert_quantity_allclose
from .. import SBDB, SBDBClass
# files in data/ for different query types
DATA_FILES = {'1': 'cer... | D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@jplsbdb@tests@test_jplsbdb.py@.PATH_END.py |
{
"filename": "vis_formats_write.md",
"repo_name": "MWATelescope/mwa_hyperdrive",
"repo_path": "mwa_hyperdrive_extracted/mwa_hyperdrive-main/mdbook/src/defs/vis_formats_write.md",
"type": "Markdown"
} | # Supported visibility formats for writing
The following examples illustrate how to produce each of the supported
visibility file formats with `solutions-apply`, but other aspects of
`hyperdrive` are also able to produce these file formats, and all aspects are
able to perform averaging and write to multiple outputs.
... | MWATelescopeREPO_NAMEmwa_hyperdrivePATH_START.@mwa_hyperdrive_extracted@mwa_hyperdrive-main@mdbook@src@defs@vis_formats_write.md@.PATH_END.py |
{
"filename": "time_weighted_retriever.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/retrievers/time_weighted_retriever.py",
"type": "Python"
} | import datetime
from copy import deepcopy
from typing import Any, Dict, List, Optional, Tuple
from langchain_core.callbacks import (
AsyncCallbackManagerForRetrieverRun,
CallbackManagerForRetrieverRun,
)
from langchain_core.documents import Document
from langchain_core.retrievers import BaseRetriever
from lang... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@retrievers@time_weighted_retriever.py@.PATH_END.py |
{
"filename": "orbit.py",
"repo_name": "lucabaldini/ixpeobssim",
"repo_path": "ixpeobssim_extracted/ixpeobssim-main/docs/macro/orbit.py",
"type": "Python"
} | #!/urs/bin/env python
#
# Copyright (C) 2020, the ixpeobssim team.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
#... | lucabaldiniREPO_NAMEixpeobssimPATH_START.@ixpeobssim_extracted@ixpeobssim-main@docs@macro@orbit.py@.PATH_END.py |
{
"filename": "test_fouriersqrt.py",
"repo_name": "GalSim-developers/GalSim",
"repo_path": "GalSim_extracted/GalSim-main/tests/test_fouriersqrt.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@tests@test_fouriersqrt.py@.PATH_END.py |
{
"filename": "synthetic.py",
"repo_name": "ander-son-almeida/DashboardOCmass",
"repo_path": "DashboardOCmass_extracted/DashboardOCmass-main/synthetic.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 23 15:33:17 2021
@author: Anderson Almeida
"""
# from ocs_functions import *
import numpy as np
from oc_tools_padova_edr3 import *
def synthetic(age, dist, Av, FeH, bin_frac, nstars, Mlim):
# read isochrones
mod_grid, age_grid, z_grid = load_mod_grid()
... | ander-son-almeidaREPO_NAMEDashboardOCmassPATH_START.@DashboardOCmass_extracted@DashboardOCmass-main@synthetic.py@.PATH_END.py |
{
"filename": "_hoverinfo.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/histogram/_hoverinfo.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HoverinfoValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(self, plotly_name="hoverinfo", parent_name="histogram", **kwargs):
super(HoverinfoValidator, 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@histogram@_hoverinfo.py@.PATH_END.py |
{
"filename": "calculate_calibration_coefficients.ipynb",
"repo_name": "cta-observatory/cta-lstchain",
"repo_path": "cta-lstchain_extracted/cta-lstchain-main/notebooks/calculate_calibration_coefficients.ipynb",
"type": "Jupyter Notebook"
} | ```python
%load_ext autoreload
%autoreload 2
from ctapipe.io import EventSource
import sys
from matplotlib import pyplot as plt
import numpy as np
%matplotlib inline
import sys
from scipy.stats import norm
from traitlets.config.loader import Config
from ctapipe import utils
# ctapipe modules
from ctapipe.visualiza... | cta-observatoryREPO_NAMEcta-lstchainPATH_START.@cta-lstchain_extracted@cta-lstchain-main@notebooks@calculate_calibration_coefficients.ipynb@.PATH_END.py |
{
"filename": "Compatibility-Policy.md",
"repo_name": "crossbario/crossbar",
"repo_path": "crossbar_extracted/crossbar-master/docs-old/pages/about/Compatibility-Policy.md",
"type": "Markdown"
} | title: Compatibility Policy
toc: [Documentation, Compatibility Policy]
# Compatibility Policy
This document describes our compatibility policies for Crossbar.io:
1. [Backward Compatibility of Releases](#backward-compatibility-of-releases)
2. [Compatibility with WAMP Client Libraries](#compatibility-with-wamp-client-... | crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@docs-old@pages@about@Compatibility-Policy.md@.PATH_END.py |
{
"filename": "audio_classifier.md",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/lite/g3doc/api_docs/python/tflite_model_maker/audio_classifier.md",
"type": "Markdown"
} | page_type: reference
description: APIs to train an audio classification model.
<link rel="stylesheet" href="/site-assets/css/style.css">
<!-- DO NOT EDIT! Automatically generated file. -->
<div itemscope itemtype="http://developers.google.com/ReferenceObject">
<meta itemprop="name" content="tflite_model_maker.audio... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@lite@g3doc@api_docs@python@tflite_model_maker@audio_classifier.md@.PATH_END.py |
{
"filename": "async_helpers.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/ipython/py3/IPython/core/async_helpers.py",
"type": "Python"
} | """
Async helper function that are invalid syntax on Python 3.5 and below.
This code is best effort, and may have edge cases not behaving as expected. In
particular it contain a number of heuristics to detect whether code is
effectively async and need to run in an event loop or not.
Some constructs (like top-level `r... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipython@py3@IPython@core@async_helpers.py@.PATH_END.py |
{
"filename": "test_results.py",
"repo_name": "ConorMacBride/mcalf",
"repo_path": "mcalf_extracted/mcalf-main/src/mcalf/tests/models/test_results.py",
"type": "Python"
} | import numpy as np
import pytest
from mcalf.models import FitResult, FitResults
from mcalf.models import ModelBase as DummyModel
fitted_parameters = [1, 2, 1000.2, 1001.8, 5]
fit_info = {'chi2': 1.4, 'classification': 2, 'profile': 'abc',
'success': True, 'index': [123, 456, 789]}
def test_fitresult_pas... | ConorMacBrideREPO_NAMEmcalfPATH_START.@mcalf_extracted@mcalf-main@src@mcalf@tests@models@test_results.py@.PATH_END.py |
{
"filename": "_blend.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/pointcloud/marker/_blend.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BlendValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="blend", parent_name="pointcloud.marker", **kwargs):
super(BlendValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@pointcloud@marker@_blend.py@.PATH_END.py |
{
"filename": "CHANGELOG.md",
"repo_name": "NannyML/nannyml",
"repo_path": "nannyml_extracted/nannyml-main/CHANGELOG.md",
"type": "Markdown"
} | # Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.12.1] - 2024-09-06
### Fixed
- Fixed component filtering mis... | NannyMLREPO_NAMEnannymlPATH_START.@nannyml_extracted@nannyml-main@CHANGELOG.md@.PATH_END.py |
{
"filename": "check.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/core/computation/check.py",
"type": "Python"
} | from __future__ import annotations
from pandas.compat._optional import import_optional_dependency
ne = import_optional_dependency("numexpr", errors="warn")
NUMEXPR_INSTALLED = ne is not None
__all__ = ["NUMEXPR_INSTALLED"]
| pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@core@computation@check.py@.PATH_END.py |
{
"filename": "mcmc.py",
"repo_name": "annadeg/jwst-msafit",
"repo_path": "jwst-msafit_extracted/jwst-msafit-main/msafit/fitting/mcmc.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
import emcee
__all__ = ["make_init_ball","get_scale_estimate","plot_autocorr"]
def get_scale_estimate(prior_func):
"""find a reasonable typical value for the prior distribution.
For uniform priors this is somewhere around the middle, for other priors
i... | annadegREPO_NAMEjwst-msafitPATH_START.@jwst-msafit_extracted@jwst-msafit-main@msafit@fitting@mcmc.py@.PATH_END.py |
{
"filename": "hst.py",
"repo_name": "natashabatalha/PandExo",
"repo_path": "PandExo_extracted/PandExo-master/pandexo/engine/hst.py",
"type": "Python"
} | import numpy as np
import pandas as pd
from .create_input import hst_spec
import batman
from .RECTE import RECTE
from scipy import optimize
def wfc3_GuessNOrbits(trdur):
'''Predict number of HST orbits
Predict number of HST orbits for transit observation when not provided by the user.
Parameters
----... | natashabatalhaREPO_NAMEPandExoPATH_START.@PandExo_extracted@PandExo-master@pandexo@engine@hst.py@.PATH_END.py |
{
"filename": "_offsetgroup.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/box/_offsetgroup.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OffsetgroupValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="offsetgroup", parent_name="box", **kwargs):
super(OffsetgroupValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@box@_offsetgroup.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/yt/frontends/eagle/__init__.py",
"type": "Python"
} | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@frontends@eagle@__init__.py@.PATH_END.py | |
{
"filename": "test_arxiv.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/integration_tests/document_loaders/test_arxiv.py",
"type": "Python"
} | import shutil
from http.client import HTTPMessage
from pathlib import Path
from typing import List, Union
from unittest.mock import patch
from urllib.error import HTTPError
import pytest
from langchain_core.documents import Document
from langchain_community.document_loaders.arxiv import ArxivLoader
EXAMPLE_HELLO_PDF... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@integration_tests@document_loaders@test_arxiv.py@.PATH_END.py |
{
"filename": "python-reference_sum_models.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/concepts/python-reference_sum_models.md",
"type": "Markdown"
} | # sum_models
## {{ dl--purpose }} {#purpose}
{% include [sum_limits-python__sum-limits__desc](../_includes/work_src/reusage-python/python__sum-limits__desc.md) %}
## {{ dl--invoke-format }} {#call-format}
```python
sum_models(models,
weights=None,
ctr_merge_policy='IntersectingCountersAverage... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@concepts@python-reference_sum_models.md@.PATH_END.py |
{
"filename": "line_prob.py",
"repo_name": "HETDEX/elixer",
"repo_path": "elixer_extracted/elixer-main/elixer/line_prob.py",
"type": "Python"
} | #import Bayes.bayesian
#import Bayes.nb
import math
try:
from ConfigParser import RawConfigParser
except:
from configparser import RawConfigParser
import os
import sys
import astropy.stats.biweight as biweight
import matplotlib.pyplot as plt
from scipy.stats import bayes_mvs
try:
from elixer import globa... | HETDEXREPO_NAMEelixerPATH_START.@elixer_extracted@elixer-main@elixer@line_prob.py@.PATH_END.py |
{
"filename": "test_from_texts.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/partners/qdrant/tests/integration_tests/test_from_texts.py",
"type": "Python"
} | import tempfile
import uuid
from typing import Optional
import pytest # type: ignore[import-not-found]
from langchain_core.documents import Document
from langchain_qdrant import Qdrant
from langchain_qdrant.vectorstores import QdrantException
from tests.integration_tests.common import (
ConsistentFakeEmbeddings,... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@partners@qdrant@tests@integration_tests@test_from_texts.py@.PATH_END.py |
{
"filename": "_marker.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/choropleth/unselected/_marker.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Marker(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "choropleth.unselected"
_path_str = "choropleth.unselected.marker"
_valid_props = {"opacity"}... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@choropleth@unselected@_marker.py@.PATH_END.py |
{
"filename": "test.py",
"repo_name": "wmpg/WesternMeteorPyLib",
"repo_path": "WesternMeteorPyLib_extracted/WesternMeteorPyLib-master/test.py",
"type": "Python"
} | """ Working script for testing chunks of code. Nothing really of value here. """
import numpy as np
from wmpl.Utils.Math import findClosestPoints, vectNorm, vectMag
from wmpl.Utils.TrajConversions import date2JD, ecef2ENU, enu2ECEF, cartesian2Geo, geo2Cartesian
def calcSpatialResidual(jd, state_vect, radiant_eci,... | wmpgREPO_NAMEWesternMeteorPyLibPATH_START.@WesternMeteorPyLib_extracted@WesternMeteorPyLib-master@test.py@.PATH_END.py |
{
"filename": "test_verbosity.py",
"repo_name": "wdpozzo/raynest",
"repo_path": "raynest_extracted/raynest-main/raynest/tests/test_verbosity.py",
"type": "Python"
} | import unittest
import numpy as np
import raynest.model
class GaussianModel(raynest.model.Model):
"""
A simple gaussian model with parameters mean and sigma
"""
names=['mean','sigma']
bounds=[[-5,5],[0.05,1]]
data = np.array([x for x in np.random.normal(0.5,0.5,size=10)])
analyticZ = np.log... | wdpozzoREPO_NAMEraynestPATH_START.@raynest_extracted@raynest-main@raynest@tests@test_verbosity.py@.PATH_END.py |
{
"filename": "test_sdsstractor.py",
"repo_name": "dstndstn/tractor",
"repo_path": "tractor_extracted/tractor-main/test/not-real-tests/test_sdsstractor.py",
"type": "Python"
} | from __future__ import print_function
import sys
from math import pi
import numpy as np
import pylab as plt
from astrometry.util.sip import Tan
from sdsstractor import *
#from compiled_profiles import *
#from galaxy_profiles import *
class FitsWcs(object):
def __init__(self, wcs):
self.wcs = wcs
def positionTo... | dstndstnREPO_NAMEtractorPATH_START.@tractor_extracted@tractor-main@test@not-real-tests@test_sdsstractor.py@.PATH_END.py |
{
"filename": "_familysrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/area/hoverlabel/font/_familysrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="familysrc", parent_name="area.hoverlabel.font", **kwargs
):
super(FamilysrcValidator, self).__init__(
plotly_name=plotly_name,
paren... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@area@hoverlabel@font@_familysrc.py@.PATH_END.py |
{
"filename": "prepare_internet.ipynb",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/benchmarks/quality_benchmarks/prepare_internet/prepare_internet.ipynb",
"type": "Jupyter Notebook"
} | ### Instruction
To obtain the dataset Internet used for algorithms comparison:
1) Download `kdd_internet_usage.arff` file from http://www.cs.odu.edu/~mukka/cs795sum10dm/datasets/uci-20070111/nominal/kdd_internet_usage.arff.
2) Put it to the same directory as this notebook.
3) Run all the cells of this notebook succ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@benchmarks@quality_benchmarks@prepare_internet@prepare_internet.ipynb@.PATH_END.py |
{
"filename": "obslog.py",
"repo_name": "plazar/coast_guard",
"repo_path": "coast_guard_extracted/coast_guard-master/database/obslog.py",
"type": "Python"
} | import sqlalchemy as sa
# Create metadata object
metadata = sa.MetaData()
# Define the metadata object for the obsinfo table
sa.Table('obsinfo', metadata,
sa.Column('object', sa.String(32), nullable=False),
sa.Column('mjd', sa.Float(53), nullable=False),
sa.Column('equinox', sa.Float, nulla... | plazarREPO_NAMEcoast_guardPATH_START.@coast_guard_extracted@coast_guard-master@database@obslog.py@.PATH_END.py |
{
"filename": "proxy.py",
"repo_name": "crossbario/crossbar",
"repo_path": "crossbar_extracted/crossbar-master/crossbar/master/api/proxy.py",
"type": "Python"
} | ###############################################################################
#
# Crossbar.io Master
# Copyright (c) typedef int GmbH. Licensed under EUPLv1.2.
#
###############################################################################
from crossbar.master.api.remote import RemoteApi
__all__ = ('RemoteProxyAp... | crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@crossbar@master@api@proxy.py@.PATH_END.py |
{
"filename": "_dual_annealing.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/optimize/_dual_annealing.py",
"type": "Python"
} | # Dual Annealing implementation.
# Copyright (c) 2018 Sylvain Gubian <sylvain.gubian@pmi.com>,
# Yang Xiang <yang.xiang@pmi.com>
# Author: Sylvain Gubian, Yang Xiang, PMP S.A.
"""
A Dual Annealing global optimization algorithm
"""
import numpy as np
from scipy.optimize import OptimizeResult
from scipy.optimize import... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@optimize@_dual_annealing.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "deepskies/deeplenstronomy",
"repo_path": "deeplenstronomy_extracted/deeplenstronomy-master/README.md",
"type": "Markdown"
} | # Welcome to `deeplenstronomy`!
[](https://joss.theoj.org/papers/e978dd566d1f290055a02d76288e95e1)
[](http://arxiv.org/abs/2102.02830)
[:
# class properties
# --------------------
_parent_path_str = "layout.geo"
_path_str = "layout.geo.center"
_valid_props = {"lat", "lon"}
# lat
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@layout@geo@_center.py@.PATH_END.py |
{
"filename": "michi2_filter_flux_2sigma.py",
"repo_name": "1054/Crab.Toolkit.michi2",
"repo_path": "Crab.Toolkit.michi2_extracted/Crab.Toolkit.michi2-master/bin/michi2_filter_flux_2sigma.py",
"type": "Python"
} | #!/usr/bin/env python
#
import os
import sys
import numpy
import astropy
import astropy.io.ascii as asciitable
from copy import copy
####################################
# MAIN #
####################################
if not len(sys.argv) > 2:
print('Usage: michi2_filter_flux_3sigma... | 1054REPO_NAMECrab.Toolkit.michi2PATH_START.@Crab.Toolkit.michi2_extracted@Crab.Toolkit.michi2-master@bin@michi2_filter_flux_2sigma.py@.PATH_END.py |
{
"filename": "test_functional.py",
"repo_name": "radiocosmology/driftscan",
"repo_path": "driftscan_extracted/driftscan-master/tests/test_functional.py",
"type": "Python"
} | """Functional test suite for checking integrity of the analysis product generation.
The tests using the KL spectrum are effected by changes to the default cosmology/power
spectrum in cora, and there is no easy way to pin this during the tests. Best option is
to just update the products *if* the defaults change.
Also,... | radiocosmologyREPO_NAMEdriftscanPATH_START.@driftscan_extracted@driftscan-master@tests@test_functional.py@.PATH_END.py |
{
"filename": "instrument.py",
"repo_name": "trident-project/trident",
"repo_path": "trident_extracted/trident-main/trident/instrument.py",
"type": "Python"
} | """
Instrument class and member functions.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2016, Trident Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#-----... | trident-projectREPO_NAMEtridentPATH_START.@trident_extracted@trident-main@trident@instrument.py@.PATH_END.py |
{
"filename": "functions.py",
"repo_name": "justinread/gravsphere",
"repo_path": "gravsphere_extracted/gravsphere-master/functions.py",
"type": "Python"
} | import numpy as np
from scipy.integrate import simps as integrator
from scipy.misc.common import derivative
from scipy.special import gamma
from scipy.integrate import quad, dblquad
from constants import *
multimode = 'normal'
###########################################################
#For setting cosmology priors on... | justinreadREPO_NAMEgravspherePATH_START.@gravsphere_extracted@gravsphere-master@functions.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "dfm/emcee",
"repo_path": "emcee_extracted/emcee-main/setup.py",
"type": "Python"
} | #!/usr/bin/env python
# Inspired by:
# https://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/
import codecs
import os
import re
from setuptools import find_packages, setup
# PROJECT SPECIFIC
NAME = "emcee"
PACKAGES = find_packages(where="src")
META_PATH = os.path.join("src", "emcee", "__init__.... | dfmREPO_NAMEemceePATH_START.@emcee_extracted@emcee-main@setup.py@.PATH_END.py |
{
"filename": "np_array_ops.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/ops/numpy_ops/np_array_ops.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@np_array_ops.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/prefect/server/services/__init__.py",
"type": "Python"
} | import prefect.server.services.cancellation_cleanup
import prefect.server.services.flow_run_notifications
import prefect.server.services.foreman
import prefect.server.services.late_runs
import prefect.server.services.pause_expirations
import prefect.server.services.scheduler
import prefect.server.services.telemetry
| PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@server@services@__init__.py@.PATH_END.py |
{
"filename": "incremental_pca.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scikit-learn/py2/sklearn/decomposition/incremental_pca.py",
"type": "Python"
} | """Incremental Principal Components Analysis."""
# Author: Kyle Kastner <kastnerkyle@gmail.com>
# Giorgio Patrini
# License: BSD 3 clause
import numpy as np
from scipy import linalg
from .base import _BasePCA
from ..utils import check_array, gen_batches
from ..utils.extmath import svd_flip, _incremental_mean... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scikit-learn@py2@sklearn@decomposition@incremental_pca.py@.PATH_END.py |
{
"filename": "_nticks.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/mesh3d/colorbar/_nticks.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NticksValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(self, plotly_name="nticks", parent_name="mesh3d.colorbar", **kwargs):
super(NticksValidator, 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@mesh3d@colorbar@_nticks.py@.PATH_END.py |
{
"filename": "test_fouriertransform.py",
"repo_name": "AOtools/aotools",
"repo_path": "aotools_extracted/aotools-main/test/test_fouriertransform.py",
"type": "Python"
} | from aotools import fouriertransform
import numpy
def test_ft():
data = numpy.random.random((100))
ft_data = fouriertransform.ft(data, 0.1)
assert ft_data.shape == data.shape
def test_ift():
data = numpy.random.random((100))
ift_data = fouriertransform.ift(data, 1.)
assert ift_data.shape == ... | AOtoolsREPO_NAMEaotoolsPATH_START.@aotools_extracted@aotools-main@test@test_fouriertransform.py@.PATH_END.py |
{
"filename": "galaxy_catalog_analysis_tutorial6.ipynb",
"repo_name": "astropy/halotools",
"repo_path": "halotools_extracted/halotools-master/docs/notebooks/galcat_analysis/basic_examples/galaxy_catalog_analysis_tutorial6.ipynb",
"type": "Jupyter Notebook"
} | # Example 6: Mean infall velocity into cluster BCGs
In this example we'll show how to calculate the mean infall velocity of galaxies towards the cluster BCGs.
## Generate a mock galaxy catalog
Let's start out by generating a mock galaxy catalog into an N-body
simulation in the usual way. Here we'll assume you have... | astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@docs@notebooks@galcat_analysis@basic_examples@galaxy_catalog_analysis_tutorial6.ipynb@.PATH_END.py |
{
"filename": "gpu_rnn.py",
"repo_name": "google/jax",
"repo_path": "jax_extracted/jax-main/jaxlib/gpu_rnn.py",
"type": "Python"
} | # Copyright 2022 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | googleREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jaxlib@gpu_rnn.py@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/sankey/link/hoverlabel/_font.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="font", parent_name="sankey.link.hoverlabel", **kwargs
):
super(FontValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@sankey@link@hoverlabel@_font.py@.PATH_END.py |
{
"filename": "JeffreysPrior.py",
"repo_name": "dokester/BayesicFitting",
"repo_path": "BayesicFitting_extracted/BayesicFitting-master/BayesicFitting/source/JeffreysPrior.py",
"type": "Python"
} | import math as math
import numpy as numpy
import warnings
from .Prior import Prior
from .Tools import setAttribute as setatt
__author__ = "Do Kester"
__year__ = 2024
__license__ = "GPL3"
__version__ = "3.2.1"
__url__ = "https://www.bayesicfitting.nl"
__status__ = "Perpetual Beta"
# * This file is part of the Bayesi... | dokesterREPO_NAMEBayesicFittingPATH_START.@BayesicFitting_extracted@BayesicFitting-master@BayesicFitting@source@JeffreysPrior.py@.PATH_END.py |
{
"filename": "pointless.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/Pygments/py3/pygments/lexers/pointless.py",
"type": "Python"
} | """
pygments.lexers.pointless
~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Pointless.
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, words
from pygments.token import Comment, Error, Keyword, Name, Numbe... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@Pygments@py3@pygments@lexers@pointless.py@.PATH_END.py |
{
"filename": "_yref.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/funnel/marker/colorbar/_yref.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YrefValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="yref", parent_name="funnel.marker.colorbar", **kwargs
):
super(YrefValidator, self).__init__(
plotly_name=plotly_name,
parent_name... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@funnel@marker@colorbar@_yref.py@.PATH_END.py |
{
"filename": "calc_slab.py",
"repo_name": "galtay/rabacus",
"repo_path": "rabacus_extracted/rabacus-master/rabacus/solvers/calc_slab.py",
"type": "Python"
} | """ Solves a slab with plane parallel radiation incident from one side. """
import numpy as np
import one_zone as ozn
from rabacus.atomic import chemistry
from rabacus.atomic import cooling
from rabacus.constants import units
from rabacus.utils import utils
__all__ = ['Slab']
class Slab:
"""
Solves a ... | galtayREPO_NAMErabacusPATH_START.@rabacus_extracted@rabacus-master@rabacus@solvers@calc_slab.py@.PATH_END.py |
{
"filename": "muLAnFig.py",
"repo_name": "muLAn-project/muLAn",
"repo_path": "muLAn_extracted/muLAn-master/muLAn/utils/muLAnFig.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""Create a figure from muLAn outputs of publication quality"""
# Copyright (c) 2014-2018 Clément Ranc & Arnaud Cassan
# Distributed under the terms of the MIT license
#
# This module is part of software:
# muLAn: gravitational MICROlensing Analysis code
# https://github.com/muLAn-p... | muLAn-projectREPO_NAMEmuLAnPATH_START.@muLAn_extracted@muLAn-master@muLAn@utils@muLAnFig.py@.PATH_END.py |
{
"filename": "_ticktextsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/sunburst/marker/colorbar/_ticktextsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicktextsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="ticktextsrc",
parent_name="sunburst.marker.colorbar",
**kwargs
):
super(TicktextsrcValidator, self).__init__(
plotly_n... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@sunburst@marker@colorbar@_ticktextsrc.py@.PATH_END.py |
{
"filename": "functional_api.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/guides/functional_api.py",
"type": "Python"
} | """
Title: The Functional API
Author: [fchollet](https://twitter.com/fchollet)
Date created: 2019/03/01
Last modified: 2020/04/12
Description: Complete guide to the functional API.
Accelerator: GPU
"""
"""
## Setup
"""
import numpy as np
import keras
from keras import layers
from keras import ops
"""
## Introduction... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@guides@functional_api.py@.PATH_END.py |
{
"filename": "test_combined_visualise.py",
"repo_name": "rhayes777/PyAutoFit",
"repo_path": "PyAutoFit_extracted/PyAutoFit-main/test_autofit/analysis/test_combined_visualise.py",
"type": "Python"
} | import pytest
import autofit as af
class Analysis(af.Analysis):
def visualize(self, paths, instance, during_analysis):
assert isinstance(instance, af.Gaussian)
assert during_analysis is True
paths.output_path.mkdir(parents=True, exist_ok=True)
with open(f"{paths.output_path}/visu... | rhayes777REPO_NAMEPyAutoFitPATH_START.@PyAutoFit_extracted@PyAutoFit-main@test_autofit@analysis@test_combined_visualise.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "GBTSpectroscopy/gbtpipe",
"repo_path": "gbtpipe_extracted/gbtpipe-master/README.md",
"type": "Markdown"
} | The `gbtpipe` package is a package for reducing and mapping On-the-fly mapping data created at the GBT in spectral line observations. The module consists of two main components:
* An installable version of the the GBTpipeline which is forked from NRAO's [gbt-pipeline](https://github.com/nrao/gbt-pipeline) package. T... | GBTSpectroscopyREPO_NAMEgbtpipePATH_START.@gbtpipe_extracted@gbtpipe-master@README.md@.PATH_END.py |
{
"filename": "SiGaps_08_VG03_f045.ipynb",
"repo_name": "Echelle/AO_bonding_paper",
"repo_path": "AO_bonding_paper_extracted/AO_bonding_paper-master/notebooks/SiGaps_08_VG03_f045.ipynb",
"type": "Jupyter Notebook"
} | ###This IPython Notebook is for performing a fit and generating a figure of the spectrum of sample VG03, in the region with ~4.5% fill factor
The filename of the figure is **VG03_f045.pdf**.
Author: Michael Gully-Santiago, `gully@astro.as.utexas.edu`
Date: January 13, 2015
```python
%pylab inline
import emcee
impo... | EchelleREPO_NAMEAO_bonding_paperPATH_START.@AO_bonding_paper_extracted@AO_bonding_paper-master@notebooks@SiGaps_08_VG03_f045.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/legend/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._yref import YrefValidator
from ._yanchor import YanchorValidator
from ._y import YValidator
from ._xref import XrefValidator
from ._xanchor import XanchorValidator
from ._x import XValidator
fr... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@legend@__init__.py@.PATH_END.py |
{
"filename": "tensorboard_vis.py",
"repo_name": "cy-xu/cosmic-conn",
"repo_path": "cosmic-conn_extracted/cosmic-conn-main/paper_utils/tensorboard_vis.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Plot the training evaluation figure for paper
CY Xu (cxu@ucsb.edu)
"""
import numpy as np
from numpy import genfromtxt
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
def extract_csv(path, max_epoch, scale_correction=False):
"""because Tensorboard export CSV is no... | cy-xuREPO_NAMEcosmic-connPATH_START.@cosmic-conn_extracted@cosmic-conn-main@paper_utils@tensorboard_vis.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/src/amuse/ic/_limepy/__init__.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
__author__ = 'Mark Gieles, Alice Zocchi'
__email__ = 'm.gieles@surrey.ac.uk, a.zocchi@surrey.ac.uk'
__version__ = '0.1.1'
from .limepy import limepy
from .sample import sample
| amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@src@amuse@ic@_limepy@__init__.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "jax-ml/jax",
"repo_path": "jax_extracted/jax-main/tests/filecheck/README.md",
"type": "Markdown"
} | This directory contains LLVM
[FileCheck](https://llvm.org/docs/CommandGuide/FileCheck.html) tests that verify
that JAX primitives can be lowered to MLIR.
These tests are intended to be a quick and easy-to-understand way to catch
regressions from changes due the MLIR Python bindings and from changes to the
various MLIR... | jax-mlREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@tests@filecheck@README.md@.PATH_END.py |
{
"filename": "human_parsing.py",
"repo_name": "itseez/opencv",
"repo_path": "opencv_extracted/opencv-master/samples/dnn/human_parsing.py",
"type": "Python"
} | #!/usr/bin/env python
'''
You can download the converted pb model from https://www.dropbox.com/s/qag9vzambhhkvxr/lip_jppnet_384.pb?dl=0
or convert the model yourself.
Follow these steps if you want to convert the original model yourself:
To get original .meta pre-trained model download https://drive.google.com/fil... | itseezREPO_NAMEopencvPATH_START.@opencv_extracted@opencv-master@samples@dnn@human_parsing.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "ArgonneCPAC/dsps",
"repo_path": "dsps_extracted/dsps-main/dsps/photometry/utils.py",
"type": "Python"
} | """Convenience functions commonly encountered in photometry calculations"""
import numpy as np
def interpolate_filter_trans_curves(wave_filters, trans_filters, n=None):
"""Interpolate a collection of filter transmission curves to a common length.
Convenience function for analyses vmapping over broadband color... | ArgonneCPACREPO_NAMEdspsPATH_START.@dsps_extracted@dsps-main@dsps@photometry@utils.py@.PATH_END.py |
{
"filename": "ModSMFromNp.py",
"repo_name": "saopicc/DDFacet",
"repo_path": "DDFacet_extracted/DDFacet-master/SkyModel/Sky/ModSMFromNp.py",
"type": "Python"
} | from __future__ import division, absolute_import, print_function
import numpy as np
def ReadFromNp(Cat0):
ns=Cat0.shape[0]
Cat=np.zeros((ns,),dtype=[('Name','|S200'),('ra',float),('dec',float),('Sref',float),('I',float),('Q',float),\
('U',float),('V',float),('RefFreq',float),(... | saopiccREPO_NAMEDDFacetPATH_START.@DDFacet_extracted@DDFacet-master@SkyModel@Sky@ModSMFromNp.py@.PATH_END.py |
{
"filename": "test_dims_dimensionproxy.py",
"repo_name": "h5py/h5py",
"repo_path": "h5py_extracted/h5py-master/h5py/tests/test_dims_dimensionproxy.py",
"type": "Python"
} | # This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
"""
Tests the h5py.Dataset.dims.DimensionProxy c... | h5pyREPO_NAMEh5pyPATH_START.@h5py_extracted@h5py-master@h5py@tests@test_dims_dimensionproxy.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "lenjonah/neutron_star_inference",
"repo_path": "neutron_star_inference_extracted/neutron_star_inference-main/README.md",
"type": "Markdown"
} | # Neural Simulation-Based Inference of the Neutron Star Equation of State directly from Telescope Spectra
Neutron stars provide a unique window into the unknown physics of extremely dense matter. Their internal structure is described by the relationship between pressure and energy density, $P(\varepsilon)$, commonly r... | lenjonahREPO_NAMEneutron_star_inferencePATH_START.@neutron_star_inference_extracted@neutron_star_inference-main@README.md@.PATH_END.py |
{
"filename": "test_pixel_likelihood.py",
"repo_name": "cta-observatory/ctapipe",
"repo_path": "ctapipe_extracted/ctapipe-main/src/ctapipe/image/tests/test_pixel_likelihood.py",
"type": "Python"
} | import numpy as np
from ctapipe.image import (
chi_squared,
mean_poisson_likelihood_full,
mean_poisson_likelihood_gaussian,
neg_log_likelihood,
neg_log_likelihood_approx,
neg_log_likelihood_numeric,
)
def test_chi_squared():
image = np.array([20, 20, 20])
prediction = np.array([20, 20... | cta-observatoryREPO_NAMEctapipePATH_START.@ctapipe_extracted@ctapipe-main@src@ctapipe@image@tests@test_pixel_likelihood.py@.PATH_END.py |
{
"filename": "_showexponent.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/carpet/baxis/_showexponent.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowexponentValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="showexponent", parent_name="carpet.baxis", **kwargs
):
super(ShowexponentValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@carpet@baxis@_showexponent.py@.PATH_END.py |
{
"filename": "recipe_test_unit.py",
"repo_name": "Keck-DataReductionPipelines/KPF-Pipeline",
"repo_path": "KPF-Pipeline_extracted/KPF-Pipeline-master/kpfpipe/tools/recipe_test_unit.py",
"type": "Python"
} | # test_recipe_unit.py
import sys, os, traceback
import tempfile
sys.path.insert(0, os.path.abspath('../KeckDRPFramework'))
from keckdrpframework.core.framework import Framework
from keckdrpframework.models.arguments import Arguments
from keckdrpframework.models.action import Action
from keckdrpframework.models.proces... | Keck-DataReductionPipelinesREPO_NAMEKPF-PipelinePATH_START.@KPF-Pipeline_extracted@KPF-Pipeline-master@kpfpipe@tools@recipe_test_unit.py@.PATH_END.py |
{
"filename": "response_chain.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/chains/openapi/response_chain.py",
"type": "Python"
} | """Response parser."""
import json
import re
from typing import Any
from langchain.chains.api.openapi.prompts import RESPONSE_TEMPLATE
from langchain.chains.llm import LLMChain
from langchain_core.language_models import BaseLanguageModel
from langchain_core.output_parsers import BaseOutputParser
from langchain_core.p... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@chains@openapi@response_chain.py@.PATH_END.py |
{
"filename": "test_html_parsers.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/unit_tests/document_loaders/parsers/test_html_parsers.py",
"type": "Python"
} | """Tests for the HTML parsers."""
from pathlib import Path
import pytest
from langchain_community.document_loaders.blob_loaders import Blob
from langchain_community.document_loaders.parsers.html import BS4HTMLParser
HERE = Path(__file__).parent
EXAMPLES = HERE.parent.parent.parent / "integration_tests" / "examples"... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@unit_tests@document_loaders@parsers@test_html_parsers.py@.PATH_END.py |
{
"filename": "donutImageCheck.py",
"repo_name": "lsst-ts/ts_wep",
"repo_path": "ts_wep_extracted/ts_wep-main/python/lsst/ts/wep/donutImageCheck.py",
"type": "Python"
} | # This file is part of ts_wep.
#
# Developed for the LSST Telescope and Site Systems.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This program is free software: you ... | lsst-tsREPO_NAMEts_wepPATH_START.@ts_wep_extracted@ts_wep-main@python@lsst@ts@wep@donutImageCheck.py@.PATH_END.py |
{
"filename": "design.py",
"repo_name": "rat-pac/rat-pac",
"repo_path": "rat-pac_extracted/rat-pac-master/python/couchdb/design.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""Utility code for managing design documents."""
from copy import deepcopy
from inspect import get... | rat-pacREPO_NAMErat-pacPATH_START.@rat-pac_extracted@rat-pac-master@python@couchdb@design.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.