metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "test_disp.py",
"repo_name": "cta-observatory/cta-lstchain",
"repo_path": "cta-lstchain_extracted/cta-lstchain-main/lstchain/reco/tests/test_disp.py",
"type": "Python"
} | import astropy.units as u
from ctapipe.containers import CameraHillasParametersContainer
import numpy as np
def test_disp():
from lstchain.reco.disp import disp_parameters_event
hillas = CameraHillasParametersContainer(
x=0.5 * u.m,
y=1.0 * u.m,
width=0.1 * u.m,
length=0.3 * u... | cta-observatoryREPO_NAMEcta-lstchainPATH_START.@cta-lstchain_extracted@cta-lstchain-main@lstchain@reco@tests@test_disp.py@.PATH_END.py |
{
"filename": "mlx_pipeline.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/llms/mlx_pipeline.py",
"type": "Python"
} | from __future__ import annotations
import logging
from typing import Any, Callable, Iterator, List, Mapping, Optional
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.language_models.llms import LLM
from langchain_core.outputs import GenerationChunk
from pydantic import ConfigDict
DE... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@llms@mlx_pipeline.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattergl/textfont/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(self, plotly_name="color", parent_name="scattergl.textfont", **kwargs):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattergl@textfont@_color.py@.PATH_END.py |
{
"filename": "test_populations.py",
"repo_name": "timothydmorton/VESPA",
"repo_path": "VESPA_extracted/VESPA-master/vespa/stars/tests/test_populations.py",
"type": "Python"
} | from __future__ import print_function, division
from ..populations import Raghavan_BinaryPopulation
from ..populations import MultipleStarPopulation
from ..populations import BGStarPopulation_TRILEGAL
import os, os.path
import tempfile
TMP = tempfile.gettempdir()
def test_raghavan(filename=os.path.join(TMP,'test_rag... | timothydmortonREPO_NAMEVESPAPATH_START.@VESPA_extracted@VESPA-master@vespa@stars@tests@test_populations.py@.PATH_END.py |
{
"filename": "ops_sim_atm.py",
"repo_name": "hpc4cmb/toast",
"repo_path": "toast_extracted/toast-main/src/toast/tests/ops_sim_atm.py",
"type": "Python"
} | # Copyright (c) 2015-2020 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
from .mpi import MPITestCase
import os
import shutil
import numpy as np
import numpy.testing as nt
from ..mpi import MPI
fr... | hpc4cmbREPO_NAMEtoastPATH_START.@toast_extracted@toast-main@src@toast@tests@ops_sim_atm.py@.PATH_END.py |
{
"filename": "fig8.ipynb",
"repo_name": "dtamayo/spock",
"repo_path": "spock_extracted/spock-master/paper_plots/fig8.ipynb",
"type": "Jupyter Notebook"
} | ```python
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.lines import Line2D
from celmech import Andoyer, AndoyerHamiltonian
from celmech.andoyer import get_Xstarres, get_Xstarunstable, get_Xstarnonres, get_Xsep
from sympy import init_printing
from matplotlib.patches import ConnectionPatch
from matp... | dtamayoREPO_NAMEspockPATH_START.@spock_extracted@spock-master@paper_plots@fig8.ipynb@.PATH_END.py |
{
"filename": "_weight.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/scene/annotation/hoverlabel/font/_weight.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WeightValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self,
plotly_name="weight",
parent_name="layout.scene.annotation.hoverlabel.font",
**kwargs,
):
super(WeightValidator, self).__init__(
plo... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@scene@annotation@hoverlabel@font@_weight.py@.PATH_END.py |
{
"filename": "fit_polynomial.py",
"repo_name": "arjunsavel/cortecs",
"repo_path": "cortecs_extracted/cortecs-main/src/cortecs/fit/fit_polynomial.py",
"type": "Python"
} | """
Module for fitting polynomial functions in temperature and pressure to opacity functions.
"""
import jax.numpy as jnp
import numpy as np
# todo: loop over all wavelengths.
def prep_polynomial(cross_section, **kargs):
pass
# @jax.jit
def fit_polynomial(
Z,
P,
T,
prep_res,
plot=False,
):... | arjunsavelREPO_NAMEcortecsPATH_START.@cortecs_extracted@cortecs-main@src@cortecs@fit@fit_polynomial.py@.PATH_END.py |
{
"filename": "excel.py",
"repo_name": "glue-viz/glue",
"repo_path": "glue_extracted/glue-main/glue/core/data_factories/excel.py",
"type": "Python"
} | import os
from glue.core.data_factories.helpers import has_extension
from glue.core.data_factories.pandas import panda_process
from glue.config import data_factory
__all__ = []
@data_factory(label="Excel", identifier=has_extension('xls xlsx'))
def panda_read_excel(path, sheet=None, **kwargs):
"""
A factory... | glue-vizREPO_NAMEgluePATH_START.@glue_extracted@glue-main@glue@core@data_factories@excel.py@.PATH_END.py |
{
"filename": "Finder_charts.py",
"repo_name": "fkiwy/Finder_charts",
"repo_path": "Finder_charts_extracted/Finder_charts-main/Finder_charts.py",
"type": "Python"
} | import os
import sys
import math
import warnings
import requests
import tempfile
import traceback
import subprocess
import collections
import numpy as np
from enum import Enum
from datetime import datetime
from PIL import Image, ImageOps
import matplotlib.pyplot as plt
from matplotlib.patches import BoxStyle, Rectangle... | fkiwyREPO_NAMEFinder_chartsPATH_START.@Finder_charts_extracted@Finder_charts-main@Finder_charts.py@.PATH_END.py |
{
"filename": "_namelength.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/splom/hoverlabel/_namelength.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NamelengthValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="namelength", parent_name="splom.hoverlabel", **kwargs
):
super(NamelengthValidator, self).__init__(
plotly_name=plotly_name,
pa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@splom@hoverlabel@_namelength.py@.PATH_END.py |
{
"filename": "demo_MBS_rev_limits.py",
"repo_name": "projectchrono/chrono",
"repo_path": "chrono_extracted/chrono-main/src/demos/python/mbs/demo_MBS_rev_limits.py",
"type": "Python"
} | # =============================================================================
# PROJECT CHRONO - http://projectchrono.org
#
# Copyright (c) 2014 projectchrono.org
# All rights reserved.
#
# Use of this source code is governed by a BSD-style license that can be found
# in the LICENSE file at the top level of the distr... | projectchronoREPO_NAMEchronoPATH_START.@chrono_extracted@chrono-main@src@demos@python@mbs@demo_MBS_rev_limits.py@.PATH_END.py |
{
"filename": "alias.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/setuptools/py2/setuptools/command/alias.py",
"type": "Python"
} | from distutils.errors import DistutilsOptionError
from setuptools.extern.six.moves import map
from setuptools.command.setopt import edit_config, option_base, config_file
def shquote(arg):
"""Quote an argument for later parsing by shlex.split()"""
for c in '"', "'", "\\", "#":
if c in arg:
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@setuptools@py2@setuptools@command@alias.py@.PATH_END.py |
{
"filename": "make_figure_11.ipynb",
"repo_name": "tcallister/autoregressive-bbh-inference",
"repo_path": "autoregressive-bbh-inference_extracted/autoregressive-bbh-inference-main/figures/make_figure_11.ipynb",
"type": "Jupyter Notebook"
} | ```python
import arviz as az
import matplotlib.pylab as plt
import matplotlib as mpl
mpl.style.use('plotting.mplstyle')
import numpy as np
np.random.seed(15)
import h5py
from read_O3_LVK_results import *
from scipy.special import erf
from scipy.optimize import minimize
```
```python
# Load AR results
precomputed_data... | tcallisterREPO_NAMEautoregressive-bbh-inferencePATH_START.@autoregressive-bbh-inference_extracted@autoregressive-bbh-inference-main@figures@make_figure_11.ipynb@.PATH_END.py |
{
"filename": "pyoscode_scipy.ipynb",
"repo_name": "fruzsinaagocs/oscode",
"repo_path": "oscode_extracted/oscode-master/examples/pyoscode_scipy.ipynb",
"type": "Jupyter Notebook"
} | ```python
import numpy as np
import pyoscode
import matplotlib.pyplot as plt
plt.ion()
import scipy.special as sp
import scipy.integrate
from scipy.optimize import minimize_scalar
import warnings
warnings.filterwarnings('ignore')
from ipywidgets import interact, IntSlider, FloatSlider,FloatLogSlider
%config InlineBac... | fruzsinaagocsREPO_NAMEoscodePATH_START.@oscode_extracted@oscode-master@examples@pyoscode_scipy.ipynb@.PATH_END.py |
{
"filename": "_cmax.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterpolar/marker/_cmax.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CmaxValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="cmax", parent_name="scatterpolar.marker", **kwargs):
super(CmaxValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterpolar@marker@_cmax.py@.PATH_END.py |
{
"filename": "LogResults.py",
"repo_name": "simoncasassus/ConeRot",
"repo_path": "ConeRot_extracted/ConeRot-master/RotOrient/LogResults.py",
"type": "Python"
} | import numpy as np
import re
def load(workdir, FixPAInc=False, RunMCMC=False):
file_log = workdir + 'log_output.txt'
print("loading file_log", file_log, "FixPAInc", FixPAInc)
fin = open(file_log, "r")
log_output = fin.readlines()
fin.close
#print( log_output)
#print( "entries:",len(log_o... | simoncasassusREPO_NAMEConeRotPATH_START.@ConeRot_extracted@ConeRot-master@RotOrient@LogResults.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/barpolar/selected/marker/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._opacity import OpacityValidator
from ._color import ColorValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._opac... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@barpolar@selected@marker@__init__.py@.PATH_END.py |
{
"filename": "roman_phasec.py",
"repo_name": "ajeldorado/falco-python",
"repo_path": "falco-python_extracted/falco-python-master/roman/roman_phasec.py",
"type": "Python"
} | # Copyright 2020 California Institute of Technology
# ------------------------------------------------------------------
#
# PUBLIC RELEASE VERSION (no ITAR error maps)
#
# Version 0.9, 15 June 2020, John Krist; beta-test version for mask evaluation
# Version 0.9.1, 29 June 2020, John Krist; rotated SPC pupils & Lyot... | ajeldoradoREPO_NAMEfalco-pythonPATH_START.@falco-python_extracted@falco-python-master@roman@roman_phasec.py@.PATH_END.py |
{
"filename": "python-reference_catboostclassifier_predict_proba.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/concepts/python-reference_catboostclassifier_predict_proba.md",
"type": "Markdown"
} | # predict_proba
{% include [sections-with-methods-desc-predict-proba__purpose__full-with-note__div](../_includes/work_src/reusage/predict-proba__purpose__full-with-note__div.md) %}
## {{ dl--invoke-format }} {#call-format}
```python
predict_proba(X,
ntree_start={{ fit--ntree_start }},
nt... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@concepts@python-reference_catboostclassifier_predict_proba.md@.PATH_END.py |
{
"filename": "generate_gaussian_alms.py",
"repo_name": "toshiyan/cmblensplus",
"repo_path": "cmblensplus_extracted/cmblensplus-master/example/curvedsky_utils/generate_gaussian_alms.py",
"type": "Python"
} | #!/usr/bin/env python
# coding: utf-8
# Generate random gaussian fields
# In[1]:
# external
import numpy as np
import healpy as hp
import matplotlib.pyplot as plt
# modules from curvedsky/wrap/
import curvedsky as cs
# Set parameters
# In[2]:
nside = 512 # Nside of Healpix map
npix = 12*nside**2 # Numer of ... | toshiyanREPO_NAMEcmblensplusPATH_START.@cmblensplus_extracted@cmblensplus-master@example@curvedsky_utils@generate_gaussian_alms.py@.PATH_END.py |
{
"filename": "SavingAndLoadingSimulations.ipynb",
"repo_name": "dtamayo/reboundx",
"repo_path": "reboundx_extracted/reboundx-main/ipython_examples/SavingAndLoadingSimulations.ipynb",
"type": "Jupyter Notebook"
} | # Saving and Reloading Simulations
Here we show how to save a binary field with all the parameters for particles and the simulation's REBOUNDx effects. We begin with a one planet system subject to general relativity corrections:
```python
import rebound
import numpy as np
sim = rebound.Simulation()
sim.add(m=1., has... | dtamayoREPO_NAMEreboundxPATH_START.@reboundx_extracted@reboundx-main@ipython_examples@SavingAndLoadingSimulations.ipynb@.PATH_END.py |
{
"filename": "Planck_CMB_HILC.ipynb",
"repo_name": "jcolinhill/pyilc",
"repo_path": "pyilc_extracted/pyilc-main/notebooks/Planck_CMB_HILC.ipynb",
"type": "Jupyter Notebook"
} | ```python
import sys
import os
import matplotlib.pyplot as plt
import numpy as np
import healpy as hp
```
```python
pyilc_folder ='../'
sys.path.insert(1,pyilc_folder+'pyilc/')
from input import ILCInfo
from wavelets import Wavelets, wavelet_ILC, harmonic_ILC
```
```python
# this file is where the preproces... | jcolinhillREPO_NAMEpyilcPATH_START.@pyilc_extracted@pyilc-main@notebooks@Planck_CMB_HILC.ipynb@.PATH_END.py |
{
"filename": "fitting.py",
"repo_name": "cta-observatory/ctapipe",
"repo_path": "ctapipe_extracted/ctapipe-main/src/ctapipe/image/muon/fitting.py",
"type": "Python"
} | import numpy as np
from astropy.units import Quantity
from ...exceptions import OptionalDependencyMissing
from ...utils.quantities import all_to_value
__all__ = ["kundu_chaudhuri_circle_fit", "taubin_circle_fit"]
try:
from iminuit import Minuit
except ModuleNotFoundError:
Minuit = None
def kundu_chaudhuri_... | cta-observatoryREPO_NAMEctapipePATH_START.@ctapipe_extracted@ctapipe-main@src@ctapipe@image@muon@fitting.py@.PATH_END.py |
{
"filename": "test_hdulist.py",
"repo_name": "spacetelescope/PyFITS",
"repo_path": "PyFITS_extracted/PyFITS-master/pyfits/tests/test_hdulist.py",
"type": "Python"
} | from __future__ import division, with_statement # confidence high
import glob
import os
import sys
import numpy as np
from ..extern.six import BytesIO
import pyfits as fits
from ..verify import VerifyError
from . import PyfitsTestCase
from .util import ignore_warnings
from nose.tools import assert_raises
from war... | spacetelescopeREPO_NAMEPyFITSPATH_START.@PyFITS_extracted@PyFITS-master@pyfits@tests@test_hdulist.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "astrom-tom/dfitspy",
"repo_path": "dfitspy_extracted/dfitspy-master/dfitspy/docs/source/conf.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | astrom-tomREPO_NAMEdfitspyPATH_START.@dfitspy_extracted@dfitspy-master@dfitspy@docs@source@conf.py@.PATH_END.py |
{
"filename": "python__parameters__cat_features__div.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage/python__parameters__cat_features__div.md",
"type": "Markdown"
} |
A one-dimensional array of categorical columns indices (specified as integers) or names (specified as strings).
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage@python__parameters__cat_features__div.md@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "ntessore/wigner",
"repo_path": "wigner_extracted/wigner-main/python/README.md",
"type": "Markdown"
} | ***wigner*** package for Python
===============================
The ***wigner*** package for Python contains bindings to the *wigner* C library
for computing Wigner d functions and 3j symbols.
Functions are provided with minimal wrapping:
```py
>>> import wigner
>>> wigner.wigner_3jj(2, 3, -1, 2)
(1.0, 5.0, [-0.308,... | ntessoreREPO_NAMEwignerPATH_START.@wigner_extracted@wigner-main@python@README.md@.PATH_END.py |
{
"filename": "galevo.py",
"repo_name": "Azeret/galIMF",
"repo_path": "galIMF_extracted/galIMF-master/galevo.py",
"type": "Python"
} | # A python3 code
# This is a single-zone closed-box galaxy chemical evolution module.
# It is coupled with a variable galaxy-wide IMF that depends on the galactic property at the time of star formation.
# The stellar population forms at every 10 Myr (the shortest time step) over 10 Gyr;
# with each stellar population a... | AzeretREPO_NAMEgalIMFPATH_START.@galIMF_extracted@galIMF-master@galevo.py@.PATH_END.py |
{
"filename": "eigenproblem.py",
"repo_name": "minkailin/stratsi",
"repo_path": "stratsi_extracted/stratsi-master/caseB/eigenproblem.py",
"type": "Python"
} | from dedalus.tools.cache import CachedAttribute
from dedalus.core.field import Field
import dedalus.public as de
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import interp1d
import scipy.sparse.linalg
tol = 1e-12
class Eigenproblem():
def __init__(self, EVP, sparse=False):
"""
... | minkailinREPO_NAMEstratsiPATH_START.@stratsi_extracted@stratsi-master@caseB@eigenproblem.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/heatmapgl/legendgrouptitle/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._font import Font
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(__name__, [], ["._font.Font"])
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@heatmapgl@legendgrouptitle@__init__.py@.PATH_END.py |
{
"filename": "toy_xspec_point_source.py",
"repo_name": "lucabaldini/ixpeobssim",
"repo_path": "ixpeobssim_extracted/ixpeobssim-main/ixpeobssim/config/toy_xspec_point_source.py",
"type": "Python"
} | #!/usr/bin/env python
#
# Copyright (C) 2015--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 versio... | lucabaldiniREPO_NAMEixpeobssimPATH_START.@ixpeobssim_extracted@ixpeobssim-main@ixpeobssim@config@toy_xspec_point_source.py@.PATH_END.py |
{
"filename": "test_transforms.py",
"repo_name": "pyro-ppl/numpyro",
"repo_path": "numpyro_extracted/numpyro-master/test/test_transforms.py",
"type": "Python"
} | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from collections import namedtuple
from functools import partial
import math
import numpy as np
import pytest
import jax
from jax import jacfwd, jit, random, vmap
import jax.numpy as jnp
from numpyro.distributions import constraints... | pyro-pplREPO_NAMEnumpyroPATH_START.@numpyro_extracted@numpyro-master@test@test_transforms.py@.PATH_END.py |
{
"filename": "_cmax.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/icicle/marker/_cmax.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CmaxValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="cmax", parent_name="icicle.marker", **kwargs):
super(CmaxValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@icicle@marker@_cmax.py@.PATH_END.py |
{
"filename": "AvailableComponents.py",
"repo_name": "ACS-Community/ACS",
"repo_path": "ACS_extracted/ACS-master/LGPL/CommonSoftware/acssim/src/Acssim/Widgets/AvailableComponents.py",
"type": "Python"
} | # @(#) $Id$
#
# Copyright (C) 2001
# Associated Universities, Inc. Washington DC, USA.
#
# Produced for the ALMA project
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Library General Public License as published by the Free
# Software Foundation; either version ... | ACS-CommunityREPO_NAMEACSPATH_START.@ACS_extracted@ACS-master@LGPL@CommonSoftware@acssim@src@Acssim@Widgets@AvailableComponents.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "huggingface/peft",
"repo_path": "peft_extracted/peft-main/src/peft/tuners/lokr/__init__.py",
"type": "Python"
} | # Copyright 2023-present the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | huggingfaceREPO_NAMEpeftPATH_START.@peft_extracted@peft-main@src@peft@tuners@lokr@__init__.py@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/heatmap/legendgrouptitle/_font.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "heatmap.legendgrouptitle"
_path_str = "heatmap.legendgrouptitle.font"
_valid_props = {
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@heatmap@legendgrouptitle@_font.py@.PATH_END.py |
{
"filename": "bayesian_imputation.ipynb",
"repo_name": "pyro-ppl/numpyro",
"repo_path": "numpyro_extracted/numpyro-master/notebooks/source/bayesian_imputation.ipynb",
"type": "Jupyter Notebook"
} | # Bayesian Imputation
Real-world datasets often contain many missing values. In those situations, we have to either remove those missing data (also known as "complete case") or replace them by some values. Though using complete case is pretty straightforward, it is only applicable when the number of missing entries is... | pyro-pplREPO_NAMEnumpyroPATH_START.@numpyro_extracted@numpyro-master@notebooks@source@bayesian_imputation.ipynb@.PATH_END.py |
{
"filename": "_bordercolorsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/waterfall/hoverlabel/_bordercolorsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BordercolorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="bordercolorsrc", parent_name="waterfall.hoverlabel", **kwargs
):
super(BordercolorsrcValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@waterfall@hoverlabel@_bordercolorsrc.py@.PATH_END.py |
{
"filename": "cosmo_derived.ipynb",
"repo_name": "marius311/cosmoslik",
"repo_path": "cosmoslik_extracted/cosmoslik-master/cosmoslik_plugins/models/cosmo_derived/cosmo_derived.ipynb",
"type": "Jupyter Notebook"
} | # cosmo_derived
This plugin calculates the following "derived" cosmological quantities:
* $H(z)$
* $D_A(z)$
* $r_s(z)$
* $\theta_s(z)$
* $z_{\rm drag}$ (Hu & Sugiyama fitting formula)
It can also be used as a $\theta$ to $H_0$ converter.
Credit: Lloyd Knox, code adapted by Marius Millea
```python
from cosmoslik im... | marius311REPO_NAMEcosmoslikPATH_START.@cosmoslik_extracted@cosmoslik-master@cosmoslik_plugins@models@cosmo_derived@cosmo_derived.ipynb@.PATH_END.py |
{
"filename": "run.py",
"repo_name": "ratt-ru/Stimela-classic",
"repo_path": "Stimela-classic_extracted/Stimela-classic-master/stimela/cargo/cab/casa_plotants/src/run.py",
"type": "Python"
} | # -*- coding: future_fstrings -*-
import Crasa.Crasa as crasa
from scabha import config, parameters_dict, prun
print(f"Running CASA task '{config.binary}'")
task = crasa.CasaTask(config.binary, **parameters_dict)
task.run()
| ratt-ruREPO_NAMEStimela-classicPATH_START.@Stimela-classic_extracted@Stimela-classic-master@stimela@cargo@cab@casa_plotants@src@run.py@.PATH_END.py |
{
"filename": "compare_beams.py",
"repo_name": "amanchokshi/EMBERS",
"repo_path": "EMBERS_extracted/EMBERS-master/src/embers/kindle/compare_beams.py",
"type": "Python"
} | """
Compare Beams
-------------
compare measured MWA beam slices to FEE beam models
"""
import argparse
from pathlib import Path
from embers.tile_maps.compare_beams import batch_compare_beam
def main():
"""
Compare measured MWA beam maps with MWA FEE models using the :func:`~embers.tile_maps.compare_beams... | amanchokshiREPO_NAMEEMBERSPATH_START.@EMBERS_extracted@EMBERS-master@src@embers@kindle@compare_beams.py@.PATH_END.py |
{
"filename": "template.py",
"repo_name": "dullemond/radmc3d-2.0",
"repo_path": "radmc3d-2.0_extracted/radmc3d-2.0-master/python/radmc3dPy/radmc3dPy/models/template.py",
"type": "Python"
} | """This is a radmc3dPy model template
This template is an empty model, i.e. all model functions return zeros in the appropriate arrays and dimensions.
The purpose of this model is to illustrate the names and syntax of the model functions. Hence, this file can
be a starting point for implementing new models in the li... | dullemondREPO_NAMEradmc3d-2.0PATH_START.@radmc3d-2.0_extracted@radmc3d-2.0-master@python@radmc3dPy@radmc3dPy@models@template.py@.PATH_END.py |
{
"filename": "fit_spectra.py",
"repo_name": "nanograv/holodeck",
"repo_path": "holodeck_extracted/holodeck-main/holodeck/librarian/fit_spectra.py",
"type": "Python"
} | """Script and methods to fit simulated GWB spectra with analytic functions.
Usage (fit_spectra.py)
----------------------
For usage information, run the script with the ``-h`` or ``--help`` arguments, i.e.::
python -m holodeck.librarian.fit_spectra -h
Typically, the only argument required is the path to the fold... | nanogravREPO_NAMEholodeckPATH_START.@holodeck_extracted@holodeck-main@holodeck@librarian@fit_spectra.py@.PATH_END.py |
{
"filename": "test_load_table.py",
"repo_name": "mgckind/easyaccess",
"repo_path": "easyaccess_extracted/easyaccess-master/tests/test_load_table.py",
"type": "Python"
} | #!/usr/bin/env python
"""
Script for testing table upload.
"""
__author__ = "Alex Drlica-Wagner"
import os
from os.path import splitext
from glob import glob
import subprocess as sub
import numpy as np
import pandas as pd
import fitsio
import easyaccess as ea
BASENAME = 'load_table_test'
BASENAME2 = BASENAME + '2'
BA... | mgckindREPO_NAMEeasyaccessPATH_START.@easyaccess_extracted@easyaccess-master@tests@test_load_table.py@.PATH_END.py |
{
"filename": "RosenbrockModule.py",
"repo_name": "BradGreig/21CMMC",
"repo_path": "21CMMC_extracted/21CMMC-master/21CMMC_SourceCode/Programs/CosmoHammer_21CMMC/likelihood/module/RosenbrockModule.py",
"type": "Python"
} | import numpy as np
class RosenbrockModule(object):
def __init__(self):
self.a1 = 100.0
self.a2 = 20.0
def computeLikelihood(self, ctx):
p = ctx.getParams()
return -(self.a1 * (p[1]-p[0]**2)**2 + (1-p[0])**2)/self.a2
def setup(self):
print "Rosenbrock setup" | BradGreigREPO_NAME21CMMCPATH_START.@21CMMC_extracted@21CMMC-master@21CMMC_SourceCode@Programs@CosmoHammer_21CMMC@likelihood@module@RosenbrockModule.py@.PATH_END.py |
{
"filename": "example_parser_configuration_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/util/example_parser_configuration_test.py",
"type": "Python"
} | # Copyright 2016 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@util@example_parser_configuration_test.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/ternary/baxis/tickfont/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="layout.ternary.baxis.tickfont", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@ternary@baxis@tickfont@_color.py@.PATH_END.py |
{
"filename": "simulate_a_perfect_survey.py",
"repo_name": "TRASAL/frbpoppy",
"repo_path": "frbpoppy_extracted/frbpoppy-master/examples/simulate_a_perfect_survey.py",
"type": "Python"
} | """Example of simulating a perfect survey."""
from frbpoppy import CosmicPopulation, Survey, SurveyPopulation, plot
# Generate an FRB population
cosmic_pop = CosmicPopulation.simple(1e4, generate=True)
# Setup a survey
survey = Survey('perfect')
# Observe the FRB population
survey_pop = SurveyPopulation(cosmic_pop, ... | TRASALREPO_NAMEfrbpoppyPATH_START.@frbpoppy_extracted@frbpoppy-master@examples@simulate_a_perfect_survey.py@.PATH_END.py |
{
"filename": "test_gmf_models.py",
"repo_name": "me-manu/gammaALPs",
"repo_path": "gammaALPs_extracted/gammaALPs-master/tests/test_gmf_models.py",
"type": "Python"
} | from __future__ import absolute_import, division, print_function
import numpy as np
import os
import gammaALPs
from numpy.testing import assert_allclose
from gammaALPs.bfields import gmf
from astropy.tests.helper import pytest
@pytest.fixture(scope='module')
def jansson_file(request, tmpdir_factory):
path = tmpdi... | me-manuREPO_NAMEgammaALPsPATH_START.@gammaALPs_extracted@gammaALPs-master@tests@test_gmf_models.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "jluastro/PopSyCLE",
"repo_path": "PopSyCLE_extracted/PopSyCLE-main/docs/conf.py",
"type": "Python"
} | # Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import os
import sys
sys.path.insert(0, os.path.abspath('../../'))
sys.path.insert(0, os.path.abspath('../../popsycle... | jluastroREPO_NAMEPopSyCLEPATH_START.@PopSyCLE_extracted@PopSyCLE-main@docs@conf.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "projectchrono/chrono",
"repo_path": "chrono_extracted/chrono-main/data/models/FlightHelmet/README.md",
"type": "Markdown"
} | Donated by Microsoft for glTF testing
[](http://creativecommons.org/publicdomain/zero/1.0/)
To the extent possible under law, Microsoft has waived all copyright and related or neighboring rights to this asset.
| projectchronoREPO_NAMEchronoPATH_START.@chrono_extracted@chrono-main@data@models@FlightHelmet@README.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "ebachelet/pyLIMA",
"repo_path": "pyLIMA_extracted/pyLIMA-master/pyLIMA/xallarap/__init__.py",
"type": "Python"
} | ebacheletREPO_NAMEpyLIMAPATH_START.@pyLIMA_extracted@pyLIMA-master@pyLIMA@xallarap@__init__.py@.PATH_END.py | |
{
"filename": "data.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/datasets/star98/data.py",
"type": "Python"
} | """Star98 Educational Testing dataset."""
from statsmodels.datasets import utils as du
__docformat__ = 'restructuredtext'
COPYRIGHT = """Used with express permission from the original author,
who retains all rights."""
TITLE = "Star98 Educational Dataset"
SOURCE = """
Jeff Gill's `Generalized Linear Mode... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@datasets@star98@data.py@.PATH_END.py |
{
"filename": "hard_coded_constants.py",
"repo_name": "small-body-dynamics/SBDynT",
"repo_path": "SBDynT_extracted/SBDynT-main/src/hard_coded_constants.py",
"type": "Python"
} | import numpy as np
# set of reasonable whfast simulation timesteps for each planet
# (1/20 of its orbital period for terrestrial planets, 1/30 for giants)
# dt[0] is a placeholder since the planets are indexed starting
# at 1 instad of at 0
# values are in years
dt = [0.00001, 0.012, 0.03, 0.05, 0.09, 0.4, 0.98, 2.7,... | small-body-dynamicsREPO_NAMESBDynTPATH_START.@SBDynT_extracted@SBDynT-main@src@hard_coded_constants.py@.PATH_END.py |
{
"filename": "_align.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/table/hoverlabel/_align.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class AlignValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="align", parent_name="table.hoverlabel", **kwargs):
super(AlignValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@table@hoverlabel@_align.py@.PATH_END.py |
{
"filename": "_name.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/bar/marker/colorbar/tickformatstop/_name.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="name",
parent_name="bar.marker.colorbar.tickformatstop",
**kwargs
):
super(NameValidator, self).__init__(
plotly_name=plot... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@bar@marker@colorbar@tickformatstop@_name.py@.PATH_END.py |
{
"filename": "_variant.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/scene/xaxis/title/font/_variant.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="variant",
parent_name="layout.scene.xaxis.title.font",
**kwargs,
):
super(VariantValidator, self).__init__(
plotly_... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@scene@xaxis@title@font@_variant.py@.PATH_END.py |
{
"filename": "_showticklabels.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/densitymap/colorbar/_showticklabels.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowticklabelsValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="showticklabels", parent_name="densitymap.colorbar", **kwargs
):
super(ShowticklabelsValidator, self).__init__(
plotly_name=plotly_name,... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@densitymap@colorbar@_showticklabels.py@.PATH_END.py |
{
"filename": "twilio.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/utilities/twilio.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.utilities import TwilioAPIWrapper
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEP... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@utilities@twilio.py@.PATH_END.py |
{
"filename": "minimization_handler_stix.py",
"repo_name": "hmuellergoe/mrbeam",
"repo_path": "mrbeam_extracted/mrbeam-main/mr_beam/imagingbase/imagingbase/minimization_handler_stix.py",
"type": "Python"
} | import numpy as np
import ehtim as eh
from imagingbase.ehtim_wrapper import EhtimWrapper, EhtimFunctional, EhtimOperator
from regpy.operators import CoordinateProjection
from regpy.solvers import HilbertSpaceSetting
from regpy.solvers.forward_backward_splitting import Forward_Backward_Splitting
from imagingbase.solver... | hmuellergoeREPO_NAMEmrbeamPATH_START.@mrbeam_extracted@mrbeam-main@mr_beam@imagingbase@imagingbase@minimization_handler_stix.py@.PATH_END.py |
{
"filename": "Benchmark_2.ipynb",
"repo_name": "Magritte-code/pomme",
"repo_path": "pomme_extracted/pomme-main/docs/src/benchmarks/Benchmark_2.ipynb",
"type": "Jupyter Notebook"
} | # Benchmark 2
---
```python
import matplotlib.pyplot as plt
import numpy as np
import torch.nn as nn
import torch
from torch.optim import Adam
from tqdm import tqdm
from astropy import units, constants
from ipywidgets import interact
from pomme.ut... | Magritte-codeREPO_NAMEpommePATH_START.@pomme_extracted@pomme-main@docs@src@benchmarks@Benchmark_2.ipynb@.PATH_END.py |
{
"filename": "plot-pgm.ipynb",
"repo_name": "smoh/kinesis",
"repo_path": "kinesis_extracted/kinesis-master/hyades/plot-pgm.ipynb",
"type": "Jupyter Notebook"
} | ```python
"""Plot graphical model for the full model"""
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import daft
print(f"matplotlib=={matplotlib.__version__}")
print(f"daft=={daft.__version__}")
```
matplotlib==3.1.2
daft==0.1.0
```python
import kinesis as kn
kn.set_mpl_style()
pl... | smohREPO_NAMEkinesisPATH_START.@kinesis_extracted@kinesis-master@hyades@plot-pgm.ipynb@.PATH_END.py |
{
"filename": "safe_imports.py",
"repo_name": "rapidsai/cuml",
"repo_path": "cuml_extracted/cuml-main/python/cuml/cuml/internals/safe_imports.py",
"type": "Python"
} | #
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | rapidsaiREPO_NAMEcumlPATH_START.@cuml_extracted@cuml-main@python@cuml@cuml@internals@safe_imports.py@.PATH_END.py |
{
"filename": "test_rockstar_hlist_reader.py",
"repo_name": "astropy/halotools",
"repo_path": "halotools_extracted/halotools-master/halotools/sim_manager/tests/test_rockstar_hlist_reader.py",
"type": "Python"
} | """ This module provides unit-testing for
the `~halotools.sim_manager.RockstarHlistReader` class.
"""
import numpy as np
import os
import shutil
from unittest import TestCase
import pytest
from astropy.table import Table
from astropy.utils.misc import NumpyRNGContext
from pathlib import Path
from astropy.utils.data im... | astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@halotools@sim_manager@tests@test_rockstar_hlist_reader.py@.PATH_END.py |
{
"filename": "absorption_spectrum_fit.py",
"repo_name": "trident-project/trident",
"repo_path": "trident_extracted/trident-main/trident/absorption_spectrum/absorption_spectrum_fit.py",
"type": "Python"
} | from yt.utilities.on_demand_imports import _h5py as h5py
import numpy as np
from trident.absorption_spectrum.absorption_line import \
voigt
from yt.funcs import \
mylog
from yt.units.yt_array import \
YTArray
from yt.utilities.on_demand_imports import \
_scipy
optimize = _scipy.optimize
def generate_... | trident-projectREPO_NAMEtridentPATH_START.@trident_extracted@trident-main@trident@absorption_spectrum@absorption_spectrum_fit.py@.PATH_END.py |
{
"filename": "_separatethousands.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/scene/yaxis/_separatethousands.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SeparatethousandsValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name="separatethousands",
parent_name="layout.scene.yaxis",
**kwargs,
):
super(SeparatethousandsValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@scene@yaxis@_separatethousands.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "lsst-uk/lasair-lsst",
"repo_path": "lasair-lsst_extracted/lasair-lsst-main/deploy/roles/zookeeper/README.md",
"type": "Markdown"
} | Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required... | lsst-ukREPO_NAMElasair-lsstPATH_START.@lasair-lsst_extracted@lasair-lsst-main@deploy@roles@zookeeper@README.md@.PATH_END.py |
{
"filename": "tabarray.py",
"repo_name": "kapteyn-astro/kapteyn",
"repo_path": "kapteyn_extracted/kapteyn-master/kapteyn/tabarray.py",
"type": "Python"
} | #----------------------------------------------------------------------
# FILE: tabarray.py
# PURPOSE: This module provides a class which allows the user to read,
# write and manipulate simple table-like structures.
# It is based on NumPy and the table-reading part has been
# optimized for... | kapteyn-astroREPO_NAMEkapteynPATH_START.@kapteyn_extracted@kapteyn-master@kapteyn@tabarray.py@.PATH_END.py |
{
"filename": "demo_SEN_lidar.py",
"repo_name": "projectchrono/chrono",
"repo_path": "chrono_extracted/chrono-main/src/demos/python/sensor/demo_SEN_lidar.py",
"type": "Python"
} | # =============================================================================
# PROJECT CHRONO - http://projectchrono.org
#
# Copyright (c) 2019 projectchrono.org
# All rights reserved.
#
# Use of this source code is governed by a BSD-style license that can be found
# in the LICENSE file at the top level of the distr... | projectchronoREPO_NAMEchronoPATH_START.@chrono_extracted@chrono-main@src@demos@python@sensor@demo_SEN_lidar.py@.PATH_END.py |
{
"filename": "plot_scalable_poly_kernels.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/examples/kernel_approximation/plot_scalable_poly_kernels.py",
"type": "Python"
} | """
======================================================
Scalable learning with polynomial kernel approximation
======================================================
.. currentmodule:: sklearn.kernel_approximation
This example illustrates the use of :class:`PolynomialCountSketch` to
efficiently generate polynomial... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@examples@kernel_approximation@plot_scalable_poly_kernels.py@.PATH_END.py |
{
"filename": "log.py",
"repo_name": "fritz-marshal/fritz",
"repo_path": "fritz_extracted/fritz-main/launcher/commands/log.py",
"type": "Python"
} | import subprocess
def log():
"""Show SkyPortal's colorized logs while Fritz is running"""
p = subprocess.run(
[
"docker",
"exec",
"-i",
"skyportal-web-1",
"/bin/bash",
"-c",
"source /skyportal_env/bin/activate; make lo... | fritz-marshalREPO_NAMEfritzPATH_START.@fritz_extracted@fritz-main@launcher@commands@log.py@.PATH_END.py |
{
"filename": "_minexponent.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/carpet/baxis/_minexponent.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MinexponentValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="minexponent", parent_name="carpet.baxis", **kwargs):
super(MinexponentValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@carpet@baxis@_minexponent.py@.PATH_END.py |
{
"filename": "test_expression_engine.py",
"repo_name": "cta-observatory/ctapipe",
"repo_path": "ctapipe_extracted/ctapipe-main/src/ctapipe/core/tests/test_expression_engine.py",
"type": "Python"
} | import pickle
import pytest
from ctapipe.core.expression_engine import ExpressionEngine, ExpressionError
def test_failing_expression():
"""Test for invalid syntax in expression"""
expressions = [("syntax-error", "log(a")]
with pytest.raises(ExpressionError) as err:
ExpressionEngine(expressions=... | cta-observatoryREPO_NAMEctapipePATH_START.@ctapipe_extracted@ctapipe-main@src@ctapipe@core@tests@test_expression_engine.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "gammapy/gammapy",
"repo_path": "gammapy_extracted/gammapy-main/gammapy/irf/edisp/__init__.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .core import EnergyDispersion2D
from .kernel import EDispKernel
from .map import EDispKernelMap, EDispMap
__all__ = [
"EDispKernel",
"EDispKernelMap",
"EDispMap",
"EnergyDispersion2D",
]
| gammapyREPO_NAMEgammapyPATH_START.@gammapy_extracted@gammapy-main@gammapy@irf@edisp@__init__.py@.PATH_END.py |
{
"filename": "DbAdmin.md",
"repo_name": "EranOfek/AstroPack",
"repo_path": "AstroPack_extracted/AstroPack-main/matlab/util/+db/doc/DbAdmin.md",
"type": "Markdown"
} | # Overview
## General
## Database Configuration File
### Database.DbConnections.UnitTest
config/Database.DbConnections.UnitTest.yml
or (note that files in config/local/ override the same file in config/)
config/local/Database.DbConnections.UnitTest.yml
# Edit this file and save it in config/local/
Dat... | EranOfekREPO_NAMEAstroPackPATH_START.@AstroPack_extracted@AstroPack-main@matlab@util@+db@doc@DbAdmin.md@.PATH_END.py |
{
"filename": "hard.py",
"repo_name": "lwang-astro/PeTar",
"repo_path": "PeTar_extracted/PeTar-master/tools/analysis/hard.py",
"type": "Python"
} | from .base import *
from .data import *
from .functions import *
class SDARParticle(SimpleParticle):
""" SDAR particle
keys: (class members)
mass (1D): mass
pos (2D,3): postion x, y, z
vel (2D,3): velocity vx, vy, vz
radius (1D): stellar radius for interruption check
id ... | lwang-astroREPO_NAMEPeTarPATH_START.@PeTar_extracted@PeTar-master@tools@analysis@hard.py@.PATH_END.py |
{
"filename": "_kernel_pca.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scikit-learn/py3/sklearn/decomposition/_kernel_pca.py",
"type": "Python"
} | """Kernel Principal Components Analysis."""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# Sylvain Marie <sylvain.marie@schneider-electric.com>
# License: BSD 3 clause
from numbers import Integral, Real
import numpy as np
from scipy import linalg
from scipy.linalg import eigh
from scipy.sparse.linalg imp... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scikit-learn@py3@sklearn@decomposition@_kernel_pca.py@.PATH_END.py |
{
"filename": "_cmin.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/cone/_cmin.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CminValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="cmin", parent_name="cone", **kwargs):
super(CminValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@cone@_cmin.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "callendeprieto/synple",
"repo_path": "synple_extracted/synple-master/README.md",
"type": "Markdown"
} | # synple
An Easy-to-Use Python Wrapper for the Spectral Synthesis Code Synspec
** install **
Starting in the main synple directory
1- Compile synspec and rotin
Make sure you have a fortran compiler -- gfortran, is expected and
if you are using a different compiler you will need to modify the
makefile according... | callendeprietoREPO_NAMEsynplePATH_START.@synple_extracted@synple-master@README.md@.PATH_END.py |
{
"filename": "test_utils.py",
"repo_name": "CPM-project/MCPM",
"repo_path": "MCPM_extracted/MCPM-master/source/MCPM/tests/test_utils.py",
"type": "Python"
} | import numpy as np
import MCPM.utils as utils
def test_pixel_list_center():
expected_1 = np.array([[ 99, 199], [ 99, 200], [ 99, 201], [100, 199],
[100, 200], [100, 201], [101, 199], [101, 200], [101, 201]])
expected_2 = np.array([[399, 299], [399, 300], [399, 301], [399, 302],
[399, 303], ... | CPM-projectREPO_NAMEMCPMPATH_START.@MCPM_extracted@MCPM-master@source@MCPM@tests@test_utils.py@.PATH_END.py |
{
"filename": "test.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/libs/model/model_export/ut/test.py",
"type": "Python"
} | import numpy as np
import os
import pytest
import re
import yatest
from catboost import Pool, CatBoost, CatBoostClassifier
from catboost_pytest_lib import data_file, load_pool_features_as_df
CATBOOST_APP_PATH = yatest.common.binary_path('catboost/app/catboost')
APPROXIMATE_DIFF_PATH = yatest.common.binary_path('catbo... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@libs@model@model_export@ut@test.py@.PATH_END.py |
{
"filename": "test_join.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/indexes/period/test_join.py",
"type": "Python"
} | import numpy as np
import pytest
from pandas._libs.tslibs import IncompatibleFrequency
from pandas import (
DataFrame,
Index,
PeriodIndex,
date_range,
period_range,
)
import pandas._testing as tm
class TestJoin:
def test_join_outer_indexer(self):
pi = period_range("1/1/2000", "1/20/2... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@indexes@period@test_join.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "GBTAmmoniaSurvey/GAS",
"repo_path": "GAS_extracted/GAS-master/GAS/__init__.py",
"type": "Python"
} | # Licensed under a MIT style license - see LICENSE
"""
This is a package to process the GBT Ammonia Survey (GAS) data. It includes a calibration funtion
that (wrapper of gbtpipeline), an imaging function which creates the reduced data cubes, and the
first look analysis tools. It is setup to run at Green Bank. This p... | GBTAmmoniaSurveyREPO_NAMEGASPATH_START.@GAS_extracted@GAS-master@GAS@__init__.py@.PATH_END.py |
{
"filename": "test_checksum.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/pyfits/tests/test_checksum.py",
"type": "Python"
} | from __future__ import division, with_statement # confidence high
import contextlib
import sys
import warnings
import numpy as np
import pyfits as fits
from ..hdu.base import _ValidHDU
from . import PyfitsTestCase
from .test_table import comparerecords
class TestChecksumFunctions(PyfitsTestCase):
# All check... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@pyfits@tests@test_checksum.py@.PATH_END.py |
{
"filename": "event_sampling.py",
"repo_name": "gammapy/gammapy",
"repo_path": "gammapy_extracted/gammapy-main/examples/tutorials/analysis-3d/event_sampling.py",
"type": "Python"
} | """
Event sampling
==============
Learn to sampling events from a given sky model and IRFs.
Prerequisites
-------------
To understand how to generate a model and a `~gammapy.datasets.MapDataset` and how to fit
the data, please refer to the `~gammapy.modeling.models.SkyModel` and
:doc:`/tutorials/analysis-3d/simulate... | gammapyREPO_NAMEgammapyPATH_START.@gammapy_extracted@gammapy-main@examples@tutorials@analysis-3d@event_sampling.py@.PATH_END.py |
{
"filename": "apero_lbl_compute_nirps_he.py",
"repo_name": "njcuk9999/apero-drs",
"repo_path": "apero-drs_extracted/apero-drs-main/apero/recipes/nirps_he/apero_lbl_compute_nirps_he.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Run the LBL compute for:
- science=object template=object
- science=object template=friend
Arguments:
- object
Created on 2023-08-09 at 11:14
@author: cook
"""
import os
import sys
from typing import Any, Dict, Optional, Tuple, Union
from apero import lang
from a... | njcuk9999REPO_NAMEapero-drsPATH_START.@apero-drs_extracted@apero-drs-main@apero@recipes@nirps_he@apero_lbl_compute_nirps_he.py@.PATH_END.py |
{
"filename": "test_cloud.py",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/src/amuse/test/suite/ext_tests/test_cloud.py",
"type": "Python"
} | import sys
import os
import numpy
from amuse.test import amusetest
from amuse.ext import cloud
from amuse.units import units
from amuse.units import generic_unit_system
from amuse import datamodel
class CloudTests(amusetest.TestCase):
def test1(self):
grid = datamodel.Grid.create((10, 10, 10), [10.0,... | amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@src@amuse@test@suite@ext_tests@test_cloud.py@.PATH_END.py |
{
"filename": "_sizesrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/cone/hoverlabel/font/_sizesrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="sizesrc", parent_name="cone.hoverlabel.font", **kwargs
):
super(SizesrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@cone@hoverlabel@font@_sizesrc.py@.PATH_END.py |
{
"filename": "_sizemin.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter/marker/_sizemin.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizeminValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="sizemin", parent_name="scatter.marker", **kwargs):
super(SizeminValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter@marker@_sizemin.py@.PATH_END.py |
{
"filename": "models.py",
"repo_name": "OSSOS/SurveySimulator",
"repo_path": "SurveySimulator_extracted/SurveySimulator-master/python/ossssim/models.py",
"type": "Python"
} | """
Model classes for the Outer Solar System Survey Simulator.
"""
import logging
import os
import re
import time
from abc import ABC, abstractmethod
from collections import OrderedDict
from collections.abc import Iterable
import numpy
import rebound
from astropy import units
from astropy.table import QTable
from astr... | OSSOSREPO_NAMESurveySimulatorPATH_START.@SurveySimulator_extracted@SurveySimulator-master@python@ossssim@models.py@.PATH_END.py |
{
"filename": "symbolic_scope_test.py",
"repo_name": "fchollet/keras",
"repo_path": "keras_extracted/keras-master/keras/src/backend/common/symbolic_scope_test.py",
"type": "Python"
} | import numpy as np
from keras.src import ops
from keras.src import testing
from keras.src.backend.common.symbolic_scope import SymbolicScope
from keras.src.backend.common.symbolic_scope import in_symbolic_scope
class TestSymbolicScope(testing.TestCase):
def test_basic_flow(self):
# Define a function that... | fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@backend@common@symbolic_scope_test.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/utils/tests/__init__.py",
"type": "Python"
} | from __future__ import (absolute_import, division, print_function,
unicode_literals)
| waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@utils@tests@__init__.py@.PATH_END.py |
{
"filename": "run_cls.py",
"repo_name": "xC-ell/growth-history",
"repo_path": "growth-history_extracted/growth-history-main/xCell/run_cls.py",
"type": "Python"
} | #!/usr/bin/python
from xcell.cls.common import Data
import os
import time
import subprocess
##############################################################################
def get_mem(data, trs, compute):
# Return memory for nside 4096
d = {}
if compute == 'cls':
d[0] = 16
d[2] = 25
eli... | xC-ellREPO_NAMEgrowth-historyPATH_START.@growth-history_extracted@growth-history-main@xCell@run_cls.py@.PATH_END.py |
{
"filename": "config.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/framework/config.py",
"type": "Python"
} | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@framework@config.py@.PATH_END.py |
{
"filename": "ParticleMot.py",
"repo_name": "wmpg/Supracenter",
"repo_path": "Supracenter_extracted/Supracenter-master/supra/GUI/Dialogs/ParticleMot.py",
"type": "Python"
} |
import os
import numpy as np
import pickle
import obspy
import scipy.signal
import scipy.odr
from obspy.signal.polarization import polarization_analysis
from obspy.core.utcdatetime import UTCDateTime
from obspy.signal.filter import remez_fir
from obspy import read_inventory
from obspy.signal.rotate import rotate2zne... | wmpgREPO_NAMESupracenterPATH_START.@Supracenter_extracted@Supracenter-master@supra@GUI@Dialogs@ParticleMot.py@.PATH_END.py |
{
"filename": "_ysrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/streamtube/starts/_ysrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="ysrc", parent_name="streamtube.starts", **kwargs):
super(YsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@streamtube@starts@_ysrc.py@.PATH_END.py |
{
"filename": "image_full_cluster.py",
"repo_name": "TariqBlecher/tblenser",
"repo_path": "tblenser_extracted/tblenser-master/drivers/image_full_cluster.py",
"type": "Python"
} | """
A high level script to simulate lensed HI disks behind the HFF clusters.
The first part of this script reads in the relevant parameters of the foreground clusters and background sources.
The second part of the script, consisting of the double for loop, handles the actual lensing simulation and magnification calc... | TariqBlecherREPO_NAMEtblenserPATH_START.@tblenser_extracted@tblenser-master@drivers@image_full_cluster.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "California-Planet-Search/radvel",
"repo_path": "radvel_extracted/radvel-master/radvel/utils.py",
"type": "Python"
} | import os
import sys
from decimal import Decimal
from contextlib import contextmanager
import warnings
import numpy as np
from datetime import datetime, timedelta
from astropy import constants as c
from astropy import units as u
import radvel
from scipy.optimize import root
# Normalization.
# RV m/s of a 1.0 Jupiter... | California-Planet-SearchREPO_NAMEradvelPATH_START.@radvel_extracted@radvel-master@radvel@utils.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/violin/marker/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._line import Line
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(__name__, [], ["._line.Line"])
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@violin@marker@__init__.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.