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
netcdf4-python
netcdf4-python-master/test/tst_stringarr.py
from netCDF4 import Dataset, stringtochar, chartostring import random, numpy, string import unittest import os from numpy.testing import assert_array_equal, assert_array_almost_equal def generateString(length, alphabet=string.ascii_letters + string.digits + string.punctuation): return(''.join([random.choice(alphab...
3,409
36.472527
95
py
netcdf4-python
netcdf4-python-master/test/tst_unlimdim.py
import sys import unittest import os import tempfile import numpy as np from numpy.random.mtrand import uniform from numpy.testing import assert_array_equal, assert_array_almost_equal import netCDF4 # test creating variables with unlimited dimensions, # writing to and retrieving data from such variables. # create an ...
2,210
32
91
py
netcdf4-python
netcdf4-python-master/test/tst_masked6.py
import unittest import os import tempfile import numpy as np from numpy import ma from numpy.testing import assert_array_almost_equal from netCDF4 import Dataset # Test automatic conversion of masked arrays (set_always_mask()) class SetAlwaysMaskTestBase(unittest.TestCase): """Base object for tests checking the...
3,641
25.583942
96
py
netcdf4-python
netcdf4-python-master/test/tst_masked3.py
import unittest import os import tempfile import numpy as np from numpy import ma from numpy.testing import assert_array_almost_equal from netCDF4 import Dataset, default_fillvals # Test automatic conversion of masked arrays (set_auto_mask()) class SetAutoMaskTestBase(unittest.TestCase): """Base object for test...
5,568
26.569307
106
py
netcdf4-python
netcdf4-python-master/test/tst_slicing.py
from netCDF4 import Dataset from numpy.random import seed, randint from numpy.testing import assert_array_equal, assert_equal,\ assert_array_almost_equal import tempfile, unittest, os, random, sys import numpy as np file_name = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name xdim=9; ydim=10; zdim=11 #seed...
10,135
35.992701
87
py
netcdf4-python
netcdf4-python-master/test/tst_compression_szip.py
from numpy.random.mtrand import uniform from netCDF4 import Dataset from numpy.testing import assert_almost_equal import os, tempfile, unittest, sys ndim = 100000 filename = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name datarr = uniform(size=(ndim,)) def write_netcdf(filename,dtype='f8'): nc = Data...
1,716
34.770833
183
py
netcdf4-python
netcdf4-python-master/test/tst_masked4.py
import unittest import os import tempfile import numpy as np from numpy import ma from numpy.testing import assert_array_almost_equal from netCDF4 import Dataset, default_fillvals # Test use of valid_min/valid_max/valid_range in generation of masked arrays class SetValidMinMax(unittest.TestCase): def setUp(self...
4,136
32.096
121
py
netcdf4-python
netcdf4-python-master/test/tst_compression_zstd.py
from numpy.random.mtrand import uniform from netCDF4 import Dataset from numpy.testing import assert_almost_equal import os, tempfile, unittest, sys ndim = 100000 filename1 = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name filename2 = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name array = un...
2,133
35.793103
125
py
netcdf4-python
netcdf4-python-master/test/tst_masked5.py
import unittest import os import tempfile import numpy as np from numpy import ma from numpy.testing import assert_array_equal from netCDF4 import Dataset, __netcdf4libversion__ # Test use of vector of missing values. class VectorMissingValues(unittest.TestCase): def setUp(self): self.testfile = tempfi...
1,787
25.294118
84
py
netcdf4-python
netcdf4-python-master/test/tst_grps2.py
import sys import unittest import os import tempfile import netCDF4 # test implicit group creation by using unix-like paths # in createVariable and createGroups (added in 1.1.8). # also test Dataset.__getitem__, also added in 1.1.8. FILE_NAME = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name class Group...
1,334
29.340909
73
py
netcdf4-python
netcdf4-python-master/test/tst_vlen.py
import sys import unittest import os import tempfile from netCDF4 import Dataset import numpy as np from numpy.testing import assert_array_equal FILE_NAME = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name VL_NAME = 'vlen_type' VL_BASETYPE = np.int16 DIM1_NAME = 'lon' DIM2_NAME = 'lat' nlons = 5; nlats = 5...
7,675
32.519651
86
py
netcdf4-python
netcdf4-python-master/test/tst_compression_blosc.py
from numpy.random.mtrand import uniform from netCDF4 import Dataset from numpy.testing import assert_almost_equal import os, tempfile, unittest, sys ndim = 100000 iblosc_shuffle=2 iblosc_complevel=4 filename = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name datarr = uniform(size=(ndim,)) def write_netcdf...
4,029
47.554217
125
py
netcdf4-python
netcdf4-python-master/test/tst_rename.py
import sys import unittest import os import tempfile import netCDF4 from netCDF4 import __has_rename_grp__ # test changing dimension, variable names # and deleting attributes. FILE_NAME = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name LAT_NAME="lat" LON_NAME="lon" LON_NAME2 = "longitude" LEVEL_NAME="lev...
5,167
35.13986
79
py
netcdf4-python
netcdf4-python-master/test/tst_alignment.py
import numpy as np from netCDF4 import set_alignment, get_alignment, Dataset from netCDF4 import __has_set_alignment__ import netCDF4 import os import subprocess import tempfile import unittest # During testing, sometimes development versions are used. # They may be written as 4.9.1-development libversion_no_developme...
5,676
33.828221
88
py
netcdf4-python
netcdf4-python-master/test/tst_filepath.py
import os, sys, shutil import tempfile import unittest import netCDF4 class test_filepath(unittest.TestCase): def setUp(self): self.netcdf_file = os.path.join(os.getcwd(), "netcdf_dummy_file.nc") self.nc = netCDF4.Dataset(self.netcdf_file) def test_filepath(self): assert self.nc.file...
1,067
29.514286
76
py
netcdf4-python
netcdf4-python-master/test/tst_issue908.py
import netCDF4, unittest import numpy as np class Issue908TestCase(unittest.TestCase): def setUp(self): nc = netCDF4.Dataset('CRM032_test1.nc') self.nc = nc def tearDown(self): self.nc.close() def runTest(self): data = self.nc['rgrid'][:] assert(data.all() is np.m...
378
18.947368
47
py
camel_tools
camel_tools-master/setup.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
4,817
32.227586
79
py
camel_tools
camel_tools-master/camel_tools/__init__.py
# MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitation the rights # to use, co...
1,567
39.205128
79
py
camel_tools
camel_tools-master/camel_tools/cli/camel_data.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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, inclu...
5,041
29.011905
79
py
camel_tools
camel_tools-master/camel_tools/cli/camel_diac.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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, inclu...
5,882
32.617143
79
py
camel_tools
camel_tools-master/camel_tools/cli/camel_arclean.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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, inclu...
3,901
29.015385
79
py
camel_tools
camel_tools-master/camel_tools/cli/camel_morphology.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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, inclu...
14,086
29.757642
79
py
camel_tools
camel_tools-master/camel_tools/cli/utils.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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, inclu...
1,914
34.462963
79
py
camel_tools
camel_tools-master/camel_tools/cli/camel_word_tokenize.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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, inclu...
3,552
28.363636
79
py
camel_tools
camel_tools-master/camel_tools/cli/camel_dediac.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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, inclu...
5,596
31.923529
79
py
camel_tools
camel_tools-master/camel_tools/cli/camel_transliterate.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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, inclu...
7,318
35.412935
79
py
camel_tools
camel_tools-master/camel_tools/cli/__init__.py
# MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitation the rights # to use, co...
1,203
47.16
79
py
camel_tools
camel_tools-master/camel_tools/morphology/reinflector.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
7,462
37.271795
81
py
camel_tools
camel_tools-master/camel_tools/morphology/errors.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
3,942
27.366906
79
py
camel_tools
camel_tools-master/camel_tools/morphology/utils.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
10,355
34.34471
79
py
camel_tools
camel_tools-master/camel_tools/morphology/analyzer.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
18,547
34.876209
79
py
camel_tools
camel_tools-master/camel_tools/morphology/database.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
17,140
34.415289
79
py
camel_tools
camel_tools-master/camel_tools/morphology/__init__.py
# MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitation the rights # to use, co...
1,315
47.740741
79
py
camel_tools
camel_tools-master/camel_tools/morphology/generator.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
9,177
39.078603
81
py
camel_tools
camel_tools-master/camel_tools/tokenizers/morphological.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
4,375
35.466667
79
py
camel_tools
camel_tools-master/camel_tools/tokenizers/__init__.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
1,208
42.178571
79
py
camel_tools
camel_tools-master/camel_tools/tokenizers/word.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
3,526
41.493976
79
py
camel_tools
camel_tools-master/camel_tools/sentiment/__init__.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitati...
6,028
34.464706
82
py
camel_tools
camel_tools-master/camel_tools/ner/__init__.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
17,999
40.189931
79
py
camel_tools
camel_tools-master/camel_tools/dialectid/model6.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
18,565
35.261719
79
py
camel_tools
camel_tools-master/camel_tools/dialectid/common.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
2,979
31.043011
79
py
camel_tools
camel_tools-master/camel_tools/dialectid/model26.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
22,736
35.495987
79
py
camel_tools
camel_tools-master/camel_tools/dialectid/__init__.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
2,040
38.25
79
py
camel_tools
camel_tools-master/camel_tools/utils/charsets.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
4,968
42.208696
80
py
camel_tools
camel_tools-master/camel_tools/utils/dediac.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
3,413
27.689076
79
py
camel_tools
camel_tools-master/camel_tools/utils/charmap.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
10,962
34.478964
79
py
camel_tools
camel_tools-master/camel_tools/utils/stringutils.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
2,753
30.295455
79
py
camel_tools
camel_tools-master/camel_tools/utils/__init__.py
# MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitation the rights # to use, co...
1,232
46.423077
79
py
camel_tools
camel_tools-master/camel_tools/utils/normalize.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
7,288
25.032143
79
py
camel_tools
camel_tools-master/camel_tools/utils/transliterate.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
4,578
36.532787
79
py
camel_tools
camel_tools-master/camel_tools/data/downloader.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
6,437
33.427807
79
py
camel_tools
camel_tools-master/camel_tools/data/post_install.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
2,459
34.652174
79
py
camel_tools
camel_tools-master/camel_tools/data/__init__.py
# MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitation the rights # to use, co...
1,763
34.28
79
py
camel_tools
camel_tools-master/camel_tools/data/catalogue.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
17,448
31.614953
102
py
camel_tools
camel_tools-master/camel_tools/tagger/common.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
1,846
34.519231
79
py
camel_tools
camel_tools-master/camel_tools/tagger/__init__.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
1,151
45.08
79
py
camel_tools
camel_tools-master/camel_tools/tagger/default.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
5,459
29.333333
79
py
camel_tools
camel_tools-master/camel_tools/disambig/mle.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
10,769
36.137931
81
py
camel_tools
camel_tools-master/camel_tools/disambig/score_function.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
3,483
31.867925
79
py
camel_tools
camel_tools-master/camel_tools/disambig/common.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
5,555
34.845161
79
py
camel_tools
camel_tools-master/camel_tools/disambig/__init__.py
# MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitation the rights # to use, co...
1,210
47.44
79
py
camel_tools
camel_tools-master/camel_tools/disambig/bert/unfactored.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
25,500
38.536434
100
py
camel_tools
camel_tools-master/camel_tools/disambig/bert/__init__.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
1,279
40.290323
79
py
camel_tools
camel_tools-master/camel_tools/disambig/bert/_bert_morph_dataset.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
12,226
43.300725
79
py
camel_tools
camel_tools-master/tests/test_stringutils.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
2,321
31.25
79
py
camel_tools
camel_tools-master/tests/test_charmap.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
12,276
29.46402
79
py
camel_tools
camel_tools-master/tests/test_meta.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
1,967
34.781818
79
py
camel_tools
camel_tools-master/tests/test_transliterate.py
# -*- coding: utf-8 -*- # MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitatio...
7,987
32.704641
79
py
camel_tools
camel_tools-master/tests/__init__.py
# MIT License # # Copyright 2018-2022 New York University Abu Dhabi # # 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 without limitation the rights # to use, co...
1,125
50.181818
79
py
camel_tools
camel_tools-master/docs/source/conf.py
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
5,775
28.025126
79
py
femocs
femocs-main/in/flat.py
#!/usr/bin/python import numpy as np width = 30 Nwidth = 8 x = np.linspace(-width, width, Nwidth) y = np.copy(x) X,Y = np.meshgrid(x,y) Z = np.copy(X) * 0 X = np.reshape(X,-1) Y = np.reshape(Y,-1) Z = np.reshape(Z,-1) with open("flat.ckx","w") as f: f.write("%d\nMedium properties=type:I:1:pos:R:3\n"%len(X)) for i ...
381
19.105263
59
py
cqr
cqr-master/nonconformist/nc.py
#!/usr/bin/env python """ Nonconformity functions. """ # Authors: Henrik Linusson # Yaniv Romano modified RegressorNc class to include CQR from __future__ import division import abc import numpy as np import sklearn.base from nonconformist.base import ClassifierAdapter, RegressorAdapter from nonconformist.base impo...
17,678
27.79316
79
py
cqr
cqr-master/nonconformist/base.py
#!/usr/bin/env python """ docstring """ # Authors: Henrik Linusson import abc import numpy as np from sklearn.base import BaseEstimator class RegressorMixin(object): def __init__(self): super(RegressorMixin, self).__init__() @classmethod def get_problem_type(cls): return 'regression' class ClassifierMix...
3,379
20.528662
63
py
cqr
cqr-master/nonconformist/icp.py
#!/usr/bin/env python """ Inductive conformal predictors. """ # Authors: Henrik Linusson from __future__ import division from collections import defaultdict from functools import partial import numpy as np from sklearn.base import BaseEstimator from nonconformist.base import RegressorMixin, ClassifierMixin from no...
13,978
30.698413
79
py
cqr
cqr-master/nonconformist/cp.py
from nonconformist.icp import * # TODO: move contents from nonconformist.icp here # ----------------------------------------------------------------------------- # TcpClassifier # ----------------------------------------------------------------------------- class TcpClassifier(BaseEstimator, ClassifierMixin): """Tra...
5,299
29.813953
79
py
cqr
cqr-master/nonconformist/util.py
from __future__ import division import numpy as np def calc_p(ncal, ngt, neq, smoothing=False): if smoothing: return (ngt + (neq + 1) * np.random.uniform(0, 1)) / (ncal + 1) else: return (ngt + neq + 1) / (ncal + 1)
223
23.888889
65
py
cqr
cqr-master/nonconformist/__init__.py
#!/usr/bin/env python """ docstring """ # Authors: Henrik Linusson # Yaniv Romano modified np.py file to include CQR __version__ = '2.1.0' __all__ = ['icp', 'nc', 'acp']
174
12.461538
49
py
cqr
cqr-master/nonconformist/evaluation.py
#!/usr/bin/env python """ Evaluation of conformal predictors. """ # Authors: Henrik Linusson # TODO: cross_val_score/run_experiment should possibly allow multiple to be evaluated on identical folding from __future__ import division from nonconformist.base import RegressorMixin, ClassifierMixin import sys import n...
14,339
30.378556
106
py
cqr
cqr-master/nonconformist/acp.py
#!/usr/bin/env python """ Aggregated conformal predictors """ # Authors: Henrik Linusson import numpy as np from sklearn.cross_validation import KFold, StratifiedKFold from sklearn.cross_validation import ShuffleSplit, StratifiedShuffleSplit from sklearn.base import clone from nonconformist.base import BaseEstimator...
10,138
26.402703
79
py
cqr
cqr-master/get_meps_data/meps_dataset_panel19_fy2015_reg.py
# This code is a variant of # https://github.com/IBM/AIF360/blob/master/aif360/datasets/meps_dataset_panel19_fy2015.py from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import pandas as pd from save_dataset import Save...
5,141
48.442308
137
py
cqr
cqr-master/get_meps_data/base_dataset.py
# Code copied from IBM's AIF360 package: # https://github.com/IBM/AIF360/blob/master/aif360/datasets/dataset.py from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import abc import copy import sys if sys.version_info >=...
2,782
32.53012
80
py
cqr
cqr-master/get_meps_data/meps_dataset_panel21_fy2016_reg.py
# This code is a variant of # https://github.com/IBM/AIF360/blob/master/aif360/datasets/meps_dataset_panel21_fy2016.py from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import pandas as pd #from standard_dataset import...
5,262
49.12381
137
py
cqr
cqr-master/get_meps_data/structured_dataset.py
# Code copied from IBM's AIF360 package # https://github.com/IBM/AIF360/blob/master/aif360/datasets/structured_dataset.py from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from collections import defaultdict from contex...
24,495
43.70073
133
py
cqr
cqr-master/get_meps_data/save_dataset.py
# Code copied from IBM's AIF360 package # https://github.com/IBM/AIF360/blob/master/aif360/datasets/standard_dataset.py from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from logging import warning import numpy as np i...
6,412
45.136691
112
py
cqr
cqr-master/get_meps_data/regression_dataset.py
# Code copied from IBM's AIF360 package # https://github.com/IBM/AIF360/blob/master/aif360/datasets/binary_label_dataset.py from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np from structured_dataset i...
2,259
39.357143
83
py
cqr
cqr-master/get_meps_data/meps_dataset_panel20_fy2015_reg.py
# This code is a variant of # https://github.com/IBM/AIF360/blob/master/aif360/datasets/meps_dataset_panel20_fy2015.py from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import pandas as pd #from standard_datasets impor...
5,265
48.679245
137
py
cqr
cqr-master/get_meps_data/main_clean_and_save_to_csv.py
# Code based on IBM's AIF360 software package, suggesting a simple modification # that accumulates the medical utilization variables without binarization # Load packages from meps_dataset_panel19_fy2015_reg import MEPSDataset19Reg from meps_dataset_panel20_fy2015_reg import MEPSDataset20Reg from meps_dataset_panel21_...
8,836
50.678363
107
py
cqr
cqr-master/cqr/torch_models.py
import sys import copy import torch import numpy as np import torch.nn as nn from cqr import helper from sklearn.model_selection import train_test_split if torch.cuda.is_available(): device = "cuda:0" else: device = "cpu" ############################################################################### # Help...
17,313
33.217391
215
py
cqr
cqr-master/cqr/tune_params_cv.py
from cqr import helper from skgarden import RandomForestQuantileRegressor from sklearn.model_selection import train_test_split def CV_quntiles_rf(params, X, y, target_coverage, grid_q, test_ratio, random...
3,123
42.388889
109
py
cqr
cqr-master/cqr/helper.py
import sys import torch import numpy as np from cqr import torch_models from functools import partial from cqr import tune_params_cv from nonconformist.cp import IcpRegressor from nonconformist.base import RegressorAdapter from skgarden import RandomForestQuantileRegressor if torch.cuda.is_available(): device = "...
22,414
36.927242
133
py
cqr
cqr-master/cqr/__init__.py
#!/usr/bin/env python
22
10.5
21
py
cqr
cqr-master/datasets/datasets.py
import numpy as np import pandas as pd def GetDataset(name, base_path): """ Load a dataset Parameters ---------- name : string, dataset name base_path : string, e.g. "path/to/datasets/directory/" Returns ------- X : features (nXp) y : labels (n) """ if name=="m...
17,896
49.414085
122
py
cqr
cqr-master/reproducible_experiments/run_equalized_coverage_experiment.py
#!/usr/bin/env python # coding: utf-8 import os import torch import random import numpy as np np.warnings.filterwarnings('ignore') from datasets import datasets from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split import pandas as pd # for MEPS def condition(x, y=Non...
22,793
41.36803
118
py
cqr
cqr-master/reproducible_experiments/all_equalized_coverage_experiments.py
############################################################################### # Script for reproducing the results of CQR paper ############################################################################### import numpy as np from reproducible_experiments.run_equalized_coverage_experiment import run_equalized_cover...
1,442
40.228571
104
py
cqr
cqr-master/reproducible_experiments/all_cqr_experiments.py
############################################################################### # Script for reproducing the results of CQR paper ############################################################################### import numpy as np from reproducible_experiments.run_cqr_experiment import run_experiment #from run_cqr_expe...
1,670
32.42
79
py
cqr
cqr-master/reproducible_experiments/run_cqr_experiment.py
import os import sys import torch import random import numpy as np import pandas as pd from cqr import helper from datasets import datasets from sklearn import linear_model from nonconformist.nc import NcFactory from nonconformist.nc import RegressorNc from nonconformist.nc import AbsErrorErrFunc from nonconformist.nc ...
30,512
41.915612
139
py
tmbidl
tmbidl-master/catalogs/generateContCat.py
# generateContCat.py - generate continuum catalog # # Usage: # # > python generateContCat.py <catalog name> # def generateContCat(proj='hii'): # set the output file outfile = 'source_catalog' fout = open(outfile, 'w') print " " print "Reading data from proj :", proj print " " # define ...
2,910
34.5
259
py
MCEvidence
MCEvidence-master/examples.py
''' Collection of codes that can be used to test the MCEvidence code. The examples below demostrate the validitiy of MCEvidence for three MCMC samplers: * Gibbs Sampling * PyStan NUT sampler * EMCEE sampler Two types of likelihood surface is considered * Gaussian Linear Model - 3 dimensions * N-dimensional Gaussian...
18,044
30.994681
104
py
MCEvidence
MCEvidence-master/setup.py
#!/usr/bin/env python from __future__ import absolute_import import io import re import os try: from setuptools import setup except ImportError: from distutils.core import setup def find_version(): version_file = io.open(os.path.join(os.path.dirname(__file__), 'MCEvidence.py')).read() version_match =...
1,451
29.25
91
py
MCEvidence
MCEvidence-master/MCEvidence.py
#!usr/bin/env python """ Authors : Yabebal Fantaye Email : yabi@aims.ac.za Affiliation : African Institute for Mathematical Sciences - South Africa Stellenbosch University - South Africa License : MIT Status : Under Development Description : Python implementation of the evidence estimation from MCMC ch...
58,030
38.343051
126
py