metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "Aesthetics.py",
"repo_name": "mirochaj/ares",
"repo_path": "ares_extracted/ares-main/ares/util/Aesthetics.py",
"type": "Python"
} | """
Aesthetics.py
Author: Jordan Mirocha
Affiliation: University of Colorado at Boulder
Created on: Wed Sep 24 16:15:52 MDT 2014
Description:
"""
import os, imp, re
import numpy as np
from matplotlib import cm
from .ParameterFile import par_info
from matplotlib.colors import ListedColormap
# Charlotte's color-map... | mirochajREPO_NAMEaresPATH_START.@ares_extracted@ares-main@ares@util@Aesthetics.py@.PATH_END.py |
{
"filename": "testdpg.py",
"repo_name": "mef51/frbgui",
"repo_path": "frbgui_extracted/frbgui-main/testdpg.py",
"type": "Python"
} | import dpg
dpg.set_main_window_size(500, 500)
dpg.set_main_window_title("Group Test")
with dpg.window('FRB Analysis', width=200, height=200, x_pos=10, y_pos=30):
with dpg.group("Hello"):
pass
with dpg.group("Bye", parent="Hello"):
dpg.add_button("A button", parent="Hello")
dpg.add_button("B button", parent="H... | mef51REPO_NAMEfrbguiPATH_START.@frbgui_extracted@frbgui-main@testdpg.py@.PATH_END.py |
{
"filename": "qt.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/ipython/py3/IPython/terminal/pt_inputhooks/qt.py",
"type": "Python"
} | import sys
import os
from IPython.external.qt_for_kernel import QtCore, QtGui, enum_helper
from IPython import get_ipython
# If we create a QApplication, keep a reference to it so that it doesn't get
# garbage collected.
_appref = None
_already_warned = False
def _exec(obj):
# exec on PyQt6, exec_ elsewhere.
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipython@py3@IPython@terminal@pt_inputhooks@qt.py@.PATH_END.py |
{
"filename": "cluster_model.py",
"repo_name": "Moyoxkit/cluster-counts",
"repo_path": "cluster-counts_extracted/cluster-counts-main/cluster_model/cluster_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@cluster_model.py@.PATH_END.py |
{
"filename": "_idssrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattersmith/_idssrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class IdssrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="idssrc", parent_name="scattersmith", **kwargs):
super(IdssrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattersmith@_idssrc.py@.PATH_END.py |
{
"filename": "reducepoldata.py",
"repo_name": "saltastro/polsalt",
"repo_path": "polsalt_extracted/polsalt-master/scripts/reducepoldata.py",
"type": "Python"
} | import os, sys, glob
import argparse
import numpy as np
import pyfits
# np.seterr(invalid='raise')
import polsalt
datadir = os.path.dirname(polsalt.__file__)+'/data/'
from polsalt.imred import imred
from polsalt.specpolwavmap import specpolwavmap
from polsalt.specpolextract import specpolextract
from polsalt.specpol... | saltastroREPO_NAMEpolsaltPATH_START.@polsalt_extracted@polsalt-master@scripts@reducepoldata.py@.PATH_END.py |
{
"filename": "bticino.py",
"repo_name": "jabesq-org/pyatmo",
"repo_path": "pyatmo_extracted/pyatmo-master/src/pyatmo/modules/bticino.py",
"type": "Python"
} | """Module to represent BTicino modules."""
from __future__ import annotations
import logging
from pyatmo.modules.module import (
DimmableMixin,
Module,
Shutter,
ShutterMixin,
Switch,
SwitchMixin,
)
LOG = logging.getLogger(__name__)
class BNDL(Module):
"""BTicino door lock."""
class B... | jabesq-orgREPO_NAMEpyatmoPATH_START.@pyatmo_extracted@pyatmo-master@src@pyatmo@modules@bticino.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "gbrammer/eazy-py",
"repo_path": "eazy-py_extracted/eazy-py-master/eazy/utils.py",
"type": "Python"
} | import os
import warnings
import numpy as np
import matplotlib.pyplot as plt
import astropy.stats
import astropy.units as u
CLIGHT = 299792458.0 # m/s
TRUE_VALUES = [True, 1, '1', 'True', 'TRUE', 'true', 'y', 'yes', 'Y', 'Yes']
FALSE_VALUES = [False, 0, '0', 'False', 'FALSE', 'false', 'n', 'no', 'N', 'No']
FNU_CGS... | gbrammerREPO_NAMEeazy-pyPATH_START.@eazy-py_extracted@eazy-py-master@eazy@utils.py@.PATH_END.py |
{
"filename": "EccAndIncDamping.ipynb",
"repo_name": "dtamayo/reboundx",
"repo_path": "reboundx_extracted/reboundx-main/ipython_examples/EccAndIncDamping.ipynb",
"type": "Jupyter Notebook"
} | # Eccentricity & Inclination Damping
For modifying orbital elements, REBOUNDx offers two implementations. `modify_orbits_direct` directly calculates orbital elements and modifies those, while `modify_orbits_forces` applies forces that when orbit-averaged yield the desired behavior. Let's set up a simple simulation o... | dtamayoREPO_NAMEreboundxPATH_START.@reboundx_extracted@reboundx-main@ipython_examples@EccAndIncDamping.ipynb@.PATH_END.py |
{
"filename": "_variantsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/table/cells/font/_variantsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class VariantsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="variantsrc", parent_name="table.cells.font", **kwargs
):
super(VariantsrcValidator, self).__init__(
plotly_name=plotly_name,
parent... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@table@cells@font@_variantsrc.py@.PATH_END.py |
{
"filename": "_bordercolorsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/table/hoverlabel/_bordercolorsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BordercolorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="bordercolorsrc", parent_name="table.hoverlabel", **kwargs
):
super(BordercolorsrcValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@table@hoverlabel@_bordercolorsrc.py@.PATH_END.py |
{
"filename": "_show.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/isosurface/slices/y/_show.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="show", parent_name="isosurface.slices.y", **kwargs):
super(ShowValidator, 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@isosurface@slices@y@_show.py@.PATH_END.py |
{
"filename": "runCosmoHammerPseudoCmb.py",
"repo_name": "cosmo-ethz/CosmoHammer",
"repo_path": "CosmoHammer_extracted/CosmoHammer-master/examples/runCosmoHammerPseudoCmb.py",
"type": "Python"
} | #!/usr/bin/env python
"""
Runs CosmoHammer with a likelihood module simulating the WMAP likelihood by assuming the parameter distributions to be gaussian.
Yields results very similar to ones gathered using CAMB and WMAP in default config, but only needs a fraction of the time.
"""
from __future__ import print_function,... | cosmo-ethzREPO_NAMECosmoHammerPATH_START.@CosmoHammer_extracted@CosmoHammer-master@examples@runCosmoHammerPseudoCmb.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/contour/contours/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._labelfont import Labelfont
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._labelfont.Labelfont"]
)
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@contour@contours@__init__.py@.PATH_END.py |
{
"filename": "Armentrout_2015.py",
"repo_name": "geodynamics/burnman",
"repo_path": "burnman_extracted/burnman-main/burnman/calibrants/Armentrout_2015.py",
"type": "Python"
} | # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for
# the Earth and Planetary Sciences
# Copyright (C) 2012 - 2024 by the BurnMan team, released under the GNU
# GPL v2 or later.
from burnman.eos.birch_murnaghan import BirchMurnaghanBase as BM3
from burnman.eos.mie_grueneisen_debye import MGD... | geodynamicsREPO_NAMEburnmanPATH_START.@burnman_extracted@burnman-main@burnman@calibrants@Armentrout_2015.py@.PATH_END.py |
{
"filename": "AMR_comparison_analysis.py",
"repo_name": "Astroua/AstroStat_Results",
"repo_path": "AstroStat_Results_extracted/AstroStat_Results-master/AMR_comparison_analysis.py",
"type": "Python"
} |
'''
Compare the timestep 30 fiducials with and without AMR.
'''
import numpy as np
import astropy.units as u
import os
import sys
from astropy.utils.console import ProgressBar
import pandas as pd
from copy import copy
import statsmodels.api as sm
import statsmodels.formula.api as smf
from turbustat.data_reduction im... | AstrouaREPO_NAMEAstroStat_ResultsPATH_START.@AstroStat_Results_extracted@AstroStat_Results-master@AMR_comparison_analysis.py@.PATH_END.py |
{
"filename": "test_imports.py",
"repo_name": "crossbario/crossbar",
"repo_path": "crossbar_extracted/crossbar-master/test/test_imports.py",
"type": "Python"
} | import time
import sys
import os
def test_import_1():
started = time.monotonic_ns()
import autobahn
ended = time.monotonic_ns()
return ended - started
def test_import_2():
started = time.monotonic_ns()
from autobahn import xbr
ended = time.monotonic_ns()
return ended - started
def tes... | crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@test@test_imports.py@.PATH_END.py |
{
"filename": "calc_avg_pres.py",
"repo_name": "cshsgy/ExoCubed",
"repo_path": "ExoCubed_extracted/ExoCubed-main/examples/2023-Chen-exo3/calc_avg_pres.py",
"type": "Python"
} |
import numpy as np
from netCDF4 import Dataset
from scipy.interpolate import interp1d
import os
from tqdm import tqdm
# Set the filepath to your single combined .nc file
filepath = 'pres_hotjupiter.nc' # Change this to your file path
# Set the name of the output file where the results will be saved
output_file = 'a... | cshsgyREPO_NAMEExoCubedPATH_START.@ExoCubed_extracted@ExoCubed-main@examples@2023-Chen-exo3@calc_avg_pres.py@.PATH_END.py |
{
"filename": "fftarma.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/sandbox/tsa/fftarma.py",
"type": "Python"
} | """
Created on Mon Dec 14 19:53:25 2009
Author: josef-pktd
generate arma sample using fft with all the lfilter it looks slow
to get the ma representation first
apply arma filter (in ar representation) to time series to get white noise
but seems slow to be useful for fast estimation for nobs=10000
change/check: inst... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@sandbox@tsa@fftarma.py@.PATH_END.py |
{
"filename": "point_source.py",
"repo_name": "Herculens/herculens",
"repo_path": "herculens_extracted/herculens-main/herculens/PointSourceModel/point_source.py",
"type": "Python"
} | # Copyright (c) 2023, herculens developers and contributors
__author__ = 'austinpeel'
import functools
import numpy as np
import jax.numpy as jnp
try:
from helens import LensEquationSolver
except ImportError:
_solver_installed = False
else:
_solver_installed = True
__all__ = ['PointSource']
class Poi... | HerculensREPO_NAMEherculensPATH_START.@herculens_extracted@herculens-main@herculens@PointSourceModel@point_source.py@.PATH_END.py |
{
"filename": "test_healpix.py",
"repo_name": "astropy/reproject",
"repo_path": "reproject_extracted/reproject-main/reproject/healpix/tests/test_healpix.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import itertools
import os
import numpy as np
import pytest
from astropy.io import fits
from astropy.wcs import WCS
from astropy_healpix import nside_to_npix
from ...interpolation.tests.test_core import as_high_level_wcs
from ...tests.test_high_level im... | astropyREPO_NAMEreprojectPATH_START.@reproject_extracted@reproject-main@reproject@healpix@tests@test_healpix.py@.PATH_END.py |
{
"filename": "cycoverage.py",
"repo_name": "mpi4py/mpi4py",
"repo_path": "mpi4py_extracted/mpi4py-master/conf/cycoverage.py",
"type": "Python"
} | import os
from coverage.plugin import (
CoveragePlugin,
FileTracer,
FileReporter
)
from coverage.files import (
canonical_filename,
)
CYTHON_EXTENSIONS = {".pxd", ".pyx", ".pxi"}
class CythonCoveragePlugin(CoveragePlugin):
def configure(self, config):
self.exclude = config.get_option("re... | mpi4pyREPO_NAMEmpi4pyPATH_START.@mpi4py_extracted@mpi4py-master@conf@cycoverage.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "radis/radis",
"repo_path": "radis_extracted/radis-master/radis/test/utils.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""Tools to test RADIS library.
Summary
-------
Tools to test RADIS library
Examples
--------
Run all tests::
cd radis/test
pytest
Run only "fast" tests (tests that have a "fast" label, and should be
a few seconds only)::
cd radis/test
pytest -m fast
---------------------... | radisREPO_NAMEradisPATH_START.@radis_extracted@radis-master@radis@test@utils.py@.PATH_END.py |
{
"filename": "configure.py",
"repo_name": "astro-friedel/CADRE",
"repo_path": "CADRE_extracted/CADRE-master/configure.py",
"type": "Python"
} | import os
ok = False
try :
import flagging
ok = True
except :
pass
if(not ok) :
print "Configuring the pipeline for your system (this should only need to be run once)"
try :
from pipeline_miriadwrap import *
except:
print "Could not locate the python MIRIAD wrappers"
pri... | astro-friedelREPO_NAMECADREPATH_START.@CADRE_extracted@CADRE-master@configure.py@.PATH_END.py |
{
"filename": "hubconf.py",
"repo_name": "pmelchior/spender",
"repo_path": "spender_extracted/spender-main/spender/hubconf.py",
"type": "Python"
} | ../hubconf.py | pmelchiorREPO_NAMEspenderPATH_START.@spender_extracted@spender-main@spender@hubconf.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattergeo/marker/colorbar/tickfont/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="color",
parent_name="scattergeo.marker.colorbar.tickfont",
**kwargs,
):
super(ColorValidator, self).__init__(
plotly_name=... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattergeo@marker@colorbar@tickfont@_color.py@.PATH_END.py |
{
"filename": "helio_jd.py",
"repo_name": "segasai/astrolibpy",
"repo_path": "astrolibpy_extracted/astrolibpy-master/astrolib/helio_jd.py",
"type": "Python"
} | from numpy import array, cos, sin, tan, pi, poly1d, deg2rad
from xyz import xyz
from bprecess import bprecess
def helio_jd(date, ra, dec, b1950=False, time_diff=False):
"""
NAME:
HELIO_JD
PURPOSE:
Convert geocentric (reduced) Julian date to heliocentric Julian date
EXPLANATION:
... | segasaiREPO_NAMEastrolibpyPATH_START.@astrolibpy_extracted@astrolibpy-master@astrolib@helio_jd.py@.PATH_END.py |
{
"filename": "test_overrides.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/numpy/py3/numpy/core/tests/test_overrides.py",
"type": "Python"
} | import inspect
import sys
import os
import tempfile
from io import StringIO
from unittest import mock
import numpy as np
from numpy.testing import (
assert_, assert_equal, assert_raises, assert_raises_regex)
from numpy.core.overrides import (
_get_implementing_args, array_function_dispatch,
verify_matching... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@numpy@py3@numpy@core@tests@test_overrides.py@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/layout/scene/xaxis/title/_font.py",
"type": "Python"
} | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Font(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.scene.xaxis.title"
_path_str = "layout.scene.xaxis.title.font"
_valid_props = {
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@layout@scene@xaxis@title@_font.py@.PATH_END.py |
{
"filename": "pixelsplines.py",
"repo_name": "desihub/desisim",
"repo_path": "desisim_extracted/desisim-main/py/desisim/pixelsplines.py",
"type": "Python"
} | """
desisim.pixelsplines
====================
Pixel-integrated spline utilities.
Written by A. Bolton, U. of Utah, 2010-2013.
"""
from __future__ import absolute_import, division, print_function
import numpy as n
from scipy import linalg as la
from scipy import sparse as sp
from scipy import special as sf
def compu... | desihubREPO_NAMEdesisimPATH_START.@desisim_extracted@desisim-main@py@desisim@pixelsplines.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "ajdittmann/multiNestNotes",
"repo_path": "multiNestNotes_extracted/multiNestNotes-master/README.md",
"type": "Markdown"
} | # Nested Sampling test problems
Some simple test problems for nested sampling codes (or other Bayesian sampling methods). These include multidimensional normal distributions, [generalized Rosenbrock](https://arxiv.org/abs/1903.09556) distributions, and multidimensional [log-gamma](https://docs.scipy.org/doc/scipy/refer... | ajdittmannREPO_NAMEmultiNestNotesPATH_START.@multiNestNotes_extracted@multiNestNotes-master@README.md@.PATH_END.py |
{
"filename": "plot_slice.py",
"repo_name": "PrincetonUniversity/athena",
"repo_path": "athena_extracted/athena-master/vis/python/plot_slice.py",
"type": "Python"
} | #! /usr/bin/env python
"""
Script for plotting 2D data or 2D slices of 3D data, intended primarily for
Cartesian grids.
Run "plot_slice.py -h" to see description of inputs.
See documentation on athena_read.athdf() for important notes about reading files
with mesh refinement.
Users are encouraged to make their own v... | PrincetonUniversityREPO_NAMEathenaPATH_START.@athena_extracted@athena-master@vis@python@plot_slice.py@.PATH_END.py |
{
"filename": "matrix_gen-bias_real_space.py",
"repo_name": "Michalychforever/CLASS-PT",
"repo_path": "CLASS-PT_extracted/CLASS-PT-master/pt_matrices/compute_matrices_python/bias_real_space/matrix_gen-bias_real_space.py",
"type": "Python"
} | import numpy as np
#from whichdict import importdict
from sympy.parsing.mathematica import mathematica
from sympy import *
from mpmath import *
mp.dps = 32
mp.pretty = True
nu1 = var('nu1')
nu2 = var('nu2')
def J(nu1,nu2):
return (gamma(1.5 - nu1) * gamma(1.5 - nu2) * gamma(nu1 + nu2 - 1.5) / (gamma(nu1) * gamma... | MichalychforeverREPO_NAMECLASS-PTPATH_START.@CLASS-PT_extracted@CLASS-PT-master@pt_matrices@compute_matrices_python@bias_real_space@matrix_gen-bias_real_space.py@.PATH_END.py |
{
"filename": "TestOverride.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/tests/unit/NodeList/TestOverride.py",
"type": "Python"
} | from SpheralTestUtilities import *
import NodeList
class DummySphNodeList1d(SphNodeList1d):
def __init__(self,
numInternal = 100,
numGhost = 0):
SphNodeList1d(numInternal, numGhost)
print("Instantiating dummy sph node list.")
return
nodes = SphNodeList1d(1... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@tests@unit@NodeList@TestOverride.py@.PATH_END.py |
{
"filename": "tfsa-2021-019.md",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/security/advisory/tfsa-2021-019.md",
"type": "Markdown"
} | ## TFSA-2021-019: Heap buffer overflow caused by rounding
### CVE Number
CVE-2021-29529
### Impact
An attacker can trigger a heap buffer overflow in
`tf.raw_ops.QuantizedResizeBilinear` by manipulating input values so that float
rounding results in off-by-one error in accessing image elements:
```python
import tenso... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@security@advisory@tfsa-2021-019.md@.PATH_END.py |
{
"filename": "Data_selector.py",
"repo_name": "astrom-tom/SPARTAN",
"repo_path": "SPARTAN_extracted/SPARTAN-master/spartan/Data_selector.py",
"type": "Python"
} | '''
############################
#####
##### The Spartan Project
##### R. THOMAS
##### 2016-18
#####
##### This file contains
##### the code that organizes
##### the data in *Lib.hdf5
##### files
###########################
@License: GPL licence - see LICENCE.txt
'''
#### local imports
from . i... | astrom-tomREPO_NAMESPARTANPATH_START.@SPARTAN_extracted@SPARTAN-master@spartan@Data_selector.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/docstore/__init__.py",
"type": "Python"
} | """**Docstores** are classes to store and load Documents.
The **Docstore** is a simplified version of the Document Loader.
**Class hierarchy:**
.. code-block::
Docstore --> <name> # Examples: InMemoryDocstore, Wikipedia
**Main helpers:**
.. code-block::
Document, AddableMixin
"""
import importlib
from t... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@docstore@__init__.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "nespinoza/exonailer",
"repo_path": "exonailer_extracted/exonailer-master/utilities/flicker-noise/setup.py",
"type": "Python"
} | from distutils.core import setup, Extension
import numpy
"""
According to GSL documentation (http://www.gnu.org/software/gsl/manual/html_node/Shared-Libraries.html), in order to run the different operations one must include the GSL library, the GSLCBLAS library and the math library. To compile in C one must do:
... | nespinozaREPO_NAMEexonailerPATH_START.@exonailer_extracted@exonailer-master@utilities@flicker-noise@setup.py@.PATH_END.py |
{
"filename": "_xsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/funnel/_xsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="xsrc", parent_name="funnel", **kwargs):
super(XsrcValidator, 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@funnel@_xsrc.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/partners/openai/langchain_openai/output_parsers/__init__.py",
"type": "Python"
} | from langchain_core.output_parsers.openai_tools import (
JsonOutputKeyToolsParser,
JsonOutputToolsParser,
PydanticToolsParser,
)
__all__ = ["JsonOutputKeyToolsParser", "JsonOutputToolsParser", "PydanticToolsParser"]
| langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@partners@openai@langchain_openai@output_parsers@__init__.py@.PATH_END.py |
{
"filename": "plot_case_A.py",
"repo_name": "galtay/rabacus",
"repo_path": "rabacus_extracted/rabacus-master/cloudy/plot_case_A.py",
"type": "Python"
} | import time
import numpy as np
import rabacus as ra
# setup Stromgren sphere
#=================================================================
Nl = 512
T = np.ones(Nl) * 1.0e4 * ra.U.K
Rsphere = 6.6 * ra.U.kpc
Edges = np.linspace( 0.0 * ra.U.kpc, Rsphere, Nl+1 )
nH = np.ones(Nl) * 1.0e-3 / ra.U.cm**3
nHe = np.on... | galtayREPO_NAMErabacusPATH_START.@rabacus_extracted@rabacus-master@cloudy@plot_case_A.py@.PATH_END.py |
{
"filename": "test_large_input.py",
"repo_name": "dmlc/xgboost",
"repo_path": "xgboost_extracted/xgboost-master/tests/python-gpu/test_large_input.py",
"type": "Python"
} | import cupy as cp
import numpy as np
import pytest
import xgboost as xgb
# Test for integer overflow or out of memory exceptions
def test_large_input():
available_bytes, _ = cp.cuda.runtime.memGetInfo()
# 15 GB
required_bytes = 1.5e10
if available_bytes < required_bytes:
pytest.skip("Not enou... | dmlcREPO_NAMExgboostPATH_START.@xgboost_extracted@xgboost-master@tests@python-gpu@test_large_input.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "glue-viz/glue",
"repo_path": "glue_extracted/glue-main/glue/plugins/data_factories/__init__.py",
"type": "Python"
} | glue-vizREPO_NAMEgluePATH_START.@glue_extracted@glue-main@glue@plugins@data_factories@__init__.py@.PATH_END.py | |
{
"filename": "python__group_weight__first-sentence.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/_includes/work_src/reusage/python__group_weight__first-sentence.md",
"type": "Markdown"
} |
The weights of all objects within the defined groups from the input data in the form of one-dimensional array-like data.
Used for calculating the final values of trees. By default, it is set to 1 for all objects in all groups.
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@_includes@work_src@reusage@python__group_weight__first-sentence.md@.PATH_END.py |
{
"filename": "container_instance.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/integrations/prefect-azure/prefect_azure/container_instance.py",
"type": "Python"
} | """
Integrations with the Azure Container Instances service.
Note this module is experimental. The interfaces within may change without notice.
The `AzureContainerInstanceJob` infrastructure block in this module is ideally
configured via the Prefect UI and run via a Prefect agent, but it can be called directly
as demo... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@integrations@prefect-azure@prefect_azure@container_instance.py@.PATH_END.py |
{
"filename": "2-IVFFlat.py",
"repo_name": "facebookresearch/faiss",
"repo_path": "faiss_extracted/faiss-main/tutorial/python/2-IVFFlat.py",
"type": "Python"
} | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
d = 64 # dimension
nb = 100000 # database size
nq = 10000 ... | facebookresearchREPO_NAMEfaissPATH_START.@faiss_extracted@faiss-main@tutorial@python@2-IVFFlat.py@.PATH_END.py |
{
"filename": "covariance.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/stats/covariance.py",
"type": "Python"
} | """
Author: Josef Perktold
License: BSD-3
"""
import numpy as np
from scipy import integrate, stats
pi2 = np.pi**2
pi2i = 1. / pi2
def _term_integrate(rho):
# needs other terms for spearman rho var calculation
# TODO: streamline calculation and save to linear interpolation, maybe
sin, cos = np.sin, np.... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@stats@covariance.py@.PATH_END.py |
{
"filename": "_base.py",
"repo_name": "deepmind/optax",
"repo_path": "optax_extracted/optax-main/optax/second_order/_base.py",
"type": "Python"
} | # Copyright 2019 DeepMind Technologies Limited. 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 ... | deepmindREPO_NAMEoptaxPATH_START.@optax_extracted@optax-main@optax@second_order@_base.py@.PATH_END.py |
{
"filename": "test_multi_gauss_expansion.py",
"repo_name": "lenstronomy/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_Util/test_multi_gauss_expansion.py",
"type": "Python"
} | __author__ = "sibirrer"
import lenstronomy.Util.multi_gauss_expansion as mge
import numpy as np
import numpy.testing as npt
from lenstronomy.LightModel.Profiles.sersic import Sersic
from lenstronomy.LightModel.Profiles.hernquist import Hernquist
from lenstronomy.LightModel.Profiles.gaussian import MultiGaussian
impor... | lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_Util@test_multi_gauss_expansion.py@.PATH_END.py |
{
"filename": "test_rank.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/groupby/methods/test_rank.py",
"type": "Python"
} | from datetime import datetime
import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
NaT,
Series,
concat,
)
import pandas._testing as tm
def test_rank_unordered_categorical_typeerror():
# GH#51034 should be TypeError, not NotImplementedError
cat = pd.Categorical... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@groupby@methods@test_rank.py@.PATH_END.py |
{
"filename": "BADASS3_autocorr_example-checkpoint.ipynb",
"repo_name": "remingtonsexton/BADASS3",
"repo_path": "BADASS3_extracted/BADASS3-master/example_notebooks/.ipynb_checkpoints/BADASS3_autocorr_example-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | ## Bayesian AGN Decomposition Analysis for SDSS Spectra (BADASS)
### Example: Autocorrelation Analysis
This example shows how to use the built-in autocorrelation analysis when using MCMC
to automatically stop the fit when the sampler chains of free parameters have sufficiently
converged on a solution.
#### Remingto... | remingtonsextonREPO_NAMEBADASS3PATH_START.@BADASS3_extracted@BADASS3-master@example_notebooks@.ipynb_checkpoints@BADASS3_autocorr_example-checkpoint.ipynb@.PATH_END.py |
{
"filename": "testMassSheets.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/tests/unit/NodeGenerators/testMassSheets.py",
"type": "Python"
} | from Spheral3d import *
from GenerateEqualMassSheets3d import *
from VoronoiDistributeNodes import distributeNodes3d as distributeNodes
from SpheralTestUtilities import *
from SpheralVisitDump import *
commandLine(nPerh = 2.01,
hmin = 1e-5,
hmax = 1e6,
rmin = 0.0,
... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@tests@unit@NodeGenerators@testMassSheets.py@.PATH_END.py |
{
"filename": "auxfuncs.py",
"repo_name": "numpy/numpy",
"repo_path": "numpy_extracted/numpy-main/numpy/f2py/auxfuncs.py",
"type": "Python"
} | """
Auxiliary functions for f2py2e.
Copyright 1999 -- 2011 Pearu Peterson all rights reserved.
Copyright 2011 -- present NumPy Developers.
Permission to use, modify, and distribute this software is given under the
terms of the NumPy (BSD style) LICENSE.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
"""
... | numpyREPO_NAMEnumpyPATH_START.@numpy_extracted@numpy-main@numpy@f2py@auxfuncs.py@.PATH_END.py |
{
"filename": "CHANGELOG.md",
"repo_name": "mj-will/nessai",
"repo_path": "nessai_extracted/nessai-main/CHANGELOG.md",
"type": "Markdown"
} | # Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Add experimental support for discrete... | mj-willREPO_NAMEnessaiPATH_START.@nessai_extracted@nessai-main@CHANGELOG.md@.PATH_END.py |
{
"filename": "getattr_static.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/jedi/py3/jedi/evaluate/compiled/getattr_static.py",
"type": "Python"
} | """
A static version of getattr.
This is a backport of the Python 3 code with a little bit of additional
information returned to enable Jedi to make decisions.
"""
import types
from jedi._compatibility import py_version
_sentinel = object()
def _check_instance(obj, attr):
instance_dict = {}
try:
in... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@jedi@py3@jedi@evaluate@compiled@getattr_static.py@.PATH_END.py |
{
"filename": "google_drive.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/document_loaders/google_drive.ipynb",
"type": "Jupyter Notebook"
} | # Google Drive
>[Google Drive](https://en.wikipedia.org/wiki/Google_Drive) is a file storage and synchronization service developed by Google.
This notebook covers how to load documents from `Google Drive`. Currently, only `Google Docs` are supported.
## Prerequisites
1. Create a Google Cloud project or use an exist... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@document_loaders@google_drive.ipynb@.PATH_END.py |
{
"filename": "ragged_to_sparse_op_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/ops/ragged/ragged_to_sparse_op_test.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@ragged@ragged_to_sparse_op_test.py@.PATH_END.py |
{
"filename": "test_colorlist_validator.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/_plotly_utils/tests/validators/test_colorlist_validator.py",
"type": "Python"
} | import pytest
import numpy as np
from _plotly_utils.basevalidators import ColorlistValidator
# Fixtures
# --------
@pytest.fixture()
def validator():
return ColorlistValidator("prop", "parent")
# Rejection
# ---------
@pytest.mark.parametrize("val", [set(), 23, 0.5, {}, "redd"])
def test_rejection_value(valida... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@_plotly_utils@tests@validators@test_colorlist_validator.py@.PATH_END.py |
{
"filename": "peft_lora_seq2seq_accelerate_big_model_inference.ipynb",
"repo_name": "huggingface/peft",
"repo_path": "peft_extracted/peft-main/examples/conditional_generation/peft_lora_seq2seq_accelerate_big_model_inference.ipynb",
"type": "Jupyter Notebook"
} | ```python
from transformers import AutoModelForSeq2SeqLM
from peft import PeftModel, PeftConfig
import torch
from datasets import load_dataset
import os
from transformers import AutoTokenizer
from torch.utils.data import DataLoader
from transformers import default_data_collator, get_linear_schedule_with_warmup
from tqd... | huggingfaceREPO_NAMEpeftPATH_START.@peft_extracted@peft-main@examples@conditional_generation@peft_lora_seq2seq_accelerate_big_model_inference.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/matplotlib/py2/mpl_toolkits/axes_grid/__init__.py",
"type": "Python"
} | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from . import axes_size as Size
from .axes_divider import Divider, SubplotDivider, LocatableAxes, \
make_axes_locatable
from .axes_grid import Grid, ImageGrid, AxesGrid
#from axes_divider import make_axes_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@matplotlib@py2@mpl_toolkits@axes_grid@__init__.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "ericagol/TRAPPIST1_Spitzer",
"repo_path": "TRAPPIST1_Spitzer_extracted/TRAPPIST1_Spitzer-master/src/v09_eps0.1_2k/README.md",
"type": "Markdown"
} |
2/11/2020
Okay, setting up a 10-day, 2000-step x 112 CPU
run. Let's see how this goes!
This seems to be the run I'm going with.
6/18/2020
Here is some description of how to run an HMC chain, how to set up the slurm
runs on Hyak Mox, and what the output files contain:
0. First, you will need to install Julia v... | ericagolREPO_NAMETRAPPIST1_SpitzerPATH_START.@TRAPPIST1_Spitzer_extracted@TRAPPIST1_Spitzer-master@src@v09_eps0.1_2k@README.md@.PATH_END.py |
{
"filename": "_smoothing.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/contour/line/_smoothing.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SmoothingValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="smoothing", parent_name="contour.line", **kwargs):
super(SmoothingValidator, 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@line@_smoothing.py@.PATH_END.py |
{
"filename": "5-Chempy_function.ipynb",
"repo_name": "oliverphilcox/ChempyMulti",
"repo_path": "ChempyMulti_extracted/ChempyMulti-master/Chempy_tutorials/5-Chempy_function.ipynb",
"type": "Jupyter Notebook"
} | ## Chempy
we will now introduce the Chempy function which will calculate the chemical evolution of a one-zone open box model
```python
%pylab inline
```
Populating the interactive namespace from numpy and matplotlib
```python
# loading the default parameters
from Chempy.parameter import ModelParameters
a = M... | oliverphilcoxREPO_NAMEChempyMultiPATH_START.@ChempyMulti_extracted@ChempyMulti-master@Chempy_tutorials@5-Chempy_function.ipynb@.PATH_END.py |
{
"filename": "geo.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/matplotlib/projections/geo.py",
"type": "Python"
} | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import math
import numpy as np
import numpy.ma as ma
import matplotlib
rcParams = matplotlib.rcParams
from matplotlib.axes import Axes
from matplotlib import cbook
from matplotlib.patches import C... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@matplotlib@projections@geo.py@.PATH_END.py |
{
"filename": "records.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/numpy/core/records.py",
"type": "Python"
} | """
Record Arrays
=============
Record arrays expose the fields of structured arrays as properties.
Most commonly, ndarrays contain elements of a single type, e.g. floats,
integers, bools etc. However, it is possible for elements to be combinations
of these using structured types, such as::
>>> a = np.array([(1, 2... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@numpy@core@records.py@.PATH_END.py |
{
"filename": "_stream.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/heatmap/_stream.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Stream(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "heatmap"
_path_str = "heatmap.stream"
_valid_props = {"maxpoints", "token"}
# maxpoints... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@heatmap@_stream.py@.PATH_END.py |
{
"filename": "predictor.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/sklearn/ensemble/_hist_gradient_boosting/predictor.py",
"type": "Python"
} | """
This module contains the TreePredictor class which is used for prediction.
"""
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
import numpy as np
from ._predictor import (
_compute_partial_dependence,
_predict_from_binned_data,
_predict_from_raw_data,
)
from .common imp... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@sklearn@ensemble@_hist_gradient_boosting@predictor.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "mnicholl/superbol",
"repo_path": "superbol_extracted/superbol-master/example/README.md",
"type": "Markdown"
} | # Superbol input data
This directory contains real supernova data demonstrating the input format for superbol.
For *all* Superbol input:
- Sloan, PanSTARRS, Gaia, ATLAS, GALEX in AB mags;
- Johnson, NIR and Swift in Vega mags
# Example 1: SN2015bn (Nicholl et al. 2016, ApJ, 826, 39)
- Input has multiple filters p... | mnichollREPO_NAMEsuperbolPATH_START.@superbol_extracted@superbol-master@example@README.md@.PATH_END.py |
{
"filename": "BinnedWCosmology.py",
"repo_name": "igomezv/simplemc_tests",
"repo_path": "simplemc_tests_extracted/simplemc_tests-main/simplemc/models/BinnedWCosmology.py",
"type": "Python"
} |
from simplemc.models.LCDMCosmology import LCDMCosmology
from simplemc.cosmo.Parameter import Parameter
from scipy.interpolate import interp1d
from scipy.integrate import quad
import numpy as np
## Binned cosmology, where the DE eqn of state is assumed to be a set of bins
# with varying amplitudes and fix positions.... | igomezvREPO_NAMEsimplemc_testsPATH_START.@simplemc_tests_extracted@simplemc_tests-main@simplemc@models@BinnedWCosmology.py@.PATH_END.py |
{
"filename": "_padding.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/newshape/label/_padding.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class PaddingValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="padding", parent_name="layout.newshape.label", **kwargs
):
super(PaddingValidator, self).__init__(
plotly_name=plotly_name,
parent_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@newshape@label@_padding.py@.PATH_END.py |
{
"filename": "photom.py",
"repo_name": "FRBs/FRB",
"repo_path": "FRB_extracted/FRB-main/frb/galaxies/photom.py",
"type": "Python"
} | """ Methods related to galaxy photometry """
import os
import warnings
import dust_extinction.parameter_averages
import numpy as np
import importlib_resources
from IPython import embed
from astropy.io import fits
from astropy.table import Table, hstack, vstack, join
from astropy.coordinates import SkyCoord
from ast... | FRBsREPO_NAMEFRBPATH_START.@FRB_extracted@FRB-main@frb@galaxies@photom.py@.PATH_END.py |
{
"filename": "exceptions.py",
"repo_name": "astropy/pyvo",
"repo_path": "pyvo_extracted/pyvo-main/pyvo/utils/xml/exceptions.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.utils.exceptions import AstropyWarning
__all__ = ['XMLWarning', 'UnknownElementWarning']
def _format_message(message, name, config=None, pos=None):
if config is None:
config = {}
if pos is None:
pos = ('?', '?')
... | astropyREPO_NAMEpyvoPATH_START.@pyvo_extracted@pyvo-main@pyvo@utils@xml@exceptions.py@.PATH_END.py |
{
"filename": "TransferGeckoFiles.ipynb",
"repo_name": "SilverRon/gppy",
"repo_path": "gppy_extracted/gppy-main/TransferGeckoFiles.ipynb",
"type": "Jupyter Notebook"
} | ```python
import os, glob
from astropy.io import fits
from util import tool
from astropy.table import Table
```
```python
path_data = "/data4/gecko/factory/gecko"
imlist = sorted(glob.glob(f"{path_data}/C*m.fits"))
print(imlist)
```
['/data4/gecko/factory/gecko/Calib-LOAO-NGC6555-20230421-114409-B-180.com.fits',... | SilverRonREPO_NAMEgppyPATH_START.@gppy_extracted@gppy-main@TransferGeckoFiles.ipynb@.PATH_END.py |
{
"filename": "panel.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/tools/python3/Lib/curses/panel.py",
"type": "Python"
} | """curses.panel
Module for using panels with curses.
"""
from _curses_panel import *
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@python3@Lib@curses@panel.py@.PATH_END.py |
{
"filename": "plot_sed.py",
"repo_name": "KarlenS/swift-uvot-analysis-tools",
"repo_path": "swift-uvot-analysis-tools_extracted/swift-uvot-analysis-tools-master/plot_sed.py",
"type": "Python"
} | #!/Users/karlen/anaconda2/envs/astroconda/bin/python
from astropy.io import fits
import matplotlib.pyplot as plt
import argparse
import numpy as np
def readData(filename):
return fits.getdata(filename)
def plotSED(dat,axs,color='black',label=None):
central_wav = {'uu':3465.,'w1':2600.,'m2':2246.,'w2':1928.,... | KarlenSREPO_NAMEswift-uvot-analysis-toolsPATH_START.@swift-uvot-analysis-tools_extracted@swift-uvot-analysis-tools-master@plot_sed.py@.PATH_END.py |
{
"filename": "Needham_problems.py",
"repo_name": "wmpg/Supracenter",
"repo_path": "Supracenter_extracted/Supracenter-master/supra/Yields/examples/Needham_problems.py",
"type": "Python"
} | import numpy as np
from supra.Atmosphere.Pressure import *
from supra.Yields.YieldFuncs import *
from supra.Yields.YieldCalcs import *
print("Section 12.3 Examples of Scaling")
W_0 = 1 # in pounds
W = 1000 # in pounds
d = 3.61
print("We know that {:} ft away from a {:} pound charge produces 60 psi".format(d, W_... | wmpgREPO_NAMESupracenterPATH_START.@Supracenter_extracted@Supracenter-master@supra@Yields@examples@Needham_problems.py@.PATH_END.py |
{
"filename": "_showexponent.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/cone/colorbar/_showexponent.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowexponentValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="showexponent", parent_name="cone.colorbar", **kwargs
):
super(ShowexponentValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@cone@colorbar@_showexponent.py@.PATH_END.py |
{
"filename": "three-cornered-hat-demo.ipynb",
"repo_name": "aewallin/allantools",
"repo_path": "allantools_extracted/allantools-master/examples/three-cornered-hat-demo.ipynb",
"type": "Jupyter Notebook"
} | # Three-cornered-hat test
See http://www.wriley.com/3-CornHat.htm
we test ADEV etc. by calculations on synthetic data
with known slopes of ADEV
#### Import packages and setup notebook
```python
%matplotlib inline
```
```python
import numpy
import matplotlib.pyplot as plt
import allantools
from allantools import ... | aewallinREPO_NAMEallantoolsPATH_START.@allantools_extracted@allantools-master@examples@three-cornered-hat-demo.ipynb@.PATH_END.py |
{
"filename": "casatools_vla_pipe.py",
"repo_name": "interferopy/interferopy",
"repo_path": "interferopy_extracted/interferopy-master/interferopy/casatools_vla_pipe.py",
"type": "Python"
} | # """VLA pipeline helper functions"""
import numpy as np
import os
import scipy.constants
# import some stuff from CASA
if os.getenv('CASAPATH') is not None:
# import casadef
from taskinit import *
msmd = msmdtool() # need for metadata
def flagtemplate_add(sdm="", flagcmds=[], outfile=""):
"""
A... | interferopyREPO_NAMEinterferopyPATH_START.@interferopy_extracted@interferopy-master@interferopy@casatools_vla_pipe.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/chart-studio/chart_studio/__init__.py",
"type": "Python"
} | from __future__ import absolute_import
from chart_studio import plotly, dashboard_objs, grid_objs, session, tools
| plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@chart-studio@chart_studio@__init__.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "projectchrono/chrono",
"repo_path": "chrono_extracted/chrono-main/src/chrono_swig/chrono_python/README.md",
"type": "Markdown"
} | # PyChrono Sensor Module
## Extra/special dependencies
- numpy
## Reasons why the sensor+python interface was setup like it was
#### Numpy
here is wanted to use numpy and what that gives us performance wise
- cmake point to numpy include directory
- an additiona cmake flag was added when sensor and python are ... | projectchronoREPO_NAMEchronoPATH_START.@chrono_extracted@chrono-main@src@chrono_swig@chrono_python@README.md@.PATH_END.py |
{
"filename": "Example_5_Inverse_Compton_Scattering.ipynb",
"repo_name": "hongwanliu/DarkHistory",
"repo_path": "DarkHistory_extracted/DarkHistory-master/examples/Example_5_Inverse_Compton_Scattering.ipynb",
"type": "Jupyter Notebook"
} | # Example 5: Inverse Compton Scattering
DarkHistory comes with the module [*darkhistory.electrons.ics*](https://darkhistory.readthedocs.io/en/latest/_autosummary/darkhistory/electrons/darkhistory.electrons.ics.html) to compute the inverse Compton scattering (ICS) scattered photon spectrum in the Thomson limit and in t... | hongwanliuREPO_NAMEDarkHistoryPATH_START.@DarkHistory_extracted@DarkHistory-master@examples@Example_5_Inverse_Compton_Scattering.ipynb@.PATH_END.py |
{
"filename": "Plot.Converge.py",
"repo_name": "alexrhowe/APOLLO",
"repo_path": "APOLLO_extracted/APOLLO-master/Plot.Converge.py",
"type": "Python"
} | from __future__ import print_function
import sys
import numpy as np
import matplotlib.pyplot as plt
if len(sys.argv)>1:
fin = open(sys.argv[1],'r')
else:
'Input file not specified.'
sys.exit()
line = fin.readline().split()
nwalkers = int(line[0])
nsteps = int(line[1])
ndim = int(line[2])
pnames = fin.rea... | alexrhoweREPO_NAMEAPOLLOPATH_START.@APOLLO_extracted@APOLLO-master@Plot.Converge.py@.PATH_END.py |
{
"filename": "iterateIdealHInst.cc.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/src/Utilities/iterateIdealHInst.cc.py",
"type": "Python"
} | text = """
//------------------------------------------------------------------------------
// Explicit instantiation.
//------------------------------------------------------------------------------
#include "Utilities/iterateIdealH.cc"
#include "Geometry/Dimension.hh"
namespace Spheral {
template void iterateIdeal... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@src@Utilities@iterateIdealHInst.cc.py@.PATH_END.py |
{
"filename": "fit_simulation_suite.ipynb",
"repo_name": "steven-murray/mrpy",
"repo_path": "mrpy_extracted/mrpy-master/docs/examples/fit_simulation_suite.ipynb",
"type": "Jupyter Notebook"
} | # Fit MRP parameters to a suite of simulation data simultaneously
In this example, we grab haloes from the publicly available $\nu^2$GC simulation suite and show how MRP can be fit to the haloes of 4 simulations simultaneously. In this case, the 4 simulations have different box sizes, so they probe different parts of ... | steven-murrayREPO_NAMEmrpyPATH_START.@mrpy_extracted@mrpy-master@docs@examples@fit_simulation_suite.ipynb@.PATH_END.py |
{
"filename": "solid_solid.py",
"repo_name": "jrenaud90/TidalPy",
"repo_path": "TidalPy_extracted/TidalPy-main/TidalPy/radial_solver/numerical/interfaces/solid_solid.py",
"type": "Python"
} | """ Functions to calculate the initial conditions for an overlying solid layer above another solid layer.
For solid-solid layer interfaces, all radial functions are continuous.
Since the solid solutions do not lose a y or an independent solution when moving from dynamic to static: Then the
interfaces between static-d... | jrenaud90REPO_NAMETidalPyPATH_START.@TidalPy_extracted@TidalPy-main@TidalPy@radial_solver@numerical@interfaces@solid_solid.py@.PATH_END.py |
{
"filename": "test_cosmology.py",
"repo_name": "LSSTDESC/CCL",
"repo_path": "CCL_extracted/CCL-master/pyccl/tests/test_cosmology.py",
"type": "Python"
} | import pickle
import tempfile
import pytest
import numpy as np
import pyccl as ccl
import copy
import warnings
from .test_cclobject import check_eq_repr_hash
def test_Cosmology_eq_repr_hash():
# Test eq, repr, hash for Cosmology and CosmologyCalculator.
# 1. Using a complicated Cosmology object.
extras = ... | LSSTDESCREPO_NAMECCLPATH_START.@CCL_extracted@CCL-master@pyccl@tests@test_cosmology.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "franpoz/SHERLOCK",
"repo_path": "SHERLOCK_extracted/SHERLOCK-master/setup.py",
"type": "Python"
} | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
version = "0.47.3"
setuptools.setup(
name="sherlockpipe", # Replace with your own username
version=version,
author="M. Dévora-Pajares & F.J. Pozuelos",
author_email="mdevorapajares@protonmail.com",
description="S... | franpozREPO_NAMESHERLOCKPATH_START.@SHERLOCK_extracted@SHERLOCK-master@setup.py@.PATH_END.py |
{
"filename": "ALMAPipe.py",
"repo_name": "bill-cotton/Obit",
"repo_path": "Obit_extracted/Obit-master/ObitSystem/Obit/python/ALMAPipe.py",
"type": "Python"
} | #! /usr/bin/env ObitTalk
"""
The ALMA Pipeline. The pipeline can be invoked from the command line
as, ::
ObitTalk ALMAPipe.py AipsSetupScript PipelineParamScript
where the required arguments are
* *AipsSetupScript* = an AIPS setup script (an example of this file is stored in
``Obit/share/scripts``)
* *Pi... | bill-cottonREPO_NAMEObitPATH_START.@Obit_extracted@Obit-master@ObitSystem@Obit@python@ALMAPipe.py@.PATH_END.py |
{
"filename": "_family.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/ohlc/legendgrouptitle/font/_family.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="family", parent_name="ohlc.legendgrouptitle.font", **kwargs
):
super(FamilyValidator, self).__init__(
plotly_name=plotly_name,
paren... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@ohlc@legendgrouptitle@font@_family.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "google/jax",
"repo_path": "jax_extracted/jax-main/jax/experimental/pallas/ops/gpu/__init__.py",
"type": "Python"
} | # Copyright 2024 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | googleREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@experimental@pallas@ops@gpu@__init__.py@.PATH_END.py |
{
"filename": "test_fixEB.py",
"repo_name": "liuhao-cn/fastSHT",
"repo_path": "fastSHT_extracted/fastSHT-main/scripts/obsolete/test_fixEB.py",
"type": "Python"
} | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import sys as sys
import os
nside = 64
nsim = 1000
n_proc = 8
niter = 3
compare = False
# the command line input will overwrite the defaults
if len(sys.argv)>1:
nside = int(sys.argv[1])
if len(sys.argv)>2:
nsim = int(sys.argv[2])
if len(sys.argv)>3:
n_proc =... | liuhao-cnREPO_NAMEfastSHTPATH_START.@fastSHT_extracted@fastSHT-main@scripts@obsolete@test_fixEB.py@.PATH_END.py |
{
"filename": "_font.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/volume/legendgrouptitle/_font.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="font", parent_name="volume.legendgrouptitle", **kwargs
):
super(FontValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@volume@legendgrouptitle@_font.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "glue-viz/glue",
"repo_path": "glue_extracted/glue-main/glue/plugins/wcs_autolinking/tests/__init__.py",
"type": "Python"
} | glue-vizREPO_NAMEgluePATH_START.@glue_extracted@glue-main@glue@plugins@wcs_autolinking@tests@__init__.py@.PATH_END.py | |
{
"filename": "main.py",
"repo_name": "cdslaborg/paramonte",
"repo_path": "paramonte_extracted/paramonte-main/example/fortran/pm_mathGammaGil/getGammaIncUppGil/main.py",
"type": "Python"
} | #!/usr/bin/env python
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import glob
import sys
fontsize = 17
kind = "RK"
label = [ r"shape: $\kappa = 1.0$"
, r"shape: $\kappa = 2.5$"
, r"shape: $\kappa = 5.0$"
]
pattern = "*." + kind + ".txt"
fileList = glob.glob(pattern... | cdslaborgREPO_NAMEparamontePATH_START.@paramonte_extracted@paramonte-main@example@fortran@pm_mathGammaGil@getGammaIncUppGil@main.py@.PATH_END.py |
{
"filename": "test_cnfw_ellipse_potential.py",
"repo_name": "sibirrer/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_LensModel/test_Profiles/test_cnfw_ellipse_potential.py",
"type": "Python"
} | __author__ = "sibirrer"
from lenstronomy.LensModel.Profiles.cnfw import CNFW
from lenstronomy.LensModel.Profiles.cnfw_ellipse_potential import CNFWEllipsePotential
import lenstronomy.Util.param_util as param_util
import numpy as np
import numpy.testing as npt
import pytest
class TestCNFWELLIPSE(object):
"""Tes... | sibirrerREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_LensModel@test_Profiles@test_cnfw_ellipse_potential.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "i4Ds/sdo-cli",
"repo_path": "sdo-cli_extracted/sdo-cli-main/setup.py",
"type": "Python"
} | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
pkgs = find_packages(where='src')
setup(
name="sdo-cli",
version="0.0.21",
author="Marius Giger",
author_email="marius.giger@fhnw.ch",
description="An ML practitioner's utility for worki... | i4DsREPO_NAMEsdo-cliPATH_START.@sdo-cli_extracted@sdo-cli-main@setup.py@.PATH_END.py |
{
"filename": "test_k2sff.py",
"repo_name": "lightkurve/lightkurve",
"repo_path": "lightkurve_extracted/lightkurve-main/tests/io/test_k2sff.py",
"type": "Python"
} | import pytest
from astropy.io import fits
import numpy as np
from numpy.testing import assert_array_equal
from lightkurve.io.k2sff import read_k2sff_lightcurve
from lightkurve import search_lightcurve
@pytest.mark.remote_data
def test_read_k2sff():
"""Can we read K2SFF files?"""
url = "http://archive.stsci.... | lightkurveREPO_NAMElightkurvePATH_START.@lightkurve_extracted@lightkurve-main@tests@io@test_k2sff.py@.PATH_END.py |
{
"filename": "add_densities.py",
"repo_name": "phil-mansfield/gotetra",
"repo_path": "gotetra_extracted/gotetra-master/render/scripts/add_densities.py",
"type": "Python"
} | import numpy as np
import sys
width = int(sys.argv[1])
out = sys.argv[2]
inputs = sys.argv[3:]
grid = np.zeros(width * width * width)
for fname in inputs:
grid += np.fromfile(fname)
grid.tofile(out)
| phil-mansfieldREPO_NAMEgotetraPATH_START.@gotetra_extracted@gotetra-master@render@scripts@add_densities.py@.PATH_END.py |
{
"filename": "alpaca_chat.py",
"repo_name": "OpenAccess-AI-Collective/axolotl",
"repo_path": "axolotl_extracted/axolotl-main/src/axolotl/prompt_strategies/alpaca_chat.py",
"type": "Python"
} | """Module for Alpaca prompt strategy classes"""
from typing import Any, Dict, Optional, Tuple
from axolotl.prompt_tokenizers import (
AlpacaPromptTokenizingStrategy,
InstructionPromptTokenizingStrategy,
)
from axolotl.prompters import AlpacaPrompter, PromptStyle, UnpromptedPrompter
def load(tokenizer, cfg, ... | OpenAccess-AI-CollectiveREPO_NAMEaxolotlPATH_START.@axolotl_extracted@axolotl-main@src@axolotl@prompt_strategies@alpaca_chat.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.