metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "_customdata.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/splom/_customdata.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CustomdataValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="customdata", parent_name="splom", **kwargs):
super(CustomdataValidator, 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@splom@_customdata.py@.PATH_END.py |
{
"filename": "wodenpy_uvfits.py",
"repo_name": "JLBLine/WODEN",
"repo_path": "WODEN_extracted/WODEN-master/wodenpy/uvfits/wodenpy_uvfits.py",
"type": "Python"
} | from astropy.io import fits
import numpy as np
from wodenpy.observational.calc_obs import calc_jdcal
from erfa import gd2gc
import warnings
import sys
from copy import deepcopy
##Constants
R2D = 180.0 / np.pi
D2R = np.pi / 180.0
SOLAR2SIDEREAL = 1.00274
def RTS_encode_baseline(b1, b2):
"""The ancient aips/miriad... | JLBLineREPO_NAMEWODENPATH_START.@WODEN_extracted@WODEN-master@wodenpy@uvfits@wodenpy_uvfits.py@.PATH_END.py |
{
"filename": "test_hessian_update_strategy.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py2/scipy/optimize/tests/test_hessian_update_strategy.py",
"type": "Python"
} | from __future__ import division, print_function, absolute_import
import numpy as np
from copy import deepcopy
from numpy.linalg import norm
from numpy.testing import (TestCase, assert_array_almost_equal,
assert_array_equal, assert_array_less,
assert_raises, assert_e... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py2@scipy@optimize@tests@test_hessian_update_strategy.py@.PATH_END.py |
{
"filename": "tool_choice.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/how_to/tool_choice.ipynb",
"type": "Jupyter Notebook"
} | # How to force models to call a tool
:::info Prerequisites
This guide assumes familiarity with the following concepts:
- [Chat models](/docs/concepts/chat_models)
- [LangChain Tools](/docs/concepts/tools)
- [How to use a model to call tools](/docs/how_to/tool_calling)
:::
In order to force our LLM to select a specif... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@how_to@tool_choice.ipynb@.PATH_END.py |
{
"filename": "CodeGen.py",
"repo_name": "mattkjames7/libinternalfield",
"repo_path": "libinternalfield_extracted/libinternalfield-main/src/CodeGen.py",
"type": "Python"
} | import numpy as np
import os
import platform
def ProcessIGRF():
'''
Read the IGRF coefficient file and split it into one for each 5
year period
data are from:
https://www.ngdc.noaa.gov/IAGA/vmod/coeffs/igrf13coeffs.txt
'''
print('Reading IGRF coefficients')
f = open('igrf/igrf13coeffs.txt','r')
lines = f.... | mattkjames7REPO_NAMElibinternalfieldPATH_START.@libinternalfield_extracted@libinternalfield-main@src@CodeGen.py@.PATH_END.py |
{
"filename": "_textsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/funnelarea/_textsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="textsrc", parent_name="funnelarea", **kwargs):
super(TextsrcValidator, 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@funnelarea@_textsrc.py@.PATH_END.py |
{
"filename": "slice.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/lite/testing/op_tests/slice.py",
"type": "Python"
} | # Copyright 2019 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@lite@testing@op_tests@slice.py@.PATH_END.py |
{
"filename": "test_posthocs.py",
"repo_name": "maximtrp/scikit-posthocs",
"repo_path": "scikit-posthocs_extracted/scikit-posthocs-master/tests/test_posthocs.py",
"type": "Python"
} | import os
import sys
import unittest
import matplotlib as mpl
import scikit_posthocs._posthocs as sp
import scikit_posthocs._omnibus as som
import scikit_posthocs._outliers as so
import scikit_posthocs._plotting as splt
import scikit_posthocs._global as spg
import seaborn as sb
import numpy as np
import matplotlib.axes... | maximtrpREPO_NAMEscikit-posthocsPATH_START.@scikit-posthocs_extracted@scikit-posthocs-master@tests@test_posthocs.py@.PATH_END.py |
{
"filename": "schmidtlaw_test.py",
"repo_name": "pynbody/pynbody",
"repo_path": "pynbody_extracted/pynbody-master/tests/schmidtlaw_test.py",
"type": "Python"
} | import numpy as np
import numpy.testing as npt
import pytest
import pynbody
from pynbody.plot.stars import schmidtlaw
from pynbody.test_utils.make_disc import make_disc
# These should give identical surface densities if we count all stars.
def test_full_disc():
s = make_disc()
pg, ps = schmidtlaw(s, pretime=... | pynbodyREPO_NAMEpynbodyPATH_START.@pynbody_extracted@pynbody-master@tests@schmidtlaw_test.py@.PATH_END.py |
{
"filename": "page_navigation.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/bindings/page_navigation.py",
"type": "Python"
} | """
Key bindings for extra page navigation: bindings for up/down scrolling through
long pages, like in Emacs or Vi.
"""
from __future__ import annotations
from prompt_toolkit.filters import buffer_has_focus, emacs_mode, vi_mode
from prompt_toolkit.key_binding.key_bindings import (
ConditionalKeyBindings,
KeyB... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@prompt-toolkit@py3@prompt_toolkit@key_binding@bindings@page_navigation.py@.PATH_END.py |
{
"filename": "main.py",
"repo_name": "cdslaborg/paramonte",
"repo_path": "paramonte_extracted/paramonte-main/example/fortran/pm_distPower/getPowerLogPDFNF/main.py",
"type": "Python"
} | #!/usr/bin/env python
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import glob
import sys
fontsize = 17
marker ={ "CK" : "-"
, "IK" : "."
, "RK" : "-"
}
xlab = { "CK" : r"$\alpha$ ( real/imaginary )"
, "IK" : r"$\alpha$ ( integer-valued )"
, "RK" : r... | cdslaborgREPO_NAMEparamontePATH_START.@paramonte_extracted@paramonte-main@example@fortran@pm_distPower@getPowerLogPDFNF@main.py@.PATH_END.py |
{
"filename": "self_cal.py",
"repo_name": "achael/eht-imaging",
"repo_path": "eht-imaging_extracted/eht-imaging-main/ehtim/calibrating/self_cal.py",
"type": "Python"
} | # selfcal.py
# functions for self-calibration
#
# Copyright (C) 2018 Andrew Chael
#
# 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 ... | achaelREPO_NAMEeht-imagingPATH_START.@eht-imaging_extracted@eht-imaging-main@ehtim@calibrating@self_cal.py@.PATH_END.py |
{
"filename": "nested_sampling.py",
"repo_name": "MNGuenther/allesfitter",
"repo_path": "allesfitter_extracted/allesfitter-master/allesfitter/nested_sampling.py",
"type": "Python"
} | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 5 01:05:28 2018
@author:
Dr. Maximilian N. Günther
European Space Agency (ESA)
European Space Research and Technology Centre (ESTEC)
Keplerlaan 1, 2201 AZ Noordwijk, The Netherlands
Email: maximilian.guenther@esa.int
GitHub: mnguenther
Twitter: m_n... | MNGuentherREPO_NAMEallesfitterPATH_START.@allesfitter_extracted@allesfitter-master@allesfitter@nested_sampling.py@.PATH_END.py |
{
"filename": "tzscale.py",
"repo_name": "fraserw/TRIPPy",
"repo_path": "TRIPPy_extracted/TRIPPy-master/trippy/tzscale.py",
"type": "Python"
} | from __future__ import division # confidence high
import math
import numpy
MAX_REJECT = 0.5
MIN_NPIXELS = 5
GOOD_PIXEL = 0
BAD_PIXEL = 1
KREJ = 2.5
MAX_ITERATIONS = 5
def zscale (image, nsamples=1000, contrast=0.25, bpmask=None, zmask=None):
"""Implement IRAF zscale algorithm
Parameters
----------
i... | fraserwREPO_NAMETRIPPyPATH_START.@TRIPPy_extracted@TRIPPy-master@trippy@tzscale.py@.PATH_END.py |
{
"filename": "block.py",
"repo_name": "hgrecco/pint",
"repo_path": "pint_extracted/pint-master/pint/delegates/txt_defparser/block.py",
"type": "Python"
} | """
pint.delegates.txt_defparser.block
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Classes for Pint Blocks, which are defined by:
@<block name>
<content>
@end
:copyright: 2022 by Pint Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from... | hgreccoREPO_NAMEpintPATH_START.@pint_extracted@pint-master@pint@delegates@txt_defparser@block.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/scatterternary/textfont/_familysrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="familysrc", parent_name="scatterternary.textfont", **kwargs
):
super(FamilysrcValidator, self).__init__(
plotly_name=plotly_name,
pa... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterternary@textfont@_familysrc.py@.PATH_END.py |
{
"filename": "_colorsrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterternary/textfont/_colorsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="colorsrc", parent_name="scatterternary.textfont", **kwargs
):
super(ColorsrcValidator, self).__init__(
plotly_name=plotly_name,
paren... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterternary@textfont@_colorsrc.py@.PATH_END.py |
{
"filename": "test_pyxsis_add_specutils.ipynb",
"repo_name": "eblur/pyxsis",
"repo_path": "pyxsis_extracted/pyxsis-master/tests/notebooks/test_pyxsis_add_specutils.ipynb",
"type": "Jupyter Notebook"
} | ```python
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
```
```python
import astropy.units as u
from pyxsis import XBinSpectrum, XBkgSpectrum
import pyxsis
```
```python
heg_arf = '../data/17392/heg_-1.arf'
heg_rmf = '../data/17392/heg_-1.rmf'
heg_m1 = XBinSpectrum.load('../data/17392/heg_-... | eblurREPO_NAMEpyxsisPATH_START.@pyxsis_extracted@pyxsis-master@tests@notebooks@test_pyxsis_add_specutils.ipynb@.PATH_END.py |
{
"filename": "_categoryarraysrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/yaxis/_categoryarraysrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CategoryarraysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="categoryarraysrc", parent_name="layout.yaxis", **kwargs
):
super(CategoryarraysrcValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@yaxis@_categoryarraysrc.py@.PATH_END.py |
{
"filename": "fake_simulated_example.py",
"repo_name": "afarahi/PoPE",
"repo_path": "PoPE_extracted/PoPE-master/fake_simulated_example.py",
"type": "Python"
} | import warnings
def fxn():
warnings.warn("deprecated", DeprecationWarning)
def main():
print('START')
with warnings.catch_warnings():
warnings.simplefilter("ignore")
fxn()
import time
from examples import controled_experiment
start_time = time.time()
con... | afarahiREPO_NAMEPoPEPATH_START.@PoPE_extracted@PoPE-master@fake_simulated_example.py@.PATH_END.py |
{
"filename": "_legendgroup.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/shape/_legendgroup.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LegendgroupValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="legendgroup", parent_name="layout.shape", **kwargs):
super(LegendgroupValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@shape@_legendgroup.py@.PATH_END.py |
{
"filename": "plotit.py",
"repo_name": "bolverk/huji-rich",
"repo_path": "huji-rich_extracted/huji-rich-master/tests/newtonian/one_dimensional/riemann_problem_1_lagrangian/plotit.py",
"type": "Python"
} | import pylab
import numpy
import re
import sys
import Tkinter
import glob
pref = re.sub(r'/[^/]*$','',sys.argv[0])
n = len(glob.glob(pref+'/center_list.*.txt'))
if len(sys.argv)>1:
val = int(sys.argv[1])
else:
val = n
x_list = numpy.loadtxt(pref+'/center_list.'+str(val)+'.txt')
d_list = numpy.loadtxt(pref+'... | bolverkREPO_NAMEhuji-richPATH_START.@huji-rich_extracted@huji-rich-master@tests@newtonian@one_dimensional@riemann_problem_1_lagrangian@plotit.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "fchollet/keras",
"repo_path": "keras_extracted/keras-master/keras/api/_tf_keras/__init__.py",
"type": "Python"
} | from keras.api._tf_keras import keras
| fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@api@_tf_keras@__init__.py@.PATH_END.py |
{
"filename": "apero_shape_nirps_he.py",
"repo_name": "njcuk9999/apero-drs",
"repo_path": "apero-drs_extracted/apero-drs-main/apero/recipes/nirps_he/apero_shape_nirps_he.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
apero_shape_nirps_he.py [obs dir] [files]
APERO shape calibration recipe for NIRPS HE
Created on 2019-03-23 at 13:01
@author: cook
"""
from typing import Any, Dict, List, Optional, Tuple, Union
from apero import lang
from apero.base import base
from apero.core impor... | njcuk9999REPO_NAMEapero-drsPATH_START.@apero-drs_extracted@apero-drs-main@apero@recipes@nirps_he@apero_shape_nirps_he.py@.PATH_END.py |
{
"filename": "gui_utils.py",
"repo_name": "BU-hammerTeam/PyHammer",
"repo_path": "PyHammer_extracted/PyHammer-master/gui_utils.py",
"type": "Python"
} | from pyhamimports import *
class MessageBox(QMessageBox):
def __init__(self, parent, text, title = 'PyHammer', buttons = QMessageBox.Ok, details = None, fontFamily = None):
super().__init__(parent)
self.setWindowTitle(title)
self.setText(text)
self.setStandardButtons(buttons)
... | BU-hammerTeamREPO_NAMEPyHammerPATH_START.@PyHammer_extracted@PyHammer-master@gui_utils.py@.PATH_END.py |
{
"filename": "test_objects.py",
"repo_name": "h5py/h5py",
"repo_path": "h5py_extracted/h5py-master/h5py/tests/test_objects.py",
"type": "Python"
} | # This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
from h5py import _objects as o
from .common import ... | h5pyREPO_NAMEh5pyPATH_START.@h5py_extracted@h5py-master@h5py@tests@test_objects.py@.PATH_END.py |
{
"filename": "setup.py",
"repo_name": "triton-inference-server/server",
"repo_path": "server_extracted/server-main/src/python/setup.py",
"type": "Python"
} | #!/usr/bin/env python3
# Copyright 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# n... | triton-inference-serverREPO_NAMEserverPATH_START.@server_extracted@server-main@src@python@setup.py@.PATH_END.py |
{
"filename": "drivers.py",
"repo_name": "simonsobs/socs",
"repo_path": "socs_extracted/socs-main/socs/agents/wiregrid_encoder/drivers.py",
"type": "Python"
} | import calendar
import select
import socket
import struct
import time
from collections import deque
import numpy as np
import txaio
txaio.use_twisted()
# should be consistent with the software on beaglebone
COUNTER_INFO_LENGTH = 100
# header, quad, clock[100], clock_overflow[100], refcount[100], error[100]
COUNTER_P... | simonsobsREPO_NAMEsocsPATH_START.@socs_extracted@socs-main@socs@agents@wiregrid_encoder@drivers.py@.PATH_END.py |
{
"filename": "Galaxy.py",
"repo_name": "TommasoRonconi/galapy",
"repo_path": "galapy_extracted/galapy-main/galapy/Galaxy.py",
"type": "Python"
} | """
Implements galaxy classes wrapping up the interplay between the different components
contribution to the overall emission.
By instantiating an object of class ``GXY`` or derived it is possible to set-up the
different components, compute global and component-specific emission, compute the
derived quantities and mo... | TommasoRonconiREPO_NAMEgalapyPATH_START.@galapy_extracted@galapy-main@galapy@Galaxy.py@.PATH_END.py |
{
"filename": "_cmin.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/mesh3d/_cmin.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CminValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="cmin", parent_name="mesh3d", **kwargs):
super(CminValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_typ... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@mesh3d@_cmin.py@.PATH_END.py |
{
"filename": "Simulate_raw_data_redcal.py",
"repo_name": "Ntsikelelo-Charles/Fringe_rate_filters",
"repo_path": "Fringe_rate_filters_extracted/Fringe_rate_filters-main/Simulate_raw_data_redcal.py",
"type": "Python"
} | #matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import copy
from scipy import stats
from pyuvdata import UVData, UVBeam
import linsolve
import hera_cal as hc
from collections import OrderedDict as odict
from hera_cal.abscal import fill_dict_nans
## run this in Jake! gains
# load the metadata
p... | Ntsikelelo-CharlesREPO_NAMEFringe_rate_filtersPATH_START.@Fringe_rate_filters_extracted@Fringe_rate_filters-main@Simulate_raw_data_redcal.py@.PATH_END.py |
{
"filename": "plots-checkpoint.ipynb",
"repo_name": "orlox/mesa_input_data",
"repo_path": "mesa_input_data_extracted/mesa_input_data-master/sph_import/relax_model/.ipynb_checkpoints/plots-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | ```python
import matplotlib.pyplot as plt
from pylab import *
params = {'backend': 'pdf',
'figure.figsize': [4.3, 3.0],
'font.family':'serif',
'font.size':10,
'font.serif': 'Times Roman',
'axes.titlesize': 'medium',
'axes.labelsize': 'medium',
... | orloxREPO_NAMEmesa_input_dataPATH_START.@mesa_input_data_extracted@mesa_input_data-master@sph_import@relax_model@.ipynb_checkpoints@plots-checkpoint.ipynb@.PATH_END.py |
{
"filename": "python-reference_catboostranker_set_params.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/catboost/docs/en/concepts/python-reference_catboostranker_set_params.md",
"type": "Markdown"
} | {% include [python-reference_catboost_set_params](python-reference_catboost_set_params.md) %}
| catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@catboost@docs@en@concepts@python-reference_catboostranker_set_params.md@.PATH_END.py |
{
"filename": "fitter.py",
"repo_name": "nanograv/PINT",
"repo_path": "PINT_extracted/PINT-master/src/pint/fitter.py",
"type": "Python"
} | """Objects for managing the procedure of fitting models to TOAs.
The objects defined here can be used to set up a fitting problem and carry out
the fit, adjust the model, and repeat the fit as necessary.
The primary objects of interest will be :class:`pint.fitter.WLSFitter` for
basic fitting, :class:`pint.fitter.GLSF... | nanogravREPO_NAMEPINTPATH_START.@PINT_extracted@PINT-master@src@pint@fitter.py@.PATH_END.py |
{
"filename": "stopping.py",
"repo_name": "mikekatz04/Eryn",
"repo_path": "Eryn_extracted/Eryn-main/eryn/utils/stopping.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
from abc import ABC
import numpy as np
class Stopping(ABC, object):
"""Base class for stopping.
Stopping checks are only performed every ``thin_by`` iterations.
"""
@classmethod
def __call__(self, iter, last_sample, sampler):
"""Call update function.
... | mikekatz04REPO_NAMEErynPATH_START.@Eryn_extracted@Eryn-main@eryn@utils@stopping.py@.PATH_END.py |
{
"filename": "transforms.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/lib/matplotlib/transforms.py",
"type": "Python"
} | """
Matplotlib includes a framework for arbitrary geometric transformations that is used to
determine the final position of all elements drawn on the canvas.
Transforms are composed into trees of `TransformNode` objects
whose actual value depends on their children. When the contents of
children change, their parents ... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@lib@matplotlib@transforms.py@.PATH_END.py |
{
"filename": "test_fit_sequential.py",
"repo_name": "rhayes777/PyAutoFit",
"repo_path": "PyAutoFit_extracted/PyAutoFit-main/test_autofit/non_linear/test_fit_sequential.py",
"type": "Python"
} | import os
import warnings
from pathlib import Path
from random import random
import pytest
import autofit as af
from autofit.non_linear.analysis.combined import CombinedResult
class Analysis(af.Analysis):
def log_likelihood_function(self, instance):
return -random()
@pytest.fixture(name="search")
def ... | rhayes777REPO_NAMEPyAutoFitPATH_START.@PyAutoFit_extracted@PyAutoFit-main@test_autofit@non_linear@test_fit_sequential.py@.PATH_END.py |
{
"filename": "_y.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/contour/colorbar/_y.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class YValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="y", parent_name="contour.colorbar", **kwargs):
super(YValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_ty... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@contour@colorbar@_y.py@.PATH_END.py |
{
"filename": "_value.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/scene/yaxis/tickformatstop/_value.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ValueValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="value",
parent_name="layout.scene.yaxis.tickformatstop",
**kwargs,
):
super(ValueValidator, self).__init__(
plotly_name=p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@scene@yaxis@tickformatstop@_value.py@.PATH_END.py |
{
"filename": "test_instrument.py",
"repo_name": "adrijd/beamconv",
"repo_path": "beamconv_extracted/beamconv-master/tests/test_instrument.py",
"type": "Python"
} | import unittest
import numpy as np
import healpy as hp
from beamconv import instrument
from beamconv import Beam
import os
import pickle
import warnings
opj = os.path.join
test_fpu_dir = os.path.abspath(opj(os.path.dirname(__file__),
'test_data', 'test_fpu'))
class TestTools(unitte... | adrijdREPO_NAMEbeamconvPATH_START.@beamconv_extracted@beamconv-master@tests@test_instrument.py@.PATH_END.py |
{
"filename": "onsite.py",
"repo_name": "cta-observatory/cta-lstchain",
"repo_path": "cta-lstchain_extracted/cta-lstchain-main/lstchain/onsite.py",
"type": "Python"
} | from glob import glob
import logging
from pathlib import Path
from enum import Enum, auto
from datetime import datetime
import tempfile
from astropy.time import Time
import pymongo
from .paths import parse_calibration_name
from .io.io import get_resource_path
log = logging.getLogger(__name__)
DEFAULT_BASE_PATH = Pat... | cta-observatoryREPO_NAMEcta-lstchainPATH_START.@cta-lstchain_extracted@cta-lstchain-main@lstchain@onsite.py@.PATH_END.py |
{
"filename": "test_utils.py",
"repo_name": "andycasey/AnniesLasso",
"repo_path": "AnniesLasso_extracted/AnniesLasso-master/thecannon/tests/test_utils.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Unit tests for general utility functions.
"""
import unittest
from .. import utils
class TestShortHash(unittest.TestCase):
def test_different(self):
self.assertNotEqual(utils.short_hash(True), utils.short_hash(False))
def test_hashing(self):
... | andycaseyREPO_NAMEAnniesLassoPATH_START.@AnniesLasso_extracted@AnniesLasso-master@thecannon@tests@test_utils.py@.PATH_END.py |
{
"filename": "_boxgroupgap.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/_boxgroupgap.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BoxgroupgapValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="boxgroupgap", parent_name="layout", **kwargs):
super(BoxgroupgapValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@_boxgroupgap.py@.PATH_END.py |
{
"filename": "_rows.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/grid/_rows.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class RowsValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(self, plotly_name="rows", parent_name="layout.grid", **kwargs):
super(RowsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
ed... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@grid@_rows.py@.PATH_END.py |
{
"filename": "pointsource.py",
"repo_name": "dstndstn/tractor",
"repo_path": "tractor_extracted/tractor-main/tractor/pointsource.py",
"type": "Python"
} | from __future__ import print_function
import numpy as np
from tractor.utils import MultiParams
from tractor.patch import ModelMask
from tractor import ducks
class BasicSource(ducks.Source):
def getPosition(self):
return self.pos
def setPosition(self, position):
self.pos = position
class Si... | dstndstnREPO_NAMEtractorPATH_START.@tractor_extracted@tractor-main@tractor@pointsource.py@.PATH_END.py |
{
"filename": "example_by_mass.py",
"repo_name": "CaymanUnterborn/ExoPlex",
"repo_path": "ExoPlex_extracted/ExoPlex-master/Examples/example_by_mass.py",
"type": "Python"
} |
# This file is part of ExoPlex - a self consistent planet builder
# Copyright (C) 2017 - by the ExoPlex team, released under the GNU
# GPL v2 or later.
import os
import sys
# hack to allow scripts to be placed in subdirectories next to exoplex:
import numpy as np
if not os.path.exists('ExoPlex') and os.path.exists(... | CaymanUnterbornREPO_NAMEExoPlexPATH_START.@ExoPlex_extracted@ExoPlex-master@Examples@example_by_mass.py@.PATH_END.py |
{
"filename": "_scatter.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/_scatter.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ScatterValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="scatter", parent_name="", **kwargs):
super(ScatterValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
dat... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@_scatter.py@.PATH_END.py |
{
"filename": "apero_changelog.py",
"repo_name": "njcuk9999/apero-drs",
"repo_path": "apero-drs_extracted/apero-drs-main/apero/tools/recipes/dev/apero_changelog.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# CODE NAME HERE
# CODE DESCRIPTION HERE
Created on 2019-07-26 at 09:40
@author: cook
"""
import os
import shutil
import apero
from apero import lang
from apero.base import base
from apero.core.core import drs_log
from apero.core.core import drs_misc
from apero.core... | njcuk9999REPO_NAMEapero-drsPATH_START.@apero-drs_extracted@apero-drs-main@apero@tools@recipes@dev@apero_changelog.py@.PATH_END.py |
{
"filename": "_minexponent.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/treemap/marker/colorbar/_minexponent.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MinexponentValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="minexponent", parent_name="treemap.marker.colorbar", **kwargs
):
super(MinexponentValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@treemap@marker@colorbar@_minexponent.py@.PATH_END.py |
{
"filename": "windowfunctions.py",
"repo_name": "IvS-KULeuven/IvSPythonRepository",
"repo_path": "IvSPythonRepository_extracted/IvSPythonRepository-master/timeseries/windowfunctions.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""
Window functions.
A window with a high dynamic range is a window that can distinguish peaks in
a broad range of amplitudes. Usually, this goes together with loss in resolution
and detection power (higher noise).
Example usage: calculate the window function of timeseries, using different
wi... | IvS-KULeuvenREPO_NAMEIvSPythonRepositoryPATH_START.@IvSPythonRepository_extracted@IvSPythonRepository-master@timeseries@windowfunctions.py@.PATH_END.py |
{
"filename": "_symbol.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattercarpet/marker/_symbol.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SymbolValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="symbol", parent_name="scattercarpet.marker", **kwargs
):
super(SymbolValidator, self).__init__(
plotly_name=plotly_name,
parent_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattercarpet@marker@_symbol.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/standard-tests/langchain_tests/unit_tests/__init__.py",
"type": "Python"
} | # ruff: noqa: E402
import pytest
# Rewrite assert statements for test suite so that implementations can
# see the full error message from failed asserts.
# https://docs.pytest.org/en/7.1.x/how-to/writing_plugins.html#assertion-rewriting
modules = [
"chat_models",
"embeddings",
"tools",
]
for module in mod... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@standard-tests@langchain_tests@unit_tests@__init__.py@.PATH_END.py |
{
"filename": "axis3d.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/lib/mpl_toolkits/mplot3d/axis3d.py",
"type": "Python"
} | # axis3d.py, original mplot3d version by John Porter
# Created: 23 Sep 2005
# Parts rewritten by Reinier Heeres <reinier@heeres.eu>
import inspect
import numpy as np
import matplotlib as mpl
from matplotlib import (
_api, artist, lines as mlines, axis as maxis, patches as mpatches,
transforms as mtransforms,... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@lib@mpl_toolkits@mplot3d@axis3d.py@.PATH_END.py |
{
"filename": "_showscale.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/densitymap/_showscale.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowscaleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="showscale", parent_name="densitymap", **kwargs):
super(ShowscaleValidator, 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@densitymap@_showscale.py@.PATH_END.py |
{
"filename": "extraction.py",
"repo_name": "mhardcastle/ddf-pipeline",
"repo_path": "ddf-pipeline_extracted/ddf-pipeline-master/scripts/extraction.py",
"type": "Python"
} | #!/usr/bin/env python
# Manual extraction
from __future__ import print_function
from run_extraction_pipeline import create_ds9_region,do_run_extract
from reprocessing_utils import prepare_field
import sys
from astropy.coordinates import SkyCoord,get_icrs_coordinates
import astropy.units as u
from auxcodes import run... | mhardcastleREPO_NAMEddf-pipelinePATH_START.@ddf-pipeline_extracted@ddf-pipeline-master@scripts@extraction.py@.PATH_END.py |
{
"filename": "README_CANFAR_DOCKER.md",
"repo_name": "OSSOS/SurveySimulator",
"repo_path": "SurveySimulator_extracted/SurveySimulator-master/README_CANFAR_DOCKER.md",
"type": "Markdown"
} | # Building the SurveySimulator image
To run the SSim on CANFAR we need to make a `docker` container. There are `dev` and `deploy` targets in the Makefile.
## Testing/Development build and run
To build a development version of the container that you will run locally to ensure everything is working.
You can also u... | OSSOSREPO_NAMESurveySimulatorPATH_START.@SurveySimulator_extracted@SurveySimulator-master@README_CANFAR_DOCKER.md@.PATH_END.py |
{
"filename": "batch_predict.py",
"repo_name": "yuliang419/AstroNet-Triage",
"repo_path": "AstroNet-Triage_extracted/AstroNet-Triage-master/astronet/batch_predict.py",
"type": "Python"
} | # Copyright 2018 The TensorFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | yuliang419REPO_NAMEAstroNet-TriagePATH_START.@AstroNet-Triage_extracted@AstroNet-Triage-master@astronet@batch_predict.py@.PATH_END.py |
{
"filename": "test_distributions.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/stats/tests/test_distributions.py",
"type": "Python"
} | """
Test functions for stats module
"""
import warnings
import re
import sys
import pickle
from pathlib import Path
import os
import json
import platform
import yatest.common as yc
from numpy.testing import (assert_equal, assert_array_equal,
assert_almost_equal, assert_array_almost_equal,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@stats@tests@test_distributions.py@.PATH_END.py |
{
"filename": "test_outputs.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/yt/frontends/artio/tests/test_outputs.py",
"type": "Python"
} | from numpy.testing import assert_equal
from yt.frontends.artio.api import ARTIODataset
from yt.loaders import load
from yt.testing import (
assert_allclose_units,
requires_file,
units_override_check,
)
from yt.utilities.answer_testing.framework import (
FieldValuesTest,
PixelizedProjectionValuesTes... | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@frontends@artio@tests@test_outputs.py@.PATH_END.py |
{
"filename": "test_block_standards.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/integrations/prefect-email/tests/test_block_standards.py",
"type": "Python"
} | import pytest
from prefect.blocks.core import Block
from prefect.testing.standard_test_suites import BlockStandardTestSuite
from prefect.utilities.dispatch import get_registry_for_type
from prefect.utilities.importtools import to_qualified_name
def find_module_blocks():
blocks = get_registry_for_type(Block)
... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@integrations@prefect-email@tests@test_block_standards.py@.PATH_END.py |
{
"filename": "_outlinewidth.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/parcats/line/colorbar/_outlinewidth.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OutlinewidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="outlinewidth", parent_name="parcats.line.colorbar", **kwargs
):
super(OutlinewidthValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@parcats@line@colorbar@_outlinewidth.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/restricted/boost/dynamic_bitset/README.md",
"type": "Markdown"
} | DynamicBitset, part of collection of the [Boost C++ Libraries](http://github.com/boostorg), is similar to std::bitset however the size is specified at run-time instead of at compile-time.
### License
Distributed under the [Boost Software License, Version 1.0](http://www.boost.org/LICENSE_1_0.txt).
### Properties
* ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@restricted@boost@dynamic_bitset@README.md@.PATH_END.py |
{
"filename": "test_multi_gaussian_ellipse_kappa.py",
"repo_name": "lenstronomy/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_LensModel/test_Profiles/test_multi_gaussian_ellipse_kappa.py",
"type": "Python"
} | __author__ = "xinchzhu"
from lenstronomy.LensModel.Profiles.gaussian_ellipse_kappa import (
GaussianEllipseKappa,
)
from lenstronomy.LensModel.Profiles.multi_gaussian_ellipse_kappa import (
MultiGaussianEllipseKappa,
)
import numpy as np
import numpy.testing as npt
import pytest
class TestGaussianEllipseKa... | lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_LensModel@test_Profiles@test_multi_gaussian_ellipse_kappa.py@.PATH_END.py |
{
"filename": "trace.py",
"repo_name": "tigerchenlu98/rebound",
"repo_path": "rebound_extracted/rebound-main/rebound/integrators/trace.py",
"type": "Python"
} | import ctypes
from ctypes import cast
from .. import clibrebound
from ..simulation import Simulation
from ..particle import Particle
from ..vectors import Vec3dBasic
TRACE_PERI_MODES = {"FULL_BS": 1, "PARTIAL_BS": 0, "FULL_IAS15": 2}
class IntegratorTRACE(ctypes.Structure):
"""
This class is an abstraction o... | tigerchenlu98REPO_NAMEreboundPATH_START.@rebound_extracted@rebound-main@rebound@integrators@trace.py@.PATH_END.py |
{
"filename": "_y.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/volume/caps/_y.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Y(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "volume.caps"
_path_str = "volume.caps.y"
_valid_props = {"fill", "show"}
# fill
# ----
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@volume@caps@_y.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "AWehrhahn/SME",
"repo_path": "SME_extracted/SME-master/src/pysme/__init__.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
__file_ending__ = ".sme"
# Load correct version string
from ._version import get_versions
__version__ = get_versions()["version"]
del get_versions
# Add output to the console
import logging
import colorlog
import tqdm
class TqdmLoggingHandler(logging.Handler):
def __init__(self, level=... | AWehrhahnREPO_NAMESMEPATH_START.@SME_extracted@SME-master@src@pysme@__init__.py@.PATH_END.py |
{
"filename": "basis.py",
"repo_name": "DedalusProject/dedalus",
"repo_path": "dedalus_extracted/dedalus-master/dedalus/core/basis.py",
"type": "Python"
} | """Abstract and built-in classes for spectral bases."""
import numpy as np
from scipy import sparse
from functools import reduce
import inspect
from math import prod
from . import operators
from ..libraries import spin_recombination
from ..tools.array import kron, axslice, apply_matrix, permute_axis
from ..tools.cach... | DedalusProjectREPO_NAMEdedalusPATH_START.@dedalus_extracted@dedalus-master@dedalus@core@basis.py@.PATH_END.py |
{
"filename": "plot_model_galaxy.py",
"repo_name": "ACCarnall/bagpipes",
"repo_path": "bagpipes_extracted/bagpipes-master/bagpipes/plotting/plot_model_galaxy.py",
"type": "Python"
} | from __future__ import print_function, division, absolute_import
import numpy as np
try:
import matplotlib as mpl
import matplotlib.pyplot as plt
except RuntimeError:
pass
from .general import *
from .plot_spectrum import add_spectrum
def plot_model_galaxy(model, show=True):
""" Make a quick plot ... | ACCarnallREPO_NAMEbagpipesPATH_START.@bagpipes_extracted@bagpipes-master@bagpipes@plotting@plot_model_galaxy.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "moble/GWFrames",
"repo_path": "GWFrames_extracted/GWFrames-master/README.md",
"type": "Markdown"
} | | NOTE: This module is no longer maintained. Much of the functionality has been moved to [`scri`](https://github.com/moble/scri) or to [`sxs`](https://github.com/sxs-collaboration/sxs). I'll generally reply to issues, but because of the age of this code and its dependencies (especially SWIG), no further updates to th... | mobleREPO_NAMEGWFramesPATH_START.@GWFrames_extracted@GWFrames-master@README.md@.PATH_END.py |
{
"filename": "make_configs.py",
"repo_name": "andreicuceu/vega",
"repo_path": "vega_extracted/vega-master/bin/make_configs.py",
"type": "Python"
} | import argparse
from vega import BuildConfig
if __name__ == '__main__':
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description='Create config files for vega.')
parser.add_argument('--fit-name', type=str, default='lyalya_lyaly... | andreicuceuREPO_NAMEvegaPATH_START.@vega_extracted@vega-master@bin@make_configs.py@.PATH_END.py |
{
"filename": "test_power_law.py",
"repo_name": "lynx-x-ray-observatory/soxs",
"repo_path": "soxs_extracted/soxs-main/soxs/tests/test_power_law.py",
"type": "Python"
} | import os
import shutil
import tempfile
from numpy.random import RandomState
from soxs.events import write_spectrum
from soxs.instrument import instrument_simulator
from soxs.instrument_registry import make_simple_instrument
from soxs.simput import SimputCatalog, SimputPhotonList
from soxs.spatial import PointSourceM... | lynx-x-ray-observatoryREPO_NAMEsoxsPATH_START.@soxs_extracted@soxs-main@soxs@tests@test_power_law.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/slider/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._yanchor import YanchorValidator
from ._y import YValidator
from ._xanchor import XanchorValidator
from ._x import XValidator
from ._visible import VisibleValidator
from ._transition import Transiti... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@slider@__init__.py@.PATH_END.py |
{
"filename": "langcyrillicmodel.py",
"repo_name": "davidharvey1986/pyRRG",
"repo_path": "pyRRG_extracted/pyRRG-master/unittests/bugFixPyRRG/lib/python3.7/site-packages/pip/_vendor/chardet/langcyrillicmodel.py",
"type": "Python"
} | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | davidharvey1986REPO_NAMEpyRRGPATH_START.@pyRRG_extracted@pyRRG-master@unittests@bugFixPyRRG@lib@python3.7@site-packages@pip@_vendor@chardet@langcyrillicmodel.py@.PATH_END.py |
{
"filename": "_tickwidth.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/funnel/marker/colorbar/_tickwidth.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickwidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="tickwidth", parent_name="funnel.marker.colorbar", **kwargs
):
super(TickwidthValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@funnel@marker@colorbar@_tickwidth.py@.PATH_END.py |
{
"filename": "axes_box_aspect.py",
"repo_name": "matplotlib/matplotlib",
"repo_path": "matplotlib_extracted/matplotlib-main/galleries/examples/subplots_axes_and_figures/axes_box_aspect.py",
"type": "Python"
} | """
===============
Axes box aspect
===============
This demo shows how to set the aspect of an Axes box directly via
`~.Axes.set_box_aspect`. The box aspect is the ratio between Axes height
and Axes width in physical units, independent of the data limits.
This is useful to e.g. produce a square plot, independent of t... | matplotlibREPO_NAMEmatplotlibPATH_START.@matplotlib_extracted@matplotlib-main@galleries@examples@subplots_axes_and_figures@axes_box_aspect.py@.PATH_END.py |
{
"filename": "on-demand-io.ipynb",
"repo_name": "bccp/nbodykit",
"repo_path": "nbodykit_extracted/nbodykit-master/docs/source/catalogs/on-demand-io.ipynb",
"type": "Jupyter Notebook"
} | ```python
from nbodykit.lab import UniformCatalog
cat = UniformCatalog(nbar=100, BoxSize=1.0, seed=42)
```
/home/yfeng1/anaconda3/install/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will ... | bccpREPO_NAMEnbodykitPATH_START.@nbodykit_extracted@nbodykit-master@docs@source@catalogs@on-demand-io.ipynb@.PATH_END.py |
{
"filename": "batching_test.py",
"repo_name": "google/jax",
"repo_path": "jax_extracted/jax-main/tests/batching_test.py",
"type": "Python"
} | # Copyright 2018 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | googleREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@tests@batching_test.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "ARCLab-MIT/kspdg",
"repo_path": "kspdg_extracted/kspdg-main/evaluation/results/README.md",
"type": "Markdown"
} | This directory should be used to store user-generated evaluation results files, although they are not meant to be version controlled within the kspdg library
| ARCLab-MITREPO_NAMEkspdgPATH_START.@kspdg_extracted@kspdg-main@evaluation@results@README.md@.PATH_END.py |
{
"filename": "Universe.py",
"repo_name": "athob/py-ananke",
"repo_path": "py-ananke_extracted/py-ananke-main/src/ananke/Universe.py",
"type": "Python"
} | #!/usr/bin/env python
"""
Contains the Universe class definition
Please note that this module is private. The Universe class is
available in the main ``ananke`` namespace - use that instead.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Dict
from numpy.typing import ArrayLike, NDArray
i... | athobREPO_NAMEpy-anankePATH_START.@py-ananke_extracted@py-ananke-main@src@ananke@Universe.py@.PATH_END.py |
{
"filename": "_thickness.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/icicle/pathbar/_thickness.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ThicknessValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="thickness", parent_name="icicle.pathbar", **kwargs):
super(ThicknessValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@icicle@pathbar@_thickness.py@.PATH_END.py |
{
"filename": "flow_run.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/prefect/runtime/flow_run.py",
"type": "Python"
} | """
Access attributes of the current flow run dynamically.
Note that if a flow run cannot be discovered, all attributes will return empty values.
You can mock the runtime attributes for testing purposes by setting environment variables
prefixed with `PREFECT__RUNTIME__FLOW_RUN`.
Available attributes:
- `id`: the... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@prefect@runtime@flow_run.py@.PATH_END.py |
{
"filename": "load-layer.py",
"repo_name": "legacysurvey/imagine",
"repo_path": "imagine_extracted/imagine-main/load-layer.py",
"type": "Python"
} | from __future__ import print_function
import os
from glob import glob
import numpy as np
from astrometry.util.file import read_file
from legacypipe.survey import LegacySurveyData
def delete_scaled_images(name, new_bricks, bands=None):
from map.views import get_layer
layer = get_layer(name)
modlayer = get_l... | legacysurveyREPO_NAMEimaginePATH_START.@imagine_extracted@imagine-main@load-layer.py@.PATH_END.py |
{
"filename": "_histogram2d.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/template/data/_histogram2d.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class Histogram2DValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="histogram2d", parent_name="layout.template.data", **kwargs
):
super(Histogram2DValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@template@data@_histogram2d.py@.PATH_END.py |
{
"filename": "_textangle.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/funnel/_textangle.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextangleValidator(_plotly_utils.basevalidators.AngleValidator):
def __init__(self, plotly_name="textangle", parent_name="funnel", **kwargs):
super(TextangleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@funnel@_textangle.py@.PATH_END.py |
{
"filename": "Tutorial - Drift - Univariate.ipynb",
"repo_name": "NannyML/nannyml",
"repo_path": "nannyml_extracted/nannyml-main/docs/example_notebooks/Tutorial - Drift - Univariate.ipynb",
"type": "Jupyter Notebook"
} | ```python
import nannyml as nml
from IPython.display import display
reference_df, analysis_df, _ = nml.load_synthetic_car_loan_dataset()
display(reference_df.head())
```
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical... | NannyMLREPO_NAMEnannymlPATH_START.@nannyml_extracted@nannyml-main@docs@example_notebooks@Tutorial - Drift - Univariate.ipynb@.PATH_END.py |
{
"filename": "_smoothing.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scattercarpet/line/_smoothing.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SmoothingValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="smoothing", parent_name="scattercarpet.line", **kwargs
):
super(SmoothingValidator, self).__init__(
plotly_name=plotly_name,
pare... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scattercarpet@line@_smoothing.py@.PATH_END.py |
{
"filename": "readme.md",
"repo_name": "lsst-uk/lasair-lsst",
"repo_path": "lasair-lsst_extracted/lasair-lsst-main/utility/parallel/readme.md",
"type": "Markdown"
} | # Lasair "parallel"
* This system is used for rebuilding object features from light curves.
* It can also be used for other data mining of all the light curves.
The system executes multiple tasks on multiple workers, controlled by a head node that can connect to each worker through SSH. It is built with the "paralle... | lsst-ukREPO_NAMElasair-lsstPATH_START.@lasair-lsst_extracted@lasair-lsst-main@utility@parallel@readme.md@.PATH_END.py |
{
"filename": "VERSION.md",
"repo_name": "cdslaborg/paramonte",
"repo_path": "paramonte_extracted/paramonte-main/src/c/VERSION.md",
"type": "Markdown"
} | 2.0.0
ParaMonte C library version file.
This project uses semantic versioning.
For details, see http://semver.org
| cdslaborgREPO_NAMEparamontePATH_START.@paramonte_extracted@paramonte-main@src@c@VERSION.md@.PATH_END.py |
{
"filename": "exptime-comparison.py",
"repo_name": "dstndstn/tractor",
"repo_path": "tractor_extracted/tractor-main/projects/desi/exptime-comparison.py",
"type": "Python"
} | from __future__ import print_function
import matplotlib
matplotlib.use('Agg')
import pylab as plt
from astrometry.util.plotutils import *
'''
This is a little script to investigate the expected depth of the
z-band images in DECaLS DR1.
Plots sent to decam-obs on 2015-06-09.
'''
from nightlystrategy import *
from as... | dstndstnREPO_NAMEtractorPATH_START.@tractor_extracted@tractor-main@projects@desi@exptime-comparison.py@.PATH_END.py |
{
"filename": "supabase_self_query.ipynb",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/docs/integrations/retrievers/self_query/supabase_self_query.ipynb",
"type": "Jupyter Notebook"
} | # Supabase (Postgres)
>[Supabase](https://supabase.com/docs) is an open-source `Firebase` alternative.
> `Supabase` is built on top of `PostgreSQL`, which offers strong `SQL`
> querying capabilities and enables a simple interface with already-existing tools and frameworks.
>[PostgreSQL](https://en.wikipedia.org/wik... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@docs@integrations@retrievers@self_query@supabase_self_query.ipynb@.PATH_END.py |
{
"filename": "test_cinv_teb.py",
"repo_name": "dhanson/quicklens",
"repo_path": "quicklens_extracted/quicklens-master/examples/cinv/test_cinv_teb.py",
"type": "Python"
} | # quicklens/examples/test_cinv_teb.py
# --
# test script which generates a C^{-1} filtered temperature + polarization CMB map.
#
import numpy as np
import pylab as pl
import quicklens as ql
multigrid = False # use a multigrid preconditioner.
eps_min = 1.e-4
lmax = 3000 ... | dhansonREPO_NAMEquicklensPATH_START.@quicklens_extracted@quicklens-master@examples@cinv@test_cinv_teb.py@.PATH_END.py |
{
"filename": "mathutils.py",
"repo_name": "SBU-COSMOLIKE/CAMBLateDE",
"repo_path": "CAMBLateDE_extracted/CAMBLateDE-main/build/lib/camb/mathutils.py",
"type": "Python"
} | """
This module contains some fast utility functions that are useful in the same contexts as camb. They are entirely
independent of the main camb code.
"""
from ctypes import c_int, c_double, c_bool, POINTER
from .baseconfig import camblib, numpy_1d, numpy_2d, numpy_3d
import numpy as np
_chi2 = camblib.__mathutils_... | SBU-COSMOLIKEREPO_NAMECAMBLateDEPATH_START.@CAMBLateDE_extracted@CAMBLateDE-main@build@lib@camb@mathutils.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "astropy/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/simbad/__init__.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
SIMBAD Query Tool
=================
The SIMBAD query tool creates `TAP ADQL queries
<https://cds.unistra.fr/help/documentation/simbad-more/adql-simbad/>`__ that return VOtable XML
data. This is then parsed into a `~astropy.table.Table` object.
"""
fro... | astropyREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@simbad@__init__.py@.PATH_END.py |
{
"filename": "test_collections.py",
"repo_name": "lightkurve/lightkurve",
"repo_path": "lightkurve_extracted/lightkurve-main/tests/test_collections.py",
"type": "Python"
} | import warnings
import pytest
from astropy import units as u
from astropy.utils.data import get_pkg_data_filename
from astropy.utils.masked import Masked
import matplotlib.pyplot as plt
import numpy as np
from numpy.testing import assert_array_equal
from lightkurve.lightcurve import LightCurve, KeplerLightCurve, Tess... | lightkurveREPO_NAMElightkurvePATH_START.@lightkurve_extracted@lightkurve-main@tests@test_collections.py@.PATH_END.py |
{
"filename": "fullbayes.py",
"repo_name": "sherpa/sherpa",
"repo_path": "sherpa_extracted/sherpa-main/sherpa/astro/sim/fullbayes.py",
"type": "Python"
} | #
# Copyright (C) 2011, 2016, 2017, 2020, 2021, 2023
# Smithsonian Astrophysical Observatory
#
#
# 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 y... | sherpaREPO_NAMEsherpaPATH_START.@sherpa_extracted@sherpa-main@sherpa@astro@sim@fullbayes.py@.PATH_END.py |
{
"filename": "contributing.md",
"repo_name": "ML4GW/aframe",
"repo_path": "aframe_extracted/aframe-main/docs/contributing.md",
"type": "Markdown"
} | Contributing
============
Thanks for taking the time to contribute! While we appreciate all who wish to contribute, at the moment we're prioritizing contributions from IGWN scientists.
Here are some guidelines on how code in this repo should be structured, as well as best practices for making contributions to it.
##... | ML4GWREPO_NAMEaframePATH_START.@aframe_extracted@aframe-main@docs@contributing.md@.PATH_END.py |
{
"filename": "extract.py",
"repo_name": "astrofelipe/tesseract",
"repo_path": "tesseract_extracted/tesseract-master/extract.py",
"type": "Python"
} | from astropy.io import fits
import numpy as np
import argparse
parser = argparse.ArgumentParser(description='Converts TESS official LCs to Juliet format')
parser.add_argument('File', help='Light curve file (.FITS)')
args = parser.parse_args()
filename = args.File
data = fits.getdata(filename)
head = fits.gethe... | astrofelipeREPO_NAMEtesseractPATH_START.@tesseract_extracted@tesseract-master@extract.py@.PATH_END.py |
{
"filename": "utils.py",
"repo_name": "LoganAMorrison/blackthorn",
"repo_path": "blackthorn_extracted/blackthorn-master/old/scripts/utils.py",
"type": "Python"
} | from typing import Dict, Optional
from pathlib import Path
from matplotlib.ticker import LogLocator, NullFormatter
import h5py
PALETTE = {
8: [
"#003f5c",
"#2f4b7c",
"#665191",
"#a05195",
"#d45087",
"#f95d6a",
"#ff7c43",
"#ffa600",
],
7: [
... | LoganAMorrisonREPO_NAMEblackthornPATH_START.@blackthorn_extracted@blackthorn-master@old@scripts@utils.py@.PATH_END.py |
{
"filename": "test_2d.py",
"repo_name": "wdpozzo/raynest",
"repo_path": "raynest_extracted/raynest-main/raynest/tests/test_2d.py",
"type": "Python"
} | import unittest
import numpy as np
import raynest.model
class GaussianModel(raynest.model.Model):
"""
A simple 2 dimensional gaussian
"""
def __init__(self):
pass
names=['x','y']
bounds=[[-10,10],[-10,10]]
analytic_log_Z=0.0 - np.log(bounds[0][1]-bounds[0][0]) - np.log(bounds[1][1]-... | wdpozzoREPO_NAMEraynestPATH_START.@raynest_extracted@raynest-main@raynest@tests@test_2d.py@.PATH_END.py |
{
"filename": "test_visualization.py",
"repo_name": "dmentipl/plonk",
"repo_path": "plonk_extracted/plonk-main/tests/test_visualization.py",
"type": "Python"
} | """Testing visualization."""
from pathlib import Path
import pytest
import plonk
from plonk.utils import visualize
from .data.phantom import adiabatic, dustmixture, dustseparate, mhd
SNAPTYPES = [adiabatic, dustmixture, dustseparate, mhd]
DIR = Path(__file__).parent / 'data/phantom'
AU = plonk.units('au')
@pytes... | dmentiplREPO_NAMEplonkPATH_START.@plonk_extracted@plonk-main@tests@test_visualization.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.