metadata
dict
text
stringlengths
0
40.6M
id
stringlengths
14
255
{ "filename": "test_analysis_blobs.py", "repo_name": "mirochaj/ares", "repo_path": "ares_extracted/ares-main/tests/test_analysis_blobs.py", "type": "Python" }
""" test_analysis_blobs.py Author: Jordan Mirocha Affiliation: UCLA Created on: Thu May 26 11:28:43 PDT 2016 Description: """ import os import ares import numpy as np from ares.util.Pickling import write_pickle_file def test(Ns=500, Nd=4, prefix='test'): # Step 1. Make some fake data. # Start with a 2-D...
mirochajREPO_NAMEaresPATH_START.@ares_extracted@ares-main@tests@test_analysis_blobs.py@.PATH_END.py
{ "filename": "gammainc_asy.py", "repo_name": "waynebhayes/SpArcFiRe", "repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/scipy/special/_precompute/gammainc_asy.py", "type": "Python" }
""" Precompute coefficients of Temme's asymptotic expansion for gammainc. This takes about 8 hours to run on a 2.3 GHz Macbook Pro with 4GB ram. Sources: [1] NIST, "Digital Library of Mathematical Functions", http://dlmf.nist.gov/ """ from __future__ import division, print_function, absolute_import import os fr...
waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@scipy@special@_precompute@gammainc_asy.py@.PATH_END.py
{ "filename": "README.md", "repo_name": "spedas/pyspedas", "repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/st5/README.md", "type": "Markdown" }
## Space Technology 5 (ST5) The routines in this module can be used to load data from the Space Technology 5 (ST5) mission. ### Instruments - Magnetometer (MAG) ### Examples Get started by importing pyspedas and tplot; these are required to load and plot the data: ```python import pyspedas from pytplot import tplo...
spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@st5@README.md@.PATH_END.py
{ "filename": "bias_vs_corrected_panel.py", "repo_name": "LSSTDESC/chroma", "repo_path": "chroma_extracted/chroma-master/bin/analytic/catalog/bias_vs_corrected_panel.py", "type": "Python" }
"""Make a panel figure for the paper of chromatic biases (RbarSqr, V, S_m02) vs their residuals after ETR correction. """ import cPickle from argparse import ArgumentParser import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib...
LSSTDESCREPO_NAMEchromaPATH_START.@chroma_extracted@chroma-master@bin@analytic@catalog@bias_vs_corrected_panel.py@.PATH_END.py
{ "filename": "Tutorial.ipynb", "repo_name": "cbottrell/realsim_ifs", "repo_path": "realsim_ifs_extracted/realsim_ifs-master/Tutorials/IFS/Tutorial.ipynb", "type": "Jupyter Notebook" }
# RealSim-IFS Tutorial: Generating synthetic MaNGA data Welcome to the RealSim-IFS tutorial. In this tutorial, we will generate some MaNGA-like synthetic kinematic data using a line-of-sight (LOS) velocity cube for a disk galaxy from the TNG50-1 simulation. The main requirements of RealSim-IFS are the `astropy`, `nump...
cbottrellREPO_NAMErealsim_ifsPATH_START.@realsim_ifs_extracted@realsim_ifs-master@Tutorials@IFS@Tutorial.ipynb@.PATH_END.py
{ "filename": "msvc9compiler.py", "repo_name": "numpy/numpy", "repo_path": "numpy_extracted/numpy-main/numpy/distutils/msvc9compiler.py", "type": "Python" }
import os from distutils.msvc9compiler import MSVCCompiler as _MSVCCompiler from .system_info import platform_bits def _merge(old, new): """Concatenate two environment paths avoiding repeats. Here `old` is the environment string before the base class initialize function is called and `new` is the string...
numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@numpy@distutils@msvc9compiler.py@.PATH_END.py
{ "filename": "_xanchor.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/shape/_xanchor.py", "type": "Python" }
import _plotly_utils.basevalidators class XanchorValidator(_plotly_utils.basevalidators.AnyValidator): def __init__(self, plotly_name="xanchor", parent_name="layout.shape", **kwargs): super(XanchorValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@shape@_xanchor.py@.PATH_END.py
{ "filename": "LICENSE.md", "repo_name": "AndreyTavleev/DiscVerSt", "repo_path": "DiscVerSt_extracted/DiscVerSt-master/LICENSE.md", "type": "Markdown" }
MIT License Copyright (c) 2022 Andrey Tavleev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, di...
AndreyTavleevREPO_NAMEDiscVerStPATH_START.@DiscVerSt_extracted@DiscVerSt-master@LICENSE.md@.PATH_END.py
{ "filename": "pgt.py", "repo_name": "icrar/daliuge", "repo_path": "daliuge_extracted/daliuge-master/daliuge-translator/dlg/dropmake/pgt.py", "type": "Python" }
# # ICRAR - International Centre for Radio Astronomy Research # (c) UWA - The University of Western Australia, 2015 # 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-translator@dlg@dropmake@pgt.py@.PATH_END.py
{ "filename": "_sizesrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/isosurface/hoverlabel/font/_sizesrc.py", "type": "Python" }
import _plotly_utils.basevalidators class SizesrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="sizesrc", parent_name="isosurface.hoverlabel.font", **kwargs ): super(SizesrcValidator, self).__init__( plotly_name=plotly_name, paren...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@isosurface@hoverlabel@font@_sizesrc.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "adrn/gala", "repo_path": "gala_extracted/gala-main/gala/potential/potential/tests/__init__.py", "type": "Python" }
adrnREPO_NAMEgalaPATH_START.@gala_extracted@gala-main@gala@potential@potential@tests@__init__.py@.PATH_END.py
{ "filename": "matrix_logarithm_op_test.py", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/kernel_tests/linalg/matrix_logarithm_op_test.py", "type": "Python" }
# Copyright 2017 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@kernel_tests@linalg@matrix_logarithm_op_test.py@.PATH_END.py
{ "filename": "test_cadctap_remote.py", "repo_name": "D-arioSpace/astroquery", "repo_path": "astroquery_extracted/astroquery-main/astroquery/cadc/tests/test_cadctap_remote.py", "type": "Python" }
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ ============= Canadian Astronomy Data Centre ============= """ import pytest import os import requests from pathlib import Path from datetime import datetime, timezone from astropy.coordinates import SkyCoord from astropy.io import fits from astropy i...
D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@cadc@tests@test_cadctap_remote.py@.PATH_END.py
{ "filename": "_color.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattercarpet/marker/colorbar/title/font/_color.py", "type": "Python" }
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="scattercarpet.marker.colorbar.title.font", **kwargs ): super(ColorValidator, self).__init__( plotly_n...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattercarpet@marker@colorbar@title@font@_color.py@.PATH_END.py
{ "filename": "_family.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/heatmapgl/hoverlabel/font/_family.py", "type": "Python" }
import _plotly_utils.basevalidators class FamilyValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="family", parent_name="heatmapgl.hoverlabel.font", **kwargs ): super(FamilyValidator, self).__init__( plotly_name=plotly_name, parent...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@heatmapgl@hoverlabel@font@_family.py@.PATH_END.py
{ "filename": "cut_data.py", "repo_name": "mbejger/polgraw-allsky", "repo_path": "polgraw-allsky_extracted/polgraw-allsky-master/followup/src/Auxiliary_scripts/cut_data.py", "type": "Python" }
from glob import iglob import shutil, os, sys datapath = sys.argv[3] newpath = sys.argv[4] ifo = sys.argv[1] #L1 or H1 band = sys.argv[2] #e.g. 0067 frame = '001' start = int(sys.argv[5]) end = int(sys.argv[6]) N = 1033969 #int(sys.argv[7]) newsize = 258492 #int(sys.argv[8]) # Open big file xdat = datapath + '/...
mbejgerREPO_NAMEpolgraw-allskyPATH_START.@polgraw-allsky_extracted@polgraw-allsky-master@followup@src@Auxiliary_scripts@cut_data.py@.PATH_END.py
{ "filename": "plevel_fn.py", "repo_name": "ExeClim/Isca", "repo_path": "Isca_extracted/Isca-master/postprocessing/plevel_interpolation/scripts/plevel_fn.py", "type": "Python" }
#Function to load interpolated data on pressure levels for multiple months #Copied from RG on 29/03/16 import subprocess import sys import os import sh def plevel_call(nc_file_in,nc_file_out, var_names = '-a', p_levels='default', mask_below_surface_option=' '): check_gfdl_directories_set() interper = './ple...
ExeClimREPO_NAMEIscaPATH_START.@Isca_extracted@Isca-master@postprocessing@plevel_interpolation@scripts@plevel_fn.py@.PATH_END.py
{ "filename": "cocoplot.py", "repo_name": "mdruett/COCOPLOT", "repo_path": "COCOPLOT_extracted/COCOPLOT-master/Python/cocopy/cocoplot.py", "type": "Python" }
#!/bin/env python # -*- coding: utf-8 -*- name = "COCOpy" import numpy as np from PIL import Image as img import astropy.io.fits as f import matplotlib.pyplot as plt import matplotlib.animation as animation def filter(wavelengths, filtername, rgb_pos ='default', plot=False): ''' Make filters for cocoplot ...
mdruettREPO_NAMECOCOPLOTPATH_START.@COCOPLOT_extracted@COCOPLOT-master@Python@cocopy@cocoplot.py@.PATH_END.py
{ "filename": "utils.py", "repo_name": "mikekatz04/LISAanalysistools", "repo_path": "LISAanalysistools_extracted/LISAanalysistools-main/lisatools/sources/utils.py", "type": "Python" }
import numpy as np from typing import Any, Tuple, List, Optional from ..diagnostic import snr as snr_func from lisatools.diagnostic import ( covariance, plot_covariance_corner, plot_covariance_contour, ) from ..sensitivity import A1TDISens, Sensitivity from .waveformbase import SNRWaveform, AETTDIWaveform ...
mikekatz04REPO_NAMELISAanalysistoolsPATH_START.@LISAanalysistools_extracted@LISAanalysistools-main@lisatools@sources@utils.py@.PATH_END.py
{ "filename": "test_uni_hall_elecinertia.py", "repo_name": "n-claes/legolas", "repo_path": "legolas_extracted/legolas-master/tests/regression_tests/test_uni_hall_elecinertia.py", "type": "Python" }
import numpy as np import pytest from .regression import RegressionTest class UniHallElectronInertia(RegressionTest): equilibrium = "adiabatic_homo" geometry = "Cartesian" x_start = 0 x_end = 1000 parameters = { "k2": 10 * np.sin(np.pi / 6), "k3": 10 * np.cos(np.pi / 6), ...
n-claesREPO_NAMElegolasPATH_START.@legolas_extracted@legolas-master@tests@regression_tests@test_uni_hall_elecinertia.py@.PATH_END.py
{ "filename": "_colorsrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/table/cells/fill/_colorsrc.py", "type": "Python" }
import _plotly_utils.basevalidators class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="colorsrc", parent_name="table.cells.fill", **kwargs ): super(ColorsrcValidator, self).__init__( plotly_name=plotly_name, parent_name=...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@table@cells@fill@_colorsrc.py@.PATH_END.py
{ "filename": "image_data.py", "repo_name": "sibirrer/AstroObjectAnalyser", "repo_path": "AstroObjectAnalyser_extracted/AstroObjectAnalyser-master/astroObjectAnalyser/image_data.py", "type": "Python" }
__author__ = 'sibirrer' #external modules import astropy.io.fits as pyfits import astropy.wcs as pywcs import astropy.coordinates as coords import numpy as np import astrofunc.util as util import pyextract.image_config as ImageConfig #internal modules from astroObjectAnalyser.DataAnalysis.analysis import Analysis f...
sibirrerREPO_NAMEAstroObjectAnalyserPATH_START.@AstroObjectAnalyser_extracted@AstroObjectAnalyser-master@astroObjectAnalyser@image_data.py@.PATH_END.py
{ "filename": "get_pa.py", "repo_name": "t-brandt/acorns-adi", "repo_path": "acorns-adi_extracted/acorns-adi-master/transform/get_pa.py", "type": "Python" }
# Original filename: get_pa.py # # Author: Tim Brandt # Email: tbrandt@astro.princeton.edu # Date: March 2011 # # # Summary: Fetch the position angle from a FITS header. This routine # uses the local sidereal time, RA, Dec, and latitude to get the # parallactic angle of an object. All quantities except the latitude #...
t-brandtREPO_NAMEacorns-adiPATH_START.@acorns-adi_extracted@acorns-adi-master@transform@get_pa.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "simonsobs/socs", "repo_path": "socs_extracted/socs-main/socs/agents/ifm_sbn246_flowmeter/__init__.py", "type": "Python" }
simonsobsREPO_NAMEsocsPATH_START.@socs_extracted@socs-main@socs@agents@ifm_sbn246_flowmeter@__init__.py@.PATH_END.py
{ "filename": "test_polycomp_low_level.py", "repo_name": "ziotom78/polycomp", "repo_path": "polycomp_extracted/polycomp-master/tests/test_polycomp_low_level.py", "type": "Python" }
import numpy as np import pypolycomp def test_polycomp(): for alg in (pypolycomp.PCOMP_ALG_USE_CHEBYSHEV, pypolycomp.PCOMP_ALG_NO_CHEBYSHEV): max_error = 0.1 samples = np.array([1.0, 2.0, 3.0, 4.1]) params = pypolycomp.Polycomp(samples.size, 2, max_error, alg) inv_ch...
ziotom78REPO_NAMEpolycompPATH_START.@polycomp_extracted@polycomp-master@tests@test_polycomp_low_level.py@.PATH_END.py
{ "filename": "proper_motion_statistics.py", "repo_name": "CPM-project/MCPM", "repo_path": "MCPM_extracted/MCPM-master/examples/asteroid_first_try/proper_motion_statistics.py", "type": "Python" }
""" Calculate proper motion statistics for all input *.ephem_interp_CCR files. """ import sys import numpy as np pixel_scale = 3.96 # pixel scale of Kepler camera def calculate_proper_motion_stats(file_name): """ Calculate proper motion based on time and (x,y) pixels. Return median, min, and max [arcsec...
CPM-projectREPO_NAMEMCPMPATH_START.@MCPM_extracted@MCPM-master@examples@asteroid_first_try@proper_motion_statistics.py@.PATH_END.py
{ "filename": "lad.py", "repo_name": "spedas/pyspedas", "repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/projects/twins/lad.py", "type": "Python" }
from .load import load # This routine was moved out of __init__.py. Please see that file for previous revision history. def lad(trange=['2018-11-5', '2018-11-6'], probe='1', datatype='', prefix='', suffix='', get_support_data=False, varformat=None, varname...
spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@projects@twins@lad.py@.PATH_END.py
{ "filename": "plot_j1407_rings_face_on_simple.py", "repo_name": "mkenworthy/exorings", "repo_path": "exorings_extracted/exorings-master/plot_j1407_rings_face_on_simple.py", "type": "Python" }
import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from scipy.interpolate import interp1d import exorings3 as exorings import j1407 # read in j1407 photometry (time, flux, flux_err) = j1407.j1407_photom_binned('j1407_bincc.dat', 54160.0, 54300.0) print ('number of photometric points: %d' % ti...
mkenworthyREPO_NAMEexoringsPATH_START.@exorings_extracted@exorings-master@plot_j1407_rings_face_on_simple.py@.PATH_END.py
{ "filename": "LoftQ_weight_replacement.ipynb", "repo_name": "huggingface/peft", "repo_path": "peft_extracted/peft-main/examples/loftq_finetuning/LoftQ_weight_replacement.ipynb", "type": "Jupyter Notebook" }
# Initializing weights with LoftQ by replacing LoRA weights in-place This notebook shows how to apply [LoftQ](https://arxiv.org/abs/2310.08659) initialization on our QLoRA model. In short, the idea behind LoftQ is the following. When we use QLoRA, i.e. we quantize the base model with bitsandbytes to save memory, and ...
huggingfaceREPO_NAMEpeftPATH_START.@peft_extracted@peft-main@examples@loftq_finetuning@LoftQ_weight_replacement.ipynb@.PATH_END.py
{ "filename": "run.py", "repo_name": "leightonw-cerebras/sliding-window", "repo_path": "sliding-window_extracted/sliding-window-main/synchronous-slide/run.py", "type": "Python" }
#!/usr/bin/env cs_python import argparse import csv import json import struct import time import numpy as np from cerebras.sdk.runtime.sdkruntimepybind import SdkRuntime, MemcpyDataType, MemcpyOrder from cerebras.sdk import sdk_utils def main(): parser = argparse.ArgumentParser() parser.add_argument('--name...
leightonw-cerebrasREPO_NAMEsliding-windowPATH_START.@sliding-window_extracted@sliding-window-main@synchronous-slide@run.py@.PATH_END.py
{ "filename": "get_scale_and_bias__return_value_type.md", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage-python/get_scale_and_bias__return_value_type.md", "type": "Markdown" }
{{ python-type--tuple }}
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage-python@get_scale_and_bias__return_value_type.md@.PATH_END.py
{ "filename": "pyrafetifile.py", "repo_name": "GeminiDRSoftware/DRAGONS", "repo_path": "DRAGONS_extracted/DRAGONS-master/gempy/eti_core/pyrafetifile.py", "type": "Python" }
from .etifile import ETIFile from ..utils import logutils log = logutils.get_logger(__name__) class PyrafETIFile(ETIFile): """This class coordinates the ETI files as it pertains to Pyraf tasks in general. """ inputs = None params = None filedict = None def __init__(self, inputs=None, param...
GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@gempy@eti_core@pyrafetifile.py@.PATH_END.py
{ "filename": "dbgpyapp.py", "repo_name": "mhammond/pywin32", "repo_path": "pywin32_extracted/pywin32-main/Pythonwin/pywin/debugger/dbgpyapp.py", "type": "Python" }
# dbgpyapp.py - Debugger Python application class # import sys import win32con import win32ui from pywin.framework import intpyapp version = "0.3.0" class DebuggerPythonApp(intpyapp.InteractivePythonApp): def LoadMainFrame(self): "Create the main applications frame" self.frame = self.CreateMain...
mhammondREPO_NAMEpywin32PATH_START.@pywin32_extracted@pywin32-main@Pythonwin@pywin@debugger@dbgpyapp.py@.PATH_END.py
{ "filename": "test_snr.py", "repo_name": "vterron/lemon", "repo_path": "lemon_extracted/lemon-master/test/test_snr.py", "type": "Python" }
#! /usr/bin/env python2 # Copyright (c) 2012 Victor Terron. All rights reserved. # Institute of Astrophysics of Andalusia, IAA-CSIC # # This file is part of LEMON. # # LEMON 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 Softwar...
vterronREPO_NAMElemonPATH_START.@lemon_extracted@lemon-master@test@test_snr.py@.PATH_END.py
{ "filename": "median_and_scatter_model.py", "repo_name": "Moyoxkit/cluster-counts", "repo_path": "cluster-counts_extracted/cluster-counts-main/cluster_model/median_and_scatter_model.py", "type": "Python" }
import numpy as np from astropy.cosmology import FlatLambdaCDM, z_at_value import astropy.units as u import matplotlib.pyplot as plt from tqdm import tqdm from scipy.integrate import dblquad, quad from scipy.interpolate import ( interp1d, LinearNDInterpolator, NearestNDInterpolator, griddata, ) from sci...
MoyoxkitREPO_NAMEcluster-countsPATH_START.@cluster-counts_extracted@cluster-counts-main@cluster_model@median_and_scatter_model.py@.PATH_END.py
{ "filename": "_end.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/histogram2d/ybins/_end.py", "type": "Python" }
import _plotly_utils.basevalidators class EndValidator(_plotly_utils.basevalidators.AnyValidator): def __init__(self, plotly_name="end", parent_name="histogram2d.ybins", **kwargs): super(EndValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edi...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@histogram2d@ybins@_end.py@.PATH_END.py
{ "filename": "tfsa-2021-196.md", "repo_name": "tensorflow/tensorflow", "repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/security/advisory/tfsa-2021-196.md", "type": "Markdown" }
## TFSA-2021-196: Overflow/crash in `tf.tile` when tiling tensor is large ### CVE Number CVE-2021-41198 ### Impact If `tf.tile` is called with a large input argument then the TensorFlow process will crash due to a `CHECK`-failure caused by an overflow. ```python import tensorflow as tf import numpy as np tf.keras.ba...
tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@security@advisory@tfsa-2021-196.md@.PATH_END.py
{ "filename": "sqlite_interface.py", "repo_name": "fred3m/toyz", "repo_path": "toyz_extracted/toyz-master/toyz/utils/db_interfaces/sqlite_interface.py", "type": "Python" }
# Copyright 2015 by Fred Moolekamp # License: BSD 3-clause """ Database interface to sqlite """ from __future__ import print_function, division import os import sys import json import sqlite3 from toyz.utils.errors import ToyzDbError from toyz.utils import db as db_utils ############################################...
fred3mREPO_NAMEtoyzPATH_START.@toyz_extracted@toyz-master@toyz@utils@db_interfaces@sqlite_interface.py@.PATH_END.py
{ "filename": "surface.py", "repo_name": "enthought/mayavi", "repo_path": "mayavi_extracted/mayavi-master/mayavi/modules/surface.py", "type": "Python" }
"""Draws a surface for any input dataset with optional contouring. """ # Author: Prabhu Ramachandran <prabhu_r@users.sf.net> # Copyright (c) 2005, Enthought, Inc. # License: BSD Style. # Enthought library imports. from traits.api import Instance, Bool from tvtk.api import tvtk # Local imports from mayavi.core.pipeli...
enthoughtREPO_NAMEmayaviPATH_START.@mayavi_extracted@mayavi-master@mayavi@modules@surface.py@.PATH_END.py
{ "filename": "test_waterfall2.py", "repo_name": "ucberkeleyseti/blimpy", "repo_path": "blimpy_extracted/blimpy-master/tests/test_waterfall2.py", "type": "Python" }
import os import numpy as np from astropy.coordinates import Angle import matplotlib.pyplot as plt import blimpy as bl from blimpy.plotting import plot_waterfall, plot_spectrum_min_max from tests.data import voyager_h5, test_h5, test_fil TEST_DATA_DIR = os.path.dirname(voyager_h5) RTOL = 1e-05 def compare_hdr_field...
ucberkeleysetiREPO_NAMEblimpyPATH_START.@blimpy_extracted@blimpy-master@tests@test_waterfall2.py@.PATH_END.py
{ "filename": "astropt020M.py", "repo_name": "Smith42/astroPT", "repo_path": "astroPT_extracted/astroPT-main/config/astropt020M.py", "type": "Python" }
# this file will train a ~20m parameter model with the same hyperparams as # EleutherAI's Pythia-20M (https://arxiv.org/abs/2304.01373) # # launch as the following (e.g. in a tmux session) and wait ~5 days: # $ OMP_NUM_THREADS=32 torchrun --standalone --nproc_per_node=8 src/train.py config/astropt300m.py # # don't forg...
Smith42REPO_NAMEastroPTPATH_START.@astroPT_extracted@astroPT-main@config@astropt020M.py@.PATH_END.py
{ "filename": "_nbinsy.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/histogram/_nbinsy.py", "type": "Python" }
import _plotly_utils.basevalidators class NbinsyValidator(_plotly_utils.basevalidators.IntegerValidator): def __init__(self, plotly_name="nbinsy", parent_name="histogram", **kwargs): super(NbinsyValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@histogram@_nbinsy.py@.PATH_END.py
{ "filename": "test_base.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/partners/openai/tests/unit_tests/chat_models/test_base.py", "type": "Python" }
"""Test OpenAI Chat API wrapper.""" import json from types import TracebackType from typing import Any, Dict, List, Literal, Optional, Type, Union from unittest.mock import AsyncMock, MagicMock, patch import pytest from langchain_core.messages import ( AIMessage, AIMessageChunk, FunctionMessage, Human...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@partners@openai@tests@unit_tests@chat_models@test_base.py@.PATH_END.py
{ "filename": "_colorsrc.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/area/marker/_colorsrc.py", "type": "Python" }
import _plotly_utils.basevalidators class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__(self, plotly_name="colorsrc", parent_name="area.marker", **kwargs): super(ColorsrcValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@area@marker@_colorsrc.py@.PATH_END.py
{ "filename": "test_detailedRun_P2.ipynb", "repo_name": "anchal-009/SAVED21cm", "repo_path": "SAVED21cm_extracted/SAVED21cm-master/tests_new/test_detailedRun_P2.ipynb", "type": "Jupyter Notebook" }
### A detailed notebook to perform 21cm signal extraction by fitting 2 antennas at different times Importing dependencies ```python import sys; sys.path.insert(1, './../') from src.readset import Modset, Inputs from src.noise import Noise from src.basis import Basis from src.visuals import Visual from src.infocrit i...
anchal-009REPO_NAMESAVED21cmPATH_START.@SAVED21cm_extracted@SAVED21cm-master@tests_new@test_detailedRun_P2.ipynb@.PATH_END.py
{ "filename": "_tickformat.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/choropleth/colorbar/_tickformat.py", "type": "Python" }
import _plotly_utils.basevalidators class TickformatValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="tickformat", parent_name="choropleth.colorbar", **kwargs ): super(TickformatValidator, self).__init__( plotly_name=plotly_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@choropleth@colorbar@_tickformat.py@.PATH_END.py
{ "filename": "cubed_m_28_kg_scf_perts_off_newtcl.py", "repo_name": "PoulinV/AxiCLASS", "repo_path": "AxiCLASS_extracted/AxiCLASS-master/output/cubed_m_28_kg_scf_perts_off_newtcl.py", "type": "Python" }
import matplotlib.pyplot as plt import numpy as np import itertools files = ['/home/charlotte/class_perso-ScalarField/class_perso-ScalarField/output/cubed_m_28_kg_scf_perts_off_newtcl.dat', '/home/charlotte/class_perso-ScalarField/class_perso-ScalarField/output/cubed_m_28_fluid_scf_perts_off_newt_cl.dat', '/home/charl...
PoulinVREPO_NAMEAxiCLASSPATH_START.@AxiCLASS_extracted@AxiCLASS-master@output@cubed_m_28_kg_scf_perts_off_newtcl.py@.PATH_END.py
{ "filename": "_variant.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/carpet/baxis/title/font/_variant.py", "type": "Python" }
import _plotly_utils.basevalidators class VariantValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="variant", parent_name="carpet.baxis.title.font", **kwargs ): super(VariantValidator, self).__init__( plotly_name=plotly_name, p...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@carpet@baxis@title@font@_variant.py@.PATH_END.py
{ "filename": "__config__.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/numpy/py2/numpy/__config__.py", "type": "Python" }
# This file is generated by /home/alexander/work/temp/numpy-1.11.1/setup.py # It contains system_info results at the time of building this package. __all__ = ["get_info","show"] blas_info={'libraries': ['blas', 'blas'], 'library_dirs': ['/usr/lib'], 'language': 'c', 'define_macros': [('HAVE_CBLAS', None)]} atlas_3_10_...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@numpy@py2@numpy@__config__.py@.PATH_END.py
{ "filename": "read_spectrum.py", "repo_name": "psheehan/pdspy", "repo_path": "pdspy_extracted/pdspy-master/pdspy/spectroscopy/read_spectrum.py", "type": "Python" }
from numpy import loadtxt from .spectroscopy import Spectrum def read_spectrum(file): spectrum = loadtxt(file) wave = spectrum[:,0] flux = spectrum[:,1] unc = spectrum[:,2] data = Spectrum(wave,flux,unc) return data
psheehanREPO_NAMEpdspyPATH_START.@pdspy_extracted@pdspy-master@pdspy@spectroscopy@read_spectrum.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "brinckmann/montepython_public", "repo_path": "montepython_public_extracted/montepython_public-master/montepython/likelihoods/bicep/__init__.py", "type": "Python" }
# there is no specific lieklihood code for this experiment, because it # falls in the category of CMB experiments described in the "newdat" # format. The class below inherits the properties of a general class # "Likelihood_newdat", which knows how to deal with all experiments in # "newdat" format. from montepython.lik...
brinckmannREPO_NAMEmontepython_publicPATH_START.@montepython_public_extracted@montepython_public-master@montepython@likelihoods@bicep@__init__.py@.PATH_END.py
{ "filename": "test__threadsafety.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/_lib/tests/test__threadsafety.py", "type": "Python" }
import threading import time import traceback from numpy.testing import assert_ from pytest import raises as assert_raises from scipy._lib._threadsafety import ReentrancyLock, non_reentrant, ReentrancyError def test_parallel_threads(): # Check that ReentrancyLock serializes work in parallel threads. # #...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@_lib@tests@test__threadsafety.py@.PATH_END.py
{ "filename": "_dummy_thread32.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/deprecated/python/functools32/functools32/_dummy_thread32.py", "type": "Python" }
"""Drop-in replacement for the thread module. Meant to be used as a brain-dead substitute so that threaded code does not need to be rewritten for when the thread module is not present. Suggested usage is:: try: try: import _thread # Python >= 3 except: import thread as _t...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@deprecated@python@functools32@functools32@_dummy_thread32.py@.PATH_END.py
{ "filename": "multi-col.py", "repo_name": "enthought/mayavi", "repo_path": "mayavi_extracted/mayavi-master/mayavi/tests/csv_files/multi-col.py", "type": "Python" }
{ 'array': array([ (5.552, 1.942, 1.761, 2.6, 6.8), (5.963, 1.885, 1.775, 2.7, 6.9), (6.135, 1.791, 1.792, 2.5, 6.6), (6.313, 1.774, 1.884, 2.6, 6.6), (6.713, 1.762, 1.943, 2.5, 6.7)], dtype=[('Column 1', float), ...
enthoughtREPO_NAMEmayaviPATH_START.@mayavi_extracted@mayavi-master@mayavi@tests@csv_files@multi-col.py@.PATH_END.py
{ "filename": "arealm.py", "repo_name": "crossbario/crossbar", "repo_path": "crossbar_extracted/crossbar-master/crossbar/master/arealm/arealm.py", "type": "Python" }
############################################################################### # # Crossbar.io Master # Copyright (c) typedef int GmbH. Licensed under EUPLv1.2. # ############################################################################### import os import uuid from typing import Optional, List, Dict from pprint i...
crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@crossbar@master@arealm@arealm.py@.PATH_END.py
{ "filename": "_highlightwidth.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/surface/contours/x/_highlightwidth.py", "type": "Python" }
import _plotly_utils.basevalidators class HighlightwidthValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="highlightwidth", parent_name="surface.contours.x", **kwargs ): super(HighlightwidthValidator, self).__init__( plotly_name=plotly_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@surface@contours@x@_highlightwidth.py@.PATH_END.py
{ "filename": "_meta.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/surface/_meta.py", "type": "Python" }
import _plotly_utils.basevalidators class MetaValidator(_plotly_utils.basevalidators.AnyValidator): def __init__(self, plotly_name="meta", parent_name="surface", **kwargs): super(MetaValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, array_ok=k...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@surface@_meta.py@.PATH_END.py
{ "filename": "config_compiler.py", "repo_name": "numpy/numpy", "repo_path": "numpy_extracted/numpy-main/numpy/distutils/command/config_compiler.py", "type": "Python" }
from distutils.core import Command from numpy.distutils import log #XXX: Linker flags def show_fortran_compilers(_cache=None): # Using cache to prevent infinite recursion. if _cache: return elif _cache is None: _cache = [] _cache.append(1) from numpy.distutils.fcompiler import show...
numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@numpy@distutils@command@config_compiler.py@.PATH_END.py
{ "filename": "_showtickprefix.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/histogram/marker/colorbar/_showtickprefix.py", "type": "Python" }
import _plotly_utils.basevalidators class ShowtickprefixValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="showtickprefix", parent_name="histogram.marker.colorbar", **kwargs, ): super(ShowtickprefixValidator, self).__init__( ...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@histogram@marker@colorbar@_showtickprefix.py@.PATH_END.py
{ "filename": "Tutorial - Extract spectra against found radio sources in the f.o.v..ipynb", "repo_name": "apertif/apercal", "repo_path": "apercal_extracted/apercal-master/ipython-notebooks/projects/SHARP/Tutorial - Extract spectra against found radio sources in the f.o.v..ipynb", "type": "Jupyter Notebook" }
```python # Now we want to actually use the pipeline to extract spectra from an APERTIF observation # Let's start the pipeline again as we did in the last tutorials # Remember to change all the directory paths to your own ones %config IPCompleter.greedy=True %matplotlib notebook import libs.lib as lib lib.setup_logger(...
apertifREPO_NAMEapercalPATH_START.@apercal_extracted@apercal-master@ipython-notebooks@projects@SHARP@Tutorial - Extract spectra against found radio sources in the f.o.v..ipynb@.PATH_END.py
{ "filename": "default_constants.py", "repo_name": "njcuk9999/apero-drs", "repo_path": "apero-drs_extracted/apero-drs-main/apero/core/instruments/default/default_constants.py", "type": "Python" }
""" Default constants for NO INSTRUMENT This is the default constants config file Created on 2019-01-17 @author: cook """ # This is the main config file import numpy as np from apero.base import base from apero.core.constants import constant_functions # ============================================================...
njcuk9999REPO_NAMEapero-drsPATH_START.@apero-drs_extracted@apero-drs-main@apero@core@instruments@default@default_constants.py@.PATH_END.py
{ "filename": "test_spec.py", "repo_name": "NASA-Planetary-Science/sbpy", "repo_path": "sbpy_extracted/sbpy-main/sbpy/spectroscopy/tests/test_spec.py", "type": "Python" }
import os def data_path(filename): data_dir = os.path.join(os.path.dirname(__file__), 'data') return os.path.join(data_dir, filename) class MockResponseSpec(object): def __init__(self, filename): self.filename = data_path(filename) @property def text(self): with open(self.filen...
NASA-Planetary-ScienceREPO_NAMEsbpyPATH_START.@sbpy_extracted@sbpy-main@sbpy@spectroscopy@tests@test_spec.py@.PATH_END.py
{ "filename": "07_B_regularize_real_data.py", "repo_name": "gully/blase", "repo_path": "blase_extracted/blase-main/experiments/07_regularize_real_data/07_B_regularize_real_data.py", "type": "Python" }
import os import torch from torch import nn from tqdm import trange import torch.optim as optim from blase.emulator import SparsePhoenixEmulator import matplotlib.pyplot as plt from gollum.phoenix import PHOENIXSpectrum import numpy as np from muler.hpf import HPFSpectrumList, HPFSpectrum import copy import astropy.uni...
gullyREPO_NAMEblasePATH_START.@blase_extracted@blase-main@experiments@07_regularize_real_data@07_B_regularize_real_data.py@.PATH_END.py
{ "filename": "raytune.md", "repo_name": "ultralytics/ultralytics", "repo_path": "ultralytics_extracted/ultralytics-main/docs/en/reference/utils/callbacks/raytune.md", "type": "Markdown" }
--- description: Learn how to integrate Ray Tune with Ultralytics YOLO for efficient hyperparameter tuning and performance tracking. keywords: Ultralytics, Ray Tune, hyperparameter tuning, YOLO, machine learning, deep learning, callbacks, integration, training metrics --- # Reference for `ultralytics/utils/callbacks/r...
ultralyticsREPO_NAMEultralyticsPATH_START.@ultralytics_extracted@ultralytics-main@docs@en@reference@utils@callbacks@raytune.md@.PATH_END.py
{ "filename": "google_scholar.ipynb", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/tools/google_scholar.ipynb", "type": "Jupyter Notebook" }
# Google Scholar This notebook goes through how to use Google Scholar Tool ```python %pip install --upgrade --quiet google-search-results langchain-community ``` Requirement already satisfied: google-search-results in /home/mohtashimkhan/mambaforge/envs/langchain/lib/python3.9/site-packages (2.4.2) Require...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@tools@google_scholar.ipynb@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "MarcoMuellner/SMURFS", "repo_path": "SMURFS_extracted/SMURFS-master/smurfs/smurfs_common/preprocessing/__init__.py", "type": "Python" }
MarcoMuellnerREPO_NAMESMURFSPATH_START.@SMURFS_extracted@SMURFS-master@smurfs@smurfs_common@preprocessing@__init__.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "CobayaSampler/cobaya", "repo_path": "cobaya_extracted/cobaya-master/cobaya/likelihoods/planck_NPIPE_highl_CamSpec/__init__.py", "type": "Python" }
CobayaSamplerREPO_NAMEcobayaPATH_START.@cobaya_extracted@cobaya-master@cobaya@likelihoods@planck_NPIPE_highl_CamSpec@__init__.py@.PATH_END.py
{ "filename": "_color.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/waterfall/totals/marker/line/_color.py", "type": "Python" }
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="waterfall.totals.marker.line", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@waterfall@totals@marker@line@_color.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "trivnguyen/florah", "repo_path": "florah_extracted/florah-main/src/florah/__init__.py", "type": "Python" }
from . import models, utils
trivnguyenREPO_NAMEflorahPATH_START.@florah_extracted@florah-main@src@florah@__init__.py@.PATH_END.py
{ "filename": "_visible.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/indicator/_visible.py", "type": "Python" }
import _plotly_utils.basevalidators class VisibleValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="visible", parent_name="indicator", **kwargs): super(VisibleValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@indicator@_visible.py@.PATH_END.py
{ "filename": "worker.py", "repo_name": "PrefectHQ/prefect", "repo_path": "prefect_extracted/prefect-main/src/integrations/prefect-docker/prefect_docker/worker.py", "type": "Python" }
""" Module containing the Docker worker used for executing flow runs as Docker containers. To start a Docker worker, run the following command: ```bash prefect worker start --pool 'my-work-pool' --type docker ``` Replace `my-work-pool` with the name of the work pool you want the worker to poll for flow runs. For mo...
PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@integrations@prefect-docker@prefect_docker@worker.py@.PATH_END.py
{ "filename": "data_path.py", "repo_name": "grackle-project/grackle", "repo_path": "grackle_extracted/grackle-main/src/python/pygrackle/utilities/data_path.py", "type": "Python" }
######################################################################## # # Try to get a path to the Grackle input data. # # # Copyright (c) Grackle Development Team. All rights reserved. # # Distributed under the terms of the Enzo Public Licence. # # The full license is in the file LICENSE, distributed with this # so...
grackle-projectREPO_NAMEgracklePATH_START.@grackle_extracted@grackle-main@src@python@pygrackle@utilities@data_path.py@.PATH_END.py
{ "filename": "frozenSupport.py", "repo_name": "3fon3fonov/exostriker", "repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/pyqtgraph/frozenSupport.py", "type": "Python" }
## Definitions helpful in frozen environments (eg py2exe) import os import sys import zipfile def listdir(path): """Replacement for os.listdir that works in frozen environments.""" if not hasattr(sys, 'frozen'): return os.listdir(path) (zipPath, archivePath) = splitZip(path) if archivePat...
3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@pyqtgraph@frozenSupport.py@.PATH_END.py
{ "filename": "test_serve.py", "repo_name": "ML4GW/hermes", "repo_path": "hermes_extracted/hermes-main/tests/aeriel/serve/test_serve.py", "type": "Python" }
import os import time from queue import Queue from tempfile import NamedTemporaryFile from unittest.mock import MagicMock, patch import pytest from hermes.aeriel.serve.serve import get_wait, serve def test_get_wait(): q = Queue() wait = get_wait(q) responses = iter([False, False, True]) def is_serv...
ML4GWREPO_NAMEhermesPATH_START.@hermes_extracted@hermes-main@tests@aeriel@serve@test_serve.py@.PATH_END.py
{ "filename": "solve.py", "repo_name": "JohannesBuchner/PyMultiNest", "repo_path": "PyMultiNest_extracted/PyMultiNest-master/pymultinest/solve.py", "type": "Python" }
""" A pythonic interface to MultiNest """ from __future__ import absolute_import, unicode_literals, print_function from .run import run from .analyse import Analyzer import numpy import tempfile import shutil """ A pythonic interface to MultiNest. The arguments are the same as in *run* (see there), except that the ...
JohannesBuchnerREPO_NAMEPyMultiNestPATH_START.@PyMultiNest_extracted@PyMultiNest-master@pymultinest@solve.py@.PATH_END.py
{ "filename": "test_prepare_arrays.py", "repo_name": "daniel-muthukrishna/astrorapid", "repo_path": "astrorapid_extracted/astrorapid-master/tests/test_prepare_arrays.py", "type": "Python" }
daniel-muthukrishnaREPO_NAMEastrorapidPATH_START.@astrorapid_extracted@astrorapid-master@tests@test_prepare_arrays.py@.PATH_END.py
{ "filename": "utils.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/packaging/py2/packaging/utils.py", "type": "Python" }
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import re from ._typing import TYPE_CHECKING, cast from .tags import Tag,...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@packaging@py2@packaging@utils.py@.PATH_END.py
{ "filename": "3__supervised_model_investigation.ipynb", "repo_name": "ArjunS07/pu-learning-for-frbs-2023", "repo_path": "pu-learning-for-frbs-2023_extracted/pu-learning-for-frbs-2023-master/src/3__supervised_model_investigation.ipynb", "type": "Jupyter Notebook" }
```python import pandas as pd import numpy as np import warnings from collections import Counter warnings.filterwarnings("ignore") from imblearn.over_sampling import SMOTE from sklearn.preprocessing import StandardScaler from sklearn.metrics import recall_score, fbeta_score from sklearn.linear_model import LogisticR...
ArjunS07REPO_NAMEpu-learning-for-frbs-2023PATH_START.@pu-learning-for-frbs-2023_extracted@pu-learning-for-frbs-2023-master@src@3__supervised_model_investigation.ipynb@.PATH_END.py
{ "filename": "_column.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/geo/domain/_column.py", "type": "Python" }
import _plotly_utils.basevalidators class ColumnValidator(_plotly_utils.basevalidators.IntegerValidator): def __init__(self, plotly_name="column", parent_name="layout.geo.domain", **kwargs): super(ColumnValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@geo@domain@_column.py@.PATH_END.py
{ "filename": "XID+CIGALE-ESB_fit.ipynb", "repo_name": "H-E-L-P/XID_plus", "repo_path": "XID_plus_extracted/XID_plus-master/docs/build/doctrees/nbsphinx/notebooks/examples/SED_emulator/XID+CIGALE-ESB_fit.ipynb", "type": "Jupyter Notebook" }
# Applying XID+CIGALE to Lenses In this notebook, we read in the data files and prepare them for fitting with XID+CIGALE, the SED prior model extension to XID+. Here we focus on sources Lenses observed by HST and found in Herschel blind catalogues Import required modules ```python from astropy.io import ascii, fits ...
H-E-L-PREPO_NAMEXID_plusPATH_START.@XID_plus_extracted@XID_plus-master@docs@build@doctrees@nbsphinx@notebooks@examples@SED_emulator@XID+CIGALE-ESB_fit.ipynb@.PATH_END.py
{ "filename": "test_optimizers.py", "repo_name": "blackjax-devs/blackjax", "repo_path": "blackjax_extracted/blackjax-main/tests/optimizers/test_optimizers.py", "type": "Python" }
"""Test optimizers.""" import functools import chex import jax import jax.numpy as jnp import jax.scipy.stats as stats import numpy as np from absl.testing import absltest, parameterized from jax.flatten_util import ravel_pytree from jaxopt._src.lbfgs import compute_gamma, inv_hessian_product from blackjax.optimizers...
blackjax-devsREPO_NAMEblackjaxPATH_START.@blackjax_extracted@blackjax-main@tests@optimizers@test_optimizers.py@.PATH_END.py
{ "filename": "_hovertext.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/streamtube/_hovertext.py", "type": "Python" }
import _plotly_utils.basevalidators class HovertextValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="hovertext", parent_name="streamtube", **kwargs): super(HovertextValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@streamtube@_hovertext.py@.PATH_END.py
{ "filename": "photoz.ipynb", "repo_name": "glass-dev/glass", "repo_path": "glass_extracted/glass-main/examples/1-basic/photoz.ipynb", "type": "Jupyter Notebook" }
# Photometric redshifts This example simulates galaxies with a simple photometric redshift model. ## Setup The simplest galaxies-only GLASS simulation, sampling galaxies using some redshift distribution. Then add a model for photometric redshifts with Gaussian errors. ```python import matplotlib.pyplot as plt i...
glass-devREPO_NAMEglassPATH_START.@glass_extracted@glass-main@examples@1-basic@photoz.ipynb@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "rhayes777/PyAutoFit", "repo_path": "PyAutoFit_extracted/PyAutoFit-main/test_autofit/text/__init__.py", "type": "Python" }
rhayes777REPO_NAMEPyAutoFitPATH_START.@PyAutoFit_extracted@PyAutoFit-main@test_autofit@text@__init__.py@.PATH_END.py
{ "filename": "queues.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/joblib/joblib/externals/loky/backend/queues.py", "type": "Python" }
############################################################################### # Queue and SimpleQueue implementation for loky # # authors: Thomas Moreau, Olivier Grisel # # based on multiprocessing/queues.py (16/02/2017) # * Add some custom reducers for the Queues/SimpleQueue to tweak the # pickling process. (overl...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@joblib@joblib@externals@loky@backend@queues.py@.PATH_END.py
{ "filename": "_textfont.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/icicle/pathbar/_textfont.py", "type": "Python" }
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Textfont(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "icicle.pathbar" _path_str = "icicle.pathbar.textfont" _valid_props = { "color", ...
plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@icicle@pathbar@_textfont.py@.PATH_END.py
{ "filename": "_nticks.py", "repo_name": "plotly/plotly.py", "repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/contour/colorbar/_nticks.py", "type": "Python" }
import _plotly_utils.basevalidators class NticksValidator(_plotly_utils.basevalidators.IntegerValidator): def __init__(self, plotly_name="nticks", parent_name="contour.colorbar", **kwargs): super(NticksValidator, 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@contour@colorbar@_nticks.py@.PATH_END.py
{ "filename": "_lon.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattergeo/_lon.py", "type": "Python" }
import _plotly_utils.basevalidators class LonValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__(self, plotly_name="lon", parent_name="scattergeo", **kwargs): super(LonValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit...
catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattergeo@_lon.py@.PATH_END.py
{ "filename": "setup.py", "repo_name": "amusecode/amuse", "repo_path": "amuse_extracted/amuse-main/packages/amuse-simplex/setup.py", "type": "Python" }
#!/usr/bin/env python3 from support.classifiers import classifiers from setuptools import setup import support support.use("system") from support.setup_codes import setup_commands name = 'amuse-simplex' author = 'The AMUSE team' author_email = 'info@amusecode.org' license_ = "Apache License 2.0" url = 'http://www.am...
amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@packages@amuse-simplex@setup.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "gammapy/enrico", "repo_path": "enrico_extracted/enrico-master/enrico/submit/__init__.py", "type": "Python" }
"""Helper functions to call command line tools from python @todo: - Make it flexible so that a dict(a=42) can be given and 'a=42' or '-a 42' or '--a 42' is generated depending on an option! - Make it a class, so that options like dryrun or options formattting don't have to be handed around all the time!!!""" import s...
gammapyREPO_NAMEenricoPATH_START.@enrico_extracted@enrico-master@enrico@submit@__init__.py@.PATH_END.py
{ "filename": "optimization.py", "repo_name": "mtalapinto/moes", "repo_path": "carmenes/optimization.py", "type": "Python" }
import warnings import glob import chromatic_aberrations import matplotlib.pyplot as plt import matplotlib.cm as cm from astropy.time import Time import joint_aberrations import optical_aberrations import poly_fit warnings.filterwarnings("ignore") from pylab import * from optics import vis_spectrometer from simanneal ...
mtalapintoREPO_NAMEmoesPATH_START.@carmenes@optimization.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "jakevdp/nfft", "repo_path": "nfft_extracted/nfft-master/nfft/__init__.py", "type": "Python" }
"""Non-equispaced Fast Fourier Transforms""" from __future__ import absolute_import, division, print_function from .version import __version__ from .core import nfft, ndft, nfft_adjoint, ndft_adjoint
jakevdpREPO_NAMEnfftPATH_START.@nfft_extracted@nfft-master@nfft@__init__.py@.PATH_END.py
{ "filename": "test_california_housing.py", "repo_name": "scikit-learn/scikit-learn", "repo_path": "scikit-learn_extracted/scikit-learn-main/sklearn/datasets/tests/test_california_housing.py", "type": "Python" }
"""Test the california_housing loader, if the data is available, or if specifically requested via environment variable (e.g. for CI jobs).""" from functools import partial import pytest from sklearn.datasets.tests.test_common import check_return_X_y def test_fetch(fetch_california_housing_fxt): data = fetch_ca...
scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@sklearn@datasets@tests@test_california_housing.py@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "catboost/catboost", "repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/densitymapbox/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@densitymapbox@colorbar@title@font@__init__.py@.PATH_END.py
{ "filename": "example-analysis-cgm.ipynb", "repo_name": "rongmon/rbcodes", "repo_path": "rbcodes_extracted/rbcodes-master/example-analysis-cgm.ipynb", "type": "Jupyter Notebook" }
# This is an examples of how to perform a CGM analysis using the rb_spec.py pipeline ## Written By: Rongmon Bordoloi ---------------- The goal of this notebook is to show a running example analysing absorption line spectra. We will read in a fits file of a HST/COS quasar, pick one absorption line, continuum normaliz...
rongmonREPO_NAMErbcodesPATH_START.@rbcodes_extracted@rbcodes-master@example-analysis-cgm.ipynb@.PATH_END.py
{ "filename": "__init__.py", "repo_name": "statsmodels/statsmodels", "repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/miscmodels/tests/__init__.py", "type": "Python" }
statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@miscmodels@tests@__init__.py@.PATH_END.py
{ "filename": "test_fillna.py", "repo_name": "pandas-dev/pandas", "repo_path": "pandas_extracted/pandas-main/pandas/tests/indexes/datetimes/methods/test_fillna.py", "type": "Python" }
import pytest import pandas as pd import pandas._testing as tm class TestDatetimeIndexFillNA: @pytest.mark.parametrize("tz", ["US/Eastern", "Asia/Tokyo"]) def test_fillna_datetime64(self, tz): # GH 11343 idx = pd.DatetimeIndex(["2011-01-01 09:00", pd.NaT, "2011-01-01 11:00"]) exp = p...
pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@indexes@datetimes@methods@test_fillna.py@.PATH_END.py
{ "filename": "relative_moments.py", "repo_name": "LSSTDESC/chroma", "repo_path": "chroma_extracted/chroma-master/bin/phosim/characterize/off_axis_dispersion/relative_moments.py", "type": "Python" }
''' Want to measure first and second moments of simulated stars relative to the simulated G5v stars. ''' import pickle import numpy import pyfits import _mypath import chroma def encode_obshistid(SED_type, filter_name, zenith, seed, redshift): SED_types = {'G5v':'1', 'star':'2', 'gal':'3'} SED_digit = SED_t...
LSSTDESCREPO_NAMEchromaPATH_START.@chroma_extracted@chroma-master@bin@phosim@characterize@off_axis_dispersion@relative_moments.py@.PATH_END.py
{ "filename": "adapter_utils.md", "repo_name": "huggingface/peft", "repo_path": "peft_extracted/peft-main/docs/source/package_reference/adapter_utils.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@adapter_utils.md@.PATH_END.py
{ "filename": "edenai.py", "repo_name": "langchain-ai/langchain", "repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/llms/edenai.py", "type": "Python" }
from typing import TYPE_CHECKING, Any from langchain._api import create_importer if TYPE_CHECKING: from langchain_community.llms import EdenAI # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optional imports. DEPRECATED_LOOKUP ...
langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@llms@edenai.py@.PATH_END.py