metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "analytic_pulse.py",
"repo_name": "nu-radio/NuRadioMC",
"repo_path": "NuRadioMC_extracted/NuRadioMC-master/NuRadioReco/utilities/analytic_pulse.py",
"type": "Python"
} | import numpy as np
import scipy.signal
from NuRadioReco.utilities import fft
from NuRadioReco.utilities import trace_utilities
def amp_from_energy(energy):
"""
energy is defined as the integral of squared voltage normalized to a time window of 128 ns
Parameters
----------
energy:
"""
re... | nu-radioREPO_NAMENuRadioMCPATH_START.@NuRadioMC_extracted@NuRadioMC-master@NuRadioReco@utilities@analytic_pulse.py@.PATH_END.py |
{
"filename": "_lineposition.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter/hoverlabel/font/_lineposition.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LinepositionValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(
self,
plotly_name="lineposition",
parent_name="scatter.hoverlabel.font",
**kwargs,
):
super(LinepositionValidator, self).__init__(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter@hoverlabel@font@_lineposition.py@.PATH_END.py |
{
"filename": "core.py",
"repo_name": "davidharvey1986/pyRRG",
"repo_path": "pyRRG_extracted/pyRRG-master/unittests/bugFixPyRRG/lib/python3.7/site-packages/pip/_vendor/certifi/core.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
certifi.py
~~~~~~~~~~
This module returns the installation location of cacert.pem or its contents.
"""
import os
try:
from importlib.resources import read_text
except ImportError:
# This fallback will work for Python versions prior to 3.7 that lack the
# importlib.resources mo... | davidharvey1986REPO_NAMEpyRRGPATH_START.@pyRRG_extracted@pyRRG-master@unittests@bugFixPyRRG@lib@python3.7@site-packages@pip@_vendor@certifi@core.py@.PATH_END.py |
{
"filename": "main.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/spark/catboost4j-spark/core/src/test/generate_canonical_results/main.py",
"type": "Python"
} | import catboost_classifier_test
import catboost_regressor_test
import feature_importance_test
if __name__ == '__main__':
catboost_classifier_test.main()
catboost_regressor_test.main()
feature_importance_test.main()
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@spark@catboost4j-spark@core@src@test@generate_canonical_results@main.py@.PATH_END.py |
{
"filename": "routing.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/how_to/routing.ipynb",
"type": "Jupyter Notebook"
} | ---
sidebar_position: 3
keywords: [RunnableBranch, LCEL]
---
# How to route between sub-chains
:::info Prerequisites
This guide assumes familiarity with the following concepts:
- [LangChain Expression Language (LCEL)](/docs/concepts/lcel)
- [Chaining runnables](/docs/how_to/sequence/)
- [Configuring chain parameters ... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@how_to@routing.ipynb@.PATH_END.py |
{
"filename": "mightee_inference.py",
"repo_name": "devinamhn/RadioGalaxies-BNNs",
"repo_path": "RadioGalaxies-BNNs_extracted/RadioGalaxies-BNNs-main/radiogalaxies_bnns/eval/mightee/mightee_inference.py",
"type": "Python"
} | import torch
import torchvision.transforms as T
import numpy as np
from PIL import Image
from matplotlib import pyplot as plt
from mpl_toolkits.axes_grid1 import ImageGrid
from cata2data import CataData
from torch.utils.data import DataLoader
from radiogalaxies_bnns.datasets.mightee import MighteeZoo
from radiogalaxi... | devinamhnREPO_NAMERadioGalaxies-BNNsPATH_START.@RadioGalaxies-BNNs_extracted@RadioGalaxies-BNNs-main@radiogalaxies_bnns@eval@mightee@mightee_inference.py@.PATH_END.py |
{
"filename": "test_multiprocessing.py",
"repo_name": "jrenaud90/TidalPy",
"repo_path": "TidalPy_extracted/TidalPy-main/Tests/Test_Old/Test_SetZA_Multiprocessing/test_multiprocessing.py",
"type": "Python"
} | import os
import shutil
import pathlib
import numpy as np
import TidalPy
from TidalPy.utilities.multiprocessing import MultiprocessingInput, MultiprocessingOutput, multiprocessing_run
NUM_PROC = os.cpu_count()
if NUM_PROC is None:
NUM_PROC = 1
def func(dir_, x, y, xname, yname):
return {'test': x + y}
... | jrenaud90REPO_NAMETidalPyPATH_START.@TidalPy_extracted@TidalPy-main@Tests@Test_Old@Test_SetZA_Multiprocessing@test_multiprocessing.py@.PATH_END.py |
{
"filename": "odepack.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/scipy/integrate/odepack.py",
"type": "Python"
} | # Author: Travis Oliphant
from __future__ import division, print_function, absolute_import
__all__ = ['odeint']
from . import _odepack
from copy import copy
import warnings
class ODEintWarning(Warning):
pass
_msgs = {2: "Integration successful.",
1: "Nothing was done; the integration time was 0.",
... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@scipy@integrate@odepack.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattergeo/marker/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(self, plotly_name="color", parent_name="scattergeo.marker", **kwargs):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattergeo@marker@_color.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/mapbox/domain/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._y import YValidator
from ._x import XValidator
from ._row import RowValidator
from ._column import ColumnValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, _... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@mapbox@domain@__init__.py@.PATH_END.py |
{
"filename": "StayingPositive.ipynb",
"repo_name": "rodluger/starry",
"repo_path": "starry_extracted/starry-master/notebooks/StayingPositive.ipynb",
"type": "Jupyter Notebook"
} | # Staying Positive
```python
%matplotlib inline
```
```python
%run notebook_setup.py
```
Unfortunately, there's no trivial way of setting the spherical harmonic coefficients to ensure the map intensity is non-negative everywhere. One helpful thing to keep in mind is that the average intensity across the surface do... | rodlugerREPO_NAMEstarryPATH_START.@starry_extracted@starry-master@notebooks@StayingPositive.ipynb@.PATH_END.py |
{
"filename": "distrans.py",
"repo_name": "itseez/opencv",
"repo_path": "opencv_extracted/opencv-master/samples/python/distrans.py",
"type": "Python"
} | #!/usr/bin/env python
'''
Distance transform sample.
Usage:
distrans.py [<image>]
Keys:
ESC - exit
v - toggle voronoi mode
'''
# Python 2/3 compatibility
from __future__ import print_function
import numpy as np
import cv2 as cv
from common import make_cmap
def main():
import sys
try:
... | itseezREPO_NAMEopencvPATH_START.@opencv_extracted@opencv-master@samples@python@distrans.py@.PATH_END.py |
{
"filename": "tree.py",
"repo_name": "ArjunS07/PUExtraTrees",
"repo_path": "PUExtraTrees_extracted/PUExtraTrees-main/src/PUExtraTrees_ArjunS07_pip/tree.py",
"type": "Python"
} | # PU ExtraTree - A DT Classifier for PU Learning
import numpy as np
import scipy.stats
import scipy.sparse
class PUExtraTree:
def __init__(self, risk_estimator = "nnPU",
loss = "quadratic",
max_depth = None,
min_samples_leaf = 1,
max_features = ... | ArjunS07REPO_NAMEPUExtraTreesPATH_START.@PUExtraTrees_extracted@PUExtraTrees-main@src@PUExtraTrees_ArjunS07_pip@tree.py@.PATH_END.py |
{
"filename": "hist3d.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/galleries/examples/mplot3d/hist3d.py",
"type": "Python"
} | """
==============================
Create 3D histogram of 2D data
==============================
Demo of a histogram for 2D data as a bar graph in 3D.
"""
import matplotlib.pyplot as plt
import numpy as np
# Fixing random state for reproducibility
np.random.seed(19680801)
fig = plt.figure()
ax = fig.add_subplot(pr... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@galleries@examples@mplot3d@hist3d.py@.PATH_END.py |
{
"filename": "download_jp2_set.py",
"repo_name": "Helioviewer-Project/jp2gen",
"repo_path": "jp2gen_extracted/jp2gen-master/py/download_jp2_set.py",
"type": "Python"
} | #
# Download a set of jp2 files from helioviewer
#
import os
import datetime
import astropy.units as u
from sunpy.time import parse_time
from sunpy.net.helioviewer import HelioviewerClient
cadence = 28 * u.day
start_time = parse_time('2010/10/01')
end_time = parse_time('2017/02/01')
hv = HelioviewerClient()
observato... | Helioviewer-ProjectREPO_NAMEjp2genPATH_START.@jp2gen_extracted@jp2gen-master@py@download_jp2_set.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/tsa/statespace/_filters/__init__.py",
"type": "Python"
} | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@tsa@statespace@_filters@__init__.py@.PATH_END.py | |
{
"filename": "_colorsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/bar/hoverlabel/font/_colorsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="colorsrc", parent_name="bar.hoverlabel.font", **kwargs
):
super(ColorsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@bar@hoverlabel@font@_colorsrc.py@.PATH_END.py |
{
"filename": "velocity.py",
"repo_name": "ConorMacBride/mcalf",
"repo_path": "mcalf_extracted/mcalf-main/src/mcalf/visualisation/velocity.py",
"type": "Python"
} | import copy
import astropy.units
import numpy as np
from matplotlib import pyplot as plt
from mcalf.utils.plot import _get_mpl_cmap, calculate_extent
__all__ = ['plot_map']
def plot_map(arr, mask=None, umbra_mask=None, resolution=None, offset=(0, 0), vmin=None, vmax=None,
lw=None, show_colorbar=True, ... | ConorMacBrideREPO_NAMEmcalfPATH_START.@mcalf_extracted@mcalf-main@src@mcalf@visualisation@velocity.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/sunburst/marker/colorbar/tickfont/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._weight import WeightValidator
from ._variant import VariantValidator
from ._textcase import TextcaseValidator
from ._style import StyleValidator
from ._size import SizeValidator
from ._shadow impor... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@sunburst@marker@colorbar@tickfont@__init__.py@.PATH_END.py |
{
"filename": "test_rst.py",
"repo_name": "brandon-rhodes/pyephem",
"repo_path": "pyephem_extracted/pyephem-master/ephem/tests/test_rst.py",
"type": "Python"
} | #!/usr/bin/env python
import datetime
import doctest
import unittest
import os.path
import sys
import time
from glob import glob
class FakeDatetime(datetime.datetime):
@classmethod
def utcnow(cls):
return cls(2015, 12, 14, 15, 42, 14)
FakeDatetime.__name__ = 'datetime.datetime'
def load_tests(loader... | brandon-rhodesREPO_NAMEpyephemPATH_START.@pyephem_extracted@pyephem-master@ephem@tests@test_rst.py@.PATH_END.py |
{
"filename": "datafunc.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/special/utils/datafunc.py",
"type": "Python"
} | import csv
import numpy as np
def parse_txt_data(filename):
f = open(filename)
try:
reader = csv.reader(f, delimiter=',')
data = [list(map(float, row)) for row in reader]
nc = len(data[0])
for i in data:
if not nc == len(i):
raise ValueError(i)
... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@special@utils@datafunc.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/chart-studio/chart_studio/tests/utils.py",
"type": "Python"
} | import copy
from unittest import TestCase
from chart_studio import session, files, utils
from plotly.files import ensure_writable_plotly_dir
class PlotlyTestCase(TestCase):
# parent test case to assist with clean up of local credentials/config
def __init__(self, *args, **kwargs):
self._credentials ... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@chart-studio@chart_studio@tests@utils.py@.PATH_END.py |
{
"filename": "make_stub.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/third_party/xla/third_party/tsl/third_party/implib_so/make_stub.py",
"type": "Python"
} | """Given a list of symbols, generates a stub."""
import argparse
import configparser
import os
import string
from bazel_tools.tools.python.runfiles import runfiles
r = runfiles.Create()
def main():
parser = argparse.ArgumentParser(
description='Generates stubs for CUDA libraries.'
)
parser.add_argument... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@third_party@xla@third_party@tsl@third_party@implib_so@make_stub.py@.PATH_END.py |
{
"filename": "test_astro_ui_fluxes.py",
"repo_name": "sherpa/sherpa",
"repo_path": "sherpa_extracted/sherpa-main/sherpa/astro/ui/tests/test_astro_ui_fluxes.py",
"type": "Python"
} | #
# Copyright (C) 2020, 2021, 2022, 2023
# Smithsonian Astrophysical Observatory
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) ... | sherpaREPO_NAMEsherpaPATH_START.@sherpa_extracted@sherpa-main@sherpa@astro@ui@tests@test_astro_ui_fluxes.py@.PATH_END.py |
{
"filename": "_family.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/funnelarea/title/font/_family.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="family", parent_name="funnelarea.title.font", **kwargs
):
super(FamilyValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@funnelarea@title@font@_family.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/packages/amuse-bhtree/README.md",
"type": "Markdown"
} | This package installs the BHTree community code for AMUSE.
| amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@packages@amuse-bhtree@README.md@.PATH_END.py |
{
"filename": "_ticklabelstep.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/polar/radialaxis/_ticklabelstep.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicklabelstepValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self,
plotly_name="ticklabelstep",
parent_name="layout.polar.radialaxis",
**kwargs,
):
super(TicklabelstepValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@polar@radialaxis@_ticklabelstep.py@.PATH_END.py |
{
"filename": "_aggregations_app.md",
"repo_name": "zooniverse/caesar",
"repo_path": "caesar_extracted/caesar-master/docs/source/includes/_aggregations_app.md",
"type": "Markdown"
} | A list of task-specific outputs is detailed in the sections below.
## Tool specific data
### Question tool
>Sample task data for a simple Question task
```json
"T0": [
{
"task": "T0",
"value": 0,
"taskType": "single"
}
```
The question tool stores the answer in the`value` key, as the index of the answer (f... | zooniverseREPO_NAMEcaesarPATH_START.@caesar_extracted@caesar-master@docs@source@includes@_aggregations_app.md@.PATH_END.py |
{
"filename": "test_half.py",
"repo_name": "numpy/numpy",
"repo_path": "numpy_extracted/numpy-main/numpy/_core/tests/test_half.py",
"type": "Python"
} | import platform
import pytest
import numpy as np
from numpy import uint16, float16, float32, float64
from numpy.testing import assert_, assert_equal, IS_WASM
def assert_raises_fpe(strmatch, callable, *args, **kwargs):
try:
callable(*args, **kwargs)
except FloatingPointError as exc:
assert_(st... | numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@numpy@_core@tests@test_half.py@.PATH_END.py |
{
"filename": "_shadow.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterpolar/legendgrouptitle/font/_shadow.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShadowValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="shadow",
parent_name="scatterpolar.legendgrouptitle.font",
**kwargs,
):
super(ShadowValidator, self).__init__(
plotly_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterpolar@legendgrouptitle@font@_shadow.py@.PATH_END.py |
{
"filename": "test_stat_moments.py",
"repo_name": "Astroua/TurbuStat",
"repo_path": "TurbuStat_extracted/TurbuStat-master/turbustat/tests/test_stat_moments.py",
"type": "Python"
} | # Licensed under an MIT open source license - see LICENSE
from __future__ import print_function, absolute_import, division
import pytest
import numpy as np
import numpy.testing as npt
import astropy.units as u
import os
from ..statistics import StatMoments, StatMoments_Distance
from ._testing_data import \
datas... | AstrouaREPO_NAMETurbuStatPATH_START.@TurbuStat_extracted@TurbuStat-master@turbustat@tests@test_stat_moments.py@.PATH_END.py |
{
"filename": "ImagingReduction.py",
"repo_name": "avigan/SPHERE",
"repo_path": "SPHERE_extracted/SPHERE-master/sphere/IRDIS/ImagingReduction.py",
"type": "Python"
} | import pandas as pd
import subprocess
import logging
import numpy as np
import shutil
import configparser
import collections
from pathlib import Path
from astropy.io import fits
import sphere
import sphere.utils as utils
import sphere.utils.imutils as imutils
import sphere.utils.toolbox as toolbox
import sphere.utils... | aviganREPO_NAMESPHEREPATH_START.@SPHERE_extracted@SPHERE-master@sphere@IRDIS@ImagingReduction.py@.PATH_END.py |
{
"filename": "plotestimators.py",
"repo_name": "artis-mcrt/artistools",
"repo_path": "artistools_extracted/artistools-main/artistools/estimators/plotestimators.py",
"type": "Python"
} | #!/usr/bin/env python3
# PYTHON_ARGCOMPLETE_OK
"""Functions for plotting artis estimators and internal structure.
Examples are temperatures, populations, heating/cooling rates.
"""
import argparse
import contextlib
import math
import string
import typing as t
from collections.abc import Sequence
from itertools import... | artis-mcrtREPO_NAMEartistoolsPATH_START.@artistools_extracted@artistools-main@artistools@estimators@plotestimators.py@.PATH_END.py |
{
"filename": "test_propmptlayer_openai_chat.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/integration_tests/llms/test_propmptlayer_openai_chat.py",
"type": "Python"
} | """Test PromptLayer OpenAIChat API wrapper."""
from pathlib import Path
import pytest
from langchain_community.llms.loading import load_llm
from langchain_community.llms.promptlayer_openai import PromptLayerOpenAIChat
def test_promptlayer_openai_chat_call() -> None:
"""Test valid call to promptlayer openai."""... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@integration_tests@llms@test_propmptlayer_openai_chat.py@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/sankey/link/hoverlabel/_font.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "sankey.link.hoverlabel"
_path_str = "sankey.link.hoverlabel.font"
_valid_props = {
"co... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@sankey@link@hoverlabel@_font.py@.PATH_END.py |
{
"filename": "build_py.py",
"repo_name": "numpy/numpy",
"repo_path": "numpy_extracted/numpy-main/numpy/distutils/command/build_py.py",
"type": "Python"
} | from distutils.command.build_py import build_py as old_build_py
from numpy.distutils.misc_util import is_string
class build_py(old_build_py):
def run(self):
build_src = self.get_finalized_command('build_src')
if build_src.py_modules_dict and self.packages is None:
self.packages = list(... | numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@numpy@distutils@command@build_py.py@.PATH_END.py |
{
"filename": "GW170817_snellius.py",
"repo_name": "ThibeauWouters/TurboPE-BNS",
"repo_path": "TurboPE-BNS_extracted/TurboPE-BNS-main/JS_estimate/GW170817_TaylorF2/varied_runs/GW170817_snellius.py",
"type": "Python"
} | import os
from jimgw.jim import Jim
from jimgw.single_event.detector import H1, L1, V1
from jimgw.single_event.likelihood import HeterodynedTransientLikelihoodFD
from jimgw.single_event.waveform import RippleTaylorF2
from jimgw.prior import Uniform, PowerLaw, Composite
import jax.numpy as jnp
import jax
import time
i... | ThibeauWoutersREPO_NAMETurboPE-BNSPATH_START.@TurboPE-BNS_extracted@TurboPE-BNS-main@JS_estimate@GW170817_TaylorF2@varied_runs@GW170817_snellius.py@.PATH_END.py |
{
"filename": "prepare_input.py",
"repo_name": "daniel-muthukrishna/astrorapid",
"repo_path": "astrorapid_extracted/astrorapid-master/astrorapid/prepare_input.py",
"type": "Python"
} | import numpy as np
from astrorapid.prepare_arrays import PrepareArrays
class PrepareInputArrays(PrepareArrays):
def __init__(self, passbands=('g', 'r'), contextual_info=('redshift',), bcut=True, zcut=None,
nobs=50, mintime=-70, maxtime=80, timestep=3.0):
PrepareArrays.__init__(self, passb... | daniel-muthukrishnaREPO_NAMEastrorapidPATH_START.@astrorapid_extracted@astrorapid-master@astrorapid@prepare_input.py@.PATH_END.py |
{
"filename": "alpha-gamma-approx.ipynb",
"repo_name": "pynucastro/pynucastro",
"repo_path": "pynucastro_extracted/pynucastro-main/docs/source/alpha-gamma-approx.ipynb",
"type": "Jupyter Notebook"
} | # Approximating alpha-capture
pynucastro can use rate approximations for $A(\alpha,\gamma)B$ and $A(\alpha,p)X(p,\gamma)B$,
combining them into a single effective rate by assuming that the protons and nucleus $X$ are in equilibrium.
```python
import pynucastro as pyna
import numpy as np
import matplotlib.pyplot as p... | pynucastroREPO_NAMEpynucastroPATH_START.@pynucastro_extracted@pynucastro-main@docs@source@alpha-gamma-approx.ipynb@.PATH_END.py |
{
"filename": "point_source_cached.py",
"repo_name": "sibirrer/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/lenstronomy/PointSource/point_source_cached.py",
"type": "Python"
} | __all__ = ["PointSourceCached"]
class PointSourceCached(object):
"""This class is the same as PointSource() except that it saves image and source
positions in cache.
This speeds-up repeated calls for the same source and lens model and avoids duplicating the lens equation solving.
Attention: cache nee... | sibirrerREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@lenstronomy@PointSource@point_source_cached.py@.PATH_END.py |
{
"filename": "Long2pos_K_driver.py",
"repo_name": "Keck-DataReductionPipelines/MosfireDRP",
"repo_path": "MosfireDRP_extracted/MosfireDRP-master/drivers/Long2pos_K_driver.py",
"type": "Python"
} |
# Help, bugs to: http://mosfire.googlecode.com
#
# Instructions
# 1. edit band = '' to band = 'Y' or 'J' or 'H' or 'K'
# e.g. band = 'J'
# 2. edit [709, 1350] to be the pixel values at the beginning and end
# of the long slit. Look at the raw data.
# 3. edit row_position to be a location where the s... | Keck-DataReductionPipelinesREPO_NAMEMosfireDRPPATH_START.@MosfireDRP_extracted@MosfireDRP-master@drivers@Long2pos_K_driver.py@.PATH_END.py |
{
"filename": "read_filter.py",
"repo_name": "tomasstolker/species",
"repo_path": "species_extracted/species-main/species/read/read_filter.py",
"type": "Python"
} | """
Module with reading functionalities for filter profiles.
"""
import os
import warnings
from configparser import ConfigParser
from typing import Union, Tuple
import h5py
import numpy as np
from typeguard import typechecked
from scipy.interpolate import interp1d, InterpolatedUnivariateSpline
from species.data.fi... | tomasstolkerREPO_NAMEspeciesPATH_START.@species_extracted@species-main@species@read@read_filter.py@.PATH_END.py |
{
"filename": "_ticklen.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/histogram2dcontour/colorbar/_ticklen.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicklenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="ticklen", parent_name="histogram2dcontour.colorbar", **kwargs
):
super(TicklenValidator, self).__init__(
plotly_name=plotly_name,
p... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@histogram2dcontour@colorbar@_ticklen.py@.PATH_END.py |
{
"filename": "mkran_forffa.py",
"repo_name": "desihub/LSS",
"repo_path": "LSS_extracted/LSS-main/scripts/mock_tools/mkran_forffa.py",
"type": "Python"
} | #standard python
import sys
import os
import shutil
import unittest
from datetime import datetime
import json
import numpy as np
import fitsio
import glob
import argparse
from astropy.table import Table,join,unique,vstack
from matplotlib import pyplot as plt
from desitarget.io import read_targets_in_tiles
from desitarg... | desihubREPO_NAMELSSPATH_START.@LSS_extracted@LSS-main@scripts@mock_tools@mkran_forffa.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "astropy/halotools",
"repo_path": "halotools_extracted/halotools-master/halotools/empirical_models/smhm_models/__init__.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
from .behroozi10 import *
from .moster13 import *
from .zu_mandelbaum15 import *
| astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@halotools@empirical_models@smhm_models@__init__.py@.PATH_END.py |
{
"filename": "beautiful_soup_transformer.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/document_transformers/beautiful_soup_transformer.py",
"type": "Python"
} | from typing import Any, Iterator, List, Sequence, Tuple, Union, cast
from langchain_core.documents import BaseDocumentTransformer, Document
class BeautifulSoupTransformer(BaseDocumentTransformer):
"""Transform HTML content by extracting specific tags and removing unwanted ones.
Example:
.. code-bloc... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@document_transformers@beautiful_soup_transformer.py@.PATH_END.py |
{
"filename": "problem.py",
"repo_name": "hannorein/REBOUND",
"repo_path": "REBOUND_extracted/REBOUND-main/python_examples/dragforce/problem.py",
"type": "Python"
} | # Import the rebound module
import rebound
# Add particles
# We work in units where G=1.
sim = rebound.Simulation()
sim.add(m=1. ) # Test particle
sim.add(m=1e-3,x=1.,vy=1. ) # Planet
# Move particles so that the center of mass is (and stays) at the origin
sim.move_to_com()
# You can provid... | hannoreinREPO_NAMEREBOUNDPATH_START.@REBOUND_extracted@REBOUND-main@python_examples@dragforce@problem.py@.PATH_END.py |
{
"filename": "_unselected.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/violin/_unselected.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Unselected(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "violin"
_path_str = "violin.unselected"
_valid_props = {"marker"}
# marker
# --... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@violin@_unselected.py@.PATH_END.py |
{
"filename": "test_tkmatrix.py",
"repo_name": "PlanetHunters/tkmatrix",
"repo_path": "tkmatrix_extracted/tkmatrix-master/tkmatrix/tests/test_tkmatrix.py",
"type": "Python"
} | import os
import shutil
import unittest
import lcbuilder.constants
import pytest
from lcbuilder.star.starinfo import StarInfo
from tkmatrix.tkmatrix_class import MATRIX
class TestsMatrix(unittest.TestCase):
def test_inject_one(self):
target = "TIC 220513363"
matrix = MATRIX(target, [1], lcbuilde... | PlanetHuntersREPO_NAMEtkmatrixPATH_START.@tkmatrix_extracted@tkmatrix-master@tkmatrix@tests@test_tkmatrix.py@.PATH_END.py |
{
"filename": "rayleigh_spectral_input.py",
"repo_name": "geodynamics/Rayleigh",
"repo_path": "Rayleigh_extracted/Rayleigh-main/pre_processing/rayleigh_spectral_input.py",
"type": "Python"
} | #!/usr/bin/env python3
#
# Copyright (C) 2018 by the authors of the RAYLEIGH code.
#
# This file is part of RAYLEIGH.
#
# RAYLEIGH is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at... | geodynamicsREPO_NAMERayleighPATH_START.@Rayleigh_extracted@Rayleigh-main@pre_processing@rayleigh_spectral_input.py@.PATH_END.py |
{
"filename": "LTE_module.py",
"repo_name": "claude-bertout/SLIM2",
"repo_path": "SLIM2_extracted/SLIM2-main/LTE_module.py",
"type": "Python"
} | """
Module name : LTE_module
This module computes the LTE electron density and level populations for
known total number density and temperature distribution.
Solar composition is assumed.
Electron donor metals taken into account: C, Si, Fe, Mg, Ni, Cr, Ca, Na, K.
Caution: only one ionization level of the above elements... | claude-bertoutREPO_NAMESLIM2PATH_START.@SLIM2_extracted@SLIM2-main@LTE_module.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "astropy/halotools",
"repo_path": "halotools_extracted/halotools-master/halotools/empirical_models/__init__.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .model_defaults import *
from .model_helpers import *
from .factories import *
from .assembias_models import *
from .phase_space_models imp... | astropyREPO_NAMEhalotoolsPATH_START.@halotools_extracted@halotools-master@halotools@empirical_models@__init__.py@.PATH_END.py |
{
"filename": "MakeFakeImage.py",
"repo_name": "jah1994/PyTorchDIA",
"repo_path": "PyTorchDIA_extracted/PyTorchDIA-master/MakeFakeImage.py",
"type": "Python"
} | import numpy as np
def make_noiseless_image(shape, positions, fluxes, sky, psf_sigma):
"""
Make one image.
"""
fluxes_in_stamp = []
img = np.zeros(shape)
img += sky
nx, ny = shape
xg, yg = np.meshgrid(range(nx), range(ny))
for pos, f in zip(positions, fluxes):
#print(pos[0],... | jah1994REPO_NAMEPyTorchDIAPATH_START.@PyTorchDIA_extracted@PyTorchDIA-master@MakeFakeImage.py@.PATH_END.py |
{
"filename": "_line.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/shape/_line.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LineValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="line", parent_name="layout.shape", **kwargs):
super(LineValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@shape@_line.py@.PATH_END.py |
{
"filename": "_ids.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/table/_ids.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class IdsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="ids", parent_name="table", **kwargs):
super(IdsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@table@_ids.py@.PATH_END.py |
{
"filename": "_marker.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/choroplethmap/selected/_marker.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Marker(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "choroplethmap.selected"
_path_str = "choroplethmap.selected.marker"
_valid_props = {"opacity... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@choroplethmap@selected@_marker.py@.PATH_END.py |
{
"filename": "bedrock_anthropic_callback.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/callbacks/bedrock_anthropic_callback.py",
"type": "Python"
} | import threading
from typing import Any, Dict, List, Union
from langchain_core.callbacks import BaseCallbackHandler
from langchain_core.outputs import LLMResult
MODEL_COST_PER_1K_INPUT_TOKENS = {
"anthropic.claude-instant-v1": 0.0008,
"anthropic.claude-v2": 0.008,
"anthropic.claude-v2:1": 0.008,
"anth... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@callbacks@bedrock_anthropic_callback.py@.PATH_END.py |
{
"filename": "mag.md",
"repo_name": "tamarervin/SolAster",
"repo_path": "SolAster_extracted/SolAster-main/mkdocs/docs/calcs/mag.md",
"type": "Markdown"
} | # Calculation of Solar Magnetic Observables
Using HMI magnetograms, we are able to calculate magnetic observables that
both correlate with each other as well as the velocity features. This shows
how the magnetic activity is driving the radial velocity variations.
## Filling Factor
**Disk averaged filling factors ... | tamarervinREPO_NAMESolAsterPATH_START.@SolAster_extracted@SolAster-main@mkdocs@docs@calcs@mag.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/isosurface/colorbar/tickfont/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._weight import WeightValidator
from ._variant import VariantValidator
from ._textcase import TextcaseValidator
from ._style import StyleValidator
from ._size import SizeValidator
from ._shadow impor... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@isosurface@colorbar@tickfont@__init__.py@.PATH_END.py |
{
"filename": "11818_pils_maxlen.py",
"repo_name": "shreeyesh-biswal/Rvalue_3D",
"repo_path": "Rvalue_3D_extracted/Rvalue_3D-main/Codes/M-class/AR_11818/11818_pils_maxlen.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 5 22:55:01 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 = "11818"
core_dir = "/home/shreeyeshbiswal/IDLWorkspace/Dataset_PF/"
... | shreeyesh-biswalREPO_NAMERvalue_3DPATH_START.@Rvalue_3D_extracted@Rvalue_3D-main@Codes@M-class@AR_11818@11818_pils_maxlen.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "msiebert1/UCSC_spectral_pipeline",
"repo_path": "UCSC_spectral_pipeline_extracted/UCSC_spectral_pipeline-master/spectral_reduction/tmath/wombat/__init__.py",
"type": "Python"
} | HOPSIZE=20
from .getch import getch
from .inputter import inputter
from .inputter_single import inputter_single
from .inputter_single_mix import inputter_single_mix
from .yesno import yesno
from .airtovac import airtovac
from .wommkatmdisp import wommkatmdisp
from .womhop import womhop
from .womrdhop import womrdhop
fr... | msiebert1REPO_NAMEUCSC_spectral_pipelinePATH_START.@UCSC_spectral_pipeline_extracted@UCSC_spectral_pipeline-master@spectral_reduction@tmath@wombat@__init__.py@.PATH_END.py |
{
"filename": "extensions.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/ops/numpy_ops/tests/extensions.py",
"type": "Python"
} | # Copyright 2023 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@ops@numpy_ops@tests@extensions.py@.PATH_END.py |
{
"filename": "tfsa-2021-082.md",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/security/advisory/tfsa-2021-082.md",
"type": "Markdown"
} | ## TFSA-2021-082: Division by zero in TFLite's convolution code
### CVE Number
CVE-2021-29594
### Impact
TFLite's [convolution
code](https://github.com/tensorflow/tensorflow/blob/09c73bca7d648e961dd05898292d91a8322a9d45/tensorflow/lite/kernels/conv.cc)
has multiple division where the divisor is controlled by the user... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@security@advisory@tfsa-2021-082.md@.PATH_END.py |
{
"filename": "unstructured_mesh.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/yt/data_objects/index_subobjects/unstructured_mesh.py",
"type": "Python"
} | import numpy as np
from yt.data_objects.selection_objects.data_selection_objects import (
YTSelectionContainer,
)
from yt.funcs import mylog
from yt.utilities.lib.mesh_utilities import fill_fcoords, fill_fwidths
class UnstructuredMesh(YTSelectionContainer):
# This is a base class, not meant to be used direct... | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@data_objects@index_subobjects@unstructured_mesh.py@.PATH_END.py |
{
"filename": "_xaxis.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatter/_xaxis.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XaxisValidator(_plotly_utils.basevalidators.SubplotidValidator):
def __init__(self, plotly_name="xaxis", parent_name="scatter", **kwargs):
super(XaxisValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
d... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatter@_xaxis.py@.PATH_END.py |
{
"filename": "tool.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/tools/metaphor_search/tool.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import MetaphorSearchResults
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DE... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@tools@metaphor_search@tool.py@.PATH_END.py |
{
"filename": "full_lrs2_reduction.py",
"repo_name": "grzeimann/Panacea",
"repo_path": "Panacea_extracted/Panacea-master/full_lrs2_reduction.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 4 13:30:06 2018
@author: gregz
"""
import numpy as np
import fnmatch
import os.path as op
import os
import glob
import sys
import warnings
import tarfile
import argparse as ap
import requests
import uuid
from datetime import datetime, timedelta
from astropy.io.votable i... | grzeimannREPO_NAMEPanaceaPATH_START.@Panacea_extracted@Panacea-master@full_lrs2_reduction.py@.PATH_END.py |
{
"filename": "_export.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/sklearn/tree/_export.py",
"type": "Python"
} | """
This module defines export functions for decision trees.
"""
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
from collections.abc import Iterable
from io import StringIO
from numbers import Integral
import numpy as np
from ..base import is_classifier
from ..utils._param_validation... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@sklearn@tree@_export.py@.PATH_END.py |
{
"filename": "root_listeners.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/core/langchain_core/tracers/root_listeners.py",
"type": "Python"
} | from collections.abc import Awaitable
from typing import Callable, Optional, Union
from uuid import UUID
from langchain_core.runnables.config import (
RunnableConfig,
acall_func_with_variable_args,
call_func_with_variable_args,
)
from langchain_core.tracers.base import AsyncBaseTracer, BaseTracer
from lang... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@core@langchain_core@tracers@root_listeners.py@.PATH_END.py |
{
"filename": "setopt.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/setuptools/py2/setuptools/command/setopt.py",
"type": "Python"
} | from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsOptionError
import distutils
import os
from setuptools.extern.six.moves import configparser
from setuptools import Command
__all__ = ['config_file', 'edit_config', 'option_base', 'setopt']
def config_file(kind="... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@setuptools@py2@setuptools@command@setopt.py@.PATH_END.py |
{
"filename": "limb_darkening.py",
"repo_name": "ladsantos/flatstar",
"repo_path": "flatstar_extracted/flatstar-main/flatstar/limb_darkening.py",
"type": "Python"
} | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module is used to compute the limb-darkening functions of stars.
"""
import numpy as np
__all__ = ["linear", "quadratic", "square_root", "logarithmic", "exponential",
"sing_three", "claret_four"]
# Schwarzschild (1906; Nachrichten von der Königlich... | ladsantosREPO_NAMEflatstarPATH_START.@flatstar_extracted@flatstar-main@flatstar@limb_darkening.py@.PATH_END.py |
{
"filename": "default_layout.py",
"repo_name": "nu-radio/NuRadioMC",
"repo_path": "NuRadioMC_extracted/NuRadioMC-master/NuRadioReco/eventbrowser/default_layout.py",
"type": "Python"
} | default_layout = {
'margin': {
't': 15
},
'showlegend': True
}
efield_plot_colors = [
['rgb(91, 179, 240)', 'rgb(31, 119, 180)'],
['rgb(255, 187, 94)', 'rgb(255, 127, 14)'],
['rgb(104, 220, 104)', 'rgb(44, 160, 44)'],
['rgb(255, 99, 100)', 'rgb(214, 39, 40)'],
['rgb(208, 163, 24... | nu-radioREPO_NAMENuRadioMCPATH_START.@NuRadioMC_extracted@NuRadioMC-master@NuRadioReco@eventbrowser@default_layout.py@.PATH_END.py |
{
"filename": "plotit.py",
"repo_name": "bolverk/huji-rich",
"repo_path": "huji-rich_extracted/huji-rich-master/tests/newtonian/one_dimensional/pure_advection_2o/plotit.py",
"type": "Python"
} | import pylab
import numpy
import re
import sys
import Tkinter
import glob
pref = re.sub(r'/[^/]*$','',sys.argv[0])
n = len(glob.glob(pref+'/center_list.[0-9]+.txt'))
if len(sys.argv)>1:
val = int(sys.argv[1])
else:
val = n
x_list = numpy.loadtxt(pref+'/center_list.'+str(val)+'.txt')
d_list = numpy.loadtxt(p... | bolverkREPO_NAMEhuji-richPATH_START.@huji-rich_extracted@huji-rich-master@tests@newtonian@one_dimensional@pure_advection_2o@plotit.py@.PATH_END.py |
{
"filename": "_textcase.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattergeo/textfont/_textcase.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextcaseValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="textcase", parent_name="scattergeo.textfont", **kwargs
):
super(TextcaseValidator, self).__init__(
plotly_name=plotly_name,
pa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattergeo@textfont@_textcase.py@.PATH_END.py |
{
"filename": "_sizemode.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterpolargl/marker/_sizemode.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizemodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="sizemode", parent_name="scatterpolargl.marker", **kwargs
):
super(SizemodeValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterpolargl@marker@_sizemode.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/tests/test_optional/test_kaleido/__init__.py",
"type": "Python"
} | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@tests@test_optional@test_kaleido@__init__.py@.PATH_END.py | |
{
"filename": "test_mapmaking.py",
"repo_name": "litebird/litebird_sim",
"repo_path": "litebird_sim_extracted/litebird_sim-master/test/test_mapmaking.py",
"type": "Python"
} | # -*- encoding: utf-8 -*-
import numpy as np
from litebird_sim.mapmaking.common import cholesky, solve_cholesky, estimate_cond_number
def _generate_random_positive_definite_matrix(
N: int, random: np.random.Generator
) -> np.ndarray:
"""Return a random 3×3 matrix that is symmetric and positive definite"""
... | litebirdREPO_NAMElitebird_simPATH_START.@litebird_sim_extracted@litebird_sim-master@test@test_mapmaking.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "j-faria/kima",
"repo_path": "kima_extracted/kima-master/eigen/unsupported/Eigen/CXX11/src/Tensor/README.md",
"type": "Markdown"
} | # Eigen Tensors {#eigen_tensors}
Tensors are multidimensional arrays of elements. Elements are typically scalars,
but more complex types such as strings are also supported.
[TOC]
## Tensor Classes
You can manipulate a tensor with one of the following classes. They all are in
the namespace `::Eigen.`
### Class Te... | j-fariaREPO_NAMEkimaPATH_START.@kima_extracted@kima-master@eigen@unsupported@Eigen@CXX11@src@Tensor@README.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/cycler/py3/cycler/__init__.py",
"type": "Python"
} | """
Cycler
======
Cycling through combinations of values, producing dictionaries.
You can add cyclers::
from cycler import cycler
cc = (cycler(color=list('rgb')) +
cycler(linestyle=['-', '--', '-.']))
for d in cc:
print(d)
Results in::
{'color': 'r', 'linestyle': '-'}
{'color'... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@cycler@py3@cycler@__init__.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "segasai/rvspecfit",
"repo_path": "rvspecfit_extracted/rvspecfit-master/docs/conf.py",
"type": "Python"
} | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | segasaiREPO_NAMErvspecfitPATH_START.@rvspecfit_extracted@rvspecfit-master@docs@conf.py@.PATH_END.py |
{
"filename": "test_experiment.py",
"repo_name": "FRBs/FRB",
"repo_path": "FRB_extracted/FRB-main/frb/tests/test_experiment.py",
"type": "Python"
} | # Module to run tests on instantiating FRBObs
from __future__ import print_function, absolute_import, division, unicode_literals
# TEST_UNICODE_LITERALS
import pytest
import os
from frb.experiment import Experiment
#def data_path(filename):
# data_dir = os.path.join(os.path.dirname(__file__), 'files')
# retur... | FRBsREPO_NAMEFRBPATH_START.@FRB_extracted@FRB-main@frb@tests@test_experiment.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "simonsobs/apluggy",
"repo_path": "apluggy_extracted/apluggy-main/tests/stack/aexit/__init__.py",
"type": "Python"
} | simonsobsREPO_NAMEapluggyPATH_START.@apluggy_extracted@apluggy-main@tests@stack@aexit@__init__.py@.PATH_END.py | |
{
"filename": "G__l_a_t.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/fonttools/fontTools/ttLib/tables/G__l_a_t.py",
"type": "Python"
} | from fontTools.misc import sstruct
from fontTools.misc.fixedTools import floatToFixedToStr
from fontTools.misc.textTools import safeEval
# from itertools import *
from functools import partial
from . import DefaultTable
from . import grUtils
import struct
Glat_format_0 = """
> # big endian
version: 16... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@fonttools@fontTools@ttLib@tables@G__l_a_t.py@.PATH_END.py |
{
"filename": "kinematics_2d.py",
"repo_name": "bek0s/gbkfit",
"repo_path": "gbkfit_extracted/gbkfit-master/src/gbkfit/model/gmodels/kinematics_2d.py",
"type": "Python"
} |
from collections.abc import Sequence
from gbkfit.model.core import GModelSCube
from gbkfit.utils import iterutils, parseutils
from . import _detail
from .core import SpectralComponent2D
from .spectral_smdisk_2d import SpectralSMDisk2D
__all__ = [
'GModelKinematics2D'
]
_scmp_parser = parseutils.TypedParser(Sp... | bek0sREPO_NAMEgbkfitPATH_START.@gbkfit_extracted@gbkfit-master@src@gbkfit@model@gmodels@kinematics_2d.py@.PATH_END.py |
{
"filename": "fit_imaging.py",
"repo_name": "Jammy2211/PyAutoLens",
"repo_path": "PyAutoLens_extracted/PyAutoLens-main/autolens/aggregator/fit_imaging.py",
"type": "Python"
} | from typing import Optional, List
import autofit as af
import autoarray as aa
from autolens.imaging.fit_imaging import FitImaging
from autolens.analysis.preloads import Preloads
from autogalaxy.aggregator.imaging.imaging import _imaging_from
from autogalaxy.aggregator.dataset_model import _dataset_model_from
from au... | Jammy2211REPO_NAMEPyAutoLensPATH_START.@PyAutoLens_extracted@PyAutoLens-main@autolens@aggregator@fit_imaging.py@.PATH_END.py |
{
"filename": "eep.py",
"repo_name": "timothydmorton/isochrones",
"repo_path": "isochrones_extracted/isochrones-master/isochrones/mist/eep.py",
"type": "Python"
} | def default_max_eep(mass):
"""For MIST v1.2
"""
if mass < 0.6:
return 454
elif mass == 0.6:
return 605
elif mass == 0.65:
return 808
elif mass < 6.0:
return 1710
else:
return 808
def max_eep(mass, feh):
"""For MIST v1.2
"""
eep = None
... | timothydmortonREPO_NAMEisochronesPATH_START.@isochrones_extracted@isochrones-master@isochrones@mist@eep.py@.PATH_END.py |
{
"filename": "api.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/yt/analysis_modules/particle_trajectories/api.py",
"type": "Python"
} | raise RuntimeError(
"Particle trajectories are now available from DatasetSeries "
"objects as ts.particle_trajectories. The ParticleTrajectories "
"analysis module has been removed."
)
| rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@yt@analysis_modules@particle_trajectories@api.py@.PATH_END.py |
{
"filename": "update_vds_paths.py",
"repo_name": "SWIFTSIM/SOAP",
"repo_path": "SOAP_extracted/SOAP-master/update_vds_paths.py",
"type": "Python"
} | #!/bin/env python
import sys
import h5py
import numpy as np
import os.path
def update_vds_paths(dset, modify_function):
"""
Modify the virtual paths of the specified dataset
Note that querying the source dataspace and selection does not appear
to work (invalid pointer error from h5py) so here we ass... | SWIFTSIMREPO_NAMESOAPPATH_START.@SOAP_extracted@SOAP-master@update_vds_paths.py@.PATH_END.py |
{
"filename": "_width.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/shape/line/_width.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="width", parent_name="layout.shape.line", **kwargs):
super(WidthValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@shape@line@_width.py@.PATH_END.py |
{
"filename": "sync.py",
"repo_name": "mpi4py/mpi4py",
"repo_path": "mpi4py_extracted/mpi4py-master/src/mpi4py/util/sync.py",
"type": "Python"
} | # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
"""Synchronization utilities."""
import array as _array
import time as _time
from .. import MPI
__all__ = [
"Sequential",
"Counter",
"Mutex",
"Condition",
"Semaphore",
]
class Sequential:
"""Sequential execution."""
def __init__(se... | mpi4pyREPO_NAMEmpi4pyPATH_START.@mpi4py_extracted@mpi4py-master@src@mpi4py@util@sync.py@.PATH_END.py |
{
"filename": "setjy.py",
"repo_name": "RTIP/artip",
"repo_path": "artip_extracted/artip-master/casa_scripts/setjy.py",
"type": "Python"
} | import sys
script_parameters_start_index = sys.argv.index('-c') + 2
parameters = sys.argv[script_parameters_start_index:]
spw = parameters[0]
ms_dataset = parameters[1]
field = parameters[2]
model_path = parameters[3]
setjy(vis=ms_dataset, field=field, spw=spw, modimage=model_path, usescratch=True) | RTIPREPO_NAMEartipPATH_START.@artip_extracted@artip-master@casa_scripts@setjy.py@.PATH_END.py |
{
"filename": "_borderwidth.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattermapbox/marker/colorbar/_borderwidth.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BorderwidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="borderwidth",
parent_name="scattermapbox.marker.colorbar",
**kwargs,
):
super(BorderwidthValidator, self).__init__(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattermapbox@marker@colorbar@_borderwidth.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "hahnec/torchimize",
"repo_path": "torchimize_extracted/torchimize-master/tests/__init__.py",
"type": "Python"
} | hahnecREPO_NAMEtorchimizePATH_START.@torchimize_extracted@torchimize-master@tests@__init__.py@.PATH_END.py | |
{
"filename": "pse.py",
"repo_name": "GalSim-developers/GalSim",
"repo_path": "GalSim_extracted/GalSim-main/galsim/pse.py",
"type": "Python"
} | # Copyright (c) 2012-2023 by the GalSim developers team on GitHub
# https://github.com/GalSim-developers
#
# This file is part of GalSim: The modular galaxy image simulation toolkit.
# https://github.com/GalSim-developers/GalSim
#
# GalSim is free software: redistribution and use in source and binary forms,
# with or w... | GalSim-developersREPO_NAMEGalSimPATH_START.@GalSim_extracted@GalSim-main@galsim@pse.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "enthought/mayavi",
"repo_path": "mayavi_extracted/mayavi-master/tvtk/util/__init__.py",
"type": "Python"
} | # Author: Prabhu Ramachandran
# Copyright (c) 2006, Enthought, Inc.
# License: BSD Style.
| enthoughtREPO_NAMEmayaviPATH_START.@mayavi_extracted@mayavi-master@tvtk@util@__init__.py@.PATH_END.py |
{
"filename": "tables_dict.py",
"repo_name": "rbuehler/vasca",
"repo_path": "vasca_extracted/vasca-main/vasca/tables_dict.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Defines dictionary for the tables used by vasca.tables.TableCollection
"""
# %% dtype guidelines
#
# >np.finfo(np.float16)
# >finfo(resolution=0.001, min=-6.55040e+04, max=6.55040e+04, dtype=float16)
#
# >np.finfo(np.float32)
# >finfo(resolution=1e-06, min=-3.4028235e+... | rbuehlerREPO_NAMEvascaPATH_START.@vasca_extracted@vasca-main@vasca@tables_dict.py@.PATH_END.py |
{
"filename": "setup_package.py",
"repo_name": "StingraySoftware/stingray",
"repo_path": "stingray_extracted/stingray-main/stingray/tests/setup_package.py",
"type": "Python"
} | StingraySoftwareREPO_NAMEstingrayPATH_START.@stingray_extracted@stingray-main@stingray@tests@setup_package.py@.PATH_END.py | |
{
"filename": "2. Plot Spectral Index Error.ipynb",
"repo_name": "mlarichardson/CosmosCanvas",
"repo_path": "CosmosCanvas_extracted/CosmosCanvas-main/2. Plot Spectral Index Error.ipynb",
"type": "Jupyter Notebook"
} | # Making an Spectral Index Error Plot with Increasing Chroma.
This notebook is Tutorial 2 of the [```CosmosCanvas```](https://github.com/mlarichardson/CosmosCanvas) package. This Python 3 tutorial highlights the creation of a perception-based colour map designed for plotting spectral index error data. See Tutorial 1 f... | mlarichardsonREPO_NAMECosmosCanvasPATH_START.@CosmosCanvas_extracted@CosmosCanvas-main@2. Plot Spectral Index Error.ipynb@.PATH_END.py |
{
"filename": "_hovertextsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattermap/_hovertextsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HovertextsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="hovertextsrc", parent_name="scattermap", **kwargs):
super(HovertextsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_n... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattermap@_hovertextsrc.py@.PATH_END.py |
{
"filename": "bdist_rpm.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/setuptools/py2/setuptools/command/bdist_rpm.py",
"type": "Python"
} | import distutils.command.bdist_rpm as orig
class bdist_rpm(orig.bdist_rpm):
"""
Override the default bdist_rpm behavior to do the following:
1. Run egg_info to ensure the name and version are properly calculated.
2. Always run 'install' using --single-version-externally-managed to
disable eggs... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@setuptools@py2@setuptools@command@bdist_rpm.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.