repo
stringlengths
2
99
file
stringlengths
13
225
code
stringlengths
0
18.3M
file_length
int64
0
18.3M
avg_line_length
float64
0
1.36M
max_line_length
int64
0
4.26M
extension_type
stringclasses
1 value
ADaPTION
ADaPTION-master/frcnn/tools/lp_train_faster_rcnn_alt_opt.py
#!/usr/bin/env python # -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Train a Faster R-CNN network using alternat...
12,772
36.130814
80
py
ADaPTION
ADaPTION-master/frcnn/tools/train_svms.py
#!/usr/bin/env python # -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """ Train post-hoc SVMs using the algorithm and ...
13,480
37.081921
80
py
ADaPTION
ADaPTION-master/frcnn/tools/eval_recall.py
#!/usr/bin/env python import _init_paths from fast_rcnn.config import cfg, cfg_from_file, cfg_from_list from datasets.factory import get_imdb import argparse import time, os, sys import numpy as np def parse_args(): """ Parse input arguments """ parser = argparse.ArgumentParser(description='Test a Fas...
2,265
30.915493
77
py
ADaPTION
ADaPTION-master/frcnn/tools/rpn_generate.py
#!/usr/bin/env python # -------------------------------------------------------- # Fast/er/ R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Generate RPN proposals.""" import _init_...
2,994
31.554348
78
py
ADaPTION
ADaPTION-master/frcnn/tools/train_net.py
#!/usr/bin/env python # -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Train a Fast R-CNN network on a region of int...
3,747
32.168142
78
py
ADaPTION
ADaPTION-master/frcnn/lib/setup.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- import os from os.path import join as pjoin from setuptools import setu...
5,684
35.210191
90
py
ADaPTION
ADaPTION-master/frcnn/lib/roi_data_layer/layer.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """The data layer used during training to train a Fast R-CNN network. ...
7,449
36.817259
81
py
ADaPTION
ADaPTION-master/frcnn/lib/roi_data_layer/roidb.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Transform a roidb into a trainable roidb by adding a bunch of metada...
5,611
40.880597
80
py
ADaPTION
ADaPTION-master/frcnn/lib/roi_data_layer/minibatch.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Compute minibatch blobs for training a Fast R-CNN network.""" impor...
8,169
39.85
81
py
ADaPTION
ADaPTION-master/frcnn/lib/roi_data_layer/__init__.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # --------------------------------------------------------
248
34.571429
58
py
ADaPTION
ADaPTION-master/frcnn/lib/fast_rcnn/test.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Test a Fast R-CNN network on an imdb (image database).""" from fast...
11,126
35.601974
83
py
ADaPTION
ADaPTION-master/frcnn/lib/fast_rcnn/bbox_transform.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- import numpy as np def bbox_transform(ex_rois, gt_rois): ex_widths...
2,540
32
79
py
ADaPTION
ADaPTION-master/frcnn/lib/fast_rcnn/nms_wrapper.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- from fast_rcnn.config import cfg from nms.gpu_nms import gpu_nms from n...
642
29.619048
60
py
ADaPTION
ADaPTION-master/frcnn/lib/fast_rcnn/config.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Fast R-CNN config system. This file specifies default config option...
9,213
31.216783
91
py
ADaPTION
ADaPTION-master/frcnn/lib/fast_rcnn/__init__.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # --------------------------------------------------------
248
34.571429
58
py
ADaPTION
ADaPTION-master/frcnn/lib/fast_rcnn/train.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Train a Fast R-CNN network.""" import caffe from fast_rcnn.config i...
6,076
36.282209
79
py
ADaPTION
ADaPTION-master/frcnn/lib/datasets/kitti.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- import os from datasets.imdb import imdb import datasets.ds_utils as ds...
14,015
39.626087
86
py
ADaPTION
ADaPTION-master/frcnn/lib/datasets/voc_eval.py
# -------------------------------------------------------- # Fast/er R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Bharath Hariharan # -------------------------------------------------------- import xml.etree.ElementTree as ET import os import cPickle import numpy as np def parse_rec(f...
7,058
33.773399
78
py
ADaPTION
ADaPTION-master/frcnn/lib/datasets/pascal_voc.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- import os from datasets.imdb import imdb import datasets.ds_utils as ds...
14,542
40.081921
80
py
ADaPTION
ADaPTION-master/frcnn/lib/datasets/imdb.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- import os import os.path as osp import PIL from utils.cython_bbox impor...
9,811
37.629921
80
py
ADaPTION
ADaPTION-master/frcnn/lib/datasets/factory.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Factory method for easily getting imdbs by name.""" __sets = {} fr...
1,621
30.803922
79
py
ADaPTION
ADaPTION-master/frcnn/lib/datasets/ds_utils.py
# -------------------------------------------------------- # Fast/er R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- import numpy as np def unique_boxes(boxes, scale=1.0): """Return indices of unique boxes.""" ...
1,336
30.833333
72
py
ADaPTION
ADaPTION-master/frcnn/lib/datasets/__init__.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # --------------------------------------------------------
248
34.571429
58
py
ADaPTION
ADaPTION-master/frcnn/lib/datasets/coco.py
# -------------------------------------------------------- # Fast/er R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- from datasets.imdb import imdb import datasets.ds_utils as ds_utils from fast_rcnn.config import cf...
16,560
40.926582
94
py
ADaPTION
ADaPTION-master/frcnn/lib/datasets/tools/mcg_munge.py
import os import sys """Hacky tool to convert file system layout of MCG boxes downloaded from http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/mcg/ so that it's consistent with those computed by Jan Hosang (see: http://www.mpi-inf.mpg.de/departments/computer-vision-and-multimodal- computing/research...
1,451
36.230769
94
py
ADaPTION
ADaPTION-master/frcnn/lib/rpn/proposal_layer.py
# -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick and Sean Bell # -------------------------------------------------------- import caffe import numpy as np import yaml from fast_r...
7,171
37.352941
89
py
ADaPTION
ADaPTION-master/frcnn/lib/rpn/generate_anchors.py
# -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick and Sean Bell # -------------------------------------------------------- import numpy as np # Verify that we compute the same a...
3,110
28.349057
78
py
ADaPTION
ADaPTION-master/frcnn/lib/rpn/generate.py
# -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- from fast_rcnn.config import cfg from utils.blob import im_list_to_bl...
3,894
32.008475
75
py
ADaPTION
ADaPTION-master/frcnn/lib/rpn/proposal_target_layer.py
# -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick and Sean Bell # -------------------------------------------------------- import caffe import yaml import numpy as np import nump...
7,494
37.634021
85
py
ADaPTION
ADaPTION-master/frcnn/lib/rpn/anchor_target_layer.py
# -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick and Sean Bell # -------------------------------------------------------- import os import caffe import yaml from fast_rcnn.confi...
11,575
39.055363
95
py
ADaPTION
ADaPTION-master/frcnn/lib/rpn/__init__.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick and Sean Bell # --------------------------------------------------------
262
36.571429
58
py
ADaPTION
ADaPTION-master/frcnn/lib/pycocotools/cocoeval.py
__author__ = 'tsungyi' import numpy as np import datetime import time from collections import defaultdict import mask import copy class COCOeval: # Interface for evaluating detection on the Microsoft COCO dataset. # # The usage for CocoEval is as follows: # cocoGt=..., cocoDt=... # load dataset...
19,735
43.45045
131
py
ADaPTION
ADaPTION-master/frcnn/lib/pycocotools/__init__.py
__author__ = 'tylin'
21
10
20
py
ADaPTION
ADaPTION-master/frcnn/lib/pycocotools/coco.py
__author__ = 'tylin' __version__ = '1.0.1' # Interface for accessing the Microsoft COCO dataset. # Microsoft COCO is a large image dataset designed for object detection, # segmentation, and caption generation. pycocotools is a Python API that # assists in loading, parsing and visualizing the annotations in COCO. # Ple...
14,881
41.278409
128
py
ADaPTION
ADaPTION-master/frcnn/lib/pycocotools/mask.py
__author__ = 'tsungyi' import pycocotools._mask as _mask # Interface for manipulating masks stored in RLE format. # # RLE is a simple yet efficient format for storing binary masks. RLE # first divides a vector (or vectorized image) into a series of piecewise # constant regions and then for each piece simply stores th...
4,058
48.5
100
py
ADaPTION
ADaPTION-master/frcnn/lib/utils/timer.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- import time class Timer(object): """A simple timer.""" def __i...
948
27.757576
71
py
ADaPTION
ADaPTION-master/frcnn/lib/utils/blob.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Blob helper functions.""" import numpy as np import cv2 def im_lis...
1,625
34.347826
75
py
ADaPTION
ADaPTION-master/frcnn/lib/utils/__init__.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # --------------------------------------------------------
248
34.571429
58
py
ADaPTION
ADaPTION-master/frcnn/lib/transform/__init__.py
0
0
0
py
ADaPTION
ADaPTION-master/frcnn/lib/transform/torch_image_transform_layer.py
# -------------------------------------------------------- # Fast/er R-CNN # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- """ Transform images for compatibility with models trained with https://github.com/facebook/fb.resnet.torch. Usage in model p...
2,000
29.784615
72
py
ADaPTION
ADaPTION-master/frcnn/lib/nms/py_cpu_nms.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- import numpy as np def py_cpu_nms(dets, thresh): """Pure Python NM...
1,051
25.974359
59
py
ADaPTION
ADaPTION-master/frcnn/lib/nms/__init__.py
0
0
0
py
selectionfunctions
selectionfunctions-main/setup.py
#!/usr/bin/env python # # setup.py # Package "selectionfunctions" for pip. # # Copyright (C) 2019 Douglas Boubert # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the Licen...
3,902
29.492188
95
py
selectionfunctions
selectionfunctions-main/selectionfunctions/sets.py
#!/usr/bin/env python # # sets.py # Generates selection functions for combined samples (e.g. APOGEE + GaiaDR2) # # Copyright (C) 2020 Douglas Boubert & Andrew Everall # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Fr...
5,309
30.987952
112
py
selectionfunctions
selectionfunctions-main/selectionfunctions/rrl_mateu_2020.py
#!/usr/bin/env python # # rrl_mateu_2020.py # Implements querying of the completeness maps from # Mateu, Holl, De Ridder & Rimoldini (2020). # # Copyright (C) 2020 Douglas Boubert & Andrew Everall # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public Li...
10,575
39.992248
148
py
selectionfunctions
selectionfunctions-main/selectionfunctions/sfexceptions.py
#!/usr/bin/env python # # sfexceptions.py # Defines exceptions for the selectionfunctions package. # # Copyright (C) 2020 Douglas Boubert # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; eithe...
1,655
35
88
py
selectionfunctions
selectionfunctions-main/selectionfunctions/cog_v.py
#!/usr/bin/env python # # cog_vi.py # Implements the selection function from Completeness # of the Gaia-verse Paper IV, in prep. # # Copyright (C) 2021 Douglas Boubert & Andrew Everall # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
39,144
40.118697
232
py
selectionfunctions
selectionfunctions-main/selectionfunctions/healpix_map.py
#!/usr/bin/env python # # healpix_map.py # A set of HEALPix map classes. # # Copyright (C) 2020 Douglas Boubert # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License...
4,333
36.042735
80
py
selectionfunctions
selectionfunctions-main/selectionfunctions/fetch_utils.py
#!/usr/bin/env python # # fetch_utils.py # Utility funcgtions for fetching data files required by the selection functions library. # # Copyright (C) 2019 Douglas Boubert # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
15,289
33.359551
89
py
selectionfunctions
selectionfunctions-main/selectionfunctions/std_paths.py
#!/usr/bin/env python # # std_paths.py # Defines a set of paths used by scripts in the selectionfunctions module. # # Copyright (C) 2020 Douglas Boubert # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Fou...
1,766
30.553571
77
py
selectionfunctions
selectionfunctions-main/selectionfunctions/source.py
#!/usr/bin/env python # # source.py # Provides a new class that extends astropy SkyCoord. # # Copyright (C) 2020 Douglas Boubert # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version...
8,316
35.47807
136
py
selectionfunctions
selectionfunctions-main/selectionfunctions/config.py
#!/usr/bin/env python # # config.py # Allow configuration options to be set. # # Copyright (C) 2020 Douglas Boubert # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the Lic...
4,772
33.839416
84
py
selectionfunctions
selectionfunctions-main/selectionfunctions/map.py
#!/usr/bin/env python # # map.py # A generic interface to a 3D selection function. # # Copyright (C) 2020 Douglas Boubert # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of t...
24,343
34.230101
112
py
selectionfunctions
selectionfunctions-main/selectionfunctions/equirectangular_map.py
#!/usr/bin/env python # # equirectangular_map.py # Implements a class for querying selection functions that are stored in an # Equirectangular projection. # # Copyright (C) 2020 Douglas Boubert # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
13,805
40.089286
88
py
selectionfunctions
selectionfunctions-main/selectionfunctions/__init__.py
#!/usr/bin/env python # # __init__.py # Makes the contents of the package "dustmaps" discoverable. # # Copyright (C) 2020 Douglas Boubert # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; eithe...
847
37.545455
73
py
selectionfunctions
selectionfunctions-main/selectionfunctions/cog_ii.py
#!/usr/bin/env python # # cog_ii.py # Reads the Gaia DR2 selection function from Completeness # of the Gaia-verse Paper II, Boubert & Everall (2020). # # Copyright (C) 2020 Douglas Boubert & Andrew Everall # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General ...
10,361
37.377778
171
py
selectionfunctions
selectionfunctions-main/selectionfunctions/json_serializers.py
#!/usr/bin/env python # # json_serializers.py # Contains JSON (de)serializers for: # astropy.units.Quantity # astropy.coordinates.SkyCoord # numpy.ndarray # numpy.dtype # numpy.floating # numpy.integer # # Copyright (C) 2020 Douglas Boubert # # This program is free software; you can redistribut...
11,780
27.59466
89
py
selectionfunctions
selectionfunctions-main/selectionfunctions/unstructured_map.py
#!/usr/bin/env python # # unstructured_map.py # Implements a class for querying selection functions with unstructured pixels. Sky # coordinates are assigned to the nearest pixel. # # Copyright (C) 2020 Douglas Boubert # # This program is free software; you can redistribute it and/or modify # it under the terms of the ...
4,722
37.713115
90
py
selectionfunctions
selectionfunctions-main/selectionfunctions/examples/__init__.py
#!/usr/bin/env python # # __init__.py # Makes the examples in the package "selectionfunctions" discoverable. # # Copyright (C) 2019 Douglas Boubert # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundat...
857
38
73
py
selectionfunctions
selectionfunctions-main/selectionfunctions/examples/FIRE/gobs_eff_query.py
import sys, pickle sys.path.append('/home/andy/Documents/Research/software/') import sqlutilpy, getdata, numpy as np, h5py catalogue = "gaia_edr3.gaia_source"#"andy_everall.gaia3_rand100m" query = f"""select floor(phot_g_mean_mag/0.1)*0.1 as magbin, sum(phot_g_n_obs) as k, sum(m...
1,012
35.178571
67
py
selectionfunctions
selectionfunctions-main/selectionfunctions/examples/FIRE/gamp_query.py
import sys, pickle sys.path.append('/home/andy/Documents/Research/software/') import sqlutilpy, getdata, numpy as np, h5py #catalogue = "gaia_edr3.gaia_source" catalogue = "andy_everall.gaia3_rand100m" query = f"""select floor(phot_g_mean_mag/0.1)*0.1 as magbin, percentile_cont(0.5) within group (O...
922
35.92
135
py
selectionfunctions
selectionfunctions-main/selectionfunctions/tests/test_cog_ii.py
#!/usr/bin/env python # # test_cog_ii.py # Test query code for the Boubert & Everall (2020) selection function. # # Copyright (C) 2020 Douglas Boubert & Andrew Everall. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the ...
3,672
31.794643
88
py
selectionfunctions
selectionfunctions-main/selectionfunctions/tests/__init__.py
#!/usr/bin/env python # # __init__.py # Makes the tests in the package "selectionfunctions" discoverable. # # Copyright (C) 2019 Douglas Boubert # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation;...
853
37.818182
73
py
selectionfunctions
selectionfunctions-main/docs/conf.py
# -*- coding: utf-8 -*- # # dustmaps documentation build configuration file, created by # sphinx-quickstart on Fri Oct 14 17:20:58 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
11,441
27.605
80
py
imsrg
imsrg-master/src/pybind11/setup.py
#!/usr/bin/env python # Setup script for PyPI; use CMakeFile.txt to build extension modules from setuptools import setup from pybind11 import __version__ import os # Prevent installation of pybind11 headers by setting # PYBIND11_USE_CMAKE. if os.environ.get('PYBIND11_USE_CMAKE'): headers = [] else: headers =...
3,646
40.91954
79
py
imsrg
imsrg-master/src/pybind11/tools/mkdoc.py
#!/usr/bin/env python3 # # Syntax: mkdoc.py [-I<path> ..] [.. a list of header files ..] # # Extract documentation from C++ header files to use it in Python bindings # import os import sys import platform import re import textwrap from clang import cindex from clang.cindex import CursorKind from collections import ...
10,341
32.908197
127
py
imsrg
imsrg-master/src/pybind11/tools/libsize.py
from __future__ import print_function, division import os import sys # Internal build script for generating debugging test .so size. # Usage: # python libsize.py file.so save.txt -- displays the size of file.so and, if save.txt exists, compares it to the # size in it, then...
1,098
27.179487
116
py
imsrg
imsrg-master/src/pybind11/pybind11/__main__.py
from __future__ import print_function import argparse import sys import sysconfig from . import get_include def print_includes(): dirs = [sysconfig.get_path('include')] if sysconfig.get_path('platinclude') not in dirs: dirs.append(sysconfig.get_path('platinclude')) if get_include() not in dirs: ...
791
23.75
83
py
imsrg
imsrg-master/src/pybind11/pybind11/_version.py
version_info = (2, 2, 'dev0') __version__ = '.'.join(map(str, version_info))
77
25
46
py
imsrg
imsrg-master/src/pybind11/pybind11/__init__.py
from ._version import version_info, __version__ # noqa: F401 imported but unused def get_include(*args, **kwargs): import os try: from pip import locations return os.path.dirname( locations.distutils_scheme('pybind11', *args, **kwargs)['headers']) except ImportError: r...
336
27.083333
81
py
imsrg
imsrg-master/src/pybind11/tests/test_class.py
import pytest from pybind11_tests import class_ as m from pybind11_tests import UserType, ConstructorStats def test_repr(): # In Python 3.3+, repr() accesses __qualname__ assert "pybind11_type" in repr(type(UserType)) assert "UserType" in repr(UserType) def test_instance(msg): with pytest.raises(Ty...
4,550
34.007692
96
py
imsrg
imsrg-master/src/pybind11/tests/test_smart_ptr.py
import pytest from pybind11_tests import ConstructorStats def test_smart_ptr(capture): # Object1 from pybind11_tests import (MyObject1, make_object_1, make_object_2, print_object_1, print_object_2, print_object_3, print_object_4) for i, o in enumerate([make_object_1(), mak...
8,732
34.072289
97
py
imsrg
imsrg-master/src/pybind11/tests/test_builtin_casters.py
# Python < 3 needs this: coding=utf-8 import pytest from pybind11_tests import builtin_casters as m from pybind11_tests import UserType, IncType def test_simple_string(): assert m.string_roundtrip("const char *") == "const char *" def test_unicode_conversion(): """Tests unicode conversion and error reporti...
7,822
34.238739
97
py
imsrg
imsrg-master/src/pybind11/tests/conftest.py
"""pytest configuration Extends output capture as needed by pybind11: ignore constructors, optional unordered lines. Adds docstring and exceptions message sanitizers: ignore Python 2 vs 3 differences. """ import pytest import textwrap import difflib import re import sys import contextlib import platform import gc _u...
6,526
26.195833
93
py
imsrg
imsrg-master/src/pybind11/tests/test_buffers.py
import struct import pytest from pybind11_tests import Matrix, ConstructorStats, PTMFBuffer, ConstPTMFBuffer, DerivedPTMFBuffer pytestmark = pytest.requires_numpy with pytest.suppress(ImportError): import numpy as np def test_from_python(): with pytest.raises(RuntimeError) as excinfo: Matrix(np.arra...
2,430
27.940476
99
py
imsrg
imsrg-master/src/pybind11/tests/test_virtual_functions.py
import pytest from pybind11_tests import virtual_functions as m from pybind11_tests import ConstructorStats def test_override(capture, msg): class ExtendedExampleVirt(m.ExampleVirt): def __init__(self, state): super(ExtendedExampleVirt, self).__init__(state + 1) self.data = "Hello...
11,020
29.277473
103
py
imsrg
imsrg-master/src/pybind11/tests/test_constants_and_functions.py
def test_constants(): from pybind11_tests import some_constant assert some_constant == 14 def test_function_overloading(): from pybind11_tests import MyEnum, test_function assert test_function() == "test_function()" assert test_function(7) == "test_function(7)" assert test_function(MyEnum....
1,100
24.022727
72
py
imsrg
imsrg-master/src/pybind11/tests/test_kwargs_and_defaults.py
import pytest from pybind11_tests import (kw_func0, kw_func1, kw_func2, kw_func3, kw_func4, args_function, args_kwargs_function, kw_func_udl, kw_func_udl_z, KWClass) def test_function_signatures(doc): assert doc(kw_func0) == "kw_func0(arg0: int, arg1: int) -> str" assert doc(kw_fun...
4,618
41.376147
119
py
imsrg
imsrg-master/src/pybind11/tests/test_modules.py
def test_nested_modules(): import pybind11_tests from pybind11_tests.submodule import submodule_func assert pybind11_tests.__name__ == "pybind11_tests" assert pybind11_tests.submodule.__name__ == "pybind11_tests.submodule" assert submodule_func() == "submodule_func()" def test_reference_interna...
2,208
29.680556
90
py
imsrg
imsrg-master/src/pybind11/tests/test_pickling.py
import pytest try: import cPickle as pickle # Use cPickle on Python 2.7 except ImportError: import pickle def test_roundtrip(): from pybind11_tests import Pickleable p = Pickleable("test_value") p.setExtra1(15) p.setExtra2(48) data = pickle.dumps(p, 2) # Must use pickle protocol >= 2 ...
834
22.194444
62
py
imsrg
imsrg-master/src/pybind11/tests/test_copy_move.py
import pytest from pybind11_tests import has_optional def test_lacking_copy_ctor(): from pybind11_tests import lacking_copy_ctor with pytest.raises(RuntimeError) as excinfo: lacking_copy_ctor.get_one() assert "the object is non-copyable!" in str(excinfo.value) def test_lacking_move_ctor(): f...
5,103
40.836066
99
py
imsrg
imsrg-master/src/pybind11/tests/test_methods_and_attributes.py
import pytest from pybind11_tests import ExampleMandA, ConstructorStats def test_methods_and_attributes(): instance1 = ExampleMandA() instance2 = ExampleMandA(32) instance1.add1(instance2) instance1.add2(instance2) instance1.add3(instance2) instance1.add4(instance2) instance1.add5(instanc...
16,018
33.823913
107
py
imsrg
imsrg-master/src/pybind11/tests/test_docstring_options.py
def test_docstring_options(): from pybind11_tests import (test_function1, test_function2, test_function3, test_function4, test_function5, test_function6, test_function7, DocstringTestFoo, test_overloaded1, test_overloa...
1,705
38.674419
87
py
imsrg
imsrg-master/src/pybind11/tests/test_eval.py
import os def test_evals(capture): from pybind11_tests import (test_eval_statements, test_eval, test_eval_single_statement, test_eval_file, test_eval_failure, test_eval_file_failure) with capture: assert test_eval_statements() assert capture == "Hello World!" ...
560
27.05
92
py
imsrg
imsrg-master/src/pybind11/tests/test_opaque_types.py
import pytest def test_string_list(): from pybind11_tests import StringList, ClassWithSTLVecProperty, print_opaque_list l = StringList() l.push_back("Element 1") l.push_back("Element 2") assert print_opaque_list(l) == "Opaque list: [Element 1, Element 2]" assert l.back() == "Element 2" f...
1,869
35.666667
106
py
imsrg
imsrg-master/src/pybind11/tests/test_chrono.py
def test_chrono_system_clock(): from pybind11_tests import test_chrono1 import datetime # Get the time from both c++ and datetime date1 = test_chrono1() date2 = datetime.datetime.today() # The returned value should be a datetime assert isinstance(date1, datetime.datetime) # The numb...
3,402
27.123967
81
py
imsrg
imsrg-master/src/pybind11/tests/test_numpy_vectorize.py
import pytest pytestmark = pytest.requires_numpy with pytest.suppress(ImportError): import numpy as np def test_vectorize(capture): from pybind11_tests import vectorized_func, vectorized_func2, vectorized_func3 assert np.isclose(vectorized_func3(np.array(3 + 7j)), [6 + 14j]) for f in [vectorized_f...
8,887
42.568627
121
py
imsrg
imsrg-master/src/pybind11/tests/test_stl_binders.py
import pytest import sys with pytest.suppress(ImportError): import numpy as np def test_vector_int(): from pybind11_tests import VectorInt v_int = VectorInt([0, 0]) assert len(v_int) == 2 assert bool(v_int) is True v_int2 = VectorInt([0, 0]) assert v_int == v_int2 v_int2[1] = 1 ...
4,850
22.779412
96
py
imsrg
imsrg-master/src/pybind11/tests/test_call_policies.py
import pytest def test_keep_alive_argument(capture): from pybind11_tests import Parent, Child, ConstructorStats n_inst = ConstructorStats.detail_reg_inst() with capture: p = Parent() assert capture == "Allocating parent." with capture: p.addChild(Child()) assert Constructo...
5,118
27.758427
79
py
imsrg
imsrg-master/src/pybind11/tests/test_multiple_inheritance.py
import pytest from pybind11_tests import ConstructorStats def test_multiple_inheritance_cpp(): from pybind11_tests import MIType mt = MIType(3, 4) assert mt.foo() == 3 assert mt.bar() == 4 def test_multiple_inheritance_mix1(): from pybind11_tests import Base2 class Base1: def __in...
9,277
25.737752
94
py
imsrg
imsrg-master/src/pybind11/tests/test_stl.py
import pytest from pybind11_tests import stl as m from pybind11_tests import UserType def test_vector(doc): """std::vector <-> list""" l = m.cast_vector() assert l == [1] l.append(2) assert m.load_vector(l) assert m.load_vector(tuple(l)) assert doc(m.cast_vector) == "cast_vector() -> Lis...
5,124
31.643312
107
py
imsrg
imsrg-master/src/pybind11/tests/test_numpy_dtypes.py
import re import pytest pytestmark = pytest.requires_numpy with pytest.suppress(ImportError): import numpy as np @pytest.fixture(scope='module') def simple_dtype(): ld = np.dtype('longdouble') return np.dtype({'names': ['bool_', 'uint_', 'float_', 'ldbl_'], 'formats': ['?', 'u4', 'f...
11,824
35.723602
99
py
imsrg
imsrg-master/src/pybind11/tests/test_eigen.py
import pytest pytestmark = pytest.requires_eigen_and_numpy with pytest.suppress(ImportError): import numpy as np ref = np.array([[ 0., 3, 0, 0, 0, 11], [22, 0, 0, 0, 17, 11], [ 7, 5, 0, 1, 0, 11], [ 0, 0, 0, 0, 0, 11], ...
28,676
38.718837
99
py
imsrg
imsrg-master/src/pybind11/tests/test_operator_overloading.py
import pytest from pybind11_tests import ConstructorStats def test_operator_overloading(): from pybind11_tests.operators import Vector2, Vector v1 = Vector2(1, 2) v2 = Vector(3, -1) assert str(v1) == "[1.000000, 2.000000]" assert str(v2) == "[3.000000, -1.000000]" assert str(v1 + v2) == "[4....
3,442
30.87963
93
py
imsrg
imsrg-master/src/pybind11/tests/test_enum.py
import pytest def test_unscoped_enum(): from pybind11_tests import UnscopedEnum, EOne assert str(UnscopedEnum.EOne) == "UnscopedEnum.EOne" assert str(UnscopedEnum.ETwo) == "UnscopedEnum.ETwo" assert str(EOne) == "UnscopedEnum.EOne" # __members__ property assert UnscopedEnum.__members__ == {"E...
4,144
30.884615
93
py
imsrg
imsrg-master/src/pybind11/tests/test_eval_call.py
# This file is called from 'test_eval.py' if 'call_test2' in locals(): call_test2(y) # noqa: F821 undefined name
119
23
46
py
imsrg
imsrg-master/src/pybind11/tests/test_exceptions.py
import pytest def test_std_exception(msg): from pybind11_tests import throw_std_exception with pytest.raises(RuntimeError) as excinfo: throw_std_exception() assert msg(excinfo.value) == "This exception was intentionally thrown." def test_error_already_set(msg): from pybind11_tests import th...
2,897
31.931818
89
py
imsrg
imsrg-master/src/pybind11/tests/test_pytypes.py
import pytest import sys from pybind11_tests import pytypes as m from pybind11_tests import debug_enabled def test_list(capture, doc): with capture: l = m.get_list() assert l == ["overwritten"] l.append("value2") m.print_list(l) assert capture.unordered == """ Entry a...
5,777
26.254717
88
py
imsrg
imsrg-master/src/pybind11/tests/test_callbacks.py
import pytest def test_callbacks(): from functools import partial from pybind11_tests import (test_callback1, test_callback2, test_callback3, test_callback4, test_callback5) def func1(): return "func1" def func2(a, b, c, d): return "func2", a, b, c, d ...
4,380
35.508333
99
py
imsrg
imsrg-master/src/pybind11/tests/test_sequences_and_iterators.py
import pytest def isclose(a, b, rel_tol=1e-05, abs_tol=0.0): """Like math.isclose() from Python 3.5""" return abs(a - b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol) def allclose(a_list, b_list, rel_tol=1e-05, abs_tol=0.0): return all(isclose(a, b, rel_tol=rel_tol, abs_tol=abs_tol) for a, b in zip(a_l...
5,189
30.26506
97
py