metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "main_create_masterstamps_catalogue.py",
"repo_name": "torluca/morphofit",
"repo_path": "morphofit_extracted/morphofit-master/main_functions/main_create_masterstamps_catalogue.py",
"type": "Python"
} | #! /usr/bin/env python
# Copyright (C) 2019,2020 ETH Zurich, Institute for Particle Physics and Astrophysics
# Copyright (C) 2021 University Observatory, Ludwig-Maximilians-Universitaet Muenchen
# Author: Luca Tortorelli
# System imports
from __future__ import (print_function, division, absolute_import,
... | torlucaREPO_NAMEmorphofitPATH_START.@morphofit_extracted@morphofit-master@main_functions@main_create_masterstamps_catalogue.py@.PATH_END.py |
{
"filename": "_imputation.py",
"repo_name": "rapidsai/cuml",
"repo_path": "cuml_extracted/cuml-main/python/cuml/cuml/_thirdparty/sklearn/preprocessing/_imputation.py",
"type": "Python"
} | # Original authors from Sckit-Learn:
# Nicolas Tresegnie <nicolas.tresegnie@gmail.com>
# Sergey Feldman <sergeyfeldman@gmail.com>
# License: BSD 3 clause
# This code originates from the Scikit-Learn library,
# it was since modified to allow GPU acceleration.
# This code is under BSD 3 clause license... | rapidsaiREPO_NAMEcumlPATH_START.@cuml_extracted@cuml-main@python@cuml@cuml@_thirdparty@sklearn@preprocessing@_imputation.py@.PATH_END.py |
{
"filename": "m31_feature_analysis.ipynb",
"repo_name": "snad-space/zwad",
"repo_path": "zwad_extracted/zwad-master/notebooks/m31_feature_analysis.ipynb",
"type": "Jupyter Notebook"
} | ```python
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import sys
import warnings
warnings.filterwarnings("ignore")
```
```python
# M31
m31_oid = np.memmap('../data/oid_m31.dat', mode='r', dtype=np.uint64)
m31_name... | snad-spaceREPO_NAMEzwadPATH_START.@zwad_extracted@zwad-master@notebooks@m31_feature_analysis.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/box/marker/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._symbol import SymbolValidator
from ._size import SizeValidator
from ._outliercolor import OutliercolorValidator
from ._opacity import OpacityValidator
from ._line import LineValidator
from ._color import ColorValidator
else:
from _plotly_utils... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@box@marker@__init__.py@.PATH_END.py |
{
"filename": "_weight.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/choroplethmap/colorbar/title/font/_weight.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WeightValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self,
plotly_name="weight",
parent_name="choroplethmap.colorbar.title.font",
**kwargs,
):
super(WeightValidator, self).__init__(
plotly_na... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@choroplethmap@colorbar@title@font@_weight.py@.PATH_END.py |
{
"filename": "test_inmemory.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/unit_tests/docstore/test_inmemory.py",
"type": "Python"
} | """Test in memory docstore."""
import pytest
from langchain_core.documents import Document
from langchain_community.docstore.in_memory import InMemoryDocstore
def test_document_found() -> None:
"""Test document found."""
_dict = {"foo": Document(page_content="bar")}
docstore = InMemoryDocstore(_dict)
... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@unit_tests@docstore@test_inmemory.py@.PATH_END.py |
{
"filename": "test_pytrees.py",
"repo_name": "rhayes777/PyAutoFit",
"repo_path": "PyAutoFit_extracted/PyAutoFit-main/test_autofit/jax/test_pytrees.py",
"type": "Python"
} | import numpy as np
import pytest
from autofit.jax_wrapper import numpy as jnp
import autofit as af
jax = pytest.importorskip("jax")
def recreate(o):
flatten_func, unflatten_func = jax._src.tree_util._registry[type(o)]
children, aux_data = flatten_func(o)
return unflatten_func(aux_data, children)
@pyt... | rhayes777REPO_NAMEPyAutoFitPATH_START.@PyAutoFit_extracted@PyAutoFit-main@test_autofit@jax@test_pytrees.py@.PATH_END.py |
{
"filename": "fluence_flux.py",
"repo_name": "HeRTA/FRBSTATS",
"repo_path": "FRBSTATS_extracted/FRBSTATS-main/figs/fluence_flux.py",
"type": "Python"
} | from csv import reader
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
### Set MPL plot parameters
# Selectable SVG text
plt.rcParams['svg.fonttype'] = 'none'
# Use TeX
plt.rcParams['text.usetex'] = True
# Set figsize
plt.rcParams["figure.figsize"] = (26,20)
plt.rcParams["figure.dpi"] = ... | HeRTAREPO_NAMEFRBSTATSPATH_START.@FRBSTATS_extracted@FRBSTATS-main@figs@fluence_flux.py@.PATH_END.py |
{
"filename": "fakes_and_scores.ipynb",
"repo_name": "snad-space/zwad",
"repo_path": "zwad_extracted/zwad-master/notebooks/fakes_and_scores.ipynb",
"type": "Jupyter Notebook"
} | ```python
%load_ext autoreload
%autoreload 2
# Comment to make figures visible in html version of the notebook
# %matplotlib notebook
```
```python
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import os
from functools import lru_cache, reduce
from zwad.ad import ZtfAnomal... | snad-spaceREPO_NAMEzwadPATH_START.@zwad_extracted@zwad-master@notebooks@fakes_and_scores.ipynb@.PATH_END.py |
{
"filename": "broadband_poly.py",
"repo_name": "andreicuceu/vega",
"repo_path": "vega_extracted/vega-master/vega/broadband_poly.py",
"type": "Python"
} | import numpy as np
class BroadbandPolynomials:
""" Class for computing broadband polynomials. """
def __init__(self, bb_input, cf_name, model_coordinates, dist_model_coordinates):
self.model_coordinates = model_coordinates
self.dist_model_coordinates = dist_model_coordinates
self.bb_t... | andreicuceuREPO_NAMEvegaPATH_START.@vega_extracted@vega-master@vega@broadband_poly.py@.PATH_END.py |
{
"filename": "jwstpipe1p1p0_ramp_fit.py",
"repo_name": "chriswillott/jwst",
"repo_path": "jwst_extracted/jwst-master/columnjump/columnjump/jwstpipe1p1p0_ramp_fit.py",
"type": "Python"
} | #! /usr/bin/env python
#
# ramp_fit.py - calculate weighted mean of slope, based on Massimo
# Robberto's "On the Optimal Strategy to fit MULTIACCUM
# ramps in the presence of cosmic rays."
# (JWST-STScI-0001490,SM-12; 07/25/08). The derivation
# is a genera... | chriswillottREPO_NAMEjwstPATH_START.@jwst_extracted@jwst-master@columnjump@columnjump@jwstpipe1p1p0_ramp_fit.py@.PATH_END.py |
{
"filename": "mkCat_tar4ang.py",
"repo_name": "desihub/LSS",
"repo_path": "LSS_extracted/LSS-main/scripts/mkCat_tar4ang.py",
"type": "Python"
} | '''
one executable to create catalogs for given target type meant for angular clustering
'''
#standard python
import sys
import os
import shutil
import unittest
from datetime import datetime
import json
import numpy as np
import fitsio
import glob
import argparse
from astropy.table import Table,join,unique,vstack
fr... | desihubREPO_NAMELSSPATH_START.@LSS_extracted@LSS-main@scripts@mkCat_tar4ang.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "sczesla/PyAstronomy",
"repo_path": "PyAstronomy_extracted/PyAstronomy-master/src/pyTiming/__init__.py",
"type": "Python"
} | from . import pyPDM
from . import pyPeriod
from .stringlength import * | sczeslaREPO_NAMEPyAstronomyPATH_START.@PyAstronomy_extracted@PyAstronomy-master@src@pyTiming@__init__.py@.PATH_END.py |
{
"filename": "plot_wedge.py",
"repo_name": "desihub/LSS",
"repo_path": "LSS_extracted/LSS-main/scripts/plotting/plot_wedge.py",
"type": "Python"
} | import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import fitsio
from astropy.table import join,Table
import healpy as hp
from LSS.tabulated_cosmo import TabulatedDESI
cosmo = TabulatedDESI()
dis_dc = cosmo.comoving_radial_distance
outdir = '/global/cfs/cdirs/desi/survey/catalogs/main/LSS/daily/... | desihubREPO_NAMELSSPATH_START.@LSS_extracted@LSS-main@scripts@plotting@plot_wedge.py@.PATH_END.py |
{
"filename": "_name.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/shape/_name.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="name", parent_name="layout.shape", **kwargs):
super(NameValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
ed... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@shape@_name.py@.PATH_END.py |
{
"filename": "test_esa_hubble_remote.py",
"repo_name": "astropy/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/esa/hubble/tests/test_esa_hubble_remote.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
=================
eHST Remote Tests
=================
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
"""
import tempfile
import os
import numpy as np
import pytest
from astroquery.esa.hubble import ESAHubble
from astropy import... | astropyREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@esa@hubble@tests@test_esa_hubble_remote.py@.PATH_END.py |
{
"filename": "generate_breaking_files.ipynb",
"repo_name": "pynucastro/pynucastro",
"repo_path": "pynucastro_extracted/pynucastro-main/pynucastro/library/tabular/suzuki/generate_breaking_files.ipynb",
"type": "Jupyter Notebook"
} | ```python
import numpy as np
import scipy.constants as scp
import itertools
import os
import re
```
```python
eV_to_J, _, _ = scp.physical_constants['electron volt-joule relationship']
MeV_to_eV = 1.0e6
J_to_erg = 1.0e7
MeV_to_erg = MeV_to_eV * eV_to_J * J_to_erg
```
```python
files = ['A21_OFNeNaMg_ScrExp.odat',
... | pynucastroREPO_NAMEpynucastroPATH_START.@pynucastro_extracted@pynucastro-main@pynucastro@library@tabular@suzuki@generate_breaking_files.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "astromer-science/main-code",
"repo_path": "main-code_extracted/main-code-main/presentation/scripts/__init__.py",
"type": "Python"
} | astromer-scienceREPO_NAMEmain-codePATH_START.@main-code_extracted@main-code-main@presentation@scripts@__init__.py@.PATH_END.py | |
{
"filename": "_text.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/choropleth/colorbar/title/_text.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="text", parent_name="choropleth.colorbar.title", **kwargs
):
super(TextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@choropleth@colorbar@title@_text.py@.PATH_END.py |
{
"filename": "test_input_types.py",
"repo_name": "e-koch/FilFinder",
"repo_path": "FilFinder_extracted/FilFinder-master/fil_finder/tests/test_input_types.py",
"type": "Python"
} | # Licensed under an MIT open source license - see LICENSE
import pytest
import numpy as np
import numpy.testing as npt
import astropy.units as u
from astropy.io.fits import PrimaryHDU
try:
from spectral_cube import Projection, Slice
SPECTRALCUBE_INSTALL = True
except ImportError:
SPECTRALCUBE_INSTALL = F... | e-kochREPO_NAMEFilFinderPATH_START.@FilFinder_extracted@FilFinder-master@fil_finder@tests@test_input_types.py@.PATH_END.py |
{
"filename": "_tickformatstop.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/choroplethmap/colorbar/_tickformatstop.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Tickformatstop(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "choroplethmap.colorbar"
_path_str = "choroplethmap.colorbar.tickformatstop"
_valid_p... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@choroplethmap@colorbar@_tickformatstop.py@.PATH_END.py |
{
"filename": "_text.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattersmith/legendgrouptitle/_text.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="text", parent_name="scattersmith.legendgrouptitle", **kwargs
):
super(TextValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattersmith@legendgrouptitle@_text.py@.PATH_END.py |
{
"filename": "_legend.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/carpet/_legend.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LegendValidator(_plotly_utils.basevalidators.SubplotidValidator):
def __init__(self, plotly_name="legend", parent_name="carpet", **kwargs):
super(LegendValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@carpet@_legend.py@.PATH_END.py |
{
"filename": "mp_procoli_functions.py",
"repo_name": "tkarwal/procoli",
"repo_path": "procoli_extracted/procoli-main/src/procoli/mp_procoli_functions.py",
"type": "Python"
} | import os
from copy import deepcopy
from glob import glob
from subprocess import run
from time import time
import re
import numpy as np
from getdist import mcsamples
import procoli.procoli_io as pio
from procoli.procoli_errors import (ParamDifferenceError, GlobalMLDifferenceError,
... | tkarwalREPO_NAMEprocoliPATH_START.@procoli_extracted@procoli-main@src@procoli@mp_procoli_functions.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "wfirst-cgi/emccd_detect",
"repo_path": "emccd_detect_extracted/emccd_detect-master/arcticpy_folder/build/lib/arcticpy/__init__.py",
"type": "Python"
} | from autoarray.instruments import acs
from arcticpy.main import add_cti, remove_cti, model_for_HST_ACS
from arcticpy.roe import (
ROE,
ROEChargeInjection,
ROETrapPumping,
)
from arcticpy.ccd import CCD, CCDPhase
from arcticpy.traps import (
Trap,
TrapInstantCapture,
TrapLifetimeContinuumAbstrac... | wfirst-cgiREPO_NAMEemccd_detectPATH_START.@emccd_detect_extracted@emccd_detect-master@arcticpy_folder@build@lib@arcticpy@__init__.py@.PATH_END.py |
{
"filename": "svi_flow_guide.ipynb",
"repo_name": "pyro-ppl/pyro",
"repo_path": "pyro_extracted/pyro-master/tutorial/source/svi_flow_guide.ipynb",
"type": "Jupyter Notebook"
} | # SVI with a Normalizing Flow guide
Thanks to their expressiveness, normalizing flows (see [normalizing flow introduction](normalizing_flows_intro.ipynb)) are great guide candidates for stochastic variational inference (SVI). This notebook demonstrates how to perform amortized SVI with a normalizing flow as guide.
> ... | pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@tutorial@source@svi_flow_guide.ipynb@.PATH_END.py |
{
"filename": "basic.py",
"repo_name": "dfm/george",
"repo_path": "george_extracted/george-main/src/george/solvers/basic.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = ["BasicSolver"]
import numpy as np
from scipy.linalg import cholesky, cho_solve
class BasicSolver(object):
"""
This is the most basic solver built using :func:`scipy.linalg.cholesky`.
kernel (george.kernels.Kernel): A su... | dfmREPO_NAMEgeorgePATH_START.@george_extracted@george-main@src@george@solvers@basic.py@.PATH_END.py |
{
"filename": "_tickformatstops.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/polar/radialaxis/_tickformatstops.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickformatstopsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self,
plotly_name="tickformatstops",
parent_name="layout.polar.radialaxis",
**kwargs,
):
super(TickformatstopsValidator, self).__init__... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@polar@radialaxis@_tickformatstops.py@.PATH_END.py |
{
"filename": "metadata_routing.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scikit-learn/py3/sklearn/utils/metadata_routing.py",
"type": "Python"
} | """
The :mod:`sklearn.utils.metadata_routing` module includes utilities to route
metadata within scikit-learn estimators.
"""
# This module is not a separate sub-folder since that would result in a circular
# import issue.
#
# Author: Adrin Jalali <adrin.jalali@gmail.com>
# License: BSD 3 clause
from ._metadata_reque... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scikit-learn@py3@sklearn@utils@metadata_routing.py@.PATH_END.py |
{
"filename": "polars_dataframe.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/document_loaders/polars_dataframe.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import PolarsDataFrameLoader
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional ... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@document_loaders@polars_dataframe.py@.PATH_END.py |
{
"filename": "io_tools.py",
"repo_name": "mikecokina/elisa",
"repo_path": "elisa_extracted/elisa-master/src/elisa/analytics/binary_fit/io_tools.py",
"type": "Python"
} | import numpy as np
from . mixins import MCMCMixin
from . shared import AbstractFit
from .. params import parameters
from .. params.parameters import ParameterMeta, BinaryInitialParameters
def filter_chain(mcmc_fit_cls, **boundaries):
"""
Filtering mcmc chain down to given parameter intervals. This function ... | mikecokinaREPO_NAMEelisaPATH_START.@elisa_extracted@elisa-master@src@elisa@analytics@binary_fit@io_tools.py@.PATH_END.py |
{
"filename": "los_dg19.py",
"repo_name": "swagnercarena/paltas",
"repo_path": "paltas_extracted/paltas-main/paltas/Substructure/los_dg19.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Define the class to draw line of sight substructure for a lens according to
https://arxiv.org/pdf/1909.02573.pdf
This module contains the functions needed to turn the parameters of the
los halo distribution into masses, concentrations, and positions.
"""
from .los_base import LOSBase
import... | swagnercarenaREPO_NAMEpaltasPATH_START.@paltas_extracted@paltas-main@paltas@Substructure@los_dg19.py@.PATH_END.py |
{
"filename": "input_pipeline.py",
"repo_name": "google/flax",
"repo_path": "flax_extracted/flax-main/examples/lm1b_nnx/input_pipeline.py",
"type": "Python"
} | # Copyright 2024 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | googleREPO_NAMEflaxPATH_START.@flax_extracted@flax-main@examples@lm1b_nnx@input_pipeline.py@.PATH_END.py |
{
"filename": "test_fail.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/simplejson/py2/simplejson/tests/test_fail.py",
"type": "Python"
} | import sys
from unittest import TestCase
import simplejson as json
# 2007-10-05
JSONDOCS = [
# http://json.org/JSON_checker/test/fail1.json
'"A JSON payload should be an object or array, not a string."',
# http://json.org/JSON_checker/test/fail2.json
'["Unclosed array"',
# http://json.org/JSON_che... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@simplejson@py2@simplejson@tests@test_fail.py@.PATH_END.py |
{
"filename": "test_search_tool.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/partners/exa/tests/integration_tests/test_search_tool.py",
"type": "Python"
} | from langchain_exa import (
ExaSearchResults, # type: ignore[import-not-found, import-not-found]
)
def test_search_tool() -> None:
tool = ExaSearchResults()
res = tool.invoke({"query": "best time to visit japan", "num_results": 5})
print(res) # noqa: T201
assert not isinstance(res, str) # str m... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@partners@exa@tests@integration_tests@test_search_tool.py@.PATH_END.py |
{
"filename": "test_widget_upload.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/ipywidgets/py3/ipywidgets/widgets/tests/test_widget_upload.py",
"type": "Python"
} | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import datetime as dt
from unittest import TestCase
from unittest.mock import MagicMock
from traitlets import TraitError
from ipywidgets import FileUpload
FILE_UPLOAD_FRONTEND_CONTENT = {
'name': 'file-name.txt... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipywidgets@py3@ipywidgets@widgets@tests@test_widget_upload.py@.PATH_END.py |
{
"filename": "performance_counters.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/yt/utilities/performance_counters.py",
"type": "Python"
} | import atexit
import time
from bisect import insort
from collections import defaultdict
from datetime import datetime as dt
from functools import wraps
from yt.config import ytcfg
from yt.funcs import mylog
class PerformanceCounters:
_shared_state = {} # type: ignore
def __new__(cls, *args, **kwargs):
... | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@yt@utilities@performance_counters.py@.PATH_END.py |
{
"filename": "cli.md",
"repo_name": "dokkum/maskfill",
"repo_path": "maskfill_extracted/maskfill-main/docs/cli.md",
"type": "Markdown"
} | ### CLI Usage
When you install `maskfill` it will create a `maskfill` executable callable from the shell. You can print the usage via
```
maskfill -h
```
which will return something like this:
```bash
usage: maskfill [-h] [-e EXTENSION] [-v] [-s SIZE] [-o OPERATOR] [-n] [-w] input mask output
positional arguments... | dokkumREPO_NAMEmaskfillPATH_START.@maskfill_extracted@maskfill-main@docs@cli.md@.PATH_END.py |
{
"filename": "precompute_response_sh.py",
"repo_name": "HydraRadio/Hydra",
"repo_path": "Hydra_extracted/Hydra-main/scripts/precompute_response_sh.py",
"type": "Python"
} | #!/usr/bin/env python
import numpy as np
from mpi4py import MPI
from pyuvdata import UVData
import healpy as hp
import argparse, os, sys, time
import pyuvsim
sys.path.insert(0,'/home/phil/hera/Hydra/')
#sys.path.insert(0,'/cosma/home/dp270/dc-bull2/software/Hydra/')
import hydra
# Set up argparser
description = "Pre... | HydraRadioREPO_NAMEHydraPATH_START.@Hydra_extracted@Hydra-main@scripts@precompute_response_sh.py@.PATH_END.py |
{
"filename": "test_asfreq.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/frame/methods/test_asfreq.py",
"type": "Python"
} | from datetime import datetime
import numpy as np
import pytest
from pandas._libs.tslibs.offsets import MonthEnd
from pandas import (
DataFrame,
DatetimeIndex,
PeriodIndex,
Series,
date_range,
period_range,
to_datetime,
)
import pandas._testing as tm
from pandas.tseries import offsets
c... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@frame@methods@test_asfreq.py@.PATH_END.py |
{
"filename": "mpi_pool.py",
"repo_name": "nye17/javelin",
"repo_path": "javelin_extracted/javelin-master/javelin/emcee_internal/mpi_pool.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, print_function, absolute_import,
unicode_literals)
from six.moves import range
__all__ = ["MPIPool"]
# On some systems mpi4py is available but broken
# we avoid crashes by importing it only when
# an MPI Pool is e... | nye17REPO_NAMEjavelinPATH_START.@javelin_extracted@javelin-master@javelin@emcee_internal@mpi_pool.py@.PATH_END.py |
{
"filename": "_logsumexp.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py2/scipy/special/_logsumexp.py",
"type": "Python"
} | from __future__ import division, print_function, absolute_import
import numpy as np
from scipy._lib._util import _asarray_validated
__all__ = ["logsumexp", "softmax"]
def logsumexp(a, axis=None, b=None, keepdims=False, return_sign=False):
"""Compute the log of the sum of exponentials of input elements.
Par... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py2@scipy@special@_logsumexp.py@.PATH_END.py |
{
"filename": "triples_integrate_tides.py",
"repo_name": "djmunoz/kozaipy",
"repo_path": "kozaipy_extracted/kozaipy-master/kozaipy/triples_integrate_tides.py",
"type": "Python"
} | import numpy as np
import scipy.integrate as integ
import kozaipy.triples as triples
#import bsint
def threebody_ode_vf_tides(t,y,\
m0,m1,m2,
R0, R1,
rg_0, rg_1,
k2_0, k2_1,
tv0, tv1,
... | djmunozREPO_NAMEkozaipyPATH_START.@kozaipy_extracted@kozaipy-master@kozaipy@triples_integrate_tides.py@.PATH_END.py |
{
"filename": "_hoverformat.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/polar/radialaxis/_hoverformat.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HoverformatValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="hoverformat", parent_name="layout.polar.radialaxis", **kwargs
):
super(HoverformatValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@polar@radialaxis@_hoverformat.py@.PATH_END.py |
{
"filename": "test_derivative_util.py",
"repo_name": "lenstronomy/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_Util/test_derivative_util.py",
"type": "Python"
} | __author__ = "sibirrer"
import lenstronomy.Util.derivative_util as calc_util
import pytest
from lenstronomy.Util import util
from lenstronomy.Util import param_util
import numpy.testing as npt
import numpy as np
class TestCalcUtil(object):
"""Tests the Gaussian methods."""
def setup_method(self):
pa... | lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_Util@test_derivative_util.py@.PATH_END.py |
{
"filename": "generate_PCA_files.py",
"repo_name": "federicomarulli/CosmoBolognaLib",
"repo_path": "CosmoBolognaLib_extracted/CosmoBolognaLib-master/External/CLASS/external/distortions/generate_PCA_files.py",
"type": "Python"
} | #!/usr/bin/env python
import numpy as np
import sys
import scipy.interpolate as sciint
from numpy.linalg import norm as vector_norm
from numpy.linalg import eigh as eigen_vals_vecs
import os
import matplotlib.pyplot as plt
# Read inputs
if(len(sys.argv)==14):
sd_detector_name = sys.argv[1]
sd_detector_nu_min = ev... | federicomarulliREPO_NAMECosmoBolognaLibPATH_START.@CosmoBolognaLib_extracted@CosmoBolognaLib-master@External@CLASS@external@distortions@generate_PCA_files.py@.PATH_END.py |
{
"filename": "vlsvvariables.py",
"repo_name": "fmihpc/analysator",
"repo_path": "analysator_extracted/analysator-master/pyVlsv/vlsvvariables.py",
"type": "Python"
} | #
# This file is part of Analysator.
# Copyright 2013-2016 Finnish Meteorological Institute
# Copyright 2017-2018 University of Helsinki
#
# For details of usage, see the COPYING file and read the "Rules of the Road"
# at http://www.physics.helsinki.fi/vlasiator/
#
# This program is free software; you can redistribu... | fmihpcREPO_NAMEanalysatorPATH_START.@analysator_extracted@analysator-master@pyVlsv@vlsvvariables.py@.PATH_END.py |
{
"filename": "constants.py",
"repo_name": "PabloVD/HaloGraphNet",
"repo_path": "HaloGraphNet_extracted/HaloGraphNet-master/Source/constants.py",
"type": "Python"
} | #----------------------------------------------------------------------
# List of constants and some common functions
# Author: Pablo Villanueva Domingo
# Last update: 10/11/21
#----------------------------------------------------------------------
import numpy as np
import torch
import os
import random
# Random seed... | PabloVDREPO_NAMEHaloGraphNetPATH_START.@HaloGraphNet_extracted@HaloGraphNet-master@Source@constants.py@.PATH_END.py |
{
"filename": "axes_grid.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/mpl_toolkits/axisartist/axes_grid.py",
"type": "Python"
} | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import mpl_toolkits.axes_grid1.axes_grid as axes_grid_orig
from .axes_divider import LocatableAxes
class CbarAxes(axes_grid_orig.CbarAxesBase, LocatableAxes):
def __init__(self, *kl, **kwargs):
ori... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@mpl_toolkits@axisartist@axes_grid.py@.PATH_END.py |
{
"filename": "_cmin.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/splom/marker/line/_cmin.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CminValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="cmin", parent_name="splom.marker.line", **kwargs):
super(CminValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@splom@marker@line@_cmin.py@.PATH_END.py |
{
"filename": "test_Sersic.py",
"repo_name": "LSSTDESC/chroma",
"repo_path": "chroma_extracted/chroma-master/tests/deprecated/test_Sersic.py",
"type": "Python"
} | import _mypath
import numpy as np
def test_Sersic():
from chroma.Sersic import Sersic
'''Creating a test case for the various ways of initializing Sersics'''
y0 = 0.1
x0 = 0.3
n = 1.5
peak = 1.0
# a, b, phi
phi = 0.1
a = 0.5
b = 0.2
s1 = Sersic(y0, x0, n, peak=peak, a=a, b=... | LSSTDESCREPO_NAMEchromaPATH_START.@chroma_extracted@chroma-master@tests@deprecated@test_Sersic.py@.PATH_END.py |
{
"filename": "_aspectmode.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/scene/_aspectmode.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class AspectmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="aspectmode", parent_name="layout.scene", **kwargs):
super(AspectmodeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=paren... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@scene@_aspectmode.py@.PATH_END.py |
{
"filename": "data_processing.py",
"repo_name": "ejhigson/nestcheck",
"repo_path": "nestcheck_extracted/nestcheck-master/nestcheck/data_processing.py",
"type": "Python"
} | #!/usr/bin/env python
r"""Module containing functions for loading and processing output files
produced by nested sampling software.
Background: threads
-------------------
``nestcheck``'s error estimates and diagnostics rely on the decomposition
of a nested sampling run into multiple runs, each with a single live poi... | ejhigsonREPO_NAMEnestcheckPATH_START.@nestcheck_extracted@nestcheck-master@nestcheck@data_processing.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/ternary/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._uirevision import UirevisionValidator
from ._sum import SumValidator
from ._domain import DomainValidator
from ._caxis import CaxisValidator
from ._bgcolor import BgcolorValidator
from ._baxis impo... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@ternary@__init__.py@.PATH_END.py |
{
"filename": "astCalc.py",
"repo_name": "mattyowl/astLib",
"repo_path": "astLib_extracted/astLib-main/astLib/astCalc.py",
"type": "Python"
} | """Module for performing common calculations.
(c) 2007-2011 Matt Hilton
(c) 2013-2014 Matt Hilton & Steven Boada
The focus in this module is at present on calculations of distances in a given
cosmology. The parameters for the cosmological model are set using the
variables OMEGA_M0, OMEGA_L0, OMEGA_R0, H0 in the modu... | mattyowlREPO_NAMEastLibPATH_START.@astLib_extracted@astLib-main@astLib@astCalc.py@.PATH_END.py |
{
"filename": "test_condor.py",
"repo_name": "sampsyo/clusterfutures",
"repo_path": "clusterfutures_extracted/clusterfutures-master/tests/test_condor.py",
"type": "Python"
} | from testpath import MockCommand
import cfut
from .utils import run_all_outstanding_work
def square(n):
return n * n
def test_submit():
executor = cfut.CondorExecutor(debug=True, keep_logs=True)
try:
with MockCommand.fixed_output('condor_submit', stdout='Proc 0.0') as csub:
fut = exe... | sampsyoREPO_NAMEclusterfuturesPATH_START.@clusterfutures_extracted@clusterfutures-master@tests@test_condor.py@.PATH_END.py |
{
"filename": "convert.py",
"repo_name": "apertif/apercal",
"repo_path": "apercal_extracted/apercal-master/apercal/modules/convert.py",
"type": "Python"
} | import glob
import logging
import numpy as np
import pandas as pd
from os import path
import os
from apercal.modules.base import BaseModule
from apercal.subs import setinit as subs_setinit
from apercal.subs import managefiles as subs_managefiles
from apercal.subs.param import get_param_def
from apercal.subs import pa... | apertifREPO_NAMEapercalPATH_START.@apercal_extracted@apercal-master@apercal@modules@convert.py@.PATH_END.py |
{
"filename": "planet_growth.py",
"repo_name": "miosta/drift_composition",
"repo_path": "drift_composition_extracted/drift_composition-main/examples/drift_composition/planet_growth.py",
"type": "Python"
} | import numpy as np
from drift_composition.constants import k_boltzmann, m_hydrogen, G_Msun, Rau, Msun, yr, Mearth
def seed_mass(hr, flaring, gas_slope, dist):
dist = dist*Rau
vk = np.sqrt(mass_star*G_Msun/dist)
pres_grad = 2*(flaring-1)+gas_slope
eta = - 0.5* hr**2 * pres_grad
m_min = (eta*vk)**3/G... | miostaREPO_NAMEdrift_compositionPATH_START.@drift_composition_extracted@drift_composition-main@examples@drift_composition@planet_growth.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/legend/title/font/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="layout.legend.title.font", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@legend@title@font@_color.py@.PATH_END.py |
{
"filename": "_text.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/contour/_text.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="text", parent_name="contour", **kwargs):
super(TextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@contour@_text.py@.PATH_END.py |
{
"filename": "bokeh_plot_rank.py",
"repo_name": "arviz-devs/arviz",
"repo_path": "arviz_extracted/arviz-main/examples/bokeh/bokeh_plot_rank.py",
"type": "Python"
} | """
Rank plot
=========
"""
import arviz as az
data = az.load_arviz_data("centered_eight")
ax = az.plot_rank(data, var_names=("tau", "mu"), backend="bokeh")
| arviz-devsREPO_NAMEarvizPATH_START.@arviz_extracted@arviz-main@examples@bokeh@bokeh_plot_rank.py@.PATH_END.py |
{
"filename": "ChainContext.py",
"repo_name": "cosmo-ethz/CosmoHammer",
"repo_path": "CosmoHammer_extracted/CosmoHammer-master/cosmoHammer/ChainContext.py",
"type": "Python"
} |
PARENT_KEY = "key_parent"
PARAMS_KEY = "key_params"
DATA_KEY = "key_data"
class ChainContext(object):
"""
Context holding a dict to store data and information durring the computation of the likelihood
"""
def __init__(self, parent, params):
"""
Constructor of the context
"... | cosmo-ethzREPO_NAMECosmoHammerPATH_START.@CosmoHammer_extracted@CosmoHammer-master@cosmoHammer@ChainContext.py@.PATH_END.py |
{
"filename": "_array.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/bar/error_x/_array.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ArrayValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="array", parent_name="bar.error_x", **kwargs):
super(ArrayValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@bar@error_x@_array.py@.PATH_END.py |
{
"filename": "inform_all.py",
"repo_name": "LSSTDESC/rail_pipelines",
"repo_path": "rail_pipelines_extracted/rail_pipelines-main/src/rail/pipelines/estimation/inform_all.py",
"type": "Python"
} | #!/usr/bin/env python
# coding: utf-8
import ceci
from rail.core.stage import RailStage, RailPipeline
from rail.utils.algo_library import PZ_ALGORITHMS
input_file = 'rubin_dm_dc2_example.pq'
class InformPipeline(RailPipeline):
default_input_dict={'input':'dummy.in'}
def __init__(self, algorithms: dict |... | LSSTDESCREPO_NAMErail_pipelinesPATH_START.@rail_pipelines_extracted@rail_pipelines-main@src@rail@pipelines@estimation@inform_all.py@.PATH_END.py |
{
"filename": "XRDCalibrationFrame.py",
"repo_name": "xraypy/xraylarch",
"repo_path": "xraylarch_extracted/xraylarch-master/larch/wxxrd/XRDCalibrationFrame.py",
"type": "Python"
} | #!/usr/bin/env pythonw
'''
popup for 2D XRD calibration
'''
import os
import numpy as np
import wx
from wxmplot.imagepanel import ImagePanel
from larch.io import tifffile
from larch.xrd import lambda_from_E, E_from_lambda
from larch.utils import get_cwd
from .ImageControlsFrame import ImageToolboxFrame
HAS_pyFAI =... | xraypyREPO_NAMExraylarchPATH_START.@xraylarch_extracted@xraylarch-master@larch@wxxrd@XRDCalibrationFrame.py@.PATH_END.py |
{
"filename": "network.py",
"repo_name": "fabiorigamonti/bang",
"repo_path": "bang_extracted/bang-main/build/lib.linux-x86_64-3.8/src/BANG/network.py",
"type": "Python"
} | import functools
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import data as d
import matplotlib.pyplot as plt
from collections import OrderedDict
'''
This is the Residual in Residual neural network structure!
'''
def make_layer(block, n_layers):
layers = []
for _ in... | fabiorigamontiREPO_NAMEbangPATH_START.@bang_extracted@bang-main@build@lib.linux-x86_64-3.8@src@BANG@network.py@.PATH_END.py |
{
"filename": "_ticktext.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/yaxis/_ticktext.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicktextValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="ticktext", parent_name="layout.yaxis", **kwargs):
super(TicktextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@yaxis@_ticktext.py@.PATH_END.py |
{
"filename": "gravsphere_initialise_LeoI.py",
"repo_name": "justinread/gravsphere",
"repo_path": "gravsphere_extracted/gravsphere-master/gravsphere_initialise_LeoI.py",
"type": "Python"
} | import numpy as np
from constants import *
from functions import *
#This file contains all the code options and choices for
#running a given model. Throughout, -1 means auto-calculate.
#Data files and output base filename:
whichgal = 'LeoI'
infile = output_base+whichgal+'/'+whichgal
outdirbase = output_base+whichg... | justinreadREPO_NAMEgravspherePATH_START.@gravsphere_extracted@gravsphere-master@gravsphere_initialise_LeoI.py@.PATH_END.py |
{
"filename": "fx_root_jh.py",
"repo_name": "kevin218/POET",
"repo_path": "POET_extracted/POET-master/code/lib/fx_root_jh.py",
"type": "Python"
} | from numarray import *
#
# Copyright (c) 1994-2005, Research Systems, Inc. All rights reserved.
# Unauthorized reproduction prohibited.
# Modifications by Joseph Harrington are in the public domain.
#+
# NAME:
# FX_ROOT_JH
#
# PURPOSE:
# This function computes real and complex roots (zeros) of
# ... | kevin218REPO_NAMEPOETPATH_START.@POET_extracted@POET-master@code@lib@fx_root_jh.py@.PATH_END.py |
{
"filename": "_std.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/py/py2/py/_std.py",
"type": "Python"
} | import sys
import warnings
class PyStdIsDeprecatedWarning(DeprecationWarning):
pass
class Std(object):
""" makes top-level python modules available as an attribute,
importing them on first access.
"""
def __init__(self):
self.__dict__ = sys.modules
def __getattr__(self, name):
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@py@py2@py@_std.py@.PATH_END.py |
{
"filename": "_size.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterpolar/hoverlabel/font/_size.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="size", parent_name="scatterpolar.hoverlabel.font", **kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterpolar@hoverlabel@font@_size.py@.PATH_END.py |
{
"filename": "_dataset.py",
"repo_name": "pytorch/vision",
"repo_path": "vision_extracted/vision-main/torchvision/prototype/datasets/utils/_dataset.py",
"type": "Python"
} | import abc
import importlib
import pathlib
from typing import Any, Collection, Dict, Iterator, List, Optional, Sequence, Union
from torchdata.datapipes.iter import IterDataPipe
from torchvision.datasets.utils import verify_str_arg
from ._resource import OnlineResource
class Dataset(IterDataPipe[Dict[str, Any]], abc... | pytorchREPO_NAMEvisionPATH_START.@vision_extracted@vision-main@torchvision@prototype@datasets@utils@_dataset.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/bar/error_y/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._width import WidthValidator
from ._visible import VisibleValidator
from ._valueminus import ValueminusValidator
from ._value import ValueValidator
from ._type import TypeValidator
from ._tracerefminus import TracerefminusValidator
from ._trace... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@bar@error_y@__init__.py@.PATH_END.py |
{
"filename": "c_router.py",
"repo_name": "mikecokina/elisa",
"repo_path": "elisa_extracted/elisa-master/src/elisa/single_system/curves/c_router.py",
"type": "Python"
} | import numpy as np
from ... logger import getLogger
from ... import const
from .. container import SinglePositionContainer
from . import utils as crv_utils, c_managed
from ... observer.mp_manager import manage_observations
logger = getLogger('single_system.curves.curves')
def resolve_curve_method(system, fn_array):... | mikecokinaREPO_NAMEelisaPATH_START.@elisa_extracted@elisa-master@src@elisa@single_system@curves@c_router.py@.PATH_END.py |
{
"filename": "test_html2text_transformer.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/unit_tests/document_transformers/test_html2text_transformer.py",
"type": "Python"
} | """Unit tests for html2text document transformer."""
import pytest
from langchain_core.documents import Document
from langchain_community.document_transformers import Html2TextTransformer
@pytest.mark.requires("html2text")
def test_transform_empty_html() -> None:
html2text_transformer = Html2TextTransformer()
... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@unit_tests@document_transformers@test_html2text_transformer.py@.PATH_END.py |
{
"filename": "HGP_2018_ds633_cov.py",
"repo_name": "CaymanUnterborn/ExoPlex",
"repo_path": "ExoPlex_extracted/ExoPlex-master/ExoPlex/burnman/minerals/HGP_2018_ds633_cov.py",
"type": "Python"
} | # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences
# Copyright (C) 2012 - 2021 by the BurnMan team, released under the GNU
# GPL v2 or later.
"""
HGP_2018 (ds-633) zero-point energy covariance matrix
Derived from Holland, Green and Powell (2018) and referen... | CaymanUnterbornREPO_NAMEExoPlexPATH_START.@ExoPlex_extracted@ExoPlex-master@ExoPlex@burnman@minerals@HGP_2018_ds633_cov.py@.PATH_END.py |
{
"filename": "_shape.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/pie/marker/pattern/_shape.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShapeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="shape", parent_name="pie.marker.pattern", **kwargs):
super(ShapeValidator, 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@pie@marker@pattern@_shape.py@.PATH_END.py |
{
"filename": "horizontal_incidence.py",
"repo_name": "neeravkaushal/RIDs-in-WCDs",
"repo_path": "RIDs-in-WCDs_extracted/RIDs-in-WCDs-master/horizontal_incidence.py",
"type": "Python"
} | #!/usr/bin/env python
#coding: utf-8
#PYTHON Code: Simulation for horizontal incidence of muon
#Author: Neerav Kaushal
#Import Libraries
import matplotlib.pyplot as plt
from numpy import sin, cos, sqrt, pi, linspace, arange, deg2rad, rad2deg, array, zeros
from numpy import arcsin, arccos,sort, argsort, argwhere, argmi... | neeravkaushalREPO_NAMERIDs-in-WCDsPATH_START.@RIDs-in-WCDs_extracted@RIDs-in-WCDs-master@horizontal_incidence.py@.PATH_END.py |
{
"filename": "human.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/callbacks/human.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.callbacks.human import (
AsyncHumanApprovalCallbackHandler,
HumanApprovalCallbackHandler,
HumanRejectedException,
)
# Create a way to dynamically look up depreca... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@callbacks@human.py@.PATH_END.py |
{
"filename": "_ticks.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattergl/marker/colorbar/_ticks.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicksValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="ticks", parent_name="scattergl.marker.colorbar", **kwargs
):
super(TicksValidator, self).__init__(
plotly_name=plotly_name,
paren... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattergl@marker@colorbar@_ticks.py@.PATH_END.py |
{
"filename": "test_event.py",
"repo_name": "ebachelet/pyLIMA",
"repo_path": "pyLIMA_extracted/pyLIMA-master/pyLIMA/tests/test_event.py",
"type": "Python"
} | import numpy as np
from pyLIMA import telescopes, event
def test_event():
lightcurve = np.array([[2456789, 12.8, 0.01], [2458888, 12, 0.25]])
telo = telescopes.Telescope(name='fake', camera_filter='I',
lightcurve=lightcurve,
lightcurve_names=['... | ebacheletREPO_NAMEpyLIMAPATH_START.@pyLIMA_extracted@pyLIMA-master@pyLIMA@tests@test_event.py@.PATH_END.py |
{
"filename": "_arrayminussrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/histogram/error_y/_arrayminussrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ArrayminussrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="arrayminussrc", parent_name="histogram.error_y", **kwargs
):
super(ArrayminussrcValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@histogram@error_y@_arrayminussrc.py@.PATH_END.py |
{
"filename": "hub_mixin.py",
"repo_name": "qubvel/segmentation_models.pytorch",
"repo_path": "segmentation_models.pytorch_extracted/segmentation_models.pytorch-main/segmentation_models_pytorch/base/hub_mixin.py",
"type": "Python"
} | import json
from pathlib import Path
from typing import Optional, Union
from functools import wraps
from huggingface_hub import (
PyTorchModelHubMixin,
ModelCard,
ModelCardData,
hf_hub_download,
)
MODEL_CARD = """
---
{{ card_data }}
---
# {{ model_name }} Model Card
Table of Contents:
- [Load traine... | qubvelREPO_NAMEsegmentation_models.pytorchPATH_START.@segmentation_models.pytorch_extracted@segmentation_models.pytorch-main@segmentation_models_pytorch@base@hub_mixin.py@.PATH_END.py |
{
"filename": "surveys.py",
"repo_name": "latrop/DECA",
"repo_path": "DECA_extracted/DECA-master/prep_modules/surveys.py",
"type": "Python"
} | #!/usr/bin/python
# -*- coding: cp1251 -*-
import sys
import math
import numpy as np
from scipy import stats
import scipy as sp
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import matplotlib.patches as patches
import matplotlib.path as path
from matplotlib.ticker import NullFormatter
from numpy impo... | latropREPO_NAMEDECAPATH_START.@DECA_extracted@DECA-master@prep_modules@surveys.py@.PATH_END.py |
{
"filename": "quickstart.ipynb",
"repo_name": "ExObsSim/ExoRad2-public",
"repo_path": "ExoRad2-public_extracted/ExoRad2-public-master/examples/quickstart.ipynb",
"type": "Jupyter Notebook"
} | # Exorad 2.0
This Notebook will show you how to use exorad library to build your own pipeline.
Before we start, let's silent the exorad logger.
```python
import warnings
warnings.filterwarnings("ignore")
from exorad.log import disableLogging
disableLogging()
```
## Preparing the instrument
### Load the instr... | ExObsSimREPO_NAMEExoRad2-publicPATH_START.@ExoRad2-public_extracted@ExoRad2-public-master@examples@quickstart.ipynb@.PATH_END.py |
{
"filename": "_pie.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/layout/template/data/_pie.py",
"type": "Python"
} | from plotly.graph_objs import Pie
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@layout@template@data@_pie.py@.PATH_END.py |
{
"filename": "_insidetextfont.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/treemap/_insidetextfont.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class InsidetextfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="insidetextfont", parent_name="treemap", **kwargs):
super(InsidetextfontValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@treemap@_insidetextfont.py@.PATH_END.py |
{
"filename": "observers.py",
"repo_name": "gammapy/gammapy",
"repo_path": "gammapy_extracted/gammapy-main/gammapy/utils/observers.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Location of gamma-ray observatories."""
import astropy.units as u
from astropy.coordinates import EarthLocation
__all__ = ["observatory_locations"]
observatory_locations = {}
"""Gamma-ray observatory locations (dict).
This is a dict with observatory... | gammapyREPO_NAMEgammapyPATH_START.@gammapy_extracted@gammapy-main@gammapy@utils@observers.py@.PATH_END.py |
{
"filename": "_colorbar.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattersmith/marker/_colorbar.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorbarValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="colorbar", parent_name="scattersmith.marker", **kwargs
):
super(ColorbarValidator, self).__init__(
plotly_name=plotly_name,
pare... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattersmith@marker@_colorbar.py@.PATH_END.py |
{
"filename": "_namelengthsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/choroplethmap/hoverlabel/_namelengthsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="namelengthsrc",
parent_name="choroplethmap.hoverlabel",
**kwargs,
):
super(NamelengthsrcValidator, self).__init__(
p... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@choroplethmap@hoverlabel@_namelengthsrc.py@.PATH_END.py |
{
"filename": "geom.py",
"repo_name": "gammapy/gammapy",
"repo_path": "gammapy_extracted/gammapy-main/gammapy/maps/hpx/geom.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Utilities for dealing with HEALPix projections and mappings."""
import copy
import numpy as np
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.io import fits
from astropy.units import Quantity
from gammapy.utils.arra... | gammapyREPO_NAMEgammapyPATH_START.@gammapy_extracted@gammapy-main@gammapy@maps@hpx@geom.py@.PATH_END.py |
{
"filename": "test.py",
"repo_name": "xwzhang98/SREmulator",
"repo_path": "SREmulator_extracted/SREmulator-main/map2map/map2map/test.py",
"type": "Python"
} | import os
import sys
import warnings
from pprint import pprint
import numpy as np
import torch
from torch.utils.data import DataLoader
from .data import FieldDataset
from .data import norms
from . import models
from .models import narrow_cast
from .utils import import_attr, load_model_state_dict
from .models import na... | xwzhang98REPO_NAMESREmulatorPATH_START.@SREmulator_extracted@SREmulator-main@map2map@map2map@test.py@.PATH_END.py |
{
"filename": "Plot-Thermo-Slopes-checkpoint.ipynb",
"repo_name": "AMReX-Astro/MAESTROeX",
"repo_path": "MAESTROeX_extracted/MAESTROeX-main/Exec/science/urca/analysis/.ipynb_checkpoints/Plot-Thermo-Slopes-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | AMReX-AstroREPO_NAMEMAESTROeXPATH_START.@MAESTROeX_extracted@MAESTROeX-main@Exec@science@urca@analysis@.ipynb_checkpoints@Plot-Thermo-Slopes-checkpoint.ipynb@.PATH_END.py | |
{
"filename": "amcsd.py",
"repo_name": "xraypy/xraylarch",
"repo_path": "xraylarch_extracted/xraylarch-master/larch/xrd/amcsd.py",
"type": "Python"
} | #!/usr/bin/env python
"""
replaced by larixite code
"""
from larixite.amcsd import (get_amcsd, get_cif, find_cifs,
parse_cif_file, CifStructure)
| xraypyREPO_NAMExraylarchPATH_START.@xraylarch_extracted@xraylarch-master@larch@xrd@amcsd.py@.PATH_END.py |
{
"filename": "test_diagnostics.py",
"repo_name": "probabilists/lampe",
"repo_path": "lampe_extracted/lampe-master/tests/test_diagnostics.py",
"type": "Python"
} | r"""Tests for the lampe.diagnostics module."""
import torch
from lampe.diagnostics import *
from zuko.distributions import Independent, Normal, Truncated
def test_expected_coverage_mc():
posterior = lambda x: Independent(Normal(0, 1 + x**2), 1)
x = torch.randn(1024, 2)
theta = posterior(x).sample()
... | probabilistsREPO_NAMElampePATH_START.@lampe_extracted@lampe-master@tests@test_diagnostics.py@.PATH_END.py |
{
"filename": "index.md",
"repo_name": "ChandraCXC/iris",
"repo_path": "iris_extracted/iris-master/test-components/src/site/markdown/index.md",
"type": "Markdown"
} | # test-components
This page contains developer information for the `test-components` module.
Please see the [Project Documentation][proj-info] for more details.
Otherwise, return to the main [Iris user documentation][user-docs].
[proj-info]: ./project-info.html
[user-docs]: ../index.html | ChandraCXCREPO_NAMEirisPATH_START.@iris_extracted@iris-master@test-components@src@site@markdown@index.md@.PATH_END.py |
{
"filename": "test_constant.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/astropy/constants/tests/test_constant.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import pytest
from astropy.constants import Constant
from astropy.units import Quantity as Q
def test_c():
from astropy.constants import c
# c is an exactly defined constant, so it shouldn't be changing
assert c.value == 2.997... | astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@constants@tests@test_constant.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/prefect/events/schemas/__init__.py",
"type": "Python"
} | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@events@schemas@__init__.py@.PATH_END.py | |
{
"filename": "example_optimize_pv.py",
"repo_name": "geodynamics/burnman",
"repo_path": "burnman_extracted/burnman-main/examples/example_optimize_pv.py",
"type": "Python"
} | # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences
# Copyright (C) 2012 - 2015 by the BurnMan team, released under the GNU
# GPL v2 or later.
"""
example_optimize_pv
-------------------
Vary the amount perovskite vs. ferropericlase and compute the error i... | geodynamicsREPO_NAMEburnmanPATH_START.@burnman_extracted@burnman-main@examples@example_optimize_pv.py@.PATH_END.py |
{
"filename": "main.py",
"repo_name": "cdslaborg/paramonte",
"repo_path": "paramonte_extracted/paramonte-main/example/fortran/pm_mathGammaNR/getGammaIncLowNR/main.py",
"type": "Python"
} | #!/usr/bin/env python
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import glob
import sys
fontsize = 17
kind = "RK"
label = [ r"shape: $\kappa = 1.0$"
, r"shape: $\kappa = 2.5$"
, r"shape: $\kappa = 5.0$"
]
pattern = "*." + kind + ".txt"
fileList = glob.glob(pattern... | cdslaborgREPO_NAMEparamontePATH_START.@paramonte_extracted@paramonte-main@example@fortran@pm_mathGammaNR@getGammaIncLowNR@main.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.