metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "_tickfont.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/parcats/_tickfont.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Tickfont(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "parcats"
_path_str = "parcats.tickfont"
_valid_props = {"color", "family", "size"}
# ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@parcats@_tickfont.py@.PATH_END.py |
{
"filename": "_tick0.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatterpolar/marker/colorbar/_tick0.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class Tick0Validator(_plotly_utils.basevalidators.AnyValidator):
def __init__(
self, plotly_name="tick0", parent_name="scatterpolar.marker.colorbar", **kwargs
):
super(Tick0Validator, self).__init__(
plotly_name=plotly_name,
parent_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatterpolar@marker@colorbar@_tick0.py@.PATH_END.py |
{
"filename": "problem_setup.py",
"repo_name": "dullemond/radmc3d-2.0",
"repo_path": "radmc3d-2.0_extracted/radmc3d-2.0-master/examples/run_ppdisk_analytic_1/problem_setup.py",
"type": "Python"
} | #
# Import NumPy for array handling
#
import numpy as np
#
# A simple grid refinement function
#
def grid_refine_inner_edge(x_orig,nlev,nspan):
x = x_orig.copy()
rev = x[0]>x[1]
for ilev in range(nlev):
x_new = 0.5 * ( x[1:nspan+1] + x[:nspan] )
x_ref = np.hstack((x,x_new))
x_r... | dullemondREPO_NAMEradmc3d-2.0PATH_START.@radmc3d-2.0_extracted@radmc3d-2.0-master@examples@run_ppdisk_analytic_1@problem_setup.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "brinckmann/montepython_public",
"repo_path": "montepython_public_extracted/montepython_public-master/montepython/likelihoods/ska1_lensing/__init__.py",
"type": "Python"
} | ########################################################
# ska1_lensing likelihood
########################################################
# Copied from Euclid_lensing 05.2017
# Tim Sprenger: changed galaxy_distribution and photo_z_distribution
# to match ska1 specifications from 1601.03947
from montepython.likelihoo... | brinckmannREPO_NAMEmontepython_publicPATH_START.@montepython_public_extracted@montepython_public-master@montepython@likelihoods@ska1_lensing@__init__.py@.PATH_END.py |
{
"filename": "plot_save_mesa_individual_fin1p25.py",
"repo_name": "NikolayBritavskiyAstro/fast_rotating_binaries",
"repo_path": "fast_rotating_binaries_extracted/fast_rotating_binaries-main/src/scripts/plot_save_mesa_individual_fin1p25.py",
"type": "Python"
} | import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import numpy as np
import os
import mesaPlot as mp
from showyourwork.paths import user as Paths
paths = Paths()
if os.path.exists(os.path.join(paths.data, 'post_interaction/30_20_1p25_g1_new/LOGS3/history.data')):
pass
else:
... | NikolayBritavskiyAstroREPO_NAMEfast_rotating_binariesPATH_START.@fast_rotating_binaries_extracted@fast_rotating_binaries-main@src@scripts@plot_save_mesa_individual_fin1p25.py@.PATH_END.py |
{
"filename": "parse_maestro_params.py",
"repo_name": "AMReX-Astro/MAESTROeX",
"repo_path": "MAESTROeX_extracted/MAESTROeX-main/Source/param/parse_maestro_params.py",
"type": "Python"
} | #!/usr/bin/env python3
"""This script parses the list of C++ runtime parameters and writes
the necessary header and source files to make them available in
Maestro's C++ routines.
parameters have the format:
name type default ifdef
the first three (name, type, default) are mandatory:
name: the name of the pa... | AMReX-AstroREPO_NAMEMAESTROeXPATH_START.@MAESTROeX_extracted@MAESTROeX-main@Source@param@parse_maestro_params.py@.PATH_END.py |
{
"filename": "hash_test.py",
"repo_name": "vaexio/vaex",
"repo_path": "vaex_extracted/vaex-master/tests/internal/hash_test.py",
"type": "Python"
} | from vaex.superutils import *
import vaex.strings
from vaex.utils import dropnan
import numpy as np
import sys
import pytest
import pyarrow as pa
@pytest.mark.parametrize('counter_cls', [counter_string]) #, counter_stringview])
def test_counter_string(counter_cls):
strings = vaex.strings.array(['aap', 'noot', 'mie... | vaexioREPO_NAMEvaexPATH_START.@vaex_extracted@vaex-master@tests@internal@hash_test.py@.PATH_END.py |
{
"filename": "writer.py",
"repo_name": "jan-rybizki/Chempy",
"repo_path": "Chempy_extracted/Chempy-master/Chempy/input/yields/West17/fortranfile/writer.py",
"type": "Python"
} | """
Classes for writing UNIX unformatted FORTRAN files.
"""
# TODO
# * for general reading, load needs to be able to specify record size?
# * fortranfile needs "backspace" and "truncate" functions.
import os
import sys
import gzip
import bz2
import lzma
import numpy as np
from .utils import prod
from .errors import... | jan-rybizkiREPO_NAMEChempyPATH_START.@Chempy_extracted@Chempy-master@Chempy@input@yields@West17@fortranfile@writer.py@.PATH_END.py |
{
"filename": "generate_model.py",
"repo_name": "ebachelet/pyLIMA",
"repo_path": "pyLIMA_extracted/pyLIMA-master/pyLIMA/models/generate_model.py",
"type": "Python"
} | import importlib
def create_model(model_type, event, parallax=['None', 0.0], double_source=['None',0],
orbital_motion=['None', 0.0], origin=['center_of_mass', [0, 0]],
blend_flux_parameter='fblend',
fancy_parameters={}):
"""
Load a model according to the supp... | ebacheletREPO_NAMEpyLIMAPATH_START.@pyLIMA_extracted@pyLIMA-master@pyLIMA@models@generate_model.py@.PATH_END.py |
{
"filename": "run_lavatmos_example1.py",
"repo_name": "cvbuchem/LavAtmos",
"repo_path": "LavAtmos_extracted/LavAtmos-master/scripts/run_lavatmos_example1.py",
"type": "Python"
} | # Standard python packages
import os
import numpy as np
import pandas as pd
import sys
# LavAtmos
mod_dir = '/home/jovyan/ThermoEngine/LavAtmos'
sys.path.append(mod_dir)
import lavatmos
# Import compositions
os.chdir(mod_dir)
vf13_comps_df = pd.read_csv('/home/jovyan/ThermoEngine/LavAtmos/data/input/vf2013_comps.csv'... | cvbuchemREPO_NAMELavAtmosPATH_START.@LavAtmos_extracted@LavAtmos-master@scripts@run_lavatmos_example1.py@.PATH_END.py |
{
"filename": "_margin.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/_margin.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MarginValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="margin", parent_name="layout", **kwargs):
super(MarginValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@_margin.py@.PATH_END.py |
{
"filename": "argilla_callback.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/callbacks/argilla_callback.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.callbacks.argilla_callback import ArgillaCallbackHandler
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handlin... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@callbacks@argilla_callback.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "keras-team/keras-tuner",
"repo_path": "keras-tuner_extracted/keras-tuner-master/keras_tuner/applications/__init__.py",
"type": "Python"
} | # Copyright 2019 The KerasTuner Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | keras-teamREPO_NAMEkeras-tunerPATH_START.@keras-tuner_extracted@keras-tuner-master@keras_tuner@applications@__init__.py@.PATH_END.py |
{
"filename": "_legendgroup.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattermap/_legendgroup.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LegendgroupValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="legendgroup", parent_name="scattermap", **kwargs):
super(LegendgroupValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_n... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattermap@_legendgroup.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "triton-inference-server/server",
"repo_path": "server_extracted/server-main/python/openai/openai_frontend/__init__.py",
"type": "Python"
} | # Copyright 2024, 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
# notice, this list of con... | triton-inference-serverREPO_NAMEserverPATH_START.@server_extracted@server-main@python@openai@openai_frontend@__init__.py@.PATH_END.py |
{
"filename": "test_disjoint_set.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/cluster/tests/test_disjoint_set.py",
"type": "Python"
} | import pytest
from pytest import raises as assert_raises
import numpy as np
from scipy.cluster.hierarchy import DisjointSet
import string
def generate_random_token():
k = len(string.ascii_letters)
tokens = list(np.arange(k, dtype=int))
tokens += list(np.arange(k, dtype=float))
tokens += list(string.as... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@cluster@tests@test_disjoint_set.py@.PATH_END.py |
{
"filename": "test_tree.py",
"repo_name": "shaoshanglqy/shap-shapley",
"repo_path": "shap-shapley_extracted/shap-shapley-master/tests/explainers/test_tree.py",
"type": "Python"
} | import matplotlib
import numpy as np
matplotlib.use('Agg')
import shap
def test_front_page_xgboost():
try:
import xgboost
except Exception as e:
print("Skipping test_front_page_xgboost!")
return
import shap
# load JS visualization code to notebook
shap.initjs()
# trai... | shaoshanglqyREPO_NAMEshap-shapleyPATH_START.@shap-shapley_extracted@shap-shapley-master@tests@explainers@test_tree.py@.PATH_END.py |
{
"filename": "setup_package.py",
"repo_name": "D-arioSpace/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/image_cutouts/first/tests/setup_package.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
def get_package_data():
paths = [os.path.join('data', '*.fits'),
]
return {'astroquery.image_cutouts.first.tests': paths}
| D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@image_cutouts@first@tests@setup_package.py@.PATH_END.py |
{
"filename": "get_fof_halo_shapes.py",
"repo_name": "LSSTDESC/lsstdesc-diffsky",
"repo_path": "lsstdesc-diffsky_extracted/lsstdesc-diffsky-main/lsstdesc_diffsky/halo_information/get_fof_halo_shapes.py",
"type": "Python"
} | import os
import h5py
import numpy as np
from astropy.table import Table
shape_file_template = "shapes_{}_l.hdf5"
evalues = "eigenvalues_SIT_COM"
evectors = "eigenvectors_SIT_COM"
def get_halo_shapes(snapshot, hpx_fof_tags, hpx_reps, shape_dir, debug=True):
"""
read file with halo shapes and return shape dat... | LSSTDESCREPO_NAMElsstdesc-diffskyPATH_START.@lsstdesc-diffsky_extracted@lsstdesc-diffsky-main@lsstdesc_diffsky@halo_information@get_fof_halo_shapes.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "kboone/avocado",
"repo_path": "avocado_extracted/avocado-master/avocado/__init__.py",
"type": "Python"
} | from .settings import settings
from .utils import *
from .augment import *
from .astronomical_object import *
from .classifier import *
from .dataset import *
from .features import *
from .instruments import *
from . import plasticc
# Expose the load method of Dataset
load = Dataset.load
# Expose the load method of... | kbooneREPO_NAMEavocadoPATH_START.@avocado_extracted@avocado-master@avocado@__init__.py@.PATH_END.py |
{
"filename": "timing_utils.py",
"repo_name": "rapidsai/cuml",
"repo_path": "cuml_extracted/cuml-main/python/cuml/cuml/common/timing_utils.py",
"type": "Python"
} | #
# Copyright (c) 2020-2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | rapidsaiREPO_NAMEcumlPATH_START.@cuml_extracted@cuml-main@python@cuml@cuml@common@timing_utils.py@.PATH_END.py |
{
"filename": "_minexponent.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/bar/marker/colorbar/_minexponent.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MinexponentValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="minexponent", parent_name="bar.marker.colorbar", **kwargs
):
super(MinexponentValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@bar@marker@colorbar@_minexponent.py@.PATH_END.py |
{
"filename": "_hooks.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/pluggy/py3/pluggy/_hooks.py",
"type": "Python"
} | """
Internal hook annotation, representation and calling machinery.
"""
from __future__ import annotations
import inspect
import sys
from types import ModuleType
from typing import AbstractSet
from typing import Any
from typing import Callable
from typing import Final
from typing import final
from typing import Gener... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@pluggy@py3@pluggy@_hooks.py@.PATH_END.py |
{
"filename": "leastsq_rv_fit.py",
"repo_name": "mikecokina/elisa",
"repo_path": "elisa_extracted/elisa-master/scripts/analytics/leastsq_rv_fit.py",
"type": "Python"
} | import json
import os.path as op
import numpy as np
from elisa import units
from elisa.analytics import RVData, RVBinaryAnalyticsTask
from elisa.analytics.params.parameters import BinaryInitialParameters
np.random.seed(1)
DATA = op.join(op.abspath(op.dirname(__file__)), "data")
def get_rv():
fpath = op.join(DA... | mikecokinaREPO_NAMEelisaPATH_START.@elisa_extracted@elisa-master@scripts@analytics@leastsq_rv_fit.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/integration_tests/document_compressors/__init__.py",
"type": "Python"
} | """Test document compressor integrations."""
| langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@integration_tests@document_compressors@__init__.py@.PATH_END.py |
{
"filename": "_dtick.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/carpet/aaxis/_dtick.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class DtickValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="dtick", parent_name="carpet.aaxis", **kwargs):
super(DtickValidator, 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@carpet@aaxis@_dtick.py@.PATH_END.py |
{
"filename": "io.py",
"repo_name": "mj-will/nessai",
"repo_path": "nessai_extracted/nessai-main/src/nessai/utils/io.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Utilities related to loading files, saving files etc.
"""
import json
import os
import shutil
import numpy as np
from ..livepoint import live_points_to_dict
def is_jsonable(x):
"""Check if an object is JSON serialisable.
Based on: https://stackoverflow.com/a/53112659
Param... | mj-willREPO_NAMEnessaiPATH_START.@nessai_extracted@nessai-main@src@nessai@utils@io.py@.PATH_END.py |
{
"filename": "_data.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/frame/_data.py",
"type": "Python"
} | import plotly.validators
class DataValidator(plotly.validators.DataValidator):
def __init__(self, plotly_name="data", parent_name="frame", **kwargs):
super(DataValidator, self).__init__(
plotly_name=plotly_name, parent_name=parent_name, **kwargs
)
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@frame@_data.py@.PATH_END.py |
{
"filename": "main.py",
"repo_name": "Astro-Sean/autophot",
"repo_path": "autophot_extracted/autophot-master/main.py",
"type": "Python"
} | Astro-SeanREPO_NAMEautophotPATH_START.@autophot_extracted@autophot-master@main.py@.PATH_END.py | |
{
"filename": "_nticks.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/isosurface/colorbar/_nticks.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NticksValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="nticks", parent_name="isosurface.colorbar", **kwargs
):
super(NticksValidator, self).__init__(
plotly_name=plotly_name,
parent_name... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@isosurface@colorbar@_nticks.py@.PATH_END.py |
{
"filename": "12b. RFC Comparison HIDDEN REBALANCED (binary).ipynb",
"repo_name": "sidchaini/LightCurveDistanceClassification",
"repo_path": "LightCurveDistanceClassification_extracted/LightCurveDistanceClassification-main/notebooks/12. RFC Comparison HIDDEN REBALANCED/12b. RFC Comparison HIDDEN REBALANCED (bina... | ```python
import numpy as np
import pandas as pd
from tqdm.auto import tqdm
import matplotlib.pyplot as plt
import seaborn as sns
from mlxtend.feature_selection import (
SequentialFeatureSelector,
)
from mlxtend.evaluate import feature_importance_permutation
from mlxtend.plotting import plot_sequential_feature_sele... | sidchainiREPO_NAMELightCurveDistanceClassificationPATH_START.@LightCurveDistanceClassification_extracted@LightCurveDistanceClassification-main@notebooks@12. RFC Comparison HIDDEN REBALANCED@12b. RFC Comparison HIDDEN REBALANCED (binary).ipynb@.PATH_END.py |
{
"filename": "main.py",
"repo_name": "cdslaborg/paramonte",
"repo_path": "paramonte_extracted/paramonte-main/example/fortran/pm_distNorm/getNormRand/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
linewidth = 2
fontsize = 17
marker ={ "CK" : "-"
, "IK" : "."
, "RK" : "-"
}
xlab = { "CK" : "Normal Random Number ( real/imaginary components )"
, "IK" : "Normal Rando... | cdslaborgREPO_NAMEparamontePATH_START.@paramonte_extracted@paramonte-main@example@fortran@pm_distNorm@getNormRand@main.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "pec27/hfof",
"repo_path": "hfof_extracted/hfof-master/setup.py",
"type": "Python"
} | from setuptools import setup, Extension
def find_version(path):
import re
# path shall be a plain ascii text file.
s = open(path, 'rt').read()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
s, re.M)
if version_match:
return version_match.grou... | pec27REPO_NAMEhfofPATH_START.@hfof_extracted@hfof-master@setup.py@.PATH_END.py |
{
"filename": "simtools.py",
"repo_name": "agreenbaum/gsgs",
"repo_path": "gsgs_extracted/gsgs-master/simtools.py",
"type": "Python"
} | #! /usr/bin/env python
import numpy as np
import sys,os
def mas2rad(mas):
rad = mas*(10**(-3)) / (3600*180/np.pi)
return rad
def rad2mas(rad):
mas = rad * (3600*180/np.pi) * 10**3
return mas
def makedisk(N, R, ctr=(0,0)):
if N%2 == 1:
M = (N-1)/2
xx = np.linspace(-M-ctr[0],M-ctr[0],N)
yy = np.linspace(-... | agreenbaumREPO_NAMEgsgsPATH_START.@gsgs_extracted@gsgs-master@simtools.py@.PATH_END.py |
{
"filename": "ELL_map_class.py",
"repo_name": "alphalyncis/doppler-imaging-maxentropy",
"repo_path": "doppler-imaging-maxentropy_extracted/doppler-imaging-maxentropy-main/src/ELL_map_class.py",
"type": "Python"
} | """
# Original author: Ian Crossfield (Python 2.7)
Planetary mapping routines.
phi = 0 faces toward the observer
phi = pi thus faces away from the observer
theta=pi/2 is the z-axis or 'north pole'
theta=-pi/2 is the 'south pole' -- this is in fact not true, theta=(0, pi)
"""
########################################... | alphalyncisREPO_NAMEdoppler-imaging-maxentropyPATH_START.@doppler-imaging-maxentropy_extracted@doppler-imaging-maxentropy-main@src@ELL_map_class.py@.PATH_END.py |
{
"filename": "plot_mars-coordinate-frame.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/examples/coordinates/plot_mars-coordinate-frame.py",
"type": "Python"
} | r"""
============================================
Create a new coordinate frame class for Mars
============================================
This example describes how to subclass and define a custom coordinate frame for a
planetary body which can be described by a geodetic or bodycentric representation,
as discussed i... | astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@examples@coordinates@plot_mars-coordinate-frame.py@.PATH_END.py |
{
"filename": "component.py",
"repo_name": "glue-viz/glue",
"repo_path": "glue_extracted/glue-main/glue/core/component.py",
"type": "Python"
} | import logging
import numpy as np
import pandas as pd
import shapely
from glue.core.coordinate_helpers import dependent_axes, pixel2world_single_axis
from glue.utils import shape_to_string, coerce_numeric, categorical_ndarray
try:
import dask.array as da
DASK_INSTALLED = True
except ImportError:
DASK_INS... | glue-vizREPO_NAMEgluePATH_START.@glue_extracted@glue-main@glue@core@component.py@.PATH_END.py |
{
"filename": "test_inter_rater.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/stats/tests/test_inter_rater.py",
"type": "Python"
} | """
Created on Mon Dec 10 09:18:14 2012
Author: Josef Perktold
"""
import numpy as np
from numpy.testing import assert_almost_equal, assert_equal, assert_allclose
from statsmodels.stats.inter_rater import (fleiss_kappa, cohens_kappa,
to_table, aggregate_raters)
from statsm... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@stats@tests@test_inter_rater.py@.PATH_END.py |
{
"filename": "_outlinecolor.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/densitymapbox/colorbar/_outlinecolor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OutlinecolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="outlinecolor", parent_name="densitymapbox.colorbar", **kwargs
):
super(OutlinecolorValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@densitymapbox@colorbar@_outlinecolor.py@.PATH_END.py |
{
"filename": "parameters.py",
"repo_name": "baptklein/ATMOSPHERIX_DATA_RED",
"repo_path": "ATMOSPHERIX_DATA_RED_extracted/ATMOSPHERIX_DATA_RED-main/parameters.py",
"type": "Python"
} |
import numpy as np
import matplotlib.pyplot as plt
import scipy.signal
type_obs = "emission"
SMALL_SIZE = 28
MEDIUM_SIZE = 32
BIGGER_SIZE = 34
plt.rc('font', size=SMALL_SIZE) # controls default text sizes
plt.rc('axes', titlesize=SMALL_SIZE) # fontsize of the axes title
plt.rc('axes', labelsize=MEDIUM... | baptkleinREPO_NAMEATMOSPHERIX_DATA_REDPATH_START.@ATMOSPHERIX_DATA_RED_extracted@ATMOSPHERIX_DATA_RED-main@parameters.py@.PATH_END.py |
{
"filename": "_thicknessmode.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/coloraxis/colorbar/_thicknessmode.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ThicknessmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="thicknessmode",
parent_name="layout.coloraxis.colorbar",
**kwargs,
):
super(ThicknessmodeValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@coloraxis@colorbar@_thicknessmode.py@.PATH_END.py |
{
"filename": "_visible.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/polar/angularaxis/_visible.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VisibleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="visible", parent_name="layout.polar.angularaxis", **kwargs
):
super(VisibleValidator, self).__init__(
plotly_name=plotly_name,
par... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@polar@angularaxis@_visible.py@.PATH_END.py |
{
"filename": "test_glm_weights.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/genmod/tests/test_glm_weights.py",
"type": "Python"
} | """
Test for weights in GLM, Poisson and OLS/WLS, continuous test_glm.py
Below is a table outlining the test coverage.
================================= ====================== ====== ===================== === ======= ======== ============== ============= ============== ============= ============== ==== =========
Tes... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@genmod@tests@test_glm_weights.py@.PATH_END.py |
{
"filename": "data_structures_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/autograph/operators/data_structures_test.py",
"type": "Python"
} | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@autograph@operators@data_structures_test.py@.PATH_END.py |
{
"filename": "axislines.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/mpl_toolkits/axes_grid/axislines.py",
"type": "Python"
} | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from mpl_toolkits.axisartist.axislines import *
| waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@mpl_toolkits@axes_grid@axislines.py@.PATH_END.py |
{
"filename": "keywords.py",
"repo_name": "hpc4cmb/toast",
"repo_path": "toast_extracted/toast-main/src/libtoast/gtest/googlemock/scripts/generator/cpp/keywords.py",
"type": "Python"
} | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google Inc.
#
# 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... | hpc4cmbREPO_NAMEtoastPATH_START.@toast_extracted@toast-main@src@libtoast@gtest@googlemock@scripts@generator@cpp@keywords.py@.PATH_END.py |
{
"filename": "variance_relations.ipynb",
"repo_name": "astrolamb/pop_synth",
"repo_path": "pop_synth_extracted/pop_synth-main/notebooks/variance_relations.ipynb",
"type": "Jupyter Notebook"
} | ```python
%load_ext autoreload
%autoreload 2
# retina quality
%config InlineBackend.figure_format = 'retina'
```
```python
import numpy as np
import scipy.stats as ss
import matplotlib.pyplot as plt
from astropy.cosmology import FlatLambdaCDM
from astropy.constants import G, c
from astropy import units as u
from sci... | astrolambREPO_NAMEpop_synthPATH_START.@pop_synth_extracted@pop_synth-main@notebooks@variance_relations.ipynb@.PATH_END.py |
{
"filename": "test_fBM_delvar_vs_idl.py",
"repo_name": "Astroua/TurbuStat",
"repo_path": "TurbuStat_extracted/TurbuStat-master/Examples/paper_plots/test_fBM_delvar_vs_idl.py",
"type": "Python"
} |
'''
Compare Turbustat's Delta-variance to the original IDL code.
'''
from turbustat.statistics import DeltaVariance
from turbustat.simulator import make_extended
import astropy.io.fits as fits
from astropy.table import Table
import matplotlib.pyplot as plt
import astropy.units as u
import seaborn as sb
font_scale =... | AstrouaREPO_NAMETurbuStatPATH_START.@TurbuStat_extracted@TurbuStat-master@Examples@paper_plots@test_fBM_delvar_vs_idl.py@.PATH_END.py |
{
"filename": "Code.py",
"repo_name": "mariapetro/LeHaMoC",
"repo_path": "LeHaMoC_extracted/LeHaMoC-main/Fit_emcee/Code.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 11 19:09:51 2023
@author: mapet
"""
# This is the leptohadronic version of a radiative transfer code LeHaMoC.
# Copyright (C) 2023 S. I. Stathopoulos, M. Petropoulou.
# When using this code, make reference to the following
# publication: Stath... | mariapetroREPO_NAMELeHaMoCPATH_START.@LeHaMoC_extracted@LeHaMoC-main@Fit_emcee@Code.py@.PATH_END.py |
{
"filename": "exolib.py",
"repo_name": "ExoSim/ExoSimPublic",
"repo_path": "ExoSimPublic_extracted/ExoSimPublic-master/exosim/lib/exolib.py",
"type": "Python"
} | import numpy as np
from scipy import signal
from scipy import interpolate
from scipy.integrate import cumtrapz
import scipy.special
import quantities as pq
#import sys, os, pyfits
import sys
import os
import astropy.io.fits as pyfits
def exosim_error(error_msg):
sys.stderr.write("Error code: {:s}\n".format(error_m... | ExoSimREPO_NAMEExoSimPublicPATH_START.@ExoSimPublic_extracted@ExoSimPublic-master@exosim@lib@exolib.py@.PATH_END.py |
{
"filename": "fsclean.py",
"repo_name": "mrbell/fsclean",
"repo_path": "fsclean_extracted/fsclean-master/fsclean.py",
"type": "Python"
} | #!/usr/bin/env python
"""
fsclean.py
Faraday synthesis using 3D CLEAN deconvolution
*******************************************************************************
Copyright 2012 Michael Bell
This file is part of fsclean.
fsclean is free software: you can redistribute it and/or modify
it under the terms of the GN... | mrbellREPO_NAMEfscleanPATH_START.@fsclean_extracted@fsclean-master@fsclean.py@.PATH_END.py |
{
"filename": "amplifiers.py",
"repo_name": "nu-radio/NuRadioMC",
"repo_path": "NuRadioMC_extracted/NuRadioMC-master/NuRadioMC/examples/SignalVisualization/amplifiers.py",
"type": "Python"
} | amplifier_options = [
{
'label': 'None',
'value': None,
'description': ('No amplifier is selected. Only the response of the'
' antenna is displayed')
},
{
'label': 'RNO-G, Iglu',
'value': 'iglu',
'description': 'Amplifier used for the downhole chan... | nu-radioREPO_NAMENuRadioMCPATH_START.@NuRadioMC_extracted@NuRadioMC-master@NuRadioMC@examples@SignalVisualization@amplifiers.py@.PATH_END.py |
{
"filename": "trantable.md",
"repo_name": "jbroll/starbase",
"repo_path": "starbase_extracted/starbase-master/docs/trantable.md",
"type": "Markdown"
} |
### `trantable` - table driven string substitution.
SYNOPSYS
--------
```
`trantable` [-i *ifile*] [-o *ofile*] *table* *fromcol* *tocol*
```
DESCRIPTION
-----------
Use m4 to replace all of the strings in *fromcol* with the
strings in *tocol*.
SEE ALSO
--------
* [grestable](grestable.html) - table d... | jbrollREPO_NAMEstarbasePATH_START.@starbase_extracted@starbase-master@docs@trantable.md@.PATH_END.py |
{
"filename": "_tickmode.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/yaxis/minor/_tickmode.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="tickmode", parent_name="layout.yaxis.minor", **kwargs
):
super(TickmodeValidator, self).__init__(
plotly_name=plotly_name,
par... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@yaxis@minor@_tickmode.py@.PATH_END.py |
{
"filename": "elasticc2_demo3.ipynb",
"repo_name": "LSSTDESC/elasticc",
"repo_path": "elasticc_extracted/elasticc-main/jupyter/sprint_week_2024oct/elasticc2_demo3.ipynb",
"type": "Jupyter Notebook"
} | ### DESC Sprint Week ELAsTiCC Tutorial Demo 3
## Querying the DESC TOM
This will be less efficient than just reading the parquet files if what you want is access to the SNANA simulations. Use this if you're Amanda Wasserman and developing DESC infrastructure for spectroscopic followup, or somebody doing something si... | LSSTDESCREPO_NAMEelasticcPATH_START.@elasticc_extracted@elasticc-main@jupyter@sprint_week_2024oct@elasticc2_demo3.ipynb@.PATH_END.py |
{
"filename": "bokeh_plot_khat.py",
"repo_name": "arviz-devs/arviz",
"repo_path": "arviz_extracted/arviz-main/examples/bokeh/bokeh_plot_khat.py",
"type": "Python"
} | """
Pareto Shape Plot
=================
"""
import arviz as az
idata = az.load_arviz_data("radon")
loo = az.loo(idata, pointwise=True)
ax = az.plot_khat(loo, show_bins=True, backend="bokeh")
| arviz-devsREPO_NAMEarvizPATH_START.@arviz_extracted@arviz-main@examples@bokeh@bokeh_plot_khat.py@.PATH_END.py |
{
"filename": "test_XYLike.py",
"repo_name": "threeML/threeML",
"repo_path": "threeML_extracted/threeML-master/threeML/test/test_XYLike.py",
"type": "Python"
} | from threeML import *
from threeML.plugins.XYLike import XYLike
import os
import numpy as np
def get_signal():
# Generate a test signal
generator = Line() + Gaussian()
generator.mu_2 = 5.0
generator.sigma_2 = 0.32
generator.F_2 = 70.4
generator.a_1 = 40.0
signal = generator(x)
return... | threeMLREPO_NAMEthreeMLPATH_START.@threeML_extracted@threeML-master@threeML@test@test_XYLike.py@.PATH_END.py |
{
"filename": "test_deploy.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/tests/cli/test_deploy.py",
"type": "Python"
} | import io
import json
import os
import shutil
import subprocess
import sys
import tempfile
from datetime import timedelta
from pathlib import Path
from typing import Optional
from unittest import mock
from uuid import UUID, uuid4
import pendulum
import pytest
import readchar
import yaml
from typer import Exit
import ... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@tests@cli@test_deploy.py@.PATH_END.py |
{
"filename": "_thicknessmode.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/parcats/line/colorbar/_thicknessmode.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ThicknessmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="thicknessmode", parent_name="parcats.line.colorbar", **kwargs
):
super(ThicknessmodeValidator, self).__init__(
plotly_name=plotly_nam... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@parcats@line@colorbar@_thicknessmode.py@.PATH_END.py |
{
"filename": "polarization.py",
"repo_name": "threeML/astromodels",
"repo_path": "astromodels_extracted/astromodels-master/astromodels/core/polarization.py",
"type": "Python"
} | __author__ = "giacomov"
from astromodels.core.tree import Node
from astromodels.core.parameter import Parameter
import numpy as np
class Polarization(Node):
def __init__(self, polarization_type="linear"):
assert polarization_type in [
"linear",
"stokes",
], "polarization... | threeMLREPO_NAMEastromodelsPATH_START.@astromodels_extracted@astromodels-master@astromodels@core@polarization.py@.PATH_END.py |
{
"filename": "test_rt_nbs14_1k.py",
"repo_name": "aewallin/allantools",
"repo_path": "allantools_extracted/allantools-master/tests/realtime/test_rt_nbs14_1k.py",
"type": "Python"
} | """
NBS14 test for allantools (https://github.com/aewallin/allantools)
nbs14 datasets are from http://www.ieee-uffc.org/frequency-control/learning-riley.asp
Stable32 was used to calculate the deviations we compare against.
The small dataset and deviations are from
http://www.ieee-uffc.org/frequency-contr... | aewallinREPO_NAMEallantoolsPATH_START.@allantools_extracted@allantools-master@tests@realtime@test_rt_nbs14_1k.py@.PATH_END.py |
{
"filename": "fista.py",
"repo_name": "miguelcarcamov/csromer",
"repo_path": "csromer_extracted/csromer-master/src/csromer/optimization/methods/fista.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 14 12:09:14 2019
@author: miguel
"""
import copy
from dataclasses import dataclass
import numpy as np
from ...objectivefunction import Chi2, Fi
from ..optimizer import Optimizer
@dataclass(init=True, repr=True)
class FISTA(Optimizer):
fx: C... | miguelcarcamovREPO_NAMEcsromerPATH_START.@csromer_extracted@csromer-master@src@csromer@optimization@methods@fista.py@.PATH_END.py |
{
"filename": "1_GetStarted.ipynb",
"repo_name": "natashabatalha/picaso",
"repo_path": "picaso_extracted/picaso-master/docs/notebooks/1_GetStarted.ipynb",
"type": "Jupyter Notebook"
} | # Getting Started : Basic Inputs and Outputs
If you are here then you have already successfully
1) Installed the code
2) Downloaded the necessary reference data
3) Added ``export picaso_refdata="/path/to/picaso/reference"`` to ~/.bash_profile
If you have not done these things, please return to [Installation Guild... | natashabatalhaREPO_NAMEpicasoPATH_START.@picaso_extracted@picaso-master@docs@notebooks@1_GetStarted.ipynb@.PATH_END.py |
{
"filename": "_detail.py",
"repo_name": "bek0s/gbkfit",
"repo_path": "gbkfit_extracted/gbkfit-master/src/gbkfit/dataset/datasets/_detail.py",
"type": "Python"
} |
import logging
import typing
from gbkfit.dataset.data import data_parser
from gbkfit.utils import iterutils, parseutils
__init__ = [
'load_dataset_common',
'dump_dataset_common'
]
_log = logging.getLogger(__name__)
def _sanitize_dimensional_option(option, value, lengths, type_):
args = typing.get_ar... | bek0sREPO_NAMEgbkfitPATH_START.@gbkfit_extracted@gbkfit-master@src@gbkfit@dataset@datasets@_detail.py@.PATH_END.py |
{
"filename": "MF_theory.py",
"repo_name": "franciscovillaescusa/Pylians",
"repo_path": "Pylians_extracted/Pylians-master/Mass_function/MF_theory.py",
"type": "Python"
} | import numpy as np
import mass_function_library as MFL
################################# INPUT ######################################
# input Pk at wanted MF redshift. For neutrinos use CDM+B Pk
f_Pk = 'Pk_m_z=0.dat'
bins_k = 10000 #number of bins to use in the input Pk
# For neutrinos use Omega_{CDM+B} instead of ... | franciscovillaescusaREPO_NAMEPyliansPATH_START.@Pylians_extracted@Pylians-master@Mass_function@MF_theory.py@.PATH_END.py |
{
"filename": "runfiles_nirps_he.py",
"repo_name": "njcuk9999/apero-drs",
"repo_path": "apero-drs_extracted/apero-drs-main/apero/tools/module/processing/instruments/runfiles_nirps_he.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# CODE NAME HERE
# CODE DESCRIPTION HERE
Created on 2022-06-06
@author: cook
"""
from typing import List
from apero.base import base
from apero.core import constants
from apero.tools.module.processing import drs_run_ini
# ===========================================... | njcuk9999REPO_NAMEapero-drsPATH_START.@apero-drs_extracted@apero-drs-main@apero@tools@module@processing@instruments@runfiles_nirps_he.py@.PATH_END.py |
{
"filename": "sparse_embeddings.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/partners/qdrant/langchain_qdrant/sparse_embeddings.py",
"type": "Python"
} | from abc import ABC, abstractmethod
from typing import List
from langchain_core.runnables.config import run_in_executor
from pydantic import BaseModel, Field
class SparseVector(BaseModel, extra="forbid"):
"""
Sparse vector structure
"""
indices: List[int] = Field(..., description="indices must be un... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@partners@qdrant@langchain_qdrant@sparse_embeddings.py@.PATH_END.py |
{
"filename": "parallel_stacking.ipynb",
"repo_name": "ali-beheshti/Astro-Paint",
"repo_path": "Astro-Paint_extracted/Astro-Paint-master/examples/parallel_stacking.ipynb",
"type": "Jupyter Notebook"
} | ```python
import numpy as np
np.random.seed(0)
import astropaint as ap
from astropaint import Catalog, Canvas, Painter
from astropaint import utils, transform
from astropaint.profiles import NFW
import matplotlib.pyplot as plt
from matplotlib import cm
```
In this notebook we will
1. Paint `NFW.kSZ_T` profiles on ... | ali-beheshtiREPO_NAMEAstro-PaintPATH_START.@Astro-Paint_extracted@Astro-Paint-master@examples@parallel_stacking.ipynb@.PATH_END.py |
{
"filename": "_filter_design.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/signal/_filter_design.py",
"type": "Python"
} | """Filter design."""
import math
import operator
import warnings
import numpy
import numpy as np
from numpy import (atleast_1d, poly, polyval, roots, real, asarray,
resize, pi, absolute, logspace, r_, sqrt, tan, log10,
arctan, arcsinh, sin, exp, cosh, arccosh, ceil, conjugate,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@signal@_filter_design.py@.PATH_END.py |
{
"filename": "_shadow.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/histogram/marker/colorbar/title/font/_shadow.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShadowValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="shadow",
parent_name="histogram.marker.colorbar.title.font",
**kwargs,
):
super(ShadowValidator, self).__init__(
plotly_... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@histogram@marker@colorbar@title@font@_shadow.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "s-ilic/ECLAIR",
"repo_path": "ECLAIR_extracted/ECLAIR-master/likelihoods/BG/BAO/SDSS/DR12/LRG/__init__.py",
"type": "Python"
} | import numpy as np
# BAO BOSS DR12 LRG 0.2<z<0.5 and 0.4<z<0.6
# Based on Alam et al. 2016
# https://arxiv.org/abs/1607.03155
class likelihood:
def __init__(self, lkl_input):
self.z = np.array([0.38, 0.38, 0.51, 0.51])
self.data = np.array([
1.023406e+01, # DM_over_rs
2.498058e+01, # DH_over_r... | s-ilicREPO_NAMEECLAIRPATH_START.@ECLAIR_extracted@ECLAIR-master@likelihoods@BG@BAO@SDSS@DR12@LRG@__init__.py@.PATH_END.py |
{
"filename": "zero_out_grad_2.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/examples/adding_an_op/zero_out_grad_2.py",
"type": "Python"
} | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@examples@adding_an_op@zero_out_grad_2.py@.PATH_END.py |
{
"filename": "multinomial.py",
"repo_name": "jax-ml/jax",
"repo_path": "jax_extracted/jax-main/jax/scipy/stats/multinomial.py",
"type": "Python"
} | # Copyright 2022 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | jax-mlREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@scipy@stats@multinomial.py@.PATH_END.py |
{
"filename": "mu_simplecontours.py",
"repo_name": "kapteyn-astro/kapteyn",
"repo_path": "kapteyn_extracted/kapteyn-master/doc/source/EXAMPLES/mu_simplecontours.py",
"type": "Python"
} | from kapteyn import maputils
from matplotlib import pyplot as plt
fitsobj = maputils.FITSimage("m101.fits")
fitsobj.set_limits((200,400), (200,400))
annim = fitsobj.Annotatedimage()
cont = annim.Contours()
annim.plot()
print("Levels=", cont.clevels)
plt.show()
| kapteyn-astroREPO_NAMEkapteynPATH_START.@kapteyn_extracted@kapteyn-master@doc@source@EXAMPLES@mu_simplecontours.py@.PATH_END.py |
{
"filename": "spectrum.py",
"repo_name": "gammapy/gammapy",
"repo_path": "gammapy_extracted/gammapy-main/gammapy/datasets/spectrum.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import logging
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
from gammapy.utils.scripts import make_path
from .map import MapDataset, MapDatasetOnOff
from .utils import get_axes
__all__ = ["SpectrumDatasetOnOff", "SpectrumDatase... | gammapyREPO_NAMEgammapyPATH_START.@gammapy_extracted@gammapy-main@gammapy@datasets@spectrum.py@.PATH_END.py |
{
"filename": "prepare_plig.py",
"repo_name": "benabed/clik",
"repo_path": "clik_extracted/clik-main/src/python/tools/prepare_plig.py",
"type": "Python"
} | #! PYTHONEXE
import sys
sys.path = ["REPLACEPATH"]+sys.path
import numpy as nm
import numpy.random as ra
import numpy.linalg as la
import clik.parobject as php
import clik
import re
import clik.hpy as h5py
import clik.smicahlp as smh
try:
from astropy.io import fits as pf
except ImportError as e:
# try pyfits t... | benabedREPO_NAMEclikPATH_START.@clik_extracted@clik-main@src@python@tools@prepare_plig.py@.PATH_END.py |
{
"filename": "special.py",
"repo_name": "jrenaud90/TidalPy",
"repo_path": "TidalPy_extracted/TidalPy-main/TidalPy/utilities/math/special.py",
"type": "Python"
} | """ This module provides several special functions that are specifically designed to work with TidalPy and its
dependencies (looking at you, Numba).
"""
from typing import TYPE_CHECKING
import numpy as np
from TidalPy.utilities.performance import njit, use_numba
if TYPE_CHECKING:
from TidalPy.utilities.types i... | jrenaud90REPO_NAMETidalPyPATH_START.@TidalPy_extracted@TidalPy-main@TidalPy@utilities@math@special.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "rabrahm/ceres",
"repo_path": "ceres_extracted/ceres-master/utils/OptExtract/setup.py",
"type": "Python"
} | from distutils.core import setup, Extension
import numpy
import os
"""
According to GSL documentation (http://www.gnu.org/software/gsl/manual/html_node/Shared-Libraries.html), in order to run the different operations one must include the GSL library, the GSLCBLAS library and the math library. To compile in C one must d... | rabrahmREPO_NAMEceresPATH_START.@ceres_extracted@ceres-master@utils@OptExtract@setup.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "NiallJeffrey/DeepMass",
"repo_path": "DeepMass_extracted/DeepMass-main/DES_mass_maps_demo/original_run_scripts/training_data/__init__.py",
"type": "Python"
} | NiallJeffreyREPO_NAMEDeepMassPATH_START.@DeepMass_extracted@DeepMass-main@DES_mass_maps_demo@original_run_scripts@training_data@__init__.py@.PATH_END.py | |
{
"filename": "_opacity.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattercarpet/marker/_opacity.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OpacityValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="opacity", parent_name="scattercarpet.marker", **kwargs
):
super(OpacityValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattercarpet@marker@_opacity.py@.PATH_END.py |
{
"filename": "dtype_policy.py",
"repo_name": "fchollet/keras",
"repo_path": "keras_extracted/keras-master/keras/src/dtype_policies/dtype_policy.py",
"type": "Python"
} | from keras.src import backend
from keras.src import ops
from keras.src.api_export import keras_export
from keras.src.backend.common import global_state
QUANTIZATION_MODES = ("int8", "float8")
@keras_export(
[
"keras.DTypePolicy",
"keras.dtype_policies.DTypePolicy",
"keras.mixed_precision.... | fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@dtype_policies@dtype_policy.py@.PATH_END.py |
{
"filename": "io_utils.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/utils/io_utils.py",
"type": "Python"
} | import sys
from absl import logging
from keras.src.api_export import keras_export
from keras.src.backend.common import global_state
@keras_export(
[
"keras.config.enable_interactive_logging",
"keras.utils.enable_interactive_logging",
]
)
def enable_interactive_logging():
"""Turn on inter... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@utils@io_utils.py@.PATH_END.py |
{
"filename": "test_hypergeometric.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/special/tests/test_hypergeometric.py",
"type": "Python"
} | import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_equal
import scipy.special as sc
class TestHyperu:
def test_negative_x(self):
a, b, x = np.meshgrid(
[-1, -0.5, 0, 0.5, 1],
[-1, -0.5, 0, 0.5, 1],
np.linspace(-100, -1, 10),
)
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@special@tests@test_hypergeometric.py@.PATH_END.py |
{
"filename": "test_chained_assignment_deprecation.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/copy_view/test_chained_assignment_deprecation.py",
"type": "Python"
} | import numpy as np
import pytest
from pandas.errors import ChainedAssignmentError
from pandas import DataFrame
import pandas._testing as tm
@pytest.mark.parametrize(
"indexer", [0, [0, 1], slice(0, 2), np.array([True, False, True])]
)
def test_series_setitem(indexer):
# ensure we only get a single warning f... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@copy_view@test_chained_assignment_deprecation.py@.PATH_END.py |
{
"filename": "parameters_spect.py",
"repo_name": "GeminiDRSoftware/DRAGONS",
"repo_path": "DRAGONS_extracted/DRAGONS-master/geminidr/core/parameters_spect.py",
"type": "Python"
} | # This parameter file contains the parameters related to the primitives located
# in the primitives_spect.py file, in alphabetical order.
from astropy import table, units as u
from astropy.io import registry
from astrodata import AstroData
from geminidr.core import parameters_generic
from gempy.library import config, ... | GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@geminidr@core@parameters_spect.py@.PATH_END.py |
{
"filename": "pooling_ops_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/compiler/tests/pooling_ops_test.py",
"type": "Python"
} | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@compiler@tests@pooling_ops_test.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "desihub/LSS",
"repo_path": "LSS_extracted/LSS-main/py/LSS/DESI_ke/__init__.py",
"type": "Python"
} | desihubREPO_NAMELSSPATH_START.@LSS_extracted@LSS-main@py@LSS@DESI_ke@__init__.py@.PATH_END.py | |
{
"filename": "11158_rval_100015.py",
"repo_name": "shreeyesh-biswal/Rvalue_3D",
"repo_path": "Rvalue_3D_extracted/Rvalue_3D-main/Codes/X-class/AR_11158/11158_rval_100015.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 26 20:36:28 2022
@author: shreeyeshbiswal
"""
import os
import numpy as np
import matplotlib as mpl
from matplotlib import pyplot as plt
from matplotlib.pyplot import figure
AR = "11158"
core_dir = "/home/shreeyeshbiswal/IDLWorkspace/Dataset_PF/"
... | shreeyesh-biswalREPO_NAMERvalue_3DPATH_START.@Rvalue_3D_extracted@Rvalue_3D-main@Codes@X-class@AR_11158@11158_rval_100015.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "juanep97/iop4",
"repo_path": "iop4_extracted/iop4-main/iop4lib/db/__init__.py",
"type": "Python"
} | from ..enums import *
from .epoch import Epoch
from .rawfit import RawFit
from .astrosource import AstroSource
from .masterbias import MasterBias
from .masterflat import MasterFlat
from .masterdark import MasterDark
from .reducedfit import ReducedFit
from .photopolresult import PhotoPolResult, PhotoPolResultReducedFitR... | juanep97REPO_NAMEiop4PATH_START.@iop4_extracted@iop4-main@iop4lib@db@__init__.py@.PATH_END.py |
{
"filename": "Box1d.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/src/PYB11/Geometry/Box1d.py",
"type": "Python"
} | #-------------------------------------------------------------------------------
# Box1d
#-------------------------------------------------------------------------------
from PYB11Generator import *
class Box1d:
PYB11typedefs = """
typedef Box1d::Vector Vector;
"""
#......................................... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@src@PYB11@Geometry@Box1d.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "JulianBMunoz/Zeus21",
"repo_path": "Zeus21_extracted/Zeus21-main/zeus21/__init__.py",
"type": "Python"
} | from .inputs import Cosmo_Parameters_Input, Cosmo_Parameters, Astro_Parameters
from .constants import *
from .cosmology import *
from .correlations import *
from .sfrd import get_T21_coefficients
from .xrays import Xray_class
from .UVLFs import UVLF_binned
from .maps import CoevalMaps
import warnings
warnings.filterwa... | JulianBMunozREPO_NAMEZeus21PATH_START.@Zeus21_extracted@Zeus21-main@zeus21@__init__.py@.PATH_END.py |
{
"filename": "_bgcolor.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/image/hoverlabel/_bgcolor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BgcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(self, plotly_name="bgcolor", parent_name="image.hoverlabel", **kwargs):
super(BgcolorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@image@hoverlabel@_bgcolor.py@.PATH_END.py |
{
"filename": "1_fitting_wd_spectra.ipynb",
"repo_name": "vedantchandra/wdtools",
"repo_path": "wdtools_extracted/wdtools-master/docs/examples/1_fitting_wd_spectra.ipynb",
"type": "Jupyter Notebook"
} | # Tutorial: Fitting a DA Spectrum
For this demonstration, we use a sample spectrum from the Sloan Digital Sky Survey (SDSS) named SDSS J082600.58+282346.2.
Tremblay et al. (2019) assigned this star an effective temperature of $13917$ Kelvin and a surface gravity of $8.06$ log[cm/s^2] using their latest atmospheric m... | vedantchandraREPO_NAMEwdtoolsPATH_START.@wdtools_extracted@wdtools-master@docs@examples@1_fitting_wd_spectra.ipynb@.PATH_END.py |
{
"filename": "test_index.py",
"repo_name": "facebookresearch/faiss",
"repo_path": "faiss_extracted/faiss-main/tests/test_index.py",
"type": "Python"
} | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""this is a basic test script for simple indices work"""
from __future__ import absolute_import, division, print_function
# no unicode_lite... | facebookresearchREPO_NAMEfaissPATH_START.@faiss_extracted@faiss-main@tests@test_index.py@.PATH_END.py |
{
"filename": "RELEASE_NOTES.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/libs/tbb/RELEASE_NOTES.md",
"type": "Markdown"
} | <!--
******************************************************************************
*
* 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
*
* Unl... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@libs@tbb@RELEASE_NOTES.md@.PATH_END.py |
{
"filename": "_stream.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/choropleth/_stream.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Stream(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "choropleth"
_path_str = "choropleth.stream"
_valid_props = {"maxpoints", "token"}
# max... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@choropleth@_stream.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/core/langchain_core/outputs/__init__.py",
"type": "Python"
} | """**Output** classes are used to represent the output of a language model call
and the output of a chat.
The top container for information is the `LLMResult` object. `LLMResult` is used by
both chat models and LLMs. This object contains the output of the language
model and any additional information that the model pr... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@core@langchain_core@outputs@__init__.py@.PATH_END.py |
{
"filename": "_variantsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattersmith/textfont/_variantsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="variantsrc", parent_name="scattersmith.textfont", **kwargs
):
super(VariantsrcValidator, self).__init__(
plotly_name=plotly_name,
p... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattersmith@textfont@_variantsrc.py@.PATH_END.py |
{
"filename": "validate_decoder.py",
"repo_name": "changhoonhahn/provabgs",
"repo_path": "provabgs_extracted/provabgs-main/bin/validate_decoder.py",
"type": "Python"
} | '''
validate the trained decoder
'''
import os, sys
import numpy as np
from datetime import date
import torch
from torch import nn
from torch import optim
from torch.nn import functional as F
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
#-------------------------------------------------... | changhoonhahnREPO_NAMEprovabgsPATH_START.@provabgs_extracted@provabgs-main@bin@validate_decoder.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "PlasmaPy/PlasmaPy",
"repo_path": "PlasmaPy_extracted/PlasmaPy-main/tests/dispersion/numerical/__init__.py",
"type": "Python"
} | PlasmaPyREPO_NAMEPlasmaPyPATH_START.@PlasmaPy_extracted@PlasmaPy-main@tests@dispersion@numerical@__init__.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.