metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "__main__.py",
"repo_name": "madamow/pymoogi",
"repo_path": "pymoogi_extracted/pymoogi-master/pymoogi/__main__.py",
"type": "Python"
} | #!/usr/bin/env python
import os
import sys
path = os.path.dirname(os.path.realpath(__file__)) # directory of pymoogi
print(path)
# location of pyEW functions:
sys.path.append("%s/lib/" % path)
from Common_functions import *
import matplotlib.pyplot as plt
from plot_style import SM_style
from Synth import SynthPlot
... | madamowREPO_NAMEpymoogiPATH_START.@pymoogi_extracted@pymoogi-master@pymoogi@__main__.py@.PATH_END.py |
{
"filename": "_marker.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/waterfall/decreasing/_marker.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MarkerValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="marker", parent_name="waterfall.decreasing", **kwargs
):
super(MarkerValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@waterfall@decreasing@_marker.py@.PATH_END.py |
{
"filename": "tsv.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/document_loaders/tsv.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import UnstructuredTSVLoader
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional ... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@document_loaders@tsv.py@.PATH_END.py |
{
"filename": "apero_lbl_mask_nirps_ha.py",
"repo_name": "njcuk9999/apero-drs",
"repo_path": "apero-drs_extracted/apero-drs-main/apero/recipes/nirps_ha/apero_lbl_mask_nirps_ha.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Run the LBL reference code
- symlinks files
Arguments: None
Created on 2023-08-09 at 11:14
@author: cook
"""
import sys
from typing import Any, Dict, List, Optional, Tuple, Union
from apero import lang
from apero.base import base
from apero.core import constants
fr... | njcuk9999REPO_NAMEapero-drsPATH_START.@apero-drs_extracted@apero-drs-main@apero@recipes@nirps_ha@apero_lbl_mask_nirps_ha.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "NuSpaceSim/nuSpaceSim",
"repo_path": "nuSpaceSim_extracted/nuSpaceSim-main/src/nuspacesim/types/__init__.py",
"type": "Python"
} | NuSpaceSimREPO_NAMEnuSpaceSimPATH_START.@nuSpaceSim_extracted@nuSpaceSim-main@src@nuspacesim@types@__init__.py@.PATH_END.py | |
{
"filename": "GiRaFFE_NRPy_staggered_Afield_flux.py",
"repo_name": "zachetienne/nrpytutorial",
"repo_path": "nrpytutorial_extracted/nrpytutorial-master/in_progress-GiRaFFE_NRPy/GiRaFFE_NRPy/GiRaFFE_NRPy_staggered_Afield_flux.py",
"type": "Python"
} | # Step 0: Add NRPy's directory to the path
# https://stackoverflow.com/questions/16780014/import-file-from-parent-directory
import os,sys
nrpy_dir_path = os.path.join("..")
if nrpy_dir_path not in sys.path:
sys.path.append(nrpy_dir_path)
from outputC import outC_function_outdir_dict, outC_function_dict, outC_funct... | zachetienneREPO_NAMEnrpytutorialPATH_START.@nrpytutorial_extracted@nrpytutorial-master@in_progress-GiRaFFE_NRPy@GiRaFFE_NRPy@GiRaFFE_NRPy_staggered_Afield_flux.py@.PATH_END.py |
{
"filename": "wrapcauchy.py",
"repo_name": "google/jax",
"repo_path": "jax_extracted/jax-main/jax/_src/scipy/stats/wrapcauchy.py",
"type": "Python"
} | # Copyright 2023 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | googleREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@_src@scipy@stats@wrapcauchy.py@.PATH_END.py |
{
"filename": "gen_ic.py",
"repo_name": "jmd-dk/concept",
"repo_path": "concept_extracted/concept-master/test/fluid_drift_rigid/gen_ic.py",
"type": "Python"
} | # This file has to be run in pure Python mode!
# Imports from the CO𝘕CEPT code
from commons import *
from ic import random_uniform
from species import Component
from snapshot import save
# Create the fluid.
# This is a global sine wave along the x-direction,
# moving with the speed "speed" along the x-direction,
# t... | jmd-dkREPO_NAMEconceptPATH_START.@concept_extracted@concept-master@test@fluid_drift_rigid@gen_ic.py@.PATH_END.py |
{
"filename": "atm_errs.py",
"repo_name": "jfcrenshaw/aos_notebooks",
"repo_path": "aos_notebooks_extracted/aos_notebooks-main/bin/atm_errs.py",
"type": "Python"
} | """This script calculates expected atmospheric errors."""
import galsim
import numpy as np
import pandas as pd
from lsst.ts.phosim.utils.ConvertZernikesToPsfWidth import convertZernikesToPsfWidth
from lsst.ts.wep.cwfs.instrument import Instrument
from scipy.spatial.distance import cdist
from scipy.special import gamma,... | jfcrenshawREPO_NAMEaos_notebooksPATH_START.@aos_notebooks_extracted@aos_notebooks-main@bin@atm_errs.py@.PATH_END.py |
{
"filename": "sss.py",
"repo_name": "hpc4cmb/toast",
"repo_path": "toast_extracted/toast-main/src/toast/pipeline_tools/sss.py",
"type": "Python"
} | # Copyright (c) 2019-2020 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
import argparse
import os
import numpy as np
from ..timing import function_timer, Timer
from ..utils import Logger, Environm... | hpc4cmbREPO_NAMEtoastPATH_START.@toast_extracted@toast-main@src@toast@pipeline_tools@sss.py@.PATH_END.py |
{
"filename": "_dtickrange.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/sunburst/marker/colorbar/tickformatstop/_dtickrange.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class DtickrangeValidator(_plotly_utils.basevalidators.InfoArrayValidator):
def __init__(
self,
plotly_name="dtickrange",
parent_name="sunburst.marker.colorbar.tickformatstop",
**kwargs,
):
super(DtickrangeValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@sunburst@marker@colorbar@tickformatstop@_dtickrange.py@.PATH_END.py |
{
"filename": "_symbolsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattermapbox/marker/_symbolsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SymbolsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="symbolsrc", parent_name="scattermapbox.marker", **kwargs
):
super(SymbolsrcValidator, self).__init__(
plotly_name=plotly_name,
paren... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattermapbox@marker@_symbolsrc.py@.PATH_END.py |
{
"filename": "_opacity.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/icicle/leaf/_opacity.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OpacityValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="opacity", parent_name="icicle.leaf", **kwargs):
super(OpacityValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@icicle@leaf@_opacity.py@.PATH_END.py |
{
"filename": "huggingface_example.py",
"repo_name": "AlexImmer/Laplace",
"repo_path": "Laplace_extracted/Laplace-main/examples/huggingface_example.py",
"type": "Python"
} | import logging
import warnings
from collections import UserDict
from collections.abc import MutableMapping
import numpy
import torch
import torch.utils.data as data_utils
from datasets import Dataset
from peft import LoraConfig, get_peft_model
from torch import nn
from transformers import (
DataCollatorWithPadding... | AlexImmerREPO_NAMELaplacePATH_START.@Laplace_extracted@Laplace-main@examples@huggingface_example.py@.PATH_END.py |
{
"filename": "spline.py",
"repo_name": "xraypy/xraylarch",
"repo_path": "xraylarch_extracted/xraylarch-master/larch/math/spline.py",
"type": "Python"
} | #!/usr/bin/env python
"""
Splines for fitting to data within Larch
"""
from scipy.interpolate import splrep, splev
from .. import Group, isgroup
from ..fitting import Parameter, isParameter
def spline_rep(x, y, group=None, name='spl1'):
"""create a spline representation for an (x, y) data set to be
evaluate... | xraypyREPO_NAMExraylarchPATH_START.@xraylarch_extracted@xraylarch-master@larch@math@spline.py@.PATH_END.py |
{
"filename": "check_batch.py",
"repo_name": "lsstdesc/sn_pipe",
"repo_path": "sn_pipe_extracted/sn_pipe-master/for_batch/scripts/check_batch.py",
"type": "Python"
} | import os
import glob
import numpy as np
import pandas as pd
from optparse import OptionParser
def count(grp, dirFiles, metric):
"""
Function to count the number of *hdf5 files in a directory
Parameters
---------------
grp: pandas df row
dirFiles: str
main location dir of the files
... | lsstdescREPO_NAMEsn_pipePATH_START.@sn_pipe_extracted@sn_pipe-master@for_batch@scripts@check_batch.py@.PATH_END.py |
{
"filename": "spectrum_list.py",
"repo_name": "astropy/specutils",
"repo_path": "specutils_extracted/specutils-main/specutils/spectra/spectrum_list.py",
"type": "Python"
} | from astropy.nddata import NDIOMixin
__all__ = ['SpectrumList']
class SpectrumList(list, NDIOMixin):
"""
A list that is used to hold a list of `~specutils.Spectrum1D` objects
The primary purpose of this class is to allow loaders to return a list of
spectra that have different shapes. For spectra t... | astropyREPO_NAMEspecutilsPATH_START.@specutils_extracted@specutils-main@specutils@spectra@spectrum_list.py@.PATH_END.py |
{
"filename": "helpers.py",
"repo_name": "pytorch/vision",
"repo_path": "vision_extracted/vision-main/gallery/transforms/helpers.py",
"type": "Python"
} | import matplotlib.pyplot as plt
import torch
from torchvision.utils import draw_bounding_boxes, draw_segmentation_masks
from torchvision import tv_tensors
from torchvision.transforms.v2 import functional as F
def plot(imgs, row_title=None, **imshow_kwargs):
if not isinstance(imgs[0], list):
# Make a 2d gr... | pytorchREPO_NAMEvisionPATH_START.@vision_extracted@vision-main@gallery@transforms@helpers.py@.PATH_END.py |
{
"filename": "_size.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/sunburst/textfont/_size.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="size", parent_name="sunburst.textfont", **kwargs):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@sunburst@textfont@_size.py@.PATH_END.py |
{
"filename": "_barpolar.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/template/data/_barpolar.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BarpolarValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="barpolar", parent_name="layout.template.data", **kwargs
):
super(BarpolarValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@template@data@_barpolar.py@.PATH_END.py |
{
"filename": "surface3d_3.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/galleries/examples/mplot3d/surface3d_3.py",
"type": "Python"
} | """
=========================
3D surface (checkerboard)
=========================
Demonstrates plotting a 3D surface colored in a checkerboard pattern.
"""
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.ticker import LinearLocator
ax = plt.figure().add_subplot(projection='3d')
# Make data.
X = ... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@galleries@examples@mplot3d@surface3d_3.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/indicator/gauge/step/line/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._width import WidthValidator
from ._color import ColorValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._width.Wi... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@indicator@gauge@step@line@__init__.py@.PATH_END.py |
{
"filename": "specv_evolution.py",
"repo_name": "saberyoung/haffet",
"repo_path": "haffet_extracted/haffet-master/sdapy/engines/specv_evolution.py",
"type": "Python"
} | from sdapy.model_fitters import fit_model
from sdapy.constants import line_location, line_forsn
from sdapy.functions import *
from sdapy.models import *
import numpy as np
import os
LOCALSOURCE = os.getenv('ZTFDATA',"./Data/")
def engine(self, model_name, engine_name,
sourcename=None, modelname=None, quant=... | saberyoungREPO_NAMEhaffetPATH_START.@haffet_extracted@haffet-master@sdapy@engines@specv_evolution.py@.PATH_END.py |
{
"filename": "main.py",
"repo_name": "cdslaborg/paramonte",
"repo_path": "paramonte_extracted/paramonte-main/example/fortran/pm_distGeom/setGeomCDF/main.py",
"type": "Python"
} | #!/usr/bin/env python
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import glob
import sys
fontsize = 17
kind = "IK"
label = [ r"probSuccess = .1"
, r"probSuccess = .2"
, r"probSuccess = .5"
, r"probSuccess = .8"
]
pattern = "*." + kind + ".txt"
fileList = gl... | cdslaborgREPO_NAMEparamontePATH_START.@paramonte_extracted@paramonte-main@example@fortran@pm_distGeom@setGeomCDF@main.py@.PATH_END.py |
{
"filename": "_remove_redundancy.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py2/scipy/optimize/_remove_redundancy.py",
"type": "Python"
} | """
Routines for removing redundant (linearly dependent) equations from linear
programming equality constraints.
"""
# Author: Matt Haberland
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.linalg import svd
import scipy
def _row_count(A):
"""
Counts the number ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py2@scipy@optimize@_remove_redundancy.py@.PATH_END.py |
{
"filename": "train_compressor_simulator.ipynb",
"repo_name": "dlanzieri/WL_Implicit-Inference",
"repo_path": "WL_Implicit-Inference_extracted/WL_Implicit-Inference-main/notebook/train_compressor_simulator.ipynb",
"type": "Jupyter Notebook"
} | ```python
from jax.lib import xla_bridge
print(xla_bridge.get_backend().platform)
```
gpu
```python
%load_ext autoreload
%autoreload 2
%pylab inline
from functools import partial
from tqdm import tqdm
import pickle
from pathlib import Path
import tensorboard
import numpy as np
import jax
import jax.numpy as j... | dlanzieriREPO_NAMEWL_Implicit-InferencePATH_START.@WL_Implicit-Inference_extracted@WL_Implicit-Inference-main@notebook@train_compressor_simulator.ipynb@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/image/legendgrouptitle/_font.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "image.legendgrouptitle"
_path_str = "image.legendgrouptitle.font"
_valid_props = {
"co... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@image@legendgrouptitle@_font.py@.PATH_END.py |
{
"filename": "test_toa_indexing.py",
"repo_name": "nanograv/PINT",
"repo_path": "PINT_extracted/PINT-master/tests/test_toa_indexing.py",
"type": "Python"
} | from io import StringIO
import numpy as np
import pytest
from hypothesis import given
from hypothesis.strategies import slices, integers, one_of, lists
from hypothesis.extra.numpy import arrays, array_shapes
from pint.toa import get_TOAs
tim = """FORMAT 1
fake 1400 54000 1.0 @ -flag thing
fake 1400 54001 1.0 @ -flag... | nanogravREPO_NAMEPINTPATH_START.@PINT_extracted@PINT-master@tests@test_toa_indexing.py@.PATH_END.py |
{
"filename": "mktrace_iraf.py",
"repo_name": "spacetelescope/stsdas_stripped",
"repo_path": "stsdas_stripped_extracted/stsdas_stripped-master/stsdas/pkg/hst_calib/stis/mktrace_iraf.py",
"type": "Python"
} | from __future__ import division # confidence high
from pyraf import iraf
from pyraf.iraf import stsdas,hst_calib,stis
from stistools import mktrace as tr
# Point to default parameter file for task
_parfile = 'stis$mktrace.par'
##### Initialize Python IRAF interface
#weights must be passed to python in forma... | spacetelescopeREPO_NAMEstsdas_strippedPATH_START.@stsdas_stripped_extracted@stsdas_stripped-master@stsdas@pkg@hst_calib@stis@mktrace_iraf.py@.PATH_END.py |
{
"filename": "test_tuple.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/simplejson/py3/simplejson/tests/test_tuple.py",
"type": "Python"
} | import unittest
from simplejson.compat import StringIO
import simplejson as json
class TestTuples(unittest.TestCase):
def test_tuple_array_dumps(self):
t = (1, 2, 3)
expect = json.dumps(list(t))
# Default is True
self.assertEqual(expect, json.dumps(t))
self.assertEqual(expe... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@simplejson@py3@simplejson@tests@test_tuple.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "pyro-ppl/numpyro",
"repo_path": "numpyro_extracted/numpyro-master/numpyro/contrib/einstein/__init__.py",
"type": "Python"
} | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from numpyro.contrib.einstein.mixture_guide_predictive import MixtureGuidePredictive
from numpyro.contrib.einstein.stein_kernels import (
GraphicalKernel,
IMQKernel,
LinearKernel,
MixtureKernel,
ProbabilityProductKe... | pyro-pplREPO_NAMEnumpyroPATH_START.@numpyro_extracted@numpyro-master@numpyro@contrib@einstein@__init__.py@.PATH_END.py |
{
"filename": "Untitled.ipynb",
"repo_name": "patrickaleo/LAISS-local",
"repo_path": "LAISS-local_extracted/LAISS-local-main/notebooks/Untitled.ipynb",
"type": "Jupyter Notebook"
} | ```python
import sncosmo
```
```python
import numpy as np
from astropy.cosmology import FlatLambdaCDM
# Cosmological parameters
H0 = 70 # Hubble constant in km/s/Mpc
omega_M = 0.3 # Omega_Matter
# Redshift of the supernova
z = 0.05 # Example redshift value
# Apparent magnitude of the supernova
apparent_mag = 19... | patrickaleoREPO_NAMELAISS-localPATH_START.@LAISS-local_extracted@LAISS-local-main@notebooks@Untitled.ipynb@.PATH_END.py |
{
"filename": "AnalysisEvent.py",
"repo_name": "delphes/delphes",
"repo_path": "delphes_extracted/delphes-master/python/DelphesAnalysis/AnalysisEvent.py",
"type": "Python"
} | from inspect import getargspec
from ROOT import TLorentzVector,TVector3,TChain,TClass,TDatabasePDG
from datetime import datetime
from collections import Iterable
from types import StringTypes
from os import path
class AnalysisEvent(TChain):
"""A class that complements fwlite::Events with analysis facilities.
... | delphesREPO_NAMEdelphesPATH_START.@delphes_extracted@delphes-master@python@DelphesAnalysis@AnalysisEvent.py@.PATH_END.py |
{
"filename": "carto.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/_plotly_utils/colors/carto.py",
"type": "Python"
} | """
Color sequences and scales from CARTO's CartoColors
Learn more at https://github.com/CartoDB/CartoColor
CARTOColors are made available under a Creative Commons Attribution license: https://creativecommons.org/licenses/by/3.0/us/
"""
from ._swatches import _swatches
def swatches(template=None):
return _swat... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@_plotly_utils@colors@carto.py@.PATH_END.py |
{
"filename": "CODE_OF_CONDUCT.md",
"repo_name": "spacetelescope/specviz",
"repo_path": "specviz_extracted/specviz-master/CODE_OF_CONDUCT.md",
"type": "Markdown"
} | # Spacetelescope Open Source Code of Conduct
We expect all "spacetelescope" organization projects to adopt a code of conduct that ensures a productive, respectful environment for all open source contributors and participants. We are committed to providing a strong and enforced code of conduct and expect everyone in ou... | spacetelescopeREPO_NAMEspecvizPATH_START.@specviz_extracted@specviz-master@CODE_OF_CONDUCT.md@.PATH_END.py |
{
"filename": "models.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/odr/models.py",
"type": "Python"
} | # This file is not meant for public use and will be removed in SciPy v2.0.0.
# Use the `scipy.odr` namespace for importing the functions
# included below.
import warnings
from . import _models
__all__ = [ # noqa: F822
'Model', 'exponential', 'multilinear', 'unilinear',
'quadratic', 'polynomial'
]
def __dir... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@odr@models.py@.PATH_END.py |
{
"filename": "conftest.py",
"repo_name": "rhayes777/PyAutoFit",
"repo_path": "PyAutoFit_extracted/PyAutoFit-main/test_autofit/non_linear/grid/test_sensitivity/conftest.py",
"type": "Python"
} | import numpy as np
import pytest
from typing import Optional
import autofit as af
from autofit.non_linear.grid import sensitivity as s
from autofit.non_linear.mock.mock_samples_summary import MockSamplesSummary
x = np.array(range(10))
class Simulate:
def __init__(self):
pass
def __call__(self, inst... | rhayes777REPO_NAMEPyAutoFitPATH_START.@PyAutoFit_extracted@PyAutoFit-main@test_autofit@non_linear@grid@test_sensitivity@conftest.py@.PATH_END.py |
{
"filename": "_ticktext.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattersmith/marker/colorbar/_ticktext.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicktextValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self,
plotly_name="ticktext",
parent_name="scattersmith.marker.colorbar",
**kwargs,
):
super(TicktextValidator, self).__init__(
plotly... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattersmith@marker@colorbar@_ticktext.py@.PATH_END.py |
{
"filename": "maker.py",
"repo_name": "Jammy2211/PyAutoLens",
"repo_path": "PyAutoLens_extracted/PyAutoLens-main/autolens/analysis/maker.py",
"type": "Python"
} | import autogalaxy as ag
from autolens.analysis.preloads import Preloads
class FitMaker(ag.FitMaker):
@property
def preloads_cls(self):
return Preloads
| Jammy2211REPO_NAMEPyAutoLensPATH_START.@PyAutoLens_extracted@PyAutoLens-main@autolens@analysis@maker.py@.PATH_END.py |
{
"filename": "_xperiod.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/box/_xperiod.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XperiodValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="xperiod", parent_name="box", **kwargs):
super(XperiodValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@box@_xperiod.py@.PATH_END.py |
{
"filename": "manage-artifacts.py",
"repo_name": "dmlc/xgboost",
"repo_path": "xgboost_extracted/xgboost-master/ops/pipeline/manage-artifacts.py",
"type": "Python"
} | """
Upload an artifact to an S3 bucket for later use
Note. This script takes in all inputs via environment variables
except the path to the artifact(s).
"""
import argparse
import os
import subprocess
import sys
from pathlib import Path
from urllib.parse import SplitResult, urlsplit, urlunsplit
def resolve(x: ... | dmlcREPO_NAMExgboostPATH_START.@xgboost_extracted@xgboost-master@ops@pipeline@manage-artifacts.py@.PATH_END.py |
{
"filename": "_token.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/splom/stream/_token.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TokenValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="token", parent_name="splom.stream", **kwargs):
super(TokenValidator, 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@splom@stream@_token.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "esheldon/ngmix",
"repo_path": "ngmix_extracted/ngmix-master/setup.py",
"type": "Python"
} | import os
from setuptools import setup, find_packages
__version__ = None
pth = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"ngmix",
"_version.py")
with open(pth, 'r') as fp:
exec(fp.read())
setup(
name="ngmix",
author="Erin Sheldon",
url="https://github.com/esheldon/ngmix",
... | esheldonREPO_NAMEngmixPATH_START.@ngmix_extracted@ngmix-master@setup.py@.PATH_END.py |
{
"filename": "runtwogalaxies.py",
"repo_name": "dstndstn/tractor",
"repo_path": "tractor_extracted/tractor-main/projects/sdss-atlas/runtwogalaxies.py",
"type": "Python"
} | from twogalaxies import twogalaxies
import sys
f = open('2data.txt','r')
for line in f:
name1,ra1,dec1,name2,ra2,dec2 = line.split()
twogalaxies(name1,ra1,dec1,name2,ra2,dec2)
| dstndstnREPO_NAMEtractorPATH_START.@tractor_extracted@tractor-main@projects@sdss-atlas@runtwogalaxies.py@.PATH_END.py |
{
"filename": "healpix_map.py",
"repo_name": "gregreen/dustmaps",
"repo_path": "dustmaps_extracted/dustmaps-master/dustmaps/healpix_map.py",
"type": "Python"
} | #!/usr/bin/env python
#
# healpix_map.py
# A set of HEALPix map classes.
#
# Copyright (C) 2016 Gregory M. Green
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Licens... | gregreenREPO_NAMEdustmapsPATH_START.@dustmaps_extracted@dustmaps-master@dustmaps@healpix_map.py@.PATH_END.py |
{
"filename": "load_results.py",
"repo_name": "psheehan/pdspy",
"repo_path": "pdspy_extracted/pdspy-master/pdspy/utils/load_results.py",
"type": "Python"
} | from sklearn.neighbors import KernelDensity
import scipy.signal
import scipy.stats
import emcee
import numpy
def load_results(config, model_path='', code="dynesty", discard=100, \
best="median", unc="none", percentile=68, chisq_cut=False, \
trim=None, fix_log10=False, gas_mass=False, return_format="dic... | psheehanREPO_NAMEpdspyPATH_START.@pdspy_extracted@pdspy-master@pdspy@utils@load_results.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/scattergeo/unselected/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._textfont import TextfontValidator
from ._marker import MarkerValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattergeo@unselected@__init__.py@.PATH_END.py |
{
"filename": "plot_smalln_data.py",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/src/amuse/community/ph4/util/plot_smalln_data.py",
"type": "Python"
} | import sys
import getopt
import math
import numpy
import time
import matplotlib.pyplot as plt
import matplotlib.animation as animate
# TODO: Colormap should respond to changes in index array.
def unpack_line(r, np, nq):
tt = float(r[0])
ii = []
mm = []
xx = []
yy = []
zz = []
for ... | amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@src@amuse@community@ph4@util@plot_smalln_data.py@.PATH_END.py |
{
"filename": "StrConverter.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/matplotlib/py3/matplotlib/testing/jpl_units/StrConverter.py",
"type": "Python"
} | """StrConverter module containing class StrConverter."""
import numpy as np
import matplotlib.units as units
__all__ = ['StrConverter']
class StrConverter(units.ConversionInterface):
"""
A Matplotlib converter class for string data values.
Valid units for string are:
- 'indexed' : Values are index... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@matplotlib@py3@matplotlib@testing@jpl_units@StrConverter.py@.PATH_END.py |
{
"filename": "test_fmoc.py",
"repo_name": "cds-astro/mocpy",
"repo_path": "mocpy_extracted/mocpy-master/python/mocpy/tests/test_fmoc.py",
"type": "Python"
} | import numpy as np
import pytest
from astropy import units as u
from ..fmoc import FrequencyMOC
def test_new_empty():
fmoc = FrequencyMOC.new_empty(FrequencyMOC.MAX_ORDER)
assert fmoc.empty()
def test_max_order():
fmoc = FrequencyMOC.new_empty(32)
assert fmoc.max_order == 32
def test_n_cells():
... | cds-astroREPO_NAMEmocpyPATH_START.@mocpy_extracted@mocpy-master@python@mocpy@tests@test_fmoc.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/pyqtgraph/Qt/__init__.py",
"type": "Python"
} | """
This module exists to smooth out some of the differences between Qt versions.
* Automatically import Qt lib depending on availability
* Allow you to import QtCore/QtGui from pyqtgraph.Qt without specifying which Qt wrapper
you want to use.
"""
import os
import re
import subprocess
import sys
import time
import w... | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@pyqtgraph@Qt@__init__.py@.PATH_END.py |
{
"filename": "bandpassfilter.py",
"repo_name": "sdss/mangadap",
"repo_path": "mangadap_extracted/mangadap-main/mangadap/proc/bandpassfilter.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
Container class that defines a bandpass filter.
Class usage examples
--------------------
To define an bandpass filter::
from mangadap.par.bandpassfilter import BandPassFilterPar
p = BandPassFilterPar(index=44, name='... | sdssREPO_NAMEmangadapPATH_START.@mangadap_extracted@mangadap-main@mangadap@proc@bandpassfilter.py@.PATH_END.py |
{
"filename": "_hidesurface.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/surface/_hidesurface.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HidesurfaceValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="hidesurface", parent_name="surface", **kwargs):
super(HidesurfaceValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@surface@_hidesurface.py@.PATH_END.py |
{
"filename": "tunebrick.py",
"repo_name": "dstndstn/tractor",
"repo_path": "tractor_extracted/tractor-main/projects/desi/tunebrick.py",
"type": "Python"
} | from __future__ import print_function
if __name__ == '__main__':
import matplotlib
matplotlib.use('Agg')
from astrometry.util.util import *
from astrometry.util.fits import *
from astrometry.util.plotutils import *
from astrometry.util.ttime import Time, MemMeas
from common import *
from desi_common import *
... | dstndstnREPO_NAMEtractorPATH_START.@tractor_extracted@tractor-main@projects@desi@tunebrick.py@.PATH_END.py |
{
"filename": "util.py",
"repo_name": "pymc-devs/pymc",
"repo_path": "pymc_extracted/pymc-main/pymc/gp/util.py",
"type": "Python"
} | # Copyright 2024 The PyMC Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | pymc-devsREPO_NAMEpymcPATH_START.@pymc_extracted@pymc-main@pymc@gp@util.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "brinckmann/montepython_public",
"repo_path": "montepython_public_extracted/montepython_public-master/montepython/likelihoods/bao_eBOSS_DR16_ELG/__init__.py",
"type": "Python"
} | import os
import numpy as np
import warnings
import montepython.io_mp as io_mp
from montepython.likelihood_class import Likelihood
import scipy.constants as conts
from scipy import interpolate as itp
from scipy.interpolate import RectBivariateSpline
class bao_eBOSS_DR16_ELG(Likelihood):
# initialization routine
... | brinckmannREPO_NAMEmontepython_publicPATH_START.@montepython_public_extracted@montepython_public-master@montepython@likelihoods@bao_eBOSS_DR16_ELG@__init__.py@.PATH_END.py |
{
"filename": "_tickmode.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/choropleth/colorbar/_tickmode.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="tickmode", parent_name="choropleth.colorbar", **kwargs
):
super(TickmodeValidator, self).__init__(
plotly_name=plotly_name,
pa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@choropleth@colorbar@_tickmode.py@.PATH_END.py |
{
"filename": "demo_VEH_HMMWV_DefSoil.py",
"repo_name": "projectchrono/chrono",
"repo_path": "chrono_extracted/chrono-main/src/demos/python/vehicle/demo_VEH_HMMWV_DefSoil.py",
"type": "Python"
} | # =============================================================================
# PROJECT CHRONO - http://projectchrono.org
#
# Copyright (c) 2014 projectchrono.org
# All rights reserved.
#
# Use of this source code is governed by a BSD-style license that can be found
# in the LICENSE file at the top level of the distr... | projectchronoREPO_NAMEchronoPATH_START.@chrono_extracted@chrono-main@src@demos@python@vehicle@demo_VEH_HMMWV_DefSoil.py@.PATH_END.py |
{
"filename": "config_dict_drizz.py",
"repo_name": "swagnercarena/paltas",
"repo_path": "paltas_extracted/paltas-main/test/test_data/config_dict_drizz.py",
"type": "Python"
} | # A test configuration dict
from paltas.Sampling import distributions
import numpy as np
from scipy.stats import uniform, norm, loguniform, lognorm, multivariate_normal
from paltas.Substructure.los_dg19 import LOSDG19
from paltas.Substructure.subhalos_dg19 import SubhalosDG19
from paltas.MainDeflector.simple_deflector... | swagnercarenaREPO_NAMEpaltasPATH_START.@paltas_extracted@paltas-main@test@test_data@config_dict_drizz.py@.PATH_END.py |
{
"filename": "_texttemplate.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattermap/_texttemplate.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TexttemplateValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="texttemplate", parent_name="scattermap", **kwargs):
super(TexttemplateValidator, self).__init__(
plotly_name=plotly_name,
parent_name=paren... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattermap@_texttemplate.py@.PATH_END.py |
{
"filename": "lint.py",
"repo_name": "fritz-marshal/fritz",
"repo_path": "fritz_extracted/fritz-main/launcher/commands/lint.py",
"type": "Python"
} | import subprocess
import sys
from launcher.commands import develop
def lint():
"""Lint the full code base"""
try:
import pre_commit # noqa: F401
except ImportError:
develop()
try:
subprocess.run(["pre-commit", "run", "--all-files"], check=True)
except subprocess.CalledPr... | fritz-marshalREPO_NAMEfritzPATH_START.@fritz_extracted@fritz-main@launcher@commands@lint.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "sfschen/velocileptors",
"repo_path": "velocileptors_extracted/velocileptors-master/velocileptors/EPT/__init__.py",
"type": "Python"
} | sfschenREPO_NAMEvelocileptorsPATH_START.@velocileptors_extracted@velocileptors-master@velocileptors@EPT@__init__.py@.PATH_END.py | |
{
"filename": "make_draine_1um.py",
"repo_name": "psheehan/pdspy",
"repo_path": "pdspy_extracted/pdspy-master/pdspy/dust/data/make_draine_1um.py",
"type": "Python"
} | #!/usr/bin/env python3
from pdspy.dust import *
import numpy
water_ice = Dust()
water_ice.set_optical_constants_from_henn("optical_constants/water_ice.txt")
water_ice.set_density(0.92)
#1/3
graphite_parallel = Dust()
graphite_parallel.set_optical_constants_from_draine("optical_constants/graphite_parallel_0.01.txt")
... | psheehanREPO_NAMEpdspyPATH_START.@pdspy_extracted@pdspy-master@pdspy@dust@data@make_draine_1um.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "JulianBMunoz/21cmvFAST",
"repo_path": "21cmvFAST_extracted/21cmvFAST-master/public_21CMvFAST_MC/Programs/CosmoHammer_21CMMC/emcee/__init__.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, print_function, absolute_import,
unicode_literals)
from .sampler import *
from .mh import *
from .ensemble import *
from .ptsampler import *
from . import utils
__version__ = "1.2.0"
def test():
from inspect... | JulianBMunozREPO_NAME21cmvFASTPATH_START.@21cmvFAST_extracted@21cmvFAST-master@public_21CMvFAST_MC@Programs@CosmoHammer_21CMMC@emcee@__init__.py@.PATH_END.py |
{
"filename": "_dx.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/waterfall/_dx.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class DxValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="dx", parent_name="waterfall", **kwargs):
super(DxValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=k... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@waterfall@_dx.py@.PATH_END.py |
{
"filename": "addsource.py",
"repo_name": "t-brandt/acorns-adi",
"repo_path": "acorns-adi_extracted/acorns-adi-master/addsource/addsource.py",
"type": "Python"
} | #!/usr/bin/env python
#
# Original filename: addsource.py
#
# Author: Tim Brandt
# Email: tbrandt@astro.princeton.edu
# Date: Feb 2012
#
# Summary: inject a fake source into an ADI sequence
#
import numpy as np
import random
from scipy import ndimage
from parallel import *
def addsource(flux, pos, pa, psf, norm=1, j... | t-brandtREPO_NAMEacorns-adiPATH_START.@acorns-adi_extracted@acorns-adi-master@addsource@addsource.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "mwaskom/seaborn",
"repo_path": "seaborn_extracted/seaborn-master/seaborn/utils.py",
"type": "Python"
} | """Utility functions, mostly for internal use."""
import os
import inspect
import warnings
import colorsys
from contextlib import contextmanager
from urllib.request import urlopen, urlretrieve
from types import ModuleType
import numpy as np
import pandas as pd
import matplotlib as mpl
from matplotlib.colors import to_... | mwaskomREPO_NAMEseabornPATH_START.@seaborn_extracted@seaborn-master@seaborn@utils.py@.PATH_END.py |
{
"filename": "_bgcolorsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/mesh3d/hoverlabel/_bgcolorsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BgcolorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="bgcolorsrc", parent_name="mesh3d.hoverlabel", **kwargs
):
super(BgcolorsrcValidator, self).__init__(
plotly_name=plotly_name,
paren... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@mesh3d@hoverlabel@_bgcolorsrc.py@.PATH_END.py |
{
"filename": "_token.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattergl/stream/_token.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TokenValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="token", parent_name="scattergl.stream", **kwargs):
super(TokenValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattergl@stream@_token.py@.PATH_END.py |
{
"filename": "svd.py",
"repo_name": "sczesla/PyAstronomy",
"repo_path": "PyAstronomy_extracted/PyAstronomy-master/src/pyasl/asl/svd.py",
"type": "Python"
} | from __future__ import print_function, division
import numpy as np
from PyAstronomy.pyaC import pyaErrors as PE
import six.moves as smo
class SVD:
"""
Use Singular Value Decomposition (SVD) to obtain broadening function.
The technique is, e.g., described in Rucinski 1999, "Determination of
Broadenin... | sczeslaREPO_NAMEPyAstronomyPATH_START.@PyAstronomy_extracted@PyAstronomy-master@src@pyasl@asl@svd.py@.PATH_END.py |
{
"filename": "fitramp_checks.py",
"repo_name": "t-brandt/fitramp",
"repo_path": "fitramp_extracted/fitramp-main/fitramp_checks.py",
"type": "Python"
} | import numpy as np
from scipy import optimize, special
import fitramp
def run_checks(nreads_Cmatrix=1000000, countrate=20, sig=20, nramps_test=10,
nramps_testjumps=100000,
readtimes=[3, [4, 5], [6, 7, 8], [9, 10, 12], [14, 17],
[20, 21], 22, [24, 25], 26, 27]):... | t-brandtREPO_NAMEfitrampPATH_START.@fitramp_extracted@fitramp-main@fitramp_checks.py@.PATH_END.py |
{
"filename": "sign.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/lite/testing/op_tests/sign.py",
"type": "Python"
} | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@lite@testing@op_tests@sign.py@.PATH_END.py |
{
"filename": "xcode.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/Pygments/py2/pygments/styles/xcode.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
pygments.styles.xcode
~~~~~~~~~~~~~~~~~~~~~
Style similar to the `Xcode` default theme.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, N... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@Pygments@py2@pygments@styles@xcode.py@.PATH_END.py |
{
"filename": "test_prior.py",
"repo_name": "minaskar/pocomc",
"repo_path": "pocomc_extracted/pocomc-main/tests/test_prior.py",
"type": "Python"
} | import unittest
import numpy as np
from scipy.stats import norm
from pocomc.prior import Prior
class PriorTestCase(unittest.TestCase):
def test_sample(self):
prior = Prior([norm(0, 1), norm(0, 1)])
x = prior.rvs(10)
self.assertEqual(np.shape(x), (10,2))
def test_log_prob(self):
... | minaskarREPO_NAMEpocomcPATH_START.@pocomc_extracted@pocomc-main@tests@test_prior.py@.PATH_END.py |
{
"filename": "batch_op.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/data/ops/batch_op.py",
"type": "Python"
} | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@data@ops@batch_op.py@.PATH_END.py |
{
"filename": "odt.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/document_loaders/odt.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import UnstructuredODTLoader
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional ... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@document_loaders@odt.py@.PATH_END.py |
{
"filename": "save_mcmc_outs.py",
"repo_name": "CarlosCoba/XookSuut-code",
"repo_path": "XookSuut-code_extracted/XookSuut-code-master/src/save_mcmc_outs.py",
"type": "Python"
} | import numpy as np
from astropy.io import fits
def marginal_vals(galaxy,vmode,chain_res,n_circ,n_noncirc,out,nlabels,mcmc_outs):
[acc_frac, steps, thin, burnin, Nwalkers, PropDist, ndim, act] = mcmc_outs
data = chain_res
[ny,nx]=data.shape
hdu = fits.PrimaryHDU(data)
hdu.header['PROPDIST'] = "Gaussian" if Prop... | CarlosCobaREPO_NAMEXookSuut-codePATH_START.@XookSuut-code_extracted@XookSuut-code-master@src@save_mcmc_outs.py@.PATH_END.py |
{
"filename": "radsources.py",
"repo_name": "dullemond/radmc3d-2.0",
"repo_path": "radmc3d-2.0_extracted/radmc3d-2.0-master/python/radmc3dPy/radmc3dPy/radsources.py",
"type": "Python"
} | """This module contains classes for radiation sources
"""
from __future__ import absolute_import
from __future__ import print_function
import traceback
import os
try:
import numpy as np
except ImportError:
np = None
print(' Numpy cannot be imported ')
print(' To use the python module of RADMC-3D you n... | dullemondREPO_NAMEradmc3d-2.0PATH_START.@radmc3d-2.0_extracted@radmc3d-2.0-master@python@radmc3dPy@radmc3dPy@radsources.py@.PATH_END.py |
{
"filename": "test_elementslib.py",
"repo_name": "skyfielders/python-skyfield",
"repo_path": "python-skyfield_extracted/python-skyfield-master/skyfield/tests/test_elementslib.py",
"type": "Python"
} | from skyfield.api import load, Time, load_file
from skyfield.data.spice import inertial_frames
from skyfield.data.gravitational_parameters import GM_dict
from skyfield.units import Distance, Angle, Velocity
from skyfield.constants import DAY_S
from skyfield.elementslib import (
OsculatingElements,
normpi,
o... | skyfieldersREPO_NAMEpython-skyfieldPATH_START.@python-skyfield_extracted@python-skyfield-master@skyfield@tests@test_elementslib.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "ELeeAstro/gCMCRT",
"repo_path": "gCMCRT_extracted/gCMCRT-main/README.md",
"type": "Markdown"
} | # gCMCRT - 3D Monte Carlo Radiative Transfer for exoplanet atmospheres with GPUs
WARNING - this code is not a black box and requires some getting used to, that said it typically takes a student a few hours of tinkering to get a first spectra. Once the model works the first time, further tinkering with options/physics ... | ELeeAstroREPO_NAMEgCMCRTPATH_START.@gCMCRT_extracted@gCMCRT-main@README.md@.PATH_END.py |
{
"filename": "paths.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/ipython/py3/IPython/paths.py",
"type": "Python"
} | """Find files and directories which IPython uses.
"""
import os.path
import tempfile
from warnings import warn
import IPython
from IPython.utils.importstring import import_item
from IPython.utils.path import (
get_home_dir,
get_xdg_dir,
get_xdg_cache_dir,
compress_user,
_writable_dir,
ensure_di... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipython@py3@IPython@paths.py@.PATH_END.py |
{
"filename": "_widget_version.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/_widget_version.py",
"type": "Python"
} | # This file is generated by the updateplotlywidgetversion setup.py command
# for automated dev builds
#
# It is edited by hand prior to official releases
__frontend_version__ = "^6.0.0rc0"
| plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@_widget_version.py@.PATH_END.py |
{
"filename": "_outlinecolor.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/densitymap/colorbar/_outlinecolor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OutlinecolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="outlinecolor", parent_name="densitymap.colorbar", **kwargs
):
super(OutlinecolorValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@densitymap@colorbar@_outlinecolor.py@.PATH_END.py |
{
"filename": "Step3_matching_img_ifs_part1.ipynb",
"repo_name": "aabdurrouf/piXedfit",
"repo_path": "piXedfit_extracted/piXedfit-main/examples/FUVtoNIR_MaNGA/Step3_matching_img_ifs_part1.ipynb",
"type": "Jupyter Notebook"
} | ## 3. Spatial and spectral matching between photometric data cube and IFS data cube -- I. Spatial matching
In this step, we will match spatially (on pixel level) the reduced photometric data cube, which is produced from the previous step, and the IFS data cube from the CALIFA survey. This task can be performed using ... | aabdurroufREPO_NAMEpiXedfitPATH_START.@piXedfit_extracted@piXedfit-main@examples@FUVtoNIR_MaNGA@Step3_matching_img_ifs_part1.ipynb@.PATH_END.py |
{
"filename": "EPIRK5P1.py",
"repo_name": "Pranab-JD/LeXInt",
"repo_path": "LeXInt_extracted/LeXInt-main/Python/Variable/EPIRK5P1.py",
"type": "Python"
} | import sys
sys.path.insert(1, "../")
from Jacobian import *
from Phi_functions import *
from real_Leja_phi import *
from imag_Leja_phi import *
################################################################################################
def EPIRK5P1(u, dt, RHS_function, c, Gamma, Leja_X, tol, Real_Imag):
"""... | Pranab-JDREPO_NAMELeXIntPATH_START.@LeXInt_extracted@LeXInt-main@Python@Variable@EPIRK5P1.py@.PATH_END.py |
{
"filename": "_arrayminussrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter/error_y/_arrayminussrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ArrayminussrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="arrayminussrc", parent_name="scatter.error_y", **kwargs
):
super(ArrayminussrcValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter@error_y@_arrayminussrc.py@.PATH_END.py |
{
"filename": "CustomPrior.py",
"repo_name": "xpsi-group/xpsi",
"repo_path": "xpsi_extracted/xpsi-main/examples/examples_fast/Modules/CustomPrior.py",
"type": "Python"
} |
import numpy as np
import math
from scipy.stats import truncnorm
import xpsi
from xpsi.global_imports import gravradius
class CustomPrior(xpsi.Prior):
""" A custom (joint) prior distribution.
Source: Fictitious
Model variant: ST-
"""
__derived_names__ = ['compactness', 'phase_separation',]
... | xpsi-groupREPO_NAMExpsiPATH_START.@xpsi_extracted@xpsi-main@examples@examples_fast@Modules@CustomPrior.py@.PATH_END.py |
{
"filename": "uc_cluster_basta_taxa.py",
"repo_name": "timkahlke/BASTA",
"repo_path": "BASTA_extracted/BASTA-master/scripts/uc_cluster_basta_taxa.py",
"type": "Python"
} | #!/usr/bin/env python
import os
import sys
import argparse
import logging
############
#
# uc cluster taxa
#
####
# COPYRIGHT DISCALIMER:
# 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 Foundatio... | timkahlkeREPO_NAMEBASTAPATH_START.@BASTA_extracted@BASTA-master@scripts@uc_cluster_basta_taxa.py@.PATH_END.py |
{
"filename": "clean.py",
"repo_name": "RobertJaro/InstrumentToInstrument",
"repo_path": "InstrumentToInstrument_extracted/InstrumentToInstrument-master/itipy/data/sdo/clean.py",
"type": "Python"
} | import glob
import os
from multiprocessing import Pool
import numpy as np
from astropy.io.fits import getheader
from tqdm import tqdm
path = '/gpfs/gpfs0/robert.jarolim/data/iti/sdo'
wls = [171, 193, 211, 304]
def check(f):
header = getheader(f, 1)
if header['QUALITY'] != 0:
print(f, header['QUALITY'... | RobertJaroREPO_NAMEInstrumentToInstrumentPATH_START.@InstrumentToInstrument_extracted@InstrumentToInstrument-master@itipy@data@sdo@clean.py@.PATH_END.py |
{
"filename": "_yanchor.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/contour/colorbar/_yanchor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YanchorValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="yanchor", parent_name="contour.colorbar", **kwargs):
super(YanchorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@contour@colorbar@_yanchor.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "LSSTDESC/CCL",
"repo_path": "CCL_extracted/CCL-master/README.md",
"type": "Markdown"
} | <!---
STYLE CONVENTION USED
bolt italic:
***file***"
code:
`program` or `library``
`commands` or `paths`
`variable`
bold code:
**`function`**
**`type`** or **`structure`**
-->
# CCL
 at redshift z = 0.557 (Paiano et al. 2020; Paliya et al.
2020) that belongs to the rare class of extreme blazars (See Section 4.1 in http://arxiv.org/abs/2308.06174). Observ... | mariapetroREPO_NAMELeHaMoCPATH_START.@LeHaMoC_extracted@LeHaMoC-main@Fit_emcee@README.md@.PATH_END.py |
{
"filename": "events.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/tools/python3/Lib/asyncio/events.py",
"type": "Python"
} | """Event loop and event loop policy."""
# Contains code from https://github.com/MagicStack/uvloop/tree/v0.16.0
# SPDX-License-Identifier: PSF-2.0 AND (MIT OR Apache-2.0)
# SPDX-FileCopyrightText: Copyright (c) 2015-2021 MagicStack Inc. http://magic.io
__all__ = (
'AbstractEventLoopPolicy',
'AbstractEventLoop... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@python3@Lib@asyncio@events.py@.PATH_END.py |
{
"filename": "_size.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/table/cells/font/_size.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="size", parent_name="table.cells.font", **kwargs):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@table@cells@font@_size.py@.PATH_END.py |
{
"filename": "vip_ds9.py",
"repo_name": "vortex-exoplanet/VIP",
"repo_path": "VIP_extracted/VIP-master/vip_hci/vip_ds9.py",
"type": "Python"
} | #! /usr/bin/env python
"""
Module with a class for creating a DS9 window through pyds9.
"""
__author__ = "Carlos Alberto Gomez Gonzalez"
import warnings
from .objects.dataset import Dataset, Frame
try:
import pyds9
no_pyds9 = False
__all__ = ["Ds9Window"]
except ImportError:
msg = "Pyds9 not availabl... | vortex-exoplanetREPO_NAMEVIPPATH_START.@VIP_extracted@VIP-master@vip_hci@vip_ds9.py@.PATH_END.py |
{
"filename": "_sizemode.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter3d/marker/_sizemode.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizemodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="sizemode", parent_name="scatter3d.marker", **kwargs
):
super(SizemodeValidator, self).__init__(
plotly_name=plotly_name,
paren... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter3d@marker@_sizemode.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "minkailin/stratsi",
"repo_path": "stratsi_extracted/stratsi-master/dedalus_repo/README.md",
"type": "Markdown"
} | # Dedalus Project
## About Dedalus
Dedalus is a flexible framework for solving partial differential equations using spectral methods.
The code is open-source and developed by a team of researchers working on problems in astrophysical and geophysical fluid dynamics.
The code is written primarily in Python and feature... | minkailinREPO_NAMEstratsiPATH_START.@stratsi_extracted@stratsi-master@dedalus_repo@README.md@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "google/jax",
"repo_path": "jax_extracted/jax-main/docs/notebooks/README.md",
"type": "Markdown"
} | For instructions on how to change and test notebooks, see
[Update Documentation](https://jax.readthedocs.io/en/latest/developer.html#update-documentation).
| googleREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@docs@notebooks@README.md@.PATH_END.py |
{
"filename": "line_fitting.py",
"repo_name": "HETDEX/hetdex_api",
"repo_path": "hetdex_api_extracted/hetdex_api-master/hetdex_tools/line_fitting.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Some line fitting functions using the specutils package
Functions with output spectra from get_spec.py
This is very preliminary and should not be used without
discussing it with Erin.
author = Erin Mentuch Cooper
"""
import os
import os.path as op
import numpy as np
import matplotlib.pypl... | HETDEXREPO_NAMEhetdex_apiPATH_START.@hetdex_api_extracted@hetdex_api-master@hetdex_tools@line_fitting.py@.PATH_END.py |
{
"filename": "bphase.py",
"repo_name": "himmng/Closure_phase_analysis",
"repo_path": "Closure_phase_analysis_extracted/Closure_phase_analysis-master/bphase.py",
"type": "Python"
} | try:
import os
import warnings
import numpy as np
from scipy import signal
from astropy.io import fits
from astropy import constants
from pyuvdata import UVData
from pyuvdata.data import DATA_PATH
from astropy import units as u
from astropy.cosmology import Planck18
from astr... | himmngREPO_NAMEClosure_phase_analysisPATH_START.@Closure_phase_analysis_extracted@Closure_phase_analysis-master@bphase.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.