metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "bicycle_gan_model.py",
"repo_name": "junyanz/BicycleGAN",
"repo_path": "BicycleGAN_extracted/BicycleGAN-master/models/bicycle_gan_model.py",
"type": "Python"
} | import torch
from .base_model import BaseModel
from . import networks
class BiCycleGANModel(BaseModel):
@staticmethod
def modify_commandline_options(parser, is_train=True):
return parser
def __init__(self, opt):
if opt.isTrain:
assert opt.batch_size % 2 == 0 # load two images... | junyanzREPO_NAMEBicycleGANPATH_START.@BicycleGAN_extracted@BicycleGAN-master@models@bicycle_gan_model.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatterpolargl/line/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._width import WidthValidator
from ._shape import ShapeValidator
from ._dash import DashValidator
from ._color import ColorValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatterpolargl@line@__init__.py@.PATH_END.py |
{
"filename": "constants.py",
"repo_name": "carronj/LensIt",
"repo_path": "LensIt_extracted/LensIt-master/lensit/clusterlens/constants.py",
"type": "Python"
} | import numpy as np
# Some useful constants
# Solar mass
Msol_kg = 1.98840987e+30 # in kg
# 1 Megaparsec in meter
Mpc_m = 30856775814671914*1e6
# Speed of light in Mpc / s
c_Mpcs = 299792458 / Mpc_m
# Gravitational constant
G_m3_pkg_ps2 = 6.67430 *1e-11 # In m^3 / kg / s^2
G_Mpc3_pMsol_ps2 = G_m3_pkg_ps2 / M... | carronjREPO_NAMELensItPATH_START.@LensIt_extracted@LensIt-master@lensit@clusterlens@constants.py@.PATH_END.py |
{
"filename": "__main__.py",
"repo_name": "musevlt/zap",
"repo_path": "zap_extracted/zap-master/zap/__main__.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
import argparse
import logging
import sys
from zap.zap import process, CFTYPE_OPTIONS, __version__
def main():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description='ZAP (the Zurich Atmosphere Purge) is a high precision '
... | musevltREPO_NAMEzapPATH_START.@zap_extracted@zap-master@zap@__main__.py@.PATH_END.py |
{
"filename": "corrprior.ipynb",
"repo_name": "changhoonhahn/provabgs",
"repo_path": "provabgs_extracted/provabgs-main/nb/tests/corrprior.ipynb",
"type": "Jupyter Notebook"
} | ```python
import numpy as np
# --- plotting ---
import corner as DFM
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rcParams['text.usetex'] = True
mpl.rcParams['font.family'] = 'serif'
mpl.rcParams['axes.linewidth'] = 1.5
mpl.rcParams['axes.xmargin'] = 1
mpl.rcParams['xtick.labelsize'] = 'x-large'
mpl.rc... | changhoonhahnREPO_NAMEprovabgsPATH_START.@provabgs_extracted@provabgs-main@nb@tests@corrprior.ipynb@.PATH_END.py |
{
"filename": "_title.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/contourcarpet/colorbar/_title.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Title(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "contourcarpet.colorbar"
_path_str = "contourcarpet.colorbar.title"
_valid_props = {"font", "s... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@contourcarpet@colorbar@_title.py@.PATH_END.py |
{
"filename": "_ticksuffix.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/coloraxis/colorbar/_ticksuffix.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicksuffixValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="ticksuffix",
parent_name="layout.coloraxis.colorbar",
**kwargs,
):
super(TicksuffixValidator, self).__init__(
plotly... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@coloraxis@colorbar@_ticksuffix.py@.PATH_END.py |
{
"filename": "rf_chain_example.py",
"repo_name": "grand-mother/grand",
"repo_path": "grand_extracted/grand-main/examples/simulation/du/rf_chain_example.py",
"type": "Python"
} | """
"""
import matplotlib.pyplot as plt
import scipy.fft as sf
import numpy as np
import grand.manage_log as mlg
import grand.simu.du.rf_chain as edu
# specific logger definition for script because __mane__ is "__main__" !
logger = mlg.get_logger_for_script(__file__)
# define a handler for logger : standard only
... | grand-motherREPO_NAMEgrandPATH_START.@grand_extracted@grand-main@examples@simulation@du@rf_chain_example.py@.PATH_END.py |
{
"filename": "separable_conv2d.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/layers/convolutional/separable_conv2d.py",
"type": "Python"
} | from keras.src.api_export import keras_export
from keras.src.layers.convolutional.base_separable_conv import BaseSeparableConv
@keras_export(
[
"keras.layers.SeparableConv2D",
"keras.layers.SeparableConvolution2D",
]
)
class SeparableConv2D(BaseSeparableConv):
"""2D separable convolution l... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@layers@convolutional@separable_conv2d.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/scattercarpet/selected/marker/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._size import SizeValidator
from ._opacity import OpacityValidator
from ._color import ColorValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_i... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattercarpet@selected@marker@__init__.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/setuptools/py3/setuptools/config/__init__.py",
"type": "Python"
} | """For backward compatibility, expose main functions from
``setuptools.config.setupcfg``
"""
from functools import wraps
from typing import Callable, TypeVar, cast
from ..warnings import SetuptoolsDeprecationWarning
from . import setupcfg
Fn = TypeVar("Fn", bound=Callable)
__all__ = ('parse_configuration', 'read_co... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@setuptools@py3@setuptools@config@__init__.py@.PATH_END.py |
{
"filename": "check_priors.py",
"repo_name": "j-faria/kima",
"repo_path": "kima_extracted/kima-master/pykima/check_priors.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
import sys
import numpy as np
import scipy.stats as st
import matplotlib.pyplot as plt
import argparse
def _parse_args():
desc = """
A small script to check correct sampling from the priors.
Remember to run kima with the maximum number of levels
set to 1 (and save interval = 1 ... | j-fariaREPO_NAMEkimaPATH_START.@kima_extracted@kima-master@pykima@check_priors.py@.PATH_END.py |
{
"filename": "AsyncProcessPool.py",
"repo_name": "saopicc/DDFacet",
"repo_path": "DDFacet_extracted/DDFacet-master/DDFacet/Other/AsyncProcessPool.py",
"type": "Python"
} | '''
DDFacet, a facet-based radio imaging package
Copyright (C) 2013-2016 Cyril Tasse, l'Observatoire de Paris,
SKA South Africa, Rhodes University
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; eit... | saopiccREPO_NAMEDDFacetPATH_START.@DDFacet_extracted@DDFacet-master@DDFacet@Other@AsyncProcessPool.py@.PATH_END.py |
{
"filename": "pyphantom.py",
"repo_name": "alisonkyoung1/phantom",
"repo_path": "phantom_extracted/phantom-master/scripts/pyphantom/pyphantom.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ctypes import *
from numpy import zeros, shape, loadtxt, concatenate
from os import listdir, path
import re
# Exceptions
class UnableToReadDumpFile(Exception):
pass
class IncorrectNumberOfParticles(Exception):
pass
class SpecificEnergyNotStored(Exception):
pass... | alisonkyoung1REPO_NAMEphantomPATH_START.@phantom_extracted@phantom-master@scripts@pyphantom@pyphantom.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/sunburst/_opacity.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OpacityValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="opacity", parent_name="sunburst", **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@sunburst@_opacity.py@.PATH_END.py |
{
"filename": "metrics.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/ops/metrics.py",
"type": "Python"
} | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@ops@metrics.py@.PATH_END.py |
{
"filename": "mkidtesting.py",
"repo_name": "MazinLab/MKIDGen3",
"repo_path": "MKIDGen3_extracted/MKIDGen3-main/scripts/arraysetup/mkidtesting.py",
"type": "Python"
} | import mkidgen3 as g3
import numpy as np
from mkidgen3.drivers.ifboard import IFBoard
from logging import getLogger, basicConfig
import matplotlib.pyplot as plt
#basicConfig()
#getLogger("mkidgen3.drivers.ifboard").setLevel("DEBUG")
bitstream='/home/xilinx/bit/cordic_16_15_fir_22_0.bit'
ol = g3.overlay_helpers.conf... | MazinLabREPO_NAMEMKIDGen3PATH_START.@MKIDGen3_extracted@MKIDGen3-main@scripts@arraysetup@mkidtesting.py@.PATH_END.py |
{
"filename": "test_apophis.py",
"repo_name": "matthewholman/assist",
"repo_path": "assist_extracted/assist-main/assist/test/test_apophis.py",
"type": "Python"
} | import rebound
import assist
import unittest
import math
import numpy as np
class TestAssist(unittest.TestCase):
def test_apophis(self):
ephem = assist.Ephem("data/linux_p1550p2650.440", "data/sb441-n16.bsp")
t_initial = 2.4621385359989386E+06 - ephem.jd_ref # Julian Days relative to jd_ref
... | matthewholmanREPO_NAMEassistPATH_START.@assist_extracted@assist-main@assist@test@test_apophis.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "federicomarulli/CosmoBolognaLib",
"repo_path": "CosmoBolognaLib_extracted/CosmoBolognaLib-master/External/MGCAMB/pycamb/docs/source/conf.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
#
# MyProj documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 18 20:57:49 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | federicomarulliREPO_NAMECosmoBolognaLibPATH_START.@CosmoBolognaLib_extracted@CosmoBolognaLib-master@External@MGCAMB@pycamb@docs@source@conf.py@.PATH_END.py |
{
"filename": "Basic example.ipynb",
"repo_name": "ajshajib/dolphin",
"repo_path": "dolphin_extracted/dolphin-main/notebooks/Basic example.ipynb",
"type": "Jupyter Notebook"
} | # Simplest use case
## Running a model from the config file
Setting up the `dolphin` ecosystem:
- Install `dolphin`, `lenstronomy`, and the required dependencies.
- Create an input/output directory for `dolphin`, we are using "../io_directory_example" in this example.
- Set up these directories inside the input/outp... | ajshajibREPO_NAMEdolphinPATH_START.@dolphin_extracted@dolphin-main@notebooks@Basic example.ipynb@.PATH_END.py |
{
"filename": "_alignsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/heatmapgl/hoverlabel/_alignsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class AlignsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="alignsrc", parent_name="heatmapgl.hoverlabel", **kwargs
):
super(AlignsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@heatmapgl@hoverlabel@_alignsrc.py@.PATH_END.py |
{
"filename": "_hovertextsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/image/_hovertextsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HovertextsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="hovertextsrc", parent_name="image", **kwargs):
super(HovertextsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@image@_hovertextsrc.py@.PATH_END.py |
{
"filename": "vizier.py",
"repo_name": "snad-space/ztf-viewer",
"repo_path": "ztf-viewer_extracted/ztf-viewer-master/ztf_viewer/catalogs/vizier.py",
"type": "Python"
} | import logging
from collections import namedtuple
import numpy as np
from astropy.coordinates import SkyCoord
from astroquery.cds import cds
from astroquery.vizier import Vizier
from ztf_viewer.cache import cache
from ztf_viewer.exceptions import NotFound
class VizierCatalogDetails:
@staticmethod
@cache()
... | snad-spaceREPO_NAMEztf-viewerPATH_START.@ztf-viewer_extracted@ztf-viewer-master@ztf_viewer@catalogs@vizier.py@.PATH_END.py |
{
"filename": "test_examples.py",
"repo_name": "kyleaoman/martini",
"repo_path": "martini_extracted/martini-main/tests/test_examples.py",
"type": "Python"
} | import os
from martini.__version__ import __version__
import pytest
class TestExamples:
def test_source_injection_example_version(self):
"""
Check that the source injection notebook installs current version of martini.
"""
with open("examples/martini_source_injection.ipynb") as f:
... | kyleaomanREPO_NAMEmartiniPATH_START.@martini_extracted@martini-main@tests@test_examples.py@.PATH_END.py |
{
"filename": "core.py",
"repo_name": "dmlc/xgboost",
"repo_path": "xgboost_extracted/xgboost-master/python-package/xgboost/spark/core.py",
"type": "Python"
} | """XGBoost pyspark integration submodule for core code."""
import base64
# pylint: disable=fixme, protected-access, no-member, invalid-name
# pylint: disable=too-many-lines, too-many-branches
import json
import logging
import os
from collections import namedtuple
from dataclasses import asdict
from typing import (
... | dmlcREPO_NAMExgboostPATH_START.@xgboost_extracted@xgboost-master@python-package@xgboost@spark@core.py@.PATH_END.py |
{
"filename": "check_logsheet.py",
"repo_name": "arjunsavel/SImMER",
"repo_path": "SImMER_extracted/SImMER-main/src/simmer/check_logsheet.py",
"type": "Python"
} | # AS
# Created: 7/17/19
# Updated: 2/16/20
# Updated: 6/16/20
"""
Capability to check whether logsheet format is conducive to creating a config.
"""
import numpy as np
import pandas as pd
from . import add_dark_exp as ad
import logging
logger = logging.getLogger('simmer')
def check_logsheet(inst, log_name, tab=Non... | arjunsavelREPO_NAMESImMERPATH_START.@SImMER_extracted@SImMER-main@src@simmer@check_logsheet.py@.PATH_END.py |
{
"filename": "conversion.py",
"repo_name": "kemasuda/jnkepler",
"repo_path": "jnkepler_extracted/jnkepler-main/src/jnkepler/jaxttv/conversion.py",
"type": "Python"
} | __all__ = [
"reduce_angle", "m_to_u", "tic_to_u", "tic_to_m", "elements_to_xv", "xv_to_elements",
"jacobi_to_astrocentric", "j2a_map", "astrocentric_to_cm", "a2cm_map", "cm_to_astrocentric",
"xvjac_to_xvacm", "xvjac_to_xvcm"
]
import jax.numpy as jnp
from jax import jit, vmap, config
from jax.lax import s... | kemasudaREPO_NAMEjnkeplerPATH_START.@jnkepler_extracted@jnkepler-main@src@jnkepler@jaxttv@conversion.py@.PATH_END.py |
{
"filename": "expand_cmake_vars.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/third_party/xla/third_party/tsl/third_party/llvm_openmp/expand_cmake_vars.py",
"type": "Python"
} | # Copyright 2016 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@third_party@xla@third_party@tsl@third_party@llvm_openmp@expand_cmake_vars.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "benrendle/AIMS",
"repo_path": "AIMS_extracted/AIMS-master/AIMS_v1.0/doc/conf.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
#
# AIMS documentation build configuration file, created by
# sphinx-quickstart on Thu Apr 16 14:52:14 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | benrendleREPO_NAMEAIMSPATH_START.@AIMS_extracted@AIMS-master@AIMS_v1.0@doc@conf.py@.PATH_END.py |
{
"filename": "mice.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/imputation/mice.py",
"type": "Python"
} | """
Overview
--------
This module implements the Multiple Imputation through Chained
Equations (MICE) approach to handling missing data in statistical data
analyses. The approach has the following steps:
0. Impute each missing value with the mean of the observed values of
the same variable.
1. For each variable in t... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@imputation@mice.py@.PATH_END.py |
{
"filename": "levels_lines.py",
"repo_name": "tardis-sn/carsus",
"repo_path": "carsus_extracted/carsus-master/carsus/io/output/levels_lines.py",
"type": "Python"
} | import functools
import logging
import astropy.constants as const
import astropy.units as u
import numpy as np
import pandas as pd
from carsus.util import convert_atomic_number2symbol, convert_wavelength_air2vacuum
from carsus.io.util import get_lvl_index2id, create_artificial_fully_ionized
# Wavelengths above this ... | tardis-snREPO_NAMEcarsusPATH_START.@carsus_extracted@carsus-master@carsus@io@output@levels_lines.py@.PATH_END.py |
{
"filename": "test_shared_memory.py",
"repo_name": "icrar/daliuge",
"repo_path": "daliuge_extracted/daliuge-master/daliuge-engine/test/test_shared_memory.py",
"type": "Python"
} | #
# ICRAR - International Centre for Radio Astronomy Research
# (c) UWA - The University of Western Australia, 2016
# Copyright by UWA (in the framework of the ICRAR)
# All rights reserved
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser G... | icrarREPO_NAMEdaliugePATH_START.@daliuge_extracted@daliuge-master@daliuge-engine@test@test_shared_memory.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "LSSTDESC/Spectractor",
"repo_path": "Spectractor_extracted/Spectractor-master/spectractor/fit/__init__.py",
"type": "Python"
} | LSSTDESCREPO_NAMESpectractorPATH_START.@Spectractor_extracted@Spectractor-master@spectractor@fit@__init__.py@.PATH_END.py | |
{
"filename": "psf_selection.py",
"repo_name": "spacetelescope/mirage",
"repo_path": "mirage_extracted/mirage-master/mirage/psf/psf_selection.py",
"type": "Python"
} | #! /usr/bin/env python
"""This module contains code to locate the appropriate PSF library files
to use for a given simulation. It supports the selection of one PSF
"core" file, which is assumed to contain a 3D array of PSFs that is read
into a ``griddedPSFmodel`` instance, as well as a single PSF "wings" file,
which c... | spacetelescopeREPO_NAMEmiragePATH_START.@mirage_extracted@mirage-master@mirage@psf@psf_selection.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "ysBach/NICpolpy",
"repo_path": "NICpolpy_extracted/NICpolpy-master/nicpolpy/__init__.py",
"type": "Python"
} | from .util import *
from .prepare import *
from .preproc import *
from .phot import *
from .NICPolReduc import *
from astropy.wcs import FITSFixedWarning
import warnings
warnings.filterwarnings('ignore', append=True, category=FITSFixedWarning) | ysBachREPO_NAMENICpolpyPATH_START.@NICpolpy_extracted@NICpolpy-master@nicpolpy@__init__.py@.PATH_END.py |
{
"filename": "scope.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/pythran/pythran/analyses/scope.py",
"type": "Python"
} | """
Scope computes scope information
"""
from pythran.analyses.ancestors import AncestorsWithBody
from pythran.analyses.use_def_chain import DefUseChains
from pythran.passmanager import FunctionAnalysis
from collections import defaultdict
import gast as ast
class Scope(FunctionAnalysis):
'''
Associate each ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@pythran@pythran@analyses@scope.py@.PATH_END.py |
{
"filename": "_lenmode.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/bar/marker/colorbar/_lenmode.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LenmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="lenmode", parent_name="bar.marker.colorbar", **kwargs
):
super(LenmodeValidator, self).__init__(
plotly_name=plotly_name,
paren... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@bar@marker@colorbar@_lenmode.py@.PATH_END.py |
{
"filename": "s4_genLC.py",
"repo_name": "kevin218/Eureka",
"repo_path": "Eureka_extracted/Eureka-main/src/eureka/S4_generate_lightcurves/s4_genLC.py",
"type": "Python"
} | #! /usr/bin/env python
# Generic Stage 4 light curve generation pipeline
# Proposed Steps
# -------- -----
# 1. Read in Stage 3 data products
# 2. Replace NaNs with zero
# 3. Determine wavelength bins
# 4. Increase resolution of spectra (optional)
# 5. Smooth spectra (optional)
# 6. Applying 1D drift correction... | kevin218REPO_NAMEEurekaPATH_START.@Eureka_extracted@Eureka-main@src@eureka@S4_generate_lightcurves@s4_genLC.py@.PATH_END.py |
{
"filename": "algorithm-main-stages_fighting-biases.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/concepts/algorithm-main-stages_fighting-biases.md",
"type": "Markdown"
} | # Unbiased boosting
{{ product }} implements an algorithm that allows to fight usual gradient boosting biases.
A detailed description of the algorithm is given in the following paper: [{{ ext__papers____arxiv_org_abs_1706_09516__name }}](https://arxiv.org/abs/1706.09516).
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@concepts@algorithm-main-stages_fighting-biases.md@.PATH_END.py |
{
"filename": "stratsi_eqm.py",
"repo_name": "minkailin/stratsi",
"repo_path": "stratsi_extracted/stratsi-master/discussion_visc1/stratsi_eqm.py",
"type": "Python"
} | """
stratified streaming instability
equilibrium vertical profiles of horizontal velocities
"""
'''
import parameters and functions
'''
from stratsi_params import *
'''
process command line arguements
'''
parser = argparse.ArgumentParser()
parser.add_argument("--xlim", "-xl", nargs='*', help="set horizontal axis r... | minkailinREPO_NAMEstratsiPATH_START.@stratsi_extracted@stratsi-master@discussion_visc1@stratsi_eqm.py@.PATH_END.py |
{
"filename": "test_outputs.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/yt/frontends/ytdata/tests/test_outputs.py",
"type": "Python"
} | import os
import shutil
import tempfile
import numpy as np
from numpy.testing import assert_array_equal, assert_equal
from yt.data_objects.api import create_profile
from yt.frontends.ytdata.api import (
YTDataContainerDataset,
YTGridDataset,
YTNonspatialDataset,
YTProfileDataset,
YTSpatialPlotData... | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@frontends@ytdata@tests@test_outputs.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "huggingface/peft",
"repo_path": "peft_extracted/peft-main/src/peft/tuners/mixed/__init__.py",
"type": "Python"
} | # Copyright 2023-present the HuggingFace Inc. team.
#
# 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... | huggingfaceREPO_NAMEpeftPATH_START.@peft_extracted@peft-main@src@peft@tuners@mixed@__init__.py@.PATH_END.py |
{
"filename": "Tutorial-ID_converter_ILGRMHD.ipynb",
"repo_name": "zachetienne/nrpytutorial",
"repo_path": "nrpytutorial_extracted/nrpytutorial-master/IllinoisGRMHD/ID_converter_ILGRMHD/doc/Tutorial-ID_converter_ILGRMHD.ipynb",
"type": "Jupyter Notebook"
} | <script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-59152712-8');
</script>
# Tutorial-ID_converter_ILGRMHD
## Authors: Leo Werneck & ... | zachetienneREPO_NAMEnrpytutorialPATH_START.@nrpytutorial_extracted@nrpytutorial-master@IllinoisGRMHD@ID_converter_ILGRMHD@doc@Tutorial-ID_converter_ILGRMHD.ipynb@.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/legendgrouptitle/font/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._weight import WeightValidator
from ._variant import VariantValidator
from ._textcase import TextcaseValidator
from ._style import StyleValidator
from ._size import SizeValidator
from ._shadow impor... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@indicator@legendgrouptitle@font@__init__.py@.PATH_END.py |
{
"filename": "maxima.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/Pygments/py3/pygments/lexers/maxima.py",
"type": "Python"
} | """
pygments.lexers.maxima
~~~~~~~~~~~~~~~~~~~~~~
Lexer for the computer algebra system Maxima.
Derived from pygments/lexers/algebra.py.
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexL... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@Pygments@py3@pygments@lexers@maxima.py@.PATH_END.py |
{
"filename": "Rays_Filter.py",
"repo_name": "xastprl/darsakx",
"repo_path": "darsakx_extracted/darsakx-main/darsakx/Rays_Filter.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
def ray_filter(ray_data,r,x0,xi,lp,lh,st,theta,j):
## ray after hitting the hyperbola at a shell at r0, ray should not hit hyperbola for the shell at r0-dr0
if (r[j]-r[j-1])<=st[j-1]:
raise Exception("Shell thickness error: two shells are intersecting")
r0_next=... | xastprlREPO_NAMEdarsakxPATH_START.@darsakx_extracted@darsakx-main@darsakx@Rays_Filter.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattermapbox/unselected/marker/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="color",
parent_name="scattermapbox.unselected.marker",
**kwargs,
):
super(ColorValidator, self).__init__(
plotly_name=plot... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattermapbox@unselected@marker@_color.py@.PATH_END.py |
{
"filename": "tof_data_analysis.py",
"repo_name": "JulianZDing/UniMAP",
"repo_path": "UniMAP_extracted/UniMAP-main/tof_data_analysis.py",
"type": "Python"
} | import os
import numpy as np
from collections import defaultdict
from matplotlib import pyplot as plt
from gwpy.timeseries import TimeSeries
from gwpy.time import tconvert
from tqdm.auto import tqdm
from ts_outlier_detection import *
from ts_outlier_detection.plotting import *
VMIN = 0
VMAX = 25.5
def _scale_widt... | JulianZDingREPO_NAMEUniMAPPATH_START.@UniMAP_extracted@UniMAP-main@tof_data_analysis.py@.PATH_END.py |
{
"filename": "vectorstore.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/memory/vectorstore.py",
"type": "Python"
} | """Class for a VectorStore-backed memory object."""
from typing import Any, Dict, List, Optional, Sequence, Union
from langchain_core._api import deprecated
from langchain_core.documents import Document
from langchain_core.vectorstores import VectorStoreRetriever
from pydantic import Field
from langchain.memory.chat... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@memory@vectorstore.py@.PATH_END.py |
{
"filename": "figures.ipynb",
"repo_name": "tere-valdivia/Barnard_5_infall",
"repo_path": "Barnard_5_infall_extracted/Barnard_5_infall-main/figures.ipynb",
"type": "Jupyter Notebook"
} | # Figures for Barnard 5 at large and small scale
In this notebook, we do the figures for all data, from large scale to small scale and the comparison between them.
These were in two separate notebooks, one for ALMA and another one for NOEMA, but it is more convenient to have all figures in one place.
```python
impo... | tere-valdiviaREPO_NAMEBarnard_5_infallPATH_START.@Barnard_5_infall_extracted@Barnard_5_infall-main@figures.ipynb@.PATH_END.py |
{
"filename": "iforest.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scikit-learn/py2/sklearn/ensemble/iforest.py",
"type": "Python"
} | # Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# License: BSD 3 clause
from __future__ import division
import numpy as np
import scipy as sp
from warnings import warn
from scipy.sparse import issparse
import numbers
from ..external... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scikit-learn@py2@sklearn@ensemble@iforest.py@.PATH_END.py |
{
"filename": "_lineposition.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/sunburst/textfont/_lineposition.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LinepositionValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(
self, plotly_name="lineposition", parent_name="sunburst.textfont", **kwargs
):
super(LinepositionValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@sunburst@textfont@_lineposition.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/indicator/gauge/bar/line/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="indicator.gauge.bar.line", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@indicator@gauge@bar@line@_color.py@.PATH_END.py |
{
"filename": "core.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/numpy/py2/numpy/ma/core.py",
"type": "Python"
} | """
numpy.ma : a package to handle missing or invalid values.
This package was initially written for numarray by Paul F. Dubois
at Lawrence Livermore National Laboratory.
In 2006, the package was completely rewritten by Pierre Gerard-Marchant
(University of Georgia) to make the MaskedArray class a subclass of ndarray,... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@numpy@py2@numpy@ma@core.py@.PATH_END.py |
{
"filename": "test_nirspec_wcs.py",
"repo_name": "spacetelescope/jwst",
"repo_path": "jwst_extracted/jwst-main/jwst/regtest/test_nirspec_wcs.py",
"type": "Python"
} | import numpy as np
import pytest
from numpy.testing import assert_allclose
from gwcs.wcstools import grid_from_bounding_box
from stdatamodels.jwst import datamodels
from jwst.assign_wcs import AssignWcsStep, nirspec
@pytest.mark.bigdata
@pytest.mark.parametrize('input_file',
['jw02072002001... | spacetelescopeREPO_NAMEjwstPATH_START.@jwst_extracted@jwst-main@jwst@regtest@test_nirspec_wcs.py@.PATH_END.py |
{
"filename": "_waveforms.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/signal/_waveforms.py",
"type": "Python"
} | # Author: Travis Oliphant
# 2003
#
# Feb. 2010: Updated by Warren Weckesser:
# Rewrote much of chirp()
# Added sweep_poly()
import numpy as np
from numpy import asarray, zeros, place, nan, mod, pi, extract, log, sqrt, \
exp, cos, sin, polyval, polyint
__all__ = ['sawtooth', 'square', 'gausspulse', 'chirp', 's... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@signal@_waveforms.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/mpmath/py3/mpmath/__init__.py",
"type": "Python"
} | __version__ = '1.3.0'
from .usertools import monitor, timing
from .ctx_fp import FPContext
from .ctx_mp import MPContext
from .ctx_iv import MPIntervalContext
fp = FPContext()
mp = MPContext()
iv = MPIntervalContext()
fp._mp = mp
mp._mp = mp
iv._mp = mp
mp._fp = fp
fp._fp = fp
mp._iv = iv
fp._iv = iv
iv._iv = iv
#... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@mpmath@py3@mpmath@__init__.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "PaCER-BLINK-Project/imager",
"repo_path": "imager_extracted/imager-main/README.md",
"type": "Markdown"
} | # Building the project in this branch is as follows:
- Laptop/workstation using NVIDIA :
- CPU :
cd build
cmake ..
make
make test
sudo make install
- GPU :
cd build_gpu
cmake -DUSE_HIP=ON -DCUDA_SM=86 .. # make use to change CUDA_SM to value relevant to your specif... | PaCER-BLINK-ProjectREPO_NAMEimagerPATH_START.@imager_extracted@imager-main@README.md@.PATH_END.py |
{
"filename": "flux_conserve_proj.py",
"repo_name": "Yash-10/beta-sgp",
"repo_path": "beta-sgp_extracted/beta-sgp-master/restoration/flux_conserve_proj.py",
"type": "Python"
} | # Approach used for the flux-conservation constraint from http://dx.doi.org/10.1051/0004-6361/201118681 and Bonettini et al. 2009.
import numpy as np
EPSILON = np.finfo(float).eps
def projectDF(b, c, dia, scaling, ccd_sat_level=None, lambda_=0, dlambda_=1, tol_lam=1e-11, biter=0, siter=0, max_projs=1000):
"""
... | Yash-10REPO_NAMEbeta-sgpPATH_START.@beta-sgp_extracted@beta-sgp-master@restoration@flux_conserve_proj.py@.PATH_END.py |
{
"filename": "_family.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterternary/marker/colorbar/tickfont/_family.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="family",
parent_name="scatterternary.marker.colorbar.tickfont",
**kwargs,
):
super(FamilyValidator, self).__init__(
plot... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterternary@marker@colorbar@tickfont@_family.py@.PATH_END.py |
{
"filename": "planar_reconstruction.ipynb",
"repo_name": "astro-informatics/DarkMappy",
"repo_path": "DarkMappy_extracted/DarkMappy-main/docs/assets/static_notebooks/planar_reconstruction.ipynb",
"type": "Jupyter Notebook"
} | # Super-resolution Planar Mass-mapping
This example instantiates the planar massmapping forward model with the **super-resolution operator active**. Moreover, this the example is also **noise whitened**; which is to say the pixel space map is multiplied by the inverse noise covariance matrix $\Sigma^{-1}$ -- which is s... | astro-informaticsREPO_NAMEDarkMappyPATH_START.@DarkMappy_extracted@DarkMappy-main@docs@assets@static_notebooks@planar_reconstruction.ipynb@.PATH_END.py |
{
"filename": "g3tsmurf_utils.py",
"repo_name": "simonsobs/sotodlib",
"repo_path": "sotodlib_extracted/sotodlib-master/sotodlib/io/g3tsmurf_utils.py",
"type": "Python"
} | """Utility functions for interacting with level 2 data and g3tsmurf
"""
import os
import numpy as np
import logging
import yaml
from sqlalchemy import desc, asc, or_, and_, not_
from so3g.hk import load_range
import sotodlib.core as core
from sotodlib.io.load_smurf import load_file, SmurfStatus, G3tSmurf
from soto... | simonsobsREPO_NAMEsotodlibPATH_START.@sotodlib_extracted@sotodlib-master@sotodlib@io@g3tsmurf_utils.py@.PATH_END.py |
{
"filename": "summary_utils.py",
"repo_name": "fchollet/keras",
"repo_path": "keras_extracted/keras-master/keras/src/utils/summary_utils.py",
"type": "Python"
} | import functools
import math
import re
import shutil
import rich
import rich.console
import rich.markup
# See https://github.com/keras-team/keras/issues/448
# for below imports
import rich.table
from keras.src import backend
from keras.src import tree
from keras.src.utils import dtype_utils
from keras.src.utils impo... | fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@utils@summary_utils.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/tests/integration_tests/chains/openai_functions/__init__.py",
"type": "Python"
} | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@tests@integration_tests@chains@openai_functions@__init__.py@.PATH_END.py | |
{
"filename": "test_wavfile.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/io/tests/test_wavfile.py",
"type": "Python"
} | import os
import sys
from io import BytesIO
import threading
import numpy as np
from numpy.testing import (assert_equal, assert_, assert_array_equal,
break_cycles, suppress_warnings, IS_PYPY)
import pytest
from pytest import raises, warns
from scipy.io import wavfile
def datafile(fn):
... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@io@tests@test_wavfile.py@.PATH_END.py |
{
"filename": "build-spatial-filters.py",
"repo_name": "macrocosme/shwirl",
"repo_path": "shwirl_extracted/shwirl-master/shwirl/extern/vispy/glsl/build-spatial-filters.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# glumpy is an OpenGL framework for the fast visualization of numpy arrays.
# Copyright (C) 2009-2011 Nicolas P. Rougier. All rights reserved.
#
# Redistribution and use in source and binary fo... | macrocosmeREPO_NAMEshwirlPATH_START.@shwirl_extracted@shwirl-master@shwirl@extern@vispy@glsl@build-spatial-filters.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "lsst-uk/lasair-lsst",
"repo_path": "lasair-lsst_extracted/lasair-lsst-main/webserver/users/oldmigrations/__init__.py",
"type": "Python"
} | lsst-ukREPO_NAMElasair-lsstPATH_START.@lasair-lsst_extracted@lasair-lsst-main@webserver@users@oldmigrations@__init__.py@.PATH_END.py | |
{
"filename": "nersc_desi_spectral_fitting.ipynb",
"repo_name": "changhoonhahn/provabgs",
"repo_path": "provabgs_extracted/provabgs-main/docs/nb/nersc_desi_spectral_fitting.ipynb",
"type": "Jupyter Notebook"
} | # DESI spectral fitting on NERSC
In this jupyter notebook, I'll demonstrate how we can use the `provabgs` pipeline to fit DESI spectra! This notebook uses the DESI master jupyter notebook kernel (see [Jupyter on NERSC](https://desi.lbl.gov/trac/wiki/Computing/JupyterAtNERSC) for instructions).
```python
# lets insta... | changhoonhahnREPO_NAMEprovabgsPATH_START.@provabgs_extracted@provabgs-main@docs@nb@nersc_desi_spectral_fitting.ipynb@.PATH_END.py |
{
"filename": "flare_finding_example-checkpoint.ipynb",
"repo_name": "iveydavis/flare_id",
"repo_path": "flare_id_extracted/flare_id-main/.ipynb_checkpoints/flare_finding_example-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | ```python
import flare_id
import pandas as pd
import matplotlib.pyplot as plt
import importlib
importlib.reload(flare_id)
```
/home/idavis/anaconda3/lib/python3.9/site-packages/lightkurve/config/__init__.py:119: UserWarning: The default Lightkurve cache directory, used by download(), etc., has been moved to /home/... | iveydavisREPO_NAMEflare_idPATH_START.@flare_id_extracted@flare_id-main@.ipynb_checkpoints@flare_finding_example-checkpoint.ipynb@.PATH_END.py |
{
"filename": "Crossbar-License.md",
"repo_name": "crossbario/crossbar",
"repo_path": "crossbar_extracted/crossbar-master/docs-old/pages/about/Crossbar-License.md",
"type": "Markdown"
} | title: Crossbar.io Code License
toc: [Documentation, Crossbar License]
# Crossbar.io Code License
## Code
The Crossbar.io [source code](https://github.com/crossbario/crossbar/tree/master/crossbar) is licensed under the [GNU AGPL 3.0](http://www.gnu.org/licenses/agpl-3.0.html). You can find a copy of the license in t... | crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@docs-old@pages@about@Crossbar-License.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattercarpet/marker/colorbar/title/font/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._weight import WeightValidator
from ._variant import VariantValidator
from ._textcase import TextcaseValidator
from ._style import StyleValidator
from ._size import SizeValidator
from ._shadow impor... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattercarpet@marker@colorbar@title@font@__init__.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "ywx649999311/EzTao",
"repo_path": "EzTao_extracted/EzTao-master/src/eztao/carma/__init__.py",
"type": "Python"
} | from .CARMATerm import DRW_term, DHO_term, CARMA_term
from .CARMATerm import acf
from .model_utils import *
| ywx649999311REPO_NAMEEzTaoPATH_START.@EzTao_extracted@EzTao-master@src@eztao@carma@__init__.py@.PATH_END.py |
{
"filename": "test_decorators.py",
"repo_name": "PlasmaPy/PlasmaPy",
"repo_path": "PlasmaPy_extracted/PlasmaPy-main/tests/particles/test_decorators.py",
"type": "Python"
} | """Tests for `plasmapy.particles.decorators`."""
import inspect
import sys
from collections.abc import Callable, Iterable
from typing import Any
import astropy.constants as const
import astropy.units as u
import pytest
from plasmapy.particles.decorators import particle_input
from plasmapy.particles.exceptions import... | PlasmaPyREPO_NAMEPlasmaPyPATH_START.@PlasmaPy_extracted@PlasmaPy-main@tests@particles@test_decorators.py@.PATH_END.py |
{
"filename": "AbstractMast.py",
"repo_name": "barentsen/dave",
"repo_path": "dave_extracted/dave-master/fileio/AbstractMast.py",
"type": "Python"
} |
"""
Abstract classes for interfacing with the Mast Kepler Data archives.
Used by mastio.py
"""
import urllib
import math
import os
import pyfits
class MastArchive():
"""Base class for queries of the MAST Kepler and K2 archives.
Handles submitting the URL, receiving and caching the results
The child ... | barentsenREPO_NAMEdavePATH_START.@dave_extracted@dave-master@fileio@AbstractMast.py@.PATH_END.py |
{
"filename": "Tutorial-Start_to_Finish-GiRaFFE_NRPy-3D_tests-staggered.ipynb",
"repo_name": "zachetienne/nrpytutorial",
"repo_path": "nrpytutorial_extracted/nrpytutorial-master/in_progress-GiRaFFE_NRPy/Tutorial-Start_to_Finish-GiRaFFE_NRPy-3D_tests-staggered.ipynb",
"type": "Jupyter Notebook"
} | <script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-59152712-8');
</script>
# Start-to-Finish Example: `GiRaFFE_NRPy` 3D tests
### Aut... | zachetienneREPO_NAMEnrpytutorialPATH_START.@nrpytutorial_extracted@nrpytutorial-master@in_progress-GiRaFFE_NRPy@Tutorial-Start_to_Finish-GiRaFFE_NRPy-3D_tests-staggered.ipynb@.PATH_END.py |
{
"filename": "pippi_parse.py",
"repo_name": "GambitBSM/pippi",
"repo_path": "pippi_extracted/pippi-master/pippi_parse.py",
"type": "Python"
} |
#############################################################
# pippi: parse it, plot it
# ------------------------
# Parsing program for pippi.
#
# Author: Pat Scott (patscott@physics.mcgill.ca)
# Originally developed: March 2012
#############################################################
from __future__ import pr... | GambitBSMREPO_NAMEpippiPATH_START.@pippi_extracted@pippi-master@pippi_parse.py@.PATH_END.py |
{
"filename": "de_interface.py",
"repo_name": "DarkQuestCosmology/dark_emulator_public",
"repo_path": "dark_emulator_public_extracted/dark_emulator_public-main/dark_emulator/darkemu/de_interface.py",
"type": "Python"
} | import os
from .cosmo_util import cosmo_class
from .cosmo_util import constants
from .pklin import pklin_gp
from .xinl import xinl_gp
from .gamma1 import gamma1_gp
from .cross import cross_gp
from .auto import auto_gp
from .hmf import hmf_gp
from .. import fftlog
import numpy as np
from scipy.interpolate import Interpo... | DarkQuestCosmologyREPO_NAMEdark_emulator_publicPATH_START.@dark_emulator_public_extracted@dark_emulator_public-main@dark_emulator@darkemu@de_interface.py@.PATH_END.py |
{
"filename": "misc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/library/python/testing/yatest_common/yatest/common/misc.py",
"type": "Python"
} | import functools
def first(it):
for d in it:
if d:
return d
def lazy(func):
res = []
@functools.wraps(func)
def wrapper(*args, **kwargs):
if not res:
res.append(func(*args, **kwargs))
return res[0]
return wrapper
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@library@python@testing@yatest_common@yatest@common@misc.py@.PATH_END.py |
{
"filename": "test_get_reparameterisation.py",
"repo_name": "mj-will/nessai",
"repo_path": "nessai_extracted/nessai-main/tests/test_reparameterisations/test_get_reparameterisation.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
General tests of `get_reparameterisation`.
"""
import pytest
from nessai.reparameterisations import (
Angle,
AnglePair,
NullReparameterisation,
Reparameterisation,
Rescale,
RescaleToBounds,
ToCartesian,
get_reparameterisation,
)
# List of known reparameteri... | mj-willREPO_NAMEnessaiPATH_START.@nessai_extracted@nessai-main@tests@test_reparameterisations@test_get_reparameterisation.py@.PATH_END.py |
{
"filename": "lgmres.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/sparse/linalg/_isolve/lgmres.py",
"type": "Python"
} | # Copyright (C) 2009, Pauli Virtanen <pav@iki.fi>
# Distributed under the same license as SciPy.
import numpy as np
from numpy.linalg import LinAlgError
from scipy.linalg import get_blas_funcs
from .iterative import _get_atol_rtol
from .utils import make_system
from ._gcrotmk import _fgmres
__all__ = ['lgmres']
de... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@sparse@linalg@_isolve@lgmres.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "alexrhowe/ExoVista",
"repo_path": "ExoVista_extracted/ExoVista-main/src/setup.py",
"type": "Python"
} | from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from Cython.Distutils import build_ext
# Build command:
# python setup.py build_ext --inplace
#import os
#os.environ['CC'] = 'gcc'
#os.environ['CXX'] = 'g++'
ext_modules1=[Extension("wrapImage",sources=["wra... | alexrhoweREPO_NAMEExoVistaPATH_START.@ExoVista_extracted@ExoVista-main@src@setup.py@.PATH_END.py |
{
"filename": "Photon_Postage_Test_V4.ipynb",
"repo_name": "MazinLab/MKIDGen3",
"repo_path": "MKIDGen3_extracted/MKIDGen3-main/notebooks/Photon_Postage_Test_V4.ipynb",
"type": "Jupyter Notebook"
} | # Import Drivers+, Download Overlay
```python
import logging
import sys
import pynq
import time
from pynq import PL, buffer
import numpy as np
from fpbinary import FpBinary
import matplotlib.pyplot as plt
from scipy.fftpack import fft, fftfreq, fftshift
import scipy.io as sio
import mkidgen3 as g3
import mkidgen3.m... | MazinLabREPO_NAMEMKIDGen3PATH_START.@MKIDGen3_extracted@MKIDGen3-main@notebooks@Photon_Postage_Test_V4.ipynb@.PATH_END.py |
{
"filename": "_weightsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterternary/textfont/_weightsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WeightsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="weightsrc", parent_name="scatterternary.textfont", **kwargs
):
super(WeightsrcValidator, self).__init__(
plotly_name=plotly_name,
pa... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterternary@textfont@_weightsrc.py@.PATH_END.py |
{
"filename": "classify_source.py",
"repo_name": "SKA-INAF/sclassifier",
"repo_path": "sclassifier_extracted/sclassifier-master/scripts/classify_source.py",
"type": "Python"
} | #!/usr/bin/env python
from __future__ import print_function
##################################################
### MODULE IMPORT
##################################################
## STANDARD MODULES
import os
import sys
import subprocess
import string
import time
import signal
from threading import Thread
i... | SKA-INAFREPO_NAMEsclassifierPATH_START.@sclassifier_extracted@sclassifier-master@scripts@classify_source.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "transientskp/tkp",
"repo_path": "tkp_extracted/tkp-master/tkp/utility/__init__.py",
"type": "Python"
} | """
Root level :mod:`tkp.utility` functions that don't justify a submodule:
"""
import math
def nice_format(f):
if f > 9999 or f < 0.01:
return "%.2e" % f
else:
return "%.2f" % f
def substitute(value, sub, test_f):
try:
if test_f(value):
return sub
except TypeError... | transientskpREPO_NAMEtkpPATH_START.@tkp_extracted@tkp-master@tkp@utility@__init__.py@.PATH_END.py |
{
"filename": "base.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/tools/playwright/base.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools.playwright.base import BaseBrowserTool
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional i... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@tools@playwright@base.py@.PATH_END.py |
{
"filename": "test_ludlow_vs_sigma_cmz.py",
"repo_name": "halomod/halomod",
"repo_path": "halomod_extracted/halomod-main/devel/test_ludlow_vs_sigma_cmz.py",
"type": "Python"
} | """A quick script to print out some intermediate results testing the Ludlow16 concentration
model vs. the Sigma_cMz_Py code, originally written by Ludlow et al.
"""
import matplotlib.pyplot as plt
import numpy as np
from hmf import MassFunction
from halomod import concentration as cm
# Use the actual power spectrum ... | halomodREPO_NAMEhalomodPATH_START.@halomod_extracted@halomod-main@devel@test_ludlow_vs_sigma_cmz.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/treemap/pathbar/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._visible import VisibleValidator
from ._thickness import ThicknessValidator
from ._textfont import TextfontValidator
from ._side import SideValidator
from ._edgeshape import EdgeshapeValidator
else:
from _plotly_utils.importers import relative_impo... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@treemap@pathbar@__init__.py@.PATH_END.py |
{
"filename": "basevalidators.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/_plotly_utils/basevalidators.py",
"type": "Python"
} | from __future__ import absolute_import
import base64
import numbers
import textwrap
import uuid
from importlib import import_module
import copy
import io
from copy import deepcopy
import re
import sys
from six import string_types
from _plotly_utils.optional_imports import get_module
# back-port of fullmatch from Py... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@_plotly_utils@basevalidators.py@.PATH_END.py |
{
"filename": "converter.py",
"repo_name": "jluastro/PopSyCLE",
"repo_path": "PopSyCLE_extracted/PopSyCLE-main/popsycle/converter.py",
"type": "Python"
} | #! /usr/bin/env python
"""
converter.py
Functions for converting PopSyCLE data formats.
"""
import h5py
import numpy as np
from popsycle.synthetic import _generate_compound_dtype
def convert_h5_array_dtype_to_compound_dtype(hdf5_file):
"""
Converts h5 files with the array datatype into the compound datatype
... | jluastroREPO_NAMEPopSyCLEPATH_START.@PopSyCLE_extracted@PopSyCLE-main@popsycle@converter.py@.PATH_END.py |
{
"filename": "_legendwidth.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/histogram/_legendwidth.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LegendwidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="legendwidth", parent_name="histogram", **kwargs):
super(LegendwidthValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_na... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@histogram@_legendwidth.py@.PATH_END.py |
{
"filename": "ode_test.py",
"repo_name": "google/jax",
"repo_path": "jax_extracted/jax-main/tests/ode_test.py",
"type": "Python"
} | # Copyright 2020 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@tests@ode_test.py@.PATH_END.py |
{
"filename": "models.py",
"repo_name": "yuliang419/AstroNet-Triage",
"repo_path": "AstroNet-Triage_extracted/AstroNet-Triage-master/astronet/models.py",
"type": "Python"
} | # Copyright 2018 The TensorFlow 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 ... | yuliang419REPO_NAMEAstroNet-TriagePATH_START.@AstroNet-Triage_extracted@AstroNet-Triage-master@astronet@models.py@.PATH_END.py |
{
"filename": "amethyst.py",
"repo_name": "1313e/CMasher",
"repo_path": "CMasher_extracted/CMasher-master/src/cmasher/colormaps/amethyst/amethyst.py",
"type": "Python"
} | import matplotlib as mpl
from matplotlib.colors import ListedColormap
# All declaration
__all__ = ["cmap"]
# Author declaration
__author__ = "Ellert van der Velden (@1313e)"
# Package declaration
__package__ = "cmasher"
# %% GLOBALS AND DEFINITIONS
# Type of this colormap
cm_type = "sequential"
# RGB-values of th... | 1313eREPO_NAMECMasherPATH_START.@CMasher_extracted@CMasher-master@src@cmasher@colormaps@amethyst@amethyst.py@.PATH_END.py |
{
"filename": "custom-borders__contains__intro.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage-formats/custom-borders__contains__intro.md",
"type": "Markdown"
} |
Custom quantization borders and the method for processing missing values for the dataset numerical features.
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage-formats@custom-borders__contains__intro.md@.PATH_END.py |
{
"filename": "imf.py",
"repo_name": "fraserevans/speedystar",
"repo_path": "speedystar_extracted/speedystar-main/speedystar/utils/imfmaster/imf/imf.py",
"type": "Python"
} | """
Various codes to work with the initial mass function
"""
from __future__ import print_function
import numpy as np
import types
import scipy.integrate
from scipy.special import erf
from six import iteritems
import scipy.integrate as integrate
from scipy.integrate import quad
from . import distributions
class Mass... | fraserevansREPO_NAMEspeedystarPATH_START.@speedystar_extracted@speedystar-main@speedystar@utils@imfmaster@imf@imf.py@.PATH_END.py |
{
"filename": "CDG_gd.py",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/examples/tutorial/CDG_gd.py",
"type": "Python"
} | from amuse.lab import *
def main(Ncl, mcl, rcl, W0, t_end, n_steps):
converter = nbody_system.nbody_to_si(mcl, rcl)
bodies = new_king_model(Ncl, W0, convert_nbody=converter)
gravity = Hermite(converter)
gravity.particles.add_particles(bodies)
channel_from_gravity_to_framework = gravity.particles.... | amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@examples@tutorial@CDG_gd.py@.PATH_END.py |
{
"filename": "wavelets.py",
"repo_name": "epfl-radio-astro/LiSA",
"repo_path": "LiSA_extracted/LiSA-main/modules/util/wavelets.py",
"type": "Python"
} | import numpy as np
import pysap
import pysparse
class StarletTransform(object):
"""
Decomposition of an image using the Isotropic Undecimated Walevet Transform,
also known as "starlet" or "B-spline", using the 'a trous' algorithm.
Astronomical data (galaxies, stars, ...) are often very sparsely repre... | epfl-radio-astroREPO_NAMELiSAPATH_START.@LiSA_extracted@LiSA-main@modules@util@wavelets.py@.PATH_END.py |
{
"filename": "stellar_flux_resample.py",
"repo_name": "exoclime/VULCAN",
"repo_path": "VULCAN_extracted/VULCAN-master/plot_py/stellar_flux_resample.py",
"type": "Python"
} | import sys
sys.path.insert(0, '../') # including the upper level of directory for the path of modules
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.legend as lg
import vulcan_cfg
try: from PIL import Image
except ImportError:
try: import Image
except: vulcan_cfg.use_PIL = False
import ... | exoclimeREPO_NAMEVULCANPATH_START.@VULCAN_extracted@VULCAN-master@plot_py@stellar_flux_resample.py@.PATH_END.py |
{
"filename": "demo_colorbar_with_inset_locator.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/galleries/examples/axes_grid1/demo_colorbar_with_inset_locator.py",
"type": "Python"
} | """
.. _demo-colorbar-with-inset-locator:
===========================================================
Control the position and size of a colorbar with Inset Axes
===========================================================
This example shows how to control the position, height, and width of colorbars
using `~mpl_toolk... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@galleries@examples@axes_grid1@demo_colorbar_with_inset_locator.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.