metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/ohlc/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._decreasing import Decreasing
from ._hoverlabel import Hoverlabel
from ._increasing import Increasing
from ._legendgrouptitle import Legendgrouptitle
from ._line import Line
from ._stream import Str... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@ohlc@__init__.py@.PATH_END.py |
{
"filename": "cartocolorspalette.py",
"repo_name": "jiffyclub/palettable",
"repo_path": "palettable_extracted/palettable-master/palettable/cartocolors/cartocolorspalette.py",
"type": "Python"
} | """
Palette class and utilities for CartoColors palettes.
"""
from __future__ import absolute_import
from ..palette import Palette
class CartoColorsMap(Palette):
"""
Representation of a color map with matplotlib compatible
views of the map.
Parameters
----------
name : str
palette_type ... | jiffyclubREPO_NAMEpalettablePATH_START.@palettable_extracted@palettable-master@palettable@cartocolors@cartocolorspalette.py@.PATH_END.py |
{
"filename": "_tick0.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/ternary/caxis/_tick0.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class Tick0Validator(_plotly_utils.basevalidators.AnyValidator):
def __init__(
self, plotly_name="tick0", parent_name="layout.ternary.caxis", **kwargs
):
super(Tick0Validator, self).__init__(
plotly_name=plotly_name,
parent_name=paren... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@ternary@caxis@_tick0.py@.PATH_END.py |
{
"filename": "_blocking_input.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/lib/matplotlib/_blocking_input.py",
"type": "Python"
} | def blocking_input_loop(figure, event_names, timeout, handler):
"""
Run *figure*'s event loop while listening to interactive events.
The events listed in *event_names* are passed to *handler*.
This function is used to implement `.Figure.waitforbuttonpress`,
`.Figure.ginput`, and `.Axes.clabel`.
... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@lib@matplotlib@_blocking_input.py@.PATH_END.py |
{
"filename": "master_script.py",
"repo_name": "bbercovici/SBGAT",
"repo_path": "SBGAT_extracted/SBGAT-master/Examples/PGMUncertaintyMCSlopesValidation/master_script.py",
"type": "Python"
} | import os
import json
import numpy as np
import os
import platform
import sys
import itertools
import time
import socket
def generate_all_cases_dictionnary_list(base_dictionnary,all_cases_dictionnary,base_location,sim_name):
if len(all_cases_dictionnary) > 0:
keys, values = zip(*all_cases_dictionnary.i... | bbercoviciREPO_NAMESBGATPATH_START.@SBGAT_extracted@SBGAT-master@Examples@PGMUncertaintyMCSlopesValidation@master_script.py@.PATH_END.py |
{
"filename": "util.py",
"repo_name": "triton-inference-server/server",
"repo_path": "server_extracted/server-main/qa/python_models/model_init_del/util.py",
"type": "Python"
} | #!/usr/bin/env python3
# Copyright 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# ... | triton-inference-serverREPO_NAMEserverPATH_START.@server_extracted@server-main@qa@python_models@model_init_del@util.py@.PATH_END.py |
{
"filename": "dna_lm.ipynb",
"repo_name": "huggingface/peft",
"repo_path": "peft_extracted/peft-main/examples/dna_language_models/dna_lm.ipynb",
"type": "Jupyter Notebook"
} | # PEFT with DNA Language Models
This notebook demonstrates how to utilize parameter-efficient fine-tuning techniques (PEFT) from the PEFT library to fine-tune a DNA Language Model (DNA-LM). The fine-tuned DNA-LM will be applied to solve a task from the nucleotide benchmark dataset. Parameter-efficient fine-tuning (PEF... | huggingfaceREPO_NAMEpeftPATH_START.@peft_extracted@peft-main@examples@dna_language_models@dna_lm.ipynb@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "tomasstolker/pycrires",
"repo_path": "pycrires_extracted/pycrires-main/docs/conf.py",
"type": "Python"
} | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | tomasstolkerREPO_NAMEpycriresPATH_START.@pycrires_extracted@pycrires-main@docs@conf.py@.PATH_END.py |
{
"filename": "exotrending.py",
"repo_name": "oscaribv/exotrending",
"repo_path": "exotrending_extracted/exotrending-master/exotrending.py",
"type": "Python"
} | #!/usr/bin/python
#Load libraries
from __future__ import print_function, division, absolute_import
import sys
sys.path.append('./src')
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
import exomodule as exo
from scipy.optimize import curve_fit
#Read the input file
exec(open('src/def... | oscaribvREPO_NAMEexotrendingPATH_START.@exotrending_extracted@exotrending-master@exotrending.py@.PATH_END.py |
{
"filename": "ConsoleWidget.py",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/pyqtgraph/examples/ConsoleWidget.py",
"type": "Python"
} | """
ConsoleWidget is used to allow execution of user-supplied python commands
in an application. It also includes a command history and functionality for trapping
and inspecting stack traces.
"""
import numpy as np
import pyqtgraph as pg
import pyqtgraph.console
app = pg.mkQApp()
## build an initial namespace for ... | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@pyqtgraph@examples@ConsoleWidget.py@.PATH_END.py |
{
"filename": "_side.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattermapbox/marker/colorbar/title/_side.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SideValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="side",
parent_name="scattermapbox.marker.colorbar.title",
**kwargs,
):
super(SideValidator, self).__init__(
plotly_nam... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattermapbox@marker@colorbar@title@_side.py@.PATH_END.py |
{
"filename": "test_lupton_rgb.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/visualization/tests/test_lupton_rgb.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for RGB Images
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
import os
import tempfile
import pytest
import numpy as np
from numpy.testing import assert_equal
from ...convolution import con... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@visualization@tests@test_lupton_rgb.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "PetroFit/petrofit",
"repo_path": "petrofit_extracted/petrofit-main/petrofit/petrosian/__init__.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .core import *
from .correction import *
| PetroFitREPO_NAMEpetrofitPATH_START.@petrofit_extracted@petrofit-main@petrofit@petrosian@__init__.py@.PATH_END.py |
{
"filename": "test_procedure.py",
"repo_name": "CP3-Origins/cp3-bench",
"repo_path": "cp3-bench_extracted/cp3-bench-master/bench/methods/operon/tests/test_procedure.py",
"type": "Python"
} | import os
import sys
from unittest import TestCase
from pyoperon.sklearn import SymbolicRegressor
# Method to test
sys.path.append(os.path.join(os.path.dirname(__file__), '../../../../'))
from bench.methods.operon.procedure import OperonProcedure
# Import local methods
sys.path.append(os.path.join(os.path.dirname(__f... | CP3-OriginsREPO_NAMEcp3-benchPATH_START.@cp3-bench_extracted@cp3-bench-master@bench@methods@operon@tests@test_procedure.py@.PATH_END.py |
{
"filename": "chain_filter.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/retrievers/document_compressors/chain_filter.py",
"type": "Python"
} | """Filter that uses an LLM to drop documents that aren't relevant to the query."""
from typing import Any, Callable, Dict, Optional, Sequence
from langchain_core.callbacks.manager import Callbacks
from langchain_core.documents import Document
from langchain_core.language_models import BaseLanguageModel
from langchain... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@retrievers@document_compressors@chain_filter.py@.PATH_END.py |
{
"filename": "test_array_indexing_manipulations.py",
"repo_name": "astropy/halotools",
"repo_path": "halotools_extracted/halotools-master/halotools/utils/tests/test_array_indexing_manipulations.py",
"type": "Python"
} | """ Module provides testing for the array_indexing_manipulations functions.
"""
from __future__ import division, print_function, absolute_import, unicode_literals
import numpy as np
from astropy.utils.misc import NumpyRNGContext
import pytest
from .. import array_indexing_manipulations as aim
__all__ = ('test_calcul... | astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@halotools@utils@tests@test_array_indexing_manipulations.py@.PATH_END.py |
{
"filename": "_thickness.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/parcats/line/colorbar/_thickness.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ThicknessValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="thickness", parent_name="parcats.line.colorbar", **kwargs
):
super(ThicknessValidator, self).__init__(
plotly_name=plotly_name,
p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@parcats@line@colorbar@_thickness.py@.PATH_END.py |
{
"filename": "_validation.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/scipy/sparse/csgraph/_validation.py",
"type": "Python"
} | from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.sparse import csr_matrix, isspmatrix, isspmatrix_csc
from ._tools import csgraph_to_dense, csgraph_from_dense,\
csgraph_masked_from_dense, csgraph_from_masked
DTYPE = np.float64
def validate_graph(csgraph, directed, d... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@scipy@sparse@csgraph@_validation.py@.PATH_END.py |
{
"filename": "_marker.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/scatter/_marker.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Marker(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatter"
_path_str = "scatter.marker"
_valid_props = {
"angle",
"angleref",
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@scatter@_marker.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "spacetelescope/mirage",
"repo_path": "mirage_extracted/mirage-master/mirage/catalogs/utils.py",
"type": "Python"
} | #! /usr/bin/env python
"""This module contains utility functions related to source catalogs
"""
import os
from astropy.io import ascii
import numpy as np
from mirage.utils.constants import IMAGING_ALLOWED_CATALOGS, WFSS_ALLOWED_CATALOGS, \
TS_IMAGING_ALLOWED_CATALOGS, TS_GRISM_ALLOW... | spacetelescopeREPO_NAMEmiragePATH_START.@mirage_extracted@mirage-master@mirage@catalogs@utils.py@.PATH_END.py |
{
"filename": "mcz.py",
"repo_name": "metal-sn/pyMCZ",
"repo_path": "pyMCZ_extracted/pyMCZ-master/pyMCZ/mcz.py",
"type": "Python"
} | #!/usr/bin/env python
from __future__ import print_function
import os
import sys
import argparse
import warnings
import numpy as np
import scipy.stats as stats
from scipy.special import gammaln
from scipy import optimize
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
import csv as csv... | metal-snREPO_NAMEpyMCZPATH_START.@pyMCZ_extracted@pyMCZ-master@pyMCZ@mcz.py@.PATH_END.py |
{
"filename": "_showticksuffix.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/parcats/line/colorbar/_showticksuffix.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowticksuffixValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="showticksuffix",
parent_name="parcats.line.colorbar",
**kwargs
):
super(ShowticksuffixValidator, self).__init__(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@parcats@line@colorbar@_showticksuffix.py@.PATH_END.py |
{
"filename": "_size.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/densitymapbox/colorbar/tickfont/_size.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="size",
parent_name="densitymapbox.colorbar.tickfont",
**kwargs,
):
super(SizeValidator, self).__init__(
plotly_name=plotly... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@densitymapbox@colorbar@tickfont@_size.py@.PATH_END.py |
{
"filename": "psurf_tutorial.py",
"repo_name": "lorenaacuna/GASTLI",
"repo_path": "GASTLI_extracted/GASTLI-main/Examples/psurf_tutorial.py",
"type": "Python"
} |
# Import coupling module
import gastli.Coupling as cpl
import gastli.constants as cte
# Other Python modules
# Other Python modules
import numpy as np
import matplotlib.pyplot as plt
# Create coupling class
# Time initialization time
my_coupling = cpl.coupling(path_to_file="/Users/acuna/Desktop/gastli_input_data/"... | lorenaacunaREPO_NAMEGASTLIPATH_START.@GASTLI_extracted@GASTLI-main@Examples@psurf_tutorial.py@.PATH_END.py |
{
"filename": "IO.py",
"repo_name": "grd349/PBjam",
"repo_path": "PBjam_extracted/PBjam-master/pbjam/IO.py",
"type": "Python"
} | """
This module contains classes and functions for handling I/O related matters,
including downloading time series and computing power density spectra.
"""
from . import PACKAGEDIR
import jax.numpy as jnp
import numpy as np
from scipy.integrate import simpson
import os, pickle, re, time
import lightkurve as lk
from ... | grd349REPO_NAMEPBjamPATH_START.@PBjam_extracted@PBjam-master@pbjam@IO.py@.PATH_END.py |
{
"filename": "skymodel_vis_sim.py",
"repo_name": "rasg-affiliates/healvis",
"repo_path": "healvis_extracted/healvis-master/scripts/skymodel_vis_sim.py",
"type": "Python"
} | #!/bin/env python
# -*- mode: python; coding: utf-8 -*
# Copyright (c) 2019 Radio Astronomy Software Group
# Licensed under the 3-clause BSD License
# SBATCH -J healvis
# SBATCH -t 2-00:00:00
# SBATCH --cpus-per-task=24
# SBATCH --mem=100G
# SBATCH -A jpober-condo
# SBATCH --qos=jpober-condo
# SBATCH --mail-type=FAIL
... | rasg-affiliatesREPO_NAMEhealvisPATH_START.@healvis_extracted@healvis-master@scripts@skymodel_vis_sim.py@.PATH_END.py |
{
"filename": "likelihood_class.py",
"repo_name": "fkoehlin/montepython_2cosmos_public",
"repo_path": "montepython_2cosmos_public_extracted/montepython_2cosmos_public-master/montepython/likelihood_class.py",
"type": "Python"
} | """
.. module:: likelihood_class
:synopsis: Definition of the major likelihoods
.. moduleauthor:: Julien Lesgourgues <lesgourg@cern.ch>
.. moduleauthor:: Benjamin Audren <benjamin.audren@epfl.ch>
Contains the definition of the base likelihood class :class:`Likelihood`, with
basic functions, as well as more specific... | fkoehlinREPO_NAMEmontepython_2cosmos_publicPATH_START.@montepython_2cosmos_public_extracted@montepython_2cosmos_public-master@montepython@likelihood_class.py@.PATH_END.py |
{
"filename": "_sequentialminus.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/colorscale/_sequentialminus.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SequentialminusValidator(_plotly_utils.basevalidators.ColorscaleValidator):
def __init__(
self, plotly_name="sequentialminus", parent_name="layout.colorscale", **kwargs
):
super(SequentialminusValidator, self).__init__(
plotly_name=plotly_n... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@colorscale@_sequentialminus.py@.PATH_END.py |
{
"filename": "test_image_model.py",
"repo_name": "lenstronomy/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_ImSim/test_image_model.py",
"type": "Python"
} | __author__ = "sibirrer"
import numpy.testing as npt
import numpy as np
import pytest
import lenstronomy.Util.param_util as param_util
from lenstronomy.LensModel.lens_model import LensModel
from lenstronomy.LightModel.light_model import LightModel
from lenstronomy.PointSource.point_source import PointSource
from lenst... | lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_ImSim@test_image_model.py@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/ohlc/legendgrouptitle/_font.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "ohlc.legendgrouptitle"
_path_str = "ohlc.legendgrouptitle.font"
_valid_props = {
"colo... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@ohlc@legendgrouptitle@_font.py@.PATH_END.py |
{
"filename": "deblendDefault.py",
"repo_name": "lsst-ts/ts_wep",
"repo_path": "ts_wep_extracted/ts_wep-main/python/lsst/ts/wep/deblend/deblendDefault.py",
"type": "Python"
} | # This file is part of ts_wep.
#
# Developed for the LSST Telescope and Site Systems.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This program is free software: you ... | lsst-tsREPO_NAMEts_wepPATH_START.@ts_wep_extracted@ts_wep-main@python@lsst@ts@wep@deblend@deblendDefault.py@.PATH_END.py |
{
"filename": "_weightsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/icicle/hoverlabel/font/_weightsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WeightsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="weightsrc", parent_name="icicle.hoverlabel.font", **kwargs
):
super(WeightsrcValidator, self).__init__(
plotly_name=plotly_name,
par... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@icicle@hoverlabel@font@_weightsrc.py@.PATH_END.py |
{
"filename": "point.py",
"repo_name": "veusz/veusz",
"repo_path": "veusz_extracted/veusz-master/veusz/widgets/point.py",
"type": "Python"
} | # Copyright (C) 2008 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# ... | veuszREPO_NAMEveuszPATH_START.@veusz_extracted@veusz-master@veusz@widgets@point.py@.PATH_END.py |
{
"filename": "apply_template_examples2-checkpoint.ipynb",
"repo_name": "vfbraga/RRL_lcvtemplate_griz_LSST",
"repo_path": "RRL_lcvtemplate_griz_LSST_extracted/RRL_lcvtemplate_griz_LSST-main/.ipynb_checkpoints/apply_template_examples2-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | # Examples for using the RR Lyrae LSST griz templates by [Braga+ 2024]
This notebook will guide the user in all the possible cases in which it is possible to apply the RR Lyrae LSST templates. The aim is always to derive a mean magnitude from
1) A few magnitude measurements in LSST (see details for each case)
2) The... | vfbragaREPO_NAMERRL_lcvtemplate_griz_LSSTPATH_START.@RRL_lcvtemplate_griz_LSST_extracted@RRL_lcvtemplate_griz_LSST-main@.ipynb_checkpoints@apply_template_examples2-checkpoint.ipynb@.PATH_END.py |
{
"filename": "_family.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/treemap/marker/colorbar/tickfont/_family.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="family",
parent_name="treemap.marker.colorbar.tickfont",
**kwargs,
):
super(FamilyValidator, self).__init__(
plotly_name... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@treemap@marker@colorbar@tickfont@_family.py@.PATH_END.py |
{
"filename": "multiplicative.py",
"repo_name": "renecotyfanboy/jaxspec",
"repo_path": "jaxspec_extracted/jaxspec-main/src/jaxspec/model/multiplicative.py",
"type": "Python"
} | from __future__ import annotations
import flax.nnx as nnx
import jax.numpy as jnp
import numpy as np
from astropy.table import Table
from ..util.online_storage import table_manager
from .abc import MultiplicativeComponent
class MultiplicativeConstant(MultiplicativeComponent):
r"""
A multiplicative constant... | renecotyfanboyREPO_NAMEjaxspecPATH_START.@jaxspec_extracted@jaxspec-main@src@jaxspec@model@multiplicative.py@.PATH_END.py |
{
"filename": "sdss_dr16_baoplus_lyxqso.py",
"repo_name": "ggalloni/cobaya",
"repo_path": "cobaya_extracted/cobaya-master/cobaya/likelihoods/bao/sdss_dr16_baoplus_lyxqso.py",
"type": "Python"
} | from cobaya.likelihoods.base_classes import BAO
class sdss_dr16_baoplus_lyxqso(BAO):
r"""
Likelihood of the power spectrum Lya x QSO BAO of SDSS DR16 \cite{Alam:2020sor}.
"""
pass
| ggalloniREPO_NAMEcobayaPATH_START.@cobaya_extracted@cobaya-master@cobaya@likelihoods@bao@sdss_dr16_baoplus_lyxqso.py@.PATH_END.py |
{
"filename": "script.py",
"repo_name": "DTsuna/CHIPS",
"repo_path": "CHIPS_extracted/CHIPS-master/input/TOPS_multigroup/Y0.5/script.py",
"type": "Python"
} | from bs4 import BeautifulSoup
import numpy as np
import subprocess
eV = 1.16045E+04 ### 1eV = 1.16045E+04 K
Hz = 2.41799E+14 ### 1eV = 2.41799E+14 Hz
filelist = ['5E-04', '1E-03', '3E-03', '1E-02', '3E-02', '1E-01']
name = filelist[0]
with open(name+'.html', encoding = 'utf-8') as f:
html = f.read()
soup = Beautif... | DTsunaREPO_NAMECHIPSPATH_START.@CHIPS_extracted@CHIPS-master@input@TOPS_multigroup@Y0.5@script.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "desihub/redrock",
"repo_path": "redrock_extracted/redrock-main/py/redrock/utils.py",
"type": "Python"
} | """
redrock.utils
=============
Redrock utility functions.
"""
from __future__ import absolute_import, division, print_function
import sys
import os
import time
import numpy as np
from . import constants
#- From https://github.com/desihub/desispec io.util.native_endian
def native_endian(data):
"""Convert nump... | desihubREPO_NAMEredrockPATH_START.@redrock_extracted@redrock-main@py@redrock@utils.py@.PATH_END.py |
{
"filename": "test_dropna.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/frame/methods/test_dropna.py",
"type": "Python"
} | import datetime
import dateutil
import numpy as np
import pytest
from pandas._config import using_string_dtype
import pandas as pd
from pandas import (
DataFrame,
Series,
)
import pandas._testing as tm
class TestDataFrameMissingData:
def test_dropEmptyRows(self, float_frame):
N = len(float_fram... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@frame@methods@test_dropna.py@.PATH_END.py |
{
"filename": "helper.py",
"repo_name": "spacetelescope/jdaviz",
"repo_path": "jdaviz_extracted/jdaviz-main/jdaviz/configs/rampviz/helper.py",
"type": "Python"
} | from jdaviz.core.events import SliceSelectSliceMessage, NewViewerMessage
from jdaviz.core.helpers import CubeConfigHelper
from jdaviz.configs.rampviz.plugins.viewers import RampvizImageView
__all__ = ['Rampviz']
_temporal_axis_names = ['group', 'groups']
class Rampviz(CubeConfigHelper):
"""Rampviz Helper class"... | spacetelescopeREPO_NAMEjdavizPATH_START.@jdaviz_extracted@jdaviz-main@jdaviz@configs@rampviz@helper.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "simonsobs/BBPower",
"repo_path": "BBPower_extracted/BBPower-main/README.md",
"type": "Markdown"
} | BBPower - the C_ell-based pipeline for BB
-----------------------------------------
This repo hosts a pipeline that carries out a maps-to-params analysis of multi-frequency polarization data to constrain primordial B-modes using a power-spectrum-based component separation scheme. The pipeline is built following the BB... | simonsobsREPO_NAMEBBPowerPATH_START.@BBPower_extracted@BBPower-main@README.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "mwalmsley/zoobot",
"repo_path": "zoobot_extracted/zoobot-main/zoobot/pytorch/estimators/__init__.py",
"type": "Python"
} | mwalmsleyREPO_NAMEzoobotPATH_START.@zoobot_extracted@zoobot-main@zoobot@pytorch@estimators@__init__.py@.PATH_END.py | |
{
"filename": "pollution_model.py",
"repo_name": "andrewmbuchan4/PyllutedWD_Public",
"repo_path": "PyllutedWD_Public_extracted/PyllutedWD_Public-main/src/pollution_model.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pathlib import Path
import json
import loglike_functions as lf
import model_parameters as mp
import prior_functions as pf
import pwd_utils as pu
import pymultinest as pn
class PollutionModel:
def __init__(self, basename, enhancement_model_name, prior_name,... | andrewmbuchan4REPO_NAMEPyllutedWD_PublicPATH_START.@PyllutedWD_Public_extracted@PyllutedWD_Public-main@src@pollution_model.py@.PATH_END.py |
{
"filename": "_variant.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/treemap/insidetextfont/_variant.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="variant", parent_name="treemap.insidetextfont", **kwargs
):
super(VariantValidator, self).__init__(
plotly_name=plotly_name,
pa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@treemap@insidetextfont@_variant.py@.PATH_END.py |
{
"filename": "stis_reduction-wasp-39b-example.ipynb",
"repo_name": "natalieallen/stis_pipeline",
"repo_path": "stis_pipeline_extracted/stis_pipeline-main/stis_reduction-wasp-39b-example.ipynb",
"type": "Jupyter Notebook"
} | ```python
from STIS_pipeline_functions import *
```
/Users/natalieallen/opt/anaconda3/lib/python3.8/site-packages/autograd/numpy/numpy_wrapper.py:20: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and i... | natalieallenREPO_NAMEstis_pipelinePATH_START.@stis_pipeline_extracted@stis_pipeline-main@stis_reduction-wasp-39b-example.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "bd-j/prospector",
"repo_path": "prospector_extracted/prospector-main/prospect/observation/__init__.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
from .observation import Observation
from .observation import Photometry, Spectrum, Lines
from .observation import UndersampledSpectrum, IntrinsicSpectrum
from .observation import PolyOptCal, SplineOptCal
from .observation import from_oldstyle, from_serial
__all__ = ["Observation",
... | bd-jREPO_NAMEprospectorPATH_START.@prospector_extracted@prospector-main@prospect@observation@__init__.py@.PATH_END.py |
{
"filename": "_error_x.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/histogram/_error_x.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class ErrorX(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "histogram"
_path_str = "histogram.error_x"
_valid_props = {
"array",
"arraym... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@histogram@_error_x.py@.PATH_END.py |
{
"filename": "lastupdated.py",
"repo_name": "transientskp/tkp",
"repo_path": "tkp_extracted/tkp-master/tkp/utility/sphinx/lastupdated.py",
"type": "Python"
} | # Sphinx extension to insert the last updated date, based on the git revision
# history, into Sphinx documentation. For example, do:
#
# .. |last_updated| last_updated::
#
# *This document last updated:* |last_updated|.
import datetime
import subprocess
from email.utils import parsedate_tz
from docutils import no... | transientskpREPO_NAMEtkpPATH_START.@tkp_extracted@tkp-master@tkp@utility@sphinx@lastupdated.py@.PATH_END.py |
{
"filename": "libmpi.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/mpmath/py3/mpmath/libmp/libmpi.py",
"type": "Python"
} | """
Computational functions for interval arithmetic.
"""
from .backend import xrange
from .libmpf import (
ComplexResult,
round_down, round_up, round_floor, round_ceiling, round_nearest,
prec_to_dps, repr_dps, dps_to_prec,
bitcount,
from_float,
fnan, finf, fninf, fzero, fhalf, fone, fnone,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@mpmath@py3@mpmath@libmp@libmpi.py@.PATH_END.py |
{
"filename": "_name.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/splom/dimension/_name.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="name", parent_name="splom.dimension", **kwargs):
super(NameValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@splom@dimension@_name.py@.PATH_END.py |
{
"filename": "representation.py",
"repo_name": "JCGoran/coffe",
"repo_path": "coffe_extracted/coffe-master/python/coffe/representation.py",
"type": "Python"
} | from abc import ABC, abstractmethod
class Representation(ABC):
@abstractmethod
def __init__(self, *args, **kwargs):
pass
def to_dict(self):
"""
The representation of the class as a dictionary.
"""
return {
key: getattr(self, key)
for key in ... | JCGoranREPO_NAMEcoffePATH_START.@coffe_extracted@coffe-master@python@coffe@representation.py@.PATH_END.py |
{
"filename": "test.py",
"repo_name": "mpi4py/mpi4py",
"repo_path": "mpi4py_extracted/mpi4py-master/demo/wrap-pybind11/test.py",
"type": "Python"
} | from mpi4py import MPI
import helloworld as hw
null = MPI.COMM_NULL
hw.sayhello(null)
comm = MPI.COMM_WORLD
hw.sayhello(comm)
try:
hw.sayhello(list())
except:
pass
else:
assert 0, "exception not raised"
| mpi4pyREPO_NAMEmpi4pyPATH_START.@mpi4py_extracted@mpi4py-master@demo@wrap-pybind11@test.py@.PATH_END.py |
{
"filename": "ia_constraints.py",
"repo_name": "guillochon/MOSFiT",
"repo_path": "MOSFiT_extracted/MOSFiT-master/mosfit/modules/constraints/ia_constraints.py",
"type": "Python"
} | """Definitions for the `IaConstraints` class."""
from mosfit.constants import KM_CGS, M_P_CGS, M_SUN_CGS, MEV_CGS
from mosfit.modules.constraints.constraint import Constraint
# Important: Only define one ``Module`` class per file.
class IaConstraints(Constraint):
"""Ia constraints.
1. Kinetic energy cannot... | guillochonREPO_NAMEMOSFiTPATH_START.@MOSFiT_extracted@MOSFiT-master@mosfit@modules@constraints@ia_constraints.py@.PATH_END.py |
{
"filename": "_opacitysrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattermapbox/marker/_opacitysrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OpacitysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="opacitysrc", parent_name="scattermapbox.marker", **kwargs
):
super(OpacitysrcValidator, self).__init__(
plotly_name=plotly_name,
pa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattermapbox@marker@_opacitysrc.py@.PATH_END.py |
{
"filename": "test_crossmatch.py",
"repo_name": "lpsinger/ligo.skymap",
"repo_path": "ligo.skymap_extracted/ligo.skymap-main/ligo/skymap/postprocess/tests/test_crossmatch.py",
"type": "Python"
} | import astropy_healpix as ah
from astropy.coordinates import CartesianRepresentation, SkyCoord
from astropy.table import Table
from astropy import units as u
import numpy as np
import healpy as hp
import pytest
from scipy import stats
from ...distance import cartesian_kde_to_moments, moments_to_parameters
from ...moc ... | lpsingerREPO_NAMEligo.skymapPATH_START.@ligo.skymap_extracted@ligo.skymap-main@ligo@skymap@postprocess@tests@test_crossmatch.py@.PATH_END.py |
{
"filename": "Tutorial-IllinoisGRMHD__IllinoisGRMHD_headers.ipynb",
"repo_name": "zachetienne/nrpytutorial",
"repo_path": "nrpytutorial_extracted/nrpytutorial-master/IllinoisGRMHD/doc/Tutorial-IllinoisGRMHD__IllinoisGRMHD_headers.ipynb",
"type": "Jupyter Notebook"
} | <script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-59152712-8');
</script>
# Tutorial-IllinoisGRMHD: IllinoisGRMHD_headers.h
## Autho... | zachetienneREPO_NAMEnrpytutorialPATH_START.@nrpytutorial_extracted@nrpytutorial-master@IllinoisGRMHD@doc@Tutorial-IllinoisGRMHD__IllinoisGRMHD_headers.ipynb@.PATH_END.py |
{
"filename": "gen_ic.py",
"repo_name": "jmd-dk/concept",
"repo_path": "concept_extracted/concept-master/test/fluid_gravity/gen_ic.py",
"type": "Python"
} | # This file has to be run in pure Python mode!
# Imports from the CO𝘕CEPT code
from commons import *
from species import Component
from snapshot import save
# Create a global sine wave along the x-direction:
# ϱ(x, y, z) = ϱ(x) ∝ (2 + sin(2*π*x/boxsize)).
# The function ∫_{x1}^{x2}dxϱ(x)
ᔑdxϱ = lambda x1, x2: 2*(x2 ... | jmd-dkREPO_NAMEconceptPATH_START.@concept_extracted@concept-master@test@fluid_gravity@gen_ic.py@.PATH_END.py |
{
"filename": "_metasrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/parcoords/_metasrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MetasrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="metasrc", parent_name="parcoords", **kwargs):
super(MetasrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@parcoords@_metasrc.py@.PATH_END.py |
{
"filename": "_variant.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/ternary/baxis/title/font/_variant.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="variant",
parent_name="layout.ternary.baxis.title.font",
**kwargs,
):
super(VariantValidator, self).__init__(
plotl... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@ternary@baxis@title@font@_variant.py@.PATH_END.py |
{
"filename": "test_absolute_import.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/parso/py2/tests/test_absolute_import.py",
"type": "Python"
} | """
Tests ``from __future__ import absolute_import`` (only important for
Python 2.X)
"""
from parso import parse
def test_explicit_absolute_imports():
"""
Detect modules with ``from __future__ import absolute_import``.
"""
module = parse("from __future__ import absolute_import")
assert module._has... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@parso@py2@tests@test_absolute_import.py@.PATH_END.py |
{
"filename": "_lineposition.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterternary/hoverlabel/font/_lineposition.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LinepositionValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(
self,
plotly_name="lineposition",
parent_name="scatterternary.hoverlabel.font",
**kwargs,
):
super(LinepositionValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterternary@hoverlabel@font@_lineposition.py@.PATH_END.py |
{
"filename": "generate_king_profile.py",
"repo_name": "ClusterMonteCarlo/CMC-COSMIC",
"repo_path": "CMC-COSMIC_extracted/CMC-COSMIC-master/examples/generate_king_profile.py",
"type": "Python"
} | # Creates a King profile with N=10^5 stars/binaries and a central concentration (W_0) of 6,
# using COSMIC's initial condition generators
# This imports the version of COSMIC that was downloaded and installed with CMC
# See https://clustermontecarlo.github.io/CMC-COSMIC/initialconditions/index.html for more details
fro... | ClusterMonteCarloREPO_NAMECMC-COSMICPATH_START.@CMC-COSMIC_extracted@CMC-COSMIC-master@examples@generate_king_profile.py@.PATH_END.py |
{
"filename": "libbifrost.py",
"repo_name": "ledatelescope/bifrost",
"repo_path": "bifrost_extracted/bifrost-master/python/bifrost/libbifrost.py",
"type": "Python"
} |
# Copyright (c) 2016-2023, The Bifrost Authors. All rights reserved.
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code m... | ledatelescopeREPO_NAMEbifrostPATH_START.@bifrost_extracted@bifrost-master@python@bifrost@libbifrost.py@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/streamtube/hoverlabel/_font.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "streamtube.hoverlabel"
_path_str = "streamtube.hoverlabel.font"
_valid_props = {"color", "colo... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@streamtube@hoverlabel@_font.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/metrics/__init__.py",
"type": "Python"
} | import inspect
from keras.src.api_export import keras_export
from keras.src.metrics.accuracy_metrics import Accuracy
from keras.src.metrics.accuracy_metrics import BinaryAccuracy
from keras.src.metrics.accuracy_metrics import CategoricalAccuracy
from keras.src.metrics.accuracy_metrics import SparseCategoricalAccuracy
... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@metrics@__init__.py@.PATH_END.py |
{
"filename": "test_blackbody.py",
"repo_name": "spacetelescope/synphot_refactor",
"repo_path": "synphot_refactor_extracted/synphot_refactor-master/synphot/tests/test_blackbody.py",
"type": "Python"
} | """This should be updated if blackbody.py is removed from synphot."""
import numpy as np
from astropy import constants as const
from astropy import units as u
from synphot.blackbody import blackbody_nu
from synphot.units import FNU
# This test was removed from astropy in
# https://github.com/astropy/astropy/pull/92... | spacetelescopeREPO_NAMEsynphot_refactorPATH_START.@synphot_refactor_extracted@synphot_refactor-master@synphot@tests@test_blackbody.py@.PATH_END.py |
{
"filename": "forecast_clbb_signif.py",
"repo_name": "dhanson/quicklens",
"repo_path": "quicklens_extracted/quicklens-master/examples/forecast_clbb_signif.py",
"type": "Python"
} | #/usr/bin/env python
# --
# quicklens/examples/forecast_clbb_signif.py
# --
# make a plot containing the Fisher-forecasted
# detection significance for lensing-induced
# B-mode power spectrum ClBB, for a range of
# different instrumental noise levels and
# minimum mulitpoles.
import numpy as np
import pylab as pl
imp... | dhansonREPO_NAMEquicklensPATH_START.@quicklens_extracted@quicklens-master@examples@forecast_clbb_signif.py@.PATH_END.py |
{
"filename": "_hoverlabel.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattergl/_hoverlabel.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HoverlabelValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="hoverlabel", parent_name="scattergl", **kwargs):
super(HoverlabelValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattergl@_hoverlabel.py@.PATH_END.py |
{
"filename": "torch_log.py",
"repo_name": "pyro-ppl/pyro",
"repo_path": "pyro_extracted/pyro-master/pyro/ops/einsum/torch_log.py",
"type": "Python"
} | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import torch
from pyro.ops.einsum.util import Tensordot
from pyro.ops.special import safe_log
def transpose(a, axes):
return a.permute(axes)
def einsum(equation, *operands):
"""
Log-sum-exp implementation of einsum... | pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@pyro@ops@einsum@torch_log.py@.PATH_END.py |
{
"filename": "test_init.py",
"repo_name": "e-koch/FilFinder",
"repo_path": "FilFinder_extracted/FilFinder-master/fil_finder/tests/test_init.py",
"type": "Python"
} | # Licensed under an MIT open source license - see LICENSE
import numpy as np
import numpy.testing as npt
import astropy.units as u
from .. import fil_finder_2D
from .. import FilFinder2D
from ._testing_data import *
FWHM_FACTOR = 2 * np.sqrt(2 * np.log(2.))
def test_with_distance():
distance = 260 * u.pc
... | e-kochREPO_NAMEFilFinderPATH_START.@FilFinder_extracted@FilFinder-master@fil_finder@tests@test_init.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/express/__init__.py",
"type": "Python"
} | """
`plotly.express` is a terse, consistent, high-level wrapper around `plotly.graph_objects`
for rapid data exploration and figure generation. Learn more at https://plotly.express/
"""
from __future__ import absolute_import
from plotly import optional_imports
pd = optional_imports.get_module("pandas")
if pd is None:
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@express@__init__.py@.PATH_END.py |
{
"filename": "datasets__adult__uci.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage-python/datasets__adult__uci.md",
"type": "Markdown"
} |
Load the [UCI Adult Data Set](https://archive.ics.uci.edu/ml/datasets/Adult).
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage-python@datasets__adult__uci.md@.PATH_END.py |
{
"filename": "zhipuai.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/chat/zhipuai.ipynb",
"type": "Jupyter Notebook"
} | ---
sidebar_label: ZHIPU AI
---
# ZHIPU AI
This notebook shows how to use [ZHIPU AI API](https://open.bigmodel.cn/dev/api) in LangChain with the langchain.chat_models.ChatZhipuAI.
>[*GLM-4*](https://open.bigmodel.cn/) is a multi-lingual large language model aligned with human intent, featuring capabilities in Q&A, mu... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@chat@zhipuai.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "mikekatz04/BBHx",
"repo_path": "BBHx_extracted/BBHx-master/bbhx/__init__.py",
"type": "Python"
} | mikekatz04REPO_NAMEBBHxPATH_START.@BBHx_extracted@BBHx-master@bbhx@__init__.py@.PATH_END.py | |
{
"filename": "fillna_test.py",
"repo_name": "vaexio/vaex",
"repo_path": "vaex_extracted/vaex-master/tests/fillna_test.py",
"type": "Python"
} | from common import *
def test_fillna_column(df_local_non_arrow):
if isinstance(df_local_non_arrow.dataset['obj'], vaex.column.ColumnConcatenatedLazy):
# TODO: vaex.column.ColumnConcatenatedLazy is too eager to cast to string
# we need the same behaviour as in vaex.dataset.to_supported_array
... | vaexioREPO_NAMEvaexPATH_START.@vaex_extracted@vaex-master@tests@fillna_test.py@.PATH_END.py |
{
"filename": "drs_markdown.py",
"repo_name": "njcuk9999/apero-drs",
"repo_path": "apero-drs_extracted/apero-drs-main/apero/tools/module/documentation/drs_markdown.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# CODE NAME HERE
# CODE DESCRIPTION HERE
Created on 2021-06-29
@author: cook
"""
from typing import Optional, List, Union
import numpy as np
from astropy.table import Table
# =============================================================================
# Define va... | njcuk9999REPO_NAMEapero-drsPATH_START.@apero-drs_extracted@apero-drs-main@apero@tools@module@documentation@drs_markdown.py@.PATH_END.py |
{
"filename": "image.py",
"repo_name": "paulo-herrera/PyEVTK",
"repo_path": "PyEVTK_extracted/PyEVTK-master/evtk/examples/image.py",
"type": "Python"
} | #! /usr/bin/env python
######################################################################################
# MIT License
#
# Copyright (c) 2010-2021 Paulo A. Herrera
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software... | paulo-herreraREPO_NAMEPyEVTKPATH_START.@PyEVTK_extracted@PyEVTK-master@evtk@examples@image.py@.PATH_END.py |
{
"filename": "_uhoverformat.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/streamtube/_uhoverformat.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class UhoverformatValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="uhoverformat", parent_name="streamtube", **kwargs):
super(UhoverformatValidator, self).__init__(
plotly_name=plotly_name,
parent_name=paren... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@streamtube@_uhoverformat.py@.PATH_END.py |
{
"filename": "test_visualise.py",
"repo_name": "rhayes777/PyAutoFit",
"repo_path": "PyAutoFit_extracted/PyAutoFit-main/test_autofit/test_visualise.py",
"type": "Python"
} | import itertools
import pytest
import autofit as af
from autofit.visualise import VisualiseGraph
@pytest.fixture(autouse=True)
def reset_ids():
af.ModelObject._ids = itertools.count()
af.Prior._ids = itertools.count()
@pytest.fixture
def model():
collection = af.Collection(
first=af.Model(af.G... | rhayes777REPO_NAMEPyAutoFitPATH_START.@PyAutoFit_extracted@PyAutoFit-main@test_autofit@test_visualise.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "dmvandamt/beyonce",
"repo_path": "beyonce_extracted/beyonce-main/beyonce/shallot/__init__.py",
"type": "Python"
} | dmvandamtREPO_NAMEbeyoncePATH_START.@beyonce_extracted@beyonce-main@beyonce@shallot@__init__.py@.PATH_END.py | |
{
"filename": "empirical_distribution.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/distributions/empirical_distribution.py",
"type": "Python"
} | """
Empirical CDF Functions
"""
import numpy as np
from scipy.interpolate import interp1d
def _conf_set(F, alpha=.05):
r"""
Constructs a Dvoretzky-Kiefer-Wolfowitz confidence band for the eCDF.
Parameters
----------
F : array_like
The empirical distributions
alpha : float
Set ... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@distributions@empirical_distribution.py@.PATH_END.py |
{
"filename": "imagelist.py",
"repo_name": "gotsunami/Youpi",
"repo_path": "Youpi_extracted/Youpi-master/terapix/script/imagelist.py",
"type": "Python"
} | ##############################################################################
#
# Copyright (c) 2008-2009 Terapix Youpi development team. All Rights Reserved.
# Mathias Monnerville <monnerville@iap.fr>
# Gregory Semah <semah@iap.fr>
#
# This program is Free Software; you can redis... | gotsunamiREPO_NAMEYoupiPATH_START.@Youpi_extracted@Youpi-master@terapix@script@imagelist.py@.PATH_END.py |
{
"filename": "_base.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scikit-learn/py2/sklearn/neural_network/_base.py",
"type": "Python"
} | """Utilities for the neural network modules
"""
# Author: Issam H. Laradji <issam.laradji@gmail.com>
# License: BSD 3 clause
import numpy as np
from ..utils.fixes import expit as logistic_sigmoid
def identity(X):
"""Simply return the input array.
Parameters
----------
X : {array-like, sparse matri... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scikit-learn@py2@sklearn@neural_network@_base.py@.PATH_END.py |
{
"filename": "util.py",
"repo_name": "Jupiter1994/lya-tf",
"repo_path": "lya-tf_extracted/lya-tf-main/lya_fields/util.py",
"type": "Python"
} | import tensorflow as tf
# Indexing
def gmlt_index_wrap(i, n):
'''
Wrap an index into an array's bounds.
PARAMETERS
----------
i: index
n: length of array
'''
r = i - n * int( float(i) / float(n) )
if (r < 0):
r += n
return r | Jupiter1994REPO_NAMElya-tfPATH_START.@lya-tf_extracted@lya-tf-main@lya_fields@util.py@.PATH_END.py |
{
"filename": "property_collections.py",
"repo_name": "tardis-sn/tardis",
"repo_path": "tardis_extracted/tardis-main/tardis/plasma/properties/property_collections.py",
"type": "Python"
} | from tardis.plasma.properties import *
class PlasmaPropertyCollection(list):
pass
basic_inputs = PlasmaPropertyCollection(
[
TRadiative,
Abundance,
Density,
TimeExplosion,
AtomicData,
DilutionFactor,
LinkTRadTElectron,
HeliumTreatment,
... | tardis-snREPO_NAMEtardisPATH_START.@tardis_extracted@tardis-main@tardis@plasma@properties@property_collections.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "GeminiDRSoftware/DRAGONS",
"repo_path": "DRAGONS_extracted/DRAGONS-master/geminidr/gnirs/recipes/sq/tests/__init__.py",
"type": "Python"
} | GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@geminidr@gnirs@recipes@sq@tests@__init__.py@.PATH_END.py | |
{
"filename": "delight-learn.py",
"repo_name": "ixkael/Delight",
"repo_path": "Delight_extracted/Delight-master/scripts/delight-learn.py",
"type": "Python"
} |
import sys
#from mpi4py import MPI
import numpy as np
from delight.io import *
from delight.utils import *
from delight.photoz_gp import PhotozGP
from delight.photoz_kernels import Photoz_mean_function, Photoz_kernel
#comm = MPI.COMM_WORLD
threadNum = 0
numThreads = 1
# Parse parameters file
if len(sys.argv) < 2:
... | ixkaelREPO_NAMEDelightPATH_START.@Delight_extracted@Delight-master@scripts@delight-learn.py@.PATH_END.py |
{
"filename": "_legendrank.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/densitymap/_legendrank.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LegendrankValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="legendrank", parent_name="densitymap", **kwargs):
super(LegendrankValidator, 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@densitymap@_legendrank.py@.PATH_END.py |
{
"filename": "check_sdist.py",
"repo_name": "scikit-image/scikit-image",
"repo_path": "scikit-image_extracted/scikit-image-main/tools/check_sdist.py",
"type": "Python"
} | #!/usr/bin/env python3
import os
import sys
from argparse import ArgumentParser
from pathlib import Path
import tarfile
parser = ArgumentParser(description='Check a created sdist')
parser.add_argument(
'sdist_name', type=str, nargs=1, help='The name of the sdist file to check'
)
args = parser.parse_args()
sdist_na... | scikit-imageREPO_NAMEscikit-imagePATH_START.@scikit-image_extracted@scikit-image-main@tools@check_sdist.py@.PATH_END.py |
{
"filename": "test_quasimodes.py",
"repo_name": "n-claes/legolas",
"repo_path": "legolas_extracted/legolas-master/tests/regression_tests/test_quasimodes.py",
"type": "Python"
} | import numpy as np
import pytest
from .regression import RegressionTest
class TestQuasimodesQR(RegressionTest):
name = "quasimodes k2=1 k3=0.05"
filename = "quasimodes_QR_k2_1_k3_0.05"
equilibrium = "resonant_absorption"
geometry = "Cartesian"
parameters = {
"k2": 1.0,
"k3": 0.05... | n-claesREPO_NAMElegolasPATH_START.@legolas_extracted@legolas-master@tests@regression_tests@test_quasimodes.py@.PATH_END.py |
{
"filename": "embed.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/ipykernel/py2/ipykernel/embed.py",
"type": "Python"
} | """Simple function for embedding an IPython kernel
"""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import sys
from IPython.utils.frame import extract_module_locals
from .kernelapp import IPKern... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipykernel@py2@ipykernel@embed.py@.PATH_END.py |
{
"filename": "agent.py",
"repo_name": "simonsobs/socs",
"repo_path": "socs_extracted/socs-main/socs/agents/ups/agent.py",
"type": "Python"
} | import argparse
import os
import signal
import time
import txaio
from autobahn.twisted.util import sleep as dsleep
from ocs import ocs_agent, site_config
from ocs.ocs_twisted import TimeoutLock
from twisted.internet.defer import inlineCallbacks
from socs.snmp import SNMPTwister
# For logging
txaio.use_twisted()
de... | simonsobsREPO_NAMEsocsPATH_START.@socs_extracted@socs-main@socs@agents@ups@agent.py@.PATH_END.py |
{
"filename": "bgs-star-gal.ipynb",
"repo_name": "desihub/desitarget",
"repo_path": "desitarget_extracted/desitarget-main/doc/nb/bgs-star-gal.ipynb",
"type": "Jupyter Notebook"
} | ```python
import os
import numpy as np
import fitsio
import matplotlib.pyplot as plt
from speclite import filters
from astropy import constants
import astropy.units as u
from desisim.io import read_basis_templates
%pylab inline
```
Populating the interactive namespace from numpy and matplotlib
```python
swee... | desihubREPO_NAMEdesitargetPATH_START.@desitarget_extracted@desitarget-main@doc@nb@bgs-star-gal.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/datasets/china_smoking/__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@china_smoking@__init__.py@.PATH_END.py |
{
"filename": "exceptions.py",
"repo_name": "NASA-Planetary-Science/sbpy",
"repo_path": "sbpy_extracted/sbpy-main/sbpy/exceptions.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""sbpy exceptions and warnings
General exceptions/warnings for all of sbpy are specified below.
Exceptions and warnings that are sub-module specific should be in the
respective sub-module.
"""
class SbpyException(Exception):
"Exception base class ... | NASA-Planetary-ScienceREPO_NAMEsbpyPATH_START.@sbpy_extracted@sbpy-main@sbpy@exceptions.py@.PATH_END.py |
{
"filename": "datasets.py",
"repo_name": "spedas/pyspedas",
"repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/stereo/datasets.py",
"type": "Python"
} | from .load import load
from pyspedas.utilities.datasets import find_datasets
# This routine was originally in stereo/__init__.py, until being moved to its own file.
# Please refer to __init__.py if you need to see the revision history before it was moved.
def datasets(instrument=None, label=True):
return find_dat... | spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@stereo@datasets.py@.PATH_END.py |
{
"filename": "setup_logger.py",
"repo_name": "ja-vazquez/SimpleMC",
"repo_path": "SimpleMC_extracted/SimpleMC-master/simplemc/setup_logger.py",
"type": "Python"
} |
import sys
import logging
import datetime
from pathlib import Path
cdir = str(Path(__file__).parent.resolve())
log = False
if log:
date = datetime.datetime.now()
date = date.strftime("%Y-%b-%d, %A %I:%M:%S")
logging.basicConfig(filename="simplemc_{}.log".format(date),
fil... | ja-vazquezREPO_NAMESimpleMCPATH_START.@SimpleMC_extracted@SimpleMC-master@simplemc@setup_logger.py@.PATH_END.py |
{
"filename": "create_smearing_matrix.py",
"repo_name": "SNOwGLoBES/snowglobes",
"repo_path": "snowglobes_extracted/snowglobes-master/smearing_code/create_smearing_matrix.py",
"type": "Python"
} | #!/usr/bin/env python
# Script to make a smearing matrix for expected detector response
# This script incorporates both neutrino reactions as well as detector resolution
# Run with no arguments to be run interactively
# The interactive usage will make it simple and hard to mess up
# Run with a single argument, a json f... | SNOwGLoBESREPO_NAMEsnowglobesPATH_START.@snowglobes_extracted@snowglobes-master@smearing_code@create_smearing_matrix.py@.PATH_END.py |
{
"filename": "polychord.py",
"repo_name": "CobayaSampler/cobaya",
"repo_path": "cobaya_extracted/cobaya-master/cobaya/samplers/polychord/polychord.py",
"type": "Python"
} | """
.. module:: samplers.polychord
:Synopsis: Interface for the PolyChord nested sampler
:Author: Will Handley, Mike Hobson and Anthony Lasenby (for PolyChord),
Jesus Torrado (for the cobaya wrapper only)
"""
# Global
import os
import sys
import logging
import inspect
from itertools import chain
from typing i... | CobayaSamplerREPO_NAMEcobayaPATH_START.@cobaya_extracted@cobaya-master@cobaya@samplers@polychord@polychord.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.