metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "test_context_manager.py",
"repo_name": "AndrewAnnex/SpiceyPy",
"repo_path": "SpiceyPy_extracted/SpiceyPy-main/src/spiceypy/tests/test_context_manager.py",
"type": "Python"
} | import spiceypy as spice
from spiceypy.tests.gettestkernels import (
get_standard_kernels,
write_test_meta_kernel,
cleanup_core_kernels,
CoreKernels,
)
import pytest
get_standard_kernels()
write_test_meta_kernel()
# cleanup_core_kernels()
@pytest.mark.parametrize(
["expected_length", "kernel_list... | AndrewAnnexREPO_NAMESpiceyPyPATH_START.@SpiceyPy_extracted@SpiceyPy-main@src@spiceypy@tests@test_context_manager.py@.PATH_END.py |
{
"filename": "vds_simple.py",
"repo_name": "h5py/h5py",
"repo_path": "h5py_extracted/h5py-master/examples/vds_simple.py",
"type": "Python"
} | """A simple example of building a virtual dataset.
This makes four 'source' HDF5 files, each with a 1D dataset of 100 numbers.
Then it makes a single 4x100 virtual dataset in a separate file, exposing
the four sources as one dataset.
"""
import h5py
import numpy as np
# create some sample data
data = np.arange(0, 10... | h5pyREPO_NAMEh5pyPATH_START.@h5py_extracted@h5py-master@examples@vds_simple.py@.PATH_END.py |
{
"filename": "_text.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/ternary/caxis/title/_text.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="text", parent_name="layout.ternary.caxis.title", **kwargs
):
super(TextValidator, self).__init__(
plotly_name=plotly_name,
parent_name... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@ternary@caxis@title@_text.py@.PATH_END.py |
{
"filename": "index.md",
"repo_name": "pymc-devs/pymc",
"repo_path": "pymc_extracted/pymc-main/docs/source/learn/core_notebooks/index.md",
"type": "Markdown"
} | (core_notebooks)=
# Notebooks on core features
:::{toctree}
:maxdepth: 1
pymc_overview
GLM_linear
model_comparison
posterior_predictive
dimensionality
pymc_pytensor
Gaussian_Processes
:::
:::{note}
The notebooks above are executed with each version of the library
(available on the navigation bar). In addition, a muc... | pymc-devsREPO_NAMEpymcPATH_START.@pymc_extracted@pymc-main@docs@source@learn@core_notebooks@index.md@.PATH_END.py |
{
"filename": "_button.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/layout/updatemenu/_button.py",
"type": "Python"
} | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Button(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.updatemenu"
_path_str = "layout.updatemenu.button"
_valid_props = {
"args"... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@layout@updatemenu@_button.py@.PATH_END.py |
{
"filename": "api.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/yt/frontends/eagle/api.py",
"type": "Python"
} | from . import tests
from .data_structures import EagleDataset, EagleNetworkDataset
from .fields import EagleNetworkFieldInfo
from .io import IOHandlerEagleNetwork
| rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@yt@frontends@eagle@api.py@.PATH_END.py |
{
"filename": "_estimator_html_repr.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scikit-learn/py3/sklearn/utils/_estimator_html_repr.py",
"type": "Python"
} | import html
import itertools
from contextlib import closing
from inspect import isclass
from io import StringIO
from pathlib import Path
from string import Template
from .. import __version__, config_context
from .fixes import parse_version
class _IDCounter:
"""Generate sequential ids with a prefix."""
def ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scikit-learn@py3@sklearn@utils@_estimator_html_repr.py@.PATH_END.py |
{
"filename": "plot_dlogp.py",
"repo_name": "philbull/RadioFisher",
"repo_path": "RadioFisher_extracted/RadioFisher-master/plotting/plot_dlogp.py",
"type": "Python"
} | #!/usr/bin/python
"""
Process EOS Fisher matrices and plot P(k).
"""
import numpy as np
import pylab as P
from rfwrapper import rf
import matplotlib.patches
import matplotlib.cm
import os
cosmo = rf.experiments.cosmo
names = ['EuclidRef_paper', 'exptL_paper', 'aexptM_paper', 'yCHIME_paper'] #'exptS_paper']
colours = ... | philbullREPO_NAMERadioFisherPATH_START.@RadioFisher_extracted@RadioFisher-master@plotting@plot_dlogp.py@.PATH_END.py |
{
"filename": "plot.py",
"repo_name": "revoltek/losoto",
"repo_path": "losoto_extracted/losoto-master/losoto/operations/plot.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from losoto.lib_operations import *
from losoto._logging import logger as logging
from losoto.lib_unwrap import unwrap, unwrap_2d
logging.debug('Loading PLOT module.')
def _run_parser(soltab, parser, step):
axesInPlot = parser.getarraystr( step, 'axesInPlot' ) # no d... | revoltekREPO_NAMElosotoPATH_START.@losoto_extracted@losoto-master@losoto@operations@plot.py@.PATH_END.py |
{
"filename": "run_server.py",
"repo_name": "MichelleLochner/astronomaly",
"repo_path": "astronomaly_extracted/astronomaly-main/astronomaly/frontend/run_server.py",
"type": "Python"
} | from flask import Flask, render_template, request, Response
import json
from os.path import join
from astronomaly.frontend.interface import Controller
import logging
import argparse
# Main function to serve Astronomaly
parser = argparse.ArgumentParser(description='Run the Astronomaly server')
help_str = 'Location of ... | MichelleLochnerREPO_NAMEastronomalyPATH_START.@astronomaly_extracted@astronomaly-main@astronomaly@frontend@run_server.py@.PATH_END.py |
{
"filename": "test_rank.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/frame/methods/test_rank.py",
"type": "Python"
} | from datetime import (
datetime,
timedelta,
)
import numpy as np
import pytest
from pandas._libs.algos import (
Infinity,
NegInfinity,
)
from pandas import (
DataFrame,
Index,
Series,
)
import pandas._testing as tm
class TestRank:
s = Series([1, 3, 4, 2, np.nan, 2, 1, 5, np.nan, 3])... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@frame@methods@test_rank.py@.PATH_END.py |
{
"filename": "clean_2.py",
"repo_name": "CPM-project/MCPM",
"repo_path": "MCPM_extracted/MCPM-master/examples/asteroid_first_try/clean_2.py",
"type": "Python"
} | """
Removes points which are not on the K2C9 superstamp.
"""
import sys
from K2fov.c9 import inMicrolensRegion
with open(sys.argv[1]) as data:
lines = data.readlines()
for line in lines:
ra = float(line.split()[1])
dec = float(line.split()[2])
if inMicrolensRegion(ra, dec):
print(line[:-1])
... | CPM-projectREPO_NAMEMCPMPATH_START.@MCPM_extracted@MCPM-master@examples@asteroid_first_try@clean_2.py@.PATH_END.py |
{
"filename": "MosvizNIRISSExample.ipynb",
"repo_name": "spacetelescope/jdaviz",
"repo_path": "jdaviz_extracted/jdaviz-main/notebooks/MosvizNIRISSExample.ipynb",
"type": "Jupyter Notebook"
} | # Mosviz NIRISS example notebook
Note: We silence most warnings for now. For debugging, you can comment out the next cell and then restart the kernel to re-enable warnings.
```python
from astropy.utils.data import download_file
import pathlib
import tempfile
import warnings
from zipfile import ZipFile
from jdaviz i... | spacetelescopeREPO_NAMEjdavizPATH_START.@jdaviz_extracted@jdaviz-main@notebooks@MosvizNIRISSExample.ipynb@.PATH_END.py |
{
"filename": "test_publisher.py",
"repo_name": "crossbario/crossbar",
"repo_path": "crossbar_extracted/crossbar-master/crossbar/bridge/rest/test/test_publisher.py",
"type": "Python"
} | #####################################################################################
#
# Copyright (c) typedef int GmbH
# SPDX-License-Identifier: EUPL-1.2
#
#####################################################################################
import json
from twisted.internet.defer import inlineCallbacks, maybeDe... | crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@crossbar@bridge@rest@test@test_publisher.py@.PATH_END.py |
{
"filename": "find_mosaic_pointings.py",
"repo_name": "mhardcastle/ddf-pipeline",
"repo_path": "ddf-pipeline_extracted/ddf-pipeline-master/utils/find_mosaic_pointings.py",
"type": "Python"
} | #!/usr/bin/env python
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from builtins import range
from past.utils import old_div
import os,sys
import numpy as np
import argparse
from auxcodes import sepn
from surveys_db import SurveysDB
deg2rad = np.pi/180.0
... | mhardcastleREPO_NAMEddf-pipelinePATH_START.@ddf-pipeline_extracted@ddf-pipeline-master@utils@find_mosaic_pointings.py@.PATH_END.py |
{
"filename": "blockchain.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/document_loaders/blockchain.py",
"type": "Python"
} | import os
import re
import time
from enum import Enum
from typing import List, Optional
import requests
from langchain_core.documents import Document
from langchain_community.document_loaders.base import BaseLoader
class BlockchainType(Enum):
"""Enumerator of the supported blockchains."""
ETH_MAINNET = "et... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@document_loaders@blockchain.py@.PATH_END.py |
{
"filename": "ccf.py",
"repo_name": "mlafarga/raccoon",
"repo_path": "raccoon_extracted/raccoon-master/raccoon/ccf.py",
"type": "Python"
} | #!/usr/bin/env python
from __future__ import division
from __future__ import print_function
import glob
import os
from astropy.io import fits
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.interpolate import interp1d
# from scipy.interpolate import griddata
... | mlafargaREPO_NAMEraccoonPATH_START.@raccoon_extracted@raccoon-master@raccoon@ccf.py@.PATH_END.py |
{
"filename": "SPT_ACT_summer_school_2024_candl.ipynb",
"repo_name": "Lbalkenhol/candl",
"repo_path": "candl_extracted/candl-main/notebooks/SPT_ACT_summer_school_2024/SPT_ACT_summer_school_2024_candl.ipynb",
"type": "Jupyter Notebook"
} | <p align="center">
<img src="https://raw.githubusercontent.com/Lbalkenhol/candl/main/docs/logos/candl_wordmark%26symbol_col_RGB.png" width="750" alt="candl" />
</p>
---
This notebook will introduce you to `candl` (https://arxiv.org/abs/2401.13433). `candl` is a likelihood code that provides easy access to CMB data ... | LbalkenholREPO_NAMEcandlPATH_START.@candl_extracted@candl-main@notebooks@SPT_ACT_summer_school_2024@SPT_ACT_summer_school_2024_candl.ipynb@.PATH_END.py |
{
"filename": "TIRAVEL_Quickstart.ipynb",
"repo_name": "SPARTA-dev/SPARTA",
"repo_path": "SPARTA_extracted/SPARTA-master/examples/examples/TIRAVEL_Quickstart.ipynb",
"type": "Jupyter Notebook"
} | # TIRAVEL_Quickstart
### The notebook contains an RV calculation refinement tool, based on Zucker & Mazeh 2006 TIRAVEL - Template Independent RAdial VELocity measurement (arXiv:astro-ph/0607293).
This partial implementation of the TIRAVEL method enables using initial observation RV values to create a template for mor... | SPARTA-devREPO_NAMESPARTAPATH_START.@SPARTA_extracted@SPARTA-master@examples@examples@TIRAVEL_Quickstart.ipynb@.PATH_END.py |
{
"filename": "_shadow.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterpolargl/marker/colorbar/tickfont/_shadow.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShadowValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="shadow",
parent_name="scatterpolargl.marker.colorbar.tickfont",
**kwargs,
):
super(ShadowValidator, self).__init__(
plot... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterpolargl@marker@colorbar@tickfont@_shadow.py@.PATH_END.py |
{
"filename": "B_Model_Tutorial_7_Factor_Graphs.ipynb",
"repo_name": "jmschrei/pomegranate",
"repo_path": "pomegranate_extracted/pomegranate-master/docs/tutorials/B_Model_Tutorial_7_Factor_Graphs.ipynb",
"type": "Jupyter Notebook"
} | ## Factor Graphs
author: Jacob Schreiber <br>
contact: jmschreiber91@gmail.com
Factor graphs are a powerful and, in my opinion, underused probabilistic model. Potentially, one reason that they are underutilized is that they are not as conceptually intuitive as Bayesian networks or mixture models. Here, we will al... | jmschreiREPO_NAMEpomegranatePATH_START.@pomegranate_extracted@pomegranate-master@docs@tutorials@B_Model_Tutorial_7_Factor_Graphs.ipynb@.PATH_END.py |
{
"filename": "_variant.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterternary/hoverlabel/font/_variant.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="variant",
parent_name="scatterternary.hoverlabel.font",
**kwargs,
):
super(VariantValidator, self).__init__(
plotly... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterternary@hoverlabel@font@_variant.py@.PATH_END.py |
{
"filename": "_textfont.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/treemap/pathbar/_textfont.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Textfont(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "treemap.pathbar"
_path_str = "treemap.pathbar.textfont"
_valid_props = {"color", "colorsrc... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@treemap@pathbar@_textfont.py@.PATH_END.py |
{
"filename": "test_suspectMasking.py",
"repo_name": "lsst/ip_isr",
"repo_path": "ip_isr_extracted/ip_isr-main/tests/test_suspectMasking.py",
"type": "Python"
} | #
# LSST Data Management System
# Copyright 2008, 2009, 2010 LSST Corporation.
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# 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 ... | lsstREPO_NAMEip_isrPATH_START.@ip_isr_extracted@ip_isr-main@tests@test_suspectMasking.py@.PATH_END.py |
{
"filename": "test_combine_fast_slow.py",
"repo_name": "spacetelescope/jwst",
"repo_path": "jwst_extracted/jwst-main/jwst/flatfield/tests/test_combine_fast_slow.py",
"type": "Python"
} | """
Test for flat_field.combine_fast_slow
"""
import numpy as np
import pytest
from scipy.integrate import quad
from astropy.modeling import polynomial
from stdatamodels.jwst.datamodels import dqflags
from jwst.flatfield.flat_field import combine_fast_slow
@pytest.mark.parametrize('flat_err_1,flat_err_2',
... | spacetelescopeREPO_NAMEjwstPATH_START.@jwst_extracted@jwst-main@jwst@flatfield@tests@test_combine_fast_slow.py@.PATH_END.py |
{
"filename": "_y.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/mapbox/domain/_y.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YValidator(_plotly_utils.basevalidators.InfoArrayValidator):
def __init__(self, plotly_name="y", parent_name="layout.mapbox.domain", **kwargs):
super(YValidator, 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@layout@mapbox@domain@_y.py@.PATH_END.py |
{
"filename": "_tickwidth.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/contour/colorbar/_tickwidth.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickwidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="tickwidth", parent_name="contour.colorbar", **kwargs
):
super(TickwidthValidator, self).__init__(
plotly_name=plotly_name,
parent... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@contour@colorbar@_tickwidth.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "freelunchtheorem/Conditional_Density_Estimation",
"repo_path": "Conditional_Density_Estimation_extracted/Conditional_Density_Estimation-master/README.md",
"type": "Markdown"
} | [](https://travis-ci.org/freelunchtheorem/Conditional_Density_Estimation) [](https://pepy.tech/project/cde)
# Conditional Density Estimation (CDE)
## Description
Implementat... | freelunchtheoremREPO_NAMEConditional_Density_EstimationPATH_START.@Conditional_Density_Estimation_extracted@Conditional_Density_Estimation-master@README.md@.PATH_END.py |
{
"filename": "testing plummers sphere-Copy2-checkpoint.ipynb",
"repo_name": "jan-rybizki/Galaxia_wrap",
"repo_path": "Galaxia_wrap_extracted/Galaxia_wrap-master/notebook/.ipynb_checkpoints/testing plummers sphere-Copy2-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | ```python
"""
Plummer model generator
This module contains a function used to create Plummer (1911) models, which
follow a spherically symmetric density profile of the form:
rho = c * (1 + r**2)**(-5/2)
"""
import numpy
import numpy.random
from math import pi, sqrt
from amuse.units import nbody_system
from amuse im... | jan-rybizkiREPO_NAMEGalaxia_wrapPATH_START.@Galaxia_wrap_extracted@Galaxia_wrap-master@notebook@.ipynb_checkpoints@testing plummers sphere-Copy2-checkpoint.ipynb@.PATH_END.py |
{
"filename": "plotsettings.py",
"repo_name": "Anirbancosmo/limpy",
"repo_path": "limpy_extracted/limpy-master/limpy/plotsettings.py",
"type": "Python"
} | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 3 23:25:50 2020
@author: anirbanroy
"""
import matplotlib as pl
pl.rcParams["figure.figsize"] = 5, 5
pl.rcParams["xtick.top"] = True
pl.rcParams["ytick.right"] = True
pl.rcParams["ytick.minor.visible"] = True
pl.rcParams["xtick.minor.visible"] = T... | AnirbancosmoREPO_NAMElimpyPATH_START.@limpy_extracted@limpy-master@limpy@plotsettings.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/choroplethmapbox/marker/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._line import Line
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(__name__, [], ["._line.Line"])
| plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@choroplethmapbox@marker@__init__.py@.PATH_END.py |
{
"filename": "test_easyguide.py",
"repo_name": "pyro-ppl/pyro",
"repo_path": "pyro_extracted/pyro-master/tests/contrib/easyguide/test_easyguide.py",
"type": "Python"
} | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import io
import warnings
import pytest
import torch
from torch.distributions import constraints
import pyro
import pyro.distributions as dist
from pyro.contrib.easyguide import EasyGuide, easy_guide
from pyro.infer import SVI, T... | pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@tests@contrib@easyguide@test_easyguide.py@.PATH_END.py |
{
"filename": "UVLFs.py",
"repo_name": "JulianBMunoz/Zeus21",
"repo_path": "Zeus21_extracted/Zeus21-main/zeus21/UVLFs.py",
"type": "Python"
} | """
Compute UVLFs given our SFR and HMF models.
Author: Julian B. Muñoz
UT Austin - June 2023
Edited by Hector Afonso G. Cruz
JHU - July 2024
"""
from . import cosmology
from . import constants
from .sfrd import SFR_II
from .cosmology import bias_Tinker
import numpy as np
from scipy.special import erf
def MU... | JulianBMunozREPO_NAMEZeus21PATH_START.@Zeus21_extracted@Zeus21-main@zeus21@UVLFs.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattermap/legendgrouptitle/font/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._weight import WeightValidator
from ._variant import VariantValidator
from ._textcase import TextcaseValidator
from ._style import StyleValidator
from ._size import SizeValidator
from ._shadow impor... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattermap@legendgrouptitle@font@__init__.py@.PATH_END.py |
{
"filename": "plot_utils.py",
"repo_name": "nanograv/pint_pal",
"repo_path": "pint_pal_extracted/pint_pal-main/src/pint_pal/plot_utils.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 4 09:30:59 2020
@author: bshapiroalbert
Code since butchered by many timers.
"""
import numpy as np
import matplotlib.pyplot as plt
import copy
from astropy import log
import astropy.units as u
import yaml
import pint.toa as toa
import pint.models ... | nanogravREPO_NAMEpint_palPATH_START.@pint_pal_extracted@pint_pal-main@src@pint_pal@plot_utils.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "halomod/hmf",
"repo_path": "hmf_extracted/hmf-main/src/hmf/mass_function/__init__.py",
"type": "Python"
} | """Subpackage for determining the halo mass function in Spherical Collapse."""
from . import fitting_functions, hmf, integrate_hmf
from .fitting_functions import PS, SMT, FittingFunction, Tinker08
from .hmf import MassFunction
| halomodREPO_NAMEhmfPATH_START.@hmf_extracted@hmf-main@src@hmf@mass_function@__init__.py@.PATH_END.py |
{
"filename": "example.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/document_loaders/example_data/source_code/example.py",
"type": "Python"
} | class MyClass:
def __init__(self, name):
self.name = name
def greet(self):
print(f"Hello, {self.name}!")
def main():
name = input("Enter your name: ")
obj = MyClass(name)
obj.greet()
if __name__ == "__main__":
main()
| langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@document_loaders@example_data@source_code@example.py@.PATH_END.py |
{
"filename": "_montage.py",
"repo_name": "scikit-image/scikit-image",
"repo_path": "scikit-image_extracted/scikit-image-main/skimage/util/_montage.py",
"type": "Python"
} | import numpy as np
from .._shared import utils
from .. import exposure
__all__ = ['montage']
@utils.channel_as_last_axis(multichannel_output=False)
def montage(
arr_in,
fill='mean',
rescale_intensity=False,
grid_shape=None,
padding_width=0,
*,
channel_axis=None,
):
"""Create a montag... | scikit-imageREPO_NAMEscikit-imagePATH_START.@scikit-image_extracted@scikit-image-main@skimage@util@_montage.py@.PATH_END.py |
{
"filename": "plot_image_denoising.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/examples/decomposition/plot_image_denoising.py",
"type": "Python"
} | """
=========================================
Image denoising using dictionary learning
=========================================
An example comparing the effect of reconstructing noisy fragments
of a raccoon face image using firstly online :ref:`DictionaryLearning` and
various transform methods.
The dictionary is fi... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@examples@decomposition@plot_image_denoising.py@.PATH_END.py |
{
"filename": "_textcase.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/densitymap/colorbar/tickfont/_textcase.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextcaseValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="textcase",
parent_name="densitymap.colorbar.tickfont",
**kwargs,
):
super(TextcaseValidator, self).__init__(
plotl... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@densitymap@colorbar@tickfont@_textcase.py@.PATH_END.py |
{
"filename": "_fgcolor.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter/fillpattern/_fgcolor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FgcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="fgcolor", parent_name="scatter.fillpattern", **kwargs
):
super(FgcolorValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter@fillpattern@_fgcolor.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "gomesdasilva/ACTIN",
"repo_path": "ACTIN_extracted/ACTIN-master/setup.py",
"type": "Python"
} | #!/usr/bin/env python
import os
import subprocess
try: from setuptools import setup
except: from distutils.core import setup
path = os.path.dirname(os.path.realpath(__file__))
version_file = os.path.join(path, "actin", "VERSION")
try:
with open(version_file, 'r') as file:
version = file.read()
except: ... | gomesdasilvaREPO_NAMEACTINPATH_START.@ACTIN_extracted@ACTIN-master@setup.py@.PATH_END.py |
{
"filename": "test_machine_independent.py",
"repo_name": "dtamayo/reboundx",
"repo_path": "reboundx_extracted/reboundx-main/reboundx/test/test_machine_independent.py",
"type": "Python"
} | import rebound
import reboundx
import unittest
import os
class TestMachineIndependent(unittest.TestCase):
def setUp(self):
self.sim = rebound.Simulation()
self.sim.add(m=1.)
self.sim.add(a=1., e=0.2)
self.rebx = reboundx.Extras(self.sim)
sim = rebound.Simulation()
s... | dtamayoREPO_NAMEreboundxPATH_START.@reboundx_extracted@reboundx-main@reboundx@test@test_machine_independent.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/box/unselected/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._marker import MarkerValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._marker.MarkerValidator"]
)
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@box@unselected@__init__.py@.PATH_END.py |
{
"filename": "2d-histogram-contour.md",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/doc/python/2d-histogram-contour.md",
"type": "Markdown"
} | ---
jupyter:
jupytext:
notebook_metadata_filter: all
text_representation:
extension: .md
format_name: markdown
format_version: '1.2'
jupytext_version: 1.3.1
kernelspec:
display_name: Python 3
language: python
name: python3
language_info:
codemirror_mode:
name:... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@doc@python@2d-histogram-contour.md@.PATH_END.py |
{
"filename": "setup_package.py",
"repo_name": "zblz/naima",
"repo_path": "naima_extracted/naima-main/src/naima/tests/setup_package.py",
"type": "Python"
} | def get_package_data():
return {_ASTROPY_PACKAGE_NAME_ + ".tests": ["coveragerc", "data/*.dat"]}
| zblzREPO_NAMEnaimaPATH_START.@naima_extracted@naima-main@src@naima@tests@setup_package.py@.PATH_END.py |
{
"filename": "_gbd.py",
"repo_name": "Jashcraf/poke",
"repo_path": "poke_extracted/poke-main/poke/_gbd.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
import numexpr as ne
import os
os.environ['NUMEXPR_MAX_THREADS'] = '64'
os.environ['NUMEXPR_NUM_THREADS'] = '32'
def disp_array(array,cmap='viridis'):
plt.figure()
plt.imshow(array,cmap=cmap)
plt.colorbar()
plt.show()
def Matmulvec(x2,y2,M,x1,y1):
... | JashcrafREPO_NAMEpokePATH_START.@poke_extracted@poke-main@poke@_gbd.py@.PATH_END.py |
{
"filename": "astropyconst13.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/astropy/constants/astropyconst13.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astronomical and physics constants for Astropy v1.3 and earlier.
See :mod:`astropy.constants` for a complete listing of constants
defined in Astropy.
"""
from astropy.utils import find_current_module
from . import codata2010, iau2012
from . import ut... | astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@constants@astropyconst13.py@.PATH_END.py |
{
"filename": "legendre_jax.py",
"repo_name": "martinjameswhite/directsht",
"repo_path": "directsht_extracted/directsht-main/sht/legendre_jax.py",
"type": "Python"
} | import numpy as np
import jax.numpy as jnp
from jax import vmap, jit, devices
from functools import partial
from jax.lax import fori_loop
from sht.utils_jax import move_to_device
import sht.utils_jax as utils
# Choose the number of devices we'll be parallelizing across
N_devic... | martinjameswhiteREPO_NAMEdirectshtPATH_START.@directsht_extracted@directsht-main@sht@legendre_jax.py@.PATH_END.py |
{
"filename": "psrindex.py",
"repo_name": "demorest/nanopipe",
"repo_path": "nanopipe_extracted/nanopipe-master/src/psrindex.py",
"type": "Python"
} | #! /usr/bin/env python
# Class to deal with indexing pulsar data files in an arbitrary
# directory structure.
import os
import sys
import fnmatch
from collections import namedtuple, OrderedDict
import sqlite3
# Note, need to be careful about setting/re-setting no_amps
# if this will be imported by other code that ne... | demorestREPO_NAMEnanopipePATH_START.@nanopipe_extracted@nanopipe-master@src@psrindex.py@.PATH_END.py |
{
"filename": "_line.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/sankey/node/_line.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LineValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="line", parent_name="sankey.node", **kwargs):
super(LineValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
d... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@sankey@node@_line.py@.PATH_END.py |
{
"filename": "dusty_galaxy.py",
"repo_name": "bwvdnbro/CMacIonize",
"repo_path": "CMacIonize_extracted/CMacIonize-master/benchmarks/dusty_galaxy.py",
"type": "Python"
} | #! /usr/bin/python
################################################################################
# This file is part of CMacIonize
# Copyright (C) 2017 Bert Vandenbroucke (bert.vandenbroucke@gmail.com)
#
# CMacIonize is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... | bwvdnbroREPO_NAMECMacIonizePATH_START.@CMacIonize_extracted@CMacIonize-master@benchmarks@dusty_galaxy.py@.PATH_END.py |
{
"filename": "functions.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/how_to/functions.ipynb",
"type": "Jupyter Notebook"
} | ---
sidebar_position: 3
keywords: [RunnableLambda, LCEL]
---
# How to run custom functions
:::info Prerequisites
This guide assumes familiarity with the following concepts:
- [LangChain Expression Language (LCEL)](/docs/concepts/lcel)
- [Chaining runnables](/docs/how_to/sequence/)
:::
You can use arbitrary function... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@how_to@functions.ipynb@.PATH_END.py |
{
"filename": "test_arithmetic.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/scalar/period/test_arithmetic.py",
"type": "Python"
} | from datetime import timedelta
import numpy as np
import pytest
from pandas._libs.tslibs.period import IncompatibleFrequency
from pandas import (
NaT,
Period,
Timedelta,
Timestamp,
offsets,
)
class TestPeriodArithmetic:
def test_add_overflow_raises(self):
# GH#55503
per = Ti... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@scalar@period@test_arithmetic.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "AndreasKvammen/ML_dust_detection",
"repo_path": "ML_dust_detection_extracted/ML_dust_detection-main/Dust_impact_rates/README.md",
"type": "Markdown"
} | The folder "Dust_impact_rates" contains the MatLab script and files to reproduce the daily dust impact rates (Figure 11 from the article)
1. dust_impact_rates.m - is a MatLab script to read the daily dust count (classified by the TDS, SVM and CNN approach) and convert it to impact rates using the RPW-TDS duty cycle. ... | AndreasKvammenREPO_NAMEML_dust_detectionPATH_START.@ML_dust_detection_extracted@ML_dust_detection-main@Dust_impact_rates@README.md@.PATH_END.py |
{
"filename": "hashing.py",
"repo_name": "pyro-ppl/pyro",
"repo_path": "pyro_extracted/pyro-master/pyro/contrib/tracking/hashing.py",
"type": "Python"
} | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import heapq
import itertools
from collections import defaultdict
from numbers import Number
import torch
class LSH:
"""
Implements locality-sensitive hashing for low-dimensional euclidean space.
Allows to efficien... | pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@pyro@contrib@tracking@hashing.py@.PATH_END.py |
{
"filename": "advice.md",
"repo_name": "tigerchenlu98/rebound",
"repo_path": "rebound_extracted/rebound-main/.github/ISSUE_TEMPLATE/advice.md",
"type": "Markdown"
} | ---
name: Ask for advice
about: Ask for advice on how to use REBOUND for the specific science problem that you have in mind. Get suggestions for choosing the best integrator and settings, or inquire about ways to optmimize runtime.
title: ''
labels: question
assignees: ''
---
**Environment**
Which version of REBOUND ... | tigerchenlu98REPO_NAMEreboundPATH_START.@rebound_extracted@rebound-main@.github@ISSUE_TEMPLATE@advice.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "dsavransky/EXOSIMS",
"repo_path": "EXOSIMS_extracted/EXOSIMS-master/EXOSIMS/PlanetPhysicalModel/__init__.py",
"type": "Python"
} | dsavranskyREPO_NAMEEXOSIMSPATH_START.@EXOSIMS_extracted@EXOSIMS-master@EXOSIMS@PlanetPhysicalModel@__init__.py@.PATH_END.py | |
{
"filename": "_offsetsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/bar/_offsetsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OffsetsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="offsetsrc", parent_name="bar", **kwargs):
super(OffsetsrcValidator, 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@bar@_offsetsrc.py@.PATH_END.py |
{
"filename": "create_mumpower_bdf_file.py",
"repo_name": "nuc-astro/winnet",
"repo_path": "winnet_extracted/winnet-master/bin/create_mumpower_bdf_file.py",
"type": "Python"
} | # Author: M. Reichert
# Date : 03.06.2024
# Convert beta delayed fission file of Mumpower et al. 2022 into a WinNet readable format.
# The Mumpower et al. 2022 file can be accessed at :
# https://journals.aps.org/prc/supplemental/10.1103/PhysRevC.106.065805
import numpy as np
import pandas as pd
from class_files.nucle... | nuc-astroREPO_NAMEwinnetPATH_START.@winnet_extracted@winnet-master@bin@create_mumpower_bdf_file.py@.PATH_END.py |
{
"filename": "_textfont.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/scatterpolar/selected/_textfont.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Textfont(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatterpolar.selected"
_path_str = "scatterpolar.selected.textfont"
_valid_props = {"color... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@scatterpolar@selected@_textfont.py@.PATH_END.py |
{
"filename": "e3b50f666fbb_the_first_alembic_revision.py",
"repo_name": "transientskp/tkp",
"repo_path": "tkp_extracted/tkp-master/alembic/versions/e3b50f666fbb_the_first_alembic_revision.py",
"type": "Python"
} | """the first alembic revision
Revision ID: e3b50f666fbb
Revises:
Create Date: 2016-05-30 11:32:22.585690
"""
# revision identifiers, used by Alembic.
revision = 'e3b50f666fbb'
down_revision = None
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
pass
def ... | transientskpREPO_NAMEtkpPATH_START.@tkp_extracted@tkp-master@alembic@versions@e3b50f666fbb_the_first_alembic_revision.py@.PATH_END.py |
{
"filename": "databricks.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/tools/databricks.ipynb",
"type": "Jupyter Notebook"
} | # Databricks Unity Catalog (UC)
This notebook shows how to use UC functions as LangChain tools, with both LangChain and LangGraph agent APIs.
See Databricks documentation ([AWS](https://docs.databricks.com/en/sql/language-manual/sql-ref-syntax-ddl-create-sql-function.html)|[Azure](https://learn.microsoft.com/en-us/az... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@tools@databricks.ipynb@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "brinckmann/montepython_public",
"repo_path": "montepython_public_extracted/montepython_public-master/montepython/likelihoods/kids450_cf_likelihood_public/README.md",
"type": "Markdown"
} | This repository contains the likelihood module for the KiDS-450 correlation function measurements from [Hildebrandt et al. 2017 (MNRAS, 465, 1454)](http://adsabs.harvard.edu/abs/2017MNRAS.465.1454H). Note that this is NOT the original likelihood used for their analysis. However, this likelihood was used for the analysi... | brinckmannREPO_NAMEmontepython_publicPATH_START.@montepython_public_extracted@montepython_public-master@montepython@likelihoods@kids450_cf_likelihood_public@README.md@.PATH_END.py |
{
"filename": "coupling_layers.py",
"repo_name": "vislearn/FrEIA",
"repo_path": "FrEIA_extracted/FrEIA-master/FrEIA/modules/coupling_layers.py",
"type": "Python"
} | from . import InvertibleModule
from typing import Callable, Union
import torch
class _BaseCouplingBlock(InvertibleModule):
'''Base class to implement various coupling schemes. It takes care of
checking the dimensions, conditions, clamping mechanism, etc.
Each child class only has to implement the _coup... | vislearnREPO_NAMEFrEIAPATH_START.@FrEIA_extracted@FrEIA-master@FrEIA@modules@coupling_layers.py@.PATH_END.py |
{
"filename": "source.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/_pytest/_code/source.py",
"type": "Python"
} | from __future__ import absolute_import, division, generators, print_function
import ast
from ast import PyCF_ONLY_AST as _AST_FLAG
from bisect import bisect_right
import sys
import six
import inspect
import tokenize
import py
cpy_compile = compile
class Source(object):
""" a immutable object holding a source co... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@_pytest@_code@source.py@.PATH_END.py |
{
"filename": "py311.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/importlib-metadata/py3/importlib_metadata/compat/py311.py",
"type": "Python"
} | import os
import pathlib
import sys
import types
def wrap(path): # pragma: no cover
"""
Workaround for https://github.com/python/cpython/issues/84538
to add backward compatibility for walk_up=True.
An example affected package is dask-labextension, which uses
jupyter-packaging to install JupyterLa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@importlib-metadata@py3@importlib_metadata@compat@py311.py@.PATH_END.py |
{
"filename": "_legendgrouptitle.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/parcoords/_legendgrouptitle.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LegendgrouptitleValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="legendgrouptitle", parent_name="parcoords", **kwargs
):
super(LegendgrouptitleValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@parcoords@_legendgrouptitle.py@.PATH_END.py |
{
"filename": "test_libpython_in_gdb.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/tools/cython/Cython/Debugger/Tests/test_libpython_in_gdb.py",
"type": "Python"
} | # -*- coding: UTF-8 -*-
"""
Test libpython.py. This is already partly tested by test_libcython_in_gdb and
Lib/test/test_gdb.py in the Python source. These tests are run in gdb and
called from test_libcython_in_gdb.main()
"""
import os
import sys
import gdb
from Cython.Debugger import libcython
from Cython.Debugger ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@cython@Cython@Debugger@Tests@test_libpython_in_gdb.py@.PATH_END.py |
{
"filename": "misc.py",
"repo_name": "sunpy/ndcube",
"repo_path": "ndcube_extracted/ndcube-main/ndcube/utils/misc.py",
"type": "Python"
} | import astropy.units as u
__all__ = ['convert_quantities_to_units', 'unique_sorted']
def unique_sorted(iterable):
"""
Return unique values in the order they are first encountered in the iterable.
"""
lookup = set() # a temporary lookup set
return [ele for ele in iterable if ele not in lookup and... | sunpyREPO_NAMEndcubePATH_START.@ndcube_extracted@ndcube-main@ndcube@utils@misc.py@.PATH_END.py |
{
"filename": "angsep.py",
"repo_name": "backyardworlds/wiseview",
"repo_path": "wiseview_extracted/wiseview-master/wv/common/angsep.py",
"type": "Python"
} | #!/usr/bin/python
# angsep.py
# Program to calculate the angular separation between two points
# whose coordinates are given in RA and Dec
# From angsep.py Written by Enno Middelberg 2001
from numpy import *
def angsep(ra1deg,dec1deg,ra2deg,dec2deg):
""" Determine separation in degrees between two celestial objec... | backyardworldsREPO_NAMEwiseviewPATH_START.@wiseview_extracted@wiseview-master@wv@common@angsep.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "sdss/lvmagp",
"repo_path": "lvmagp_extracted/lvmagp-main/container/__init__.py",
"type": "Python"
} | import subprocess
# import sys
import os
# import time
# import pexpect
import shlex
import click
import socket
from pathlib import PosixPath
container_bin = 'podman'
lvmt_root = os.environ["PWD"]
lvmt_image_source_local = "localhost/sdss"
lvmt_image_source_remote = "ghcr.io/sdss"
lvmt_image_name = 'lvmagp'
lvmt_rmq =... | sdssREPO_NAMElvmagpPATH_START.@lvmagp_extracted@lvmagp-main@container@__init__.py@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/heatmap/hoverlabel/_font.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="font", parent_name="heatmap.hoverlabel", **kwargs):
super(FontValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@heatmap@hoverlabel@_font.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "GeminiDRSoftware/DRAGONS",
"repo_path": "DRAGONS_extracted/DRAGONS-master/gemini_instruments/cirpass/tests/__init__.py",
"type": "Python"
} | GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@gemini_instruments@cirpass@tests@__init__.py@.PATH_END.py | |
{
"filename": "_y.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/legend/_y.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="y", parent_name="layout.legend", **kwargs):
super(YValidator, 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@layout@legend@_y.py@.PATH_END.py |
{
"filename": "test_distributions.py",
"repo_name": "pyro-ppl/pyro",
"repo_path": "pyro_extracted/pyro-master/tests/distributions/test_distributions.py",
"type": "Python"
} | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
import torch
import pyro
import pyro.distributions as dist
from pyro.distributions import TorchDistribution
from pyro.distributions.testing.gof import auto_goodness_of_fit
from pyro.distributions.u... | pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@tests@distributions@test_distributions.py@.PATH_END.py |
{
"filename": "_tickprefix.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattergeo/marker/colorbar/_tickprefix.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickprefixValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="tickprefix",
parent_name="scattergeo.marker.colorbar",
**kwargs,
):
super(TickprefixValidator, self).__init__(
plotl... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattergeo@marker@colorbar@_tickprefix.py@.PATH_END.py |
{
"filename": "tiny_vit_sam.py",
"repo_name": "ESA-Datalabs/XAMI-model",
"repo_path": "XAMI-model_extracted/XAMI-model-main/xami_model/mobile_sam/mobile_sam/modeling/tiny_vit_sam.py",
"type": "Python"
} | # --------------------------------------------------------
# TinyViT Model Architecture
# Copyright (c) 2022 Microsoft
# Adapted from LeViT and Swin Transformer
# LeViT: (https://github.com/facebookresearch/levit)
# Swin: (https://github.com/microsoft/swin-transformer)
# Build the TinyViT Model
# ------------------... | ESA-DatalabsREPO_NAMEXAMI-modelPATH_START.@XAMI-model_extracted@XAMI-model-main@xami_model@mobile_sam@mobile_sam@modeling@tiny_vit_sam.py@.PATH_END.py |
{
"filename": "misc.py",
"repo_name": "fjdu/rac-2d",
"repo_path": "rac-2d_extracted/rac-2d-master/utils_python/draw/misc.py",
"type": "Python"
} | def load_data_as_dic(filepath, comments='!', returnOriginalKeys=False):
import numpy as np
data = np.loadtxt(filepath, comments=comments)
ftmp = open(filepath, 'r')
str_comment = ftmp.readline()[1:].split()
ftmp.close()
dic = {}
for i in range(len(str_comment)):
dic.update({st... | fjduREPO_NAMErac-2dPATH_START.@rac-2d_extracted@rac-2d-master@utils_python@draw@misc.py@.PATH_END.py |
{
"filename": "test_catalogmesh.py",
"repo_name": "bccp/nbodykit",
"repo_path": "nbodykit_extracted/nbodykit-master/nbodykit/source/mesh/tests/test_catalogmesh.py",
"type": "Python"
} | from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import set_options
from nbodykit import setup_logging
from numpy.testing import assert_array_equal, assert_allclose
import pytest
# debug logging
setup_logging("debug")
@MPITest([1])
def test_tsc_interlacing(comm):
source = UniformCatalog(... | bccpREPO_NAMEnbodykitPATH_START.@nbodykit_extracted@nbodykit-master@nbodykit@source@mesh@tests@test_catalogmesh.py@.PATH_END.py |
{
"filename": "test_npairs_jackknife_3d.py",
"repo_name": "astropy/halotools",
"repo_path": "halotools_extracted/halotools-master/halotools/mock_observables/pair_counters/test_pair_counters/test_npairs_jackknife_3d.py",
"type": "Python"
} | """
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
# load pair counters
from ..npairs_jackknife_3d import npairs_jackknife_3d, _npairs_jackknife_3d_process_weights_jtags
from ....custom_exceptions import HalotoolsError
import pytest
from astropy.utils.misc ... | astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@halotools@mock_observables@pair_counters@test_pair_counters@test_npairs_jackknife_3d.py@.PATH_END.py |
{
"filename": "cachedmodel.py",
"repo_name": "JohannesBuchner/BXA",
"repo_path": "BXA_extracted/BXA-master/bxa/sherpa/cachedmodel.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
"""
BXA (Bayesian X-ray Analysis) for Sherpa
Copyright: Johannes Buchner (C) 2013-2016
"""
import os
if 'MAKESPHINXDOC' not in os.environ:
from sherpa.models import ArithmeticModel, CompositeModel
from sherpa.models.parameter imp... | JohannesBuchnerREPO_NAMEBXAPATH_START.@BXA_extracted@BXA-master@bxa@sherpa@cachedmodel.py@.PATH_END.py |
{
"filename": "_zsmooth.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/heatmapgl/_zsmooth.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ZsmoothValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="zsmooth", parent_name="heatmapgl", **kwargs):
super(ZsmoothValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@heatmapgl@_zsmooth.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "inonchiu/ComEst",
"repo_path": "ComEst_extracted/ComEst-master/comest/templates/filters/__init__.py",
"type": "Python"
} | inonchiuREPO_NAMEComEstPATH_START.@ComEst_extracted@ComEst-master@comest@templates@filters@__init__.py@.PATH_END.py | |
{
"filename": "initializers_v2.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/keras/initializers/initializers_v2.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@keras@initializers@initializers_v2.py@.PATH_END.py |
{
"filename": "tfsa-2022-159.md",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/security/advisory/tfsa-2022-159.md",
"type": "Markdown"
} | ## TFSA-2022-159: `FractionalMaxPoolGrad` Heap OOB
### CVE Number
CVE-2022-41897
### Impact
If [`FractionMaxPoolGrad`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/fractional_max_pool_op.cc) is given outsize inputs `row_pooling_sequence` and `col_pooling_sequence`, TensorFlow will cras... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@security@advisory@tfsa-2022-159.md@.PATH_END.py |
{
"filename": "runtests.py",
"repo_name": "dsavransky/EXOSIMS",
"repo_path": "EXOSIMS_extracted/EXOSIMS-master/runtests.py",
"type": "Python"
} | import unittest
import xmlrunner
from coverage import Coverage
import sys
"""
Unittest-compatible test-running script
Sonny Rappaport, Cornell June 7/6/2021. Written in conjunction with .circleci/config.yml
to work with circleci's parallelization, coverage.py, and coveralls.
"""
def format_path(file_path):
"""C... | dsavranskyREPO_NAMEEXOSIMSPATH_START.@EXOSIMS_extracted@EXOSIMS-master@runtests.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/datasets/copper/__init__.py",
"type": "Python"
} | __all__ = ["load", "load_pandas",
"COPYRIGHT", "TITLE", "SOURCE", "DESCRSHORT", "DESCRLONG", "NOTE"]
from .data import (
load, load_pandas,
COPYRIGHT, TITLE, SOURCE, DESCRSHORT, DESCRLONG, NOTE)
| statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@datasets@copper@__init__.py@.PATH_END.py |
{
"filename": "gamma_sampler.py",
"repo_name": "CU-NESS/pylinex",
"repo_path": "pylinex_extracted/pylinex-master/examples/nonlinear/gamma_sampler.py",
"type": "Python"
} | """
File: examples/nonlinear/gamma_sampler.py
Author: Keith Tauscher
Date: 23 Nov 2018
Description: Example showing use of the GammaLoglikelihood class in an MCMC
sampling context and comparison with the Fisher matrix formalism.
"""
from __future__ import division
import os
import numpy as np
import matpl... | CU-NESSREPO_NAMEpylinexPATH_START.@pylinex_extracted@pylinex-master@examples@nonlinear@gamma_sampler.py@.PATH_END.py |
{
"filename": "_shadow.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/choroplethmapbox/hoverlabel/font/_shadow.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShadowValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="shadow",
parent_name="choroplethmapbox.hoverlabel.font",
**kwargs,
):
super(ShadowValidator, self).__init__(
plotly_name... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@choroplethmapbox@hoverlabel@font@_shadow.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "n-claes/legolas",
"repo_path": "legolas_extracted/legolas-master/post_processing/pylbo/visualisation/eigenfunctions/__init__.py",
"type": "Python"
} | n-claesREPO_NAMElegolasPATH_START.@legolas_extracted@legolas-master@post_processing@pylbo@visualisation@eigenfunctions@__init__.py@.PATH_END.py | |
{
"filename": "quantization.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/references/training-parameters/quantization.md",
"type": "Markdown"
} | # Quantization settings
## target_border {#target_border}
Command-line: `--target-border`
#### Description
If set, defines the border for converting target values to 0 and 1.
Depending on the specified value:
- $target\_value \le border\_value$ the target is converted to 0
- $target\_value > border\_value$ the ta... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@references@training-parameters@quantization.md@.PATH_END.py |
{
"filename": "_hoverinfosrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/barpolar/_hoverinfosrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HoverinfosrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="hoverinfosrc", parent_name="barpolar", **kwargs):
super(HoverinfosrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@barpolar@_hoverinfosrc.py@.PATH_END.py |
{
"filename": "_colorsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattergeo/marker/line/_colorsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="colorsrc", parent_name="scattergeo.marker.line", **kwargs
):
super(ColorsrcValidator, self).__init__(
plotly_name=plotly_name,
parent... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattergeo@marker@line@_colorsrc.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "icecube/TauRunner",
"repo_path": "TauRunner_extracted/TauRunner-master/taurunner/__init__.py",
"type": "Python"
} | from .body import __init__
from .track import __init__
from .utils import __init__
from .cross_sections import __init__
from .particle import __init__
from .proposal_interface import __init__
from .Casino import Propagate
| icecubeREPO_NAMETauRunnerPATH_START.@TauRunner_extracted@TauRunner-master@taurunner@__init__.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "sonoUnoTeam/sonoUno-desktop",
"repo_path": "sonoUno-desktop_extracted/sonoUno-desktop-master/sonoUno/data_transform/__init__.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
| sonoUnoTeamREPO_NAMEsonoUno-desktopPATH_START.@sonoUno-desktop_extracted@sonoUno-desktop-master@sonoUno@data_transform@__init__.py@.PATH_END.py |
{
"filename": "tests.py",
"repo_name": "RafiKueng/SpaghettiLens",
"repo_path": "SpaghettiLens_extracted/SpaghettiLens-master/_backup2/apps/lenses/tests.py",
"type": "Python"
} | from django.test import TestCase
# Create your tests here.
| RafiKuengREPO_NAMESpaghettiLensPATH_START.@SpaghettiLens_extracted@SpaghettiLens-master@_backup2@apps@lenses@tests.py@.PATH_END.py |
{
"filename": "_matfuncs.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/sparse/linalg/_matfuncs.py",
"type": "Python"
} | """
Sparse matrix functions
"""
#
# Authors: Travis Oliphant, March 2002
# Anthony Scopatz, August 2012 (Sparse Updates)
# Jake Vanderplas, August 2012 (Sparse Updates)
#
__all__ = ['expm', 'inv']
import numpy as np
from scipy.linalg._basic import solve, solve_triangular
from scipy.sparse._base im... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@sparse@linalg@_matfuncs.py@.PATH_END.py |
{
"filename": "test_update_traces.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_traces.py",
"type": "Python"
} | from unittest import TestCase
import inspect
import copy
import pytest
import plotly.graph_objs as go
from plotly.subplots import make_subplots
from functools import reduce
class TestSelectForEachUpdateTraces(TestCase):
def setUp(self):
fig = make_subplots(
rows=3,
cols=2,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@tests@test_core@test_update_objects@test_update_traces.py@.PATH_END.py |
{
"filename": "version.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/setuptools/py3/setuptools/version.py",
"type": "Python"
} | from ._importlib import metadata
try:
__version__ = metadata.version('setuptools') or '0.dev0+unknown'
except Exception:
__version__ = '0.dev0+unknown'
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@setuptools@py3@setuptools@version.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.