metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "cpm.py",
"repo_name": "jvc2688/K2-CPM",
"repo_path": "K2-CPM_extracted/K2-CPM-master/source/K2CPM/cpm.py",
"type": "Python"
} | from __future__ import print_function
import numpy as np
import leastSquareSolver as lss
def CPM():
def __init__(self, target_flux, target_kplr_mask, predictor_matrix, time, epoch_mask, covar_list, l2, target_med, target_std, thread_num=1):
self.target_flux = target_flux
self.target_kplr_mask = ta... | jvc2688REPO_NAMEK2-CPMPATH_START.@K2-CPM_extracted@K2-CPM-master@source@K2CPM@cpm.py@.PATH_END.py |
{
"filename": "InstallDependencies.py",
"repo_name": "sPaMFouR/RedPipe",
"repo_path": "RedPipe_extracted/RedPipe-master/InstallDependencies.py",
"type": "Python"
} | #!/usr/bin/env python
"""
Installs Necessary Modules To Get The Reduction Pipeline Going.
"""
# ------------------------------------------------------------------------------------------------------------------- #
# Import Required Libraries
# ---------------------------------------------------------------------------... | sPaMFouRREPO_NAMERedPipePATH_START.@RedPipe_extracted@RedPipe-master@InstallDependencies.py@.PATH_END.py |
{
"filename": "_unselected.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/scattergeo/_unselected.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Unselected(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scattergeo"
_path_str = "scattergeo.unselected"
_valid_props = {"marker", "textfont"}
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@scattergeo@_unselected.py@.PATH_END.py |
{
"filename": "main.py",
"repo_name": "jkrogager/PyNOT",
"repo_path": "PyNOT_extracted/PyNOT-master/pynot/main.py",
"type": "Python"
} | """
PyNOT Data Reduction Pipeline
Originally written for NOT/ALFOSC
For available tasks, run:
%] pynot -h
To create a default parameter file, run:
%] pynot init
"""
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter, REMAINDER
from copy import copy
import os
import sys
import numpy as np
... | jkrogagerREPO_NAMEPyNOTPATH_START.@PyNOT_extracted@PyNOT-master@pynot@main.py@.PATH_END.py |
{
"filename": "hyper_streamline.py",
"repo_name": "enthought/mayavi",
"repo_path": "mayavi_extracted/mayavi-master/mayavi/modules/hyper_streamline.py",
"type": "Python"
} | """ A module that integrates through a tensor field to generate a
hyperstreamline. The integration is along the maximum
eigenvector and the cross section of the hyperstreamline is
defined by the two other eigenvectors. Thus the shape of the
hyperstreamline is "tube-like", with the cross section bein... | enthoughtREPO_NAMEmayaviPATH_START.@mayavi_extracted@mayavi-master@mayavi@modules@hyper_streamline.py@.PATH_END.py |
{
"filename": "fastlinsquare_cholesky.py",
"repo_name": "nathanchara/l1periodogram",
"repo_path": "l1periodogram_extracted/l1periodogram-master/l1periodogram_codes/fastlinsquare_cholesky.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# Copyright 2020 Nathan Hara
#
# This file is part of the l1periodogram code.
#
# rvmodel 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... | nathancharaREPO_NAMEl1periodogramPATH_START.@l1periodogram_extracted@l1periodogram-master@l1periodogram_codes@fastlinsquare_cholesky.py@.PATH_END.py |
{
"filename": "stamp.py",
"repo_name": "LSSTDESC/Imsim",
"repo_path": "Imsim_extracted/Imsim-main/imsim/stamp.py",
"type": "Python"
} | from dataclasses import dataclass, fields, MISSING
import numpy as np
import galsim
from galsim.config import StampBuilder, RegisterStampType, GetAllParams, GetInputObj
from lsst.obs.lsst.translators.lsst import SIMONYI_LOCATION as RUBIN_LOC
from .diffraction_fft import apply_diffraction_psf
from .camera import get_ca... | LSSTDESCREPO_NAMEImsimPATH_START.@Imsim_extracted@Imsim-main@imsim@stamp.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "Keck-DataReductionPipelines/KPF-Pipeline",
"repo_path": "KPF-Pipeline_extracted/KPF-Pipeline-master/modules/master_dark/src/__init__.py",
"type": "Python"
} | Keck-DataReductionPipelinesREPO_NAMEKPF-PipelinePATH_START.@KPF-Pipeline_extracted@KPF-Pipeline-master@modules@master_dark@src@__init__.py@.PATH_END.py | |
{
"filename": "galactic_plane_metrics.py",
"repo_name": "lsst/rubin_sim",
"repo_path": "rubin_sim_extracted/rubin_sim-main/rubin_sim/maf/metrics/galactic_plane_metrics.py",
"type": "Python"
} | __all__ = (
"galplane_nvisits_thresholds",
"galplane_priority_map_thresholds",
"GalPlaneFootprintMetric",
"GalPlaneTimePerFilterMetric",
)
from types import MethodType
import numpy as np
from rubin_sim.maf.maps.galactic_plane_priority_maps import gp_priority_map_components_to_keys
from .base_metric ... | lsstREPO_NAMErubin_simPATH_START.@rubin_sim_extracted@rubin_sim-main@rubin_sim@maf@metrics@galactic_plane_metrics.py@.PATH_END.py |
{
"filename": "sql_dataset_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/data/experimental/kernel_tests/sql_dataset_test.py",
"type": "Python"
} | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@data@experimental@kernel_tests@sql_dataset_test.py@.PATH_END.py |
{
"filename": "_line.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/parcoords/_line.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "parcoords"
_path_str = "parcoords.line"
_valid_props = {
"autocolorscale",
"ca... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@parcoords@_line.py@.PATH_END.py |
{
"filename": "_xpad.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/histogram2dcontour/colorbar/_xpad.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class XpadValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="xpad", parent_name="histogram2dcontour.colorbar", **kwargs
):
super(XpadValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@histogram2dcontour@colorbar@_xpad.py@.PATH_END.py |
{
"filename": "BrownCompleteness.py",
"repo_name": "dsavransky/EXOSIMS",
"repo_path": "EXOSIMS_extracted/EXOSIMS-master/EXOSIMS/Completeness/BrownCompleteness.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
import time
import numpy as np
from scipy import interpolate
import astropy.units as u
import astropy.constants as const
import os
import pickle
import hashlib
from EXOSIMS.Prototypes.Completeness import Completeness
from EXOSIMS.util.eccanom import eccanom
from EXOSIMS.util.deltaMag import delt... | dsavranskyREPO_NAMEEXOSIMSPATH_START.@EXOSIMS_extracted@EXOSIMS-master@EXOSIMS@Completeness@BrownCompleteness.py@.PATH_END.py |
{
"filename": "_uirevision.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/parcats/_uirevision.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class UirevisionValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="uirevision", parent_name="parcats", **kwargs):
super(UirevisionValidator, 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@parcats@_uirevision.py@.PATH_END.py |
{
"filename": "CurvePoint.py",
"repo_name": "3fon3fonov/exostriker",
"repo_path": "exostriker_extracted/exostriker-main/exostriker/lib/pyqtgraph/graphicsItems/CurvePoint.py",
"type": "Python"
} | import weakref
from math import atan2, degrees
from ..functions import clip_scalar
from ..Qt import QtCore, QtWidgets
from . import ArrowItem
from .GraphicsObject import GraphicsObject
__all__ = ['CurvePoint', 'CurveArrow']
class CurvePoint(GraphicsObject):
"""A GraphicsItem that sets its location to a point on a... | 3fon3fonovREPO_NAMEexostrikerPATH_START.@exostriker_extracted@exostriker-main@exostriker@lib@pyqtgraph@graphicsItems@CurvePoint.py@.PATH_END.py |
{
"filename": "_idssrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/ohlc/_idssrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class IdssrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="idssrc", parent_name="ohlc", **kwargs):
super(IdssrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_ty... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@ohlc@_idssrc.py@.PATH_END.py |
{
"filename": "_dask.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/joblib/joblib/_dask.py",
"type": "Python"
} | from __future__ import print_function, division, absolute_import
import asyncio
import concurrent.futures
import contextlib
import time
from uuid import uuid4
import weakref
from .parallel import parallel_config
from .parallel import AutoBatchingMixin, ParallelBackendBase
from ._utils import (
_TracebackCapturi... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@joblib@joblib@_dask.py@.PATH_END.py |
{
"filename": "split_graph_def_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/tools/proto_splitter/split_graph_def_test.py",
"type": "Python"
} | # Copyright 2023 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@tools@proto_splitter@split_graph_def_test.py@.PATH_END.py |
{
"filename": "isolve.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/sparse/linalg/isolve.py",
"type": "Python"
} | # This file is not meant for public use and will be removed in SciPy v2.0.0.
# Use the `scipy.sparse.linalg` namespace for importing the functions
# included below.
from scipy._lib.deprecation import _sub_module_deprecation
__all__ = [ # noqa: F822
'bicg', 'bicgstab', 'cg', 'cgs', 'gcrotmk', 'gmres',
'lgmre... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@sparse@linalg@isolve.py@.PATH_END.py |
{
"filename": "preingestion.py",
"repo_name": "gotsunami/Youpi",
"repo_path": "Youpi_extracted/Youpi-master/terapix/script/preingestion.py",
"type": "Python"
} | #!/usr/bin/env python
##############################################################################
#
# Copyright (c) 2008-2009 Terapix Youpi development team. All Rights Reserved.
# Mathias Monnerville <monnerville@iap.fr>
# Gregory Semah <semah@iap.fr>
#
# This program is Free ... | gotsunamiREPO_NAMEYoupiPATH_START.@Youpi_extracted@Youpi-master@terapix@script@preingestion.py@.PATH_END.py |
{
"filename": "common.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/pyparsing/py3/pyparsing/common.py",
"type": "Python"
} | # common.py
from .core import *
from .helpers import DelimitedList, any_open_tag, any_close_tag
from datetime import datetime
# some other useful expressions - using lower-case class name since we are really using this as a namespace
class pyparsing_common:
"""Here are some common low-level expressions that may b... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@pyparsing@py3@pyparsing@common.py@.PATH_END.py |
{
"filename": "utils_gnilc_generate_map_spectralindex_Td.ipynb",
"repo_name": "galsci/pysm",
"repo_path": "pysm_extracted/pysm-main/docs/preprocess-templates/utils_gnilc_generate_map_spectralindex_Td.ipynb",
"type": "Jupyter Notebook"
} | ```python
import numpy as np
import healpy as hp
from pathlib import Path
```
```python
output_dir = Path("production-data") / "dust_gnilc"
```
```python
datadir = output_dir / "raw"
```
```python
output_nside = 2048
name = "beta"
```
```python
output_lmax = int(min(2.5 * output_nside, 8192 * 2))
```
## Galact... | galsciREPO_NAMEpysmPATH_START.@pysm_extracted@pysm-main@docs@preprocess-templates@utils_gnilc_generate_map_spectralindex_Td.ipynb@.PATH_END.py |
{
"filename": "partition.py",
"repo_name": "knaidoo29/mistree",
"repo_path": "mistree_extracted/mistree-master/mistree/mst/partition.py",
"type": "Python"
} | #'partition.py' is used to partition input data sets.
import numpy as np
def partition_data(total_sample_size, num_groups):
"""Returns an array with values that correspond to the assigned groupings.
Parameters
----------
total_sample_size : int
Length of the original data set.
num_groups... | knaidoo29REPO_NAMEmistreePATH_START.@mistree_extracted@mistree-master@mistree@mst@partition.py@.PATH_END.py |
{
"filename": "_lineposition.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/histogram/marker/colorbar/tickfont/_lineposition.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class LinepositionValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(
self,
plotly_name="lineposition",
parent_name="histogram.marker.colorbar.tickfont",
**kwargs,
):
super(LinepositionValidator, self).__init__(
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@histogram@marker@colorbar@tickfont@_lineposition.py@.PATH_END.py |
{
"filename": "run_utilities.py",
"repo_name": "HETDEX/elixer",
"repo_path": "elixer_extracted/elixer-main/elixer/run_utilities.py",
"type": "Python"
} | """
usually have problems with linux command line expansion getting too long for list, find, rm, etc
so this is dumb little, directly editable script to use Python to do what you want
"""
import glob
import os
import sys
import time
import numpy as np
files = glob.glob(os.path.join(".","d??/dispatch_*/d*/*.pdf"))
bn ... | HETDEXREPO_NAMEelixerPATH_START.@elixer_extracted@elixer-main@elixer@run_utilities.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "Keck-DataReductionPipelines/KPF-Pipeline",
"repo_path": "KPF-Pipeline_extracted/KPF-Pipeline-master/modules/quality_control/__init__.py",
"type": "Python"
} | Keck-DataReductionPipelinesREPO_NAMEKPF-PipelinePATH_START.@KPF-Pipeline_extracted@KPF-Pipeline-master@modules@quality_control@__init__.py@.PATH_END.py | |
{
"filename": "plot_density_field.py",
"repo_name": "franciscovillaescusa/Pylians3",
"repo_path": "Pylians3_extracted/Pylians3-master/density_field_plot/plot_density_field.py",
"type": "Python"
} | import numpy as np
import plotting_library as PL
import sys,os
from pylab import *
from matplotlib.ticker import ScalarFormatter
import matplotlib.gridspec as gridspec
from mpl_toolkits.axes_grid1.inset_locator import mark_inset
from matplotlib.colors import LogNorm
################################# INPUT ###########... | franciscovillaescusaREPO_NAMEPylians3PATH_START.@Pylians3_extracted@Pylians3-master@density_field_plot@plot_density_field.py@.PATH_END.py |
{
"filename": "dotnet.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/Pygments/py3/pygments/lexers/dotnet.py",
"type": "Python"
} | """
pygments.lexers.dotnet
~~~~~~~~~~~~~~~~~~~~~~
Lexers for .net languages.
:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, \
using, this, defau... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@Pygments@py3@pygments@lexers@dotnet.py@.PATH_END.py |
{
"filename": "_tickangle.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/layout/ternary/baxis/_tickangle.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class TickangleValidator(_plotly_utils.basevalidators.AngleValidator):
def __init__(
self, plotly_name="tickangle", parent_name="layout.ternary.baxis", **kwargs
):
super(TickangleValidator, self).__init__(
plotly_name=plotly_name,
par... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@ternary@baxis@_tickangle.py@.PATH_END.py |
{
"filename": "load_species_table.py",
"repo_name": "D-arioSpace/astroquery",
"repo_path": "astroquery_extracted/astroquery-main/astroquery/splatalogue/load_species_table.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import json
import re
import os
from astroquery.splatalogue.build_species_table import data_path, get_json_species_ids
class SpeciesLookuptable(dict):
def find(self, s, *, flags=0, return_dict=True,):
"""
Search dictionary keys for ... | D-arioSpaceREPO_NAMEastroqueryPATH_START.@astroquery_extracted@astroquery-main@astroquery@splatalogue@load_species_table.py@.PATH_END.py |
{
"filename": "test_ls372_agent.py",
"repo_name": "simonsobs/socs",
"repo_path": "socs_extracted/socs-main/tests/agents/test_ls372_agent.py",
"type": "Python"
} | from unittest import mock
import pytest
import txaio
from ocs.ocs_agent import OpSession
from socs.agents.lakeshore372.agent import LS372_Agent
txaio.use_twisted()
# Mocks and fixtures
def mock_connection():
"""Mock a standard connection."""
return mock.MagicMock()
def mock_failed_connection():
"""Mo... | simonsobsREPO_NAMEsocsPATH_START.@socs_extracted@socs-main@tests@agents@test_ls372_agent.py@.PATH_END.py |
{
"filename": "common.py",
"repo_name": "ARCLab-MIT/kspdg",
"repo_path": "kspdg_extracted/kspdg-main/arclab_mit/agents/extended_obs_agent/common.py",
"type": "Python"
} | import numpy as np
def round_arr(arr, digits):
return tuple(round(x,digits) for x in arr.tolist())
# pos/vel must be np arrays
def single_spacecraft_message(pos, vel, name, use_altitude=True, use_velocity=True):
pos = np.array(pos)
vel = np.array(vel)
return "".join([
f"{name} position (x,y,z)... | ARCLab-MITREPO_NAMEkspdgPATH_START.@kspdg_extracted@kspdg-main@arclab_mit@agents@extended_obs_agent@common.py@.PATH_END.py |
{
"filename": "_legendgrouptitle.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/scatterternary/_legendgrouptitle.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Legendgrouptitle(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatterternary"
_path_str = "scatterternary.legendgrouptitle"
_valid_props = {"fon... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@scatterternary@_legendgrouptitle.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "jax-ml/jax",
"repo_path": "jax_extracted/jax-main/examples/ffi/src/jax_ffi_example/__init__.py",
"type": "Python"
} | # Copyright 2024 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | jax-mlREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@examples@ffi@src@jax_ffi_example@__init__.py@.PATH_END.py |
{
"filename": "test_credentials.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/src/integrations/prefect-dbt/tests/cli/test_credentials.py",
"type": "Python"
} | import pytest
from prefect_dbt.cli.credentials import DbtCliProfile, GlobalConfigs, TargetConfigs
from pydantic import ValidationError
@pytest.mark.parametrize("configs_type", ["dict", "model"])
def test_dbt_cli_profile_init(configs_type):
target_configs = dict(type="snowflake", schema="schema")
global_config... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@src@integrations@prefect-dbt@tests@cli@test_credentials.py@.PATH_END.py |
{
"filename": "config.py",
"repo_name": "JiangFangzhou/SIDM",
"repo_path": "SIDM_extracted/SIDM-main/config.py",
"type": "Python"
} | #########################################################################
#
# global variables
#
# import config as cfg in all related modules, and use a global variable
# x defined here in the other modules as cfg.x
# Arthur Fangzhou Jiang 2017 Hebrew University
# Arthur Fangzhou Jiang 2021 Caltech & Carnegie
# O... | JiangFangzhouREPO_NAMESIDMPATH_START.@SIDM_extracted@SIDM-main@config.py@.PATH_END.py |
{
"filename": "test_taylor.py",
"repo_name": "cosmodesi/cosmoprimo",
"repo_path": "cosmoprimo_extracted/cosmoprimo-main/cosmoprimo/emulators/tools/tests/test_taylor.py",
"type": "Python"
} | import os
import numpy as np
from matplotlib import pyplot as plt
from cosmoprimo.emulators.tools import Emulator, EmulatedCalculator, TaylorEmulatorEngine, DiffSampler, setup_logging
def calculator(a=0, b=0):
x = np.linspace(0., 1., 10)
return {'x': x, 'y': a * x + b}
def plot(calculator, emulator, param... | cosmodesiREPO_NAMEcosmoprimoPATH_START.@cosmoprimo_extracted@cosmoprimo-main@cosmoprimo@emulators@tools@tests@test_taylor.py@.PATH_END.py |
{
"filename": "test_edenai.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/tests/integration_tests/embeddings/test_edenai.py",
"type": "Python"
} | """Test edenai embeddings."""
from langchain_community.embeddings.edenai import EdenAiEmbeddings
def test_edenai_embedding_documents() -> None:
"""Test edenai embeddings with openai."""
documents = ["foo bar", "test text"]
embedding = EdenAiEmbeddings(provider="openai") # type: ignore[call-arg]
outp... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@tests@integration_tests@embeddings@test_edenai.py@.PATH_END.py |
{
"filename": "dedusting.py",
"repo_name": "oliverphilcox/HADES",
"repo_path": "HADES_extracted/HADES-master/hades/dedusting.py",
"type": "Python"
} | from hades.params import BICEP
a=BICEP()
import numpy as np
from flipper import *
import flipperPol as fp
if __name__=='__main__':
""" This is the iterator for batch processing the map creation through HTCondor. Each map is done separately, and argument is map_id."""
import time
start_time=time.time()
import sys
... | oliverphilcoxREPO_NAMEHADESPATH_START.@HADES_extracted@HADES-master@hades@dedusting.py@.PATH_END.py |
{
"filename": "TestJediTyper.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/tools/cython/Cython/Tests/TestJediTyper.py",
"type": "Python"
} | # -*- coding: utf-8 -*-
# tag: jedi
from __future__ import absolute_import
import sys
import os.path
from textwrap import dedent
from contextlib import contextmanager
from tempfile import NamedTemporaryFile
from Cython.Compiler.ParseTreeTransforms import NormalizeTree, InterpretCompilerDirectives
from Cython.Compil... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@tools@cython@Cython@Tests@TestJediTyper.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "Hoeijmakers/tayph",
"repo_path": "tayph_extracted/tayph-master/README.md",
"type": "Markdown"
} | High Resolution Spectroscopy of Exoplanet Atmospheres
-----------------------------------------------------
THIS IS A WORK IN PROGRESS, BUT MOST FUNCTIONS ARE OPERATIONAL. REFER TO THE DOCUMENTATION FOR INSTALLATION AND DEMO INSTRUCTIONS. AS WE REGULARLY PUSH (SMALL) UPDATES AND FIXES, PLEASE PULL THE LATEST VERSION IF... | HoeijmakersREPO_NAMEtayphPATH_START.@tayph_extracted@tayph-master@README.md@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "SISPO-developers/sispo",
"repo_path": "sispo_extracted/sispo-master/data/README.md",
"type": "Markdown"
} | <!--
SPDX-FileCopyrightText: 2021 Gabriel J. Schwarzkopf <sispo-devs@outlook.com>
SPDX-License-Identifier: GPL-3.0-or-later
-->
# Data directory
This directory shall be used for the required data. Otherwise the paths in the modules need to be adjusted accordingly.
| SISPO-developersREPO_NAMEsispoPATH_START.@sispo_extracted@sispo-master@data@README.md@.PATH_END.py |
{
"filename": "datacontainer.py",
"repo_name": "tnakazato/priism",
"repo_path": "priism_extracted/priism-main/python/priism/core/datacontainer.py",
"type": "Python"
} | # Copyright (C) 2019-2022
# Inter-University Research Institute Corporation, National Institutes of Natural Sciences
# 2-21-1, Osawa, Mitaka, Tokyo, 181-8588, Japan.
#
# This file is part of PRIISM.
#
# PRIISM is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License... | tnakazatoREPO_NAMEpriismPATH_START.@priism_extracted@priism-main@python@priism@core@datacontainer.py@.PATH_END.py |
{
"filename": "demo2-checkpoint.ipynb",
"repo_name": "saberyoung/haffet",
"repo_path": "haffet_extracted/haffet-master/notebook/.ipynb_checkpoints/demo2-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | # play with full Ibc sample
```python
import sys
sys.path.append('../src')
from ztfanalysis import *
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
```
```python
```
```python
ztfp = ztfmultiple(datafile='tmp/%s_data.clf',
parfile='priors.txt',
datadi... | saberyoungREPO_NAMEhaffetPATH_START.@haffet_extracted@haffet-master@notebook@.ipynb_checkpoints@demo2-checkpoint.ipynb@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "glue-viz/glue",
"repo_path": "glue_extracted/glue-main/glue/plugins/exporters/__init__.py",
"type": "Python"
} | glue-vizREPO_NAMEgluePATH_START.@glue_extracted@glue-main@glue@plugins@exporters@__init__.py@.PATH_END.py | |
{
"filename": "act_test_twohalo_summed_nfw_matching_convergence_fit.py",
"repo_name": "dylancromer/maszcal",
"repo_path": "maszcal_extracted/maszcal-main/scripts/act_test_twohalo_summed_nfw_matching_convergence_fit.py",
"type": "Python"
} | import datetime
import numpy as np
import scipy.interpolate
import pathos.pools as pp
import emcee
from sklearn.gaussian_process.kernels import Matern
import multiprocessing
import pixell.enmap
import supercubos
import maszcal.cosmology
import maszcal.corrections
import maszcal.data.test
import maszcal.density
import m... | dylancromerREPO_NAMEmaszcalPATH_START.@maszcal_extracted@maszcal-main@scripts@act_test_twohalo_summed_nfw_matching_convergence_fit.py@.PATH_END.py |
{
"filename": "sources.py",
"repo_name": "james-trayford/strauss",
"repo_path": "strauss_extracted/strauss-main/src/strauss/sources.py",
"type": "Python"
} | """ The :obj:`sources` submodule: representing data as sound sources.
This submodule deals with the mapping of input datasets to the parameters
controlling sound in the eventual sonification.
Attributes:
mappable (:obj:`list(str)`): List of strings indicating possible
sonification parameters to which data can ... | james-trayfordREPO_NAMEstraussPATH_START.@strauss_extracted@strauss-main@src@strauss@sources.py@.PATH_END.py |
{
"filename": "hea15_compare.py",
"repo_name": "Goobley/DexRT",
"repo_path": "DexRT_extracted/DexRT-main/hea15_compare.py",
"type": "Python"
} | import matplotlib.pyplot as plt
import numpy as np
import xarray as xr
from matplotlib.colors import LogNorm
from scipy.interpolate import RegularGridInterpolator
from scipy.stats import pearsonr
try:
get_ipython().run_line_magic("matplotlib", "")
except:
plt.ion()
prefix = "jk20200550"
proxy_file = "jk2020055... | GoobleyREPO_NAMEDexRTPATH_START.@DexRT_extracted@DexRT-main@hea15_compare.py@.PATH_END.py |
{
"filename": "resolve_local_links.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/docs/scripts/resolve_local_links.py",
"type": "Python"
} | import os
import re
import sys
from pathlib import Path
DOCS_DIR = Path(os.path.abspath(__file__)).parents[1]
def update_links(doc_path, docs_link):
with open(DOCS_DIR / doc_path, "r") as f:
content = f.read()
# replace relative links
content = re.sub(r"\]\(\.\/", f"]({docs_link}", content)
... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@docs@scripts@resolve_local_links.py@.PATH_END.py |
{
"filename": "_metasrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/contour/_metasrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class MetasrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="metasrc", parent_name="contour", **kwargs):
super(MetasrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@contour@_metasrc.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/base/tests/__init__.py",
"type": "Python"
} | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@base@tests@__init__.py@.PATH_END.py | |
{
"filename": "_cmin.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/coloraxis/_cmin.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CminValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="cmin", parent_name="layout.coloraxis", **kwargs):
super(CminValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@coloraxis@_cmin.py@.PATH_END.py |
{
"filename": "permute.py",
"repo_name": "pyro-ppl/pyro",
"repo_path": "pyro_extracted/pyro-master/pyro/distributions/transforms/permute.py",
"type": "Python"
} | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import torch
from torch.distributions.transforms import Transform
from torch.distributions.utils import lazy_property
from pyro.distributions import constraints
from ..util import copy_docs_from
@copy_docs_from(Transform)
class... | pyro-pplREPO_NAMEpyroPATH_START.@pyro_extracted@pyro-master@pyro@distributions@transforms@permute.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/_build_utils/__init__.py",
"type": "Python"
} | import os
import numpy as np
from ._fortran import *
from .system_info import combine_dict
# Don't use the deprecated NumPy C API. Define this to a fixed version instead of
# NPY_API_VERSION in order not to break compilation for released SciPy versions
# when NumPy introduces a new deprecation. Use in setup.py::
#
#... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@_build_utils@__init__.py@.PATH_END.py |
{
"filename": "mc_rtp_launch_record.py",
"repo_name": "HERA-Team/hera_mc",
"repo_path": "hera_mc_extracted/hera_mc-main/scripts/mc_rtp_launch_record.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# Copyright 2021 The HERA Collaboration
# Licensed under the 2-clause BSD license.
"""
Add or update the RTP Launch Record for an observation.
This script takes a list of observations and either adds new RTP Launch Records
into the M&C database (if they do no... | HERA-TeamREPO_NAMEhera_mcPATH_START.@hera_mc_extracted@hera_mc-main@scripts@mc_rtp_launch_record.py@.PATH_END.py |
{
"filename": "mosaic_combine_dithers.py",
"repo_name": "bd-j/forcepho",
"repo_path": "forcepho_extracted/forcepho-main/demo/demo_mosaic/mosaic_combine_dithers.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import glob, os, sys
import argparse
import numpy as np
from astropy.io import fits
import stwcs
from drizzlepac import adrizzle
from demo_utils import write_fits_to
def drizzle_combine(ditherlist, args, wt_scale=1e-4):
"""
Parameters
----------
ditherli... | bd-jREPO_NAMEforcephoPATH_START.@forcepho_extracted@forcepho-main@demo@demo_mosaic@mosaic_combine_dithers.py@.PATH_END.py |
{
"filename": "residual.py",
"repo_name": "MIC-DKFZ/dynamic-network-architectures",
"repo_path": "dynamic-network-architectures_extracted/dynamic-network-architectures-main/dynamic_network_architectures/building_blocks/residual.py",
"type": "Python"
} | from typing import Tuple, List, Union, Type
import torch.nn
from torch import nn
from torch.nn.modules.conv import _ConvNd
from torch.nn.modules.dropout import _DropoutNd
from dynamic_network_architectures.building_blocks.helper import maybe_convert_scalar_to_list, get_matching_pool_op
from dynamic_network_architectur... | MIC-DKFZREPO_NAMEdynamic-network-architecturesPATH_START.@dynamic-network-architectures_extracted@dynamic-network-architectures-main@dynamic_network_architectures@building_blocks@residual.py@.PATH_END.py |
{
"filename": "test_stmoc.py",
"repo_name": "cds-astro/mocpy",
"repo_path": "mocpy_extracted/mocpy-master/python/mocpy/tests/test_stmoc.py",
"type": "Python"
} | import astropy.units as u
import cdshealpix
import numpy as np
import pytest
from astropy.table import Table
from astropy.time import Time, TimeDelta
from ..moc import MOC
from ..stmoc import STMOC
from ..tmoc import TimeMOC
@pytest.fixture
def stmoc_2mass():
two_mass_data = Table.read(
"resources/STMOC/... | cds-astroREPO_NAMEmocpyPATH_START.@mocpy_extracted@mocpy-master@python@mocpy@tests@test_stmoc.py@.PATH_END.py |
{
"filename": "calc_pDM.py",
"repo_name": "FRBs/zdm",
"repo_path": "zdm_extracted/zdm-main/papers/GWFRB/calc_pDM.py",
"type": "Python"
} | """
Script produced by Clancy James (clancy.james@curtin.edu.au)
This script calculates p(DM|z) and hence the associated value of PDM
It requires the followinging libraries from GitHub:
https://github.com/FRBs/zdm
https://github.com/FRBs/FRB
https://github.com/FRBs/ne2001
as well as several standard public librarie... | FRBsREPO_NAMEzdmPATH_START.@zdm_extracted@zdm-main@papers@GWFRB@calc_pDM.py@.PATH_END.py |
{
"filename": "run.py",
"repo_name": "MNGuenther/allesfitter",
"repo_path": "allesfitter_extracted/allesfitter-master/tutorials/03_transits_with_GPs/run.py",
"type": "Python"
} | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 12 15:57:05 2018
@author:
Maximilian N. Günther
MIT Kavli Institute for Astrophysics and Space Research,
Massachusetts Institute of Technology,
77 Massachusetts Avenue,
Cambridge, MA 02109,
USA
Email: maxgue@mit.edu
Web: www.mnguenther.com
"""
... | MNGuentherREPO_NAMEallesfitterPATH_START.@allesfitter_extracted@allesfitter-master@tutorials@03_transits_with_GPs@run.py@.PATH_END.py |
{
"filename": "MagField.py",
"repo_name": "chervias/DustFilaments",
"repo_path": "DustFilaments_extracted/DustFilaments-master/project/DustFilaments/MagField.py",
"type": "Python"
} | from Bpowspec import Pk2harm,harm2map,Delta2k
import numpy as np
def get_MagField(size,pixels=256,seed=1,path_cube=None,only_path=False,rms_random=3.0,):
# size is the size of the box
# pixels is the number of pixels per side in the cube
# seed is the random seed
# path_cube, if provided, must contain a npz file w... | cherviasREPO_NAMEDustFilamentsPATH_START.@DustFilaments_extracted@DustFilaments-master@project@DustFilaments@MagField.py@.PATH_END.py |
{
"filename": "tfsa-2021-129.md",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/security/advisory/tfsa-2021-129.md",
"type": "Markdown"
} | ## TFSA-2021-129: Heap OOB in `ResourceScatterUpdate`
### CVE Number
CVE-2021-37655
### Impact
An attacker can trigger a read from outside of bounds of heap allocated data by
sending invalid arguments to `tf.raw_ops.ResourceScatterUpdate`:
```python
import tensorflow as tf
v = tf.Variable([b'vvv'])
tf.raw_ops.Resou... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@security@advisory@tfsa-2021-129.md@.PATH_END.py |
{
"filename": "TestOrderEngines.py",
"repo_name": "dokester/BayesicFitting",
"repo_path": "BayesicFitting_extracted/BayesicFitting-master/BayesicFitting/test/TestOrderEngines.py",
"type": "Python"
} | # run with : python3 -m unittest TestSalesmanProblem
import unittest
import os
import numpy as numpy
from astropy import units
from numpy.testing import assert_array_equal as assertAE
import math
import matplotlib.pyplot as plt
from BayesicFitting import *
from BayesicFitting import formatter as fmt
from BayesicFitti... | dokesterREPO_NAMEBayesicFittingPATH_START.@BayesicFitting_extracted@BayesicFitting-master@BayesicFitting@test@TestOrderEngines.py@.PATH_END.py |
{
"filename": "test_semisupervised.py",
"repo_name": "jmschrei/pomegranate",
"repo_path": "pomegranate_extracted/pomegranate-master/tests/test_semisupervised.py",
"type": "Python"
} | # test_bayes_classifier.py
# Contact: Jacob Schreiber <jmschreiber91@gmail.com>
import os
import numpy
import torch
import pytest
from pomegranate.gmm import GeneralMixtureModel
from pomegranate.hmm import DenseHMM
from pomegranate.distributions import Exponential
from .tools import assert_raises
from numpy.testing ... | jmschreiREPO_NAMEpomegranatePATH_START.@pomegranate_extracted@pomegranate-master@tests@test_semisupervised.py@.PATH_END.py |
{
"filename": "WidgetBuilder.py",
"repo_name": "wmpg/Supracenter",
"repo_path": "Supracenter_extracted/Supracenter-master/supra/GUI/Tools/WidgetBuilder.py",
"type": "Python"
} | import os
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWebEngineWidgets import QWebEngineView as QWebView
from functools import partial
from matplotlib.backends.backend_qt5agg import FigureCanvas
from matplotlib.figure import Figure
import pyqtgraph as pg
from pyqt... | wmpgREPO_NAMESupracenterPATH_START.@Supracenter_extracted@Supracenter-master@supra@GUI@Tools@WidgetBuilder.py@.PATH_END.py |
{
"filename": "transforms.py",
"repo_name": "ESA-Datalabs/XAMI-model",
"repo_path": "XAMI-model_extracted/XAMI-model-main/xami_model/mobile_sam/mobile_sam/utils/transforms.py",
"type": "Python"
} | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
from torch.nn import functional as F
from torchvision.transforms.functional import resize,... | ESA-DatalabsREPO_NAMEXAMI-modelPATH_START.@XAMI-model_extracted@XAMI-model-main@xami_model@mobile_sam@mobile_sam@utils@transforms.py@.PATH_END.py |
{
"filename": "test_acs_tweak.py",
"repo_name": "spacetelescope/drizzlepac",
"repo_path": "drizzlepac_extracted/drizzlepac-main/tests/acs/test_acs_tweak.py",
"type": "Python"
} | import os
import shutil
import pytest
from stsci.tools import teal
from stwcs import updatewcs
from drizzlepac import astrodrizzle, tweakreg
from drizzlepac import pixtopix, pixtosky, skytopix
from ..resources import BaseACS
class TestAcsTweak(BaseACS):
#@pytest.mark.xfail
def test_tweak(self):
"""... | spacetelescopeREPO_NAMEdrizzlepacPATH_START.@drizzlepac_extracted@drizzlepac-main@tests@acs@test_acs_tweak.py@.PATH_END.py |
{
"filename": "cacheutil.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/py/py2/py/_path/cacheutil.py",
"type": "Python"
} | """
This module contains multithread-safe cache implementations.
All Caches have
getorbuild(key, builder)
delentry(key)
methods and allow configuration when instantiating the cache class.
"""
from time import time as gettime
class BasicCache(object):
def __init__(self, maxentries=128):
self.maxe... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@py@py2@py@_path@cacheutil.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "icecube/skyllh",
"repo_path": "skyllh_extracted/skyllh-master/skyllh/core/utils/__init__.py",
"type": "Python"
} | icecubeREPO_NAMEskyllhPATH_START.@skyllh_extracted@skyllh-master@skyllh@core@utils@__init__.py@.PATH_END.py | |
{
"filename": "Tutorial-RK_Butcher_Table_Dictionary.ipynb",
"repo_name": "zachetienne/nrpytutorial",
"repo_path": "nrpytutorial_extracted/nrpytutorial-master/Tutorial-RK_Butcher_Table_Dictionary.ipynb",
"type": "Jupyter Notebook"
} | <script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-59152712-8');
</script>
# Explicit Runge Kutta methods and their Butcher tables
## ... | zachetienneREPO_NAMEnrpytutorialPATH_START.@nrpytutorial_extracted@nrpytutorial-master@Tutorial-RK_Butcher_Table_Dictionary.ipynb@.PATH_END.py |
{
"filename": "test_flow_runs.py",
"repo_name": "PrefectHQ/prefect",
"repo_path": "prefect_extracted/prefect-main/tests/test_flow_runs.py",
"type": "Python"
} | import time
import pytest
import prefect.client.schemas as client_schemas
from prefect import flow
from prefect.exceptions import FlowRunWaitTimeout
from prefect.flow_runs import wait_for_flow_run
from prefect.states import Completed
async def test_create_then_wait_for_flow_run(prefect_client):
@flow
def fo... | PrefectHQREPO_NAMEprefectPATH_START.@prefect_extracted@prefect-main@tests@test_flow_runs.py@.PATH_END.py |
{
"filename": "3b-MaskUI_Tutorial.md",
"repo_name": "folsomcp/specpolFlow",
"repo_path": "specpolFlow_extracted/specpolFlow-main/docs-jb/Tutorials/3b-MaskUI_Tutorial.md",
"type": "Markdown"
} | # How to clean masks with the interactive tool
## Introduction
This tutorial will introduce you to the interactive mask cleaning tool called `cleanMaskUI`. This tool allows regions of lines to be easily excluded and included in the LSD line mask. This is particularly useful in the case of stars with a lot of emission... | folsomcpREPO_NAMEspecpolFlowPATH_START.@specpolFlow_extracted@specpolFlow-main@docs-jb@Tutorials@3b-MaskUI_Tutorial.md@.PATH_END.py |
{
"filename": "_shadowsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/waterfall/outsidetextfont/_shadowsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShadowsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="shadowsrc", parent_name="waterfall.outsidetextfont", **kwargs
):
super(ShadowsrcValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@waterfall@outsidetextfont@_shadowsrc.py@.PATH_END.py |
{
"filename": "test_dome_simulator.py",
"repo_name": "panoptes/POCS",
"repo_path": "POCS_extracted/POCS-main/tests/test_dome_simulator.py",
"type": "Python"
} | import pytest
from panoptes.pocs.dome import simulator
from panoptes.pocs.dome import create_dome_simulator
from panoptes.utils.config.client import set_config
@pytest.fixture(scope="function")
def dome():
set_config('dome', {
'brand': 'Simulacrum',
'driver': 'simulator',
})
the_dome = ... | panoptesREPO_NAMEPOCSPATH_START.@POCS_extracted@POCS-main@tests@test_dome_simulator.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "GeminiDRSoftware/GHOSTDR",
"repo_path": "GHOSTDR_extracted/GHOSTDR-master/README.md",
"type": "Markdown"
} | # ARCHIVED
The GHOST data reduction software is now fully integrated into DRAGONS and maintained by the International Gemini Observatory, part of NOIRLab.
This development repository was used during commissioning and system verification.
---
# GHOSTDR
Development repository for the GHOST data reduction software.
Thi... | GeminiDRSoftwareREPO_NAMEGHOSTDRPATH_START.@GHOSTDR_extracted@GHOSTDR-master@README.md@.PATH_END.py |
{
"filename": "_customdatasrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/sunburst/_customdatasrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class CustomdatasrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="customdatasrc", parent_name="sunburst", **kwargs):
super(CustomdatasrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@sunburst@_customdatasrc.py@.PATH_END.py |
{
"filename": "nightly_prim.py",
"repo_name": "Keck-DataReductionPipelines/KPF-Pipeline",
"repo_path": "KPF-Pipeline_extracted/KPF-Pipeline-master/modules/quicklook/src/nightly_prim.py",
"type": "Python"
} | # Standard dependencies
import configparser
import numpy as np
# Pipeline dependencies
from kpfpipe.logger import start_logger
from kpfpipe.primitives.level0 import KPF0_Primitive
from kpfpipe.models.level0 import KPF0
# External dependencies
from keckdrpframework.models.action import Action
from keckdrpframework.mod... | Keck-DataReductionPipelinesREPO_NAMEKPF-PipelinePATH_START.@KPF-Pipeline_extracted@KPF-Pipeline-master@modules@quicklook@src@nightly_prim.py@.PATH_END.py |
{
"filename": "_name.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/choropleth/colorbar/tickformatstop/_name.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="name",
parent_name="choropleth.colorbar.tickformatstop",
**kwargs,
):
super(NameValidator, self).__init__(
plotly_name=plo... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@choropleth@colorbar@tickformatstop@_name.py@.PATH_END.py |
{
"filename": "CODE_OF_CONDUCT.md",
"repo_name": "mackelab/sbi",
"repo_path": "sbi_extracted/sbi-main/CODE_OF_CONDUCT.md",
"type": "Markdown"
} |
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level o... | mackelabREPO_NAMEsbiPATH_START.@sbi_extracted@sbi-main@CODE_OF_CONDUCT.md@.PATH_END.py |
{
"filename": "factorials.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/mpmath/py3/mpmath/functions/factorials.py",
"type": "Python"
} | from ..libmp.backend import xrange
from .functions import defun, defun_wrapped
@defun
def gammaprod(ctx, a, b, _infsign=False):
a = [ctx.convert(x) for x in a]
b = [ctx.convert(x) for x in b]
poles_num = []
poles_den = []
regular_num = []
regular_den = []
for x in a: [regular_num, poles_num... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@mpmath@py3@mpmath@functions@factorials.py@.PATH_END.py |
{
"filename": "multinest_analyzer_utils.py",
"repo_name": "hveerten/katu",
"repo_path": "katu_extracted/katu-main/utils/multinest_analyzer_utils.py",
"type": "Python"
} | import os
import numpy as np
import matplotlib.pyplot as plt
import scipy.io
import corner
def create_report(probability, parameters, labels, best):
ndim = parameters.shape[1]
for dim in range(ndim):
a = np.c_[probability, parameters[:,dim]]
a = a[a[:,1].argsort()]
a = a.T
... | hveertenREPO_NAMEkatuPATH_START.@katu_extracted@katu-main@utils@multinest_analyzer_utils.py@.PATH_END.py |
{
"filename": "_gradient.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatterpolar/marker/_gradient.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class GradientValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="gradient", parent_name="scatterpolar.marker", **kwargs
):
super(GradientValidator, self).__init__(
plotly_name=plotly_name,
pare... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatterpolar@marker@_gradient.py@.PATH_END.py |
{
"filename": "test_ndio.py",
"repo_name": "astropy/astropy",
"repo_path": "astropy_extracted/astropy-main/astropy/nddata/mixins/tests/test_ndio.py",
"type": "Python"
} | from astropy.nddata import NDData, NDDataRef, NDIOMixin # noqa: F401
# Alias NDDataAllMixins in case this will be renamed ... :-)
NDDataIO = NDDataRef
def test_simple_write_read():
ndd = NDDataIO([1, 2, 3])
assert hasattr(ndd, "read")
assert hasattr(ndd, "write")
| astropyREPO_NAMEastropyPATH_START.@astropy_extracted@astropy-main@astropy@nddata@mixins@tests@test_ndio.py@.PATH_END.py |
{
"filename": "dedispersion_kernel_parameter_optimisation.md",
"repo_name": "AstroAccelerateOrg/astro-accelerate",
"repo_path": "astro-accelerate_extracted/astro-accelerate-master/wiki/dedispersion_kernel_parameter_optimisation.md",
"type": "Markdown"
} | # **Dedispersion kernel parameter optimisation**
It is possible to run the dedispersion step of AstroAccelerate using optimised values for each dedispersion measure (DM) range used, for the following parameters:
* SDIVINT - number of timesteps per block
* SDIVINDM - number of dedispersion measures per block
* UNROLLS
... | AstroAccelerateOrgREPO_NAMEastro-acceleratePATH_START.@astro-accelerate_extracted@astro-accelerate-master@wiki@dedispersion_kernel_parameter_optimisation.md@.PATH_END.py |
{
"filename": "poisson.py",
"repo_name": "minkailin/stratsi",
"repo_path": "stratsi_extracted/stratsi-master/dedalus_repo/examples/bvp/2d_poisson/poisson.py",
"type": "Python"
} | """
Simulation script for 2D Poisson equation.
This script is an example of how to do 2D linear boundary value problems.
It is best ran serially, and produces a plot of the solution using the included
plotting helpers.
On a single process, this should take just a few seconds to run.
"""
import os
import numpy as np... | minkailinREPO_NAMEstratsiPATH_START.@stratsi_extracted@stratsi-master@dedalus_repo@examples@bvp@2d_poisson@poisson.py@.PATH_END.py |
{
"filename": "_geo.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/layout/_geo.py",
"type": "Python"
} | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Geo(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout"
_path_str = "layout.geo"
_valid_props = {
"bgcolor",
"center",
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@layout@_geo.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "rreischke/OneCovariance",
"repo_path": "OneCovariance_extracted/OneCovariance-main/README.md",
"type": "Markdown"
} | 
OneCovariance is python package (with some C++ for the heavy lifting) for the calculation of the covariance matrix of photometric large-scale structure surveys. It can produce the covariance matrix for all the 2-point s... | rreischkeREPO_NAMEOneCovariancePATH_START.@OneCovariance_extracted@OneCovariance-main@README.md@.PATH_END.py |
{
"filename": "parameters.py",
"repo_name": "saberyoung/haffet",
"repo_path": "haffet_extracted/haffet-master/sdapy/models/sbo/parameters.py",
"type": "Python"
} | modelmeta = {
'pure_shock':
{
'engine': 'bol_early',
'alias': ['pure_sbo'],
'description': 'Pure Shock break out fit',
'func': 'functions.shock_fit',
'parname':
[
r'$M_\mathrm{ext}$',
r'$R_\mathrm{ext}$',
r"$E_\mathrm{ext}$",
... | saberyoungREPO_NAMEhaffetPATH_START.@haffet_extracted@haffet-master@sdapy@models@sbo@parameters.py@.PATH_END.py |
{
"filename": "test_screen.py",
"repo_name": "pynucastro/pynucastro",
"repo_path": "pynucastro_extracted/pynucastro-main/pynucastro/screening/tests/test_screen.py",
"type": "Python"
} | import pytest
from pytest import approx
import pynucastro as pyna
from pynucastro.screening import (chugunov_2007, chugunov_2009,
make_plasma_state, make_screen_factors,
potekhin_1998, screen5)
class TestScreen:
@pytest.fixture(scope="class")
... | pynucastroREPO_NAMEpynucastroPATH_START.@pynucastro_extracted@pynucastro-main@pynucastro@screening@tests@test_screen.py@.PATH_END.py |
{
"filename": "_polyint.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/interpolate/_polyint.py",
"type": "Python"
} | import warnings
import numpy as np
from scipy.special import factorial
from scipy._lib._util import _asarray_validated, float_factorial
__all__ = ["KroghInterpolator", "krogh_interpolate", "BarycentricInterpolator",
"barycentric_interpolate", "approximate_taylor_polynomial"]
def _isscalar(x):
"""Che... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@interpolate@_polyint.py@.PATH_END.py |
{
"filename": "tweakreg.py",
"repo_name": "spacetelescope/drizzlepac",
"repo_path": "drizzlepac_extracted/drizzlepac-main/drizzlepac/tweakreg.py",
"type": "Python"
} | """ ``TweakReg`` - A replacement for IRAF-based ``tweakshifts``
:Authors: Warren Hack, Mihai Cara
:License: :doc:`/LICENSE`
"""
import os
import sys
import numpy as np
from copy import copy
from stsci.tools import parseinput, teal
from stsci.tools import logutil, textutil
from stsci.tools.cfgpars import DuplicateKe... | spacetelescopeREPO_NAMEdrizzlepacPATH_START.@drizzlepac_extracted@drizzlepac-main@drizzlepac@tweakreg.py@.PATH_END.py |
{
"filename": "lizardnd.py",
"repo_name": "terryyin/lizard",
"repo_path": "lizard_extracted/lizard-master/lizard_ext/lizardnd.py",
"type": "Python"
} | """
This is an extension of lizard, that counts the 'Nesting Depth'
in every function.
"""
from lizard import FileInfoBuilder, FunctionInfo
DEFAULT_ND_THRESHOLD = 7
class LizardExtension(object): # pylint: disable=R0903
FUNCTION_INFO = {
"max_nesting_depth": {
"caption": " ND ",
... | terryyinREPO_NAMElizardPATH_START.@lizard_extracted@lizard-master@lizard_ext@lizardnd.py@.PATH_END.py |
{
"filename": "_autorange.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/layout/scene/yaxis/_autorange.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class AutorangeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="autorange", parent_name="layout.scene.yaxis", **kwargs
):
super(AutorangeValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@layout@scene@yaxis@_autorange.py@.PATH_END.py |
{
"filename": "Mrc.py",
"repo_name": "erikhom/aida",
"repo_path": "aida_extracted/aida-master/Priithon_heritage/Mrc.py",
"type": "Python"
} | """
MRC file format: refer to
http://www.msg.ucsf.edu/IVE/IVE4_HTML/IM_ref2.html
Mrc class uses memory mapping (file size limit about 1GB (more or less)
Mrc2 class section wise file/array I/O
"""
__author__ = "Sebastian Haase <haase@msg.ucsf.edu>"
__license__ = "BSD license - see LICENSE file"
import numpy as N
def... | erikhomREPO_NAMEaidaPATH_START.@aida_extracted@aida-master@Priithon_heritage@Mrc.py@.PATH_END.py |
{
"filename": "cylinder_pmts.py",
"repo_name": "duvall3/rat-pac",
"repo_path": "rat-pac_extracted/rat-pac-master/util/cylinder_pmts.py",
"type": "Python"
} | '''Create a PMTINFO RATDB table with positions of PMTs arranged on a
cylinder.
Note that PMTs are arranged on grids and so not all "target" numbers are
possible. Tweak this parameter until you get close to what you want.
Andy Mastbaum <mastbaum@hep.upenn.edu>, June 2014
'''
import argparse
import numpy as np
def di... | duvall3REPO_NAMErat-pacPATH_START.@rat-pac_extracted@rat-pac-master@util@cylinder_pmts.py@.PATH_END.py |
{
"filename": "find_center.py",
"repo_name": "waynebhayes/SpArcFiRe",
"repo_path": "SpArcFiRe_extracted/SpArcFiRe-master/scripts/AlignBandColors/find_center.py",
"type": "Python"
} | import os
import subprocess
import time
import numpy as np
from astropy.modeling import functional_models
from galaxy import Star
class CurveFitError(Exception):
def __init__(self, message):
self.message = message
def estimate_center(img : "ndarray", star : Star, percent_img_to_explore : float = 0.025... | waynebhayesREPO_NAMESpArcFiRePATH_START.@SpArcFiRe_extracted@SpArcFiRe-master@scripts@AlignBandColors@find_center.py@.PATH_END.py |
{
"filename": "stats.py",
"repo_name": "rfeldmann/leopy",
"repo_path": "leopy_extracted/leopy-master/leopy/stats.py",
"type": "Python"
} | """Additional statistics functionality.
This module is part of LEO-Py --
Likelihood Estimation of Observational data with Python
Copyright 2019 University of Zurich, Robert Feldmann
This module makes use of the source code of the open-source scipy.stats module.
The class doc-strings in this module include some text ... | rfeldmannREPO_NAMEleopyPATH_START.@leopy_extracted@leopy-master@leopy@stats.py@.PATH_END.py |
{
"filename": "adodbapi.py",
"repo_name": "mhammond/pywin32",
"repo_path": "pywin32_extracted/pywin32-main/adodbapi/adodbapi.py",
"type": "Python"
} | """adodbapi - A python DB API 2.0 (PEP 249) interface to Microsoft ADO
Copyright (C) 2002 Henrik Ekelund, versions 2.1 and later by Vernon Cole
* http://sourceforge.net/projects/pywin32
* https://github.com/mhammond/pywin32
* http://sourceforge.net/projects/adodbapi
This library is free software; you can redistri... | mhammondREPO_NAMEpywin32PATH_START.@pywin32_extracted@pywin32-main@adodbapi@adodbapi.py@.PATH_END.py |
{
"filename": "BlobFactory.py",
"repo_name": "mirochaj/ares",
"repo_path": "ares_extracted/ares-main/ares/analysis/BlobFactory.py",
"type": "Python"
} | """
BlobFactory.py
Author: Jordan Mirocha
Affiliation: University of Colorado at Boulder
Created on: Fri Dec 11 14:24:53 PST 2015
Description:
"""
import os
import re
import glob
import numpy as np
from inspect import ismethod
from types import FunctionType
from scipy.interpolate import RectBivariateSpline, inter... | mirochajREPO_NAMEaresPATH_START.@ares_extracted@ares-main@ares@analysis@BlobFactory.py@.PATH_END.py |
{
"filename": "fields.py",
"repo_name": "yt-project/yt",
"repo_path": "yt_extracted/yt-main/yt/frontends/swift/fields.py",
"type": "Python"
} | from yt.frontends.sph.fields import SPHFieldInfo
class SwiftFieldInfo(SPHFieldInfo):
def __init__(self, ds, field_list, slice_info=None):
self.known_particle_fields += (
(
"InternalEnergies",
("code_specific_energy", ["specific_thermal_energy"], None),
... | yt-projectREPO_NAMEytPATH_START.@yt_extracted@yt-main@yt@frontends@swift@fields.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.