metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "astrometry.md",
"repo_name": "cmillion/gPhoton",
"repo_path": "gPhoton_extracted/gPhoton-master/calpaper/src/astrometry.md",
"type": "Markdown"
} | %pylab
import gQuery as gq
import galextools as gt
import dbasetools as dt
import gphoton_utils as gu
from gAperture import gAperture
band, ra0, dec0, radius = ('FUV', 323.06766667, 0.254, 0.1)
ra0, dec0 = 53.1032558472, -27.7963826072 # PS_CDFS_MOS00
ra0, dec0 = 53.1273118244, -27.8744513656 # CDFS_00
radius = 0.5
ape... | cmillionREPO_NAMEgPhotonPATH_START.@gPhoton_extracted@gPhoton-master@calpaper@src@astrometry.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/matplotlib/py2/matplotlib/axes/__init__.py",
"type": "Python"
} | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from ._subplots import *
from ._axes import *
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@matplotlib@py2@matplotlib@axes@__init__.py@.PATH_END.py |
{
"filename": "_version.py",
"repo_name": "ma-xu/pointMLP-pytorch",
"repo_path": "pointMLP-pytorch_extracted/pointMLP-pytorch-main/pointnet2_ops_lib/pointnet2_ops/_version.py",
"type": "Python"
} | __version__ = "3.0.0"
| ma-xuREPO_NAMEpointMLP-pytorchPATH_START.@pointMLP-pytorch_extracted@pointMLP-pytorch-main@pointnet2_ops_lib@pointnet2_ops@_version.py@.PATH_END.py |
{
"filename": "test_infinite_line.py",
"repo_name": "macrocosme/shwirl",
"repo_path": "shwirl_extracted/shwirl-master/shwirl/extern/vispy/visuals/tests/test_infinite_line.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Tests for InfiniteLineVisual
All images are of size (100,100) to keep a small file size
"""
import numpy as np
from vispy.scene import visuals
from vispy.testing import ... | macrocosmeREPO_NAMEshwirlPATH_START.@shwirl_extracted@shwirl-master@shwirl@extern@vispy@visuals@tests@test_infinite_line.py@.PATH_END.py |
{
"filename": "tests.py",
"repo_name": "lsst-uk/lasair-lsst",
"repo_path": "lasair-lsst_extracted/lasair-lsst-main/webserver/lasair/apps/db_schema/tests.py",
"type": "Python"
} | from django.test import TestCase
# Create your tests here.
| lsst-ukREPO_NAMElasair-lsstPATH_START.@lasair-lsst_extracted@lasair-lsst-main@webserver@lasair@apps@db_schema@tests.py@.PATH_END.py |
{
"filename": "test_lombscargle.py",
"repo_name": "johnh2o2/cuvarbase",
"repo_path": "cuvarbase_extracted/cuvarbase-master/cuvarbase/tests/test_lombscargle.py",
"type": "Python"
} | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from builtins import zip
from builtins import range
from builtins import object
import numpy as np
import pytest
from numpy.testing import assert_allclose
from astropy.timeseries import LombScargle
from ..lom... | johnh2o2REPO_NAMEcuvarbasePATH_START.@cuvarbase_extracted@cuvarbase-master@cuvarbase@tests@test_lombscargle.py@.PATH_END.py |
{
"filename": "_meta.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/choropleth/_meta.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MetaValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="meta", parent_name="choropleth", **kwargs):
super(MetaValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
array_o... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@choropleth@_meta.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "jkrogager/PyNOT",
"repo_path": "PyNOT_extracted/PyNOT-master/README.md",
"type": "Markdown"
} | # PyNOT-redux
A Data Processing Pipeline for ALFOSC at the Nordic Optical Telescope
PyNOT handles long-slit spectroscopic data (an extension for imaging data is currently being developed). The pipeline is implemented entirely in Python and can be run directly from the terminal. The main workflow is mostly automated ... | jkrogagerREPO_NAMEPyNOTPATH_START.@PyNOT_extracted@PyNOT-master@README.md@.PATH_END.py |
{
"filename": "axis.py",
"repo_name": "macrocosme/shwirl",
"repo_path": "shwirl_extracted/shwirl-master/shwirl/extern/vispy/scene/widgets/axis.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... | macrocosmeREPO_NAMEshwirlPATH_START.@shwirl_extracted@shwirl-master@shwirl@extern@vispy@scene@widgets@axis.py@.PATH_END.py |
{
"filename": "math.py",
"repo_name": "Keck-DataReductionPipelines/KCWI_DRP",
"repo_path": "KCWI_DRP_extracted/KCWI_DRP-master/kcwidrp/core/bspline/math.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""This module corresponds to the math directory in idlutils.
"""
import numpy as np
from numpy.linalg import svd
from scipy.special import legendre
import astropy.utils as au
from .misc import djs_laxisnum
from .median import media... | Keck-DataReductionPipelinesREPO_NAMEKCWI_DRPPATH_START.@KCWI_DRP_extracted@KCWI_DRP-master@kcwidrp@core@bspline@math.py@.PATH_END.py |
{
"filename": "spleaf_multidimensional_esp_activity_slow.py",
"repo_name": "LucaMalavolta/PyORBIT",
"repo_path": "PyORBIT_extracted/PyORBIT-main/pyorbit/models/spleaf_multidimensional_esp_activity_slow.py",
"type": "Python"
} | from pyorbit.subroutines.common import *
from pyorbit.models.abstract_model import *
from pyorbit.keywords_definitions import *
from scipy.linalg import cho_factor, cho_solve, lapack, LinAlgError
from scipy import matrix, spatial
import sys
__all__ = ['SPLEAF_Multidimensional_ESP_slow']
try:
from spleaf import ... | LucaMalavoltaREPO_NAMEPyORBITPATH_START.@PyORBIT_extracted@PyORBIT-main@pyorbit@models@spleaf_multidimensional_esp_activity_slow.py@.PATH_END.py |
{
"filename": "spiderman_spot.py",
"repo_name": "kevin218/POET",
"repo_path": "POET_extracted/POET-master/code/lib/models_c/py_func/spiderman_spot.py",
"type": "Python"
} | import numpy as np
import spiderman
def spiderman_spot(params, t, etc = []):
"""
This function creates a model that fits a hotspot model
Parameters
----------
t0: time of conjunction
per: orbital period
a_abs: semi-major axis (AU)
inc: inclinations (deg)
ecc: eccentricity
w: arg of periastr... | kevin218REPO_NAMEPOETPATH_START.@POET_extracted@POET-master@code@lib@models_c@py_func@spiderman_spot.py@.PATH_END.py |
{
"filename": "_tickmode.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/scene/zaxis/_tickmode.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="tickmode", parent_name="layout.scene.zaxis", **kwargs
):
super(TickmodeValidator, self).__init__(
plotly_name=plotly_name,
par... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@scene@zaxis@_tickmode.py@.PATH_END.py |
{
"filename": "download_test_data.py",
"repo_name": "trident-project/trident",
"repo_path": "trident_extracted/trident-main/tests/download_test_data.py",
"type": "Python"
} | """
Testing utilities for Trident
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2017, Trident Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#--------------... | trident-projectREPO_NAMEtridentPATH_START.@trident_extracted@trident-main@tests@download_test_data.py@.PATH_END.py |
{
"filename": "_bordercolor.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/treemap/marker/colorbar/_bordercolor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="bordercolor", parent_name="treemap.marker.colorbar", **kwargs
):
super(BordercolorValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@treemap@marker@colorbar@_bordercolor.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatter/unselected/textfont/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="scatter.unselected.textfont", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatter@unselected@textfont@_color.py@.PATH_END.py |
{
"filename": "image.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/core/langchain_core/prompts/image.py",
"type": "Python"
} | from typing import Any
from pydantic import Field
from langchain_core.prompt_values import ImagePromptValue, ImageURL, PromptValue
from langchain_core.prompts.base import BasePromptTemplate
from langchain_core.prompts.string import (
DEFAULT_FORMATTER_MAPPING,
PromptTemplateFormat,
)
from langchain_core.runna... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@core@langchain_core@prompts@image.py@.PATH_END.py |
{
"filename": "boost_from_prediction.py",
"repo_name": "dmlc/xgboost",
"repo_path": "xgboost_extracted/xgboost-master/demo/guide-python/boost_from_prediction.py",
"type": "Python"
} | """
Demo for boosting from prediction
=================================
"""
import os
import xgboost as xgb
CURRENT_DIR = os.path.dirname(__file__)
dtrain = xgb.DMatrix(
os.path.join(CURRENT_DIR, "../data/agaricus.txt.train?format=libsvm")
)
dtest = xgb.DMatrix(
os.path.join(CURRENT_DIR, "../data/agaricus.txt... | dmlcREPO_NAMExgboostPATH_START.@xgboost_extracted@xgboost-master@demo@guide-python@boost_from_prediction.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "natashabatalha/PandExo",
"repo_path": "PandExo_extracted/PandExo-master/pandexo/engine/utils/__init__.py",
"type": "Python"
} | # This is a special __init__.py required to for namespace packages.
# There should be no other code in this module.
try:
from pkg_resources import declare_namespace
declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| natashabatalhaREPO_NAMEPandExoPATH_START.@PandExo_extracted@PandExo-master@pandexo@engine@utils@__init__.py@.PATH_END.py |
{
"filename": "plot_total_xs.py",
"repo_name": "johnh2o2/ggadt",
"repo_path": "ggadt_extracted/ggadt-master/example/plot_total_xs.py",
"type": "Python"
} | import matplotlib.pyplot as plt
import numpy as np
import argparse
parser=argparse.ArgumentParser(description="Plot 1d total extinction cross section output from GGADT")
parser.add_argument('file_name',metavar='ggadt-output-file',type=str, nargs=1, help="a file containing the output of GGADT")
args = parser.parse_arg... | johnh2o2REPO_NAMEggadtPATH_START.@ggadt_extracted@ggadt-master@example@plot_total_xs.py@.PATH_END.py |
{
"filename": "example.py",
"repo_name": "sherpa/sherpa",
"repo_path": "sherpa_extracted/sherpa-main/docs/_examples/examples/simple_user_model/example.py",
"type": "Python"
} | import numpy as np
import matplotlib.pyplot as plt
def savefig(name):
plt.savefig(name)
print("Created: {}".format(name))
def report(name):
print("# print({})".format(name))
print(eval(name))
def dump(name):
print("# dump")
print(name)
print(repr(eval(name)))
from openpyxl import load_w... | sherpaREPO_NAMEsherpaPATH_START.@sherpa_extracted@sherpa-main@docs@_examples@examples@simple_user_model@example.py@.PATH_END.py |
{
"filename": "plot_mg_fs8_bs8.py",
"repo_name": "philbull/RadioFisher",
"repo_path": "RadioFisher_extracted/RadioFisher-master/plotting/plot_mg_fs8_bs8.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
e = rf.experiments
eg = rf.experiments_galaxy
cosmo = rf.experiments.cosmo
fname = 'mg-fbsigma8-combined.pdf'
names = ['SKA1MID900_mg', 'SKA1MID35... | philbullREPO_NAMERadioFisherPATH_START.@RadioFisher_extracted@RadioFisher-master@plotting@plot_mg_fs8_bs8.py@.PATH_END.py |
{
"filename": "canonical_constraint.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py2/scipy/optimize/_trustregion_constr/canonical_constraint.py",
"type": "Python"
} | import numpy as np
import scipy.sparse as sps
class CanonicalConstraint(object):
"""Canonical constraint to use with trust-constr algorithm.
It represents the set of constraints of the form::
f_eq(x) = 0
f_ineq(x) <= 0
Where ``f_eq`` and ``f_ineq`` are evaluated by a single function, se... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py2@scipy@optimize@_trustregion_constr@canonical_constraint.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "johnh2o2/cuvarbase",
"repo_path": "cuvarbase_extracted/cuvarbase-master/cuvarbase/tests/__init__.py",
"type": "Python"
} | johnh2o2REPO_NAMEcuvarbasePATH_START.@cuvarbase_extracted@cuvarbase-master@cuvarbase@tests@__init__.py@.PATH_END.py | |
{
"filename": "test_age_graph.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/integration_tests/graphs/test_age_graph.py",
"type": "Python"
} | import os
import re
import unittest
from typing import Any, Dict
from langchain_core.documents import Document
from langchain_community.graphs.age_graph import AGEGraph
from langchain_community.graphs.graph_document import GraphDocument, Node, Relationship
test_data = [
GraphDocument(
nodes=[Node(id="foo... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@integration_tests@graphs@test_age_graph.py@.PATH_END.py |
{
"filename": "epsie.py",
"repo_name": "gwastro/pycbc",
"repo_path": "pycbc_extracted/pycbc-master/pycbc/inference/sampler/epsie.py",
"type": "Python"
} | # Copyright (C) 2019 Collin Capano
# 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 t... | gwastroREPO_NAMEpycbcPATH_START.@pycbc_extracted@pycbc-master@pycbc@inference@sampler@epsie.py@.PATH_END.py |
{
"filename": "fit_ns.py",
"repo_name": "mtalapinto/moes",
"repo_path": "carmenes/fit_ns.py",
"type": "Python"
} | import matplotlib as mpl
# mpl.use('qt4agg')
from optics import env_data
import matplotlib.pyplot as plt
import pymultinest
import numpy as np
import utils
from optics import parameters
from optics import vis_spectrometer
import time
import ws_load
import os
import pandas as pd
import dynesty
import corner
from astropy... | mtalapintoREPO_NAMEmoesPATH_START.@carmenes@fit_ns.py@.PATH_END.py |
{
"filename": "readme.md",
"repo_name": "grand-mother/grand",
"repo_path": "grand_extracted/grand-main/env/docker_fedo/readme.md",
"type": "Markdown"
} | # Enable graphical application in docker
## For Linux
### Solution 1: with $HOME/.Xauthority
[tuto](https://medium.com/@SaravSun/running-gui-applications-inside-docker-containers-83d65c0db110)
For a GUI Application to run, we need to have a XServer which is available as part of every Linux Desktop Environment, But... | grand-motherREPO_NAMEgrandPATH_START.@grand_extracted@grand-main@env@docker_fedo@readme.md@.PATH_END.py |
{
"filename": "_cmid.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/funnel/marker/_cmid.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CmidValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="cmid", parent_name="funnel.marker", **kwargs):
super(CmidValidator, 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@funnel@marker@_cmid.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "GeminiDRSoftware/DRAGONS",
"repo_path": "DRAGONS_extracted/DRAGONS-master/gemini_instruments/f2/__init__.py",
"type": "Python"
} | __all__ = ['AstroDataF2']
from astrodata import factory
from ..gemini import addInstrumentFilterWavelengths
from .adclass import AstroDataF2
from .lookup import filter_wavelengths
factory.addClass(AstroDataF2)
addInstrumentFilterWavelengths('F2', filter_wavelengths)
| GeminiDRSoftwareREPO_NAMEDRAGONSPATH_START.@DRAGONS_extracted@DRAGONS-master@gemini_instruments@f2@__init__.py@.PATH_END.py |
{
"filename": "_lineposition.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattergl/legendgrouptitle/font/_lineposition.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LinepositionValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(
self,
plotly_name="lineposition",
parent_name="scattergl.legendgrouptitle.font",
**kwargs,
):
super(LinepositionValidator, self).__init__(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattergl@legendgrouptitle@font@_lineposition.py@.PATH_END.py |
{
"filename": "ex2.py",
"repo_name": "teuben/nemo",
"repo_path": "nemo_extracted/nemo-master/scripts/templates/ex2.py",
"type": "Python"
} | #! /usr/bin/env python
#
# https://docs.python.org/3/library/argparse.html
import math
import argparse
# somehow formatting with \n doesn't work
my_help = """
This script grabs aaa and bbb via argparse. \nThere are several options:\n
--aaa 10\n
--aaa=10\n
-a 10 (note the = option is not allow... | teubenREPO_NAMEnemoPATH_START.@nemo_extracted@nemo-master@scripts@templates@ex2.py@.PATH_END.py |
{
"filename": "other.md",
"repo_name": "RadioAstronomySoftwareGroup/pyradiosky",
"repo_path": "pyradiosky_extracted/pyradiosky-main/.github/original_pr_templates/other.md",
"type": "Markdown"
} | ---
name: Other
about: Anything that doesn't fit in any of the other types of pull requests.
---
<!--- Provide a general summary of your changes in the Title above -->
## Description
<!--- Describe your changes in detail -->
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
... | RadioAstronomySoftwareGroupREPO_NAMEpyradioskyPATH_START.@pyradiosky_extracted@pyradiosky-main@.github@original_pr_templates@other.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/tests/test-projects/nested-project/shared_libs/__init__.py",
"type": "Python"
} | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@tests@test-projects@nested-project@shared_libs@__init__.py@.PATH_END.py | |
{
"filename": "remote.md",
"repo_name": "ML4GW/aframe",
"repo_path": "aframe_extracted/aframe-main/docs/remote.md",
"type": "Markdown"
} | Remote Training
===============
```{eval-rst}
.. note::
It is recommended you are familiar with running a :doc:`local pipeline <first_pipeline>` before proceeding
```
```{eval-rst}
.. important::
For remote training, you must have completed `ml4gw quickstart <https://github.com/ml4gw/quickstart/>`_ instruction... | ML4GWREPO_NAMEaframePATH_START.@aframe_extracted@aframe-main@docs@remote.md@.PATH_END.py |
{
"filename": "take_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/data/kernel_tests/take_test.py",
"type": "Python"
} | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@data@kernel_tests@take_test.py@.PATH_END.py |
{
"filename": "_style.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/table/legendgrouptitle/font/_style.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class StyleValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="style", parent_name="table.legendgrouptitle.font", **kwargs
):
super(StyleValidator, self).__init__(
plotly_name=plotly_name,
par... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@table@legendgrouptitle@font@_style.py@.PATH_END.py |
{
"filename": "makeplot.py",
"repo_name": "VirtualPlanetaryLaboratory/vplanet",
"repo_path": "vplanet_extracted/vplanet-main/examples/AtmEscFlareProxCen/makeplot.py",
"type": "Python"
} | """
This script produces a figure that show the time evolution of planetary and stellar parameters for
Proxima Centuri b, using VPLANET's ATMESC, STELLAR
and FLARE modules.
@autor: Laura N. R. do Amaral, Universidad Nacional Autónoma de México, 2021
@email: laura.nevesdoamaral@gmail.com
Date: Nov. 22st, 2021
"""
imp... | VirtualPlanetaryLaboratoryREPO_NAMEvplanetPATH_START.@vplanet_extracted@vplanet-main@examples@AtmEscFlareProxCen@makeplot.py@.PATH_END.py |
{
"filename": "exoplanet_orbit_database.py",
"repo_name": "astropy/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/exoplanet_orbit_database/exoplanet_orbit_database.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import json
import os
import warnings
from astropy.utils.data import download_file
from astropy.io import ascii
from astropy.table import QTable
import astropy.units as u
from astropy.coordinates import SkyCoord
__all__ = ['ExoplanetOrbitDatabase']
EXOP... | astropyREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@exoplanet_orbit_database@exoplanet_orbit_database.py@.PATH_END.py |
{
"filename": "johnsnowlabs_embedding.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/text_embedding/johnsnowlabs_embedding.ipynb",
"type": "Jupyter Notebook"
} | # John Snow Labs
>[John Snow Labs](https://nlp.johnsnowlabs.com/) NLP & LLM ecosystem includes software libraries for state-of-the-art AI at scale, Responsible AI, No-Code AI, and access to over 20,000 models for Healthcare, Legal, Finance, etc.
>
>Models are loaded with [nlp.load](https://nlp.johnsnowlabs.com/docs/en... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@text_embedding@johnsnowlabs_embedding.ipynb@.PATH_END.py |
{
"filename": "signals.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/tools/python3/Lib/unittest/signals.py",
"type": "Python"
} | import signal
import weakref
from functools import wraps
__unittest = True
class _InterruptHandler(object):
def __init__(self, default_handler):
self.called = False
self.original_handler = default_handler
if isinstance(default_handler, int):
if default_handler == signal.SIG_D... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@python3@Lib@unittest@signals.py@.PATH_END.py |
{
"filename": "lambda_callback_test.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/callbacks/lambda_callback_test.py",
"type": "Python"
} | import numpy as np
import pytest
from absl import logging
from keras.src import callbacks
from keras.src import layers
from keras.src import losses
from keras.src import optimizers
from keras.src import testing
from keras.src.models.sequential import Sequential
class LambdaCallbackTest(testing.TestCase):
@pytest... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@callbacks@lambda_callback_test.py@.PATH_END.py |
{
"filename": "metrics.py",
"repo_name": "shaoshanglqy/shap-shapley",
"repo_path": "shap-shapley_extracted/shap-shapley-master/shap/benchmark/metrics.py",
"type": "Python"
} | from .. import LinearExplainer
from .. import KernelExplainer
from .. import SamplingExplainer
from ..explainers import other
from . import measures
from . import methods
import sklearn
from sklearn.model_selection import train_test_split
import numpy as np
import copy
import functools
import time
def consistency_guar... | shaoshanglqyREPO_NAMEshap-shapleyPATH_START.@shap-shapley_extracted@shap-shapley-master@shap@benchmark@metrics.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "hruedisser/3DCOREweb",
"repo_path": "3DCOREweb_extracted/3DCOREweb-main/src/coreweb/__init__.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
from coreweb.methods import ABC_SMC
from coreweb.models import ToroidalModel
__author__ = "Andreas J. Weiss"
__copyright__ = "Copyright (C) 2019 Andreas J. Weiss"
__license__ = "MIT"
__version__ = "0.0.0"
# -*- coding: utf-8 -*- | hruedisserREPO_NAME3DCOREwebPATH_START.@3DCOREweb_extracted@3DCOREweb-main@src@coreweb@__init__.py@.PATH_END.py |
{
"filename": "test_proposal.py",
"repo_name": "igomezv/simplemc_tests",
"repo_path": "simplemc_tests_extracted/simplemc_tests-main/simplemc/analyzers/emcee/tests/integration/test_proposal.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
import numpy as np
import pytest
import emcee
try:
from scipy import stats
except ImportError:
stats = None
__all__ = ["_test_normal", "_test_uniform"]
def normal_log_prob_blobs(params):
return -0.5 * np.sum(params ** 2), params
def normal_log_prob(params):
return -0.5 *... | igomezvREPO_NAMEsimplemc_testsPATH_START.@simplemc_tests_extracted@simplemc_tests-main@simplemc@analyzers@emcee@tests@integration@test_proposal.py@.PATH_END.py |
{
"filename": "_familysrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter3d/hoverlabel/font/_familysrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="familysrc", parent_name="scatter3d.hoverlabel.font", **kwargs
):
super(FamilysrcValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter3d@hoverlabel@font@_familysrc.py@.PATH_END.py |
{
"filename": "colormaps.py",
"repo_name": "orlox/mesa_input_data",
"repo_path": "mesa_input_data_extracted/mesa_input_data-master/2016_ULX/scripts/NSBH/colormaps.py",
"type": "Python"
} | # New matplotlib colormaps by Nathaniel J. Smith, Stefan van der Walt,
# and (in the case of viridis) Eric Firing.
#
# This file and the colormaps in it are released under the CC0 license /
# public domain dedication. We would appreciate credit if you use or
# redistribute these colormaps, but do not impose any legal r... | orloxREPO_NAMEmesa_input_dataPATH_START.@mesa_input_data_extracted@mesa_input_data-master@2016_ULX@scripts@NSBH@colormaps.py@.PATH_END.py |
{
"filename": "exceptions.py",
"repo_name": "stub42/pytz",
"repo_path": "pytz_extracted/pytz-master/src/pytz/exceptions.py",
"type": "Python"
} | '''
Custom exceptions raised by pytz.
'''
__all__ = [
'UnknownTimeZoneError', 'InvalidTimeError', 'AmbiguousTimeError',
'NonExistentTimeError',
]
class Error(Exception):
'''Base class for all exceptions raised by the pytz library'''
class UnknownTimeZoneError(KeyError, Error):
'''Exception raised w... | stub42REPO_NAMEpytzPATH_START.@pytz_extracted@pytz-master@src@pytz@exceptions.py@.PATH_END.py |
{
"filename": "RHT_example_workflow-checkpoint.ipynb",
"repo_name": "seclark/RHT",
"repo_path": "RHT_extracted/RHT-master/.ipynb_checkpoints/RHT_example_workflow-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | # RHT example workflow
### by S. E. Clark
Imports. Note we are importing `rht` and `RHT_tools` from this repo.
```python
from astropy.io import fits
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import rht, RHT_tools
%matplotlib inline
```
File "/Users/jegpeek/Repositories/RHT-fork/rh... | seclarkREPO_NAMERHTPATH_START.@RHT_extracted@RHT-master@.ipynb_checkpoints@RHT_example_workflow-checkpoint.ipynb@.PATH_END.py |
{
"filename": "test_ephemeris_functions.py",
"repo_name": "spacetelescope/mirage",
"repo_path": "mirage_extracted/mirage-master/tests/test_ephemeris_functions.py",
"type": "Python"
} | """Unit tests for working with ephemeris files
Authors
-------
- Bryan Hilbert
Use
---
Ensure you have pytest installed. Then, simply run pytest in any
parent directory of mirage/tests/:
>>> pytest
"""
import datetime
import numpy as np
import os
import pkg_resources
from mirage.seed_image import ep... | spacetelescopeREPO_NAMEmiragePATH_START.@mirage_extracted@mirage-master@tests@test_ephemeris_functions.py@.PATH_END.py |
{
"filename": "mri.py",
"repo_name": "hmuellergoe/mrbeam",
"repo_path": "mrbeam_extracted/mrbeam-main/mr_beam/itreg/examples/mri.py",
"type": "Python"
} | import logging
import matplotlib.colorbar as cbar
import matplotlib.pyplot as plt
import numpy as np
import regpy.stoprules as rules
import regpy.util as util
from regpy.operators.mri import cartesian_sampling, normalize, parallel_mri, sobolev_smoother
from regpy.solvers import HilbertSpaceSetting
from regpy.solvers.... | hmuellergoeREPO_NAMEmrbeamPATH_START.@mrbeam_extracted@mrbeam-main@mr_beam@itreg@examples@mri.py@.PATH_END.py |
{
"filename": "adamw.py",
"repo_name": "neuraloperator/neuraloperator",
"repo_path": "neuraloperator_extracted/neuraloperator-main/neuralop/training/adamw.py",
"type": "Python"
} | # copy dependencies from transformers/optimization.py
import math
import warnings
from typing import Callable, Iterable, Tuple, Union, List
import torch
from torch import nn
from torch.optim import Optimizer
class AdamW(Optimizer):
"""
Implements Adam algorithm with weight decay fix as introduced in [Decoupl... | neuraloperatorREPO_NAMEneuraloperatorPATH_START.@neuraloperator_extracted@neuraloperator-main@neuralop@training@adamw.py@.PATH_END.py |
{
"filename": "_style.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatter/marker/colorbar/tickfont/_style.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class StyleValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="style",
parent_name="scatter.marker.colorbar.tickfont",
**kwargs,
):
super(StyleValidator, self).__init__(
plotly_nam... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatter@marker@colorbar@tickfont@_style.py@.PATH_END.py |
{
"filename": "test_ipac_definitions.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/astropy/io/ascii/tests/test_ipac_definitions.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
from io import StringIO
import pytest
from astropy.io import ascii
from astropy.io.ascii.core import masked
from astropy.io.ascii.ipac import IpacFormatError, IpacFormatErrorDBMS
from astropy.io.ascii.ui import read
from astropy.table import C... | astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@io@ascii@tests@test_ipac_definitions.py@.PATH_END.py |
{
"filename": "table.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/matplotlib/table.py",
"type": "Python"
} | """
Place a table below the x-axis at location loc.
The table consists of a grid of cells.
The grid need not be rectangular and can have holes.
Cells are added by specifying their row and column.
For the purposes of positioning the cell at (0, 0) is
assumed to be at the top left and the cell at (max_row, max_col)
i... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@matplotlib@table.py@.PATH_END.py |
{
"filename": "hypothesis_temporary_module_82e1c2937352cf71000bc2b6f36cb4cd01864ccd.py",
"repo_name": "ryanvarley/exodata",
"repo_path": "exodata_extracted/exodata-master/exodata/tests/.hypothesis/eval_source/hypothesis_temporary_module_82e1c2937352cf71000bc2b6f36cb4cd01864ccd.py",
"type": "Python"
} | from hypothesis.utils.conventions import not_set
def accept(f):
def test_can_derive_other_vars_from_one_calculated(self, A, T_s=not_set, R_s=not_set, a=not_set, epsilon=not_set):
return f(self=self, A=A, T_s=T_s, R_s=R_s, a=a, epsilon=epsilon)
return test_can_derive_other_vars_from_one_calculated
| ryanvarleyREPO_NAMEexodataPATH_START.@exodata_extracted@exodata-master@exodata@tests@.hypothesis@eval_source@hypothesis_temporary_module_82e1c2937352cf71000bc2b6f36cb4cd01864ccd.py@.PATH_END.py |
{
"filename": "quantile_regression.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/examples/python/quantile_regression.py",
"type": "Python"
} | #!/usr/bin/env python
# DO NOT EDIT
# Autogenerated from the notebook quantile_regression.ipynb.
# Edit the notebook and then sync the output with this file.
#
# flake8: noqa
# DO NOT EDIT
# # Quantile regression
#
# This example page shows how to use ``statsmodels``' ``QuantReg`` class
# to replicate parts of the a... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@examples@python@quantile_regression.py@.PATH_END.py |
{
"filename": "transitmodel.py",
"repo_name": "KathrynJones1/catwoman",
"repo_path": "catwoman_extracted/catwoman-master/catwoman/transitmodel.py",
"type": "Python"
} | # catwoman: a batman extension to generate morning/evening terminator transit lightcurves
# Copyright (C) 2019 Kathryn Jones & Néstor Espinoza
#
# This program incorporates a modified version of the batman package: fast computation of exoplanet transit light curves
# Copyright (C) 2015 Laura Kreidberg
#
# This program... | KathrynJones1REPO_NAMEcatwomanPATH_START.@catwoman_extracted@catwoman-master@catwoman@transitmodel.py@.PATH_END.py |
{
"filename": "test_xml.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/astropy/utils/tests/test_xml.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import io
import pytest
from ..xml import check, unescaper, writer
from ...extern import six
def test_writer():
fh = io.StringIO()
w =... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@utils@tests@test_xml.py@.PATH_END.py |
{
"filename": "n2hp.py",
"repo_name": "vlas-sokolov/pyspecnest",
"repo_path": "pyspecnest_extracted/pyspecnest-master/pyspecnest/n2hp.py",
"type": "Python"
} | import os
import numpy as np
from .multiwrapper import Parameter, ModelContainer
# TODO: generalize it with the parameter names already present in pyspeckit!
def get_n2hp_model(sp, std_noise, priors=None, npeaks=1, **kwargs):
# initializing the model parameters
if priors is None:
# set up dummy priors... | vlas-sokolovREPO_NAMEpyspecnestPATH_START.@pyspecnest_extracted@pyspecnest-master@pyspecnest@n2hp.py@.PATH_END.py |
{
"filename": "More_Advanced_Thermal_Emission.ipynb",
"repo_name": "jzuhone/pyxsim",
"repo_path": "pyxsim_extracted/pyxsim-main/doc/source/cookbook/More_Advanced_Thermal_Emission.ipynb",
"type": "Jupyter Notebook"
} | # More Advanced Thermal Emission
In this example, we'll look at the emission from a disk galaxy from the Illustris TNG simulations.
This dataset has metallicity information for several species in it. We'll make a cut in phase space like we did in the previous example. The dataset we want to use for this example is ava... | jzuhoneREPO_NAMEpyxsimPATH_START.@pyxsim_extracted@pyxsim-main@doc@source@cookbook@More_Advanced_Thermal_Emission.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattercarpet/hoverlabel/font/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._weightsrc import WeightsrcValidator
from ._weight import WeightValidator
from ._variantsrc import VariantsrcValidator
from ._variant import VariantValidator
from ._textcasesrc import TextcasesrcValidat... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattercarpet@hoverlabel@font@__init__.py@.PATH_END.py |
{
"filename": "_stackgaps.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter/_stackgaps.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class StackgapsValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="stackgaps", parent_name="scatter", **kwargs):
super(StackgapsValidator, 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@scatter@_stackgaps.py@.PATH_END.py |
{
"filename": "test_variance.py",
"repo_name": "gmbrandt/xwavecal",
"repo_path": "xwavecal_extracted/xwavecal-main/xwavecal/tests/test_variance.py",
"type": "Python"
} | import numpy as np
from xwavecal.tests.utils import FakeImage, FakeContext
from xwavecal.variance import CalcInverseVariance
class TestCalcInverseVariance:
def test_calc_zero_rdnoise(self):
image = FakeImage()
image.header = {'read_noise': 0}
image.data = np.random.random((10, 10)) * 100
... | gmbrandtREPO_NAMExwavecalPATH_START.@xwavecal_extracted@xwavecal-main@xwavecal@tests@test_variance.py@.PATH_END.py |
{
"filename": "tfsa-2021-038.md",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/security/advisory/tfsa-2021-038.md",
"type": "Markdown"
} | ## TFSA-2021-038: Division by 0 in `FractionalAvgPool`
### CVE Number
CVE-2021-29550
### Impact
An attacker can cause a runtime division by zero error and denial of service in
`tf.raw_ops.FractionalAvgPool`:
```python
import tensorflow as tf
value = tf.constant([60], shape=[1, 1, 1, 1], dtype=tf.int32)
pooling_rati... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@security@advisory@tfsa-2021-038.md@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/contourcarpet/colorbar/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._yref import YrefValidator
from ._ypad import YpadValidator
from ._yanchor import YanchorValidator
from ._y import YValidator
from ._xref import XrefValidator
from ._xpad import XpadValidator
fr... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@contourcarpet@colorbar@__init__.py@.PATH_END.py |
{
"filename": "_linepositionsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/densitymap/hoverlabel/font/_linepositionsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LinepositionsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="linepositionsrc",
parent_name="densitymap.hoverlabel.font",
**kwargs,
):
super(LinepositionsrcValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@densitymap@hoverlabel@font@_linepositionsrc.py@.PATH_END.py |
{
"filename": "binned.py",
"repo_name": "vislearn/FrEIA",
"repo_path": "FrEIA_extracted/FrEIA-master/FrEIA/modules/splines/binned.py",
"type": "Python"
} | from typing import Dict, List, Tuple, Union
import numpy as np
import torch
import torch.nn.functional as F
from itertools import chain
from FrEIA.modules.coupling_layers import _BaseCouplingBlock
from FrEIA.modules.base import InvertibleModule
from FrEIA import utils
class BinnedSpline(_BaseCouplingBlock):
def... | vislearnREPO_NAMEFrEIAPATH_START.@FrEIA_extracted@FrEIA-master@FrEIA@modules@splines@binned.py@.PATH_END.py |
{
"filename": "ah_bootstrap.py",
"repo_name": "D-arioSpace/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/ah_bootstrap.py",
"type": "Python"
} | """
This bootstrap module contains code for ensuring that the astropy_helpers
package will be importable by the time the setup.py script runs. It also
includes some workarounds to ensure that a recent-enough version of setuptools
is being used for the installation.
This module should be the first thing imported in th... | D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@ah_bootstrap.py@.PATH_END.py |
{
"filename": "unit_normalization_test.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/layers/normalization/unit_normalization_test.py",
"type": "Python"
} | import numpy as np
import pytest
from keras.src import backend
from keras.src import layers
from keras.src import testing
def squared_l2_norm(x):
x = backend.convert_to_numpy(x)
return np.sum(x**2)
class UnitNormalizationTest(testing.TestCase):
@pytest.mark.requires_trainable_backend
def test_un_ba... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@layers@normalization@unit_normalization_test.py@.PATH_END.py |
{
"filename": "Spectrum.py",
"repo_name": "chianti-atomic/ChiantiPy",
"repo_path": "ChiantiPy_extracted/ChiantiPy-master/ChiantiPy/core/Spectrum.py",
"type": "Python"
} | import copy
from datetime import datetime
import numpy as np
import ChiantiPy
import ChiantiPy.tools.data as chdata
import ChiantiPy.tools.constants as const
import ChiantiPy.tools.filters as chfilters
import ChiantiPy.tools.util as util
import ChiantiPy.tools.io as chio
from ChiantiPy.base import ionTrails
from Chian... | chianti-atomicREPO_NAMEChiantiPyPATH_START.@ChiantiPy_extracted@ChiantiPy-master@ChiantiPy@core@Spectrum.py@.PATH_END.py |
{
"filename": "_cheatertype.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/carpet/baxis/_cheatertype.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CheatertypeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="cheatertype", parent_name="carpet.baxis", **kwargs):
super(CheatertypeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pa... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@carpet@baxis@_cheatertype.py@.PATH_END.py |
{
"filename": "_family.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/histogram2dcontour/contours/labelfont/_family.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="family",
parent_name="histogram2dcontour.contours.labelfont",
**kwargs,
):
super(FamilyValidator, self).__init__(
plotly... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@histogram2dcontour@contours@labelfont@_family.py@.PATH_END.py |
{
"filename": "__main__.py",
"repo_name": "j0r1/GRALE2",
"repo_path": "GRALE2_extracted/GRALE2-master/pygrale/grale/editor/__main__.py",
"type": "Python"
} | import os
import sys
sys.path = [ os.path.dirname(__file__) ] + sys.path
import mainwindow
mainwindow.main()
| j0r1REPO_NAMEGRALE2PATH_START.@GRALE2_extracted@GRALE2-master@pygrale@grale@editor@__main__.py@.PATH_END.py |
{
"filename": "tools_human.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/how_to/tools_human.ipynb",
"type": "Jupyter Notebook"
} | # How to add a human-in-the-loop for tools
There are certain tools that we don't trust a model to execute on its own. One thing we can do in such situations is require human approval before the tool is invoked.
:::info
This how-to guide shows a simple way to add human-in-the-loop for code running in a jupyter notebo... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@how_to@tools_human.ipynb@.PATH_END.py |
{
"filename": "version.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/numpy/version.py",
"type": "Python"
} |
# THIS FILE IS GENERATED FROM NUMPY SETUP.PY
#
# To compare versions robustly, use `numpy.lib.NumpyVersion`
short_version = '1.14.0'
version = '1.14.0'
full_version = '1.14.0'
git_revision = '6914bb41f0fb3c1ba500bae4e7d671da9536786f'
release = True
if not release:
version = full_version
| waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@numpy@version.py@.PATH_END.py |
{
"filename": "debugger_test.py",
"repo_name": "jax-ml/jax",
"repo_path": "jax_extracted/jax-main/tests/debugger_test.py",
"type": "Python"
} | # Copyright 2022 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... | jax-mlREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@tests@debugger_test.py@.PATH_END.py |
{
"filename": "main.py",
"repo_name": "PeterKamphuis/pyFAT-astro",
"repo_path": "pyFAT-astro_extracted/pyFAT-astro-main/pyFAT_astro/main.py",
"type": "Python"
} | # -*- coding: future_fstrings -*-
# This is the python version of FAT
import numpy as np
import os
import psutil
import pyFAT_astro
import pyFAT_astro.Support.support_functions as sf
import pyFAT_astro.Support.read_functions as rf
import sys
import traceback
import warnings
import threading
from datetime import date... | PeterKamphuisREPO_NAMEpyFAT-astroPATH_START.@pyFAT-astro_extracted@pyFAT-astro-main@pyFAT_astro@main.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "spacetelescope/pystortion",
"repo_path": "pystortion_extracted/pystortion-master/setup.py",
"type": "Python"
} | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import glob
import os
import sys
from configparser import ConfigParser
# Get some values from the setup.cfg
conf = ConfigParser()
conf.read(['setup.cfg'])
metadata = dict(conf.items('metadata'))
PACKAGENAME = metadata.get('package... | spacetelescopeREPO_NAMEpystortionPATH_START.@pystortion_extracted@pystortion-master@setup.py@.PATH_END.py |
{
"filename": "TestSampleList.py",
"repo_name": "dokester/BayesicFitting",
"repo_path": "BayesicFitting_extracted/BayesicFitting-master/BayesicFitting/test/TestSampleList.py",
"type": "Python"
} | # run with : python3 -m unittest TestSampleList
import unittest
import numpy as numpy
import sys
from numpy.testing import assert_array_almost_equal as assertAAE
from astropy import units
import math
from BayesicFitting import *
from BayesicFitting import formatter as fmt
__author__ = "Do Kester"
__year__ = 2017
__l... | dokesterREPO_NAMEBayesicFittingPATH_START.@BayesicFitting_extracted@BayesicFitting-master@BayesicFitting@test@TestSampleList.py@.PATH_END.py |
{
"filename": "precalc.py",
"repo_name": "TRASAL/frbpoppy",
"repo_path": "frbpoppy_extracted/frbpoppy-master/frbpoppy/precalc.py",
"type": "Python"
} | """Create a lookup tables for redshift and the NE2001, YMW16 dispersion measure."""
import os
import numpy as np
#import numexpr as ne
import time
import bisect
import sys
from scipy.integrate import quad
from tqdm import tqdm
from joblib import Parallel, delayed
import astropy.units as u
from astropy.cosmology import... | TRASALREPO_NAMEfrbpoppyPATH_START.@frbpoppy_extracted@frbpoppy-master@frbpoppy@precalc.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "astropy/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/skyview/__init__.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy import config as _config
class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astroquery.skyview`.
"""
url = _config.ConfigItem(
'http://skyview.gsfc.nasa.gov/current/cgi/basicform.pl',
'SkyV... | astropyREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@skyview@__init__.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "tardis-sn/tardis",
"repo_path": "tardis_extracted/tardis-main/docs/conf.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
#
# Astropy documentation build configuration file.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this file.
#
# All configurati... | tardis-snREPO_NAMEtardisPATH_START.@tardis_extracted@tardis-main@docs@conf.py@.PATH_END.py |
{
"filename": "data_syn.py",
"repo_name": "quatrope/feets",
"repo_path": "feets_extracted/feets-master/res/paper/reports/experiments/data_syn.py",
"type": "Python"
} | # NORMAL
time_normal = np.arange(10000)
mag_normal = np.random.normal(size=10000)
error_normal = np.random.normal(loc=1, scale =0.008, size=10000)
mag_normal2 = np.random.normal(size=10000)
error_normal2 = np.random.normal(loc=1, scale =0.008, size=10000)
lc_normal = {
"time": time_normal,
"magnitude": mag_no... | quatropeREPO_NAMEfeetsPATH_START.@feets_extracted@feets-master@res@paper@reports@experiments@data_syn.py@.PATH_END.py |
{
"filename": "reciprocal_kprime.py",
"repo_name": "CaymanUnterborn/ExoPlex",
"repo_path": "ExoPlex_extracted/ExoPlex-master/ExoPlex/burnman/eos/reciprocal_kprime.py",
"type": "Python"
} | from __future__ import absolute_import
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences
# Copyright (C) 2012 - 2017 by the BurnMan team, released under the GNU
# GPL v2 or later.
import scipy.optimize as opt
from scipy.special import gamma, gammainc
from ... | CaymanUnterbornREPO_NAMEExoPlexPATH_START.@ExoPlex_extracted@ExoPlex-master@ExoPlex@burnman@eos@reciprocal_kprime.py@.PATH_END.py |
{
"filename": "_outlinecolor.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattergl/marker/colorbar/_outlinecolor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OutlinecolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="outlinecolor",
parent_name="scattergl.marker.colorbar",
**kwargs,
):
super(OutlinecolorValidator, self).__init__(
p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattergl@marker@colorbar@_outlinecolor.py@.PATH_END.py |
{
"filename": "06-Using_a_community_code.ipynb",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/doc/interactive_tutorial/06-Using_a_community_code.ipynb",
"type": "Jupyter Notebook"
} | ```bash
%%bash
# preamble script to check and install AMUSE components if necessary
# required packages for this tutorial:
PACKAGES="mpi4py amuse-framework amuse-bhtree amuse-sse amuse-seba amuse-sphray"
# skip in case a full development install is present
pip show amuse-devel && exit 0
for package in ${PACKAGES}
do
... | amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@doc@interactive_tutorial@06-Using_a_community_code.ipynb@.PATH_END.py |
{
"filename": "mesh_validation.py",
"repo_name": "astertaylor/SAMUS",
"repo_path": "SAMUS_extracted/SAMUS-main/SAMUS/testing/mesh_validation.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 11 17:03:40 2022
@author: astertaylor
This script is created to demonstrate the validity of the use of SAMUS's
meshes. We run twice, once with n=0, the default, and once with n=1, which has
~2x the precision. The outputs demonstrate their equivalence, and thus the
conver... | astertaylorREPO_NAMESAMUSPATH_START.@SAMUS_extracted@SAMUS-main@SAMUS@testing@mesh_validation.py@.PATH_END.py |
{
"filename": "paramnames.py",
"repo_name": "cmbant/getdist",
"repo_path": "getdist_extracted/getdist-master/getdist/paramnames.py",
"type": "Python"
} | import os
import fnmatch
from itertools import chain
def makeList(roots):
"""
Checks if the given parameter is a list.
If not, Creates a list with the parameter as an item in it.
:param roots: The parameter to check
:return: A list containing the parameter.
"""
if isinstance(roots, (list,... | cmbantREPO_NAMEgetdistPATH_START.@getdist_extracted@getdist-master@getdist@paramnames.py@.PATH_END.py |
{
"filename": "cored_steep_ellipsoid.py",
"repo_name": "lenstronomy/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/lenstronomy/LensModel/Profiles/cored_steep_ellipsoid.py",
"type": "Python"
} | __author__ = "sibirrer"
from lenstronomy.LensModel.Profiles.base_profile import LensProfileBase
import numpy as np
from lenstronomy.Util import param_util
from lenstronomy.Util import util
__all__ = [
"CSE",
"CSEMajorAxis",
"CSEMajorAxisSet",
"CSEProductAvg",
"CSEProductAvgSet",
]
class CSE(Lens... | lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@lenstronomy@LensModel@Profiles@cored_steep_ellipsoid.py@.PATH_END.py |
{
"filename": "test_datasets_video_utils.py",
"repo_name": "pytorch/vision",
"repo_path": "vision_extracted/vision-main/test/test_datasets_video_utils.py",
"type": "Python"
} | import pytest
import torch
from common_utils import assert_equal, get_list_of_videos
from torchvision import io
from torchvision.datasets.video_utils import unfold, VideoClips
class TestVideo:
def test_unfold(self):
a = torch.arange(7)
r = unfold(a, 3, 3, 1)
expected = torch.tensor(
... | pytorchREPO_NAMEvisionPATH_START.@vision_extracted@vision-main@test@test_datasets_video_utils.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattersmith/selected/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._textfont import TextfontValidator
from ._marker import MarkerValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattersmith@selected@__init__.py@.PATH_END.py |
{
"filename": "binaryformat.md",
"repo_name": "tigerchenlu98/rebound",
"repo_path": "rebound_extracted/rebound-main/docs/binaryformat.md",
"type": "Markdown"
} | # Binary Format
REBOUND comes with its own binary format.
The binary format allows you to store a current simulation state to a file or to memory.
The binary format is also used when you make a copy of a simulation or when you compare two simulations with each other.
The Simulationarchive is an extension of the binary... | tigerchenlu98REPO_NAMEreboundPATH_START.@rebound_extracted@rebound-main@docs@binaryformat.md@.PATH_END.py |
{
"filename": "_values.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/xaxis/rangebreak/_values.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ValuesValidator(_plotly_utils.basevalidators.InfoArrayValidator):
def __init__(
self, plotly_name="values", parent_name="layout.xaxis.rangebreak", **kwargs
):
super(ValuesValidator, self).__init__(
plotly_name=plotly_name,
paren... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@xaxis@rangebreak@_values.py@.PATH_END.py |
{
"filename": "_color.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatterpolargl/unselected/marker/_color.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="color",
parent_name="scatterpolargl.unselected.marker",
**kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plot... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatterpolargl@unselected@marker@_color.py@.PATH_END.py |
{
"filename": "_end.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/contourcarpet/contours/_end.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class EndValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="end", parent_name="contourcarpet.contours", **kwargs
):
super(EndValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@contourcarpet@contours@_end.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/astropy/io/votable/validator/__init__.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .main import make_validation_report
from . import main
__doc__ = main.__doc__
del main
| waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@astropy@io@votable@validator@__init__.py@.PATH_END.py |
{
"filename": "test_plane_parallel_fft.py",
"repo_name": "cosmodesi/pyrecon",
"repo_path": "pyrecon_extracted/pyrecon-main/pyrecon/tests/test_plane_parallel_fft.py",
"type": "Python"
} | import numpy as np
from pyrecon import PlaneParallelFFTReconstruction
from pyrecon.utils import MemoryMonitor
from utils import get_random_catalog, Catalog
def test_dtype():
data = get_random_catalog(seed=42)
randoms = get_random_catalog(seed=81)
for los in ['x']:
recon_f4 = PlaneParallelFFTRecon... | cosmodesiREPO_NAMEpyreconPATH_START.@pyrecon_extracted@pyrecon-main@pyrecon@tests@test_plane_parallel_fft.py@.PATH_END.py |
{
"filename": "zero_padding2d_test.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/layers/reshaping/zero_padding2d_test.py",
"type": "Python"
} | import numpy as np
from absl.testing import parameterized
from keras.src import backend
from keras.src import dtype_policies
from keras.src import layers
from keras.src import testing
class ZeroPadding2DTest(testing.TestCase):
@parameterized.parameters(
{"data_format": "channels_first"},
{"data_f... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@layers@reshaping@zero_padding2d_test.py@.PATH_END.py |
{
"filename": "johnsnowlabs.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/langchain/embeddings/johnsnowlabs.py",
"type": "Python"
} | from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.embeddings import JohnSnowLabsEmbeddings
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional impor... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@langchain@embeddings@johnsnowlabs.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.