metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "_maxpoints.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterpolar/stream/_maxpoints.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MaxpointsValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="maxpoints", parent_name="scatterpolar.stream", **kwargs
):
super(MaxpointsValidator, self).__init__(
plotly_name=plotly_name,
par... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterpolar@stream@_maxpoints.py@.PATH_END.py |
{
"filename": "cmd_parse.py",
"repo_name": "CadenArmstrong/simuTrans",
"repo_path": "simuTrans_extracted/simuTrans-master/cmd_parse.py",
"type": "Python"
} | #!/usr/bin/python
#lc_parse.py use to parse all the command lines for functions realted to run lc function.
import optparse
from fancyfont import colors
import os
tc=colors()
def runcfg():
p = optparse.OptionParser()
p.add_option('--eflag','-e',default=False,action='store_true',help='Creat example.cfg for all... | CadenArmstrongREPO_NAMEsimuTransPATH_START.@simuTrans_extracted@simuTrans-master@cmd_parse.py@.PATH_END.py |
{
"filename": "kappa-maszcal-vs-profiley.ipynb",
"repo_name": "dylancromer/maszcal",
"repo_path": "maszcal_extracted/maszcal-main/docs/kappa-maszcal-vs-profiley.ipynb",
"type": "Jupyter Notebook"
} | ```javascript
%%javascript
IPython.OutputArea.prototype._should_scroll = function(lines) {
return false;
}
```
<IPython.core.display.Javascript object>
```python
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import matplotlib
matplotlib.rc('font', **{'family': 'serif', 'serif': ['Comput... | dylancromerREPO_NAMEmaszcalPATH_START.@maszcal_extracted@maszcal-main@docs@kappa-maszcal-vs-profiley.ipynb@.PATH_END.py |
{
"filename": "Untitled2-checkpoint.ipynb",
"repo_name": "stevepur/DR25-occurrence-public",
"repo_path": "DR25-occurrence-public_extracted/DR25-occurrence-public-main/GKbaseline_kic/.ipynb_checkpoints/Untitled2-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | ```python
import numpy as np
import requests
import pandas as pd
from cStringIO import StringIO
import matplotlib.pyplot as plt
```
```python
# load the full catalogs
dr25StellarSup = pd.read_csv("../stellarCatalogs/dr25_stellar_updated_feh_all.txt", dtype={"st_quarters":str})
berger2018Stellar = pd.read_csv("../ste... | stevepurREPO_NAMEDR25-occurrence-publicPATH_START.@DR25-occurrence-public_extracted@DR25-occurrence-public-main@GKbaseline_kic@.ipynb_checkpoints@Untitled2-checkpoint.ipynb@.PATH_END.py |
{
"filename": "agent.py",
"repo_name": "simonsobs/socs",
"repo_path": "socs_extracted/socs-main/socs/agents/rtsp_camera/agent.py",
"type": "Python"
} | # Copyright (C) 2023-2024 Simons Observatory Collaboration
# See top-level LICENSE.txt file for more information.
"""Agent to capture images from cameras which support the RTSP protocol.
"""
import os
import time
from datetime import datetime, timedelta, timezone
import cv2
import ocs
import txaio
from ocs import ocs_... | simonsobsREPO_NAMEsocsPATH_START.@socs_extracted@socs-main@socs@agents@rtsp_camera@agent.py@.PATH_END.py |
{
"filename": "phasespace.py",
"repo_name": "jstuecker/adiabatic-tides",
"repo_path": "adiabatic-tides_extracted/adiabatic-tides-main/adiabatic_tides/phasespace.py",
"type": "Python"
} | import numpy as np
from scipy.integrate import quad
import scipy.optimize as op
from . import mathtools
from scipy.interpolate import interp1d, NearestNDInterpolator, LinearNDInterpolator
class IsotropicPhaseSpaceSolver():
def __init__(self, profile, rbins=1000, rnorm=None, rmax=None, rmin=None, potential... | jstueckerREPO_NAMEadiabatic-tidesPATH_START.@adiabatic-tides_extracted@adiabatic-tides-main@adiabatic_tides@phasespace.py@.PATH_END.py |
{
"filename": "ode.py",
"repo_name": "jax-ml/jax",
"repo_path": "jax_extracted/jax-main/jax/experimental/ode.py",
"type": "Python"
} | # Copyright 2018 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@experimental@ode.py@.PATH_END.py |
{
"filename": "_width.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter3d/error_z/_width.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="width", parent_name="scatter3d.error_z", **kwargs):
super(WidthValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter3d@error_z@_width.py@.PATH_END.py |
{
"filename": "plotting.py",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/dynesty_2_0/plotting.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A set of built-in plotting functions to help visualize ``dynesty`` nested
sampling :class:`~dynesty.results.Results`.
"""
import logging
import warnings
import numpy as np
import matplotlib.pyplot as pl
from matplotlib.ticker import MaxNLocator, NullLocator
from matpl... | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@dynesty_2_0@plotting.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "nanograv/PINT",
"repo_path": "PINT_extracted/PINT-master/src/pint/models/__init__.py",
"type": "Python"
} | """Pulsar timing models and tools for working with them.
The primary object for representing a timing model is
:class:`~pint.models.timing_model.TimingModel`. This contains a collection of
components (subclasses of :class:`~pint.models.timing_model.Component`), each of
which should have a collection of parameters (sub... | nanogravREPO_NAMEPINTPATH_START.@PINT_extracted@PINT-master@src@pint@models@__init__.py@.PATH_END.py |
{
"filename": "GimpGradientFile.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/Pillow/py3/PIL/GimpGradientFile.py",
"type": "Python"
} | #
# Python Imaging Library
# $Id$
#
# stuff to read (and render) GIMP gradient files
#
# History:
# 97-08-23 fl Created
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1997.
#
# See the README file for information on usage and redistribution.
#
"""
Stuff to translate curve segments to pa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@Pillow@py3@PIL@GimpGradientFile.py@.PATH_END.py |
{
"filename": "density_estimator_test.py",
"repo_name": "mackelab/sbi",
"repo_path": "sbi_extracted/sbi-main/tests/density_estimator_test.py",
"type": "Python"
} | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
from __future__ import annotations
from typing import Callable, Tuple
import pytest
import torch
from torch import eye, zeros
from torch.distributions i... | mackelabREPO_NAMEsbiPATH_START.@sbi_extracted@sbi-main@tests@density_estimator_test.py@.PATH_END.py |
{
"filename": "test_values.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/series/methods/test_values.py",
"type": "Python"
} | import numpy as np
import pytest
from pandas import (
IntervalIndex,
Series,
period_range,
)
import pandas._testing as tm
class TestValues:
@pytest.mark.parametrize(
"data",
[
period_range("2000", periods=4),
IntervalIndex.from_breaks([1, 2, 3, 4]),
],
... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@series@methods@test_values.py@.PATH_END.py |
{
"filename": "test_correlation.py",
"repo_name": "astropy/specutils",
"repo_path": "specutils_extracted/specutils-main/specutils/tests/test_correlation.py",
"type": "Python"
} | import numpy as np
import astropy.units as u
from astropy import constants as const
from astropy.nddata import StdDevUncertainty
from astropy.modeling import models
from ..spectra.spectrum1d import Spectrum1D
from ..analysis import correlation
def test_autocorrelation():
"""
Test auto correlation
"""
... | astropyREPO_NAMEspecutilsPATH_START.@specutils_extracted@specutils-main@specutils@tests@test_correlation.py@.PATH_END.py |
{
"filename": "convnext.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/applications/convnext.py",
"type": "Python"
} | import numpy as np
from keras.src import backend
from keras.src import initializers
from keras.src import layers
from keras.src import ops
from keras.src import random
from keras.src.api_export import keras_export
from keras.src.applications import imagenet_utils
from keras.src.layers.layer import Layer
from keras.src... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@applications@convnext.py@.PATH_END.py |
{
"filename": "test_act.py",
"repo_name": "dylancromer/maszcal",
"repo_path": "maszcal_extracted/maszcal-main/maszcal/data/test/test_act.py",
"type": "Python"
} | import numpy as np
import maszcal.cosmology
from maszcal.data.templates import StackedWeakLensingData
class ActTestData(StackedWeakLensingData):
def __init__(self, data_dir='data/test-act/'):
self.cosmology = self._init_cosmology()
thetas, wl_signals, zs, masses = self._load_data(data_dir)
... | dylancromerREPO_NAMEmaszcalPATH_START.@maszcal_extracted@maszcal-main@maszcal@data@test@test_act.py@.PATH_END.py |
{
"filename": "collective_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/dtensor/python/tests/collective_test.py",
"type": "Python"
} | # Copyright 2022 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@dtensor@python@tests@collective_test.py@.PATH_END.py |
{
"filename": "parse_object_list.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/doc/helper_scripts/parse_object_list.py",
"type": "Python"
} | import inspect
from textwrap import TextWrapper
import yt
ds = yt.load("RD0005-mine/RedshiftOutput0005")
output = open("source/analyzing/_obj_docstrings.inc", "w")
template = """
.. class:: %(clsname)s%(sig)s:
For more information, see :ref:`%(docstring)s`
(This is a proxy for :class:`~%(clsproxy)sBase`.)
"... | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@doc@helper_scripts@parse_object_list.py@.PATH_END.py |
{
"filename": "_xref.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/title/_xref.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XrefValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="xref", parent_name="layout.title", **kwargs):
super(XrefValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@title@_xref.py@.PATH_END.py |
{
"filename": "dirichlet_stats.py",
"repo_name": "mwalmsley/zoobot",
"repo_path": "zoobot_extracted/zoobot-main/zoobot/tensorflow/stats/dirichlet_stats.py",
"type": "Python"
} | import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
# from zoobot.tensorflow.stats import mixture_stats
def dirichlet_prob_of_answers(concentrations, schema):
# badly named vs posteriors, actually gives predicted vote fractions of answers...
# mean probability (including dropout) ... | mwalmsleyREPO_NAMEzoobotPATH_START.@zoobot_extracted@zoobot-main@zoobot@tensorflow@stats@dirichlet_stats.py@.PATH_END.py |
{
"filename": "_xsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/cone/_xsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="xsrc", parent_name="cone", **kwargs):
super(XsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@cone@_xsrc.py@.PATH_END.py |
{
"filename": "run_test.py",
"repo_name": "phirling/pyc2ray",
"repo_path": "pyc2ray_extracted/pyc2ray-main/test/unit_tests_hackathon/2_multiple_sources/run_test.py",
"type": "Python"
} | import sys
sys.path.append("../../../")
import tools21cm as t2c
import pyc2ray as pc2r
import time
import pickle as pkl
import astropy.constants as ac
import astropy.units as u
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--gpu",action='store_true')
parser.add_argument("-numsrc",default=10,t... | phirlingREPO_NAMEpyc2rayPATH_START.@pyc2ray_extracted@pyc2ray-main@test@unit_tests_hackathon@2_multiple_sources@run_test.py@.PATH_END.py |
{
"filename": "verifyGain.py",
"repo_name": "lsst/cp_verify",
"repo_path": "cp_verify_extracted/cp_verify-main/python/lsst/cp/verify/verifyGain.py",
"type": "Python"
} | # This file is part of cp_verify.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (http://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 ca... | lsstREPO_NAMEcp_verifyPATH_START.@cp_verify_extracted@cp_verify-main@python@lsst@cp@verify@verifyGain.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "fchollet/keras",
"repo_path": "keras_extracted/keras-master/keras/api/ops/image/__init__.py",
"type": "Python"
} | """DO NOT EDIT.
This file was autogenerated. Do not edit it by hand,
since your modifications would be overwritten.
"""
from keras.src.ops.image import affine_transform
from keras.src.ops.image import crop_images
from keras.src.ops.image import extract_patches
from keras.src.ops.image import hsv_to_rgb
from keras.src... | fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@api@ops@image@__init__.py@.PATH_END.py |
{
"filename": "test_bse.py",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/src/amuse/test/suite/codes_tests/test_bse.py",
"type": "Python"
} | from amuse.community.bse.interface import BSE, BSEInterface
from amuse.test.amusetest import TestWithMPI
from amuse.units import units
from amuse.units import constants
from amuse.datamodel import Particles
import numpy
class TestBSEInterface(TestWithMPI):
class state(object):
def __init__(self):
... | amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@src@amuse@test@suite@codes_tests@test_bse.py@.PATH_END.py |
{
"filename": "flows.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/prefect/flows.py",
"type": "Python"
} | """
Module containing the base workflow class and decorator - for most use cases, using the [`@flow` decorator][prefect.flows.flow] is preferred.
"""
# This file requires type-checking with pyright because mypy does not yet support PEP612
# See https://github.com/python/mypy/issues/8645
import ast
import asyncio
impor... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@flows.py@.PATH_END.py |
{
"filename": "example-checkpoint.ipynb",
"repo_name": "arsenefer/PWF_reconstruction",
"repo_path": "PWF_reconstruction_extracted/PWF_reconstruction-main/.ipynb_checkpoints/example-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | # Using PWF_reconstruction
```python
import numpy as np
import matplotlib.pyplot as plt
from PWF_reconstruction.recons_PWF import PWF_semianalytical, cov_matrix
```
We will use a dummy event to illustrate the package.
```python
x_ants = np.array([[6062., 3499.99975586, 1025.68994141],
[8660., -2... | arseneferREPO_NAMEPWF_reconstructionPATH_START.@PWF_reconstruction_extracted@PWF_reconstruction-main@.ipynb_checkpoints@example-checkpoint.ipynb@.PATH_END.py |
{
"filename": "plot_radial_profiles.py",
"repo_name": "andizq/discminer",
"repo_path": "discminer_extracted/discminer-main/_mining/plot_radial_profiles.py",
"type": "Python"
} | from discminer.plottools import (get_discminer_cmap, make_substructures,
make_up_ax, mod_minor_ticks, mod_major_ticks,
use_discminer_style, mod_nticks_cbars)
from discminer.rail import Rail, Contours
import numpy as np
import matplotlib.pyplot as plt
fr... | andizqREPO_NAMEdiscminerPATH_START.@discminer_extracted@discminer-main@_mining@plot_radial_profiles.py@.PATH_END.py |
{
"filename": "cli__binary-install-cuda.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage-code-examples/cli__binary-install-cuda.md",
"type": "Markdown"
} |
{% note info %}
Only CUDA {{ cuda_version__compiled-packages }} is officially supported in compiled command-line packages for Windows. [Вuild the binary from a local copy](../../../concepts/cli-installation.md) if GPU support is required and the installed version of CUDA differs from {{ cuda_version__compiled-package... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage-code-examples@cli__binary-install-cuda.md@.PATH_END.py |
{
"filename": "pebblo.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/document_loaders/pebblo.py",
"type": "Python"
} | """Pebblo's safe dataloader is a wrapper for document loaders"""
import logging
import os
import uuid
from importlib.metadata import version
from typing import Any, Dict, Iterable, Iterator, List, Optional
from langchain_core.documents import Document
from langchain_community.document_loaders.base import BaseLoader
... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@document_loaders@pebblo.py@.PATH_END.py |
{
"filename": "chidist_plotter.py",
"repo_name": "htjb/maxsmooth",
"repo_path": "maxsmooth_extracted/maxsmooth-master/maxsmooth/chidist_plotter.py",
"type": "Python"
} | """
This function allows the user to produce plots of the chi squared
distribution as a function of the available discrete sign spaces for the
constrained derivatives. This can be used to identify whether or not the
problem is `ill defined`, see the ``maxsmooth`` paper for a definition,
and if it can be solved using t... | htjbREPO_NAMEmaxsmoothPATH_START.@maxsmooth_extracted@maxsmooth-master@maxsmooth@chidist_plotter.py@.PATH_END.py |
{
"filename": "_xpad.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/contour/colorbar/_xpad.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XpadValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="xpad", parent_name="contour.colorbar", **kwargs):
super(XpadValidator, 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@contour@colorbar@_xpad.py@.PATH_END.py |
{
"filename": "convenience.py",
"repo_name": "timstaley/voevent-parse",
"repo_path": "voevent-parse_extracted/voevent-parse-master/src/voeventparse/convenience.py",
"type": "Python"
} | """Convenience routines for common actions on VOEvent objects"""
from __future__ import absolute_import
from collections import OrderedDict
from copy import deepcopy
import astropy.time
import iso8601
import lxml
import pytz
from voeventparse.misc import (Position2D)
from orderedmultidict import omdict as OMDict
d... | timstaleyREPO_NAMEvoevent-parsePATH_START.@voevent-parse_extracted@voevent-parse-master@src@voeventparse@convenience.py@.PATH_END.py |
{
"filename": "objects.Plot.label.ipynb",
"repo_name": "mwaskom/seaborn",
"repo_path": "seaborn_extracted/seaborn-master/doc/_docstrings/objects.Plot.label.ipynb",
"type": "Jupyter Notebook"
} | ```python
import seaborn.objects as so
from seaborn import load_dataset
penguins = load_dataset("penguins")
```
Use strings to override default labels:
```python
p = (
so.Plot(penguins, x="bill_length_mm", y="bill_depth_mm")
.add(so.Dot(), color="species")
)
p.label(x="Length", y="Depth", color="")
```
Pass a ... | mwaskomREPO_NAMEseabornPATH_START.@seaborn_extracted@seaborn-master@doc@_docstrings@objects.Plot.label.ipynb@.PATH_END.py |
{
"filename": "_showexponent.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/histogram2dcontour/colorbar/_showexponent.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowexponentValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="showexponent",
parent_name="histogram2dcontour.colorbar",
**kwargs
):
super(ShowexponentValidator, self).__init__(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@histogram2dcontour@colorbar@_showexponent.py@.PATH_END.py |
{
"filename": "batch_decomposition.py",
"repo_name": "mriener/gausspyplus",
"repo_path": "gausspyplus_extracted/gausspyplus-master/gausspyplus/gausspy_py3/batch_decomposition.py",
"type": "Python"
} | # @Author: Robert Lindner
# @Date: Nov 10, 2014
# @Filename: batch_decomposition.py
# @Last modified by: riener
# @Last modified time: 18-05-2020
import pickle
import multiprocessing
import signal
import sys
import numpy as np
from .gp import GaussianDecomposer
from tqdm import tqdm
from concurrent.futures import ... | mrienerREPO_NAMEgausspyplusPATH_START.@gausspyplus_extracted@gausspyplus-master@gausspyplus@gausspy_py3@batch_decomposition.py@.PATH_END.py |
{
"filename": "subplot.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/galleries/examples/subplots_axes_and_figures/subplot.py",
"type": "Python"
} | """
=================
Multiple subplots
=================
Simple demo with multiple subplots.
For more options, see :doc:`/gallery/subplots_axes_and_figures/subplots_demo`.
.. redirect-from:: /gallery/subplots_axes_and_figures/subplot_demo
"""
import matplotlib.pyplot as plt
import numpy as np
# Create some fake d... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@galleries@examples@subplots_axes_and_figures@subplot.py@.PATH_END.py |
{
"filename": "hetdex_fits.py",
"repo_name": "HETDEX/elixer",
"repo_path": "elixer_extracted/elixer-main/elixer/hetdex_fits.py",
"type": "Python"
} | try:
from elixer import global_config as G
except:
import global_config as G
try:
from hetdex_api.shot import get_fibers_table as hda_get_fibers_table
except:
log.error("Unable to import get_fibers_table",exc_info=True)
import numpy as np
import tables
from astropy.io import fits as pyfits
from astro... | HETDEXREPO_NAMEelixerPATH_START.@elixer_extracted@elixer-main@elixer@hetdex_fits.py@.PATH_END.py |
{
"filename": "gwfastGlobals.py",
"repo_name": "CosmoStatGW/gwfast",
"repo_path": "gwfast_extracted/gwfast-master/gwfast/gwfastGlobals.py",
"type": "Python"
} | #
# Copyright (c) 2022 Francesco Iacovelli <francesco.iacovelli@unige.ch>, Michele Mancarella <michele.mancarella@unige.ch>
#
# All rights reserved. Use of this source code is governed by the
# license that can be found in the LICENSE file.
#####################################################################... | CosmoStatGWREPO_NAMEgwfastPATH_START.@gwfast_extracted@gwfast-master@gwfast@gwfastGlobals.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "davidharvey1986/pyRRG",
"repo_path": "pyRRG_extracted/pyRRG-master/unittests/bugFixPyRRG/lib/python3.7/site-packages/pkg_resources/extern/__init__.py",
"type": "Python"
} | import sys
class VendorImporter:
"""
A PEP 302 meta path importer for finding optionally-vendored
or otherwise naturally-installed packages from root_name.
"""
def __init__(self, root_name, vendored_names=(), vendor_pkg=None):
self.root_name = root_name
self.vendored_names = set(v... | davidharvey1986REPO_NAMEpyRRGPATH_START.@pyRRG_extracted@pyRRG-master@unittests@bugFixPyRRG@lib@python3.7@site-packages@pkg_resources@extern@__init__.py@.PATH_END.py |
{
"filename": "_gridcolor.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/ternary/caxis/_gridcolor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class GridcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="gridcolor", parent_name="layout.ternary.caxis", **kwargs
):
super(GridcolorValidator, self).__init__(
plotly_name=plotly_name,
par... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@ternary@caxis@_gridcolor.py@.PATH_END.py |
{
"filename": "src_offsets_rotated.py",
"repo_name": "askap-craco/CELEBI",
"repo_path": "CELEBI_extracted/CELEBI-main/localise/src_offsets_rotated.py",
"type": "Python"
} | #####################################################################################
# GENERAL PYTHON IMPORTS
#####################################################################################
import argparse
import glob
import os
import re
import sys
import math
from itertools import dropwhile, islice
import m... | askap-cracoREPO_NAMECELEBIPATH_START.@CELEBI_extracted@CELEBI-main@localise@src_offsets_rotated.py@.PATH_END.py |
{
"filename": "disc_launch.py",
"repo_name": "FabioRigamonti/pyADfit",
"repo_path": "pyADfit_extracted/pyADfit-main/tests/disc_launch.py",
"type": "Python"
} | import numpy as np
import yaml
import pandas as pd
from disc_fit import analysis,calling_all
import os
import matplotlib.pyplot as plt
def read_data(input_path):
"""
Reads in data from a text file. USER DEFINED.
Parameters
----------
input_path : str
Path to the input file.
Returns
... | FabioRigamontiREPO_NAMEpyADfitPATH_START.@pyADfit_extracted@pyADfit-main@tests@disc_launch.py@.PATH_END.py |
{
"filename": "python__eval-metrics__return-value__div.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage/python__eval-metrics__return-value__div.md",
"type": "Markdown"
} |
A dictionary of calculated metrics in the following format:
```
metric -> array of shape [(ntree_end – ntree_start) / eval_period]
```
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage@python__eval-metrics__return-value__div.md@.PATH_END.py |
{
"filename": "_title.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/choropleth/colorbar/_title.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TitleValidator(_plotly_utils.basevalidators.TitleValidator):
def __init__(
self, plotly_name="title", parent_name="choropleth.colorbar", **kwargs
):
super(TitleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@choropleth@colorbar@_title.py@.PATH_END.py |
{
"filename": "gp_pyaneti_quasiperiodic_activity.py",
"repo_name": "LucaMalavolta/PyORBIT",
"repo_path": "PyORBIT_extracted/PyORBIT-main/pyorbit/models/gp_pyaneti_quasiperiodic_activity.py",
"type": "Python"
} | from pyorbit.subroutines.common import *
from pyorbit.models.abstract_model import *
from pyorbit.keywords_definitions import *
from scipy.linalg import cho_factor, cho_solve, lapack, LinAlgError
from scipy import matrix, spatial
try:
import pyaneti
except:
pass
class GP_Pyaneti_QuasiPeriodicActivity(Abstrac... | LucaMalavoltaREPO_NAMEPyORBITPATH_START.@PyORBIT_extracted@PyORBIT-main@pyorbit@models@gp_pyaneti_quasiperiodic_activity.py@.PATH_END.py |
{
"filename": "Likelihood_assessment.ipynb",
"repo_name": "jan-rybizki/Galaxia_wrap",
"repo_path": "Galaxia_wrap_extracted/Galaxia_wrap-master/notebook/Likelihood_assessment.ipynb",
"type": "Jupyter Notebook"
} | ```python
import numpy as np
import os, sys
path = os.path.abspath('../library/')
if path not in sys.path:
sys.path.append(path)
from cumhpx import do_likelihood, local_normalisation
name = 'raster_0.7_1.0'
```
```python
print(local_normalisation(name, verbose = True))
outputDir = '../output/%s_0.001' %name
fSamp... | jan-rybizkiREPO_NAMEGalaxia_wrapPATH_START.@Galaxia_wrap_extracted@Galaxia_wrap-master@notebook@Likelihood_assessment.ipynb@.PATH_END.py |
{
"filename": "test_visualisations_profiles.py",
"repo_name": "n-claes/legolas",
"repo_path": "legolas_extracted/legolas-master/tests/pylbo_tests/test_visualisations_profiles.py",
"type": "Python"
} | import numpy as np
import pylbo
def test_plot_equilibrium_profile(ds_v112):
p = pylbo.plot_equilibrium(ds_v112)
assert p is not None
p.draw()
def test_plot_continuum_profile(ds_v112):
p = pylbo.plot_continua(ds_v112)
assert p is not None
p.draw()
def test_plot_equilibrium_balance(ds_v112):... | n-claesREPO_NAMElegolasPATH_START.@legolas_extracted@legolas-master@tests@pylbo_tests@test_visualisations_profiles.py@.PATH_END.py |
{
"filename": "test_aperturedb.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/integration_tests/vectorstores/test_aperturedb.py",
"type": "Python"
} | """Test ApertureDB functionality."""
import uuid
import pytest
from langchain_tests.integration_tests.vectorstores import VectorStoreIntegrationTests
from langchain_community.vectorstores import ApertureDB
class TestApertureStandard(VectorStoreIntegrationTests):
@pytest.fixture
def vectorstore(self) -> Ape... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@integration_tests@vectorstores@test_aperturedb.py@.PATH_END.py |
{
"filename": "gaussian_streaming_model_fftw.py",
"repo_name": "sfschen/velocileptors",
"repo_path": "velocileptors_extracted/velocileptors-master/velocileptors/LPT/gaussian_streaming_model_fftw.py",
"type": "Python"
} | import numpy as np
from scipy.interpolate import InterpolatedUnivariateSpline as Spline
from scipy.signal import tukey
from velocileptors.Utils.spherical_bessel_transform import SphericalBesselTransform
from velocileptors.Utils.loginterp import loginterp
from velocileptors.LPT.velocity_moments_fftw import VelocityMo... | sfschenREPO_NAMEvelocileptorsPATH_START.@velocileptors_extracted@velocileptors-master@velocileptors@LPT@gaussian_streaming_model_fftw.py@.PATH_END.py |
{
"filename": "_weight.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/surface/legendgrouptitle/font/_weight.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WeightValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self,
plotly_name="weight",
parent_name="surface.legendgrouptitle.font",
**kwargs,
):
super(WeightValidator, self).__init__(
plotly_name=p... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@surface@legendgrouptitle@font@_weight.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "D4san/MultiREx-public",
"repo_path": "MultiREx-public_extracted/MultiREx-public-main/setup.py",
"type": "Python"
} | #########################################
# __ __ _ _ _ ___ ___ #
# | \/ |_ _| | |_(_) _ \ __|_ __ #
# | |\/| | || | | _| | / _|\ \ / #
# |_| |_|\_,_|_|\__|_|_|_\___/_\_\ #
# Planetary spectra generator #
#########################################
import setuptools
with op... | D4sanREPO_NAMEMultiREx-publicPATH_START.@MultiREx-public_extracted@MultiREx-public-main@setup.py@.PATH_END.py |
{
"filename": "rgbtools.py",
"repo_name": "solerjuan/astroHOG",
"repo_path": "astroHOG_extracted/astroHOG-master/rgbtools.py",
"type": "Python"
} | # This file is part of AstroHOG
#
# Copyright (C) 2013-2017 Juan Diego Soler
import sys
import numpy as np
from astropy.io import fits
import matplotlib
#matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
import matplotlib.pyplot as plt
#sys.path.append('/disk2/soler/PYTHON/astroHOG/')
#from... | solerjuanREPO_NAMEastroHOGPATH_START.@astroHOG_extracted@astroHOG-master@rgbtools.py@.PATH_END.py |
{
"filename": "basic_growth.ipynb",
"repo_name": "miosta/drift_composition",
"repo_path": "drift_composition_extracted/drift_composition-main/examples/basic_growth.ipynb",
"type": "Jupyter Notebook"
} | # Basic Model
Build a single steady disc model and compute the composition using the default abundances
```python
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.style.use('seaborn-talk')
```
### Define constants describing the disc model
```python
Mdot_gas = 1e-8
Mdot_dust = 1e-9
... | miostaREPO_NAMEdrift_compositionPATH_START.@drift_composition_extracted@drift_composition-main@examples@basic_growth.ipynb@.PATH_END.py |
{
"filename": "targets.py",
"repo_name": "ML4GW/aframe",
"repo_path": "aframe_extracted/aframe-main/aframe/targets.py",
"type": "Python"
} | from typing import Literal
import luigi
from luigi.contrib.s3 import S3Target
from luigi.format import BaseWrapper, WrappedFormat
from aframe.config import s3
from aframe.parameters import PATH_LIKE
# format for writing h5 files to s3
# via bytes streams
class BytesFormat(WrappedFormat):
input = "bytes"
out... | ML4GWREPO_NAMEaframePATH_START.@aframe_extracted@aframe-main@aframe@targets.py@.PATH_END.py |
{
"filename": "prop_savestate.py",
"repo_name": "ajeldorado/falco-python",
"repo_path": "falco-python_extracted/falco-python-master/falco/proper/prop_savestate.py",
"type": "Python"
} | # Copyright 2016, 2017 California Institute of Technology
# Users must agree to abide by the restrictions listed in the
# file "LegalStuff.txt" in the PROPER library directory.
#
# PROPER developed at Jet Propulsion Laboratory/California Inst. Technology
# Original IDL version by John Krist
# Python transla... | ajeldoradoREPO_NAMEfalco-pythonPATH_START.@falco-python_extracted@falco-python-master@falco@proper@prop_savestate.py@.PATH_END.py |
{
"filename": "distribution.py",
"repo_name": "pymc-devs/pymc",
"repo_path": "pymc_extracted/pymc-main/pymc/distributions/distribution.py",
"type": "Python"
} | # Copyright 2024 The PyMC Developers
#
# 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... | pymc-devsREPO_NAMEpymcPATH_START.@pymc_extracted@pymc-main@pymc@distributions@distribution.py@.PATH_END.py |
{
"filename": "_labelssrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/icicle/_labelssrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LabelssrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="labelssrc", parent_name="icicle", **kwargs):
super(LabelssrcValidator, 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@icicle@_labelssrc.py@.PATH_END.py |
{
"filename": "readSNdata.py",
"repo_name": "fforster/surveysim",
"repo_path": "surveysim_extracted/surveysim-master/readSNdata.py",
"type": "Python"
} | import re, os, sys
import numpy as np
import pandas as pd
from collections import defaultdict
from constants import *
def readSNdata(project, SNname, maxairmass = 1.7):
#########################
# Observational data
#########################
# make sure to return numpy arrays and not pan... | fforsterREPO_NAMEsurveysimPATH_START.@surveysim_extracted@surveysim-master@readSNdata.py@.PATH_END.py |
{
"filename": "_hovertext.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/box/_hovertext.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HovertextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="hovertext", parent_name="box", **kwargs):
super(HovertextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@box@_hovertext.py@.PATH_END.py |
{
"filename": "test_logarithmic.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/units/tests/test_logarithmic.py",
"type": "Python"
} | # coding: utf-8
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Test the Logarithmic Units and Quantities
"""
from __future__ import (absolute_import, unicode_literals, division,
print_function)
from ...extern import six
from ...extern.six.moves import zip
import pickle... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@units@tests@test_logarithmic.py@.PATH_END.py |
{
"filename": "get_standard.py",
"repo_name": "plazar/coast_guard",
"repo_path": "coast_guard_extracted/coast_guard-master/get_standard.py",
"type": "Python"
} | #!/usr/bin/env python
import sys
import utils
import toas
arf = utils.ArchiveFile(sys.argv[1])
print toas.get_standard(arf, analytic=False)
| plazarREPO_NAMEcoast_guardPATH_START.@coast_guard_extracted@coast_guard-master@get_standard.py@.PATH_END.py |
{
"filename": "config.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/schema/runnable/config.py",
"type": "Python"
} | from langchain_core.runnables.config import (
EmptyDict,
RunnableConfig,
acall_func_with_variable_args,
call_func_with_variable_args,
ensure_config,
get_async_callback_manager_for_config,
get_callback_manager_for_config,
get_config_list,
get_executor_for_config,
merge_configs,
... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@schema@runnable@config.py@.PATH_END.py |
{
"filename": "emulator.ipynb",
"repo_name": "Harry45/DESEMU",
"repo_path": "DESEMU_extracted/DESEMU-main/emulator.ipynb",
"type": "Jupyter Notebook"
} | ```python
import os
import sys
# sys.path.append('/home/harry/Documents/Oxford/Projects/DESEMU/reference/jax-cosmo/jax_cosmo-master/')
from classy import Class # pylint: disable-msg=E0611
from ml_collections.config_dict import ConfigDict
import numpy as np
import jax_cosmo as jc
import jax
import pandas as pd
impor... | Harry45REPO_NAMEDESEMUPATH_START.@DESEMU_extracted@DESEMU-main@emulator.ipynb@.PATH_END.py |
{
"filename": "TestRun_PolNum_split_1spot.py",
"repo_name": "xpsi-group/xpsi",
"repo_path": "xpsi_extracted/xpsi-main/examples/examples_modeling_tutorial/TestRun_PolNum_split_1spot.py",
"type": "Python"
} | '''
Test script with the polarized 3+2 numerical atmosphere applied to a one-spot model.
Prequisities:
Before running the script, add the atmosphere data to the model_data subdirectory:
Bobrikova_compton_slab_I.npz and Bobrikova_compton_slab_Q.npz. See the
example script in xpsi/examples/produce_atmos_lookuptable for ... | xpsi-groupREPO_NAMExpsiPATH_START.@xpsi_extracted@xpsi-main@examples@examples_modeling_tutorial@TestRun_PolNum_split_1spot.py@.PATH_END.py |
{
"filename": "calculator.py",
"repo_name": "NannyML/nannyml",
"repo_path": "nannyml_extracted/nannyml-main/nannyml/data_quality/range/calculator.py",
"type": "Python"
} | # Author: James Nesfield <jamesnesfield@live.com>
#
# License: Apache Software License 2.0
"""Continuous numerical variable range monitor to ensure range supplied is within training bounds."""
from typing import Any, Dict, List, Optional, Union
import numpy as np
import pandas as pd
from pandas import MultiInde... | NannyMLREPO_NAMEnannymlPATH_START.@nannyml_extracted@nannyml-main@nannyml@data_quality@range@calculator.py@.PATH_END.py |
{
"filename": "_tickfont.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/ternary/caxis/_tickfont.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="tickfont", parent_name="layout.ternary.caxis", **kwargs
):
super(TickfontValidator, self).__init__(
plotly_name=plotly_name,
par... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@ternary@caxis@_tickfont.py@.PATH_END.py |
{
"filename": "_tokenizer.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/setuptools/py3/setuptools/_distutils/_vendor/packaging/_tokenizer.py",
"type": "Python"
} | import contextlib
import re
from dataclasses import dataclass
from typing import Dict, Iterator, NoReturn, Optional, Tuple, Union
from .specifiers import Specifier
@dataclass
class Token:
name: str
text: str
position: int
class ParserSyntaxError(Exception):
"""The provided source text could not be ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@setuptools@py3@setuptools@_distutils@_vendor@packaging@_tokenizer.py@.PATH_END.py |
{
"filename": "state.py",
"repo_name": "glue-viz/glue",
"repo_path": "glue_extracted/glue-main/glue/viewers/image/state.py",
"type": "Python"
} | import uuid
from collections import defaultdict
from glue.core import BaseData, Data
from glue.config import colormaps
from glue.viewers.matplotlib.state import (MatplotlibDataViewerState,
MatplotlibLayerState,
DeferredDrawCallbackPr... | glue-vizREPO_NAMEgluePATH_START.@glue_extracted@glue-main@glue@viewers@image@state.py@.PATH_END.py |
{
"filename": "Modifiable.py",
"repo_name": "dokester/BayesicFitting",
"repo_path": "BayesicFitting_extracted/BayesicFitting-master/BayesicFitting/source/Modifiable.py",
"type": "Python"
} | import numpy as numpy
from .Tools import setAttribute as setatt
__author__ = "Do Kester"
__year__ = 2023
__license__ = "GPL3"
__version__ = "3.2.0"
__url__ = "https://www.bayesicfitting.nl"
__status__ = "Perpetual Beta"
# * This file is part of the BayesicFitting package.
# *
# * BayesicFitting is free software: ... | dokesterREPO_NAMEBayesicFittingPATH_START.@BayesicFitting_extracted@BayesicFitting-master@BayesicFitting@source@Modifiable.py@.PATH_END.py |
{
"filename": "_textfont.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/histogram2dcontour/_textfont.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="textfont", parent_name="histogram2dcontour", **kwargs
):
super(TextfontValidator, self).__init__(
plotly_name=plotly_name,
paren... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@histogram2dcontour@_textfont.py@.PATH_END.py |
{
"filename": "metrics.py",
"repo_name": "astrockragh/Mangrove",
"repo_path": "Mangrove_extracted/Mangrove-main/dev/metrics.py",
"type": "Python"
} | from torch import sqrt, sum, square, no_grad, vstack, std, IntTensor
from torch.cuda import FloatTensor
import numpy as np
##################################################
### Could be defined in loop ####
### different funcs to calculate metrics ####
##################################################
... | astrockraghREPO_NAMEMangrovePATH_START.@Mangrove_extracted@Mangrove-main@dev@metrics.py@.PATH_END.py |
{
"filename": "data_inspect_2458141.ipynb",
"repo_name": "HERA-Team/H1C_IDR3_Notebooks",
"repo_path": "H1C_IDR3_Notebooks-main/data_inspect/data_inspect_2458141.ipynb",
"type": "Jupyter Notebook"
} | ```python
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
import matplotlib.patches as mpatches
import matplotlib.gridspec as gridspec
import numpy as np
from pyuvdata import UVCal, UVData
import os
import sys
import glob
import uvtools as uvt
from astropy.time import ... | HERA-TeamREPO_NAMEH1C_IDR3_NotebooksPATH_START.@H1C_IDR3_Notebooks-main@data_inspect@data_inspect_2458141.ipynb@.PATH_END.py |
{
"filename": "make_predictions.sync-checkpoint.ipynb",
"repo_name": "JulioHC00/PEPITA",
"repo_path": "PEPITA_extracted/PEPITA-main/notebooks/tois/.ipynb_checkpoints/make_predictions.sync-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | ```python
## Generate predictions for the radius ratio precision of TESS Objects of Interest (TOIs)
```
## Load required packages
```python
import pandas as pd
import lightkurve as lk
import numpy as np
from IPython.display import display
```
## Select only planet candidates
```python
# Read TOIs table from t... | JulioHC00REPO_NAMEPEPITAPATH_START.@PEPITA_extracted@PEPITA-main@notebooks@tois@.ipynb_checkpoints@make_predictions.sync-checkpoint.ipynb@.PATH_END.py |
{
"filename": "core.py",
"repo_name": "AstarVienna/skycalc_ipy",
"repo_path": "skycalc_ipy_extracted/skycalc_ipy-main/skycalc_ipy/core.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Based on the skycalc_cli package, but heavily modified.
The original code was taken from ``skycalc_cli`` version 1.1.
Credit for ``skycalc_cli`` goes to ESO
"""
import warnings
import hashlib
import json
from os import environ
from datetime import datetime
from pathlib import Path
from co... | AstarViennaREPO_NAMEskycalc_ipyPATH_START.@skycalc_ipy_extracted@skycalc_ipy-main@skycalc_ipy@core.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "spedas/pyspedas",
"repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/rbsp/README.md",
"type": "Markdown"
} |
## Van Allen Probes (RBSP)
The routines in this module can be used to load data from the Van Allen Probes (RBSP) mission.
### Instruments
- Electric and Magnetic Field Instrument Suite and Integrated Science (EMFISIS)
- Electric Field and Waves Suite (EFW)
- Radiation Belt Storm Probes Ion Composition Experiment (RB... | spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@rbsp@README.md@.PATH_END.py |
{
"filename": "concept_shallot.md",
"repo_name": "dmvandamt/beyonce",
"repo_path": "beyonce_extracted/beyonce-main/concept_shallot.md",
"type": "Markdown"
} | # Concept Shallot Explorer
The Shallot Explorer is a module of the BeyonCE (Beyond Common Eclipsers) package used to explore the large parameter space of eclipsing disc systems. From a light curve we have the hard limit of the duration of the eclipse, $\Delta_\mathrm{ecl}$. From there we can think of infinite discs (p... | dmvandamtREPO_NAMEbeyoncePATH_START.@beyonce_extracted@beyonce-main@concept_shallot.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "aewallin/allantools",
"repo_path": "allantools_extracted/allantools-master/allantools/__init__.py",
"type": "Python"
} | __all__ = [
'__version__',
'adev',
'oadev',
'mdev',
'pdev',
'hdev',
'ohdev',
'calc_hdev_phase',
'tdev',
'totdev',
'mtotdev',
'calc_mtotdev_phase',
'ttotdev',
'htotdev',
'calc_htotdev_freq',
'theo1',
'mtie',
'mtie_phase_fast',
'tierms',
'fre... | aewallinREPO_NAMEallantoolsPATH_START.@allantools_extracted@allantools-master@allantools@__init__.py@.PATH_END.py |
{
"filename": "prompts.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/chains/hyde/prompts.py",
"type": "Python"
} | # flake8: noqa
from langchain_core.prompts.prompt import PromptTemplate
web_search_template = """Please write a passage to answer the question
Question: {QUESTION}
Passage:"""
web_search = PromptTemplate(template=web_search_template, input_variables=["QUESTION"])
sci_fact_template = """Please write a scientific paper... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@chains@hyde@prompts.py@.PATH_END.py |
{
"filename": "nifs_main_LP.py",
"repo_name": "jlwalsh12/NIFS-reduction-pipeline",
"repo_path": "NIFS-reduction-pipeline_extracted/NIFS-reduction-pipeline-master/py_scripts/nifs_main_LP.py",
"type": "Python"
} | """
Created on June 11 2018
Author: Jonelle Walsh, Anil Seth, Richard McDermid, etc.
See setup_pipeline.pdf for installation instructions, and
additional_info_nifspipeline_v4.pdf for useage instructions.
To run, go to the rootdir (see below), open pyraf, then type:
---> pyexecute("[pyscriptpath (see below)]/nifs_mai... | jlwalsh12REPO_NAMENIFS-reduction-pipelinePATH_START.@NIFS-reduction-pipeline_extracted@NIFS-reduction-pipeline-master@py_scripts@nifs_main_LP.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "astrorama/SourceXtractorPlusPlus",
"repo_path": "SourceXtractorPlusPlus_extracted/SourceXtractorPlusPlus-master/SEImplementation/python/sourcextractor/config/__init__.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Copyright © 2019-2022 Université de Genève, LMU Munich - Faculty of Physics, IAP-CNRS/Sorbonne Université
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; eith... | astroramaREPO_NAMESourceXtractorPlusPlusPATH_START.@SourceXtractorPlusPlus_extracted@SourceXtractorPlusPlus-master@SEImplementation@python@sourcextractor@config@__init__.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "pmelchior/scarlet",
"repo_path": "scarlet_extracted/scarlet-master/scarlet/lite/__init__.py",
"type": "Python"
} | from .initialization import *
from .models import *
from .parameters import *
from .utils import *
from .measure import *
from . import display | pmelchiorREPO_NAMEscarletPATH_START.@scarlet_extracted@scarlet-master@scarlet@lite@__init__.py@.PATH_END.py |
{
"filename": "read_spectrum.py",
"repo_name": "tomasstolker/species",
"repo_path": "species_extracted/species-main/species/read/read_spectrum.py",
"type": "Python"
} | """
Module with reading functionalities for spectral libraries.
"""
import os
from configparser import ConfigParser
from typing import List, Optional
import h5py
import numpy as np
from typeguard import typechecked
from species.core.box import PhotometryBox, SpectrumBox, create_box
from species.data.spec_data.add_... | tomasstolkerREPO_NAMEspeciesPATH_START.@species_extracted@species-main@species@read@read_spectrum.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/scene/camera/projection/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._type import TypeValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._type.TypeValidator"]
)
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@scene@camera@projection@__init__.py@.PATH_END.py |
{
"filename": "zhaires.py",
"repo_name": "grand-mother/grand",
"repo_path": "grand_extracted/grand-main/grand/simu/shower/zhaires.py",
"type": "Python"
} | """
Extract informations from ZHAires simulation
"""
from __future__ import annotations
from datetime import datetime
from logging import getLogger
from pathlib import Path
import re
from typing import Any, Dict, Optional
import h5py
import numpy
from grand.simu.shower.gen_shower import CollectionEntry, FieldsColle... | grand-motherREPO_NAMEgrandPATH_START.@grand_extracted@grand-main@grand@simu@shower@zhaires.py@.PATH_END.py |
{
"filename": "strategy_gather_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/distribute/strategy_gather_test.py",
"type": "Python"
} | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@distribute@strategy_gather_test.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/violin/unselected/marker/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._size import SizeValidator
from ._opacity import OpacityValidator
from ._color import ColorValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_i... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@violin@unselected@marker@__init__.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/indicator/delta/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._decreasing import Decreasing
from ._font import Font
from ._increasing import Increasing
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__,
[],
["._decreasing.D... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@indicator@delta@__init__.py@.PATH_END.py |
{
"filename": "_family.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/histogram2dcontour/colorbar/title/font/_family.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="family",
parent_name="histogram2dcontour.colorbar.title.font",
**kwargs,
):
super(FamilyValidator, self).__init__(
plotl... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@histogram2dcontour@colorbar@title@font@_family.py@.PATH_END.py |
{
"filename": "_border.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/pointcloud/marker/_border.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Border(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "pointcloud.marker"
_path_str = "pointcloud.marker.border"
_valid_props = {"arearatio", "colo... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@pointcloud@marker@_border.py@.PATH_END.py |
{
"filename": "setup_package.py",
"repo_name": "D-arioSpace/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/ipac/ned/setup_package.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
def get_package_data():
paths_core = [os.path.join('data', 'keywords_dict.json'),
]
paths_test = [os.path.join('data', '*.xml'),
os.path.join('data', '*.fits'),
os.path.join('data... | D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@ipac@ned@setup_package.py@.PATH_END.py |
{
"filename": "tight_layout.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/matplotlib/py2/matplotlib/tight_layout.py",
"type": "Python"
} | """
This module provides routines to adjust subplot params so that subplots are
nicely fit in the figure. In doing so, only axis labels, tick labels, axes
titles and offsetboxes that are anchored to axes are currently considered.
Internally, it assumes that the margins (left_margin, etc.) which are
differences between... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@matplotlib@py2@matplotlib@tight_layout.py@.PATH_END.py |
{
"filename": "CHIMERA_TRANSMISSION_DEMO_WASP43b_JWST-checkpoint.ipynb",
"repo_name": "mrline/CHIMERA",
"repo_path": "CHIMERA_extracted/CHIMERA-master/docs/notebooks/.ipynb_checkpoints/CHIMERA_TRANSMISSION_DEMO_WASP43b_JWST-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | # JWST Transmission/Transit Chemically Consistent Tutorial
Welcome to the JWST transmission spectrum model/retrieval tutorial!
For this particular setup, the atmosphere is parameterized within the "chemically-consistent" framework as described in Kreidberg et al. 2015. The atmospheric composition is parameterized ... | mrlineREPO_NAMECHIMERAPATH_START.@CHIMERA_extracted@CHIMERA-master@docs@notebooks@.ipynb_checkpoints@CHIMERA_TRANSMISSION_DEMO_WASP43b_JWST-checkpoint.ipynb@.PATH_END.py |
{
"filename": "CHANGELOG.md",
"repo_name": "HERA-Team/aipy",
"repo_path": "aipy_extracted/aipy-main/CHANGELOG.md",
"type": "Markdown"
} | # Next version (not yet released)
- Remove `ez_setup` installation infrastructure; it has been deprecated for a
long time.
- Allow installing from empty environment
- Use github actions instead of travis
- Use python3 print()
- Use pytest instead of unittest
- Use explicit numpy types
# 3.0.1 (2019 Aug 21)
- Remov... | HERA-TeamREPO_NAMEaipyPATH_START.@aipy_extracted@aipy-main@CHANGELOG.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/scattergl/marker/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._colorbar import ColorBar
from ._line import Line
from . import colorbar
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [".colorbar"], ["._colorbar.ColorBar", "._line.Line"]... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@scattergl@marker@__init__.py@.PATH_END.py |
{
"filename": "dynamodb.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/chat_message_histories/dynamodb.py",
"type": "Python"
} | from __future__ import annotations
import logging
from typing import TYPE_CHECKING, Dict, List, Optional
from langchain_core.chat_history import BaseChatMessageHistory
from langchain_core.messages import (
BaseMessage,
message_to_dict,
messages_from_dict,
messages_to_dict,
)
if TYPE_CHECKING:
fro... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@chat_message_histories@dynamodb.py@.PATH_END.py |
{
"filename": "maven_kp_to_tplot.py",
"repo_name": "spedas/pyspedas",
"repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/maven/maven_kp_to_tplot.py",
"type": "Python"
} | import logging
import calendar
import numpy as np
from .utilities import maven_kp_l2_regex
from .utilities import maven_param_list
from .utilities import remove_inst_tag
from .utilities import (
get_latest_files_from_date_range,
get_latest_iuvs_files_from_date_range,
)
from .utilities import get_header_info
fro... | spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@maven@maven_kp_to_tplot.py@.PATH_END.py |
{
"filename": "_yaxis.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/histogram2dcontour/_yaxis.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YaxisValidator(_plotly_utils.basevalidators.SubplotidValidator):
def __init__(self, plotly_name="yaxis", parent_name="histogram2dcontour", **kwargs):
super(YaxisValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@histogram2dcontour@_yaxis.py@.PATH_END.py |
{
"filename": "fig5.py",
"repo_name": "JiaxiWu1018/Unsupervised-TRGB",
"repo_path": "Unsupervised-TRGB_extracted/Unsupervised-TRGB-main/plots/fig5.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 3 18:15:02 2022
@author: michaelwu
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
from scipy import linalg
def selection(xx, yy, band):
m, b = band[0], band[1]
xx1 = (yy - b) / m
xx... | JiaxiWu1018REPO_NAMEUnsupervised-TRGBPATH_START.@Unsupervised-TRGB_extracted@Unsupervised-TRGB-main@plots@fig5.py@.PATH_END.py |
{
"filename": "physics.py",
"repo_name": "psheehan/pdspy",
"repo_path": "pdspy_extracted/pdspy-master/pdspy/constants/physics.py",
"type": "Python"
} | c = 2.99792458e10 # cm s^-1
h = 6.6260755e-27 # erg s
hbar = 1.05457266e-27 # erg s
G = 6.67259e-8 # cm^3 g^-1 s^-2
e = 4.8032068e-10 # esu
m_e = 9.1093897e-28 # g
m_p = 1.6726231e-24 # g
m_n = 1.6749286e-24 # g
m_H = 1.6733e-24 # g
amu... | psheehanREPO_NAMEpdspyPATH_START.@pdspy_extracted@pdspy-master@pdspy@constants@physics.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.