metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "_text.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/choroplethmap/legendgrouptitle/_text.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="text", parent_name="choroplethmap.legendgrouptitle", **kwargs
):
super(TextValidator, self).__init__(
plotly_name=plotly_name,
parent_... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@choroplethmap@legendgrouptitle@_text.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "quatrope/feets",
"repo_path": "feets_extracted/feets-master/doc/source/JSAnimation/__init__.py",
"type": "Python"
} | from .html_writer import HTMLWriter
| quatropeREPO_NAMEfeetsPATH_START.@feets_extracted@feets-master@doc@source@JSAnimation@__init__.py@.PATH_END.py |
{
"filename": "use_everybeam.py",
"repo_name": "JLBLine/WODEN",
"repo_path": "WODEN_extracted/WODEN-master/wodenpy/primary_beam/use_everybeam.py",
"type": "Python"
} | import numpy as np
from astropy.coordinates import ITRS, SkyCoord, AltAz, EarthLocation
from astropy.time import Time, TimeDelta
import astropy.units as u
import argparse
from wodenpy.use_libwoden.create_woden_struct_classes import Woden_Struct_Classes
import erfa
from typing import Union, Tuple
import concurrent.futur... | JLBLineREPO_NAMEWODENPATH_START.@WODEN_extracted@WODEN-master@wodenpy@primary_beam@use_everybeam.py@.PATH_END.py |
{
"filename": "test_sequential.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/langchain/tests/unit_tests/chains/test_sequential.py",
"type": "Python"
} | """Test pipeline functionality."""
from typing import Dict, List, Optional
import pytest
from langchain_core.callbacks.manager import (
AsyncCallbackManagerForChainRun,
CallbackManagerForChainRun,
)
from langchain.chains.base import Chain
from langchain.chains.sequential import SequentialChain, SimpleSequent... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@langchain@tests@unit_tests@chains@test_sequential.py@.PATH_END.py |
{
"filename": "_gridwidth.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/xaxis/minor/_gridwidth.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class GridwidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="gridwidth", parent_name="layout.xaxis.minor", **kwargs
):
super(GridwidthValidator, self).__init__(
plotly_name=plotly_name,
pare... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@xaxis@minor@_gridwidth.py@.PATH_END.py |
{
"filename": "MM_v4.md",
"repo_name": "rpoleski/MulensModel",
"repo_path": "MulensModel_extracted/MulensModel-master/documents/MM_v4.md",
"type": "Markdown"
} | # What we want to change when going from v3.X.Y to v4.0.0?
Once the changes are accepted to be made, **mark them in the code using warnings.warn("XXX", FutureWarning)** and note it here. Also release a version that differs from previous one only in these warnings - this will allow users to correct their codes. Also g... | rpoleskiREPO_NAMEMulensModelPATH_START.@MulensModel_extracted@MulensModel-master@documents@MM_v4.md@.PATH_END.py |
{
"filename": "GLMeshItem.py",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/pyqtgraph/examples/GLMeshItem.py",
"type": "Python"
} | """
Simple examples demonstrating the use of GLMeshItem.
"""
import pyqtgraph as pg
import pyqtgraph.opengl as gl
app = pg.mkQApp("GLMeshItem Example")
w = gl.GLViewWidget()
w.show()
w.setWindowTitle('pyqtgraph example: GLMeshItem')
w.setCameraPosition(distance=40)
g = gl.GLGridItem()
g.scale(2,2,1)
w.addItem(g)
i... | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@pyqtgraph@examples@GLMeshItem.py@.PATH_END.py |
{
"filename": "Example_CNNs.py",
"repo_name": "xpsi-group/xpsi",
"repo_path": "xpsi_extracted/xpsi-main/xpsi/utilities/Example_CNNs.py",
"type": "Python"
} | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision.models import (resnet18, ResNet18_Weights,
resnet34, ResNet34_Weights,
resnet50, ResNet50_Weights,
resnet101, ResNet101_W... | xpsi-groupREPO_NAMExpsiPATH_START.@xpsi_extracted@xpsi-main@xpsi@utilities@Example_CNNs.py@.PATH_END.py |
{
"filename": "calculate_tori_magnetization.py",
"repo_name": "IAS-Astrophysics/athenak",
"repo_path": "athenak_extracted/athenak-main/vis/python/calculate_tori_magnetization.py",
"type": "Python"
} | #! /usr/bin/env python3
"""
Script for calculating average magnetization in an AthenaK GRMHD data dump.
Usage:
[python3] calculate_tori_magnetization.py <input_file> [options]
Example:
~/athenak/vis/python/calculate_tori_magnetization.py basename.prim.00000.bin
<input_file> can be any standard AthenaK .bin data dum... | IAS-AstrophysicsREPO_NAMEathenakPATH_START.@athenak_extracted@athenak-main@vis@python@calculate_tori_magnetization.py@.PATH_END.py |
{
"filename": "_tickformatstops.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/treemap/marker/colorbar/_tickformatstops.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickformatstopsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self,
plotly_name="tickformatstops",
parent_name="treemap.marker.colorbar",
**kwargs,
):
super(TickformatstopsValidator, self).__init__... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@treemap@marker@colorbar@_tickformatstops.py@.PATH_END.py |
{
"filename": "_family.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/contourcarpet/contours/labelfont/_family.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="family",
parent_name="contourcarpet.contours.labelfont",
**kwargs
):
super(FamilyValidator, self).__init__(
plotly_name=... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@contourcarpet@contours@labelfont@_family.py@.PATH_END.py |
{
"filename": "PublicData_10y_ps_wMC.py",
"repo_name": "icecube/skyllh",
"repo_path": "skyllh_extracted/skyllh-master/skyllh/datasets/i3/PublicData_10y_ps_wMC.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Author: Dr. Martin Wolf <mail@martin-wolf.org>
import numpy as np
from skyllh.datasets.i3 import (
PublicData_10y_ps,
)
def create_dataset_collection(
cfg,
base_path=None,
sub_path_fmt=None,
):
"""Defines the dataset collection for IceCube's 10-year
poin... | icecubeREPO_NAMEskyllhPATH_START.@skyllh_extracted@skyllh-master@skyllh@datasets@i3@PublicData_10y_ps_wMC.py@.PATH_END.py |
{
"filename": "phot_datalab.py",
"repo_name": "astro-datalab/nsc",
"repo_path": "nsc_extracted/nsc-master/python/nsc/phot_datalab.py",
"type": "Python"
} | #!/usr/bin/env python
#
# PHOT.PY - SExtractor and DAOPHOT routines
#
from __future__ import print_function
__authors__ = 'David Nidever <dnidever@noao.edu>'
__version__ = '20180823' # yyyymmdd
import os
import sys
import numpy as np
import warnings
from astropy.io import fits
from astropy.wcs import WCS
from astro... | astro-datalabREPO_NAMEnscPATH_START.@nsc_extracted@nsc-master@python@nsc@phot_datalab.py@.PATH_END.py |
{
"filename": "image_classification.py",
"repo_name": "astrolabsoftware/fink-science",
"repo_path": "fink-science_extracted/fink-science-master/fink_science/image_classification/image_classification.py",
"type": "Python"
} | # Copyright 2021 AstroLab Software
# Author: Roman Le Montagner
#
# 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 appli... | astrolabsoftwareREPO_NAMEfink-sciencePATH_START.@fink-science_extracted@fink-science-master@fink_science@image_classification@image_classification.py@.PATH_END.py |
{
"filename": "_valueminus.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatter/error_y/_valueminus.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ValueminusValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="valueminus", parent_name="scatter.error_y", **kwargs
):
super(ValueminusValidator, self).__init__(
plotly_name=plotly_name,
pare... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatter@error_y@_valueminus.py@.PATH_END.py |
{
"filename": "test_scheduler.py",
"repo_name": "panoptes/POCS",
"repo_path": "POCS_extracted/POCS-main/tests/scheduler/test_scheduler.py",
"type": "Python"
} | import pytest
import requests
from panoptes.utils import error
from panoptes.utils.config.client import set_config
from panoptes.pocs.scheduler import create_scheduler_from_config
from panoptes.pocs.scheduler import BaseScheduler
from panoptes.pocs.utils.location import create_location_from_config
from panoptes.utils.... | panoptesREPO_NAMEPOCSPATH_START.@POCS_extracted@POCS-main@tests@scheduler@test_scheduler.py@.PATH_END.py |
{
"filename": "test_reflected_occultations.py",
"repo_name": "rodluger/starry",
"repo_path": "starry_extracted/starry-master/tests/greedy/test_reflected_occultations.py",
"type": "Python"
} | import numpy as np
import starry
import matplotlib.pyplot as plt
from datetime import datetime
import pytest
from scipy.interpolate import interp1d
from tqdm import tqdm
@pytest.mark.parametrize(
"xs,ys,zs,source_npts",
[
[0, 1, 1, 1],
[-1, 0, 1, 1],
[0.5, 1, -0.5, 1],
[-0.5, -... | rodlugerREPO_NAMEstarryPATH_START.@starry_extracted@starry-master@tests@greedy@test_reflected_occultations.py@.PATH_END.py |
{
"filename": "typehinting.py",
"repo_name": "ledatelescope/bifrost",
"repo_path": "bifrost_extracted/bifrost-master/python/typehinting.py",
"type": "Python"
} | import os
# Build a type hinting helper for libbifrost_generated.py
def build_typehinting(filename):
enums = {'status': {},
'space': {},
'dtype': {},
'capture': {},
'io': {},
'whence': {},
'reduce': {}}
with o... | ledatelescopeREPO_NAMEbifrostPATH_START.@bifrost_extracted@bifrost-master@python@typehinting.py@.PATH_END.py |
{
"filename": "_text.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/waterfall/_text.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="text", parent_name="waterfall", **kwargs):
super(TextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
array... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@waterfall@_text.py@.PATH_END.py |
{
"filename": "_tickvalssrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scattergeo/marker/colorbar/_tickvalssrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickvalssrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="tickvalssrc",
parent_name="scattergeo.marker.colorbar",
**kwargs
):
super(TickvalssrcValidator, self).__init__(
plotly... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scattergeo@marker@colorbar@_tickvalssrc.py@.PATH_END.py |
{
"filename": "_legendwidth.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/image/_legendwidth.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LegendwidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="legendwidth", parent_name="image", **kwargs):
super(LegendwidthValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@image@_legendwidth.py@.PATH_END.py |
{
"filename": "InteractiveParameter.py",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/pyqtgraph/examples/InteractiveParameter.py",
"type": "Python"
} | from functools import wraps
import pyqtgraph as pg
from pyqtgraph.Qt import QtWidgets
from pyqtgraph.parametertree import (
Parameter,
ParameterTree,
RunOptions,
InteractiveFunction,
Interactor,
)
app = pg.mkQApp()
class LAST_RESULT:
"""Just for testing purposes"""
value = None
def pr... | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@pyqtgraph@examples@InteractiveParameter.py@.PATH_END.py |
{
"filename": "_hoveron.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/scatterternary/_hoveron.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class HoveronValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(self, plotly_name="hoveron", parent_name="scatterternary", **kwargs):
super(HoveronValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@scatterternary@_hoveron.py@.PATH_END.py |
{
"filename": "test_pyfftw_base.py",
"repo_name": "pyFFTW/pyFFTW",
"repo_path": "pyFFTW_extracted/pyFFTW-master/tests/test_pyfftw_base.py",
"type": "Python"
} | # Copyright 2014 Knowledge Economy Developments Ltd
#
# Henry Gomersall
# heng@kedevelopments.co.uk
#
# 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 reta... | pyFFTWREPO_NAMEpyFFTWPATH_START.@pyFFTW_extracted@pyFFTW-master@tests@test_pyfftw_base.py@.PATH_END.py |
{
"filename": "usage.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/ipython/py3/IPython/core/usage.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
"""Usage information for the main IPython applications.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
# Copyright (C) 2001-2007 Fernando Perez. <fperez@colorado.edu>
#
# Distributed under the terms of... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@ipython@py3@IPython@core@usage.py@.PATH_END.py |
{
"filename": "_shadowsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/icicle/insidetextfont/_shadowsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShadowsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="shadowsrc", parent_name="icicle.insidetextfont", **kwargs
):
super(ShadowsrcValidator, self).__init__(
plotly_name=plotly_name,
pare... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@icicle@insidetextfont@_shadowsrc.py@.PATH_END.py |
{
"filename": "simscan_ground.ipynb",
"repo_name": "hpc4cmb/toast",
"repo_path": "toast_extracted/toast-main/tutorial/02_Simulated_Scan_Strategies/simscan_ground.ipynb",
"type": "Jupyter Notebook"
} | # Ground observing schedules
In this notebook we learn about creating ground observing schedules.
```python
# Load common tools for all lessons
import sys
sys.path.insert(0, "..")
from lesson_tools import (
fake_focalplane
)
# Capture C++ output in the jupyter cells
%reload_ext wurlitzer
```
## First schedule
... | hpc4cmbREPO_NAMEtoastPATH_START.@toast_extracted@toast-main@tutorial@02_Simulated_Scan_Strategies@simscan_ground.ipynb@.PATH_END.py |
{
"filename": "make-pklin.py",
"repo_name": "fastpm/fastpm",
"repo_path": "fastpm_extracted/fastpm-master/python/make-pklin.py",
"type": "Python"
} | from nbodykit.lab import *
from nbodykit.cosmology import WMAP9, LinearPower, Cosmology
import numpy
MYPlanck = Cosmology(m_ncdm=[],
Omega0_b=0.0223/0.6774**2,
Omega0_cdm=0.1188/0.6774**2,
h=0.6774)\
.match(sigma8=0.8159)
pklin0 = LinearPower(MYPlanck, redshi... | fastpmREPO_NAMEfastpmPATH_START.@fastpm_extracted@fastpm-master@python@make-pklin.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/surface/contours/x/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._width import WidthValidator
from ._usecolormap import UsecolormapValidator
from ._start import StartValidator
from ._size import SizeValidator
from ._show import ShowValidator
from ._project import... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@surface@contours@x@__init__.py@.PATH_END.py |
{
"filename": "conf.py",
"repo_name": "spacetelescope/imexam",
"repo_path": "imexam_extracted/imexam-master/docs/conf.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
#
# 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 configuration v... | spacetelescopeREPO_NAMEimexamPATH_START.@imexam_extracted@imexam-master@docs@conf.py@.PATH_END.py |
{
"filename": "approx_topk_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/kernel_tests/math_ops/approx_topk_test.py",
"type": "Python"
} | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@kernel_tests@math_ops@approx_topk_test.py@.PATH_END.py |
{
"filename": "detectors.py",
"repo_name": "scalessim/scalessim",
"repo_path": "scalessim_extracted/scalessim-main/scalessim/detectors.py",
"type": "Python"
} | import configparser
from .detector import nghxrg as ng
from .io import read_ini
import os
class Detector:
def __init__(self):
config = configparser.ConfigParser()
config.read('scalessim/detector/h2rg.ini')
self.arg_detector = {}
self.arg_detector.update(read_ini(config['Defined'])... | scalessimREPO_NAMEscalessimPATH_START.@scalessim_extracted@scalessim-main@scalessim@detectors.py@.PATH_END.py |
{
"filename": "redcal_inspect_2458116.ipynb",
"repo_name": "HERA-Team/H1C_IDR3_Notebooks",
"repo_path": "H1C_IDR3_Notebooks-main/redcal_inspect/redcal_inspect_2458116.ipynb",
"type": "Jupyter Notebook"
} | # Stage 2 Redundant Calibration Nightly Notebook
**Josh Dillon**, Last Revised 7/30/20
```python
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from hera_cal import io, redcal, apply_cal
from hera_qm.metrics_io import load_metric_file
import glob
import os
from copy import deepcopy
import inspe... | HERA-TeamREPO_NAMEH1C_IDR3_NotebooksPATH_START.@H1C_IDR3_Notebooks-main@redcal_inspect@redcal_inspect_2458116.ipynb@.PATH_END.py |
{
"filename": "six.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/SpArcFiRe-pyvenv/lib/python2.7/site-packages/pip/vendor/six.py",
"type": "Python"
} | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2013 Benjamin Peterson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including with... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@SpArcFiRe-pyvenv@lib@python2.7@site-packages@pip@vendor@six.py@.PATH_END.py |
{
"filename": "mock_backend.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/fft/tests/mock_backend.py",
"type": "Python"
} | import numpy as np
import scipy.fft
import threading
class _MockFunction:
def __init__(self, return_value = None):
self.number_calls = threading.local()
self.return_value = return_value
self.last_args = threading.local()
def __call__(self, *args, **kwargs):
if not hasattr(self.... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@fft@tests@mock_backend.py@.PATH_END.py |
{
"filename": "planner.py",
"repo_name": "franpoz/SHERLOCK",
"repo_path": "SHERLOCK_extracted/SHERLOCK-master/sherlockpipe/observation_plan/planner.py",
"type": "Python"
} | """The classes to run the plan task"""
import logging
from multiprocessing import Pool
from astroplan import moon_illumination, Constraint
import os
import shutil
import astroplan
import matplotlib
from astroplan.plots import plot_airmass
from astropy.coordinates import SkyCoord, get_body
import astropy.units as u
fro... | franpozREPO_NAMESHERLOCKPATH_START.@SHERLOCK_extracted@SHERLOCK-master@sherlockpipe@observation_plan@planner.py@.PATH_END.py |
{
"filename": "test_LSST.py",
"repo_name": "lenstronomy/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/test/test_SimulationAPI/test_ObservationConfig/test_LSST.py",
"type": "Python"
} | import unittest
from lenstronomy.SimulationAPI.ObservationConfig.LSST import LSST
from lenstronomy.SimulationAPI.observation_api import Instrument, SingleBand
import lenstronomy.Util.util as util
class TestLSST(unittest.TestCase):
def setUp(self):
self.u = LSST(band="u")
self.g = LSST() # default... | lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@test@test_SimulationAPI@test_ObservationConfig@test_LSST.py@.PATH_END.py |
{
"filename": "test_factor_analysis.py",
"repo_name": "scikit-learn/scikit-learn",
"repo_path": "scikit-learn_extracted/scikit-learn-main/sklearn/decomposition/tests/test_factor_analysis.py",
"type": "Python"
} | # Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
from itertools import combinations
import numpy as np
import pytest
from sklearn.decomposition import FactorAnalysis
from sklearn.decomposition._factor_analysis import _ortho_rotation
from sklearn.exceptions import ConvergenceWarning
from... | scikit-learnREPO_NAMEscikit-learnPATH_START.@scikit-learn_extracted@scikit-learn-main@sklearn@decomposition@tests@test_factor_analysis.py@.PATH_END.py |
{
"filename": "crtaf_H_6.py",
"repo_name": "Goobley/DexRT",
"repo_path": "DexRT_extracted/DexRT-main/tests/crtaf_H_6.py",
"type": "Python"
} | import crtaf
from crtaf.from_lightweaver import LightweaverAtomConverter
from crtaf.core_types import TemperatureInterpolationRateImpl, CERate, CIRate
from lightweaver.rh_atoms import H_6_atom, CaII_atom, H_4_atom
import numpy as np
import astropy.units as u
import astropy.constants as const
h_coll_temperature_grid = ... | GoobleyREPO_NAMEDexRTPATH_START.@DexRT_extracted@DexRT-main@tests@crtaf_H_6.py@.PATH_END.py |
{
"filename": "test_mstats_extras.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/stats/tests/test_mstats_extras.py",
"type": "Python"
} | import numpy as np
import numpy.ma as ma
import scipy.stats.mstats as ms
from numpy.testing import (assert_equal, assert_almost_equal, assert_,
assert_allclose)
def test_compare_medians_ms():
x = np.arange(7)
y = x + 10
assert_almost_equal(ms.compare_medians_ms(x, y), 0)
y... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@stats@tests@test_mstats_extras.py@.PATH_END.py |
{
"filename": "model.py",
"repo_name": "triton-inference-server/server",
"repo_path": "server_extracted/server-main/qa/L0_model_config/autofill_noplatform/python/output_wrong_property/model.py",
"type": "Python"
} | # Copyright 2022-2023, 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
# notice, this list o... | triton-inference-serverREPO_NAMEserverPATH_START.@server_extracted@server-main@qa@L0_model_config@autofill_noplatform@python@output_wrong_property@model.py@.PATH_END.py |
{
"filename": "modules.py",
"repo_name": "alibaba/TinyNeuralNetwork",
"repo_path": "TinyNeuralNetwork_extracted/TinyNeuralNetwork-main/tinynn/llm_quant/modules.py",
"type": "Python"
} | import sys
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from transformers.models.llama.modeling_llama import LlamaAttention
from tinynn.llm_quant.llama import LlamaAttentionFused
from tinynn.util.util import get_logger
from .util import _init_patch_easyquant, get_submod... | alibabaREPO_NAMETinyNeuralNetworkPATH_START.@TinyNeuralNetwork_extracted@TinyNeuralNetwork-main@tinynn@llm_quant@modules.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "astrolabsoftware/fink-science",
"repo_path": "fink-science_extracted/fink-science-master/fink_science/anomaly_detection/README.md",
"type": "Markdown"
} | # Anomaly detection module
This module adds new column **anomaly_score** (lower values mean more anomalous observations). It uses 2 pre-trained IsolationForests (1 for each passband) and calculates the score as a mean of their predictions.
| astrolabsoftwareREPO_NAMEfink-sciencePATH_START.@fink-science_extracted@fink-science-master@fink_science@anomaly_detection@README.md@.PATH_END.py |
{
"filename": "afd.py",
"repo_name": "bolverk/huji-rich",
"repo_path": "huji-rich_extracted/huji-rich-master/analytic/afd.py",
"type": "Python"
} | import numpy
import cmath
def sgn(x):
if x==0:
return 0
else:
return x/abs(x)
def single_mode(x,t,k,omega,v,g0,dx,xi):
return cmath.exp(1j*k*x)*g0*dx*xi*\
(cmath.exp(1j*omega*t)-\
(1-(1-cmath.exp(-1j*k*dx))*xi)**(t*v/xi/dx))/\
(v*(-1+cmath.exp(1j*dx*xi*o... | bolverkREPO_NAMEhuji-richPATH_START.@huji-rich_extracted@huji-rich-master@analytic@afd.py@.PATH_END.py |
{
"filename": "coldgas.py",
"repo_name": "ICRAR/shark",
"repo_path": "shark_extracted/shark-master/standard_plots/coldgas.py",
"type": "Python"
} | #
# ICRAR - International Centre for Radio Astronomy Research
# (c) UWA - The University of Western Australia, 2018
# Copyright by UWA (in the framework of the ICRAR)
#
# 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 Fre... | ICRARREPO_NAMEsharkPATH_START.@shark_extracted@shark-master@standard_plots@coldgas.py@.PATH_END.py |
{
"filename": "readme.md",
"repo_name": "AarhusCosmology/connect_public",
"repo_path": "connect_public_extracted/connect_public-main/data/lhc_samples/readme.md",
"type": "Markdown"
} | This is where Latin hypercube seeds are stored in
order to reuse them instead of computing new ones | AarhusCosmologyREPO_NAMEconnect_publicPATH_START.@connect_public_extracted@connect_public-main@data@lhc_samples@readme.md@.PATH_END.py |
{
"filename": "transforms.ipynb",
"repo_name": "dfm/tinygp",
"repo_path": "tinygp_extracted/tinygp-main/docs/tutorials/transforms.ipynb",
"type": "Jupyter Notebook"
} | ```python
try:
import tinygp
except ImportError:
%pip install -q tinygp
try:
import flax
except ImportError:
%pip install -q flax
try:
import optax
except ImportError:
%pip install -q optax
```
(transforms)=
# Kernel Transforms
`tinygp` is designed to make it easy to implement new kernels (... | dfmREPO_NAMEtinygpPATH_START.@tinygp_extracted@tinygp-main@docs@tutorials@transforms.ipynb@.PATH_END.py |
{
"filename": "about_pylbo.md",
"repo_name": "n-claes/legolas",
"repo_path": "legolas_extracted/legolas-master/docs/pylbo/about_pylbo.md",
"type": "Markdown"
} | ---
title: The Python package Pylbo
layout: single
classes: wide
sidebar:
nav: "leftcontents"
last_modified_at: 2021-07-27
---
When Legolas finishes solving the eigenvalue problem it writes all information to a specially
tailored datfile. First a header is written, containing information such as the geometry, chosen ... | n-claesREPO_NAMElegolasPATH_START.@legolas_extracted@legolas-master@docs@pylbo@about_pylbo.md@.PATH_END.py |
{
"filename": "test_join.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/indexes/timedeltas/test_join.py",
"type": "Python"
} | import numpy as np
from pandas import (
DataFrame,
Index,
Timedelta,
timedelta_range,
)
import pandas._testing as tm
class TestJoin:
def test_append_join_nondatetimeindex(self):
rng = timedelta_range("1 days", periods=10)
idx = Index(["a", "b", "c", "d"])
result = rng.app... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@indexes@timedeltas@test_join.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "juliotux/astropop",
"repo_path": "astropop_extracted/astropop-main/astropop/astrometry/__init__.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Process astrometry calibration using several algorithms."""
from .astrometrynet import AstrometryNetUnsolvedField, \
AstrometrySolver, \
AstrometricSolution, \
solve_astro... | juliotuxREPO_NAMEastropopPATH_START.@astropop_extracted@astropop-main@astropop@astrometry@__init__.py@.PATH_END.py |
{
"filename": "convergeT_parker.py",
"repo_name": "dlinssen/sunbather",
"repo_path": "sunbather_extracted/sunbather-main/src/convergeT_parker.py",
"type": "Python"
} | #sunbather imports
import tools
import solveT
#other imports
import pandas as pd
import numpy as np
import multiprocessing
from shutil import copyfile
import time
import os
import re
import argparse
import traceback
def find_close_model(parentfolder, T, Mdot, tolT=2000, tolMdot=1.0):
"""
Takes a parent folde... | dlinssenREPO_NAMEsunbatherPATH_START.@sunbather_extracted@sunbather-main@src@convergeT_parker.py@.PATH_END.py |
{
"filename": "test_vec_check_nan.py",
"repo_name": "DLR-RM/stable-baselines3",
"repo_path": "stable-baselines3_extracted/stable-baselines3-master/tests/test_vec_check_nan.py",
"type": "Python"
} | import gymnasium as gym
import numpy as np
import pytest
from gymnasium import spaces
from stable_baselines3.common.vec_env import DummyVecEnv, VecCheckNan
class NanAndInfEnv(gym.Env):
"""Custom Environment that raised NaNs and Infs"""
metadata = {"render_modes": ["human"]}
def __init__(self):
... | DLR-RMREPO_NAMEstable-baselines3PATH_START.@stable-baselines3_extracted@stable-baselines3-master@tests@test_vec_check_nan.py@.PATH_END.py |
{
"filename": "demo_skyview.py",
"repo_name": "leejjoon/pywcsgrid2",
"repo_path": "pywcsgrid2_extracted/pywcsgrid2-main/examples/demo_skyview.py",
"type": "Python"
} | from astropy.io import fits as pyfits
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from mpl_toolkits.axes_grid1.axes_grid import ImageGrid
#from pywcsgrid2.axes_wcs import GridHelperWcs, AxesWcs
import pywcsgrid2
# read in the first image
xray_name="pspc_skyview.fits"
f_xray = pyfits.open(xray_name)
hea... | leejjoonREPO_NAMEpywcsgrid2PATH_START.@pywcsgrid2_extracted@pywcsgrid2-main@examples@demo_skyview.py@.PATH_END.py |
{
"filename": "sunburst.py",
"repo_name": "1313e/CMasher",
"repo_path": "CMasher_extracted/CMasher-master/src/cmasher/colormaps/sunburst/sunburst.py",
"type": "Python"
} | import matplotlib as mpl
from matplotlib.colors import ListedColormap
# All declaration
__all__ = ["cmap"]
# Author declaration
__author__ = "Ellert van der Velden (@1313e)"
# Package declaration
__package__ = "cmasher"
# %% GLOBALS AND DEFINITIONS
# Type of this colormap
cm_type = "sequential"
# RGB-values of th... | 1313eREPO_NAMECMasherPATH_START.@CMasher_extracted@CMasher-master@src@cmasher@colormaps@sunburst@sunburst.py@.PATH_END.py |
{
"filename": "muse_line_measuring.py",
"repo_name": "Vital-Fernandez/lime",
"repo_path": "lime_extracted/lime-master/examples/benchmark/muse_line_measuring.py",
"type": "Python"
} | from pathlib import Path
from mpdaf.obj import Cube
from astropy.wcs import WCS
import numpy as np
import lime
lime.theme.set_style('dark')
def read_muse_cube(file_address):
cube_obj = Cube(filename=str(file_address))
header = cube_obj.data_header
dw = header['CD3_3']
w_min = header['CRVAL3']
n... | Vital-FernandezREPO_NAMElimePATH_START.@lime_extracted@lime-master@examples@benchmark@muse_line_measuring.py@.PATH_END.py |
{
"filename": "query.py",
"repo_name": "simonsobs/nextline-schedule",
"repo_path": "nextline-schedule_extracted/nextline-schedule-main/src/nextline_schedule/schema/scheduler/query.py",
"type": "Python"
} | import strawberry
from strawberry.types import Info
from nextline_schedule.scheduler import Scheduler
def query_scheduler_api_url(info: Info) -> str:
scheduler = info.context['schedule']['scheduler']
assert isinstance(scheduler, Scheduler)
return scheduler._api_url
def query_scheduler_length_minutes(in... | simonsobsREPO_NAMEnextline-schedulePATH_START.@nextline-schedule_extracted@nextline-schedule-main@src@nextline_schedule@schema@scheduler@query.py@.PATH_END.py |
{
"filename": "icf-2d.py",
"repo_name": "LLNL/spheral",
"repo_path": "spheral_extracted/spheral-main/tests/functional/Strength/ICF/icf-2d.py",
"type": "Python"
} | #-------------------------------------------------------------------------------
# A mock ICF kind 'o problem.
#-------------------------------------------------------------------------------
from math import *
from Spheral import *
from SpheralTestUtilities import *
from SpheralGnuPlotUtilities import *
from SpheralVi... | LLNLREPO_NAMEspheralPATH_START.@spheral_extracted@spheral-main@tests@functional@Strength@ICF@icf-2d.py@.PATH_END.py |
{
"filename": "_family.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/funnel/marker/colorbar/tickfont/_family.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="family",
parent_name="funnel.marker.colorbar.tickfont",
**kwargs
):
super(FamilyValidator, self).__init__(
plotly_name=p... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@funnel@marker@colorbar@tickfont@_family.py@.PATH_END.py |
{
"filename": "concatenate_fit_gyro_model_output.py",
"repo_name": "lgbouma/gyro-interp",
"repo_path": "gyro-interp_extracted/gyro-interp-main/drivers/deprecated/concatenate_fit_gyro_model_output.py",
"type": "Python"
} | """
Concatenate the results from parallel_fit_gyro_model.py
Write the output to one CSV file.
(which will be plotted by plot_fit_gyro_model.py)
"""
from itertools import product
from gyrointerp.fitting import get_chi_sq_red
from gyrointerp.paths import RESULTSDIR, LOCALDIR
import os
from glob import glob
import numpy a... | lgboumaREPO_NAMEgyro-interpPATH_START.@gyro-interp_extracted@gyro-interp-main@drivers@deprecated@concatenate_fit_gyro_model_output.py@.PATH_END.py |
{
"filename": "prior.py",
"repo_name": "aneeshnaik/spam",
"repo_path": "spam_extracted/spam-master/fit/prior.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created: 2018
Author: A. P. Naik
Description: File containing prior function 'lnprior', to be fed to emcee
sampler. Also various supplementary functions relating halo scaling relations
from Moster et al, 2013 (arxiv:1205.5807), and Dutton & Maccio, 2014
(arxiv:1402.707... | aneeshnaikREPO_NAMEspamPATH_START.@spam_extracted@spam-master@fit@prior.py@.PATH_END.py |
{
"filename": "run.py",
"repo_name": "ratt-ru/Stimela-classic",
"repo_path": "Stimela-classic_extracted/Stimela-classic-master/stimela/cargo/cab/casa47_gaincal/src/run.py",
"type": "Python"
} | import os
import sys
import logging
import Crasa.Crasa as crasa
from casacore.tables import table
import numpy
import glob
import yaml
import shutil
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
with open(CONFIG, "r") as _std:
cab = yaml.safe_l... | ratt-ruREPO_NAMEStimela-classicPATH_START.@Stimela-classic_extracted@Stimela-classic-master@stimela@cargo@cab@casa47_gaincal@src@run.py@.PATH_END.py |
{
"filename": "quality_control_framework.py",
"repo_name": "Keck-DataReductionPipelines/KPF-Pipeline",
"repo_path": "KPF-Pipeline_extracted/KPF-Pipeline-master/modules/quality_control/src/quality_control_framework.py",
"type": "Python"
} | import ast
import configparser as cp
from modules.Utils.kpf_parse import HeaderParse
import modules.quality_control.src.quality_control as qc
from modules.quality_control.src.quality_control import execute_all_QCs
# Pipeline dependencies
from kpfpipe.logger import *
from kpfpipe.primitives.level0 import KPF0_Primitive... | Keck-DataReductionPipelinesREPO_NAMEKPF-PipelinePATH_START.@KPF-Pipeline_extracted@KPF-Pipeline-master@modules@quality_control@src@quality_control_framework.py@.PATH_END.py |
{
"filename": "conftest.py",
"repo_name": "spicy-oil/hfs_fit",
"repo_path": "hfs_fit_extracted/hfs_fit-master/tests/conftest.py",
"type": "Python"
} | spicy-oilREPO_NAMEhfs_fitPATH_START.@hfs_fit_extracted@hfs_fit-master@tests@conftest.py@.PATH_END.py | |
{
"filename": "README.md",
"repo_name": "lesgourg/class_public",
"repo_path": "class_public_extracted/class_public-master/external/HyRec2020/README.md",
"type": "Markdown"
} | # HYREC-2
By Yacine Ali-Haimoud and Chris Hirata (2010-17)
with contributions from Nanoom Lee (2020).
Version July 2020.
See readme.pdf for detailed info.
| lesgourgREPO_NAMEclass_publicPATH_START.@class_public_extracted@class_public-master@external@HyRec2020@README.md@.PATH_END.py |
{
"filename": "conftest.py",
"repo_name": "pandas-dev/pandas",
"repo_path": "pandas_extracted/pandas-main/pandas/tests/window/moments/conftest.py",
"type": "Python"
} | import itertools
import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
notna,
)
def create_series():
return [
Series(dtype=np.float64, name="a"),
Series([np.nan] * 5),
Series([1.0] * 5),
Series(range(5, 0, -1)),
Series(range(5)),
Ser... | pandas-devREPO_NAMEpandasPATH_START.@pandas_extracted@pandas-main@pandas@tests@window@moments@conftest.py@.PATH_END.py |
{
"filename": "fishermatrix.py",
"repo_name": "janosch314/GWFish",
"repo_path": "GWFish_extracted/GWFish-main/GWFish/modules/fishermatrix.py",
"type": "Python"
} | import numpy as np
import GWFish.modules.waveforms as wf
import GWFish.modules.detection as det
import GWFish.modules.auxiliary as aux
import GWFish.modules.fft as fft
import copy
import pandas as pd
from typing import Optional, Union
from tqdm import tqdm
import logging
from pathlib import Path
def invertSVD(matri... | janosch314REPO_NAMEGWFishPATH_START.@GWFish_extracted@GWFish-main@GWFish@modules@fishermatrix.py@.PATH_END.py |
{
"filename": "checkpolconvertfringe.py",
"repo_name": "marti-vidal-i/PolConvert",
"repo_path": "PolConvert_extracted/PolConvert-main/PP/checkpolconvertfringe.py",
"type": "Python"
} | #!/usr/bin/python
#
# Copyright (c) Ivan Marti-Vidal 2015-2023, University of Valencia (Spain)
# and Geoffrey Crew 2015-2023, Massachusetts Institute of Technology
#
# Script to open and assess the POLCONVERT.FRINGE_* binary files.
# Code cribbed from TOP/task_polconvert.py around line 2550 or so.
# As usual with... | marti-vidal-iREPO_NAMEPolConvertPATH_START.@PolConvert_extracted@PolConvert-main@PP@checkpolconvertfringe.py@.PATH_END.py |
{
"filename": "acor.py",
"repo_name": "dfm/acor",
"repo_path": "acor_extracted/acor-main/acor/acor.py",
"type": "Python"
} | __all__ = ["acor", "function"]
import numpy as np
from . import _acor
def acor(data, maxlag=10):
"""
Estimate the autocorrelation time of a time series
Parameters
----------
data : numpy.ndarray (N,) or (M, N)
The time series.
maxlag : int, optional
N must be greater than m... | dfmREPO_NAMEacorPATH_START.@acor_extracted@acor-main@acor@acor.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/linalg/tests/__init__.py",
"type": "Python"
} | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@linalg@tests@__init__.py@.PATH_END.py | |
{
"filename": "phase_space2.py",
"repo_name": "eugeneg88/fixed_points_brown",
"repo_path": "fixed_points_brown_extracted/fixed_points_brown-main/phase_space2.py",
"type": "Python"
} | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 12 11:58:42 2024
@author: evgeni
"""
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
#%%
def ecc(jz, eps):
y= 9*eps*jz/8
x2 = np.fabs(jz) * (5 / 3 * (1+y)/(1-y))**0.5
e2 = 1 - x2
if e2<0:
return 0
... | eugeneg88REPO_NAMEfixed_points_brownPATH_START.@fixed_points_brown_extracted@fixed_points_brown-main@phase_space2.py@.PATH_END.py |
{
"filename": "simplify.py",
"repo_name": "maayane/catsHTM",
"repo_path": "catsHTM_extracted/catsHTM-master/build/lib/catsHTM/simplify.py",
"type": "Python"
} | import numpy as np
ID=[[[[[[3833.0]]], [[[3913.0]]], [[[3961.0]]]], [[[[4553.0]]], [[[4665.0]]], [[[4745.0]]]]]]
print('the nested list is',ID)
def simplify_list(val):
if isinstance(val, list) == False:
return val
else:
if len(val) > 1:
return val
e... | maayaneREPO_NAMEcatsHTMPATH_START.@catsHTM_extracted@catsHTM-master@build@lib@catsHTM@simplify.py@.PATH_END.py |
{
"filename": "spacy_embeddings.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/embeddings/spacy_embeddings.py",
"type": "Python"
} | import importlib.util
from typing import Any, Dict, List, Optional
from langchain_core.embeddings import Embeddings
from pydantic import BaseModel, ConfigDict, model_validator
class SpacyEmbeddings(BaseModel, Embeddings):
"""Embeddings by spaCy models.
Attributes:
model_name (str): Name of a spaCy m... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@embeddings@spacy_embeddings.py@.PATH_END.py |
{
"filename": "jedi_typing.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/jedi/py2/jedi/evaluate/jedi_typing.py",
"type": "Python"
} | """
This module is not intended to be used in jedi, rather it will be fed to the
jedi-parser to replace classes in the typing module
"""
try:
from collections import abc
except ImportError:
# python 2
import collections as abc
def factory(typing_name, indextypes):
class Iterable(abc.Iterable):
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@jedi@py2@jedi@evaluate@jedi_typing.py@.PATH_END.py |
{
"filename": "window.py",
"repo_name": "nickhand/pyRSD",
"repo_path": "pyRSD_extracted/pyRSD-master/pyRSD/rsd/window.py",
"type": "Python"
} | import math
from fractions import Fraction
import numpy as np
import scipy.interpolate as interp
from pyRSD.rsd.tools import RSDSpline as spline
from pyRSD import pygcl
_epsilon = np.finfo(float).eps
def G(p):
"""
Return the function G(p), as defined in Wilson et al 2015.
See also: WA Al-Salam 1953
... | nickhandREPO_NAMEpyRSDPATH_START.@pyRSD_extracted@pyRSD-master@pyRSD@rsd@window.py@.PATH_END.py |
{
"filename": "submit_img_jobs.py",
"repo_name": "Swift-BAT/NITRATES",
"repo_path": "NITRATES_extracted/NITRATES-main/nitrates/submission_scripts/submit_img_jobs.py",
"type": "Python"
} | import os
import numpy as np
import time
import argparse
import logging
def cli():
parser = argparse.ArgumentParser()
parser.add_argument(
"--ssh", help="Do we need to ssh in to submit?", action="store_true"
)
parser.add_argument(
"--Njobs", type=int, help="Number of jobs to submit", d... | Swift-BATREPO_NAMENITRATESPATH_START.@NITRATES_extracted@NITRATES-main@nitrates@submission_scripts@submit_img_jobs.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "scikit-optimize/scikit-optimize",
"repo_path": "scikit-optimize_extracted/scikit-optimize-master/skopt/learning/gaussian_process/tests/__init__.py",
"type": "Python"
} | scikit-optimizeREPO_NAMEscikit-optimizePATH_START.@scikit-optimize_extracted@scikit-optimize-master@skopt@learning@gaussian_process@tests@__init__.py@.PATH_END.py | |
{
"filename": "__main__.py",
"repo_name": "lwa-project/lsl",
"repo_path": "lsl_extracted/lsl-main/lsl/version/__main__.py",
"type": "Python"
} | from lsl.version import version
print(f"lsl {version}")
| lwa-projectREPO_NAMElslPATH_START.@lsl_extracted@lsl-main@lsl@version@__main__.py@.PATH_END.py |
{
"filename": "_legendrank.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scattercarpet/_legendrank.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LegendrankValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="legendrank", parent_name="scattercarpet", **kwargs):
super(LegendrankValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_n... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scattercarpet@_legendrank.py@.PATH_END.py |
{
"filename": "Eigenvalues.py",
"repo_name": "Pranab-JD/LeXInt",
"repo_path": "LeXInt_extracted/LeXInt-main/Python/Eigenvalues.py",
"type": "Python"
} | """
Created on Thu Aug 8 20:22 2022
@author: Pranab JD
Description: -
Functions to determine the largest eigenvalue of a
matrix/related matrix.
Gershgorin's disks can be used only if the matrix is
explicitly available. For matrix-free implementation,
choose power it... | Pranab-JDREPO_NAMELeXIntPATH_START.@LeXInt_extracted@LeXInt-main@Python@Eigenvalues.py@.PATH_END.py |
{
"filename": "survey.py",
"repo_name": "LSSTDESC/surveycodex",
"repo_path": "surveycodex_extracted/surveycodex-main/surveycodex/survey.py",
"type": "Python"
} | import math
from dataclasses import dataclass, field
from typing import Dict, List
import astropy.units as u
import yaml
from astropy.units import Quantity
from surveycodex.filter import Filter
@dataclass(frozen=True)
class Survey:
"""A dataclass for storing the parameters of a survey"""
name: str
"The... | LSSTDESCREPO_NAMEsurveycodexPATH_START.@surveycodex_extracted@surveycodex-main@surveycodex@survey.py@.PATH_END.py |
{
"filename": "_ticklabelstep.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/volume/colorbar/_ticklabelstep.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TicklabelstepValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="ticklabelstep", parent_name="volume.colorbar", **kwargs
):
super(TicklabelstepValidator, self).__init__(
plotly_name=plotly_name,
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@volume@colorbar@_ticklabelstep.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "ma-xu/pointMLP-pytorch",
"repo_path": "pointMLP-pytorch_extracted/pointMLP-pytorch-main/README.md",
"type": "Markdown"
} | # Rethinking Network Design and Local Geometry in Point Cloud: A Simple Residual MLP Framework (ICLR 2022)
[](https://paperswithcode.com/sota/3d-p... | ma-xuREPO_NAMEpointMLP-pytorchPATH_START.@pointMLP-pytorch_extracted@pointMLP-pytorch-main@README.md@.PATH_END.py |
{
"filename": "tinygp_multidimensional_quasiperiodicsquaredexponential_activity.py",
"repo_name": "LucaMalavolta/PyORBIT",
"repo_path": "PyORBIT_extracted/PyORBIT-main/pyorbit/models/tinygp_multidimensional_quasiperiodicsquaredexponential_activity.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__ = ['TinyGP_Multidimensional_QuasiPeriodicSquaredExponentialActivity']... | LucaMalavoltaREPO_NAMEPyORBITPATH_START.@PyORBIT_extracted@PyORBIT-main@pyorbit@models@tinygp_multidimensional_quasiperiodicsquaredexponential_activity.py@.PATH_END.py |
{
"filename": "commands.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/redis/py3/redis/commands/bf/commands.py",
"type": "Python"
} | from redis.client import NEVER_DECODE
from redis.utils import deprecated_function
BF_RESERVE = "BF.RESERVE"
BF_ADD = "BF.ADD"
BF_MADD = "BF.MADD"
BF_INSERT = "BF.INSERT"
BF_EXISTS = "BF.EXISTS"
BF_MEXISTS = "BF.MEXISTS"
BF_SCANDUMP = "BF.SCANDUMP"
BF_LOADCHUNK = "BF.LOADCHUNK"
BF_INFO = "BF.INFO"
BF_CARD = "BF.CARD"
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@redis@py3@redis@commands@bf@commands.py@.PATH_END.py |
{
"filename": "cls_instrument_library.py",
"repo_name": "pysat/pysat",
"repo_path": "pysat_extracted/pysat-main/pysat/tests/classes/cls_instrument_library.py",
"type": "Python"
} | #!/usr/bin/env python
# Full license can be found in License.md
# Full author list can be found in .zenodo.json file
# DOI:10.5281/zenodo.1199703
#
# DISTRIBUTION STATEMENT A: Approved for public release. Distribution is
# unlimited.
# ----------------------------------------------------------------------------
"""Stan... | pysatREPO_NAMEpysatPATH_START.@pysat_extracted@pysat-main@pysat@tests@classes@cls_instrument_library.py@.PATH_END.py |
{
"filename": "viz.py",
"repo_name": "pyro-ppl/pyro",
"repo_path": "pyro_extracted/pyro-master/examples/air/viz.py",
"type": "Python"
} | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import math
from collections import namedtuple
import numpy as np
from PIL import Image, ImageDraw
def bounding_box(z_where, x_size):
"""This doesn't take into account interpolation, but it's close
enough to be usable.""... | pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@examples@air@viz.py@.PATH_END.py |
{
"filename": "check_contents_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/third_party/xla/build_tools/lint/check_contents_test.py",
"type": "Python"
} | # Copyright 2023 The OpenXLA 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 in ... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@third_party@xla@build_tools@lint@check_contents_test.py@.PATH_END.py |
{
"filename": "_base_meta.py",
"repo_name": "light-curve/light-curve-python",
"repo_path": "light-curve-python_extracted/light-curve-python-master/light-curve/light_curve/light_curve_py/features/_base_meta.py",
"type": "Python"
} | from abc import abstractmethod
from dataclasses import dataclass, field
from typing import Collection, Union
from light_curve.light_curve_ext import Extractor as _RustExtractor
from light_curve.light_curve_ext import _FeatureEvaluator as _RustBaseFeature
from ..dataclass_field import dataclass_field
from ._base impor... | light-curveREPO_NAMElight-curve-pythonPATH_START.@light-curve-python_extracted@light-curve-python-master@light-curve@light_curve@light_curve_py@features@_base_meta.py@.PATH_END.py |
{
"filename": "main.py",
"repo_name": "rohinkumar/correlcalc",
"repo_path": "correlcalc_extracted/correlcalc-master/correlcalc/main.py",
"type": "Python"
} | __author__ = 'Rohin Kumar Y'
# from fileios import *
# msg = 'Enter Absolute Path to file: '
# f_name = raw_input(msg).strip()
# Ran multiple tests for most methods in the package... need to clean up
# path = file_data_and_path(f_name)
# if path != None:
# print 'Path:',path
# import tpcf
# from fileios import *
... | rohinkumarREPO_NAMEcorrelcalcPATH_START.@correlcalc_extracted@correlcalc-master@correlcalc@main.py@.PATH_END.py |
{
"filename": "SentencePieceTokenizerOptionsT.md",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/lite/g3doc/api_docs/python/tflite_support/metadata_schema_py_generated/SentencePieceTokenizerOptionsT.md",
"type": "Markdown"
} | page_type: reference
<link rel="stylesheet" href="/site-assets/css/style.css">
<!-- DO NOT EDIT! Automatically generated file. -->
<div itemscope itemtype="http://developers.google.com/ReferenceObject">
<meta itemprop="name" content="tflite_support.metadata_schema_py_generated.SentencePieceTokenizerOptionsT" />
<met... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@lite@g3doc@api_docs@python@tflite_support@metadata_schema_py_generated@SentencePieceTokenizerOptionsT.md@.PATH_END.py |
{
"filename": "proportion_test.py",
"repo_name": "pyro-ppl/numpyro",
"repo_path": "numpyro_extracted/numpyro-master/examples/proportion_test.py",
"type": "Python"
} | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
"""
Example: Proportion Test
========================
You are managing a business and want to test if calling your customers will
increase their chance of making a purchase. You get 100,000 customer records and call
roughly half of the... | pyro-pplREPO_NAMEnumpyroPATH_START.@numpyro_extracted@numpyro-master@examples@proportion_test.py@.PATH_END.py |
{
"filename": "makePerfectForecastDataset.py",
"repo_name": "cmbant/CosmoMC",
"repo_path": "CosmoMC_extracted/CosmoMC-master/python/makePerfectForecastDataset.py",
"type": "Python"
} | # take CAMB file (e.g. test_lensedCls.dat) and produce dataset with given noise for testing
# Use in cosmomc .ini file using e.g.
# cmb_dataset[MyForecast]=data/MyForecast/test_lensedCls_exactsim.dataset
from __future__ import absolute_import
import shutil
import os
import numpy as np
from getdist import IniFile
from ... | cmbantREPO_NAMECosmoMCPATH_START.@CosmoMC_extracted@CosmoMC-master@python@makePerfectForecastDataset.py@.PATH_END.py |
{
"filename": "m3dis_class.py",
"repo_name": "TSFitPy-developers/TSFitPy",
"repo_path": "TSFitPy_extracted/TSFitPy-main/scripts/m3dis_class.py",
"type": "Python"
} | from __future__ import annotations
import logging
import shutil
import subprocess
import numpy as np
import os
import tempfile
from scipy.interpolate import LinearNDInterpolator, interp1d
from . import marcs_class
from .solar_abundances import periodic_table, solar_abundances
from .solar_isotopes import solar_isotopes... | TSFitPy-developersREPO_NAMETSFitPyPATH_START.@TSFitPy_extracted@TSFitPy-main@scripts@m3dis_class.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/unit_tests/tools/powerbi/__init__.py",
"type": "Python"
} | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@unit_tests@tools@powerbi@__init__.py@.PATH_END.py | |
{
"filename": "socket_server.py",
"repo_name": "mhammond/pywin32",
"repo_path": "pywin32_extracted/pywin32-main/win32/Demos/security/sspi/socket_server.py",
"type": "Python"
} | """A sample socket server and client using SSPI authentication and encryption.
You must run with either 'client' or 'server' as arguments. A server must be
running before a client can connect.
To use with Kerberos you should include in the client options
--target-spn=username, where 'username' is the user under whic... | mhammondREPO_NAMEpywin32PATH_START.@pywin32_extracted@pywin32-main@win32@Demos@security@sspi@socket_server.py@.PATH_END.py |
{
"filename": "gen_ddp_n8.py",
"repo_name": "desihub/LSS",
"repo_path": "LSS_extracted/LSS-main/py/LSS/DESI_ke/gen_ddp_n8.py",
"type": "Python"
} | import os
import sys
import fitsio
import argparse
import runtime
import numpy as np
import matplotlib.pyplot as plt
from astropy.table import Table, vstack
from scipy.spatial import KDTree
from delta8_limits import delta8_tier, d8_limits
from findfile import findfile, fetch_fields, overwrite_check, gathe... | desihubREPO_NAMELSSPATH_START.@LSS_extracted@LSS-main@py@LSS@DESI_ke@gen_ddp_n8.py@.PATH_END.py |
{
"filename": "_a.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/carpet/_a.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class AValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="a", parent_name="carpet", **kwargs):
super(AValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwar... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@carpet@_a.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "carronj/plancklens",
"repo_path": "plancklens_extracted/plancklens-master/plancklens/helpers/__init__.py",
"type": "Python"
} | carronjREPO_NAMEplancklensPATH_START.@plancklens_extracted@plancklens-master@plancklens@helpers@__init__.py@.PATH_END.py | |
{
"filename": "dither.py",
"repo_name": "spacetelescope/hstaxe",
"repo_path": "hstaxe_extracted/hstaxe-main/hstaxe/axesrc/dither.py",
"type": "Python"
} | """
See LICENSE.txt
"""
import os
import numpy as np
import logging
from astropy.io import fits
from stsci.imagestats import ImageStats
import stsci.convolve as convolve
from stsci.image.numcombine import numCombine
from drizzlepac.drizCR import quickDeriv
from drizzlepac import minmed
from drizzlepac import adrizz... | spacetelescopeREPO_NAMEhstaxePATH_START.@hstaxe_extracted@hstaxe-main@hstaxe@axesrc@dither.py@.PATH_END.py |
{
"filename": "_textinfo.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/funnelarea/_textinfo.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TextinfoValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(self, plotly_name="textinfo", parent_name="funnelarea", **kwargs):
super(TextinfoValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@funnelarea@_textinfo.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.