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 |
|---|---|---|---|---|---|---|
theedhum-nandrum | theedhum-nandrum-master/src/tn/document/languagehelper.py | '''
@author mojosaurus
Language helper class
'''
from src.tn.document.collectiontuple import CollectionTuple
from src.tn.document.document import Document
import cld2
# This is the helper class for language classification in the context of theedhum nandrum.
# All languahe related functions go here.
class LanguageHel... | 1,899 | 34.849057 | 96 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/document/emojihelper.py | '''
@author mojosaurus
Theedhum Nandrum version of emoji class
'''
import emoji
from src.tn.document.collectiontuple import CollectionTuple
from src.tn.document.document import Document
# Emoji is a special case of CollectionTuple
class Emoji(CollectionTuple):
def __init__(self, lang : str="emoji", text:str=""):
... | 3,221 | 39.78481 | 106 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/document/spellcheckhelper.py | '''
@author mojosaurus
Spellcheck helper class
'''
from src.tn.document.collectiontuple import CollectionTuple
import src.tn.lib.spell as spell
from src.tn.document.document import Document
# This is the helper class for spell check and correction in the context of theedhum nandrum.
# Currently it takes handles onl... | 1,623 | 37.666667 | 93 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/document/__init__.py | """ Package Initialization file. """ | 36 | 36 | 36 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/document/collectiontuple.py | '''
@author mojosaurus
This is a logical single block of the document
'''
class CollectionTuple:
def __init__(self, lang : str = "", text : str =""):
# jiji is a random name to capture the context of the tuple. Too sleepy to name it anything.
self.jiji = {
"lang" : lang,
... | 603 | 26.454545 | 101 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/docproc/spellchecktagger.py | '''
@author mojosaurus
Technically, spellcheck is not a tagger. It works on the tags generated by language tagger.
Don't use this before languagetagger is used
'''
import os,sys
# Appeding our src directory to sys path so that we can import modules.
sys.path.append(os.path.join(os.path.dirname(__file__),'../../..'))
... | 1,045 | 40.84 | 93 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/docproc/emojitagger.py | '''
@author mojosaurus
Tags emojis
'''
import os,sys
# Appeding our src directory to sys path so that we can import modules.
sys.path.append(os.path.join(os.path.dirname(__file__),'../../..'))
from src.tn.document.document import Document
from src.tn.docproc.pipeline import Tagger
from src.tn.document.emojihelper impo... | 1,015 | 39.64 | 93 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/docproc/languagetagger.py | '''
@author mojosaurus
Tags languages
'''
import os,sys
# Appeding our src directory to sys path so that we can import modules.
sys.path.append(os.path.join(os.path.dirname(__file__),'../../..'))
from src.tn.document.document import Document
from src.tn.docproc.pipeline import Tagger
from src.tn.document.languagehelpe... | 1,018 | 36.740741 | 93 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/docproc/lowercase.py | '''
@author mojosaurus
Replaces multiple whitespaces with one whitespace
'''
import os,sys
# Appeding our src directory to sys path so that we can import modules.
sys.path.append(os.path.join(os.path.dirname(__file__),'../../..'))
from src.tn.docproc.pipeline import Step
from src.tn.document.document import Document
c... | 844 | 41.25 | 93 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/docproc/regexes.py | '''
@author mojosaurus
This step does a bunch of things as part of document cleanup. More details in comments below
'''
import os,sys
# Appeding our src directory to sys path so that we can import modules.
sys.path.append(os.path.join(os.path.dirname(__file__),'../../..'))
from src.tn.docproc.pipeline import Step
from ... | 1,560 | 47.78125 | 129 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/docproc/whitespace.py | '''
@author mojosaurus
Replaces multiple whitespaces with one whitespace
'''
import os,sys
# Appeding our src directory to sys path so that we can import modules.
sys.path.append(os.path.join(os.path.dirname(__file__),'../../..'))
from src.tn.docproc.pipeline import Step
from src.tn.document.document import Document
c... | 848 | 41.45 | 93 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/docproc/__init__.py | """ Package Initialization file. """ | 36 | 36 | 36 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/docproc/process.py | '''
@author mojosaurus
This is the file that executes the pipeline
'''
import os,sys
# Appeding our src directory to sys path so that we can import modules.
sys.path.append(os.path.join(os.path.dirname(__file__),'../../..'))
from src.tn.docproc.pipeline import Step
from src.tn.docproc.whitespace import Whitespace
from... | 1,261 | 39.709677 | 182 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/docproc/pipeline.py | '''
@author mojosaurus
This file defines docproc pipeline to clean up input data.
This might be broken down into multiple intermediary steps and the final output comes out at last.
'''
'''
This baseclass defines the list of functions that need to be implemented in each of the steps in the
pipeline.
Each step in the pi... | 1,691 | 29.214286 | 100 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/lib/sentimoji.py | """
Module to convert Unicode Emojis to corresponding Sentiment Rankings.
Based on the research by Kralj Novak P, Smailović J, Sluban B, Mozetič I
(2015) on Sentiment of Emojis.
Journal Link:
https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0144296
CSV Data acquired from CLAR... | 2,211 | 29.722222 | 89 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/lib/feature_utils.py | from emoji import UNICODE_EMOJI
import re
import sys, os
from googletrans import Translator
from langdetect import detect
import math
from bisect import bisect_left
from .sentimoji import get_emoji_sentiment_rank
def load_docs(source, mode='train'):
documents = {'data': [], 'target_names': [], 'ids': []}
with... | 4,517 | 34.857143 | 189 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/lib/__init__.py | """ Package Initialization file. """ | 36 | 36 | 36 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/lib/Singleton.py | class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls] | 237 | 38.666667 | 81 | py |
theedhum-nandrum | theedhum-nandrum-master/src/tn/lib/spell.py | """Spelling Corrector in Python 3; see http://norvig.com/spell-correct.html
Copyright (c) 2007-2016 Peter Norvig
MIT license: www.opensource.org/licenses/mit-license.php
"""
################ Spelling Corrector
import re
import os
from collections import Counter
def words(text): return re.findall(r'\w+', text.lower... | 4,253 | 36.646018 | 110 | py |
pycpd | pycpd-master/setup.py | from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='pycpd',
version='2.0.2',
description='Pure Numpy Implementation of the Coherent Point Drift Algorithm',
long_description=readme(),
url='https://github.com/siavashk/pycpd',
c... | 954 | 30.833333 | 84 | py |
pycpd | pycpd-master/testing/constrained_deformable_test.py | import pytest
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from pycpd import gaussian_kernel, ConstrainedDeformableRegistration
def test_2D():
X = np.loadtxt('data/fish_target.txt')
Y = np.loadtxt('data/fish_source.txt')
# simulate a pointcloud missing c... | 2,734 | 35.959459 | 137 | py |
pycpd | pycpd-master/testing/rigid_test.py | import pytest
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from pycpd import RigidRegistration
def test_2D():
theta = np.pi / 6.0
R = np.array([[np.cos(theta), -np.sin(theta)],
[np.sin(theta), np.cos(theta)]])
t = np.array([0.5, 1.0])
Y... | 1,310 | 30.97561 | 72 | py |
pycpd | pycpd-master/testing/affine_test.py | import pytest
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from pycpd import AffineRegistration
def test_2D():
B = np.array([[1.0, 0.5], [0, 1.0]])
t = np.array([0.5, 1.0])
Y = np.loadtxt('data/fish_target.txt')
X = np.dot(Y, B) + np.tile(t, (np.shape(Y)... | 1,194 | 29.641026 | 72 | py |
pycpd | pycpd-master/testing/deformable_test.py | import pytest
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from pycpd import gaussian_kernel, DeformableRegistration
def test_2D():
X = np.loadtxt('data/fish_target.txt')
Y = np.loadtxt('data/fish_source.txt')
reg = DeformableRegistration(**{'X': X, 'Y': Y})... | 1,999 | 33.482759 | 72 | py |
pycpd | pycpd-master/examples/fish_constrained_deformable_3D_lowrank.py | from functools import partial
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from pycpd import ConstrainedDeformableRegistration
import numpy as np
fish_source = np.loadtxt('data/fish_source.txt')
marker_size = 100
N_pts_include = 61
IDs = [1,10,20,30]
IDs_Y = IDs + [fish_source.shape[0] + i f... | 2,401 | 32.830986 | 137 | py |
pycpd | pycpd-master/examples/fish_affine_2D.py | from functools import partial
import matplotlib.pyplot as plt
from pycpd import AffineRegistration
import numpy as np
def visualize(iteration, error, X, Y, ax):
plt.cla()
ax.scatter(X[:, 0], X[:, 1], color='red', label='Target')
ax.scatter(Y[:, 0], Y[:, 1], color='blue', label='Source')
plt.text(0.8... | 1,248 | 29.463415 | 128 | py |
pycpd | pycpd-master/examples/fish_deformable_3D_register_with_subset_of_points.py | from functools import partial
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from pycpd import DeformableRegistration
import numpy as np
def visualize(iteration, error, X, Y, ax):
plt.cla()
ax.scatter(X[:, 0], X[:, 1], X[:, 2], color='red', label='Target')
ax.scatter(Y[:, 0], Y[... | 1,710 | 29.553571 | 121 | py |
pycpd | pycpd-master/examples/fish_rigid_3D.py | from functools import partial
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from pycpd import RigidRegistration
import numpy as np
def visualize(iteration, error, X, Y, ax):
plt.cla()
ax.scatter(X[:, 0], X[:, 1], X[:, 2], color='red', label='Target')
ax.scatter(Y[:, 0], Y[:, 1]... | 1,740 | 33.137255 | 128 | py |
pycpd | pycpd-master/examples/fish_deformable_2D.py | from functools import partial
import matplotlib.pyplot as plt
from pycpd import DeformableRegistration
import numpy as np
import time
def visualize(iteration, error, X, Y, ax):
plt.cla()
ax.scatter(X[:, 0], X[:, 1], color='red', label='Target')
ax.scatter(Y[:, 0], Y[:, 1], color='blue', label='Source')
... | 922 | 26.147059 | 121 | py |
pycpd | pycpd-master/examples/bunny_rigid_3D.py | import argparse
from functools import partial
import matplotlib.pyplot as plt
from pycpd import RigidRegistration
import numpy as np
import os
def visualize(iteration, error, X, Y, ax, fig, save_fig=False):
plt.cla()
ax.scatter(X[:, 0], X[:, 1], X[:, 2], color='red', label='Target')
ax.scatter(Y[:, 0], ... | 1,749 | 29.701754 | 128 | py |
pycpd | pycpd-master/examples/fish_constrained_deformable_2D.py | from functools import partial
import matplotlib.pyplot as plt
from pycpd import ConstrainedDeformableRegistration
import numpy as np
import time
IDs = [1,10,20,30]
marker_size = 100
def visualize(iteration, error, X, Y, ax):
plt.cla()
ids_X = np.arange(0, X.shape[0])
ids_X = np.delete(ids_X, IDs)
id... | 1,703 | 30.555556 | 121 | py |
pycpd | pycpd-master/examples/fish_deformable_3D_lowrank.py | from functools import partial
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from pycpd import DeformableRegistration
import numpy as np
def visualize(iteration, error, X, Y, ax):
plt.cla()
ax.scatter(X[:, 0], X[:, 1], X[:, 2], color='red', label='Target')
ax.scatter(Y[:, 0], Y[... | 1,457 | 31.4 | 121 | py |
pycpd | pycpd-master/examples/fish_constrained_deformable_3D.py | from functools import partial
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from pycpd import ConstrainedDeformableRegistration
import numpy as np
fish_source = np.loadtxt('data/fish_source.txt')
marker_size = 100
N_pts_include = 61
IDs = [1,10,20,30]
IDs_Y = IDs + [fish_source.shape[0] + i f... | 2,395 | 30.526316 | 129 | py |
pycpd | pycpd-master/examples/fish_affine_3D.py | from functools import partial
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from pycpd import AffineRegistration
import numpy as np
def visualize(iteration, error, X, Y, ax):
plt.cla()
ax.scatter(X[:, 0], X[:, 1], X[:, 2], color='red', label='Target')
ax.scatter(Y[:, 0], Y[:, 1... | 1,873 | 31.877193 | 128 | py |
pycpd | pycpd-master/examples/fish_rigid_2D.py | from functools import partial
import matplotlib.pyplot as plt
from pycpd import RigidRegistration
import numpy as np
def visualize(iteration, error, X, Y, ax):
plt.cla()
ax.scatter(X[:, 0], X[:, 1], color='red', label='Target')
ax.scatter(Y[:, 0], Y[:, 1], color='blue', label='Source')
plt.text(0.87... | 1,169 | 29 | 128 | py |
pycpd | pycpd-master/examples/fish_deformable_3D.py | from functools import partial
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from pycpd import DeformableRegistration
import numpy as np
def visualize(iteration, error, X, Y, ax):
plt.cla()
ax.scatter(X[:, 0], X[:, 1], X[:, 2], color='red', label='Target')
ax.scatter(Y[:, 0], Y[... | 1,439 | 31 | 121 | py |
pycpd | pycpd-master/pycpd/constrained_deformable_registration.py | from builtins import super
import numpy as np
import numbers
from .deformable_registration import DeformableRegistration
class ConstrainedDeformableRegistration(DeformableRegistration):
"""
Constrained deformable registration.
Attributes
----------
alpha: float (positive)
Represents the t... | 3,411 | 43.894737 | 147 | py |
pycpd | pycpd-master/pycpd/affine_registration.py | from builtins import super
import numpy as np
from .emregistration import EMRegistration
from .utility import is_positive_semi_definite
class AffineRegistration(EMRegistration):
"""
Affine registration.
Attributes
----------
B: numpy array (semi-positive definite)
DxD affine transformatio... | 4,535 | 33.892308 | 147 | py |
pycpd | pycpd-master/pycpd/utility.py | import numpy as np
def is_positive_semi_definite(R):
if not isinstance(R, (np.ndarray, np.generic)):
raise ValueError('Encountered an error while checking if the matrix is positive semi definite. \
Expected a numpy array, instead got : {}'.format(R))
return np.all(np.linalg.eigvals(R) > 0)... | 878 | 30.392857 | 104 | py |
pycpd | pycpd-master/pycpd/deformable_registration.py | from builtins import super
import numpy as np
import numbers
from .emregistration import EMRegistration
from .utility import gaussian_kernel, low_rank_eigen
class DeformableRegistration(EMRegistration):
"""
Deformable registration.
Attributes
----------
alpha: float (positive)
Represents t... | 5,308 | 35.613793 | 120 | py |
pycpd | pycpd-master/pycpd/__init__.py | """
This is a pure numpy implementation of the coherent point drift [CPD](https://arxiv.org/abs/0905.2635/)
algorithm by Myronenko and Song. It provides three registration methods for point clouds:
1. Scale and rigid registration
2. Affine registration
3. Gaussian regularized non-rigid registration
Licensed under an... | 685 | 39.352941 | 103 | py |
pycpd | pycpd-master/pycpd/rigid_registration.py | from builtins import super
import numpy as np
import numbers
from .emregistration import EMRegistration
from .utility import is_positive_semi_definite
class RigidRegistration(EMRegistration):
"""
Rigid registration.
Attributes
----------
R: numpy array (semi-positive definite)
DxD rotatio... | 5,743 | 35.820513 | 147 | py |
pycpd | pycpd-master/pycpd/emregistration.py | from __future__ import division
import numpy as np
import numbers
from warnings import warn
def initialize_sigma2(X, Y):
"""
Initialize the variance (sigma2).
Attributes
----------
X: numpy array
NxD array of points for target.
Y: numpy array
MxD array of points for sourc... | 8,645 | 30.67033 | 115 | py |
SPONGE | SPONGE-main/main.py | # copied from the main.py file of the old McSAS:
import argparse
import logging
import multiprocessing
import sys, os
from sys import platform
# adapted from: https://stackoverflow.com/questions/8220108/how-do-i-check-the-operating-system-in-python
def isLinux():
return platform == "linux" or platform == "linux2"... | 4,736 | 40.920354 | 105 | py |
SPONGE | SPONGE-main/nexuswriter.py | # -*- coding: utf-8 -*-
# nexuswriter.py
# Author: Brian R. Pauw
# License: GPLv3
# helper function for writing datasets:
import os
import h5py
import numpy as np
class NeXusWriter(object):
"""
Writes the provided data and keys into a NeXus-/NXcanSAS-conform structure in an HDF5 file
"""
_attrDi... | 10,045 | 44.252252 | 174 | py |
SPONGE | SPONGE-main/stlfunctions.py | # -*- coding: utf-8 -*-
import vtk
def getSTLReader(filename):
# sets up a read function with the STL filename in place.
# Get an STL reader (https://pyscience.wordpress.com/2014/09/21/ray-casting-with-python-and-vtk-intersecting-linesrays-with-surface-meshes/):
readerSTL = vtk.vtkSTLReader()
reader... | 895 | 32.185185 | 145 | py |
SPONGE | SPONGE-main/calcfunctions.py | # -*- coding: utf-8 -*-
# use in an instance with VTK!
import vtk
import numpy as np
import scipy.spatial
import logging
def polydataToMass(polydata):
# returns the object volume
Mass = vtk.vtkMassProperties()
Mass.SetInputData(polydata)
Mass.Update()
return Mass.GetVolume()
def polydataToSurf... | 5,850 | 38.802721 | 111 | py |
SPONGE | SPONGE-main/plotfunctions.py | import matplotlib
import matplotlib
import matplotlib.pyplot as plt
matplotlib.style.use('ggplot')
def simPlot(dataset, RayleighR = None, title = None):
plt.errorbar(dataset.Q, dataset.I * 10. / 1.1, dataset.IError * 10. / 1.1, label = title)
if RayleighR is not None:
q = dataset.Q
f = 3. * (np... | 645 | 33 | 119 | py |
SPONGE | SPONGE-main/smearfunctions.py | # -*- coding: utf-8 -*-
import vtk
import pandas, scipy
import numpy as np
import scipy.spatial
import scipy.signal
import os, h5py
import scipy.stats # for the distributions
from scipy.interpolate import interp1d # for the interpolations
from scipy.stats import norm # gaussian distribution function
from .distfunctio... | 2,163 | 33.903226 | 96 | py |
SPONGE | SPONGE-main/__init__.py | # -*- coding: utf-8 -*-
# __init__.py
"""
General imports of sponge
"""
__author__ = "Brian R. Pauw"
__contact__ = "brian@stack.nl"
__license__ = "GPLv3+"
__copyright__ = "Bundesanstalt für Materialforschung und -Prüfung"
__date__ = "2019-06-21"
__status__ = "beta"
version = "17"
__all__ = []
from .s import s
from ... | 1,625 | 32.183673 | 106 | py |
SPONGE | SPONGE-main/s.py | # -*- coding: utf-8 -*-
import pandas
import numpy as np
import argparse
import datetime
import os
from .nexuswriter import NeXusWriter
from pathlib import Path
# from plotfunctions import simPlot
from . import calcfunctions
# from calcfunctions import pickPointsInMeshV2, pointsToScatter, pointsToScatterD, logEdg... | 12,441 | 43.120567 | 360 | py |
SPONGE | SPONGE-main/distfunctions.py | # -*- coding: utf-8 -*-
import vtk
import pandas, scipy
import numpy as np
import scipy.spatial
import scipy.signal
import os, h5py
import scipy.stats # for the distributions
from scipy.interpolate import interp1d # for the interpolations
from scipy.stats import norm # gaussian distribution function
def distSpreadGa... | 2,846 | 38 | 84 | py |
SPONGE | SPONGE-main/test_integraltest.py | import unittest
import pandas, os
from s import s
# some tests to ensure the functionality persists. This bypasses main.py, and directly addresses s
import warnings
import numpy as np
class testSponge(unittest.TestCase):
def testSponge(self):
# new instance:
spongeInstance = s(run=False)
#... | 3,577 | 46.078947 | 116 | py |
Automata-Learning-meets-Shielding | Automata-Learning-meets-Shielding-master/world_scaler.py | from collections import defaultdict
from gym_partially_observable_grid.envs import PartiallyObservableWorld
def parse_file(path_to_file):
content = defaultdict(list)
file = open(path_to_file, 'r')
current_section = None
sections = ['Layout', 'Abstraction', 'Behaviour', 'Rewards']
for line in file... | 4,346 | 31.440299 | 132 | py |
Automata-Learning-meets-Shielding | Automata-Learning-meets-Shielding-master/active_passive_learning.py | import random
from collections import Counter
from statistics import mean
from time import sleep
import gym
import gym_partially_observable_grid
from aalpy.base import SUL
from aalpy.learning_algs import run_active_Alergia
from aalpy.learning_algs.stochastic_passive.ActiveAleriga import Sampler
from aalpy.utils impor... | 4,041 | 34.45614 | 114 | py |
Automata-Learning-meets-Shielding | Automata-Learning-meets-Shielding-master/tempest_shields.py | from pathlib import Path
import os
from aalpy.utils import mdp_2_prism_format
#tempest_binary = "/home/msi/tempest-shields/build/bin/storm"
tempest_binary = "/home/stefan/projects/tempest-public/build/bin/storm"
debug = False
input_cardinality = 4
inputs = ["left", "right", "up", "down"]
class TempestInterface:
... | 8,643 | 36.258621 | 144 | py |
Automata-Learning-meets-Shielding | Automata-Learning-meets-Shielding-master/utils.py | import random
from statistics import mean
from aalpy.base import SUL
from tempest_shields import TempestInterface
class StochasticWorldSUL(SUL):
def __init__(self, stochastic_world):
super().__init__()
self.world = stochastic_world
self.goal_reached = False
self.is_done = False
... | 3,247 | 27.491228 | 85 | py |
Automata-Learning-meets-Shielding | Automata-Learning-meets-Shielding-master/q_learning.py | import sys
import random
from statistics import mean
import gym
from aalpy.learning_algs import run_Alergia, run_JAlergia
import gym_partially_observable_grid
import numpy as np
debug = False
from termcolor import colored
import copy
# Make environment deterministic even if it is stochastic
from tempest_shields im... | 9,297 | 33.954887 | 251 | py |
Automata-Learning-meets-Shielding | Automata-Learning-meets-Shielding-master/test_worlds/plot.py | #!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
import csv
import copy
settings=["shielded", "penalty", "no"]
color_dict={"shielded": 0x00ff00, "no": 0x110000, "penalty": 0xff0000}
#filename = "penalty_summary.csv"
epochs = [1000,2000,3000,4000,5000,6000,7000,8000,9000,10000]
subplotrows=3
s... | 1,837 | 31.245614 | 97 | py |
Automata-Learning-meets-Shielding | Automata-Learning-meets-Shielding-master/experiments/wall_result1/plot.py | #!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
import csv
import copy
plot_y_min=-100
plot_y_max=140
plot_y_step=25
subplotrows=4
subplotcols=2
settings=["shielded", "penalty"]#, "no"]
color_dict={"shielded": 0x00ff00,"penalty": 0xff0000}#, "no": 0x110000, }
epochs = [1000,2000,3000,4000... | 2,854 | 34.246914 | 181 | py |
Automata-Learning-meets-Shielding | Automata-Learning-meets-Shielding-master/experiments/wall_result1/plot_automata_sizes.py | #!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
import csv
import copy
import tikzplotlib
settings=["shielded"]#, "penalty"]#, "no"]
color_dict={"shielded": 0x00ff00}#,"penalty": 0xff0000}#, "no": 0x110000, }
model_sizes = [5*9-6,8*9-12,8*14-20,11*14-30,11*18-39,14*18-52,14*22-64,17*22-80]
... | 3,169 | 35.860465 | 181 | py |
Automata-Learning-meets-Shielding | Automata-Learning-meets-Shielding-master/experiments/unsafe_result1/plot.py | #!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
import csv
import copy
settings=["shielded", "penalty"]#, "no"]
color_dict={"shielded": 0x00ff00,"penalty": 0xff0000}#, "no": 0x110000, }
epochs = [1000,2000,3000,4000,5000,6000,7000,8000,9000,10000,11000,12000,13000,14000,15000,16000,17000,1... | 2,993 | 34.642857 | 181 | py |
Automata-Learning-meets-Shielding | Automata-Learning-meets-Shielding-master/experiments/slipery_result1/plot.py | #!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
import csv
import copy
plot_y_min=0
plot_y_max=150
plot_y_step=25
subplotrows=4
subplotcols=2
settings=["shielded", "penalty"]#, "no"]
color_dict={"shielded": 0x00ff00,"penalty": 0xff0000}#, "no": 0x110000, }
epochs = [1000,2000,3000,4000,500... | 3,104 | 35.529412 | 181 | py |
Automata-Learning-meets-Shielding | Automata-Learning-meets-Shielding-master/gym_partially_observable_grid/utils.py | from collections import defaultdict
from random import choices
class StochasticTile:
def __init__(self, rule_id):
self.rule_id = rule_id
self.behaviour = dict()
def add_stochastic_action(self, action, new_action_probabilities):
self.behaviour[action] = new_action_probabilities
... | 6,717 | 37.170455 | 107 | py |
Automata-Learning-meets-Shielding | Automata-Learning-meets-Shielding-master/gym_partially_observable_grid/__init__.py | from gym.envs.registration import register
register(
id='poge-v1',
entry_point='gym_partially_observable_grid.envs:PartiallyObservableWorld',
) | 155 | 25 | 79 | py |
Automata-Learning-meets-Shielding | Automata-Learning-meets-Shielding-master/gym_partially_observable_grid/envs/PartiallyObsGridEnv.py | from copy import deepcopy
import gym
from gym import spaces
from gym_partially_observable_grid.utils import PartiallyObsGridworldParser
class PartiallyObservableWorld(gym.Env):
def __init__(self,
world_file_path,
force_determinism=False,
indicate_slip=False,
... | 9,926 | 40.190871 | 108 | py |
Automata-Learning-meets-Shielding | Automata-Learning-meets-Shielding-master/gym_partially_observable_grid/envs/__init__.py | from gym_partially_observable_grid.envs.PartiallyObsGridEnv import PartiallyObservableWorld | 91 | 91 | 91 | py |
spegg | spegg-master/tests/googletest/googletest/xcode/Scripts/versiongenerate.py | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 4,536 | 43.920792 | 80 | py |
spegg | spegg-master/tests/googletest/googletest/test/gtest_list_tests_unittest.py | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 6,537 | 30.432692 | 79 | py |
spegg | spegg-master/tests/googletest/googletest/test/gtest_throw_on_failure_test.py | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 5,767 | 32.534884 | 79 | py |
spegg | spegg-master/tests/googletest/googletest/test/gtest_xml_outfiles_test.py | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 5,340 | 39.157895 | 140 | py |
spegg | spegg-master/tests/googletest/googletest/test/gtest_filter_unittest.py | #!/usr/bin/env python
#
# Copyright 2005 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | 21,325 | 32.478807 | 80 | py |
spegg | spegg-master/tests/googletest/googletest/test/gtest_xml_test_utils.py | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 8,872 | 44.502564 | 79 | py |
spegg | spegg-master/tests/googletest/googletest/test/gtest_test_utils.py | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 10,823 | 32.719626 | 79 | py |
spegg | spegg-master/tests/googletest/googletest/test/gtest_shuffle_test.py | #!/usr/bin/env python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | 12,549 | 37.496933 | 79 | py |
spegg | spegg-master/tests/googletest/googletest/test/gtest_env_var_test.py | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 4,036 | 33.211864 | 79 | py |
spegg | spegg-master/tests/googletest/googletest/test/gtest_help_test.py | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 5,856 | 32.855491 | 75 | py |
spegg | spegg-master/tests/googletest/googletest/test/gtest_break_on_failure_unittest.py | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 7,339 | 33.460094 | 79 | py |
spegg | spegg-master/tests/googletest/googletest/test/gtest_output_test.py | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 12,259 | 34.953079 | 79 | py |
spegg | spegg-master/tests/googletest/googletest/test/gtest_catch_exceptions_test.py | #!/usr/bin/env python
#
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... | 9,901 | 40.605042 | 78 | py |
spegg | spegg-master/tests/googletest/googletest/test/gtest_uninitialized_test.py | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 2,482 | 33.971831 | 77 | py |
spegg | spegg-master/tests/googletest/googletest/test/gtest_color_test.py | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 4,911 | 36.496183 | 76 | py |
spegg | spegg-master/tests/googletest/googletest/test/gtest_xml_output_unittest.py | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 14,677 | 46.501618 | 225 | py |
spegg | spegg-master/tests/googletest/googletest/scripts/fuse_gtest_files.py | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 8,884 | 33.980315 | 78 | py |
spegg | spegg-master/tests/googletest/googletest/scripts/upload.py | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# 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 o... | 51,024 | 35.761527 | 80 | py |
spegg | spegg-master/tests/googletest/googletest/scripts/pump.py | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 23,673 | 26.656542 | 80 | py |
spegg | spegg-master/tests/googletest/googletest/scripts/gen_gtest_pred_impl.py | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 21,986 | 29.077975 | 76 | py |
spegg | spegg-master/tests/googletest/googletest/scripts/upload_gtest.py | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 2,851 | 35.101266 | 72 | py |
spegg | spegg-master/tests/googletest/googletest/scripts/common.py | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the foll... | 2,919 | 33.761905 | 78 | py |
spegg | spegg-master/tests/googletest/googletest/scripts/release_docs.py | #!/usr/bin/env python
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | 6,132 | 37.572327 | 80 | py |
spegg | spegg-master/tests/googletest/googlemock/test/gmock_leak_test.py | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 4,384 | 39.229358 | 73 | py |
spegg | spegg-master/tests/googletest/googlemock/test/gmock_test_utils.py | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 3,684 | 31.610619 | 79 | py |
spegg | spegg-master/tests/googletest/googlemock/test/gmock_output_test.py | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 5,999 | 32.149171 | 80 | py |
spegg | spegg-master/tests/googletest/googlemock/scripts/fuse_gmock_files.py | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 8,631 | 34.817427 | 79 | py |
spegg | spegg-master/tests/googletest/googlemock/scripts/upload.py | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# 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 o... | 51,024 | 35.761527 | 80 | py |
spegg | spegg-master/tests/googletest/googlemock/scripts/upload_gmock.py | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 2,833 | 34.873418 | 72 | py |
spegg | spegg-master/tests/googletest/googlemock/scripts/gmock_doctor.py | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 24,131 | 36.647426 | 80 | py |
spegg | spegg-master/tests/googletest/googlemock/scripts/generator/gmock_gen.py | #!/usr/bin/env python
#
# Copyright 2008 Google Inc. 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 requir... | 1,091 | 33.125 | 79 | py |
spegg | spegg-master/tests/googletest/googlemock/scripts/generator/cpp/gmock_class.py | #!/usr/bin/env python
#
# Copyright 2008 Google Inc. 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 requi... | 8,293 | 35.377193 | 79 | py |
spegg | spegg-master/tests/googletest/googlemock/scripts/generator/cpp/keywords.py | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google Inc.
#
# 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... | 2,004 | 32.416667 | 97 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.