metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "test_cosmology.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/yt/utilities/tests/test_cosmology.py",
"type": "Python"
} | import os
import numpy as np
from numpy.testing import assert_almost_equal, assert_equal
from yt.testing import assert_rel_equal, requires_file, requires_module
from yt.units.yt_array import YTArray, YTQuantity
from yt.utilities.answer_testing.framework import data_dir_load
from yt.utilities.cosmology import Cosmolog... | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@yt@utilities@tests@test_cosmology.py@.PATH_END.py |
{
"filename": "backend_pdf.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/lib/matplotlib/backends/backend_pdf.py",
"type": "Python"
} | """
A PDF Matplotlib backend.
Author: Jouni K Seppänen <jks@iki.fi> and others.
"""
import codecs
from datetime import timezone
from datetime import datetime
from enum import Enum
from functools import total_ordering
from io import BytesIO
import itertools
import logging
import math
import os
import string
import str... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@lib@matplotlib@backends@backend_pdf.py@.PATH_END.py |
{
"filename": "plot_shapelets.py",
"repo_name": "tslearn-team/tslearn",
"repo_path": "tslearn_extracted/tslearn-main/docs/examples/classification/plot_shapelets.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Learning Shapelets
==================
This example illustrates how the "Learning Shapelets" method can quickly
find a set of shapelets that results in excellent predictive performance
when used for a shapelet transform.
More information on the method can be found at:
http://fs.ismll.de/pub... | tslearn-teamREPO_NAMEtslearnPATH_START.@tslearn_extracted@tslearn-main@docs@examples@classification@plot_shapelets.py@.PATH_END.py |
{
"filename": "astroquery_test.py",
"repo_name": "mshubat/galaxy_data_mines",
"repo_path": "galaxy_data_mines_extracted/galaxy_data_mines-master/galaxy_data_mines/tobeintegrated/astroquery_test.py",
"type": "Python"
} | '''
from astropy.table import Table
from astroquery.ned import Ned
result_table = Ned.query_region("m83")
result_table.pprint(show_unit=True)
cols = result_table.columns
print(type(cols))
t = Table(result_table)
for col in cols:
if not col == "RA(deg)":
del(t[col])
result_table.show_in_browser(jsviewer=... | mshubatREPO_NAMEgalaxy_data_minesPATH_START.@galaxy_data_mines_extracted@galaxy_data_mines-master@galaxy_data_mines@tobeintegrated@astroquery_test.py@.PATH_END.py |
{
"filename": "bispectrum.py",
"repo_name": "SBU-COSMOLIKE/CAMB-Monodromic",
"repo_path": "CAMB-Monodromic_extracted/CAMB-Monodromic-main/camb/bispectrum.py",
"type": "Python"
} | from ctypes import c_int, c_double, c_char
# Note currently there is no python interface for getting bispectrum results.
Ini_max_string_len = 1024
max_bispectrum_deltas = 5
class TBispectrumParams:
_fields_ = [
("do_lensing_bispectrum", c_int), # logical
("do_primordial_bispectrum", c_int), # ... | SBU-COSMOLIKEREPO_NAMECAMB-MonodromicPATH_START.@CAMB-Monodromic_extracted@CAMB-Monodromic-main@camb@bispectrum.py@.PATH_END.py |
{
"filename": "strain.py",
"repo_name": "gwastro/pycbc",
"repo_path": "pycbc_extracted/pycbc-master/pycbc/strain/strain.py",
"type": "Python"
} | #Copyright (C) 2013 Alex Nitz
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the h... | gwastroREPO_NAMEpycbcPATH_START.@pycbc_extracted@pycbc-master@pycbc@strain@strain.py@.PATH_END.py |
{
"filename": "_xpad.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/parcoords/line/colorbar/_xpad.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XpadValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="xpad", parent_name="parcoords.line.colorbar", **kwargs
):
super(XpadValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@parcoords@line@colorbar@_xpad.py@.PATH_END.py |
{
"filename": "subversion.py",
"repo_name": "davidharvey1986/pyRRG",
"repo_path": "pyRRG_extracted/pyRRG-master/unittests/bugFixPyRRG/lib/python3.7/site-packages/pip/_internal/vcs/subversion.py",
"type": "Python"
} | # The following comment should be removed at some point in the future.
# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
import logging
import os
import re
from pip._internal.utils.logging import indent_log
from pip._internal.utils.misc import (
display_path,
is_console_interactive,
... | davidharvey1986REPO_NAMEpyRRGPATH_START.@pyRRG_extracted@pyRRG-master@unittests@bugFixPyRRG@lib@python3.7@site-packages@pip@_internal@vcs@subversion.py@.PATH_END.py |
{
"filename": "driver.py",
"repo_name": "igrins/plp",
"repo_path": "plp_extracted/plp-master/igrins/pipeline/driver.py",
"type": "Python"
} | """ Pipeline Driver """
from ..igrins_libs.resource_manager import get_igrins_resource_manager
from ..igrins_libs.igrins_config import IGRINSConfig
from ..igrins_libs.obs_set import ObsSet
def get_obsset(obsdate, recipe_name, band,
obsids, frametypes,
groupname=None, recipe_entry=None,
... | igrinsREPO_NAMEplpPATH_START.@plp_extracted@plp-master@igrins@pipeline@driver.py@.PATH_END.py |
{
"filename": "VegaPlots2Datasets.ipynb",
"repo_name": "andreicuceu/vega",
"repo_path": "vega_extracted/vega-master/examples/VegaPlots2Datasets.ipynb",
"type": "Jupyter Notebook"
} | ```python
from vega import VegaInterface
```
```python
vega1 = VegaInterface('../desi-4.0-4/10_mocks/main-auto_10mpc.ini')
vega2 = VegaInterface('../desi-4.12-4/10_mocks_bao/main-auto_10mpc.ini')
```
INFO: reading input Pk /global/u1/a/acuceu/envs/picca/vega/vega/models/PlanckDR12/PlanckDR12.fits
Reading dat... | andreicuceuREPO_NAMEvegaPATH_START.@vega_extracted@vega-master@examples@VegaPlots2Datasets.ipynb@.PATH_END.py |
{
"filename": "test_spline_filter.py",
"repo_name": "dask/dask-image",
"repo_path": "dask-image_extracted/dask-image-main/tests/test_dask_image/test_ndinterp/test_spline_filter.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from packaging import version
import dask
import dask.array as da
import numpy as np
import pytest
import scipy
import scipy.ndimage
import dask_image.ndinterp
# mode lists for the case with prefilter = False
_supported_modes = ['constant', 'nearest', 'reflect', 'mirror... | daskREPO_NAMEdask-imagePATH_START.@dask-image_extracted@dask-image-main@tests@test_dask_image@test_ndinterp@test_spline_filter.py@.PATH_END.py |
{
"filename": "tvguide.py",
"repo_name": "tessgi/tvguide",
"repo_path": "tvguide_extracted/tvguide-master/tvguide/tvguide.py",
"type": "Python"
} | from __future__ import absolute_import
import numpy as np
from ._tvguide import tvguidef
import argparse, sys
from astropy.coordinates import SkyCoord
from astropy import units as u
from . import Highlight
from . import logger
class TessPointing(object):
def __init__(self, ra_deg, dec_deg, dstart=0):
s... | tessgiREPO_NAMEtvguidePATH_START.@tvguide_extracted@tvguide-master@tvguide@tvguide.py@.PATH_END.py |
{
"filename": "_sf_error.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/special/_sf_error.py",
"type": "Python"
} | """Warnings and Exceptions that can be raised by special functions."""
import warnings
class SpecialFunctionWarning(Warning):
"""Warning that can be emitted by special functions."""
pass
warnings.simplefilter("always", category=SpecialFunctionWarning)
class SpecialFunctionError(Exception):
"""Exceptio... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@special@_sf_error.py@.PATH_END.py |
{
"filename": "fluxes.py",
"repo_name": "moeyensj/atm",
"repo_path": "atm_extracted/atm-master/atm/plotting/fluxes.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from sys import platform
if platform == 'darwin':
import matplotlib
matplotlib.use("TkAgg")
import numpy as np
import matplotlib.pyplot as plt
from ..config import Config
__all__ = ["plotObservations",
"plotSED"]
def plotObservations(obs, data,
... | moeyensjREPO_NAMEatmPATH_START.@atm_extracted@atm-master@atm@plotting@fluxes.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatterternary/hoverlabel/font/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._sizesrc import SizesrcValidator
from ._size import SizeValidator
from ._familysrc import FamilysrcValidator
from ._family import FamilyValidator
from ._colorsrc import ColorsrcValidator
from ._color import ColorValidator
else:
from _plotly_uti... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatterternary@hoverlabel@font@__init__.py@.PATH_END.py |
{
"filename": "Models.py",
"repo_name": "htjb/maxsmooth",
"repo_path": "maxsmooth_extracted/maxsmooth-master/maxsmooth/Models.py",
"type": "Python"
} | import numpy as np
from scipy.special import legendre
class Models_class(object):
def __init__(self, params, x, y, N, pivot_point, model_type, new_basis):
self.x = x
self.y = y
self.N = N
self.params = params
self.pivot_point = pivot_point
self.model_type = model_ty... | htjbREPO_NAMEmaxsmoothPATH_START.@maxsmooth_extracted@maxsmooth-master@maxsmooth@Models.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter3d/line/colorbar/title/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._text import TextValidator
from ._side import SideValidator
from ._font import FontValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter3d@line@colorbar@title@__init__.py@.PATH_END.py |
{
"filename": "position.py",
"repo_name": "astroufsc/chimera",
"repo_path": "chimera_extracted/chimera-master/src/chimera/util/position.py",
"type": "Python"
} | # to allow use outsise chimera
try:
from chimera.util.coord import Coord, CoordUtil
except ImportError:
from .coord import Coord, CoordUtil
try:
from chimera.util.enum import Enum
except ImportError:
from .enum import Enum
import ephem
__all__ = ["Position"]
Epoch = Enum("J2000", "B1950", "NOW")
S... | astroufscREPO_NAMEchimeraPATH_START.@chimera_extracted@chimera-master@src@chimera@util@position.py@.PATH_END.py |
{
"filename": "published_cats.py",
"repo_name": "mshubat/galaxy_data_mines",
"repo_path": "galaxy_data_mines_extracted/galaxy_data_mines-master/galaxy_data_mines/tobeintegrated/published_cats.py",
"type": "Python"
} | from astropy.table import Table, Column, hstack, vstack
from astropy.coordinates import SkyCoord, match_coordinates_sky
from astropy import units as u
import numpy as np
import os
# published_cats:
# tools for manipulating published catalogs of m83 objects, for comparison
# with Chandar et al catalog
# - reforma... | mshubatREPO_NAMEgalaxy_data_minesPATH_START.@galaxy_data_mines_extracted@galaxy_data_mines-master@galaxy_data_mines@tobeintegrated@published_cats.py@.PATH_END.py |
{
"filename": "analysis.py",
"repo_name": "ChrisBoettner/plato",
"repo_path": "plato_extracted/plato-main/plato/utils/analysis.py",
"type": "Python"
} | from typing import Optional
import numpy as np
import pandas as pd
from plato.instrument.detection import DetectionModel
def compute_detectable_fraction(
targets: pd.DataFrame,
detection_model: DetectionModel,
detection_threshold: float,
axis: Optional[int | tuple[int]] = None,
) -> np.ndarray:
... | ChrisBoettnerREPO_NAMEplatoPATH_START.@plato_extracted@plato-main@plato@utils@analysis.py@.PATH_END.py |
{
"filename": "ComputeColorDistribution.py",
"repo_name": "LSSTDESC/descqa",
"repo_path": "descqa_extracted/descqa-master/v1/descqa/ComputeColorDistribution.py",
"type": "Python"
} | from __future__ import division, print_function
import numpy as np
from astropy.io import fits
from astropy.table import Table
import os
import kcorrect
from astropy.cosmology import FlatLambdaCDM
def load_SDSS(filename, colors, SDSS_kcorrection_z):
"""
Compute the CDF of SDS... | LSSTDESCREPO_NAMEdescqaPATH_START.@descqa_extracted@descqa-master@v1@descqa@ComputeColorDistribution.py@.PATH_END.py |
{
"filename": "_fill.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/volume/slices/z/_fill.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FillValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="fill", parent_name="volume.slices.z", **kwargs):
super(FillValidator, 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@volume@slices@z@_fill.py@.PATH_END.py |
{
"filename": "_borderwidth.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter3d/marker/colorbar/_borderwidth.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BorderwidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="borderwidth",
parent_name="scatter3d.marker.colorbar",
**kwargs,
):
super(BorderwidthValidator, self).__init__(
plo... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter3d@marker@colorbar@_borderwidth.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter/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="scatter.marker.colorbar.title.font",
**kwargs,
):
super(ColorValidator, self).__init__(
plotly_name=p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter@marker@colorbar@title@font@_color.py@.PATH_END.py |
{
"filename": "amazon-redshift.md",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/doc/unconverted/python/amazon-redshift.md",
"type": "Markdown"
} | ---
jupyter:
jupytext:
notebook_metadata_filter: all
text_representation:
extension: .md
format_name: markdown
format_version: '1.1'
jupytext_version: 1.1.1
kernelspec:
display_name: Python 2
language: python
name: python2
plotly:
description: A tutorial showing how... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@doc@unconverted@python@amazon-redshift.md@.PATH_END.py |
{
"filename": "xla_custom_call_ops_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/compiler/tests/xla_custom_call_ops_test.py",
"type": "Python"
} | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@compiler@tests@xla_custom_call_ops_test.py@.PATH_END.py |
{
"filename": "mod.md",
"repo_name": "misharash/class_public",
"repo_path": "class_public_extracted/class_public-master/doc/input/mod.md",
"type": "Markdown"
} | Updating the manual
===================
Author: D. C. Hooper (hooper@physik.rwth-aachen.de)
This pdf manual and accompanying web version have been generated using the `doxygen` software (http://www.doxygen.org). This software directly reads the code and extracts the necessary comments to form the manual, meaning it is... | misharashREPO_NAMEclass_publicPATH_START.@class_public_extracted@class_public-master@doc@input@mod.md@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "lsst-uk/lasair-lsst",
"repo_path": "lasair-lsst_extracted/lasair-lsst-main/deploy/roles/grafana/README.md",
"type": "Markdown"
} | Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required... | lsst-ukREPO_NAMElasair-lsstPATH_START.@lasair-lsst_extracted@lasair-lsst-main@deploy@roles@grafana@README.md@.PATH_END.py |
{
"filename": "Miscellaneous.ipynb",
"repo_name": "moble/GWFrames",
"repo_path": "GWFrames_extracted/GWFrames-master/Tests/Miscellaneous.ipynb",
"type": "Jupyter Notebook"
} | # Pointwise operations
```
import GWFrames
T = [0., 1., 2.]
LM = [[l,m] for l in range(0,9) for m in range(-l,l+1)]
Data = zeros((len(LM), len(T)), dtype=complex)
Data[0,:] = sqrt(4*pi)+0.0j
# The Waveform objects A and B will represent uniform values of 3.0 and 5.0 over the sphere.
# Note that the factor of sqrt(4*... | mobleREPO_NAMEGWFramesPATH_START.@GWFrames_extracted@GWFrames-master@Tests@Miscellaneous.ipynb@.PATH_END.py |
{
"filename": "mpl_plot_trace_bars.py",
"repo_name": "arviz-devs/arviz",
"repo_path": "arviz_extracted/arviz-main/examples/matplotlib/mpl_plot_trace_bars.py",
"type": "Python"
} | """
Rank Bars Diagnostic with KDE
=============================
_gallery_category: Mixed Plots
"""
import matplotlib.pyplot as plt
import arviz as az
az.style.use("arviz-doc")
data = az.load_arviz_data("non_centered_eight")
az.plot_trace(data, var_names=("tau", "mu"), kind="rank_bars")
plt.show()
| arviz-devsREPO_NAMEarvizPATH_START.@arviz_extracted@arviz-main@examples@matplotlib@mpl_plot_trace_bars.py@.PATH_END.py |
{
"filename": "plot_logparabola_norm_spectral.py",
"repo_name": "gammapy/gammapy",
"repo_path": "gammapy_extracted/gammapy-main/examples/models/spectral/plot_logparabola_norm_spectral.py",
"type": "Python"
} | r"""
.. _logparabola-spectral-norm-model:
Log parabola spectral norm model
================================
This model parametrises a log parabola spectral correction with a norm parameter.
"""
# %%
# Example plot
# ------------
# Here is an example plot of the model:
from astropy import units as u
import matplotl... | gammapyREPO_NAMEgammapyPATH_START.@gammapy_extracted@gammapy-main@examples@models@spectral@plot_logparabola_norm_spectral.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "natashabatalha/virga",
"repo_path": "virga_extracted/virga-master/setup.py",
"type": "Python"
} | #!/usr/bin/env python
# This sample setup.py can be used as a template for any project using d2to1.
# Simply copy this file and, if desired, delete all the comments. Also remove
# the 'namespace_packages' and 'packages' arguments to setup.py if this project
# does not contain any packages beloning to a namespace pack... | natashabatalhaREPO_NAMEvirgaPATH_START.@virga_extracted@virga-master@setup.py@.PATH_END.py |
{
"filename": "autofit.py",
"repo_name": "saltastro/pyhrs",
"repo_path": "pyhrs_extracted/pyhrs-master/scripts/autofit.py",
"type": "Python"
} | import os
import sys
import numpy as np
import pickle
from ccdproc import CCDData
import specutils
from astropy import units as u
from astropy import modeling as mod
from astropy.io import fits
import pylab as pl
from specreduce import WavelengthSolution
from pyhrs import create_linelists
from pyhrs import collap... | saltastroREPO_NAMEpyhrsPATH_START.@pyhrs_extracted@pyhrs-master@scripts@autofit.py@.PATH_END.py |
{
"filename": "defaults.py",
"repo_name": "ismael-mendoza/ShapeMeasurementFisherFormalism",
"repo_path": "ShapeMeasurementFisherFormalism_extracted/ShapeMeasurementFisherFormalism-master/smff/defaults.py",
"type": "Python"
} | """Some of the defaults that are used in the overall program."""
import numpy as np
def get_steps(g_parameters, image_renderer):
"""Return a dictionary containing the steps to be used in the
derivatives of each parameter.
The dictionary is of the form: 'parameter_name:value_of_step'
Some parameter ... | ismael-mendozaREPO_NAMEShapeMeasurementFisherFormalismPATH_START.@ShapeMeasurementFisherFormalism_extracted@ShapeMeasurementFisherFormalism-master@smff@defaults.py@.PATH_END.py |
{
"filename": "Tutorial_Plots.ipynb",
"repo_name": "CaymanUnterborn/ExoPlex",
"repo_path": "ExoPlex_extracted/ExoPlex-master/Tutorial/Tutorial_Plots.ipynb",
"type": "Jupyter Notebook"
} | ```python
#RUN THIS FIRST
import matplotlib.pyplot as plt
import os
import numpy as np
file_loc = os.getcwd()+'/Data'
def get_den(M, R, M_err,R_err):
Rho = [M[i]*5.97e21/((4*np.pi/3)*pow(R[i]*6371e3,3)) for i in range(len(M))]
if len(M_err) > 0:
Rho_err = [(5.97e21/(4*np.pi*pow(R[i]*6371e3,3)))*np.... | CaymanUnterbornREPO_NAMEExoPlexPATH_START.@ExoPlex_extracted@ExoPlex-master@Tutorial@Tutorial_Plots.ipynb@.PATH_END.py |
{
"filename": "docmaker.py",
"repo_name": "Caltech-IPAC/Montage",
"repo_path": "Montage_extracted/Montage-main/lib/src/freetype-2.4.4/src/tools/docmaker/docmaker.py",
"type": "Python"
} | #!/usr/bin/env python
#
# DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org>
#
# This program is a re-write of the original DocMaker took used
# to generate the API Reference of the FreeType font engine
# by converting in-source comments into structured HTML.
#
# This new version is capable of outputting ... | Caltech-IPACREPO_NAMEMontagePATH_START.@Montage_extracted@Montage-main@lib@src@freetype-2.4.4@src@tools@docmaker@docmaker.py@.PATH_END.py |
{
"filename": "getting-started.md",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/doc/python/getting-started.md",
"type": "Markdown"
} | ---
jupyter:
jupytext:
notebook_metadata_filter: all
text_representation:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.16.1
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
language_info:
codemirror_mode... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@doc@python@getting-started.md@.PATH_END.py |
{
"filename": "funcs_DConeMaps.py",
"repo_name": "simoncasassus/ConeRot",
"repo_path": "ConeRot_extracted/ConeRot-master/funcs_DConeMaps.py",
"type": "Python"
} | import sys
import numpy as np
import scipy as sp
import os
import os.path
from scipy import ndimage
from astropy.io import fits as pf
import re
from copy import deepcopy
import time
import matplotlib as mpl
import matplotlib.pyplot as plt
from pylab import *
import matplotlib.colors as colors
include_path = '/home/si... | simoncasassusREPO_NAMEConeRotPATH_START.@ConeRot_extracted@ConeRot-master@funcs_DConeMaps.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/src/amuse/community/mosse/__init__.py",
"type": "Python"
} | from .interface import Mosse
| amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@src@amuse@community@mosse@__init__.py@.PATH_END.py |
{
"filename": "scipy_solver.py",
"repo_name": "hmuellergoe/mrbeam",
"repo_path": "mrbeam_extracted/mrbeam-main/mr_beam/imagingbase/imagingbase/solvers/scipy_solver.py",
"type": "Python"
} | import scipy.optimize as opt
import numpy as np
from regpy.solvers import Solver
from regpy.functionals import Functional
from regpy.operators import Identity
class Minimize():
def __init__(self, fun, x0, args=(), method=None, bounds=None, constraints=(), tol=None, callback=None, options=None):
self.fun = ... | hmuellergoeREPO_NAMEmrbeamPATH_START.@mrbeam_extracted@mrbeam-main@mr_beam@imagingbase@imagingbase@solvers@scipy_solver.py@.PATH_END.py |
{
"filename": "plot_meerkat_hz_erc.py",
"repo_name": "philbull/RadioFisher",
"repo_path": "RadioFisher_extracted/RadioFisher-master/plotting/plot_meerkat_hz_erc.py",
"type": "Python"
} | #!/usr/bin/python
"""
Plot functions of redshift for RSDs.
"""
import numpy as np
import pylab as P
from rfwrapper import rf
import matplotlib.patches
import matplotlib.cm
import os
cosmo = rf.experiments.cosmo
#-------------------------------------------------------------------------------
# Define colours
#--------... | philbullREPO_NAMERadioFisherPATH_START.@RadioFisher_extracted@RadioFisher-master@plotting@plot_meerkat_hz_erc.py@.PATH_END.py |
{
"filename": "example_mod.py",
"repo_name": "spacetelescope/pystortion",
"repo_path": "pystortion_extracted/pystortion-master/pystortion/example_mod.py",
"type": "Python"
} | def primes(imax):
"""
Returns prime numbers up to imax.
Parameters
----------
imax: int
The number of primes to return. This should be less or equal to 10000.
Returns
-------
result: list
The list of prime numbers.
"""
p = list(range(10000))
result = []
... | spacetelescopeREPO_NAMEpystortionPATH_START.@pystortion_extracted@pystortion-master@pystortion@example_mod.py@.PATH_END.py |
{
"filename": "Degeneracy.py",
"repo_name": "mmicromegas/ransX",
"repo_path": "ransX_extracted/ransX-master/EQUATIONS/Degeneracy.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
from UTILS.Calculus import Calculus
from UTILS.SetAxisLimit import SetAxisLimit
from UTILS.Tools import Tools
from UTILS.Errors import Errors
import sys
# Theoretical background https://arxiv.org/abs/1401.5176
# Mocak, Meakin, Viallet, Arnett, 2014, Compressible Hyd... | mmicromegasREPO_NAMEransXPATH_START.@ransX_extracted@ransX-master@EQUATIONS@Degeneracy.py@.PATH_END.py |
{
"filename": "trace.py",
"repo_name": "spacetelescope/calcos",
"repo_path": "calcos_extracted/calcos-master/calcos/trace.py",
"type": "Python"
} | #
# This module has all the code for trace profile application
# and calculation of centroids for reference profile and science
# data - the TRCECORR and ALGNCORR steps
#
from __future__ import division, absolute_import
import astropy.io.fits as fits
import numpy as np
import math
from . import airglow
from .calco... | spacetelescopeREPO_NAMEcalcosPATH_START.@calcos_extracted@calcos-master@calcos@trace.py@.PATH_END.py |
{
"filename": "plot_velpdf.py",
"repo_name": "justinread/gravsphere",
"repo_path": "gravsphere_extracted/gravsphere-master/plot_velpdf.py",
"type": "Python"
} | ###########################################################
#plot_velpdf
###########################################################
#Python programme to plot the velpdf function used by
#binulator to fit each velocity bin.
###########################################################
#Main code:
#Imports & dependenci... | justinreadREPO_NAMEgravspherePATH_START.@gravsphere_extracted@gravsphere-master@plot_velpdf.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/volume/colorbar/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._tickfont import Tickfont
from ._tickformatstop import Tickformatstop
from ._title import Title
from . import title
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, _... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@volume@colorbar@__init__.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterpolargl/marker/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._symbolsrc import SymbolsrcValidator
from ._symbol import SymbolValidator
from ._sizesrc import SizesrcValidator
from ._sizeref import SizerefValidator
from ._sizemode import SizemodeValidator
from ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterpolargl@marker@__init__.py@.PATH_END.py |
{
"filename": "transfer.py",
"repo_name": "Harry45/DESEMU",
"repo_path": "DESEMU_extracted/DESEMU-main/jax_cosmo/transfer.py",
"type": "Python"
} | # This module contains various transfer functions from the literatu
import jax.numpy as np
import jax_cosmo.background as bkgrd
import jax_cosmo.constants as const
__all__ = ["Eisenstein_Hu"]
def Eisenstein_Hu(cosmo, k, type="eisenhu_osc"):
"""Computes the Eisenstein & Hu matter transfer function.
Paramete... | Harry45REPO_NAMEDESEMUPATH_START.@DESEMU_extracted@DESEMU-main@jax_cosmo@transfer.py@.PATH_END.py |
{
"filename": "spd_pgs_make_phi_spec.py",
"repo_name": "spedas/pyspedas",
"repo_path": "pyspedas_extracted/pyspedas-master/pyspedas/particles/spd_part_products/spd_pgs_make_phi_spec.py",
"type": "Python"
} |
import math
import numpy as np
from scipy.ndimage import shift
# use nansum from bottleneck if it's installed, otherwise use the numpy one
try:
import bottleneck as bn
nansum = bn.nansum
except ImportError:
nansum = np.nansum
def spd_pgs_make_phi_spec(data_in, resolution=None):
"""
Builds phi (l... | spedasREPO_NAMEpyspedasPATH_START.@pyspedas_extracted@pyspedas-master@pyspedas@particles@spd_part_products@spd_pgs_make_phi_spec.py@.PATH_END.py |
{
"filename": "main.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/tools/python3/Lib/unittest/main.py",
"type": "Python"
} | """Unittest main program"""
import sys
import argparse
import os
import warnings
from . import loader, runner
from .signals import installHandler
__unittest = True
_NO_TESTS_EXITCODE = 5
MAIN_EXAMPLES = """\
Examples:
%(prog)s test_module - run tests from test_module
%(prog)s module.TestClass ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@python3@Lib@unittest@main.py@.PATH_END.py |
{
"filename": "rfast_routines.py",
"repo_name": "hablabx/rfast",
"repo_path": "rfast_extracted/rfast-main/rfast_routines.py",
"type": "Python"
} | import lblabc_input
import math
import os
import numpy as np
from scipy import interpolate
from astropy.io import ascii
from rfast_opac_routines import opacities_read
from rfast_opac_routines import cia_read
from rfast_opac_routines import rayleigh
#
#
# flux adding routine for non-emitting, inhomogeneous, ... | hablabxREPO_NAMErfastPATH_START.@rfast_extracted@rfast-main@rfast_routines.py@.PATH_END.py |
{
"filename": "plot_floodfill.py",
"repo_name": "scikit-image/scikit-image",
"repo_path": "scikit-image_extracted/scikit-image-main/doc/examples/segmentation/plot_floodfill.py",
"type": "Python"
} | """
==========
Flood Fill
==========
Flood fill is an algorithm to identify and/or change adjacent values in an
image based on their similarity to an initial seed point [1]_. The conceptual
analogy is the 'paint bucket' tool in many graphic editors.
.. [1] https://en.wikipedia.org/wiki/Flood_fill
Basic example
-----... | scikit-imageREPO_NAMEscikit-imagePATH_START.@scikit-image_extracted@scikit-image-main@doc@examples@segmentation@plot_floodfill.py@.PATH_END.py |
{
"filename": "_xperiod0.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/ohlc/_xperiod0.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class Xperiod0Validator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="xperiod0", parent_name="ohlc", **kwargs):
super(Xperiod0Validator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@ohlc@_xperiod0.py@.PATH_END.py |
{
"filename": "recon_bin.py",
"repo_name": "exoclime/HELIOS-K",
"repo_path": "HELIOS-K_extracted/HELIOS-K-master/tools/recon_bin.py",
"type": "Python"
} | import numpy as np
import argparse
import matplotlib.pylab as plt
from numpy.polynomial.chebyshev import chebval, chebfit
'''
This script reconstructs sampled cbin files, to check the sampling
Date: January 2020
Author: Simon Grimm
'''
#change here the bin size:
fig = plt.figure()
def main(M):
data = np.loadtxt... | exoclimeREPO_NAMEHELIOS-KPATH_START.@HELIOS-K_extracted@HELIOS-K-master@tools@recon_bin.py@.PATH_END.py |
{
"filename": "test_bar.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/io/formats/style/test_bar.py",
"type": "Python"
} | import io
import numpy as np
import pytest
from pandas import (
NA,
DataFrame,
read_csv,
)
pytest.importorskip("jinja2")
def bar_grad(a=None, b=None, c=None, d=None):
"""Used in multiple tests to simplify formatting of expected result"""
ret = [("width", "10em")]
if all(x is None for x in [... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@io@formats@style@test_bar.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/scipy/sparse/linalg/isolve/__init__.py",
"type": "Python"
} | "Iterative Solvers for Sparse Linear Systems"
from __future__ import division, print_function, absolute_import
#from info import __doc__
from .iterative import *
from .minres import minres
from .lgmres import lgmres
from .lsqr import lsqr
from .lsmr import lsmr
from ._gcrotmk import gcrotmk
__all__ = [s for s in dir... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@scipy@sparse@linalg@isolve@__init__.py@.PATH_END.py |
{
"filename": "uvot_sed.py",
"repo_name": "KarlenS/swift-uvot-analysis-tools",
"repo_path": "swift-uvot-analysis-tools_extracted/swift-uvot-analysis-tools-master/uvot_sed.py",
"type": "Python"
} | #!/Users/karlen/anaconda2/envs/astroconda/bin/python
import os
import re
import subprocess
import gzip
import numpy as np
from shutil import copyfile,copyfileobj
from source_position import PositionExtractor
from uvot_photometry import MeasureSource
from astropy.time import Time
from tqdm import tqdm
class MakeSED(ob... | KarlenSREPO_NAMEswift-uvot-analysis-toolsPATH_START.@swift-uvot-analysis-tools_extracted@swift-uvot-analysis-tools-master@uvot_sed.py@.PATH_END.py |
{
"filename": "main.py",
"repo_name": "cdslaborg/paramonte",
"repo_path": "paramonte_extracted/paramonte-main/example/fortran/pm_cosmology/getHubbleParamNormedSq/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
linewidth = 2
fontsize = 17
marker ={ "CK" : "-"
, "IK" : "."
, "RK" : "-"
}
xlab = { "CK" : "redshift: z ( real/imaginary components )"
, "IK" : "redshift: z ( integer... | cdslaborgREPO_NAMEparamontePATH_START.@paramonte_extracted@paramonte-main@example@fortran@pm_cosmology@getHubbleParamNormedSq@main.py@.PATH_END.py |
{
"filename": "_maxpoints.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattergl/stream/_maxpoints.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MaxpointsValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="maxpoints", parent_name="scattergl.stream", **kwargs
):
super(MaxpointsValidator, self).__init__(
plotly_name=plotly_name,
parent... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattergl@stream@_maxpoints.py@.PATH_END.py |
{
"filename": "lenser_galaxy.py",
"repo_name": "DrexelLenser/Lenser",
"repo_path": "Lenser_extracted/Lenser-master/lenser_galaxy.py",
"type": "Python"
} | """
Module: lenser_galaxy
.. synopsis: Holds a real galaxy image, or a model galaxy image and model parameters
.. module author: Evan J. Arena <evan.james.arena@drexel.edu>
"""
import numpy as np
from astropy.io import fits
from astropy.convolution import convolve_fft
from scipy import optimize
import pandas as pd
i... | DrexelLenserREPO_NAMELenserPATH_START.@Lenser_extracted@Lenser-master@lenser_galaxy.py@.PATH_END.py |
{
"filename": "paper.md",
"repo_name": "finagle29/dbsp_drp",
"repo_path": "dbsp_drp_extracted/dbsp_drp-main/paper/paper.md",
"type": "Markdown"
} | ---
title: 'DBSP_DRP: A Python package for automated spectroscopic data reduction of DBSP data'
tags:
- Python
- astronomy
- data reduction
- spectroscopy
authors:
- name: Milan Sharma Mandigo-Stoba^[Present address: Department of Physics and Astronomy, University of California, Los Angeles.]
given-na... | finagle29REPO_NAMEdbsp_drpPATH_START.@dbsp_drp_extracted@dbsp_drp-main@paper@paper.md@.PATH_END.py |
{
"filename": "_line.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/graph_objs/layout/mapbox/layer/_line.py",
"type": "Python"
} | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Line(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.mapbox.layer"
_path_str = "layout.mapbox.layer.line"
_valid_props = {"dash", "dashsr... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@graph_objs@layout@mapbox@layer@_line.py@.PATH_END.py |
{
"filename": "_customdata.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/densitymapbox/_customdata.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CustomdataValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="customdata", parent_name="densitymapbox", **kwargs):
super(CustomdataValidator, self).__init__(
plotly_name=plotly_name,
parent_name=paren... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@densitymapbox@_customdata.py@.PATH_END.py |
{
"filename": "test_comparison_basic.py",
"repo_name": "GalSim-developers/GalSim",
"repo_path": "GalSim_extracted/GalSim-main/devel/external/test_sersic_highn/test_comparison_basic.py",
"type": "Python"
} | # Copyright (c) 2012-2023 by the GalSim developers team on GitHub
# https://github.com/GalSim-developers
#
# This file is part of GalSim: The modular galaxy image simulation toolkit.
# https://github.com/GalSim-developers/GalSim
#
# GalSim is free software: redistribution and use in source and binary forms,
# with or w... | GalSim-developersREPO_NAMEGalSimPATH_START.@GalSim_extracted@GalSim-main@devel@external@test_sersic_highn@test_comparison_basic.py@.PATH_END.py |
{
"filename": "test_cassandra.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/integration_tests/document_loaders/test_cassandra.py",
"type": "Python"
} | """
Test of Cassandra document loader class `CassandraLoader`
"""
import os
from typing import Any, Iterator
import pytest
from langchain_core.documents import Document
from langchain_community.document_loaders.cassandra import CassandraLoader
CASSANDRA_DEFAULT_KEYSPACE = "docloader_test_keyspace"
CASSANDRA_TABLE =... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@integration_tests@document_loaders@test_cassandra.py@.PATH_END.py |
{
"filename": "sp_utils.py",
"repo_name": "sophiasosafiscella/highfluencetiming",
"repo_path": "highfluencetiming_extracted/highfluencetiming-main/sp_utils.py",
"type": "Python"
} | import matplotlib.pyplot as plt
import matplotlib.transforms as mtransforms
from mpl_toolkits.mplot3d import Axes3D
import seaborn as sns
import pypulse as pyp
import numpy as np
import pandas as pd
import pypulse
import glob
import string
import os
import sys
from lmfit import Model, Parameters
#from scipy.optimize... | sophiasosafiscellaREPO_NAMEhighfluencetimingPATH_START.@highfluencetiming_extracted@highfluencetiming-main@sp_utils.py@.PATH_END.py |
{
"filename": "_traceref.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/histogram/error_y/_traceref.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TracerefValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="traceref", parent_name="histogram.error_y", **kwargs
):
super(TracerefValidator, self).__init__(
plotly_name=plotly_name,
parent_... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@histogram@error_y@_traceref.py@.PATH_END.py |
{
"filename": "furlanetto2017.py",
"repo_name": "mirochaj/ares",
"repo_path": "ares_extracted/ares-main/input/litdata/furlanetto2017.py",
"type": "Python"
} | from numpy import inf
# Calibration set!
energy = \
{
'pop_fstar': None,
'pop_fstar_max': 0.1, # fstar <= this value
# SFE (through mass loading factor)
'pop_sfr_model': 'mlf-func',
'pop_mlf': 'pq[0]',
'pq_func[0]': 'pl_evolN',
'pq_func_var[0]': 'Mh',
'pq_func_var2[0]': '1+z',
##
# Steve's Equa... | mirochajREPO_NAMEaresPATH_START.@ares_extracted@ares-main@input@litdata@furlanetto2017.py@.PATH_END.py |
{
"filename": "read_gwf.ipynb",
"repo_name": "ThibeauWouters/TurboPE-BNS",
"repo_path": "TurboPE-BNS_extracted/TurboPE-BNS-main/real_events/deprecated_runs/GW190425_NRTidalv2/read_gwf.ipynb",
"type": "Jupyter Notebook"
} | # Read GWF files
```python
import psutil
p = psutil.Process()
p.cpu_affinity([0])
import warnings
warnings.filterwarnings("ignore", "Wswiglal-redir-stdio")
import lal
from gwpy.timeseries import TimeSeries
from lalframe.utils.frtools import get_channels
import jax
import jax.numpy as jnp
import numpy as np
import m... | ThibeauWoutersREPO_NAMETurboPE-BNSPATH_START.@TurboPE-BNS_extracted@TurboPE-BNS-main@real_events@deprecated_runs@GW190425_NRTidalv2@read_gwf.ipynb@.PATH_END.py |
{
"filename": "asciidata_test.py",
"repo_name": "spacetelescope/stsdas_stripped",
"repo_path": "stsdas_stripped_extracted/stsdas_stripped-master/stsdas/pkg/analysis/slitless/axe/axe_asciidata/asciidata_test.py",
"type": "Python"
} | """
Unittest classes for the asciidata module
@author: Martin Kuemmel, Jonas Haase
@organization: Space Telescope - European Coordinating Facility (ST-ECF)
@license: Gnu Public Licence
@contact: mkuemmel@eso.org
@since: 2005/09/13
$LastChangedBy: jhaase $
$LastChangedDate: 2008-02-27 16:45:36 +0100 (Wed, 27 Feb 2008)... | spacetelescopeREPO_NAMEstsdas_strippedPATH_START.@stsdas_stripped_extracted@stsdas_stripped-master@stsdas@pkg@analysis@slitless@axe@axe_asciidata@asciidata_test.py@.PATH_END.py |
{
"filename": "_anglesrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterpolar/marker/_anglesrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class AnglesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="anglesrc", parent_name="scatterpolar.marker", **kwargs
):
super(AnglesrcValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterpolar@marker@_anglesrc.py@.PATH_END.py |
{
"filename": "boxedfi.py",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/examples/publications/2013MNRAS.429..895P/disk_script/boxedfi.py",
"type": "Python"
} |
from amuse.units import nbody_system
from amuse.units import units
import amuse.datamodel as core
from amuse.community.fi.interface import Fi
from amuse.ext.gasplummer import MakePlummerGasModel
class BoxedFi(Fi):
def __init__(self, *args, **kargs):
Fi.__init__(self, *args, **kargs)
self.escapers=core.Pa... | amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@examples@publications@2013MNRAS.429..895P@disk_script@boxedfi.py@.PATH_END.py |
{
"filename": "_fontconfig_pattern.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/lib/matplotlib/_fontconfig_pattern.py",
"type": "Python"
} | """
A module for parsing and generating `fontconfig patterns`_.
.. _fontconfig patterns:
https://www.freedesktop.org/software/fontconfig/fontconfig-user.html
"""
# This class logically belongs in `matplotlib.font_manager`, but placing it
# there would have created cyclical dependency problems, because it also need... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@lib@matplotlib@_fontconfig_pattern.py@.PATH_END.py |
{
"filename": "verifyPtc.py",
"repo_name": "lsst/cp_verify",
"repo_path": "cp_verify_extracted/cp_verify-main/python/lsst/cp/verify/verifyPtc.py",
"type": "Python"
} | # This file is part of cp_verify.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (http://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This program is free software: you ca... | lsstREPO_NAMEcp_verifyPATH_START.@cp_verify_extracted@cp_verify-main@python@lsst@cp@verify@verifyPtc.py@.PATH_END.py |
{
"filename": "test_summarymetrics.py",
"repo_name": "lsst/rubin_sim",
"repo_path": "rubin_sim_extracted/rubin_sim-main/tests/maf/test_summarymetrics.py",
"type": "Python"
} | import unittest
import healpy as hp
import numpy as np
import rubin_sim.maf.metrics as metrics
class TestSummaryMetrics(unittest.TestCase):
def test_identity_metric(self):
"""Test identity metric."""
dv = np.arange(0, 10, 0.5)
dv = np.array(list(zip(dv)), dtype=[("testdata", "float")])
... | lsstREPO_NAMErubin_simPATH_START.@rubin_sim_extracted@rubin_sim-main@tests@maf@test_summarymetrics.py@.PATH_END.py |
{
"filename": "tornadoserver.py",
"repo_name": "miguelzuma/hi_class_public",
"repo_path": "hi_class_public_extracted/hi_class_public-master/RealSpaceInterface/tornadoserver.py",
"type": "Python"
} | from Calc2D.CalculationClass import Calculation
import time
import numpy as np
from concurrent.futures import ThreadPoolExecutor
from tornado.ioloop import IOLoop
from tornado import gen
import tornado.web
import tornado.websocket
import os
import os.path
import json
import unicodedata
import logging
import base64
imp... | miguelzumaREPO_NAMEhi_class_publicPATH_START.@hi_class_public_extracted@hi_class_public-master@RealSpaceInterface@tornadoserver.py@.PATH_END.py |
{
"filename": "inspect_nbody_ebf.ipynb",
"repo_name": "jan-rybizki/Galaxia_wrap",
"repo_path": "Galaxia_wrap_extracted/Galaxia_wrap-master/notebook/inspect_nbody_ebf.ipynb",
"type": "Jupyter Notebook"
} | ```python
import ebf
%pylab inline
```
Populating the interactive namespace from numpy and matplotlib
```python
file = ebf.read('/home/rybizki/Programme/GalaxiaData/nbody1/LSMC/MCssmc.ebf','/')
file
```
{'age': array([1.350000e+01, 1.349865e+01, 1.349730e+01, ..., 4.050000e-03,
2.700000e-03,... | jan-rybizkiREPO_NAMEGalaxia_wrapPATH_START.@Galaxia_wrap_extracted@Galaxia_wrap-master@notebook@inspect_nbody_ebf.ipynb@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "simonsobs/nextline-rdb",
"repo_path": "nextline-rdb_extracted/nextline-rdb-main/src/nextline_rdb/alembic/README.md",
"type": "Markdown"
} | # Alembic Migration Environment
This folder is the [Alembic Migration Environment](https://alembic.sqlalchemy.org/en/latest/tutorial.html#the-migration-environment).
## How to create a migration revision
In this folder, in which `alembic.ini` is located:
```bash
# Ensure the target DB doesn't exist
rm -f migration.... | simonsobsREPO_NAMEnextline-rdbPATH_START.@nextline-rdb_extracted@nextline-rdb-main@src@nextline_rdb@alembic@README.md@.PATH_END.py |
{
"filename": "large_distributions.py",
"repo_name": "mwaskom/seaborn",
"repo_path": "seaborn_extracted/seaborn-master/examples/large_distributions.py",
"type": "Python"
} | """
Plotting large distributions
============================
"""
import seaborn as sns
sns.set_theme(style="whitegrid")
diamonds = sns.load_dataset("diamonds")
clarity_ranking = ["I1", "SI2", "SI1", "VS2", "VS1", "VVS2", "VVS1", "IF"]
sns.boxenplot(
diamonds, x="clarity", y="carat",
color="b", order=clarity... | mwaskomREPO_NAMEseabornPATH_START.@seaborn_extracted@seaborn-master@examples@large_distributions.py@.PATH_END.py |
{
"filename": "stat.py",
"repo_name": "COSMOGRAIL/PyCS",
"repo_path": "PyCS_extracted/PyCS-master/pycs/gen/stat.py",
"type": "Python"
} | """
Statistics related stuff.
"""
import sys
import os
import numpy as np
import math
import pycs.gen.util
def normal(x, mu, sigma):
return (1.0/np.sqrt(2.0*np.pi*sigma*sigma)) * np.exp( - (x - mu)**2/(2*sigma*sigma))
def sf(l, binsize = 200, ssf=False):
"""
Structure function of a lightcurve
ssf gives a 2D... | COSMOGRAILREPO_NAMEPyCSPATH_START.@PyCS_extracted@PyCS-master@pycs@gen@stat.py@.PATH_END.py |
{
"filename": "PecinaCeplechaFunction.py",
"repo_name": "wmpg/WesternMeteorPyLib",
"repo_path": "WesternMeteorPyLib_extracted/WesternMeteorPyLib-master/wmpl/Utils/PecinaCeplechaFunction.py",
"type": "Python"
} |
import numpy as np
import scipy.optimize
import scipy.special
import scipy.integrate
import scipy.interpolate
from wmpl.Utils.AtmosphereDensity import atmDensPoly, fitAtmPoly
# Define the ceiling height (assumed to be h_inf in terms of the air density)
HT_CEILING = 180
def lenFromHt(h, c, zr):
""" Compute th... | wmpgREPO_NAMEWesternMeteorPyLibPATH_START.@WesternMeteorPyLib_extracted@WesternMeteorPyLib-master@wmpl@Utils@PecinaCeplechaFunction.py@.PATH_END.py |
{
"filename": "_plotutils.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/spatial/_plotutils.py",
"type": "Python"
} | import numpy as np
from scipy._lib.decorator import decorator as _decorator
__all__ = ['delaunay_plot_2d', 'convex_hull_plot_2d', 'voronoi_plot_2d']
@_decorator
def _held_figure(func, obj, ax=None, **kw):
import matplotlib.pyplot as plt
if ax is None:
fig = plt.figure()
ax = fig.gca()
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@spatial@_plotutils.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "cosmostat/CosmoPMC",
"repo_path": "CosmoPMC_extracted/CosmoPMC-master/README.md",
"type": "Markdown"
} | # CosmoPMC
Cosmology sampling with Population Monte Carlo (PMC)
## Information
### Description
CosmoPMC is a Monte-Carlo sampling method to explore the likelihood of various
cosmological probes. The sampling engine is implemented with the package
pmclib. It is called Population MonteCarlo (PMC), which is a novel tec... | cosmostatREPO_NAMECosmoPMCPATH_START.@CosmoPMC_extracted@CosmoPMC-master@README.md@.PATH_END.py |
{
"filename": "cities.py",
"repo_name": "brandon-rhodes/pyephem",
"repo_path": "pyephem_extracted/pyephem-master/generate/cities.py",
"type": "Python"
} | #!/usr/bin/env python
from urllib2 import urlopen, HTTPError
import re
# Look up each city in "cities.in" on the http://www.fallingrain.com/
# web site, and append their geographic data into "cities.out".
cin = open('cities.in', 'r')
cout = open('cities.out', 'a')
def transchar(c):
if c == ' ':
return '... | brandon-rhodesREPO_NAMEpyephemPATH_START.@pyephem_extracted@pyephem-master@generate@cities.py@.PATH_END.py |
{
"filename": "Quick_start.md",
"repo_name": "teuben/DataComb",
"repo_path": "DataComb_extracted/DataComb-main/Quick_start.md",
"type": "Markdown"
} | # Quick Start Guide
This guide will walk you through how to run the data combination
script on example data and how to quickly run the script in the
future.
The general overview of the steps to get combination images:
1. Set data and user specific parameters in `DC_pars.py`
2. Execute `DC_locals.py` - if it was not ... | teubenREPO_NAMEDataCombPATH_START.@DataComb_extracted@DataComb-main@Quick_start.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatter3d/stream/__init__.py",
"type": "Python"
} | import sys
if sys.version_info < (3, 7):
from ._token import TokenValidator
from ._maxpoints import MaxpointsValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._token.TokenValidator", "._maxpoints.MaxpointsValid... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatter3d@stream@__init__.py@.PATH_END.py |
{
"filename": "setting.py",
"repo_name": "veusz/veusz",
"repo_path": "veusz_extracted/veusz-master/veusz/setting/setting.py",
"type": "Python"
} | # Copyright (C) 2005 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# ... | veuszREPO_NAMEveuszPATH_START.@veusz_extracted@veusz-master@veusz@setting@setting.py@.PATH_END.py |
{
"filename": "personality.py",
"repo_name": "crossbario/crossbar",
"repo_path": "crossbar_extracted/crossbar-master/crossbar/edge/personality.py",
"type": "Python"
} | ##############################################################################
#
# Crossbar.io
# Copyright (C) Crossbar.io Technologies GmbH. All rights reserved.
#
##############################################################################
from typing import Dict
from collections.abc imp... | crossbarioREPO_NAMEcrossbarPATH_START.@crossbar_extracted@crossbar-master@crossbar@edge@personality.py@.PATH_END.py |
{
"filename": "plot_sdtw.py",
"repo_name": "tslearn-team/tslearn",
"repo_path": "tslearn_extracted/tslearn-main/docs/examples/metrics/plot_sdtw.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
r"""
sDTW multi path matching
========================
This example illustrates how subsequent DTW can be used to find multiple
matches of a sequence in a longer sequence.
A potential usecase is to identify the occurrence of certain events in
continuous sensor signals. As one example Barth et ... | tslearn-teamREPO_NAMEtslearnPATH_START.@tslearn_extracted@tslearn-main@docs@examples@metrics@plot_sdtw.py@.PATH_END.py |
{
"filename": "test_spectrum.py",
"repo_name": "tomasstolker/species",
"repo_path": "species_extracted/species-main/tests/test_read/test_spectrum.py",
"type": "Python"
} | import os
import shutil
import pytest
import numpy as np
from species import SpeciesInit
# from species.data.database import Database
# from species.read.read_spectrum import ReadSpectrum
# from species.plot.plot_spectrum import plot_spectrum
from species.util import test_util
class TestSpectrum:
def setup_clas... | tomasstolkerREPO_NAMEspeciesPATH_START.@species_extracted@species-main@tests@test_read@test_spectrum.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "ggmichael/craterstats",
"repo_path": "craterstats_extracted/craterstats-main/src/craterstats/config/__init__.py",
"type": "Python"
} | ggmichaelREPO_NAMEcraterstatsPATH_START.@craterstats_extracted@craterstats-main@src@craterstats@config@__init__.py@.PATH_END.py | |
{
"filename": "massless_ferm.ipynb",
"repo_name": "awsteiner/o2scl",
"repo_path": "o2scl_extracted/o2scl-main/doc/o2scl/python/massless_ferm.ipynb",
"type": "Jupyter Notebook"
} | ```python
import sympy
import numpy
```
```python
alpha=sympy.Symbol('alpha')
eta=sympy.Symbol('eta')
beta=sympy.Symbol('beta')
```
Basic expression to approximate
```python
cbt=(alpha**(sympy.Rational(-1,6))*(-1+sympy.sqrt(1+alpha))**
(sympy.Rational(1,3)))
display(cbt)
```
$\displaystyle \frac{\sqrt[3]{\s... | awsteinerREPO_NAMEo2sclPATH_START.@o2scl_extracted@o2scl-main@doc@o2scl@python@massless_ferm.ipynb@.PATH_END.py |
{
"filename": "test_auto.py",
"repo_name": "AFD-Illinois/ebhlight",
"repo_path": "ebhlight_extracted/ebhlight-master/test/test_auto.py",
"type": "Python"
} | ################################################################################
# #
# RUN ALL TESTS AND CHECK FOR ACCURACY #
# ... | AFD-IllinoisREPO_NAMEebhlightPATH_START.@ebhlight_extracted@ebhlight-master@test@test_auto.py@.PATH_END.py |
{
"filename": "xpobsdisplay.py",
"repo_name": "lucabaldini/ixpeobssim",
"repo_path": "ixpeobssim_extracted/ixpeobssim-main/ixpeobssim/bin/xpobsdisplay.py",
"type": "Python"
} | #!/usr/bin/env python
#
# Copyright (C) 2022, the ixpeobssim team.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
#... | lucabaldiniREPO_NAMEixpeobssimPATH_START.@ixpeobssim_extracted@ixpeobssim-main@ixpeobssim@bin@xpobsdisplay.py@.PATH_END.py |
{
"filename": "_unselected.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/splom/_unselected.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class UnselectedValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="unselected", parent_name="splom", **kwargs):
super(UnselectedValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@splom@_unselected.py@.PATH_END.py |
{
"filename": "FaultState.py",
"repo_name": "ACS-Community/ACS",
"repo_path": "ACS_extracted/ACS-master/LGPL/CommonSoftware/acsalarmpy/src/Acsalarmpy/FaultState.py",
"type": "Python"
} | #! /usr/bin/env python
#*******************************************************************************
# ALMA - Atacama Large Millimiter Array
# (c) National Research Council of Canada, 2008
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public... | ACS-CommunityREPO_NAMEACSPATH_START.@ACS_extracted@ACS-master@LGPL@CommonSoftware@acsalarmpy@src@Acsalarmpy@FaultState.py@.PATH_END.py |
{
"filename": "modulation.py",
"repo_name": "jtdinsmore/leakagelib",
"repo_path": "leakagelib_extracted/leakagelib-main/src/modulation.py",
"type": "Python"
} | import numpy as np
from scipy.interpolate import interp1d
from .settings import LEAKAGE_DATA_DIRECTORY
def load_generic_modf_file(filename):
energies, modfs = np.load(filename)
return interp1d(energies, modfs, bounds_error=False, fill_value=1)
def get_mom_modf(energies):
'''Returns the modulation factor ... | jtdinsmoreREPO_NAMEleakagelibPATH_START.@leakagelib_extracted@leakagelib-main@src@modulation.py@.PATH_END.py |
{
"filename": "run.py",
"repo_name": "aasensio/hazel",
"repo_path": "hazel_extracted/hazel-master/run/run.py",
"type": "Python"
} | #!/usr/bin/env python
from __future__ import print_function
from configobj import ConfigObj
import sys
import os
from subprocess import call
def lower_to_sep(string, separator='='):
line=string.partition(separator)
string=str(line[0]).lower()+str(line[1])+str(line[2])
return string
if (len(sys.argv) < 2):
print(... | aasensioREPO_NAMEhazelPATH_START.@hazel_extracted@hazel-master@run@run.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "bradkav/EarthShadow",
"repo_path": "EarthShadow_extracted/EarthShadow-master/scripts/README.md",
"type": "Markdown"
} | ### Plotting scripts
Here, I will add python scripts for processing and plotting the `EarthShadow` results.
At the moment, the script `PlotRates_CRESST_Earth.py` can be used to plot a whole-Earth map of the CRESST-II rate for low mass DM.
More scripts (for plotting orthographic projections, animations etc.) will be... | bradkavREPO_NAMEEarthShadowPATH_START.@EarthShadow_extracted@EarthShadow-master@scripts@README.md@.PATH_END.py |
{
"filename": "UniquelyIdentifyingParticlesWithHashes.ipynb",
"repo_name": "tigerchenlu98/rebound",
"repo_path": "rebound_extracted/rebound-main/ipython_examples/UniquelyIdentifyingParticlesWithHashes.ipynb",
"type": "Jupyter Notebook"
} | # Uniquely Identifying Particles With Hashes
In many cases, one can just identify particles by their position in the particle array, e.g. using ``sim.particles[5]``. However, in cases where particles might get reordered in the particle array finding a particle might be difficult. This is why we added a *hash* attribut... | tigerchenlu98REPO_NAMEreboundPATH_START.@rebound_extracted@rebound-main@ipython_examples@UniquelyIdentifyingParticlesWithHashes.ipynb@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.