metadata dict | text stringlengths 0 40.6M | id stringlengths 14 255 |
|---|---|---|
{
"filename": "setup.py",
"repo_name": "franciscovillaescusa/Pylians",
"repo_path": "Pylians_extracted/Pylians-master/Examples/c_wrapper/without_headers/setup.py",
"type": "Python"
} | from setuptools import setup
from setuptools.extension import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
import numpy
ext_modules = cythonize([Extension("cython_code",
["cython_code.pyx",'c_code.c'],
include_dirs=[numpy.get_include()],
extra_compile_args=["-O3","-ffast-... | franciscovillaescusaREPO_NAMEPyliansPATH_START.@Pylians_extracted@Pylians-master@Examples@c_wrapper@without_headers@setup.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "saberyoung/haffet",
"repo_path": "haffet_extracted/haffet-master/sdapy/models/salt2/__init__.py",
"type": "Python"
} | """Initilization modules."""
import os
path = os.path.dirname(os.path.abspath(__file__))
__all__ = []
for py in [
f[:-3] for f in os.listdir(path)
if f.endswith('.py') and f != '__init__.py'
]:
__all__.append(py)
from .functions import *
| saberyoungREPO_NAMEhaffetPATH_START.@haffet_extracted@haffet-master@sdapy@models@salt2@__init__.py@.PATH_END.py |
{
"filename": "_bordercolor.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/layout/annotation/_bordercolor.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="bordercolor", parent_name="layout.annotation", **kwargs
):
super(BordercolorValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@layout@annotation@_bordercolor.py@.PATH_END.py |
{
"filename": "configure.py",
"repo_name": "gbernstein/gbdes",
"repo_path": "gbdes_extracted/gbdes-master/src/configure.py",
"type": "Python"
} | #!/usr/bin/env python
"""
Collect information needed for astrometric and photometric matching of a collection of catalogs.
Successor to Bob Armstrong's parse3.py that will take YAML input files, and also do all
collecting of information from the input files' headers, to remove some of the tedium from
the C++ programs t... | gbernsteinREPO_NAMEgbdesPATH_START.@gbdes_extracted@gbdes-master@src@configure.py@.PATH_END.py |
{
"filename": "download.py",
"repo_name": "amusecode/amuse",
"repo_path": "amuse_extracted/amuse-main/src/amuse/community/mpiamrvac/download.py",
"type": "Python"
} | #!/usr/bin/env python
import subprocess
import os
import sys
import time
import urllib.request
import urllib.parse
import urllib.error
from optparse import OptionParser
class GetCodeFromHttp(object):
url_template = "http://amuse.strw.leidenuniv.nl/codes/mpiamrvac-r{version}.tgz"
filename_template = "mpiamrva... | amusecodeREPO_NAMEamusePATH_START.@amuse_extracted@amuse-main@src@amuse@community@mpiamrvac@download.py@.PATH_END.py |
{
"filename": "setup_package.py",
"repo_name": "bwinkel/cygrid",
"repo_path": "cygrid_extracted/cygrid-master/cygrid/tests/setup_package.py",
"type": "Python"
} | def get_package_data():
return {'cygrid.tests': ['coveragerc', 'data/*.*']}
| bwinkelREPO_NAMEcygridPATH_START.@cygrid_extracted@cygrid-master@cygrid@tests@setup_package.py@.PATH_END.py |
{
"filename": "test_structure.py",
"repo_name": "dendrograms/astrodendro",
"repo_path": "astrodendro_extracted/astrodendro-main/astrodendro/tests/test_structure.py",
"type": "Python"
} | # Licensed under an MIT open source license - see LICENSE
# The tests here ensure that the Structure class behaves as expected and has
# the correct interface. This is done by setting up a few simple examples and
# ensuring that all the properties and methods are behaving as expected.
import pytest
import numpy as np... | dendrogramsREPO_NAMEastrodendroPATH_START.@astrodendro_extracted@astrodendro-main@astrodendro@tests@test_structure.py@.PATH_END.py |
{
"filename": "_family.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/mesh3d/hoverlabel/font/_family.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="family", parent_name="mesh3d.hoverlabel.font", **kwargs
):
super(FamilyValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@mesh3d@hoverlabel@font@_family.py@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "dmlc/xgboost",
"repo_path": "xgboost_extracted/xgboost-master/demo/kaggle-higgs/README.md",
"type": "Markdown"
} | Highlights
=====
Higgs challenge ends recently, xgboost is being used by many users. This list highlights the xgboost solutions of players
* Blogpost by phunther: [Winning solution of Kaggle Higgs competition: what a single model can do](http://no2147483647.wordpress.com/2014/09/17/winning-solution-of-kaggle-higgs-comp... | dmlcREPO_NAMExgboostPATH_START.@xgboost_extracted@xgboost-master@demo@kaggle-higgs@README.md@.PATH_END.py |
{
"filename": "test_random_models.py",
"repo_name": "nanograv/PINT",
"repo_path": "PINT_extracted/PINT-master/tests/test_random_models.py",
"type": "Python"
} | import os
import pytest
import numpy as np
from astropy import units as u
from astropy.time import Time
from pint.models import get_model, get_model_and_toas
from pint.toa import get_TOAs
import pint.fitter
from pint import simulation
from pinttestdata import datadir
@pytest.mark.parametrize("error", [1 * u.us, 1,... | nanogravREPO_NAMEPINTPATH_START.@PINT_extracted@PINT-master@tests@test_random_models.py@.PATH_END.py |
{
"filename": "xami_inference.py",
"repo_name": "ESA-Datalabs/XAMI-model",
"repo_path": "XAMI-model_extracted/XAMI-model-main/xami_model/inference/xami_inference.py",
"type": "Python"
} | import sys
import torch
import cv2
import numpy as np
import matplotlib.pyplot as plt
import time
from ultralytics import YOLO, RTDETR
from segment_anything.utils.transforms import ResizeLongestSide
import tqdm
import os
from ..dataset import dataset_utils
from ..model_predictor import predictor_utils
from ..mobile_sam... | ESA-DatalabsREPO_NAMEXAMI-modelPATH_START.@XAMI-model_extracted@XAMI-model-main@xami_model@inference@xami_inference.py@.PATH_END.py |
{
"filename": "plot.py",
"repo_name": "geodynamics/burnman",
"repo_path": "burnman_extracted/burnman-main/burnman/tools/plot.py",
"type": "Python"
} | # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for
# the Earth and Planetary Sciences
# Copyright (C) 2012 - 2021 by the BurnMan team, released under the GNU
# GPL v2 or later.
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial.transform import Rotation as R
def pretty_... | geodynamicsREPO_NAMEburnmanPATH_START.@burnman_extracted@burnman-main@burnman@tools@plot.py@.PATH_END.py |
{
"filename": "cfis_field_select.py",
"repo_name": "CosmoStat/shapepipe",
"repo_path": "shapepipe_extracted/shapepipe-master/scripts/python/cfis_field_select.py",
"type": "Python"
} | #!/usr/bin/env python
"""Script cfis_field_select.py
Handling and selecting CFIS fields and pointings.
:Authors: Martin Kilbinger
:Date: 19/01/2018
"""
# Compability with python2.x for x>6
from __future__ import print_function
import sys
import os
import re
import copy
import glob
import numpy as np
import pyl... | CosmoStatREPO_NAMEshapepipePATH_START.@shapepipe_extracted@shapepipe-master@scripts@python@cfis_field_select.py@.PATH_END.py |
{
"filename": "visualize_active_latitudes.py",
"repo_name": "zclaytor/butterpy",
"repo_path": "butterpy_extracted/butterpy-main/visualization/visualize_active_latitudes.py",
"type": "Python"
} | """
Visualization tools to illustrate the active latitudes and spot emergence as a
function of time.
Intended for use as a script:
```
>>> python visualization/visualize_active_latitudes.py
```
"""
import numpy as np
import matplotlib.pyplot as plt
import astropy.units as u
from astropy.table import Table
from butt... | zclaytorREPO_NAMEbutterpyPATH_START.@butterpy_extracted@butterpy-main@visualization@visualize_active_latitudes.py@.PATH_END.py |
{
"filename": "test_registry.py",
"repo_name": "grburgess/popsynth",
"repo_path": "popsynth_extracted/popsynth-master/popsynth/test/test_registry.py",
"type": "Python"
} | from popsynth import (
list_available_auxiliary_samplers,
list_available_distributions,
list_available_selection_functions,
)
def test_listings():
list_available_auxiliary_samplers()
list_available_distributions()
list_available_selection_functions()
| grburgessREPO_NAMEpopsynthPATH_START.@popsynth_extracted@popsynth-master@popsynth@test@test_registry.py@.PATH_END.py |
{
"filename": "GUI-checkpoint.ipynb",
"repo_name": "MNGuenther/allesfitter",
"repo_path": "allesfitter_extracted/allesfitter-master/allesfitter/.ipynb_checkpoints/GUI-checkpoint.ipynb",
"type": "Jupyter Notebook"
} | ```python
%%html
<style>
body {
font-family: "Times New Roman";
font-size: 12pt;
}
</style>
```
<style>
body {
font-family: "Times New Roman";
font-size: 12pt;
}
</style>
```python
"""
Created on Tue Nov 2 20:31:38 2018
@author:
Dr. Maximilian N. Günther
European Space Agency (ESA)
European ... | MNGuentherREPO_NAMEallesfitterPATH_START.@allesfitter_extracted@allesfitter-master@allesfitter@.ipynb_checkpoints@GUI-checkpoint.ipynb@.PATH_END.py |
{
"filename": "create_BDSD_data.py",
"repo_name": "astro-informatics/LeIA",
"repo_path": "LeIA_extracted/LeIA-main/src/data/create_BDSD_data.py",
"type": "Python"
} | import glob
import numpy as np
from skimage import io, color
from tqdm import tqdm
import os
from src.operators.measurement import NUFFT_op
from src.sampling.uv_sampling import spider_sampling
def measure(x, m_op, ISNR, weights, factor=1):
y0 = m_op.dir_op(x)
sigma = np.sqrt(np.mean(np.abs(y0)**2)) * 10**(-... | astro-informaticsREPO_NAMELeIAPATH_START.@LeIA_extracted@LeIA-main@src@data@create_BDSD_data.py@.PATH_END.py |
{
"filename": "deepdiff.py",
"repo_name": "mivp/encube",
"repo_path": "encube_extracted/encube-master/deepdiff.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2014 - 2016 Sep Ehr (Seperman)
# www.zepworks.com
#
# 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 wi... | mivpREPO_NAMEencubePATH_START.@encube_extracted@encube-master@deepdiff.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "dolaver/calsagos",
"repo_path": "calsagos_extracted/calsagos-main/calsagos/__init__.py",
"type": "Python"
} | """
CALSAGOS
=====
Clustering ALgorithmS Applied to Galaxies in Overdense Systems
is a python package develop to select cluster members and to
search, find and identify substructures in and around a galaxy
cluster using the redshift and position of the galaxies.
CALSAGOS was develop to carry out the analysis present... | dolaverREPO_NAMEcalsagosPATH_START.@calsagos_extracted@calsagos-main@calsagos@__init__.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "lenstronomy/lenstronomy",
"repo_path": "lenstronomy_extracted/lenstronomy-main/lenstronomy/ImSim/Numerics/__init__.py",
"type": "Python"
} | lenstronomyREPO_NAMElenstronomyPATH_START.@lenstronomy_extracted@lenstronomy-main@lenstronomy@ImSim@Numerics@__init__.py@.PATH_END.py | |
{
"filename": "_showtickprefix.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/scatter/marker/colorbar/_showtickprefix.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowtickprefixValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="showtickprefix",
parent_name="scatter.marker.colorbar",
**kwargs,
):
super(ShowtickprefixValidator, self).__init__(
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@scatter@marker@colorbar@_showtickprefix.py@.PATH_END.py |
{
"filename": "test_b_utilities_numpy.py",
"repo_name": "jrenaud90/TidalPy",
"repo_path": "TidalPy_extracted/TidalPy-main/Tests/Test_Old/Test_SetB_Package/test_b_utilities_numpy.py",
"type": "Python"
} | import numpy as np
import TidalPy
from TidalPy.utilities.numpy_helper.array_other import find_nearest, neg_array_for_log_plot, normalize_dict, value_np_cleanup
def test_normalize_dict():
""" Tests the normalize_dict function """
# Test with floats
test_dict = {
'a': 102.0,
'b': 121.2,
... | jrenaud90REPO_NAMETidalPyPATH_START.@TidalPy_extracted@TidalPy-main@Tests@Test_Old@Test_SetB_Package@test_b_utilities_numpy.py@.PATH_END.py |
{
"filename": "read_snana_fits.py",
"repo_name": "daniel-muthukrishna/astrorapid",
"repo_path": "astrorapid_extracted/astrorapid-master/astrorapid/read_snana_fits.py",
"type": "Python"
} | import numpy as np
import multiprocessing as mp
import pandas as pd
import astropy.io.fits as afits
from collections import OrderedDict
from astrorapid.process_light_curves import InputLightCurve
class GetData(object):
def __init__(self):
""" Get light curves. """
self.phot_fields = ['MJD', 'FLT... | daniel-muthukrishnaREPO_NAMEastrorapidPATH_START.@astrorapid_extracted@astrorapid-master@astrorapid@read_snana_fits.py@.PATH_END.py |
{
"filename": "point_telementry.ipynb",
"repo_name": "spacetelescope/jwst",
"repo_path": "jwst_extracted/jwst-main/jwst/lib/tests/notebooks/point_telementry.ipynb",
"type": "Jupyter Notebook"
} | # Abstract
Create tables of the pointing telemetry.
# Environment
```python
import os
```
```python
# Standard C-string engineering DB
os.environ['ENG_RESTFUL_URL'] = '<wherevertheengdbisat>'
```
```python
from astropy.table import Table, join
```
```python
from jwst.lib.engdb_tools import ENGDB_Service
```
... | spacetelescopeREPO_NAMEjwstPATH_START.@jwst_extracted@jwst-main@jwst@lib@tests@notebooks@point_telementry.ipynb@.PATH_END.py |
{
"filename": "konko.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/chat_models/konko.py",
"type": "Python"
} | """KonkoAI chat wrapper."""
from __future__ import annotations
import logging
import os
import warnings
from typing import (
Any,
Dict,
Iterator,
List,
Optional,
Set,
Tuple,
Union,
cast,
)
import requests
from langchain_core.callbacks import (
CallbackManagerForLLMRun,
)
from ... | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@chat_models@konko.py@.PATH_END.py |
{
"filename": "_layer.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/layout/mapbox/_layer.py",
"type": "Python"
} | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Layer(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.mapbox"
_path_str = "layout.mapbox.layer"
_valid_props = {
"below",
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@layout@mapbox@_layer.py@.PATH_END.py |
{
"filename": "documentation.md",
"repo_name": "amrvac/amrvac",
"repo_path": "amrvac_extracted/amrvac-master/doc/documentation.md",
"type": "Markdown"
} | # About the MPI-AMRVAC documentation
[TOC]
# Generating the documentation {#doc-gen}
The documentation of MPI-AMRVAC is generated using
[Doxygen](http://doxygen.org/). On every commit to the (owner-protected) master branch, documentation on http://amrvac.org
is automatically updated. You can also generate
documenta... | amrvacREPO_NAMEamrvacPATH_START.@amrvac_extracted@amrvac-master@doc@documentation.md@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "RozanskiT/HANDY",
"repo_path": "HANDY_extracted/HANDY-master/README.md",
"type": "Markdown"
} | # HANDY - Handy tool for spectra normalization
HANDY is interactive Python3 program for spectrum normalization. The normalization process is based on "regions" and "ranges". "Ranges" are continuum parts defined manually by user (or uploaded from file from previous program run) which will be used for continuum level fi... | RozanskiTREPO_NAMEHANDYPATH_START.@HANDY_extracted@HANDY-master@README.md@.PATH_END.py |
{
"filename": "get_path.py",
"repo_name": "LoganAMorrison/Hazma",
"repo_path": "Hazma_extracted/Hazma-master/hazma/_decay/get_path.py",
"type": "Python"
} | import os
def get_dir_path():
this_dir, this_filename = os.path.split(__file__)
return this_dir
| LoganAMorrisonREPO_NAMEHazmaPATH_START.@Hazma_extracted@Hazma-master@hazma@_decay@get_path.py@.PATH_END.py |
{
"filename": "call_trees.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/autograph/converters/call_trees.py",
"type": "Python"
} | # Copyright 2016 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@autograph@converters@call_trees.py@.PATH_END.py |
{
"filename": "_dash.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/scatterpolar/line/_dash.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class DashValidator(_plotly_utils.basevalidators.DashValidator):
def __init__(self, plotly_name="dash", parent_name="scatterpolar.line", **kwargs):
super(DashValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@scatterpolar@line@_dash.py@.PATH_END.py |
{
"filename": "Untitled.ipynb",
"repo_name": "PoulinV/AxiCLASS",
"repo_path": "AxiCLASS_extracted/AxiCLASS-master/Untitled.ipynb",
"type": "Jupyter Notebook"
} | PoulinVREPO_NAMEAxiCLASSPATH_START.@AxiCLASS_extracted@AxiCLASS-master@Untitled.ipynb@.PATH_END.py | |
{
"filename": "index_lookup.py",
"repo_name": "fchollet/keras",
"repo_path": "keras_extracted/keras-master/keras/src/layers/preprocessing/index_lookup.py",
"type": "Python"
} | import collections
import numpy as np
from keras.src import backend
from keras.src.layers.layer import Layer
from keras.src.utils import argument_validation
from keras.src.utils import numerical_utils
from keras.src.utils import tf_utils
from keras.src.utils.module_utils import tensorflow as tf
class IndexLookup(La... | fcholletREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@layers@preprocessing@index_lookup.py@.PATH_END.py |
{
"filename": "PyBaciTest.py",
"repo_name": "ACS-Community/ACS",
"repo_path": "ACS_extracted/ACS-master/LGPL/CommonSoftware/acspy/test/acspytestImpl/PyBaciTest.py",
"type": "Python"
} | #*******************************************************************************
# ALMA - Atacama Large Millimiter Array
# (c) Associated Universities Inc., 2002
# (c) European Southern Observatory, 2002
# Copyright by ESO (in the framework of the ALMA collaboration)
# and Cosylab 2002, All rights reserved
#
# This li... | ACS-CommunityREPO_NAMEACSPATH_START.@ACS_extracted@ACS-master@LGPL@CommonSoftware@acspy@test@acspytestImpl@PyBaciTest.py@.PATH_END.py |
{
"filename": "test_factorplots.py",
"repo_name": "statsmodels/statsmodels",
"repo_path": "statsmodels_extracted/statsmodels-main/statsmodels/graphics/tests/test_factorplots.py",
"type": "Python"
} | import numpy as np
from numpy.testing import assert_equal, assert_raises
from pandas import Series
import pytest
from statsmodels.graphics.factorplots import _recode, interaction_plot
try:
import matplotlib.pyplot as plt
except ImportError:
pass
class TestInteractionPlot:
@classmethod
def setup_cla... | statsmodelsREPO_NAMEstatsmodelsPATH_START.@statsmodels_extracted@statsmodels-main@statsmodels@graphics@tests@test_factorplots.py@.PATH_END.py |
{
"filename": "setup_package.py",
"repo_name": "starkit/wsynphot",
"repo_path": "wsynphot_extracted/wsynphot-master/wsynphot/tests/setup_package.py",
"type": "Python"
} | def get_package_data():
return {
_ASTROPY_PACKAGE_NAME_ + '.tests': ['coveragerc']}
| starkitREPO_NAMEwsynphotPATH_START.@wsynphot_extracted@wsynphot-master@wsynphot@tests@setup_package.py@.PATH_END.py |
{
"filename": "warmup.ipynb",
"repo_name": "GuillermoFrancoAbellan/class_clumpy",
"repo_path": "class_clumpy_extracted/class_clumpy-main/notebooks/warmup.ipynb",
"type": "Jupyter Notebook"
} | ```python
# import classy module
from classy import Class
```
```python
# create instance of the class "Class"
LambdaCDM = Class()
# pass input parameters
LambdaCDM.set({'omega_b':0.022032,'omega_cdm':0.12038,'h':0.67556,'A_s':2.215e-9,'n_s':0.9619,'tau_reio':0.0925})
LambdaCDM.set({'output':'tCl,pCl,lCl,mPk','lensin... | GuillermoFrancoAbellanREPO_NAMEclass_clumpyPATH_START.@class_clumpy_extracted@class_clumpy-main@notebooks@warmup.ipynb@.PATH_END.py |
{
"filename": "vetos.py",
"repo_name": "ML4GW/aframe",
"repo_path": "aframe_extracted/aframe-main/projects/plots/plots/vetos/vetos.py",
"type": "Python"
} | import logging
from pathlib import Path
from typing import Dict, List, Literal
import numpy as np
from gwosc import datasets
from gwpy.segments import DataQualityDict
# TODO: gating should really be applied directly to the strain
VETO_CATEGORIES = Literal["CAT1", "CAT2", "CAT3", "GATES", "CATALOG"]
def gates_to_v... | ML4GWREPO_NAMEaframePATH_START.@aframe_extracted@aframe-main@projects@plots@plots@vetos@vetos.py@.PATH_END.py |
{
"filename": "render_two_fields.py",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/doc/source/cookbook/render_two_fields.py",
"type": "Python"
} | import yt
from yt.visualization.volume_rendering.api import Scene, create_volume_source
filePath = "Sedov_3d/sedov_hdf5_chk_0003"
ds = yt.load(filePath)
ds.force_periodicity()
sc = Scene()
# set up camera
cam = sc.add_camera(ds, lens_type="perspective")
cam.resolution = [400, 400]
cam.position = ds.arr([1, 1, 1], "... | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@doc@source@cookbook@render_two_fields.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "langchain-ai/langchain",
"repo_path": "langchain_extracted/langchain-master/libs/community/langchain_community/tools/ainetwork/__init__.py",
"type": "Python"
} | langchain-aiREPO_NAMElangchainPATH_START.@langchain_extracted@langchain-master@libs@community@langchain_community@tools@ainetwork@__init__.py@.PATH_END.py | |
{
"filename": "_family.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/densitymapbox/legendgrouptitle/font/_family.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="family",
parent_name="densitymapbox.legendgrouptitle.font",
**kwargs,
):
super(FamilyValidator, self).__init__(
plotly_n... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@densitymapbox@legendgrouptitle@font@_family.py@.PATH_END.py |
{
"filename": "critical_section_test.py",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/kernel_tests/critical_section_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@kernel_tests@critical_section_test.py@.PATH_END.py |
{
"filename": "_grouptitlefont.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/graph_objs/layout/hoverlabel/_grouptitlefont.py",
"type": "Python"
} | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Grouptitlefont(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.hoverlabel"
_path_str = "layout.hoverlabel.grouptitlefont"
_valid_props = ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@graph_objs@layout@hoverlabel@_grouptitlefont.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "jmccormac01/Donuts",
"repo_path": "Donuts_extracted/Donuts-master/donuts/__init__.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This is an Astropy affiliated package.
"""
# Affiliated packages may add whatever they like to this file, but
# should keep this content at the top.
# ----------------------------------------------------------------------------
from ._astropy_init im... | jmccormac01REPO_NAMEDonutsPATH_START.@Donuts_extracted@Donuts-master@donuts@__init__.py@.PATH_END.py |
{
"filename": "rk5.py",
"repo_name": "adrn/gala",
"repo_path": "gala_extracted/gala-main/gala/integrate/pyintegrators/rk5.py",
"type": "Python"
} | """ 5th order Runge-Kutta integration. """
# Third-party
import numpy as np
# Project
from ..core import Integrator
from ..timespec import parse_time_specification
__all__ = ["RK5Integrator"]
# These are the Dormand-Prince parameters for embedded Runge-Kutta methods
A = np.array([0.0, 0.2, 0.3, 0.6, 1.0, 0.875])
B ... | adrnREPO_NAMEgalaPATH_START.@gala_extracted@gala-main@gala@integrate@pyintegrators@rk5.py@.PATH_END.py |
{
"filename": "Frame_Import_Data.py",
"repo_name": "francescoa97outlook/pyExoRaMa",
"repo_path": "pyExoRaMa_extracted/pyExoRaMa-main/GUI_Plot/Frame_Import_Data.py",
"type": "Python"
} | import tkinter as tk
import GUI_Load_Data.Gui_Data
class Frame_Import_Data:
gui = None
frame_import_Data = None
loadData = None
def __init__(self, window, gui):
self.gui = gui
self.frame_import_Data = tk.Frame(window, highlightbackground="black", highlightthickness=1, padx=5, pady=2)... | francescoa97outlookREPO_NAMEpyExoRaMaPATH_START.@pyExoRaMa_extracted@pyExoRaMa-main@GUI_Plot@Frame_Import_Data.py@.PATH_END.py |
{
"filename": "EXAMPLE_config_Roman_CGI_SPC_Bowtie_Band2.py",
"repo_name": "ajeldorado/falco-python",
"repo_path": "falco-python_extracted/falco-python-master/roman/EXAMPLE_config_Roman_CGI_SPC_Bowtie_Band2.py",
"type": "Python"
} | """Configuration file for the Roman CGI model."""
import numpy as np
import os
from astropy.io import fits
import matplotlib.pyplot as plt
import falco
import roman_phasec_proper as phasec
mp = falco.config.ModelParameters()
mp.compact = falco.config.Object()
mp.full = falco.config.Object()
# Path to data needed by... | ajeldoradoREPO_NAMEfalco-pythonPATH_START.@falco-python_extracted@falco-python-master@roman@EXAMPLE_config_Roman_CGI_SPC_Bowtie_Band2.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "avigan/pyZELDA",
"repo_path": "pyZELDA_extracted/pyZELDA-master/pyzelda/sphere/__init__.py",
"type": "Python"
} | aviganREPO_NAMEpyZELDAPATH_START.@pyZELDA_extracted@pyZELDA-master@pyzelda@sphere@__init__.py@.PATH_END.py | |
{
"filename": "categorial.py",
"repo_name": "sbi-dev/sbi",
"repo_path": "sbi_extracted/sbi-main/sbi/neural_nets/net_builders/categorial.py",
"type": "Python"
} | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
from typing import Optional
from torch import Tensor, nn, unique
from sbi.neural_nets.estimators import CategoricalMassEstimator, CategoricalNet
from sb... | sbi-devREPO_NAMEsbiPATH_START.@sbi_extracted@sbi-main@sbi@neural_nets@net_builders@categorial.py@.PATH_END.py |
{
"filename": "logo.py",
"repo_name": "amerand/PMOIRED",
"repo_path": "PMOIRED_extracted/PMOIRED-master/banner/logo.py",
"type": "Python"
} | import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
figsize = (8.4, 1.6)
plt.close(0)
plt.figure(0, figsize=figsize)
ax = plt.subplot(111, frameon=False)
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
plt.subplots_adjust(left=0, right=1, bottom=0, top=1)
plt.text(0,0,'PMOIRED'... | amerandREPO_NAMEPMOIREDPATH_START.@PMOIRED_extracted@PMOIRED-master@banner@logo.py@.PATH_END.py |
{
"filename": "_size.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/bar/outsidetextfont/_size.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="size", parent_name="bar.outsidetextfont", **kwargs):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@bar@outsidetextfont@_size.py@.PATH_END.py |
{
"filename": "_namelength.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/image/hoverlabel/_namelength.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class NamelengthValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="namelength", parent_name="image.hoverlabel", **kwargs
):
super(NamelengthValidator, self).__init__(
plotly_name=plotly_name,
pa... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@image@hoverlabel@_namelength.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/layout/xaxis/rangebreak/__init__.py",
"type": "Python"
} | import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._values import ValuesValidator
from ._templateitemname import TemplateitemnameValidator
from ._pattern import PatternValidator
from ._name import NameValidator
from ._enabled import EnabledValidator
... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@layout@xaxis@rangebreak@__init__.py@.PATH_END.py |
{
"filename": "_opensrc.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/candlestick/_opensrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class OpensrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="opensrc", parent_name="candlestick", **kwargs):
super(OpensrcValidator, 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@candlestick@_opensrc.py@.PATH_END.py |
{
"filename": "neutron-decay.py",
"repo_name": "nuc-astro/winnet",
"repo_path": "winnet_extracted/winnet-master/test/neutron-decay.py",
"type": "Python"
} | #!/usr/bin/env python
def neutron_decay(x):
"""
Function to calculate the decay of a neutron
"""
X_n0 = 0.01
alpha = np.exp(-6.786182)
n_theory = X_n0 * np.exp(-alpha*x)
return n_theory
t.checklist = { \
'mainout.dat' : { 'method':'analyticcompare', 'tolerance':[5e-4,5e-4] ,'x_co... | nuc-astroREPO_NAMEwinnetPATH_START.@winnet_extracted@winnet-master@test@neutron-decay.py@.PATH_END.py |
{
"filename": "test_config_value.py",
"repo_name": "GalSim-developers/GalSim",
"repo_path": "GalSim_extracted/GalSim-main/tests/test_config_value.py",
"type": "Python"
} | # Copyright (c) 2012-2023 by the GalSim developers team on GitHub
# https://github.com/GalSim-developers
#
# This file is part of GalSim: The modular galaxy image simulation toolkit.
# https://github.com/GalSim-developers/GalSim
#
# GalSim is free software: redistribution and use in source and binary forms,
# with or w... | GalSim-developersREPO_NAMEGalSimPATH_START.@GalSim_extracted@GalSim-main@tests@test_config_value.py@.PATH_END.py |
{
"filename": "integrations.md",
"repo_name": "ultralytics/ultralytics",
"repo_path": "ultralytics_extracted/ultralytics-main/docs/en/hub/integrations.md",
"type": "Markdown"
} | ---
comments: true
description: Explore seamless integrations between Ultralytics HUB and platforms like Roboflow. Learn how to import datasets, train models, and more.
keywords: Ultralytics HUB, Roboflow integration, dataset import, model training, AI, machine learning
---
# Ultralytics HUB Integrations
Learn about ... | ultralyticsREPO_NAMEultralyticsPATH_START.@ultralytics_extracted@ultralytics-main@docs@en@hub@integrations.md@.PATH_END.py |
{
"filename": "copy_injection_recovery.py",
"repo_name": "ThibeauWouters/TurboPE-BNS",
"repo_path": "TurboPE-BNS_extracted/TurboPE-BNS-main/injections/outdir_TF2/injection_6/copy_injection_recovery.py",
"type": "Python"
} | import os
os.environ['CUDA_VISIBLE_DEVICES'] = "3"
os.environ["XLA_PYTHON_CLIENT_MEM_FRACTION"] = "0.25"
import numpy as np
import argparse
# The following is needed on CIT cluster to avoid an obscure Python error
import psutil
p = psutil.Process()
p.cpu_affinity([0])
# Regular imports
import argparse
import copy
impo... | ThibeauWoutersREPO_NAMETurboPE-BNSPATH_START.@TurboPE-BNS_extracted@TurboPE-BNS-main@injections@outdir_TF2@injection_6@copy_injection_recovery.py@.PATH_END.py |
{
"filename": "util.py",
"repo_name": "yuliang419/AstroNet-Triage",
"repo_path": "AstroNet-Triage_extracted/AstroNet-Triage-master/light_curve_util/util.py",
"type": "Python"
} | # Copyright 2018 The TensorFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | yuliang419REPO_NAMEAstroNet-TriagePATH_START.@AstroNet-Triage_extracted@AstroNet-Triage-master@light_curve_util@util.py@.PATH_END.py |
{
"filename": "_family.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py2/plotly/validators/funnel/outsidetextfont/_family.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="family", parent_name="funnel.outsidetextfont", **kwargs
):
super(FamilyValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py2@plotly@validators@funnel@outsidetextfont@_family.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "cosmo-ethz/hide",
"repo_path": "hide_extracted/hide-master/hide/astro/__init__.py",
"type": "Python"
} | cosmo-ethzREPO_NAMEhidePATH_START.@hide_extracted@hide-master@hide@astro@__init__.py@.PATH_END.py | |
{
"filename": "_stream.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/validators/cone/_stream.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class StreamValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="stream", parent_name="cone", **kwargs):
super(StreamValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
da... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@validators@cone@_stream.py@.PATH_END.py |
{
"filename": "_bordercolorsrc.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/barpolar/hoverlabel/_bordercolorsrc.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class BordercolorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="bordercolorsrc", parent_name="barpolar.hoverlabel", **kwargs
):
super(BordercolorsrcValidator, self).__init__(
plotly_name=plotly_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@barpolar@hoverlabel@_bordercolorsrc.py@.PATH_END.py |
{
"filename": "test_fortran.py",
"repo_name": "scipy/scipy",
"repo_path": "scipy_extracted/scipy-main/scipy/io/tests/test_fortran.py",
"type": "Python"
} | ''' Tests for fortran sequential files '''
import tempfile
import shutil
import os
from os import path
from glob import iglob
import threading
import re
from numpy.testing import assert_equal, assert_allclose
import numpy as np
import pytest
from scipy.io import (FortranFile,
_test_fortran,
... | scipyREPO_NAMEscipyPATH_START.@scipy_extracted@scipy-main@scipy@io@tests@test_fortran.py@.PATH_END.py |
{
"filename": "init_extern.py",
"repo_name": "agnwinds/python",
"repo_path": "python_extracted/python-main/py_progs/init_extern.py",
"type": "Python"
} | #!/usr/bin/env python
'''
Create a .c file which initializes all of the externs in a .h file.
Command line usage (if any):
usage: init_extern.py filename
Description:
This routine allows one to generate
a .c file that intialized global
variables that have been classified as .h
Primary routine... | agnwindsREPO_NAMEpythonPATH_START.@python_extracted@python-main@py_progs@init_extern.py@.PATH_END.py |
{
"filename": "_show.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/plotly/py3/plotly/validators/mesh3d/contour/_show.py",
"type": "Python"
} | import _plotly_utils.basevalidators
class ShowValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="show", parent_name="mesh3d.contour", **kwargs):
super(ShowValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@plotly@py3@plotly@validators@mesh3d@contour@_show.py@.PATH_END.py |
{
"filename": "search.py",
"repo_name": "snad-space/ztf-viewer",
"repo_path": "ztf-viewer_extracted/ztf-viewer-master/ztf_viewer/pages/search.py",
"type": "Python"
} | import dash_dangerously_set_inner_html as ddsih
from astropy.table import Table
from dash import html
from ztf_viewer.catalogs import find_ztf_circle
from ztf_viewer.exceptions import NotFound
from ztf_viewer.util import html_from_astropy_table
COLUMNS = {
"oid": "OID",
"separation": "separation, arcsec",
... | snad-spaceREPO_NAMEztf-viewerPATH_START.@ztf-viewer_extracted@ztf-viewer-master@ztf_viewer@pages@search.py@.PATH_END.py |
{
"filename": "dmp.md",
"repo_name": "natashabatalha/picaso",
"repo_path": "picaso_extracted/picaso-master/dmp.md",
"type": "Markdown"
} | # Open Science & Data Management Plan
This document is meant to help ROSES proposers curate their PICASO related Data Management Plans.
## Underlying data that are part of the software
The underlying data that are already part of PICASO are 1) monochromatic opacities (SQLite), 2) correlated-K tables (ascii), 3) the... | natashabatalhaREPO_NAMEpicasoPATH_START.@picaso_extracted@picaso-master@dmp.md@.PATH_END.py |
{
"filename": "argparsing.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/pytest/py3/_pytest/config/argparsing.py",
"type": "Python"
} | import argparse
import os
import sys
import warnings
from gettext import gettext
from typing import Any
from typing import Callable
from typing import cast
from typing import Dict
from typing import List
from typing import Mapping
from typing import NoReturn
from typing import Optional
from typing import Sequence
from ... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@pytest@py3@_pytest@config@argparsing.py@.PATH_END.py |
{
"filename": "lsastore.py",
"repo_name": "mhammond/pywin32",
"repo_path": "pywin32_extracted/pywin32-main/win32/Demos/security/lsastore.py",
"type": "Python"
} | import win32security
policy_handle = win32security.GetPolicyHandle("", win32security.POLICY_ALL_ACCESS)
privatedata = "some sensitive data"
keyname = "tmp"
win32security.LsaStorePrivateData(policy_handle, keyname, privatedata)
retrieveddata = win32security.LsaRetrievePrivateData(policy_handle, keyname)
assert retrieve... | mhammondREPO_NAMEpywin32PATH_START.@pywin32_extracted@pywin32-main@win32@Demos@security@lsastore.py@.PATH_END.py |
{
"filename": "Loading_Spherical_Data.ipynb",
"repo_name": "rennehan/yt-swift",
"repo_path": "yt-swift_extracted/yt-swift-main/doc/source/examining/Loading_Spherical_Data.ipynb",
"type": "Jupyter Notebook"
} | # Loading Spherical Data
Support in yt for non-Cartesian geometries is partial and is still being extended, but here is an example of how to load spherical data from a regularly-spaced grid. For irregularly spaced grids, a similar setup can be used, either by using supplying the `cell_widths` parameter to `load_unifor... | rennehanREPO_NAMEyt-swiftPATH_START.@yt-swift_extracted@yt-swift-main@doc@source@examining@Loading_Spherical_Data.ipynb@.PATH_END.py |
{
"filename": "gaussian.py",
"repo_name": "ConorMacBride/mcalf",
"repo_path": "mcalf_extracted/mcalf-main/src/mcalf/profiles/gaussian.py",
"type": "Python"
} | import numpy as np
__all__ = ['single_gaussian']
def single_gaussian(x, a, b, c, d):
"""Gaussian function.
Parameters
----------
x : numpy.ndarray
Wavelengths to evaluate Gaussian function at.
a : float
Amplitude.
b : float
Central line core.
c : float
Sig... | ConorMacBrideREPO_NAMEmcalfPATH_START.@mcalf_extracted@mcalf-main@src@mcalf@profiles@gaussian.py@.PATH_END.py |
{
"filename": "data_struct.py",
"repo_name": "Fermipy/fermipy",
"repo_path": "fermipy_extracted/fermipy-master/fermipy/data_struct.py",
"type": "Python"
} | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function
from collections import OrderedDict
class MutableNamedTuple(OrderedDict):
"""Light-weight class for representing data structures. Internal
data members can be accessed using both a... | FermipyREPO_NAMEfermipyPATH_START.@fermipy_extracted@fermipy-master@fermipy@data_struct.py@.PATH_END.py |
{
"filename": "pyct_tutorial.ipynb",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/python/autograph/g3doc/pyct_tutorial.ipynb",
"type": "Jupyter Notebook"
} | # Short intro to the SCT library of AutoGraph
**Work in progress, use with care and expect changes.**
The `pyct` module packages the source code transformation APIs used by AutoGraph.
This tutorial is just a preview - there is no PIP package yet, and the API has not been finalized, although most of those shown here ... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@python@autograph@g3doc@pyct_tutorial.ipynb@.PATH_END.py |
{
"filename": "gammapy_plugin.ipynb",
"repo_name": "andreatramacere/jetset",
"repo_path": "jetset_extracted/jetset-master/doc/documentation_notebooks/notebooks/gammapy_plugin/gammapy_plugin.ipynb",
"type": "Jupyter Notebook"
} | .. warning::
**Tested against Gammapy version 1.2, please, take into account that might break if Gammapy changes interface**.. _gammapy_plugin:
# Example to use the Gamma-py plugin with the JeSeT interface
In this tutorial we show how to import a jetset model into Gamma-py, and finally we perform a model... | andreatramacereREPO_NAMEjetsetPATH_START.@jetset_extracted@jetset-master@doc@documentation_notebooks@notebooks@gammapy_plugin@gammapy_plugin.ipynb@.PATH_END.py |
{
"filename": "_marker.py",
"repo_name": "plotly/plotly.py",
"repo_path": "plotly.py_extracted/plotly.py-master/packages/python/plotly/plotly/graph_objs/scattermapbox/unselected/_marker.py",
"type": "Python"
} | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Marker(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scattermapbox.unselected"
_path_str = "scattermapbox.unselected.marker"
_valid_props = {"col... | plotlyREPO_NAMEplotly.pyPATH_START.@plotly.py_extracted@plotly.py-master@packages@python@plotly@plotly@graph_objs@scattermapbox@unselected@_marker.py@.PATH_END.py |
{
"filename": "plot_bounding_box_gallery.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/visualization/plot_bounding_box_gallery.py",
"type": "Python"
} | import functools
import numpy as np
from keras.src import backend
from keras.src import ops
from keras.src.api_export import keras_export
from keras.src.visualization.draw_bounding_boxes import draw_bounding_boxes
from keras.src.visualization.plot_image_gallery import plot_image_gallery
try:
from matplotlib impo... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@visualization@plot_bounding_box_gallery.py@.PATH_END.py |
{
"filename": "set_file_owner.py",
"repo_name": "mhammond/pywin32",
"repo_path": "pywin32_extracted/pywin32-main/win32/Demos/security/set_file_owner.py",
"type": "Python"
} | fname = r"h:\tmp.txt"
import ntsecuritycon
import win32api
import win32con
import win32file
import win32security
new_privs = (
(
win32security.LookupPrivilegeValue("", ntsecuritycon.SE_SECURITY_NAME),
win32con.SE_PRIVILEGE_ENABLED,
),
(
win32security.LookupPrivilegeValue("", ntsecu... | mhammondREPO_NAMEpywin32PATH_START.@pywin32_extracted@pywin32-main@win32@Demos@security@set_file_owner.py@.PATH_END.py |
{
"filename": "_disjoint_set.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/scipy/py3/scipy/_lib/_disjoint_set.py",
"type": "Python"
} | """
Disjoint set data structure
"""
class DisjointSet:
""" Disjoint set data structure for incremental connectivity queries.
.. versionadded:: 1.6.0
Attributes
----------
n_subsets : int
The number of subsets.
Methods
-------
add
merge
connected
subset
subset... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@scipy@py3@scipy@_lib@_disjoint_set.py@.PATH_END.py |
{
"filename": "analyze_asl_dict.py",
"repo_name": "tijmen/cosmosage",
"repo_path": "cosmosage_extracted/cosmosage-main/analyze_asl_dict.py",
"type": "Python"
} | import sqlite3
import pandas as pd
import zlib
import pickle
def decompress_value(value):
try:
return zlib.decompress(value)
except zlib.error as e:
return f"Error decompressing: {e}"
def deserialize_value(value):
try:
return pickle.loads(value)
except pickle.UnpicklingError as... | tijmenREPO_NAMEcosmosagePATH_START.@cosmosage_extracted@cosmosage-main@analyze_asl_dict.py@.PATH_END.py |
{
"filename": "TROVE-pipeline.md",
"repo_name": "Trovemaster/TROVE",
"repo_path": "TROVE_extracted/TROVE-master/TROVE.wiki/TROVE-pipeline.md",
"type": "Markdown"
} |
## The typical TROVE intensity project consists of the following steps:
1. Expansion of the Hamiltonian operator (generating kinetic and potential energy expansion coefficients numerically on-the-fly) as well as of any “external” function (e.g., dipole moment, polarizability, spin–spin coupling, or any other propert... | TrovemasterREPO_NAMETROVEPATH_START.@TROVE_extracted@TROVE-master@TROVE.wiki@TROVE-pipeline.md@.PATH_END.py |
{
"filename": "boxes.py",
"repo_name": "spacetelescope/specview",
"repo_path": "specview_extracted/specview-master/specview/ui/qt/boxes.py",
"type": "Python"
} | from ...external.qt import QtGui, QtCore
class StatisticsGroupBox(QtGui.QGroupBox):
def __init__(self, title="", parent=None):
super(StatisticsGroupBox, self).__init__(title, parent)
self.lbl_mean = QtGui.QLabel()
self.lbl_median = QtGui.QLabel()
self.lbl_stddev = QtGui.QLabel()
... | spacetelescopeREPO_NAMEspecviewPATH_START.@specview_extracted@specview-master@specview@ui@qt@boxes.py@.PATH_END.py |
{
"filename": "bokeh_plot_parallel.py",
"repo_name": "arviz-devs/arviz",
"repo_path": "arviz_extracted/arviz-main/examples/bokeh/bokeh_plot_parallel.py",
"type": "Python"
} | """
Parallel Plot
=============
"""
import arviz as az
data = az.load_arviz_data("centered_eight")
ax = az.plot_parallel(data, var_names=["theta", "tau", "mu"], backend="bokeh")
| arviz-devsREPO_NAMEarvizPATH_START.@arviz_extracted@arviz-main@examples@bokeh@bokeh_plot_parallel.py@.PATH_END.py |
{
"filename": "rescaling_test.py",
"repo_name": "keras-team/keras",
"repo_path": "keras_extracted/keras-master/keras/src/layers/preprocessing/rescaling_test.py",
"type": "Python"
} | import numpy as np
import pytest
from tensorflow import data as tf_data
from keras.src import backend
from keras.src import layers
from keras.src import testing
class RescalingTest(testing.TestCase):
@pytest.mark.requires_trainable_backend
def test_rescaling_basics(self):
self.run_layer_test(
... | keras-teamREPO_NAMEkerasPATH_START.@keras_extracted@keras-master@keras@src@layers@preprocessing@rescaling_test.py@.PATH_END.py |
{
"filename": "sysrem.py",
"repo_name": "rodluger/everest",
"repo_path": "everest_extracted/everest-master/everest/missions/k2/sysrem.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
:py:mod:`sysrem.py` - CBV routines
----------------------------------
Routines for computing the co-trending basis vectors (CBVs)
for each `K2` campaign using the :py:obj:`SysRem` algorithm.
'''
from __future__ import division, print_function, absolute_import, \
... | rodlugerREPO_NAMEeverestPATH_START.@everest_extracted@everest-master@everest@missions@k2@sysrem.py@.PATH_END.py |
{
"filename": "makeplot.py",
"repo_name": "VirtualPlanetaryLaboratory/vplanet",
"repo_path": "vplanet_extracted/vplanet-main/examples/DiffLimWaterEscape/makeplot.py",
"type": "Python"
} | """
Reproduces the T1-e curve from Figure 2 of Gialluca et al (2023, in prep)
and the T1-b curve from that Figure except with 10 TO initial instead of 200 TO
Megan Gialluca, UW, 2023
"""
import sys
import os
import pathlib
import matplotlib.pyplot as plt
import numpy as np
import vplanet
import vplot
# Get Path
#... | VirtualPlanetaryLaboratoryREPO_NAMEvplanetPATH_START.@vplanet_extracted@vplanet-main@examples@DiffLimWaterEscape@makeplot.py@.PATH_END.py |
{
"filename": "_shlex.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/argcomplete/py3/argcomplete/packages/_shlex.py",
"type": "Python"
} | # This copy of shlex.py from Python 3.6 is distributed with argcomplete.
# It contains only the shlex class, with modifications as noted.
"""A lexical analyzer class for simple shell-like syntaxes."""
# Module and documentation by Eric S. Raymond, 21 Dec 1998
# Input stacking and error message cleanup added by ESR, M... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@argcomplete@py3@argcomplete@packages@_shlex.py@.PATH_END.py |
{
"filename": "base.py",
"repo_name": "quatrope/feets",
"repo_path": "feets_extracted/feets-master/feets/datasets/base.py",
"type": "Python"
} | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2017 Juan Cabral
# 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 withou... | quatropeREPO_NAMEfeetsPATH_START.@feets_extracted@feets-master@feets@datasets@base.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "mackelab/sbi",
"repo_path": "sbi_extracted/sbi-main/sbi/utils/__init__.py",
"type": "Python"
} | # flake8: noqa
from sbi.utils.analysis_utils import get_1d_marginal_peaks_from_kde
from sbi.utils.io import get_data_root, get_log_root, get_project_root
from sbi.utils.kde import KDEWrapper, get_kde
from sbi.utils.potentialutils import pyro_potential_wrapper, transformed_potential
from sbi.utils.restriction_estimator ... | mackelabREPO_NAMEsbiPATH_START.@sbi_extracted@sbi-main@sbi@utils@__init__.py@.PATH_END.py |
{
"filename": "inset_locator.py",
"repo_name": "catboost/catboost",
"repo_path": "catboost_extracted/catboost-master/contrib/python/matplotlib/py3/mpl_toolkits/axes_grid1/inset_locator.py",
"type": "Python"
} | """
A collection of functions and objects for creating or placing inset axes.
"""
from matplotlib import _api, _docstring
from matplotlib.offsetbox import AnchoredOffsetbox
from matplotlib.patches import Patch, Rectangle
from matplotlib.path import Path
from matplotlib.transforms import Bbox, BboxTransformTo
from matp... | catboostREPO_NAMEcatboostPATH_START.@catboost_extracted@catboost-master@contrib@python@matplotlib@py3@mpl_toolkits@axes_grid1@inset_locator.py@.PATH_END.py |
{
"filename": "test_dataset_getitem.py",
"repo_name": "h5py/h5py",
"repo_path": "h5py_extracted/h5py-master/h5py/tests/test_dataset_getitem.py",
"type": "Python"
} | # This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
"""
Tests the h5py.Dataset.__getitem__ method.
... | h5pyREPO_NAMEh5pyPATH_START.@h5py_extracted@h5py-master@h5py@tests@test_dataset_getitem.py@.PATH_END.py |
{
"filename": "CODE_OF_CONDUCT.md",
"repo_name": "OpenAccess-AI-Collective/axolotl",
"repo_path": "axolotl_extracted/axolotl-main/.github/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 of... | OpenAccess-AI-CollectiveREPO_NAMEaxolotlPATH_START.@axolotl_extracted@axolotl-main@.github@CODE_OF_CONDUCT.md@.PATH_END.py |
{
"filename": "tfsa-2023-016.md",
"repo_name": "tensorflow/tensorflow",
"repo_path": "tensorflow_extracted/tensorflow-master/tensorflow/security/advisory/tfsa-2023-016.md",
"type": "Markdown"
} | ## TFSA-2023-016: Seg fault in `tf.raw_ops.Print`
### CVE Number
CVE-2023-25660
### Impact
When the parameter `summarize` of `tf.raw_ops.Print` is zero, the new method `SummarizeArray<bool>` will reference to a nullptr, leading to a seg fault.
```python
import tensorflow as tf
tf.raw_ops.Print(input = tf.constant(... | tensorflowREPO_NAMEtensorflowPATH_START.@tensorflow_extracted@tensorflow-master@tensorflow@security@advisory@tfsa-2023-016.md@.PATH_END.py |
{
"filename": "_base.py",
"repo_name": "google/jax",
"repo_path": "jax_extracted/jax-main/jax/experimental/sparse/_base.py",
"type": "Python"
} | # Copyright 2021 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | googleREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@experimental@sparse@_base.py@.PATH_END.py |
{
"filename": "minimize.py",
"repo_name": "google/jax",
"repo_path": "jax_extracted/jax-main/jax/_src/scipy/optimize/minimize.py",
"type": "Python"
} | # Copyright 2020 The JAX Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | googleREPO_NAMEjaxPATH_START.@jax_extracted@jax-main@jax@_src@scipy@optimize@minimize.py@.PATH_END.py |
{
"filename": "Interactive_data.ipynb",
"repo_name": "ialopezt/GalLenspy",
"repo_path": "GalLenspy_extracted/GalLenspy-master/Puntual_source/Source_estimation/Interactive_data.ipynb",
"type": "Jupyter Notebook"
} | ```python
from scipy.misc import *
import numpy as np
import pylab as plb
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from scipy.integrate import quad
from scipy.integrate import nquad
from scipy.misc import derivative
from ipywidgets import interact, interactive, fixed
from ipywidgets import widgets
fro... | ialopeztREPO_NAMEGalLenspyPATH_START.@GalLenspy_extracted@GalLenspy-master@Puntual_source@Source_estimation@Interactive_data.ipynb@.PATH_END.py |
{
"filename": "README.md",
"repo_name": "auckland-cosmo/PyUltraLight",
"repo_path": "PyUltraLight_extracted/PyUltraLight-master/Visualisations/README.md",
"type": "Markdown"
} | # PyUltraLight
This folder is the default location for saved visualisations from the Jupyter notebook. It may contain animations in time over the plane of symmetry or line of symmetry, or plots of the energy over time or snapshots of the density over time.
| auckland-cosmoREPO_NAMEPyUltraLightPATH_START.@PyUltraLight_extracted@PyUltraLight-master@Visualisations@README.md@.PATH_END.py |
{
"filename": "plot_constant.py",
"repo_name": "gammapy/gammapy",
"repo_path": "gammapy_extracted/gammapy-main/examples/models/spatial/plot_constant.py",
"type": "Python"
} | r"""
.. _constant-spatial-model:
Constant spatial model
======================
This model is a spatially constant model.
"""
# %%
# Example plot
# ------------
# Here is an example plot of the model:
from gammapy.maps import WcsGeom
from gammapy.modeling.models import (
ConstantSpatialModel,
Models,
Pow... | gammapyREPO_NAMEgammapyPATH_START.@gammapy_extracted@gammapy-main@examples@models@spatial@plot_constant.py@.PATH_END.py |
{
"filename": "pyaErrTemplate.py",
"repo_name": "sczesla/PyAstronomy",
"repo_path": "PyAstronomy_extracted/PyAstronomy-master/src/pyaC/pyaErrors/pyaErrTemplate.py",
"type": "Python"
} | from __future__ import print_function
import copy
import six
import traceback
class PyaErrTemplate(Exception):
def __init__(self, what, errType, where=None, why=None, solution=None, addInfo=None, tbfe=None):
"""
The PyA error class template.
Parameters
----------
what : string
... | sczeslaREPO_NAMEPyAstronomyPATH_START.@PyAstronomy_extracted@PyAstronomy-master@src@pyaC@pyaErrors@pyaErrTemplate.py@.PATH_END.py |
{
"filename": "__init__.py",
"repo_name": "solerjuan/astroHOG",
"repo_path": "astroHOG_extracted/astroHOG-master/example_subpkg/tests/__init__.py",
"type": "Python"
} | solerjuanREPO_NAMEastroHOGPATH_START.@astroHOG_extracted@astroHOG-master@example_subpkg@tests@__init__.py@.PATH_END.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.