metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "_tickvals.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/coloraxis/colorbar/_tickvals.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickvalsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self, plotly_name="tickvals", parent_name="layout.coloraxis.colorbar", **kwargs
):
super(TickvalsValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@coloraxis@colorbar@_tickvals.py@.PATH_END.py |
{
"filename": "test_ps_run.py",
"repo_name": "valboz/RTModel",
"repo_path": "RTModel_extracted/RTModel-main/tests/end_to_end_tests/test_ps_run.py",
"type": "Python"
} | import tempfile
import zipfile
from pathlib import Path
from RTModel import RTModel
def test_ps_run():
temporary_directory = Path(tempfile.gettempdir())
event_zip_path = Path(__file__).parent.joinpath('test_ps_run_resources/example_event.zip')
with zipfile.ZipFile(event_zip_path, 'r') as zip_file_handle:... | valbozREPO_NAMERTModelPATH_START.@RTModel_extracted@RTModel-main@tests@end_to_end_tests@test_ps_run.py@.PATH_END.py |
{
"filename": "_x.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/contour/colorbar/_x.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="x", parent_name="contour.colorbar", **kwargs):
super(XValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_ty... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@contour@colorbar@_x.py@.PATH_END.py |
{
"filename": "retrieve_fake_data.py",
"repo_name": "ideasrule/platon",
"repo_path": "platon_extracted/platon-master/misc/retrieve_fake_data.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
import corner
from platon.fit_info import FitInfo
from platon.transit_depth_calculator import TransitDepthCalculator
from platon.retriever import Retriever
Rs = 7e8
g = 9.8
Rp = 7.14e7
logZ = 0
CO = 0.53
log_cloudtop_P = 3
temperature = 1200
depth_calculator = Tran... | ideasruleREPO_NAMEplatonPATH_START.@platon_extracted@platon-master@misc@retrieve_fake_data.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "ebachelet/pyLIMA",
"repo_path": "pyLIMA_extracted/pyLIMA-master/pyLIMA/outputs/__init__.py",
"type": "Python"
} | ebacheletREPO_NAMEpyLIMAPATH_START.@pyLIMA_extracted@pyLIMA-master@pyLIMA@outputs@__init__.py@.PATH_END.py | |
{
"filename": "_size.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter/selected/marker/_size.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="size", parent_name="scatter.selected.marker", **kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter@selected@marker@_size.py@.PATH_END.py |
{
"filename": "tests.py",
"repo_name": "plazar/TOASTER",
"repo_path": "TOASTER_extracted/TOASTER-master/webtoaster/app/tests.py",
"type": "Python"
} | """
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
... | plazarREPO_NAMETOASTERPATH_START.@TOASTER_extracted@TOASTER-master@webtoaster@app@tests.py@.PATH_END.py |
{
"filename": "_pattern.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/barpolar/marker/_pattern.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Pattern(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "barpolar.marker"
_path_str = "barpolar.marker.pattern"
_valid_props = {
"bgcolor",
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@barpolar@marker@_pattern.py@.PATH_END.py |
{
"filename": "generate_toml.py",
"repo_name": "j0r1/GRALE2",
"repo_path": "GRALE2_extracted/GRALE2-master/pygrale/grale_editor_cppqt/generate_toml.py",
"type": "Python"
} | #!/usr/bin/env python
import sys
import site
import pprint
import os
import subprocess
import glob
import platform
template = '''
# Specify sip v6 as the build system for the package.
[build-system]
requires = ["sip >=6, <7", "PyQt-builder >=1.9, <2" ]
build-backend = "sipbuild.api"
# Specify the PEP 566 metadata for... | j0r1REPO_NAMEGRALE2PATH_START.@GRALE2_extracted@GRALE2-master@pygrale@grale_editor_cppqt@generate_toml.py@.PATH_END.py |
{
"filename": "zero_shot_GPT_4o.ipynb",
"repo_name": "dtanoglidis/zero-shot-astro",
"repo_path": "zero-shot-astro_extracted/zero-shot-astro-main/zero_shot_GPT_4o.ipynb",
"type": "Jupyter Notebook"
} | ## **Zero-shot image classficiation with GPT-4o**
We perform zero-shot classification of astronomical images using the proprietary GPT-4o Large Multimodal Model, accessed through openAI's API
[Introducting GPT-4o](https://openai.com/index/hello-gpt-4o/)
We use two different datasets:
- LSBGs vs Artifacts, from [Tan... | dtanoglidisREPO_NAMEzero-shot-astroPATH_START.@zero-shot-astro_extracted@zero-shot-astro-main@zero_shot_GPT_4o.ipynb@.PATH_END.py |
{
"filename": "index.md",
"repo_name": "ultralytics/ultralytics",
"repo_path": "ultralytics_extracted/ultralytics-main/docs/en/guides/index.md",
"type": "Markdown"
} | ---
comments: true
description: Master YOLO with Ultralytics tutorials covering training, deployment and optimization. Find solutions, improve metrics, and deploy with ease!.
keywords: Ultralytics, YOLO, tutorials, guides, object detection, deep learning, PyTorch, training, deployment, optimization, computer vision
---... | ultralyticsREPO_NAMEultralyticsPATH_START.@ultralytics_extracted@ultralytics-main@docs@en@guides@index.md@.PATH_END.py |
{
"filename": "plot_photxerror.py",
"repo_name": "splus-collab/codes-dr4-paper",
"repo_path": "codes-dr4-paper_extracted/codes-dr4-paper-main/codes/plot_photxerror.py",
"type": "Python"
} | #!/usr/bin/env python3
import argparse
import os
import glob
import matplotlib.pyplot as plt
import pandas as pd
import dask.dataframe as dd
import itertools
import multiprocessing as mp
import numpy as np
os.environ["DASK_MEMORY_LIMIT"] = "32G"
def load_args():
"""Parse command line arguments."""
parser = ... | splus-collabREPO_NAMEcodes-dr4-paperPATH_START.@codes-dr4-paper_extracted@codes-dr4-paper-main@codes@plot_photxerror.py@.PATH_END.py |
{
"filename": "makeMassFunctionPlotsCCL.py",
"repo_name": "simonsobs/nemo",
"repo_path": "nemo_extracted/nemo-main/examples/SOSims/validationScripts/makeMassFunctionPlotsCCL.py",
"type": "Python"
} | """
Plot the mass function in z bins.
Range adjusted to drop the last bin, which is more incomplete in the sense that it may not cover that
full mass bin (whereas all other bins are guaranteed to by definition).
"""
import os
import sys
import astropy.table as atpy
import astropy.io.fits as pyfits
import IPython
im... | simonsobsREPO_NAMEnemoPATH_START.@nemo_extracted@nemo-main@examples@SOSims@validationScripts@makeMassFunctionPlotsCCL.py@.PATH_END.py |
{
"filename": "_x.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/streamtube/lightposition/_x.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="x", parent_name="streamtube.lightposition", **kwargs
):
super(XValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@streamtube@lightposition@_x.py@.PATH_END.py |
{
"filename": "timezones.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/_plotly_future_/timezones.py",
"type": "Python"
} | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@_plotly_future_@timezones.py@.PATH_END.py | |
{
"filename": "A03compare_triggers.py",
"repo_name": "nu-radio/NuRadioMC",
"repo_path": "NuRadioMC_extracted/NuRadioMC-master/NuRadioReco/examples/StandAloneScripts/A03compare_triggers.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
import logging
from NuRadioReco.utilities import units
import NuRadioReco.framework.channel
import NuRadioReco.framework.station
import NuRadioReco.framework.event
import NuRadioReco.modules.channelResampler
import NuRadioReco.modules.channelGenericNoiseAdder
import Nu... | nu-radioREPO_NAMENuRadioMCPATH_START.@NuRadioMC_extracted@NuRadioMC-master@NuRadioReco@examples@StandAloneScripts@A03compare_triggers.py@.PATH_END.py |
{
"filename": "_stream.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/icicle/_stream.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Stream(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "icicle"
_path_str = "icicle.stream"
_valid_props = {"maxpoints", "token"}
# maxpoints
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@icicle@_stream.py@.PATH_END.py |
{
"filename": "_title.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/choroplethmap/colorbar/_title.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TitleValidator(_plotly_utils.basevalidators.TitleValidator):
def __init__(
self, plotly_name="title", parent_name="choroplethmap.colorbar", **kwargs
):
super(TitleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@choroplethmap@colorbar@_title.py@.PATH_END.py |
{
"filename": "_family.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattermap/marker/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="scattermap.marker.colorbar.title.font",
**kwargs,
):
super(FamilyValidator, self).__init__(
plotly... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattermap@marker@colorbar@title@font@_family.py@.PATH_END.py |
{
"filename": "ab_initio_solids.py",
"repo_name": "geodynamics/burnman",
"repo_path": "burnman_extracted/burnman-main/misc/benchmarks/ab_initio_solids.py",
"type": "Python"
} | from __future__ import absolute_import
from __future__ import print_function
from burnman.minerals import DKS_2013_solids
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from burnman.tools.eos import check_eos_consistency
"""
SOLIDS
"""
phases = [
[
"stishovite",
... | geodynamicsREPO_NAMEburnmanPATH_START.@burnman_extracted@burnman-main@misc@benchmarks@ab_initio_solids.py@.PATH_END.py |
{
"filename": "prior.py",
"repo_name": "joezuntz/cosmosis",
"repo_path": "cosmosis_extracted/cosmosis-main/cosmosis/runtime/prior.py",
"type": "Python"
} | #coding: utf-8
u"""Implementation of :class:`Prior` and the concrete probability distribution specializations.
The specializations are :class:`UniformPrior`, :class:`GaussianPrior`,
:class:`TruncatedGaussianPrior`, :class:`ExponentialPrior`,
:class:`TruncatedExponentialPrior`, :class:`TruncatedOneoverxPrior`,
and :c... | joezuntzREPO_NAMEcosmosisPATH_START.@cosmosis_extracted@cosmosis-main@cosmosis@runtime@prior.py@.PATH_END.py |
{
"filename": "kin_likelihood.py",
"repo_name": "sibirrer/hierArc",
"repo_path": "hierArc_extracted/hierArc-main/hierarc/Likelihood/LensLikelihood/kin_likelihood.py",
"type": "Python"
} | __author__ = "sibirrer"
from lenstronomy.Util import constants as const
import numpy as np
class KinLikelihood(object):
"""Likelihood to deal with IFU kinematics constraints with covariances in both the
model and measured velocity dispersion."""
def __init__(
self,
z_lens,
z_sour... | sibirrerREPO_NAMEhierArcPATH_START.@hierArc_extracted@hierArc-main@hierarc@Likelihood@LensLikelihood@kin_likelihood.py@.PATH_END.py |
{
"filename": "_easing.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/transition/_easing.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class EasingValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="easing", parent_name="layout.transition", **kwargs):
super(EasingValidator, 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@layout@transition@_easing.py@.PATH_END.py |
{
"filename": "test_sdes.py",
"repo_name": "AlexandreAdam/score_models",
"repo_path": "score_models_extracted/score_models-master/tests/test_sdes.py",
"type": "Python"
} | from score_models.sde import VESDE, VPSDE, TSVESDE
import numpy as np
import torch
def get_trajectories(sde, B=10, N=100, x0=5):
dt = 1/N
t = torch.zeros(B) + sde.epsilon
x0 = torch.ones(B) * x0
x = torch.clone(x0)
trajectories = [x]
marginal_samples = [x]
for step in range(N):
t +=... | AlexandreAdamREPO_NAMEscore_modelsPATH_START.@score_models_extracted@score_models-master@tests@test_sdes.py@.PATH_END.py |
{
"filename": "downloader_tools.py",
"repo_name": "henrysky/astroNN",
"repo_path": "astroNN_extracted/astroNN-master/src/astroNN/shared/downloader_tools.py",
"type": "Python"
} | # ---------------------------------------------------------#
# astroNN.shared.downloader_tools: shared download tools
# ---------------------------------------------------------#
import hashlib
from tqdm import tqdm
class TqdmUpTo(tqdm):
"""
NAME:
sha256_checksum
PURPOSE:
Provides `upd... | henryskyREPO_NAMEastroNNPATH_START.@astroNN_extracted@astroNN-master@src@astroNN@shared@downloader_tools.py@.PATH_END.py |
{
"filename": "_offsetgroup.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/funnel/_offsetgroup.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OffsetgroupValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="offsetgroup", parent_name="funnel", **kwargs):
super(OffsetgroupValidator, 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@funnel@_offsetgroup.py@.PATH_END.py |
{
"filename": "analysis.py",
"repo_name": "erusseil/MvSR-analysis",
"repo_path": "MvSR-analysis_extracted/MvSR-analysis-main/analysis.py",
"type": "Python"
} | import numpy as np
import sys, os
import csv
import mvsr as mvsr
import shutil
import json
import pandas as pd
import pyoperon as Operon
import time
import sympy as sp
from sympy import sin, exp, sqrt, log, Abs
import string
import re
from sympy import symbols, lambdify
from iminuit import Minuit
from iminuit.cost impo... | erusseilREPO_NAMEMvSR-analysisPATH_START.@MvSR-analysis_extracted@MvSR-analysis-main@analysis.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "astropy/photutils",
"repo_path": "photutils_extracted/photutils-main/photutils/aperture/__init__.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains tools to perform aperture photometry.
"""
from .bounding_box import * # noqa: F401, F403
from .circle import * # noqa: F401, F403
from .converters import * # noqa: F401, F403
from .core import * # noqa: F401, F403
from .el... | astropyREPO_NAMEphotutilsPATH_START.@photutils_extracted@photutils-main@photutils@aperture@__init__.py@.PATH_END.py |
{
"filename": "composite_tensor_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/framework/composite_tensor_test.py",
"type": "Python"
} | # Copyright 2019 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@framework@composite_tensor_test.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "hahnec/torchimize",
"repo_path": "torchimize_extracted/torchimize-master/setup.py",
"type": "Python"
} | #!/usr/bin/env python
__author__ = "Christopher Hahne"
__email__ = "inbox@christopherhahne.de"
__license__ = """
Copyright (c) 2022 Christopher Hahne <inbox@christopherhahne.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publ... | hahnecREPO_NAMEtorchimizePATH_START.@torchimize_extracted@torchimize-master@setup.py@.PATH_END.py |
{
"filename": "webgl-text-and-annotations.md",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/doc/unconverted/python/webgl-text-and-annotations.md",
"type": "Markdown"
} | ---
jupyter:
jupytext:
notebook_metadata_filter: all
text_representation:
extension: .md
format_name: markdown
format_version: '1.1'
jupytext_version: 1.1.1
kernelspec:
display_name: Python 2
language: python
name: python2
plotly:
description: How to add webGL based... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@doc@unconverted@python@webgl-text-and-annotations.md@.PATH_END.py |
{
"filename": "test_rectangle.py",
"repo_name": "macrocosme/shwirl",
"repo_path": "shwirl_extracted/shwirl-master/shwirl/extern/vispy/visuals/tests/test_rectangle.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Tests for RectPolygonVisual
All images are of size (100,100) to keep a small file size
"""
from vispy.scene import visuals, transforms
from vispy.testing import (requires_application, TestingCanvas,
run_tests_if_main, raises)
from vispy.testing.image_tester impor... | macrocosmeREPO_NAMEshwirlPATH_START.@shwirl_extracted@shwirl-master@shwirl@extern@vispy@visuals@tests@test_rectangle.py@.PATH_END.py |
{
"filename": "test.py",
"repo_name": "bolverk/huji-rich",
"repo_path": "huji-rich_extracted/huji-rich-master/convergence/simple_waves_2d/lagrangian_second_order/test.py",
"type": "Python"
} | #! /usr/bin/python
def goodness_of_fit(a1, a2):
import math
diff2 = [(x-y)**2 for x,y in zip(a1,a2)]
return math.sqrt(sum(diff2)/(max(a1)-min(a1))/len(a1))
def main():
import numpy
# Simulation results
rawd = numpy.loadtxt('x_prof_initial.txt')
xr0 = rawd[:,0]
dr0 = rawd[:,1]
... | bolverkREPO_NAMEhuji-richPATH_START.@huji-rich_extracted@huji-rich-master@convergence@simple_waves_2d@lagrangian_second_order@test.py@.PATH_END.py |
{
"filename": "misc.py",
"repo_name": "thomasorb/orb",
"repo_path": "orb_extracted/orb-master/orb/utils/misc.py",
"type": "Python"
} | #!/usr/bin/python
# *-* coding: utf-8 *-*
# Author: Thomas Martin <thomas.martin.1@ulaval.ca>
# File: misc.py
## Copyright (c) 2010-2020 Thomas Martin <thomas.martin.1@ulaval.ca>
##
## This file is part of ORB
##
## ORB is free software: you can redistribute it and/or modify it
## under the terms of the GNU General P... | thomasorbREPO_NAMEorbPATH_START.@orb_extracted@orb-master@orb@utils@misc.py@.PATH_END.py |
{
"filename": "_separatethousands.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattergeo/marker/colorbar/_separatethousands.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SeparatethousandsValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name="separatethousands",
parent_name="scattergeo.marker.colorbar",
**kwargs,
):
super(SeparatethousandsValidator, self).__ini... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattergeo@marker@colorbar@_separatethousands.py@.PATH_END.py |
{
"filename": "image_array.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/yt/data_objects/image_array.py",
"type": "Python"
} | import numpy as np
from unyt import unyt_array
from yt.config import ytcfg
from yt.visualization.image_writer import write_bitmap, write_image
class ImageArray(unyt_array):
r"""A custom Numpy ndarray used for images.
This differs from ndarray in that you can optionally specify an
info dictionary which i... | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@data_objects@image_array.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "gammapy/gammapy",
"repo_path": "gammapy_extracted/gammapy-main/gammapy/visualization/utils.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import logging as log
import numpy as np
from scipy.interpolate import CubicSpline
from scipy.optimize import curve_fit
from scipy.stats import norm
from astropy.visualization import make_lupton_rgb
import matplotlib.axes as maxes
import matplotlib.pyplot ... | gammapyREPO_NAMEgammapyPATH_START.@gammapy_extracted@gammapy-main@gammapy@visualization@utils.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "projectchrono/chrono",
"repo_path": "chrono_extracted/chrono-main/data/vehicle/M113_RS/README.md",
"type": "Markdown"
} | ----------------------------------------------------
Test M113 variant with REAR sprocket and FRONT idler
----------------------------------------------------
The data for the M113 model implemented in these JSON files was obtained from the following publicly available sources:
- M. Wallin, A.K. Aboubakr, P. Jayakuma... | projectchronoREPO_NAMEchronoPATH_START.@chrono_extracted@chrono-main@data@vehicle@M113_RS@README.md@.PATH_END.py |
{
"filename": "mms_tai2unix.py",
"repo_name": "spedas/pyspedas",
"repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/mms/mms_tai2unix.py",
"type": "Python"
} | import datetime
import numpy as np
from pyspedas.utilities.leap_seconds import load_leap_table
def mms_tai2unix(values):
"""
Converts MMS timestamps in TAI to unix timestamps
Based on Mitsuo Oka's IDL code with the same name.
Input
---------
values: float, list of floats or np.ndarray
... | spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@mms@mms_tai2unix.py@.PATH_END.py |
{
"filename": "lightcone.ipynb",
"repo_name": "sambit-giri/tools21cm",
"repo_path": "tools21cm_extracted/tools21cm-master/docs/examples/lightcone.ipynb",
"type": "Jupyter Notebook"
} | # Light-cone construction
```python
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
import tools21cm as t2c
import warnings
warnings.filterwarnings("ignore")
```
Here we create a fake dataset of coeval cubes which consist of three growing spherical HII regions. The radius is defined using ... | sambit-giriREPO_NAMEtools21cmPATH_START.@tools21cm_extracted@tools21cm-master@docs@examples@lightcone.ipynb@.PATH_END.py |
{
"filename": "analysis.py",
"repo_name": "dynamics-of-stellar-systems/dynamite",
"repo_path": "dynamite_extracted/dynamite-master/dynamite/analysis.py",
"type": "Python"
} | import os
import logging
import numpy as np
import matplotlib.pyplot as plt
from plotbin.display_pixels import display_pixels
import cmasher as cmr
import astropy
import dynamite as dyn
class Decomposition:
"""
Class for decomposition.
Upon instatiating, the orbits are decomposed by the method
``deco... | dynamics-of-stellar-systemsREPO_NAMEdynamitePATH_START.@dynamite_extracted@dynamite-master@dynamite@analysis.py@.PATH_END.py |
{
"filename": "utils_spec.py",
"repo_name": "justyncw/STAR_MELT",
"repo_path": "STAR_MELT_extracted/STAR_MELT-main/utils_spec.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 19 19:05:15 2019
@author: jcampbellwhite001
"""
import time
import pandas as pd
import numpy as np
import astropy.constants
from astropy.time import Time
from astropy.coordinates import SkyCoord, EarthLocation
import astropy.units as u
from scipy.int... | justyncwREPO_NAMESTAR_MELTPATH_START.@STAR_MELT_extracted@STAR_MELT-main@utils_spec.py@.PATH_END.py |
{
"filename": "test_lasso.py",
"repo_name": "hjens/lasso_spectra",
"repo_path": "lasso_spectra_extracted/lasso_spectra-master/tests/test_lasso.py",
"type": "Python"
} | import pylab as pl
import numpy as np
import sys
sys.path.append('..')
import generalized_lasso as gl
import lasso
# Data generation
def get_test_model(n_features=100):
'''
Return a linear function with n_features random
coefficients plus noise
'''
b = np.random.random()*4.
coeffs = np.random... | hjensREPO_NAMElasso_spectraPATH_START.@lasso_spectra_extracted@lasso_spectra-master@tests@test_lasso.py@.PATH_END.py |
{
"filename": "performance.ipynb",
"repo_name": "google/flax",
"repo_path": "flax_extracted/flax-main/docs_nnx/guides/performance.ipynb",
"type": "Jupyter Notebook"
} | # Performance considerations
Currently, Flax [`nnx.jit`](https://flax.readthedocs.io/en/latest/api_reference/flax.nnx/transforms.html#flax.nnx.jit) traverses the object graph in pure Python, which is slow and adds overhead. This is why in order to solve this the Flax team will be developing a Rust extension called `fl... | googleREPO_NAMEflaxPATH_START.@flax_extracted@flax-main@docs_nnx@guides@performance.ipynb@.PATH_END.py |
{
"filename": "gaussian_mixture.py",
"repo_name": "CobayaSampler/cobaya",
"repo_path": "cobaya_extracted/cobaya-master/cobaya/likelihoods/gaussian_mixture/gaussian_mixture.py",
"type": "Python"
} | """
.. module:: likelihoods.gaussian_mixture
:Synopsis: Gaussian mixture likelihood
:Author: Jesus Torrado
"""
# Global
from typing import Any
import numpy as np
from scipy.stats import multivariate_normal, uniform, random_correlation
from scipy.special import logsumexp
# Local
from cobaya.likelihood import Likeliho... | CobayaSamplerREPO_NAMEcobayaPATH_START.@cobaya_extracted@cobaya-master@cobaya@likelihoods@gaussian_mixture@gaussian_mixture.py@.PATH_END.py |
{
"filename": "test_sanitize_center.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/yt/geometry/coordinates/tests/test_sanitize_center.py",
"type": "Python"
} | import re
import pytest
from unyt import unyt_array
from unyt.exceptions import UnitConversionError
from yt.testing import fake_amr_ds
@pytest.fixture(scope="module")
def reusable_fake_dataset():
ds = fake_amr_ds(
fields=[("gas", "density")],
units=["g/cm**3"],
)
return ds
valid_single... | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@yt@geometry@coordinates@tests@test_sanitize_center.py@.PATH_END.py |
{
"filename": "svhn.py",
"repo_name": "pytorch/vision",
"repo_path": "vision_extracted/vision-main/torchvision/datasets/svhn.py",
"type": "Python"
} | import os.path
from pathlib import Path
from typing import Any, Callable, Optional, Tuple, Union
import numpy as np
from PIL import Image
from .utils import check_integrity, download_url, verify_str_arg
from .vision import VisionDataset
class SVHN(VisionDataset):
"""`SVHN <http://ufldl.stanford.edu/housenumbers... | pytorchREPO_NAMEvisionPATH_START.@vision_extracted@vision-main@torchvision@datasets@svhn.py@.PATH_END.py |
{
"filename": "skip_deprecated.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/doc/sphinxext/skip_deprecated.py",
"type": "Python"
} | # Skip deprecated members
def skip_deprecated(app, what, name, obj, skip, options):
if skip:
return skip
skipped = {"matplotlib.colors": ["ColorConverter", "hex2color", "rgb2hex"]}
skip_list = skipped.get(getattr(obj, "__module__", None))
if skip_list is not None:
return getattr(obj, "... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@doc@sphinxext@skip_deprecated.py@.PATH_END.py |
{
"filename": "dsi2j2000.py",
"repo_name": "spedas/pyspedas",
"repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/erg/satellite/erg/common/cotrans/dsi2j2000.py",
"type": "Python"
} | import numpy as np
from pyspedas import tinterpol
from pytplot import tcrossp
from pytplot import tnormalize
from pyspedas.cotrans_tools.cotrans import cotrans
from pytplot import time_string
from pytplot import get_data, get_timespan, options, store_data, tplot_names
from ...orb.orb import orb
from .cart_trans_matrix... | spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@erg@satellite@erg@common@cotrans@dsi2j2000.py@.PATH_END.py |
{
"filename": "node.py",
"repo_name": "crossbario/crossbar",
"repo_path": "crossbar_extracted/crossbar-master/crossbar/edge/node/node.py",
"type": "Python"
} | ##############################################################################
#
# Crossbar.io
# Copyright (C) Crossbar.io Technologies GmbH. All rights reserved.
#
##############################################################################
import sys
import os
import json
import pkg_reso... | crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@crossbar@edge@node@node.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "spicy-oil/hfs_fit",
"repo_path": "hfs_fit_extracted/hfs_fit-master/README.md",
"type": "Markdown"
} | # hfs_fit
**A python fitting program for atomic emission lines with hyperfine structure (HFS).**
**It has nice sliders for parameters to change the fit visually, useful when HFS constants are unknown.**
<img src="data/z3P2---a3D3 (spectrum.txt).png">
# Quickstart
* requires python 3.6 or higher
* run `pip install -... | spicy-oilREPO_NAMEhfs_fitPATH_START.@hfs_fit_extracted@hfs_fit-master@README.md@.PATH_END.py |
{
"filename": "markdown-notebooks.ipynb",
"repo_name": "exo-cesm/CESM2.1.3",
"repo_path": "CESM2.1.3_extracted/CESM2.1.3-main/_build/html/_sources/markdown-notebooks.ipynb",
"type": "Jupyter Notebook"
} | # Notebooks with MyST Markdown
Jupyter Book also lets you write text-based notebooks using MyST Markdown.
See [the Notebooks with MyST Markdown documentation](https://jupyterbook.org/file-types/myst-notebooks.html) for more detailed instructions.
This page shows off a notebook written in MyST Markdown.
## An example ... | exo-cesmREPO_NAMECESM2.1.3PATH_START.@CESM2.1.3_extracted@CESM2.1.3-main@_build@html@_sources@markdown-notebooks.ipynb@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/funnel/legendgrouptitle/font/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="funnel.legendgrouptitle.font", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@funnel@legendgrouptitle@font@_color.py@.PATH_END.py |
{
"filename": "_size.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/hoverlabel/grouptitlefont/_size.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="size",
parent_name="layout.hoverlabel.grouptitlefont",
**kwargs,
):
super(SizeValidator, self).__init__(
plotly_name=plotl... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@hoverlabel@grouptitlefont@_size.py@.PATH_END.py |
{
"filename": "FS.py",
"repo_name": "rat-pac/rat-pac",
"repo_path": "rat-pac_extracted/rat-pac-master/python/SCons/Node/FS.py",
"type": "Python"
} | """scons.Node.FS
File system nodes.
These Nodes represent the canonical external objects that people think
of when they think of building software: files and directories.
This holds a "default_fs" variable that should be initialized with an FS
that can be used by scripts or modules looking for the canonical default.... | rat-pacREPO_NAMErat-pacPATH_START.@rat-pac_extracted@rat-pac-master@python@SCons@Node@FS.py@.PATH_END.py |
{
"filename": "graph.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scikit-learn/py2/sklearn/neighbors/graph.py",
"type": "Python"
} | """Nearest Neighbors graph functions"""
# Author: Jake Vanderplas <vanderplas@astro.washington.edu>
#
# License: BSD 3 clause (C) INRIA, University of Amsterdam
from .base import KNeighborsMixin, RadiusNeighborsMixin
from .unsupervised import NearestNeighbors
def _check_params(X, metric, p, metric_params):
"""C... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scikit-learn@py2@sklearn@neighbors@graph.py@.PATH_END.py |
{
"filename": "fit_begin_and_end.py",
"repo_name": "cjekel/piecewise_linear_fit_py",
"repo_path": "piecewise_linear_fit_py_extracted/piecewise_linear_fit_py-master/examples/tf/fit_begin_and_end.py",
"type": "Python"
} | # fit and predict between a known begging and known ending
# import our libraries
import numpy as np
import matplotlib.pyplot as plt
import pwlf
from scipy.optimize import differential_evolution
# your data
y = np.array([0.00000000e+00, 9.69801700e-03, 2.94350340e-02,
4.39052750e-02, 5.45343950e-02, 6.7... | cjekelREPO_NAMEpiecewise_linear_fit_pyPATH_START.@piecewise_linear_fit_py_extracted@piecewise_linear_fit_py-master@examples@tf@fit_begin_and_end.py@.PATH_END.py |
{
"filename": "_maxpoints.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/volume/stream/_maxpoints.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MaxpointsValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="maxpoints", parent_name="volume.stream", **kwargs):
super(MaxpointsValidator, 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@volume@stream@_maxpoints.py@.PATH_END.py |
{
"filename": "mms_curl.py",
"repo_name": "spedas/pyspedas",
"repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/mms/fgm/mms_curl.py",
"type": "Python"
} | import logging
import math
import numpy as np
from pytplot import get_data, store_data, options
from pyspedas import tinterpol
def mms_curl(fields=None, positions=None, suffix=''):
"""
This function applies the curlometer technique to MMS FGM data
Parameters
----------
fields : list of st... | spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@mms@fgm@mms_curl.py@.PATH_END.py |
{
"filename": "test_thomson.py",
"repo_name": "PlasmaPy/PlasmaPy",
"repo_path": "PlasmaPy_extracted/PlasmaPy-main/tests/diagnostics/test_thomson.py",
"type": "Python"
} | """
Tests for Thomson scattering analysis functions
"""
import copy
import astropy.constants as const
import astropy.units as u
import numpy as np
import pytest
from lmfit import Parameter, Parameters
from plasmapy.diagnostics import thomson
from plasmapy.particles import Particle, particle_mass
from plasmapy.partic... | PlasmaPyREPO_NAMEPlasmaPyPATH_START.@PlasmaPy_extracted@PlasmaPy-main@tests@diagnostics@test_thomson.py@.PATH_END.py |
{
"filename": "for_blog.py",
"repo_name": "eggplantbren/DNest4",
"repo_path": "DNest4_extracted/DNest4-master/code/Templates/Builder/for_blog.py",
"type": "Python"
} | import numpy as np
import dnest4.builder as bd
data = {"x": np.array([1.0, 2.0, 3.0, 4.0, 5.0]),\
"y": np.array([1.0, 2.0, 3.0, 3.9, 5.1]),\
"N": 5}
# Create the model
model = bd.Model()
# Slope and intercept
model.add_node(bd.Node("m", bd.Uniform(-100.0, 100.0)))
model.add_node(bd.Node("b", bd.Unifo... | eggplantbrenREPO_NAMEDNest4PATH_START.@DNest4_extracted@DNest4-master@code@Templates@Builder@for_blog.py@.PATH_END.py |
{
"filename": "drs_utils.py",
"repo_name": "njcuk9999/apero-drs",
"repo_path": "apero-drs_extracted/apero-drs-main/apero/core/utils/drs_utils.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
APERO core utility and miscellaneous functionality
Created on 2020-10-2020-10-05 17:43
@author: cook
"""
from collections import OrderedDict
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Union
import numpy as np
import pandas as pd
f... | njcuk9999REPO_NAMEapero-drsPATH_START.@apero-drs_extracted@apero-drs-main@apero@core@utils@drs_utils.py@.PATH_END.py |
{
"filename": "resource_sharer.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/tools/python3/Lib/multiprocessing/resource_sharer.py",
"type": "Python"
} | #
# We use a background thread for sharing fds on Unix, and for sharing sockets on
# Windows.
#
# A client which wants to pickle a resource registers it with the resource
# sharer and gets an identifier in return. The unpickling process will connect
# to the resource sharer, sends the identifier and its pid, and then ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@python3@Lib@multiprocessing@resource_sharer.py@.PATH_END.py |
{
"filename": "config_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/third_party/xla/xla/python/config_test.py",
"type": "Python"
} | # Copyright 2024 The OpenXLA Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@third_party@xla@xla@python@config_test.py@.PATH_END.py |
{
"filename": "customtags.py",
"repo_name": "lsst-uk/lasair-lsst",
"repo_path": "lasair-lsst_extracted/lasair-lsst-main/webserver/lasair/templatetags/customtags.py",
"type": "Python"
} | from django import template
register = template.Library()
@register.filter
def keyvalue(dict, key):
try:
return dict[key]
except KeyError:
return ''
@register.filter
def replace(value, arg):
"""
Replacing filter
Use `{{ "aaa"|replace:"a|b" }}`
"""
if len(arg.split('|')) ... | lsst-ukREPO_NAMElasair-lsstPATH_START.@lasair-lsst_extracted@lasair-lsst-main@webserver@lasair@templatetags@customtags.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/scene/yaxis/title/font/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._size import SizeValidator
from ._family import FamilyValidator
from ._color import ColorValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__,
[],
["._siz... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@scene@yaxis@title@font@__init__.py@.PATH_END.py |
{
"filename": "antenna_state.py",
"repo_name": "RTIP/artip",
"repo_path": "artip_extracted/artip-master/src/main/python/models/antenna_state.py",
"type": "Python"
} | from antenna_status import AntennaStatus
class AntennaState:
def __init__(self, antenna_id, polarization, scan_id):
self.antenna = antenna_id
self.scan_id = scan_id
self.polarization = polarization
self.__closure_phase_status = None
self.__R_phase_status = None
def upda... | RTIPREPO_NAMEartipPATH_START.@artip_extracted@artip-master@src@main@python@models@antenna_state.py@.PATH_END.py |
{
"filename": "Albedo_module.py",
"repo_name": "joshuakt/Oxygen-False-Positives",
"repo_path": "Oxygen-False-Positives_extracted/Oxygen-False-Positives-main/Albedo_module.py",
"type": "Python"
} | import numpy as np
def AB_fun(Tsurf,pH2O,volatile_mass,AL,AH):
if pH2O/1e5<1:
TA = 1000.0
else:
TA = 1000 + 200*np.log10(pH2O/1e5)**2
AB_atmo = 0.5*(AL-AH) * np.tanh((TA-Tsurf)/400.0) + 0.5*(AH+AL)
return AB_atmo
| joshuaktREPO_NAMEOxygen-False-PositivesPATH_START.@Oxygen-False-Positives_extracted@Oxygen-False-Positives-main@Albedo_module.py@.PATH_END.py |
{
"filename": "makeplot.py",
"repo_name": "VirtualPlanetaryLaboratory/vplanet",
"repo_path": "vplanet_extracted/vplanet-main/examples/CosmicShoreline/makeplot.py",
"type": "Python"
} | import os
import pathlib
import subprocess
import sys
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import vplot as vpl
from matplotlib.ticker import MaxNLocator
from mpl_toolkits.axes_grid1 import make_axes_locatable
import vplanet
path = pathlib.Path(__file__).parents[0].absolute()
sy... | VirtualPlanetaryLaboratoryREPO_NAMEvplanetPATH_START.@vplanet_extracted@vplanet-main@examples@CosmicShoreline@makeplot.py@.PATH_END.py |
{
"filename": "4. Parallax errors.ipynb",
"repo_name": "gaia-unlimited/gaiaunlimited",
"repo_path": "gaiaunlimited_extracted/gaiaunlimited-main/docs/notebooks/Aurora/4. Parallax errors.ipynb",
"type": "Jupyter Notebook"
} | # 4. Parallax errors
```python
import os
import pathlib
import numpy as np
from scipy.interpolate import splrep, splev, BSpline
import pandas as pd
from astroquery.gaia import Gaia
import config
```
hpx_order=7 --> (hpx_nside=128, hpx_npix=196608)
```python
cache_path = pathlib.Path(config.cache_path)
cach... | gaia-unlimitedREPO_NAMEgaiaunlimitedPATH_START.@gaiaunlimited_extracted@gaiaunlimited-main@docs@notebooks@Aurora@4. Parallax errors.ipynb@.PATH_END.py |
{
"filename": "train.py",
"repo_name": "google/flax",
"repo_path": "flax_extracted/flax-main/examples/wmt/train.py",
"type": "Python"
} | # Copyright 2024 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | googleREPO_NAMEflaxPATH_START.@flax_extracted@flax-main@examples@wmt@train.py@.PATH_END.py |
{
"filename": "test_pathloss.py",
"repo_name": "spacetelescope/jwst",
"repo_path": "jwst_extracted/jwst-main/jwst/pathloss/tests/test_pathloss.py",
"type": "Python"
} | """
Unit tests for pathloss correction
"""
from stdatamodels.jwst.datamodels import MultiSlitModel, PathlossModel
from jwst.pathloss.pathloss import (calculate_pathloss_vector,
get_aperture_from_model,
get_center,
... | spacetelescopeREPO_NAMEjwstPATH_START.@jwst_extracted@jwst-main@jwst@pathloss@tests@test_pathloss.py@.PATH_END.py |
{
"filename": "2022_07_21_205820_0cf7311d6ea6_add_crashed_state_type.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/prefect/server/database/_migrations/versions/postgresql/2022_07_21_205820_0cf7311d6ea6_add_crashed_state_type.py",
"type": "Python"
} | """Add Crashed state type
Revision ID: 0cf7311d6ea6
Revises: bb4dc90d3e29
Create Date: 2022-07-21 20:58:20.807489
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "0cf7311d6ea6"
down_revision = "bb4dc90d3e29"
branch_labels = None
depends_on = None
def upgrade():
op.execute("ALTER... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@server@database@_migrations@versions@postgresql@2022_07_21_205820_0cf7311d6ea6_add_crashed_state_type.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "adrn/thejoker",
"repo_path": "thejoker_extracted/thejoker-main/docs/conf.py",
"type": "Python"
} | import importlib.metadata
import os
project = "thejoker"
copyright = "2024, Adrian Price-Whelan"
author = "Adrian Price-Whelan"
version = release = importlib.metadata.version("thejoker")
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"nb... | adrnREPO_NAMEthejokerPATH_START.@thejoker_extracted@thejoker-main@docs@conf.py@.PATH_END.py |
{
"filename": "irafukey.py",
"repo_name": "iraf-community/pyraf",
"repo_path": "pyraf_extracted/pyraf-main/pyraf/irafukey.py",
"type": "Python"
} | """
implement IRAF ukey functionality
"""
import os
import sys
import termios
from . import wutil
from .tools import capable, irafutils
# This class emulates the IRAF ukey parameter mechanism. IRAF calls for
# a ukey parameter and expects that the user will type a character in
# response. The value of this character... | iraf-communityREPO_NAMEpyrafPATH_START.@pyraf_extracted@pyraf-main@pyraf@irafukey.py@.PATH_END.py |
{
"filename": "definitions.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/yt/frontends/_skeleton/definitions.py",
"type": "Python"
} | # This file is often empty. It can hold definitions related to a frontend.
| rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@yt@frontends@_skeleton@definitions.py@.PATH_END.py |
{
"filename": "AnIsochrone.py",
"repo_name": "jobovy/isodist",
"repo_path": "isodist_extracted/isodist-main/isodist/AnIsochrone.py",
"type": "Python"
} | import os, os.path
import csv
import math
import numpy
import gzip
from isodist.Isochrone import Isochrone, FEH2Z, Z2FEH, dict2recarray
from isodist.PadovaIsochrone import _DATADIR
_ANZSOLAR= 0.0176
_ZS= [-0.1,-0.2,-0.3,-0.5,-1.,-1.5,-2.,-3.,0.,0.1,0.2,0.4]
class AnIsochrone (Isochrone):
"""Class that represents a ... | jobovyREPO_NAMEisodistPATH_START.@isodist_extracted@isodist-main@isodist@AnIsochrone.py@.PATH_END.py |
{
"filename": "_tempita.py",
"repo_name": "numpy/numpy",
"repo_path": "numpy_extracted/numpy-main/numpy/_build_utils/tempita/_tempita.py",
"type": "Python"
} | """
A small templating language
This implements a small templating language. This language implements
if/elif/else, for/continue/break, expressions, and blocks of Python
code. The syntax is::
{{any expression (function calls etc)}}
{{any expression | filter}}
{{for x in y}}...{{endfor}}
{{if x}}x{{elif y}}y... | numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@numpy@_build_utils@tempita@_tempita.py@.PATH_END.py |
{
"filename": "XID+example_run_script_SED.ipynb",
"repo_name": "H-E-L-P/XID_plus",
"repo_path": "XID_plus_extracted/XID_plus-master/docs/notebooks/examples/XID+example_run_script_SED.ipynb",
"type": "Jupyter Notebook"
} | # XID+ Example Run Script
(This is based on a Jupyter notebook, available in the [XID+ package](https://github.com/H-E-L-P/XID_plus/tree/master/docs/notebooks/examples/) and can be interactively run and edited)
XID+ is a probababilistic deblender for confusion dominated maps. It is designed to:
1. Use a MCMC based a... | H-E-L-PREPO_NAMEXID_plusPATH_START.@XID_plus_extracted@XID_plus-master@docs@notebooks@examples@XID+example_run_script_SED.ipynb@.PATH_END.py |
{
"filename": "LICENSE.md",
"repo_name": "gmzsebastian/SLSNe",
"repo_path": "SLSNe_extracted/SLSNe-main/LICENSE.md",
"type": "Markdown"
} |
The MIT License (MIT)
Copyright (c) 2023 Sebastian Gomez (sgomez@stsci.edu)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, c... | gmzsebastianREPO_NAMESLSNePATH_START.@SLSNe_extracted@SLSNe-main@LICENSE.md@.PATH_END.py |
{
"filename": "test_cleanup_plugin.py",
"repo_name": "cosmo-ethz/hide",
"repo_path": "hide_extracted/hide-master/test/test_cleanup_plugin.py",
"type": "Python"
} | # HIDE 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) any later version.
#
# HIDE is distributed in the hope that it will be useful,
# but WITHOUT ANY W... | cosmo-ethzREPO_NAMEhidePATH_START.@hide_extracted@hide-master@test@test_cleanup_plugin.py@.PATH_END.py |
{
"filename": "question.md",
"repo_name": "TeamLEGWORK/LEGWORK",
"repo_path": "LEGWORK_extracted/LEGWORK-main/.github/ISSUE_TEMPLATE/question.md",
"type": "Markdown"
} | ---
name: Question
about: Confused about something in LEGWORK? Not sure how to use a function? Feel free to ask questions here!
title: ''
labels: question
assignees: ''
---
Use this issue to ask any questions about how LEGWORK functions work, how best to use LEGWORK for your project or anything else you need help wit... | TeamLEGWORKREPO_NAMELEGWORKPATH_START.@LEGWORK_extracted@LEGWORK-main@.github@ISSUE_TEMPLATE@question.md@.PATH_END.py |
{
"filename": "ex_var.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/examples/tsa/ex_var.py",
"type": "Python"
} | import numpy as np
import statsmodels.api as sm
from statsmodels.tsa.api import VAR
# some example data
mdata = sm.datasets.macrodata.load().data
mdata = mdata[['realgdp','realcons','realinv']]
names = mdata.dtype.names
data = mdata.view((float,3))
use_growthrate = False #True #False
if use_growthrate:
data = 10... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@examples@tsa@ex_var.py@.PATH_END.py |
{
"filename": "_decomp_schur.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/linalg/_decomp_schur.py",
"type": "Python"
} | """Schur decomposition functions."""
import numpy as np
from numpy import asarray_chkfinite, single, asarray, array
from numpy.linalg import norm
# Local imports.
from ._misc import LinAlgError, _datacopied
from .lapack import get_lapack_funcs
from ._decomp import eigvals
__all__ = ['schur', 'rsf2csf']
_double_prec... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@linalg@_decomp_schur.py@.PATH_END.py |
{
"filename": "merge_benchmark.py",
"repo_name": "fchollet/keras",
"repo_path": "keras_extracted/keras-master/benchmarks/layer_benchmark/merge_benchmark.py",
"type": "Python"
} | """Benchmark merge layers.
To run benchmarks, see the following command for an example, please change the
flag to your custom value:
```
python3 -m benchmarks.layer_benchmark.merge_benchmark \
--benchmark_name=benchmark_add \
--num_samples=2048 \
--batch_size=256 \
--jit_compile=True
```
"""
from abs... | fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@benchmarks@layer_benchmark@merge_benchmark.py@.PATH_END.py |
{
"filename": "_title.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/surface/colorbar/_title.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TitleValidator(_plotly_utils.basevalidators.TitleValidator):
def __init__(self, plotly_name="title", parent_name="surface.colorbar", **kwargs):
super(TitleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@surface@colorbar@_title.py@.PATH_END.py |
{
"filename": "_fastica.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/sklearn/decomposition/_fastica.py",
"type": "Python"
} | """
Python implementation of the fast ICA algorithms.
Reference: Tables 8.3 and 8.4 page 196 in the book:
Independent Component Analysis, by Hyvarinen et al.
"""
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
import warnings
from numbers import Integral, Real
import numpy as np
from... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@sklearn@decomposition@_fastica.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/choroplethmapbox/unselected/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._marker import Marker
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(__name__, [], ["._marker.Marker"])
| plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@choroplethmapbox@unselected@__init__.py@.PATH_END.py |
{
"filename": "test_redchi2.py",
"repo_name": "light-curve/light-curve-python",
"repo_path": "light-curve-python_extracted/light-curve-python-master/light-curve/tests/light_curve_py/features/test_redchi2.py",
"type": "Python"
} | import numpy as np
from numpy.testing import assert_allclose
from light_curve.light_curve_py import ReducedChi2
def test_redchi2_equal_sigma():
m = np.array([1.0, 1.0, 2.0, 3.0, 4.0, 5.0])
sigma = np.array([0.5, 0.5, 0.5, 0.5, 0.5, 0.5])
feature = ReducedChi2()
desired = feature(np.linspace(0, 1, len... | light-curveREPO_NAMElight-curve-pythonPATH_START.@light-curve-python_extracted@light-curve-python-master@light-curve@tests@light_curve_py@features@test_redchi2.py@.PATH_END.py |
{
"filename": "domwidget.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/ipywidgets/py2/ipywidgets/widgets/domwidget.py",
"type": "Python"
} | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Contains the DOMWidget class"""
from traitlets import Unicode
from .widget import Widget, widget_serialization
from .trait_types import InstanceDict, TypedTuple
from .widget_layout import Layout
from .widget_style ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipywidgets@py2@ipywidgets@widgets@domwidget.py@.PATH_END.py |
{
"filename": "_pep440.py",
"repo_name": "numpy/numpy",
"repo_path": "numpy_extracted/numpy-main/numpy/_utils/_pep440.py",
"type": "Python"
} | """Utility to compare pep440 compatible version strings.
The LooseVersion and StrictVersion classes that distutils provides don't
work; they don't recognize anything like alpha/beta/rc/dev versions.
"""
# Copyright (c) Donald Stufft and individual contributors.
# All rights reserved.
# Redistribution and use in sour... | numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@numpy@_utils@_pep440.py@.PATH_END.py |
{
"filename": "_meta.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/ohlc/_meta.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MetaValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="meta", parent_name="ohlc", **kwargs):
super(MetaValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
array_ok=kwar... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@ohlc@_meta.py@.PATH_END.py |
{
"filename": "_templateitemname.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/parcoords/line/colorbar/tickformatstop/_templateitemname.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TemplateitemnameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="templateitemname",
parent_name="parcoords.line.colorbar.tickformatstop",
**kwargs,
):
super(TemplateitemnameValidator, sel... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@parcoords@line@colorbar@tickformatstop@_templateitemname.py@.PATH_END.py |
{
"filename": "test_medabsdev.py",
"repo_name": "light-curve/light-curve-python",
"repo_path": "light-curve-python_extracted/light-curve-python-master/light-curve/tests/light_curve_py/features/test_medabsdev.py",
"type": "Python"
} | import numpy as np
from numpy.testing import assert_allclose
from light_curve.light_curve_py import MedianAbsoluteDeviation
def test_medabsdev():
m = [1.0, 1.0, 3.0, 4.0, 7.0]
feature = MedianAbsoluteDeviation()
actual = feature(np.linspace(0, 1, len(m)), m, None)
desired = 2.0
assert_allclose(ac... | light-curveREPO_NAMElight-curve-pythonPATH_START.@light-curve-python_extracted@light-curve-python-master@light-curve@tests@light_curve_py@features@test_medabsdev.py@.PATH_END.py |
{
"filename": "test_void_size_function.ipynb",
"repo_name": "GabrieleParimbelli/COLIBRI",
"repo_path": "COLIBRI_extracted/COLIBRI-master/notebooks/test_void_size_function.ipynb",
"type": "Jupyter Notebook"
} | # Test void size function routines
This notebook computes the void size function routines of the ``cosmo`` class
```python
import colibri.cosmology as cc
import colibri.useful_functions as UU
import numpy as np
import matplotlib.pyplot as plt
plt.rc('text',usetex=True)
plt.rc('font',size=25,family='serif')
```
###... | GabrieleParimbelliREPO_NAMECOLIBRIPATH_START.@COLIBRI_extracted@COLIBRI-master@notebooks@test_void_size_function.ipynb@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "oliverphilcox/Parity-Odd-4PCF",
"repo_path": "Parity-Odd-4PCF_extracted/Parity-Odd-4PCF-main/README.md",
"type": "Markdown"
} | # Parity-Odd-4PCF
Analysis pipeline for probing parity-violation with the 4-point correlation function of BOSS CMASS galaxies. This is described in detail in [Philcox 2022](https://arxiv.org/abs/2206.04227), and makes use of the [encore](https://github.com/oliverphilcox/encore) NPCF algorithm described in [Philcox et ... | oliverphilcoxREPO_NAMEParity-Odd-4PCFPATH_START.@Parity-Odd-4PCF_extracted@Parity-Odd-4PCF-main@README.md@.PATH_END.py |
{
"filename": "get_data.py",
"repo_name": "ethankruse/koi3278",
"repo_path": "koi3278_extracted/koi3278-master/get_data.py",
"type": "Python"
} | """
Download the necessary files if they don't already exist.
"""
import inputs as inp
from glob import glob
import subprocess
import os
dataloc = inp.keplerdata
KIC = 3342467
KICstr = str(int(KIC))
files = glob(dataloc + 'kplr*' + KICstr + '*llc.fits')
# change this if we actually had to download something
dload =... | ethankruseREPO_NAMEkoi3278PATH_START.@koi3278_extracted@koi3278-master@get_data.py@.PATH_END.py |
{
"filename": "motorhead_memory.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/memory/motorhead_memory.ipynb",
"type": "Jupyter Notebook"
} | # Motörhead
>[Motörhead](https://github.com/getmetal/motorhead) is a memory server implemented in Rust. It automatically handles incremental summarization in the background and allows for stateless applications.
## Setup
See instructions at [Motörhead](https://github.com/getmetal/motorhead) for running the server lo... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@memory@motorhead_memory.ipynb@.PATH_END.py |
{
"filename": "mcmc_gauss.py",
"repo_name": "HETDEX/hetdex_api",
"repo_path": "hetdex_api_extracted/hetdex_api-master/hetdex_tools/mcmc_gauss.py",
"type": "Python"
} | """
Cloned from ELiXer mcmc_gauss.py
Fits an emission line with a simple, single Gaussian for four parameters:
line center (mu), line width (sigma), area (A), and y offset (y)
* Note the y offset is not a line fit (that is, the slope is zero)
"""
from __future__ import print_function
import numpy as np
from sci... | HETDEXREPO_NAMEhetdex_apiPATH_START.@hetdex_api_extracted@hetdex_api-master@hetdex_tools@mcmc_gauss.py@.PATH_END.py |
{
"filename": "constants.py",
"repo_name": "pcubillos/repack",
"repo_path": "repack_extracted/repack-master/repack/constants/constants.py",
"type": "Python"
} | # Copyright (c) 2017-2021 Patricio Cubillos and contributors.
# repack is open-source software under the MIT license (see LICENSE).
__all__ = [
"kB",
"amu",
"e",
"me",
"N0",
"nano",
"C1",
"C2",
"C3",
"ROOT",
]
import os
import scipy.constants as sc
# Boltzmann constant i... | pcubillosREPO_NAMErepackPATH_START.@repack_extracted@repack-master@repack@constants@constants.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.