metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "__init__.py",
"repo_name": "musevlt/zap",
"repo_path": "zap_extracted/zap-master/zap/__init__.py",
"type": "Python"
} | from .utils import *
from .zap import *
| musevltREPO_NAMEzapPATH_START.@zap_extracted@zap-master@zap@__init__.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "webbjj/m2mcluster",
"repo_path": "m2mcluster_extracted/m2mcluster-main/README.md",
"type": "Markdown"
} | # m2mcluster
A python packaged for made to measure modelling of star clusters. Please cite Webb, Hunt, and Bovy 2022 if you use this package for your work.
# Installation
To install m2mcluster from GitHub, clone the repository and install via setup tools:
`git clone https://github.com/webbjj/m2mcluster.git`
`cd m2mcl... | webbjjREPO_NAMEm2mclusterPATH_START.@m2mcluster_extracted@m2mcluster-main@README.md@.PATH_END.py |
{
"filename": "helpers.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/document_loaders/helpers.py",
"type": "Python"
} | """Document loader helpers."""
import concurrent.futures
from pathlib import Path
from typing import List, NamedTuple, Optional, Union, cast
class FileEncoding(NamedTuple):
"""File encoding as the NamedTuple."""
encoding: Optional[str]
"""The encoding of the file."""
confidence: float
"""The con... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@document_loaders@helpers.py@.PATH_END.py |
{
"filename": "test_observations.py",
"repo_name": "desy-multimessenger/nuztf",
"repo_path": "nuztf_extracted/nuztf-main/tests/test_observations.py",
"type": "Python"
} | #!/usr/bin/env python
# coding: utf-8
import logging
import unittest
from astropy import units as u
from astropy.time import Time
from nuztf.observations import get_obs_summary_skyvision
class TestCoverage(unittest.TestCase):
def setUp(self):
self.logger = logging.getLogger(__name__)
self.logge... | desy-multimessengerREPO_NAMEnuztfPATH_START.@nuztf_extracted@nuztf-main@tests@test_observations.py@.PATH_END.py |
{
"filename": "_hovertext.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/treemap/_hovertext.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HovertextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="hovertext", parent_name="treemap", **kwargs):
super(HovertextValidator, 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@treemap@_hovertext.py@.PATH_END.py |
{
"filename": "sampler.py",
"repo_name": "nye17/javelin",
"repo_path": "javelin_extracted/javelin-master/javelin/emcee_internal/sampler.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The base sampler class implementing various helpful functions.
"""
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__all__ = ["Sampler"]
import numpy as np
class Sampler(object):
"""
An abstract ... | nye17REPO_NAMEjavelinPATH_START.@javelin_extracted@javelin-master@javelin@emcee_internal@sampler.py@.PATH_END.py |
{
"filename": "test_TPZ_Rtree.py",
"repo_name": "mgckind/MLZ",
"repo_path": "MLZ_extracted/MLZ-master/mlz/test/test_TPZ_Rtree.py",
"type": "Python"
} | from numpy import *
import os, sys
path_src = os.path.abspath(os.path.join(os.getcwd(), '../../'))
if not path_src in sys.path: sys.path.insert(1, path_src)
from mlz.ml_codes import *
#X and Y can be anything, in this case SDSS mags and colors for X and photo-z for Y
X = loadtxt('SDSS_MGS.train', usecols=(1, 2, 3, 4,... | mgckindREPO_NAMEMLZPATH_START.@MLZ_extracted@MLZ-master@mlz@test@test_TPZ_Rtree.py@.PATH_END.py |
{
"filename": "proto_ops.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/ops/proto_ops.py",
"type": "Python"
} | # Copyright 2018 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@proto_ops.py@.PATH_END.py |
{
"filename": "core.py",
"repo_name": "grazianoucci/game",
"repo_path": "game_extracted/game-master/game/core.py",
"type": "Python"
} | import multiprocessing
import os
import time
from functools import partial
from itertools import chain
import numpy as np
from sklearn import tree
from sklearn.ensemble import AdaBoostRegressor
from game_alg import main_algorithm_to_pool
from ml import determination_models
from prepare import read_emission_line_file,... | grazianoucciREPO_NAMEgamePATH_START.@game_extracted@game-master@game@core.py@.PATH_END.py |
{
"filename": "DKS_2013_solids.py",
"repo_name": "geodynamics/burnman",
"repo_path": "burnman_extracted/burnman-main/burnman/minerals/DKS_2013_solids.py",
"type": "Python"
} | # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for
# the Earth and Planetary Sciences
# Copyright (C) 2012 - 2021 by the BurnMan team, released under the GNU
# GPL v2 or later.
"""
DKS_2013_solids
^^^^^^^^^^^^^^^
Solids from de Koker and Stixrude (2013) FPMD simulations
"""
from ..classes... | geodynamicsREPO_NAMEburnmanPATH_START.@burnman_extracted@burnman-main@burnman@minerals@DKS_2013_solids.py@.PATH_END.py |
{
"filename": "T_S_I_V_.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/fonttools/fontTools/ttLib/tables/T_S_I_V_.py",
"type": "Python"
} | from fontTools.misc.textTools import strjoin, tobytes, tostr
from . import asciiTable
class table_T_S_I_V_(asciiTable.asciiTable):
def toXML(self, writer, ttFont):
data = tostr(self.data)
# removing null bytes. XXX needed??
data = data.split("\0")
data = strjoin(data)
write... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@fonttools@fontTools@ttLib@tables@T_S_I_V_.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "Herculens/herculens",
"repo_path": "herculens_extracted/herculens-main/herculens/Analysis/__init__.py",
"type": "Python"
} | HerculensREPO_NAMEherculensPATH_START.@herculens_extracted@herculens-main@herculens@Analysis@__init__.py@.PATH_END.py | |
{
"filename": "data.py",
"repo_name": "jzuhone/soxs",
"repo_path": "soxs_extracted/soxs-main/soxs/data.py",
"type": "Python"
} | import numpy as np
cdf_fluxes = np.array(
[
7.62703e-22,
1.14505e-21,
1.71908e-21,
2.58087e-21,
3.87469e-21,
5.81711e-21,
8.73329e-21,
1.31114e-20,
1.96842e-20,
2.95521e-20,
4.43669e-20,
6.66085e-20,
1.00000e-19... | jzuhoneREPO_NAMEsoxsPATH_START.@soxs_extracted@soxs-main@soxs@data.py@.PATH_END.py |
{
"filename": "cal_sols_rts.md",
"repo_name": "MWATelescope/mwa_hyperdrive",
"repo_path": "mwa_hyperdrive_extracted/mwa_hyperdrive-main/mdbook/src/defs/cal_sols_rts.md",
"type": "Markdown"
} | # The `RTS` calibration solutions format

This format is extremely complicated and therefore its usage is discouraged.
However, it is possible to convert `RTS` solutions to one of the other supported
formats; a metafits file is required, and the *director... | MWATelescopeREPO_NAMEmwa_hyperdrivePATH_START.@mwa_hyperdrive_extracted@mwa_hyperdrive-main@mdbook@src@defs@cal_sols_rts.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "cosimoNigro/agnpy",
"repo_path": "agnpy_extracted/agnpy-master/agnpy/photo_meson/tests/__init__.py",
"type": "Python"
} | cosimoNigroREPO_NAMEagnpyPATH_START.@agnpy_extracted@agnpy-master@agnpy@photo_meson@tests@__init__.py@.PATH_END.py | |
{
"filename": "backend_wx.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/matplotlib/backends/backend_wx.py",
"type": "Python"
} | """
A wxPython backend for matplotlib, based (very heavily) on
backend_template.py and backend_gtk.py
Author: Jeremy O'Donoghue (jeremy@o-donoghue.com)
Derived from original copyright work by John Hunter
(jdhunter@ace.bsd.uchicago.edu)
Copyright (C) Jeremy O'Donoghue & John Hunter, 2003-4
License: This work ... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@matplotlib@backends@backend_wx.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "rbuehler/vasca",
"repo_path": "vasca_extracted/vasca-main/vasca/test/__init__.py",
"type": "Python"
} | rbuehlerREPO_NAMEvascaPATH_START.@vasca_extracted@vasca-main@vasca@test@__init__.py@.PATH_END.py | |
{
"filename": "create_sed.ipynb",
"repo_name": "BDNYC/sedkit",
"repo_path": "sedkit_extracted/sedkit-main/sedkit/notebooks/create_sed.ipynb",
"type": "Jupyter Notebook"
} | # Make an SED and calculate fundamental parameters
`SEDkit` is used primarily for the creation and analysis of spectral energy distributions. The code stitches together the provided photometry and spectra and flux calibrates it given a distance. Simple integration then gives the bolometric luminosity. If radius is give... | BDNYCREPO_NAMEsedkitPATH_START.@sedkit_extracted@sedkit-main@sedkit@notebooks@create_sed.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "jrenaud90/TidalPy",
"repo_path": "TidalPy_extracted/TidalPy-main/TidalPy/RadialSolver/interfaces/__init__.py",
"type": "Python"
} | jrenaud90REPO_NAMETidalPyPATH_START.@TidalPy_extracted@TidalPy-main@TidalPy@RadialSolver@interfaces@__init__.py@.PATH_END.py | |
{
"filename": "gui.py",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/gui.py",
"type": "Python"
} | #!/usr/bin/python3
__author__ = 'Trifon Trifonov'
import time
from pathos.multiprocessing import freeze_support
freeze_support()
import numpy as np
#import matplotlib as mpl
#mpl.use('Qt5Agg')
import sys, os, traceback
from PyQt6 import QtCore, QtGui, QtWidgets, uic
import json
#import collections
#if sys.versio... | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@gui.py@.PATH_END.py |
{
"filename": "sim_cmb_cluster_lens.py",
"repo_name": "ebaxter/CMBClusterLens",
"repo_path": "CMBClusterLens_extracted/CMBClusterLens-main/sim_cmb_cluster_lens.py",
"type": "Python"
} |
import torch
import numpy as np
import matplotlib.pyplot as pl
from scipy import interpolate as interp
import pdb
import time
import precompute
import map_funcs
import lensing_funcs
import obs_funcs
from astropy import constants as const
from astropy import units as u
from colossus.halo import profile_nfw
from col... | ebaxterREPO_NAMECMBClusterLensPATH_START.@CMBClusterLens_extracted@CMBClusterLens-main@sim_cmb_cluster_lens.py@.PATH_END.py |
{
"filename": "Thermal_evolution.py",
"repo_name": "lorenaacuna/GASTLI",
"repo_path": "GASTLI_extracted/GASTLI-main/src/Thermal_evolution.py",
"type": "Python"
} |
# Import coupling module
import gastli.Coupling as cpl
from gastli.atm_models_interp import maxloc
# Other Python modules
import numpy as np
import math
from scipy import integrate
from scipy import interpolate
from scipy.integrate import odeint
class thermal_evolution:
def __init__(self,path_to_file,pow_law_... | lorenaacunaREPO_NAMEGASTLIPATH_START.@GASTLI_extracted@GASTLI-main@src@Thermal_evolution.py@.PATH_END.py |
{
"filename": "connect.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/io/ascii/connect.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file connects the readers/writers to the astropy.table.Table class
from __future__ import absolute_import, division, print_function
import re
import functools
from .. import registry as io_registry
from ...table import Table
from ...extern.six.mo... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@io@ascii@connect.py@.PATH_END.py |
{
"filename": "cplusplus_apply_catboost_model__performance.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage-common-phrases/cplusplus_apply_catboost_model__performance.md",
"type": "Markdown"
} |
The {{ method_name__apply_cplusplus_model }} method is inferior in performance compared to the native {{ product }} application methods, especially on large models and datasets.
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage-common-phrases@cplusplus_apply_catboost_model__performance.md@.PATH_END.py |
{
"filename": "loha.md",
"repo_name": "huggingface/peft",
"repo_path": "peft_extracted/peft-main/docs/source/package_reference/loha.md",
"type": "Markdown"
} | <!--Copyright 2023 The HuggingFace Team. 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 applicable law or agreed... | huggingfaceREPO_NAMEpeftPATH_START.@peft_extracted@peft-main@docs@source@package_reference@loha.md@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/scatter3d/line/colorbar/title/_font.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatter3d.line.colorbar.title"
_path_str = "scatter3d.line.colorbar.title.font"
_valid_props =... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@scatter3d@line@colorbar@title@_font.py@.PATH_END.py |
{
"filename": "admin.py",
"repo_name": "lsst-uk/lasair-lsst",
"repo_path": "lasair-lsst_extracted/lasair-lsst-main/webserver/users/admin.py",
"type": "Python"
} | from django.contrib import admin
from .models import Profile
admin.site.register(Profile)
| lsst-ukREPO_NAMElasair-lsstPATH_START.@lasair-lsst_extracted@lasair-lsst-main@webserver@users@admin.py@.PATH_END.py |
{
"filename": "subclassing.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/numpy/py2/numpy/doc/subclassing.py",
"type": "Python"
} | """=============================
Subclassing ndarray in python
=============================
Introduction
------------
Subclassing ndarray is relatively simple, but it has some complications
compared to other Python objects. On this page we explain the machinery
that allows you to subclass ndarray, and the implicati... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@numpy@py2@numpy@doc@subclassing.py@.PATH_END.py |
{
"filename": "test_agn_eline.py",
"repo_name": "bd-j/prospector",
"repo_path": "prospector_extracted/prospector-main/tests/test_agn_eline.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from sedpy import observate
from prospect.observation import Spectrum, Photometry
from prospect.models.sedmodel import AGNSpecModel
from prospect.models.templates import TemplateLibrary
from prospect.sources import CSPSpecBasis
def test_agn_elines():
... | bd-jREPO_NAMEprospectorPATH_START.@prospector_extracted@prospector-main@tests@test_agn_eline.py@.PATH_END.py |
{
"filename": "_pathbar.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/treemap/_pathbar.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class PathbarValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="pathbar", parent_name="treemap", **kwargs):
super(PathbarValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@treemap@_pathbar.py@.PATH_END.py |
{
"filename": "_sizesrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/violin/hoverlabel/font/_sizesrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="sizesrc", parent_name="violin.hoverlabel.font", **kwargs
):
super(SizesrcValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@violin@hoverlabel@font@_sizesrc.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "rahulshah1397/LADDER",
"repo_path": "LADDER_extracted/LADDER-main/README.md",
"type": "Markdown"
} | # 
[](https://github.com/rahulshah1397/LADDER)
[](https://github.com/rahulshah1397/LADDER/blob/main/LICENSE)
[
Psi_i's : 7 NRM-derived phases, zero mean
dpsf : data psf ... | agreenbaumREPO_NAMEgsgsPATH_START.@gsgs_extracted@gsgs-master@test_gs.py@.PATH_END.py |
{
"filename": "cache_filters.ipynb",
"repo_name": "starkit/wsynphot",
"repo_path": "wsynphot_extracted/wsynphot-master/docs/io/cache_filters.ipynb",
"type": "Jupyter Notebook"
} | # Using cache_filters (cf) module
It lets you to download the filter data fromn SVO FPS and save it locally on disk as cache, so that you can access it faster. Hence you can even use wsynphot package offline as per your convinience. It also provides functions to load the required filter data from the cache instantaneou... | starkitREPO_NAMEwsynphotPATH_START.@wsynphot_extracted@wsynphot-master@docs@io@cache_filters.ipynb@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "projectchrono/chrono",
"repo_path": "chrono_extracted/chrono-main/src/tests/README.md",
"type": "Markdown"
} | Unit test and benchmark tests
==============
Most Chrono unit tests rely on the [googletest](https://github.com/google/googletest) library.
The Chrono benchmark tests use the [googlebenchmark](https://github.com/google/benchmark) library (except the Chrono::Sensor benchmark tests).
These two supporting libraries are ... | projectchronoREPO_NAMEchronoPATH_START.@chrono_extracted@chrono-main@src@tests@README.md@.PATH_END.py |
{
"filename": "_x.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/histogram/_x.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="x", parent_name="histogram", **kwargs):
super(XValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=k... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@histogram@_x.py@.PATH_END.py |
{
"filename": "_showlegend.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/bar/_showlegend.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowlegendValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="showlegend", parent_name="bar", **kwargs):
super(ShowlegendValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@bar@_showlegend.py@.PATH_END.py |
{
"filename": "rotation.py",
"repo_name": "rodluger/starry",
"repo_path": "starry_extracted/starry-master/starry/_core/ops/rotation.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
from ...compat import Apply, Op, tt
import numpy as np
__all__ = ["dotROp", "tensordotRzOp"]
class dotROp(Op):
def __init__(self, func):
self.func = func
self._grad_op = dotRGradientOp(self)
def make_node(self, *inputs):
inputs = [tt.as_tensor_variable(i) for ... | rodlugerREPO_NAMEstarryPATH_START.@starry_extracted@starry-master@starry@_core@ops@rotation.py@.PATH_END.py |
{
"filename": "PSI_model_synthesis_14Feb2022.ipynb",
"repo_name": "tschad/pycelp",
"repo_path": "pycelp_extracted/pycelp-main/examples/PSI_model_synthesis_14Feb2022.ipynb",
"type": "Jupyter Notebook"
} | # **PSI Model Synthesis Notebook for 14 Feb 2022**
Tom Schad
----
- This notebook does an example synthesis of the global corona using a Predictive Sciences MHD model.
- Most of the details for synthesis of any line at any time can be gleaned from this example; however, it is not currently build as its own class. ... | tschadREPO_NAMEpycelpPATH_START.@pycelp_extracted@pycelp-main@examples@PSI_model_synthesis_14Feb2022.ipynb@.PATH_END.py |
{
"filename": "tile_maps.py",
"repo_name": "amanchokshi/EMBERS",
"repo_path": "EMBERS_extracted/EMBERS-master/src/embers/tile_maps/tile_maps.py",
"type": "Python"
} | """
Tile Maps
----------
A set of tools to project satellite passes onto a healpix map according to their ephemeris.
"""
import concurrent.futures
import json
from itertools import repeat
from pathlib import Path
import healpy as hp
import matplotlib
import numpy as np
from embers.rf_tools.colormaps import jade, sp... | amanchokshiREPO_NAMEEMBERSPATH_START.@EMBERS_extracted@EMBERS-master@src@embers@tile_maps@tile_maps.py@.PATH_END.py |
{
"filename": "_textcasesrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterternary/textfont/_textcasesrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextcasesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="textcasesrc", parent_name="scatterternary.textfont", **kwargs
):
super(TextcasesrcValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterternary@textfont@_textcasesrc.py@.PATH_END.py |
{
"filename": "test.py",
"repo_name": "bolverk/huji-rich",
"repo_path": "huji-rich_extracted/huji-rich-master/tests/newtonian/one_dimensional/simple_waves/test.py",
"type": "Python"
} | def L1_error_norm(a1, a2):
abs_diff = [abs(x-y) for x,y in zip(a1,a2)]
return sum(abs_diff)/len(a1)
def chi2_error_norm(a1,a2):
import math
diff2 = [(x-y)**2 for x,y in zip(a1,a2)]
return math.sqrt(sum(diff2)/len(a1))
def error_norm(a1, a2, test_name='L1'):
if 'L1'==test_name:
retu... | bolverkREPO_NAMEhuji-richPATH_START.@huji-rich_extracted@huji-rich-master@tests@newtonian@one_dimensional@simple_waves@test.py@.PATH_END.py |
{
"filename": "outlier.py",
"repo_name": "dwkim78/ASTRiDE",
"repo_path": "ASTRiDE_extracted/ASTRiDE-master/astride/utils/outlier.py",
"type": "Python"
} | import numpy as np
from sklearn.ensemble import IsolationForest
from sklearn.neighbors import LocalOutlierFactor
class Outlier:
"""
Detect outliers using Machine Learning Algorithm.
This module will train a model in real-time, so it might be
CPU-intensive and time-consuming. Still testing and under ... | dwkim78REPO_NAMEASTRiDEPATH_START.@ASTRiDE_extracted@ASTRiDE-master@astride@utils@outlier.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "carronj/planck_PR4_lensing",
"repo_path": "planck_PR4_lensing_extracted/planck_PR4_lensing-main/planckpr4lensing/iswlens_jtliks/utils.py",
"type": "Python"
} | import numpy as np
w_pt = lambda ell: (ell * (ell + 1.) ) ** 1.5 / (2. * np.pi)
w_tp = w_pt
w_pp = lambda ell: ell ** 2 * (ell + 1.) ** 2 / (2. * np.pi)
w_tt = lambda ell: (ell * (ell + 1.)) / 2. / np.pi
def camb_clfile(fname, lmax=None):
"""CAMB spectra (lenspotentialCls, lensedCls or tensCls types) returned a... | carronjREPO_NAMEplanck_PR4_lensingPATH_START.@planck_PR4_lensing_extracted@planck_PR4_lensing-main@planckpr4lensing@iswlens_jtliks@utils.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "observethesun/PIL",
"repo_path": "PIL_extracted/PIL-main/README.md",
"type": "Markdown"
} | [](https://python.org)
[](https://pytorch.org)
## Machine Learning for Reconstruction of Polarity Inversio... | observethesunREPO_NAMEPILPATH_START.@PIL_extracted@PIL-main@README.md@.PATH_END.py |
{
"filename": "plot_sgd_comparison.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/examples/linear_model/plot_sgd_comparison.py",
"type": "Python"
} | """
==================================
Comparing various online solvers
==================================
An example showing how different online solvers perform
on the hand-written digits dataset.
"""
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
import matplotlib.pyplot as plt
impo... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@examples@linear_model@plot_sgd_comparison.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/carpet/aaxis/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._type import TypeValidator
from ._title import TitleValidator
from ._tickvalssrc import TickvalssrcValidator
from ._tickvals import TickvalsValidator
from ._ticktextsrc import TicktextsrcValidator
f... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@carpet@aaxis@__init__.py@.PATH_END.py |
{
"filename": "gplvm.py",
"repo_name": "pyro-ppl/pyro",
"repo_path": "pyro_extracted/pyro-master/pyro/contrib/gp/models/gplvm.py",
"type": "Python"
} | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import pyro.distributions as dist
from pyro.contrib.gp.parameterized import Parameterized
from pyro.nn.module import PyroSample, pyro_method
class GPLVM(Parameterized):
"""
Gaussian Process Latent Variable Model (GPLVM) m... | pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@pyro@contrib@gp@models@gplvm.py@.PATH_END.py |
{
"filename": "SolidBodyRotationWrapperPotential.py",
"repo_name": "jobovy/galpy",
"repo_path": "galpy_extracted/galpy-main/galpy/potential/SolidBodyRotationWrapperPotential.py",
"type": "Python"
} | ###############################################################################
# SolidBodyRotationWrapperPotential.py: Wrapper to make a potential rotate
# with a fixed pattern speed, around
# the z axis
#################################... | jobovyREPO_NAMEgalpyPATH_START.@galpy_extracted@galpy-main@galpy@potential@SolidBodyRotationWrapperPotential.py@.PATH_END.py |
{
"filename": "select_parallel_ms_stars.py",
"repo_name": "pyDANDIA/pyDANDIA",
"repo_path": "pyDANDIA_extracted/pyDANDIA-main/trials/select_parallel_ms_stars.py",
"type": "Python"
} | import numpy as np
file = '/Users/rstreet1/ROMEREA/test_data/ROME-FIELD-01_colour_photometry.txt'
file_lines = open(file, 'r').readlines()
gmin = 15.0
gmax = 18.0
gimin = 2.5
gimax = 3.5
data = []
for line in file_lines:
if line[0:1] != '#':
entries = line.replace('\n','').split()
row = []
... | pyDANDIAREPO_NAMEpyDANDIAPATH_START.@pyDANDIA_extracted@pyDANDIA-main@trials@select_parallel_ms_stars.py@.PATH_END.py |
{
"filename": "_tickformatstop.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/cone/colorbar/_tickformatstop.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Tickformatstop(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "cone.colorbar"
_path_str = "cone.colorbar.tickformatstop"
_valid_props = {"dtickrang... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@cone@colorbar@_tickformatstop.py@.PATH_END.py |
{
"filename": "test_middleware.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/tests/server/api/test_middleware.py",
"type": "Python"
} | from datetime import datetime, timedelta, timezone
import httpx
import pytest
import sqlalchemy as sa
from fastapi import FastAPI, status
from httpx import ASGITransport
from sqlalchemy.ext.asyncio import AsyncSession
from prefect.server import models, schemas
from prefect.server.api.middleware import CsrfMiddleware
... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@tests@server@api@test_middleware.py@.PATH_END.py |
{
"filename": "util.py",
"repo_name": "astro-friedel/CADRE",
"repo_path": "CADRE_extracted/CADRE-master/util.py",
"type": "Python"
} | import os,re,subprocess
"""
"""
def determineNumberOfCPUs():
""" Number of virtual or physical CPUs on this system, i.e.
user/real as output by time(1) when called with an optimally scaling userspace-only program"""
# Python 2.6+
try:
import multiprocessing
return multiprocessing.cp... | astro-friedelREPO_NAMECADREPATH_START.@CADRE_extracted@CADRE-master@util.py@.PATH_END.py |
{
"filename": "create_templates.py",
"repo_name": "baptklein/ATMOSPHERIX_DATA_RED",
"repo_path": "ATMOSPHERIX_DATA_RED_extracted/ATMOSPHERIX_DATA_RED-main/Templates/create_templates.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 16 14:07:36 2021
@author: florian
"""
import numpy as np
import os
import convolve_templates as conv
c0 = 299792458.0
G = 6.67e-11
h_planck = 6.62607015e-34
k_boltzmann = 1.380649e-23
def strided_app(a, L, S ): # Window len = L, Stride len/ste... | baptkleinREPO_NAMEATMOSPHERIX_DATA_REDPATH_START.@ATMOSPHERIX_DATA_RED_extracted@ATMOSPHERIX_DATA_RED-main@Templates@create_templates.py@.PATH_END.py |
{
"filename": "fields.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/yt/frontends/ytdata/fields.py",
"type": "Python"
} | from yt.fields.field_info_container import FieldInfoContainer
m_units = "g"
p_units = "cm"
v_units = "cm / s"
r_units = "cm"
class YTDataContainerFieldInfo(FieldInfoContainer):
known_other_fields = ()
known_particle_fields = ()
def __init__(self, ds, field_list):
super().__init__(ds, field_list... | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@frontends@ytdata@fields.py@.PATH_END.py |
{
"filename": "RELEASE.md",
"repo_name": "spotify/annoy",
"repo_path": "annoy_extracted/annoy-main/RELEASE.md",
"type": "Markdown"
} | How to release
--------------
1. Make sure you're on master. `git checkout master && git fetch && git reset --hard origin/master`
1. Update `setup.py` to the newest version, `git add setup.py && git commit -m "version 1.2.3"`
1. `python setup.py sdist bdist_wheel`
1. `git tag -a v1.2.3 -m "version 1.2.3"`
1. `git push... | spotifyREPO_NAMEannoyPATH_START.@annoy_extracted@annoy-main@RELEASE.md@.PATH_END.py |
{
"filename": "plot_observability.py",
"repo_name": "andrewmbuchan4/PyllutedWD_Public",
"repo_path": "PyllutedWD_Public_extracted/PyllutedWD_Public-main/src/plot_observability.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
import numpy as np
import chemistry_info as ci
import complete_model as cm
import graph_factory as gf
import manager as mn
from argparse import Namespace
pressure_args = {
ci.Element.Cr:{
#(0, 0): [458, 1.5, 0, 0.05, None, None, 0, None, -4, 6.5, ... | andrewmbuchan4REPO_NAMEPyllutedWD_PublicPATH_START.@PyllutedWD_Public_extracted@PyllutedWD_Public-main@src@plot_observability.py@.PATH_END.py |
{
"filename": "_width.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/waterfall/decreasing/marker/line/_width.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class WidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="width",
parent_name="waterfall.decreasing.marker.line",
**kwargs,
):
super(WidthValidator, self).__init__(
plotly_name=pl... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@waterfall@decreasing@marker@line@_width.py@.PATH_END.py |
{
"filename": "break_test_sersic_highn_basic.py",
"repo_name": "GalSim-developers/GalSim",
"repo_path": "GalSim_extracted/GalSim-main/devel/external/test_sersic_highn/break_test_sersic_highn_basic.py",
"type": "Python"
} | # Copyright (c) 2012-2023 by the GalSim developers team on GitHub
# https://github.com/GalSim-developers
#
# This file is part of GalSim: The modular galaxy image simulation toolkit.
# https://github.com/GalSim-developers/GalSim
#
# GalSim is free software: redistribution and use in source and binary forms,
# with or w... | GalSim-developersREPO_NAMEGalSimPATH_START.@GalSim_extracted@GalSim-main@devel@external@test_sersic_highn@break_test_sersic_highn_basic.py@.PATH_END.py |
{
"filename": "generate_compile_commands.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/third_party/xla/build_tools/lint/generate_compile_commands.py",
"type": "Python"
} | # Copyright 2023 The OpenXLA Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@third_party@xla@build_tools@lint@generate_compile_commands.py@.PATH_END.py |
{
"filename": "subset_widget.py",
"repo_name": "spacetelescope/jdaviz",
"repo_path": "jdaviz_extracted/jdaviz-main/jdaviz/configs/default/plugins/subset_widget/subset_widget.py",
"type": "Python"
} | from glue.core.message import EditSubsetMessage
from glue.core.edit_subset_mode import (AndMode, AndNotMode, OrMode,
ReplaceMode, XorMode)
from glue_jupyter.widgets.subset_mode_vuetify import SelectionModeMenu
from glue_jupyter.widgets.subset_select_vuetify import SubsetSelect
fr... | spacetelescopeREPO_NAMEjdavizPATH_START.@jdaviz_extracted@jdaviz-main@jdaviz@configs@default@plugins@subset_widget@subset_widget.py@.PATH_END.py |
{
"filename": "test_tasks.py",
"repo_name": "RafiKueng/SpaghettiLens",
"repo_path": "SpaghettiLens_extracted/SpaghettiLens-master/_backup2/deploy/test_tasks.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 25 15:02:18 2014
@author: rafik
"""
from __future__ import absolute_import
from fabric.api import settings, local, task
# from fabric.utils import *
# from fabric import operations as ops
# from fabric.contrib import console, files, project
from .fab_tools import GetOu... | RafiKuengREPO_NAMESpaghettiLensPATH_START.@SpaghettiLens_extracted@SpaghettiLens-master@_backup2@deploy@test_tasks.py@.PATH_END.py |
{
"filename": "test_results.py",
"repo_name": "sblunt/orbitize",
"repo_path": "orbitize_extracted/orbitize-main/tests/test_results.py",
"type": "Python"
} | """
Test the routines in the orbitize.Results module
"""
import orbitize
from orbitize import results, read_input, system, DATADIR, hipparcos, gaia, sampler
import numpy as np
import pytest
import os
std_labels = ["sma1", "ecc1", "inc1", "aop1", "pan1", "tau1", "plx", "mtot"]
std_param_idx = {
"sma1": 0,
"ecc... | sbluntREPO_NAMEorbitizePATH_START.@orbitize_extracted@orbitize-main@tests@test_results.py@.PATH_END.py |
{
"filename": "_variant.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter/legendgrouptitle/font/_variant.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="variant",
parent_name="scatter.legendgrouptitle.font",
**kwargs,
):
super(VariantValidator, self).__init__(
plotly_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter@legendgrouptitle@font@_variant.py@.PATH_END.py |
{
"filename": "astroobsresult.py",
"repo_name": "dingswin/psrvlbireduce",
"repo_path": "psrvlbireduce_extracted/psrvlbireduce-master/datareduction/astroobsresult.py",
"type": "Python"
} | #!/usr/bin/python
import math, astro_utils, os, sys
import numpy as np
class PmparInput:
def __init__(self, filename=""):
self.defaultepoch = 56000
self.headerendlinenum = 0
self.haveepoch = False
self.numkeywords = 0
self.astrometric_points = []
self.numpoints = 0
... | dingswinREPO_NAMEpsrvlbireducePATH_START.@psrvlbireduce_extracted@psrvlbireduce-master@datareduction@astroobsresult.py@.PATH_END.py |
{
"filename": "test_pseudo_diffs.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/fftpack/tests/test_pseudo_diffs.py",
"type": "Python"
} | # Created by Pearu Peterson, September 2002
__usage__ = """
Build fftpack:
python setup_fftpack.py build
Run tests if scipy is installed:
python -c 'import scipy;scipy.fftpack.test(<level>)'
Run tests if fftpack is not installed:
python tests/test_pseudo_diffs.py [<level>]
"""
from numpy.testing import (assert_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@fftpack@tests@test_pseudo_diffs.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "i4Ds/sdo-cli",
"repo_path": "sdo-cli_extracted/sdo-cli-main/src/sdo/cmd/events/__init__.py",
"type": "Python"
} | i4DsREPO_NAMEsdo-cliPATH_START.@sdo-cli_extracted@sdo-cli-main@src@sdo@cmd@events@__init__.py@.PATH_END.py | |
{
"filename": "test_gapi_infer_onnx.py",
"repo_name": "itseez/opencv",
"repo_path": "opencv_extracted/opencv-master/modules/gapi/misc/python/test/test_gapi_infer_onnx.py",
"type": "Python"
} | #!/usr/bin/env python
import numpy as np
import cv2 as cv
import os
import sys
import unittest
from tests_common import NewOpenCVTests
try:
if sys.version_info[:2] < (3, 0):
raise unittest.SkipTest('Python 2.x is not supported')
CLASSIFICATION_MODEL_PATH = "vision/classification/squeezenet/model/s... | itseezREPO_NAMEopencvPATH_START.@opencv_extracted@opencv-master@modules@gapi@misc@python@test@test_gapi_infer_onnx.py@.PATH_END.py |
{
"filename": "plot_regions.py",
"repo_name": "GBTAmmoniaSurvey/GAS",
"repo_path": "GAS_extracted/GAS-master/GAS/plot_regions.py",
"type": "Python"
} | import os
import textwrap
import warnings
import glob
import numpy as np
from astropy.table import Table, join
from astropy.io import fits
import astropy.units as u
from spectral_cube import SpectralCube
from . import catalogs
from scipy.ndimage import binary_opening
import aplpy
import matplotlib as mpl
mpl.rcParams[... | GBTAmmoniaSurveyREPO_NAMEGASPATH_START.@GAS_extracted@GAS-master@GAS@plot_regions.py@.PATH_END.py |
{
"filename": "timelink.py",
"repo_name": "pynbody/tangos",
"repo_path": "tangos_extracted/tangos-master/tangos/scripts/timelink.py",
"type": "Python"
} | #!/usr/bin/env python2.7
import sys
from tangos import core, parallel_tasks
from tangos.parallel_tasks import database
from tangos.tools.crosslink import TimeLinker
def run_dbwriter(argv):
parallel_tasks.database.synchronize_creator_object()
writer = TimeLinker()
writer.parse_command_line(argv)
wri... | pynbodyREPO_NAMEtangosPATH_START.@tangos_extracted@tangos-master@tangos@scripts@timelink.py@.PATH_END.py |
{
"filename": "run_abc.py",
"repo_name": "EliseJ/superabc",
"repo_path": "superabc_extracted/superabc-master/run_abc.py",
"type": "Python"
} |
############## superABC ##################################
# Author: Elise Jennings, elise@fnal.gov
# Code to run ABC sampler with SN data and two metrics: Tripp and Light Curve metric.
##########################################################
import numpy as np
from math import floor
import sys
import subprocess
im... | EliseJREPO_NAMEsuperabcPATH_START.@superabc_extracted@superabc-master@run_abc.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/barpolar/selected/textfont/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._color import ColorValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._color.ColorValidator"]
)
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@barpolar@selected@textfont@__init__.py@.PATH_END.py |
{
"filename": "bls_parameters_test.py",
"repo_name": "triton-inference-server/server",
"repo_path": "server_extracted/server-main/qa/L0_backend_python/bls/bls_parameters_test.py",
"type": "Python"
} | #!/usr/bin/env python3
# Copyright 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
... | triton-inference-serverREPO_NAMEserverPATH_START.@server_extracted@server-main@qa@L0_backend_python@bls@bls_parameters_test.py@.PATH_END.py |
{
"filename": "disable_internet.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/extern/plugins/pytest_remotedata/disable_internet.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import contextlib
import socket
from ...bundled.six.moves import urllib
# save original socket method for restoration
# These are global so that re-calling the turn_off_internet function doesn't
# overwrite them again
socket_original = socket.socket
sock... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@extern@plugins@pytest_remotedata@disable_internet.py@.PATH_END.py |
{
"filename": "context_cross_platform_tpu_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/eager/context_cross_platform_tpu_test.py",
"type": "Python"
} | # Copyright 2023 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@eager@context_cross_platform_tpu_test.py@.PATH_END.py |
{
"filename": "TemperatureFluxResolutionStudy.py",
"repo_name": "mmicromegas/ransX",
"repo_path": "ransX_extracted/ransX-master/EQUATIONS/FOR_RESOLUTION_STUDY/TemperatureFluxResolutionStudy.py",
"type": "Python"
} | import numpy as np
from scipy import integrate
import matplotlib.pyplot as plt
from UTILS.Calculus import Calculus
from UTILS.SetAxisLimit import SetAxisLimit
from UTILS.Tools import Tools
from UTILS.Errors import Errors
import sys
# Theoretical background https://arxiv.org/abs/1401.5176
# Mocak, Meakin, Viallet, Arn... | mmicromegasREPO_NAMEransXPATH_START.@ransX_extracted@ransX-master@EQUATIONS@FOR_RESOLUTION_STUDY@TemperatureFluxResolutionStudy.py@.PATH_END.py |
{
"filename": "assign_wcs_step.py",
"repo_name": "spacetelescope/jwst",
"repo_path": "jwst_extracted/jwst-main/jwst/assign_wcs/assign_wcs_step.py",
"type": "Python"
} | #! /usr/bin/env python
from stdatamodels.jwst import datamodels
from ..stpipe import Step
from ..lib.exposure_types import IMAGING_TYPES
import logging
from .assign_wcs import load_wcs
from .util import (MSAFileError, wfss_imaging_wcs,
wcs_bbox_from_shape, update_fits_wcsinfo)
from .nircam import i... | spacetelescopeREPO_NAMEjwstPATH_START.@jwst_extracted@jwst-main@jwst@assign_wcs@assign_wcs_step.py@.PATH_END.py |
{
"filename": "reka.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/chat/reka.ipynb",
"type": "Jupyter Notebook"
} | ---
sidebar_label: Reka
---
# ChatReka
This notebook provides a quick overview for getting started with Reka [chat models](../../concepts/chat_models.mdx).
Reka has several chat models. You can find information about their latest models and their costs, context windows, and supported input types in the [Reka docs](... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@chat@reka.ipynb@.PATH_END.py |
{
"filename": "traps.py",
"repo_name": "roman-corgi/emccd_detect",
"repo_path": "emccd_detect_extracted/emccd_detect-master/arcticpy_folder/build/lib/arcticpy/traps.py",
"type": "Python"
} | import numpy as np
from scipy import integrate, optimize
from copy import deepcopy
from arcticpy import util
class Trap(object):
def __init__(
self,
density=0.13,
release_timescale=0.25,
capture_timescale=0,
surface=False,
):
"""The parameters for a single trap ... | roman-corgiREPO_NAMEemccd_detectPATH_START.@emccd_detect_extracted@emccd_detect-master@arcticpy_folder@build@lib@arcticpy@traps.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "riogroup/SORA",
"repo_path": "SORA_extracted/SORA-master/docs/conf.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | riogroupREPO_NAMESORAPATH_START.@SORA_extracted@SORA-master@docs@conf.py@.PATH_END.py |
{
"filename": "test_windows.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/signal/tests/test_windows.py",
"type": "Python"
} | import numpy as np
from numpy import array
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_allclose,
assert_equal, assert_, assert_array_less,
suppress_warnings)
from pytest import raises as assert_raises
... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@signal@tests@test_windows.py@.PATH_END.py |
{
"filename": "page.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/ipython/py2/IPython/core/page.py",
"type": "Python"
} | # encoding: utf-8
"""
Paging capabilities for IPython.core
Notes
-----
For now this uses IPython hooks, so it can't be in IPython.utils. If we can get
rid of that dependency, we could move it there.
-----
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipython@py2@IPython@core@page.py@.PATH_END.py |
{
"filename": "computeMap3_GaussianFields.py",
"repo_name": "sheydenreich/threepoint",
"repo_path": "threepoint_extracted/threepoint-main/python_scripts/computeMap3_GaussianFields.py",
"type": "Python"
} | from aperture_mass_computer import Map3_Gaussian_Random_Field_parallelised
from scipy.interpolate import interp1d
import numpy as np
import argparse
from os.path import exists
from os import makedirs
docstring = """ Script for creating Gaussian Random Fields and extracting the Map3 from them.
"""
# CLI parsing
parser... | sheydenreichREPO_NAMEthreepointPATH_START.@threepoint_extracted@threepoint-main@python_scripts@computeMap3_GaussianFields.py@.PATH_END.py |
{
"filename": "_special_inputs.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/express/_special_inputs.py",
"type": "Python"
} | class IdentityMap(object):
"""
`dict`-like object which acts as if the value for any key is the key itself. Objects
of this class can be passed in to arguments like `color_discrete_map` to
use the provided data values as colors, rather than mapping them to colors cycled
from `color_discrete_sequence... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@express@_special_inputs.py@.PATH_END.py |
{
"filename": "count_tables.py",
"repo_name": "FRBs/FRB",
"repo_path": "FRB_extracted/FRB-main/papers/Kilpatrick2024_Alopeke/Tables/py/count_tables.py",
"type": "Python"
} | from astropy.io import fits
from astropy.table import Table, vstack
import sep
import numpy as np
import UTILS as ut
import os
import sys
import glob
import copy
from astropy.time import Time
from astropy import units as u
from astropy.wcs import WCS, utils
from astropy.coordinates import SkyCoord
from astroquery.mas... | FRBsREPO_NAMEFRBPATH_START.@FRB_extracted@FRB-main@papers@Kilpatrick2024_Alopeke@Tables@py@count_tables.py@.PATH_END.py |
{
"filename": "vec_monitor.py",
"repo_name": "DLR-RM/stable-baselines3",
"repo_path": "stable-baselines3_extracted/stable-baselines3-master/stable_baselines3/common/vec_env/vec_monitor.py",
"type": "Python"
} | import time
import warnings
from typing import Optional
import numpy as np
from stable_baselines3.common.vec_env.base_vec_env import VecEnv, VecEnvObs, VecEnvStepReturn, VecEnvWrapper
class VecMonitor(VecEnvWrapper):
"""
A vectorized monitor wrapper for *vectorized* Gym environments,
it is used to recor... | DLR-RMREPO_NAMEstable-baselines3PATH_START.@stable-baselines3_extracted@stable-baselines3-master@stable_baselines3@common@vec_env@vec_monitor.py@.PATH_END.py |
{
"filename": "test_basic_retriever.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/standard-tests/tests/unit_tests/test_basic_retriever.py",
"type": "Python"
} | from typing import Any, Type
from langchain_core.documents import Document
from langchain_core.retrievers import BaseRetriever
from langchain_tests.integration_tests import RetrieversIntegrationTests
class ParrotRetriever(BaseRetriever):
parrot_name: str
k: int = 3
def _get_relevant_documents(self, que... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@standard-tests@tests@unit_tests@test_basic_retriever.py@.PATH_END.py |
{
"filename": "_ysrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/violin/_ysrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="ysrc", parent_name="violin", **kwargs):
super(YsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=k... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@violin@_ysrc.py@.PATH_END.py |
{
"filename": "sed_petal.py",
"repo_name": "changhoonhahn/provabgs",
"repo_path": "provabgs_extracted/provabgs-main/bin/svda/sed_petal.py",
"type": "Python"
} | import os, sys
import pickle
import numpy as np
from functools import partial
from multiprocessing.pool import Pool
import svda as SVDA
from provabgs import util as UT
from provabgs import infer as Infer
from provabgs import models as Models
from provabgs import flux_calib as FluxCalib
tileid = int(sys.argv[1])
... | changhoonhahnREPO_NAMEprovabgsPATH_START.@provabgs_extracted@provabgs-main@bin@svda@sed_petal.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "spacetelescope/astronify",
"repo_path": "astronify_extracted/astronify-main/astronify/simulator/__init__.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Data Simulation
===============
This module contains code for creating simulated/test light curves
with a variety of signals in them as either an `~astropy.table.Table`,
or FITS file. The files are designed to be read by the Astronify
software packag... | spacetelescopeREPO_NAMEastronifyPATH_START.@astronify_extracted@astronify-main@astronify@simulator@__init__.py@.PATH_END.py |
{
"filename": "bases.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/prefect/_internal/schemas/bases.py",
"type": "Python"
} | """
Utilities for creating and working with Prefect REST API schemas.
"""
import datetime
import os
from typing import Any, ClassVar, Generator, Optional, Set, TypeVar, cast
from uuid import UUID, uuid4
import pendulum
from pydantic import (
BaseModel,
ConfigDict,
Field,
)
from pydantic_extra_types.pendul... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@_internal@schemas@bases.py@.PATH_END.py |
{
"filename": "_hoverlabel.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/scene/annotation/_hoverlabel.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HoverlabelValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="hoverlabel", parent_name="layout.scene.annotation", **kwargs
):
super(HoverlabelValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@scene@annotation@_hoverlabel.py@.PATH_END.py |
{
"filename": "test_targets.py",
"repo_name": "desihub/desisim",
"repo_path": "desisim_extracted/desisim-main/py/desisim/test/test_targets.py",
"type": "Python"
} | import unittest, os
import numpy as np
import desisim.targets
class TestObs(unittest.TestCase):
def test_sample_nz(self):
n = 5
for objtype in ['LRG', 'ELG', 'QSO', 'STAR', 'STD']:
z = desisim.targets.sample_nz(objtype, n)
self.assertEqual(len(z), n)
def test_get... | desihubREPO_NAMEdesisimPATH_START.@desisim_extracted@desisim-main@py@desisim@test@test_targets.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/cone/lightposition/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._z import ZValidator
from ._y import YValidator
from ._x import XValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._z.ZValidator", "._y.YValidator", "._x.XVali... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@cone@lightposition@__init__.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "KeplerGO/lightkurve",
"repo_path": "lightkurve_extracted/lightkurve-main/src/lightkurve/correctors/__init__.py",
"type": "Python"
} | """This sub-package defines classes which help remove instrument systematics
or variability from time series photometry data.
Classes provided by this package should inherit from an abstract `Corrector`
class, which provides three key methods::
Corrector(**data_required):
.correct(**options) -> Returns a ... | KeplerGOREPO_NAMElightkurvePATH_START.@lightkurve_extracted@lightkurve-main@src@lightkurve@correctors@__init__.py@.PATH_END.py |
{
"filename": "AdaptiveRefinement.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/tests/functional/Hydro/Sod/AdaptiveRefinement.py",
"type": "Python"
} | #-------------------------------------------------------------------------------
# AdaptiveRefinement
#
# This class is intended as a basic adaptive refinement framework for splitting
# and combining nodes. This class uses the fact that in the SpheralController
# you can register arbitrary methods to be called on a gi... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@tests@functional@Hydro@Sod@AdaptiveRefinement.py@.PATH_END.py |
{
"filename": "Introduction.ipynb",
"repo_name": "threeML/astromodels",
"repo_path": "astromodels_extracted/astromodels-master/examples/Introduction.ipynb",
"type": "Jupyter Notebook"
} | # Introduction
Astromodels is a very flexible framework to define models for likelihood or Bayesian analysis of astrophysical data.
Even though it has been designed having in mind analysis in the spectral domain, it can be used also as a toolbox containing functions of any variable.
Astromodels is *not* a modeling ... | threeMLREPO_NAMEastromodelsPATH_START.@astromodels_extracted@astromodels-master@examples@Introduction.ipynb@.PATH_END.py |
{
"filename": "test_kv.py",
"repo_name": "rmjarvis/TreeCorr",
"repo_path": "TreeCorr_extracted/TreeCorr-main/tests/test_kv.py",
"type": "Python"
} | # Copyright (c) 2003-2024 by Mike Jarvis
#
# TreeCorr is free software: redistribution and use in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condi... | rmjarvisREPO_NAMETreeCorrPATH_START.@TreeCorr_extracted@TreeCorr-main@tests@test_kv.py@.PATH_END.py |
{
"filename": "pol2stack.py",
"repo_name": "Starlink/starlink",
"repo_path": "starlink_extracted/starlink-master/applications/smurf/scripts/pol2stack.py",
"type": "Python"
} | #!/usr/bin/env python3
'''
*+
* Name:
* POL2STACK
* Purpose:
* Combine multiple Q, U and I images and create a vector catalogue
* from them.
* Language:
* python (2.7 or 3.*)
* Description:
* This script combines multiple Q, U and I images and creates a
* vector catalogue from them.
*
* ... | StarlinkREPO_NAMEstarlinkPATH_START.@starlink_extracted@starlink-master@applications@smurf@scripts@pol2stack.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.