hexsha
stringlengths 40
40
| size
int64 5
2.06M
| ext
stringclasses 10
values | lang
stringclasses 1
value | max_stars_repo_path
stringlengths 3
248
| max_stars_repo_name
stringlengths 5
125
| max_stars_repo_head_hexsha
stringlengths 40
78
| max_stars_repo_licenses
listlengths 1
10
| max_stars_count
int64 1
191k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 3
248
| max_issues_repo_name
stringlengths 5
125
| max_issues_repo_head_hexsha
stringlengths 40
78
| max_issues_repo_licenses
listlengths 1
10
| max_issues_count
int64 1
67k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 3
248
| max_forks_repo_name
stringlengths 5
125
| max_forks_repo_head_hexsha
stringlengths 40
78
| max_forks_repo_licenses
listlengths 1
10
| max_forks_count
int64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 5
2.06M
| avg_line_length
float64 1
1.02M
| max_line_length
int64 3
1.03M
| alphanum_fraction
float64 0
1
| count_classes
int64 0
1.6M
| score_classes
float64 0
1
| count_generators
int64 0
651k
| score_generators
float64 0
1
| count_decorators
int64 0
990k
| score_decorators
float64 0
1
| count_async_functions
int64 0
235k
| score_async_functions
float64 0
1
| count_documentation
int64 0
1.04M
| score_documentation
float64 0
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a0bb420692799a6a79988f6528e8182e5954185a | 3,234 | py | Python | cifar10/train.py | ashawkey/hawtorch | a6e28422da9258458b6268f5981c68d60623e12f | [
"MIT"
] | 1 | 2019-12-01T05:48:00.000Z | 2019-12-01T05:48:00.000Z | cifar10/train.py | ashawkey/hawtorch | a6e28422da9258458b6268f5981c68d60623e12f | [
"MIT"
] | null | null | null | cifar10/train.py | ashawkey/hawtorch | a6e28422da9258458b6268f5981c68d60623e12f | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
import torchvision
from torchvision import datasets, transforms
from torch.utils.data import DataLoader
import hawtorch
import hawtorch.io as io
from hawtorch import Trainer
from hawtorch.metrics import ClassificationMeter
from hawtorch.utils import backup
import models
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--config', type=str, default='configs.json')
parser = parser.parse_args()
config_file = parser.config
args = io.load_json(config_file)
logger = io.logger(args["workspace_path"])
names = ('plane', 'car', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck')
def create_loaders():
# transforms
transform_train = transforms.Compose([
#transforms.RandomCrop(32, padding=4),
#transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)),
])
transform_test = transforms.Compose([
transforms.ToTensor(),
transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)),
])
# CIFAR10 dataset
logger.info("Start creating datasets...")
train_dataset = datasets.CIFAR10(root=args["data_path"], train=True, transform=transform_train, download=True)
logger.info(f"Created train set! {len(train_dataset)}")
test_dataset = datasets.CIFAR10(root=args["data_path"], train=False, transform=transform_test, download=True)
logger.info(f"Created test set! {len(test_dataset)}")
# Data Loader
train_loader = DataLoader(dataset=train_dataset,
batch_size=args["train_batch_size"],
shuffle=True,
pin_memory=True,
)
test_loader = DataLoader(dataset=test_dataset,
batch_size=args["test_batch_size"],
shuffle=False,
pin_memory=True,
)
return {"train":train_loader,
"test":test_loader}
def create_trainer():
logger.info("Start creating trainer...")
device = args["device"]
model = getattr(models, args["model"])()
objective = getattr(nn, args["objective"])()
optimizer = getattr(optim, args["optimizer"])(model.parameters(), lr=args["lr"], weight_decay=args["weight_decay"])
scheduler = lr_scheduler.MultiStepLR(optimizer, milestones=args["lr_decay_step"], gamma=args["lr_decay"])
metrics = [ClassificationMeter(10, names=names), ]
loaders = create_loaders()
trainer = Trainer(args, model, optimizer, scheduler, objective, device, loaders, logger,
metrics=metrics,
workspace_path=args["workspace_path"],
eval_set="test",
input_shape=(3,32,32),
report_step_interval=-1,
)
logger.info("Trainer Created!")
return trainer
if __name__ == "__main__":
backup(args["workspace_path"])
trainer = create_trainer()
trainer.train(args["epochs"])
trainer.evaluate()
| 34.042105 | 119 | 0.62987 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 576 | 0.178108 |
a0bbcdf05486aa95d06b89b25ca7866a985c51bb | 718 | py | Python | examples/scatterplot.py | ajduberstein/slayer | e4f2b6e0277ac38fe71ec99eaf3ee4769057b0ea | [
"MIT"
] | 2 | 2019-02-26T23:55:06.000Z | 2019-02-26T23:56:09.000Z | examples/scatterplot.py | ajduberstein/slayer | e4f2b6e0277ac38fe71ec99eaf3ee4769057b0ea | [
"MIT"
] | 1 | 2019-02-10T07:00:39.000Z | 2019-02-10T07:00:39.000Z | examples/scatterplot.py | ajduberstein/slayer | e4f2b6e0277ac38fe71ec99eaf3ee4769057b0ea | [
"MIT"
] | null | null | null | """
Example of how to make a Scatterplot with a time component
"""
import slayer as sly
import pandas as pd
DATA_URL = 'https://raw.githubusercontent.com/ajduberstein/sf_growth/master/public/data/business.csv'
businesses = pd.read_csv(DATA_URL)
FUCHSIA_RGBA = [255, 0, 255, 140]
color_scale = sly.ColorScale(
palette='random',
variable_name='neighborhood',
scale_type='categorical_random')
s = sly.Slayer(sly.Viewport(longitude=-122.43, latitude=37.76, zoom=11)) +\
sly.Timer(tick_rate=0.75) + \
sly.Scatterplot(
businesses,
position=['lng', 'lat'],
color=color_scale,
radius=50,
time_field='start_date')
s.to_html('scatterplot.html', interactive=True)
| 26.592593 | 101 | 0.693593 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 238 | 0.331476 |
a0bc99badd8c414f8e67c165139e1e1864acd087 | 3,699 | py | Python | test_dictondisk.py | MKuranowski/dictondisk | ca25f8fed2f60d8ee63d6c5eaa9e620555581383 | [
"MIT"
] | null | null | null | test_dictondisk.py | MKuranowski/dictondisk | ca25f8fed2f60d8ee63d6c5eaa9e620555581383 | [
"MIT"
] | null | null | null | test_dictondisk.py | MKuranowski/dictondisk | ca25f8fed2f60d8ee63d6c5eaa9e620555581383 | [
"MIT"
] | null | null | null | import dictondisk
import random
import pytest
import os
remove_keys = {0, (33, 12.23), "c", "中国"}
vanilla_dict = {
0: 1337, 1: 3.14, 2: 2.71, 3: 1.61,
"a": "Ą", "b": "✈!", "c": "東京", "中国": "共産",
(1, .5): "lorem", (33, 12.23): "ipsum",
-1: ["one", "two", "three"]
}
def test_contains_update():
t = dictondisk.DictOnDisk(vanilla_dict)
for i in vanilla_dict:
assert i in t
def test_del():
t = dictondisk.DictOnDisk(vanilla_dict)
folder_name = t.folder.name
del t
assert not os.path.exists(folder_name)
def test_len():
t = dictondisk.DictOnDisk(vanilla_dict)
assert len(t) == len(vanilla_dict)
def test_getsetitem():
t = dictondisk.DictOnDisk(vanilla_dict)
for k, v in vanilla_dict.items():
assert t[k] == v
t[0] = 7331
t[-1] = ["three", "two", "one"]
assert t[0] == 7331
assert t[-1] == ["three", "two", "one"]
with pytest.raises(KeyError):
u = t["0"]
def test_delitem():
t = dictondisk.DictOnDisk(vanilla_dict)
for i in remove_keys:
del t[i]
for k in vanilla_dict:
if k in remove_keys:
assert k not in t
else:
assert k in t
with pytest.raises(KeyError):
del t["0"]
def test_iter():
t = dictondisk.DictOnDisk(vanilla_dict)
all_keys = set(vanilla_dict.keys())
for k in t:
all_keys.remove(k)
assert len(all_keys) == 0
def test_get():
t = dictondisk.DictOnDisk(vanilla_dict)
assert t.get(0) == 1337
assert t.get((1, .5), "nice") == "lorem"
assert t.get(52566) == None
assert t.get(-2, "VΣЯY ПIᄃΣ") == "VΣЯY ПIᄃΣ"
def test_copy():
t1 = dictondisk.DictOnDisk(vanilla_dict)
t2 = t1.copy()
assert t1.folder.name != t2.folder.name
for k, v in t1.items(): assert t2[k] == v
for k, v in t2.items(): assert t1[k] == v
def test_fromkeys():
# Check default value
t = dictondisk.DictOnDisk.fromkeys(vanilla_dict)
for key in vanilla_dict: assert t[key] == None
for key in t: assert key in vanilla_dict
# Check custom value
t = dictondisk.DictOnDisk.fromkeys(vanilla_dict, "🖲️")
for key in vanilla_dict: assert t[key] == "🖲️"
for key in t: assert key in vanilla_dict
def test_pop():
t = dictondisk.DictOnDisk(vanilla_dict)
# Check proper popping of values
v = t.pop((1, .5), None)
assert v == "lorem"
assert (1, .5) not in t
# Check proper returning of default
v = t.pop("654", "🍔")
assert v == "🍔"
# Check rasing of KeyError without default
with pytest.raises(KeyError):
v = t.pop(32156)
# Check raising TypeError on more-then-one-defualt
with pytest.raises(TypeError):
v = t.pop(-1, None, "🍿")
assert -1 in t
def test_popitem():
t = dictondisk.DictOnDisk(vanilla_dict)
k, v = t.popitem()
assert k in vanilla_dict
assert v == vanilla_dict[k]
def test_bool():
t = dictondisk.DictOnDisk()
assert bool(t) == False
t.update(vanilla_dict)
assert bool(t) == True
def test_eq():
t = dictondisk.DictOnDisk()
assert t == []
assert t == {}
t.update(vanilla_dict)
assert t == vanilla_dict
assert t != {}
t = dictondisk.DictOnDisk()
t[1] = "1"
t[2] = "2"
assert t == [(1, "1"), (2, "2")]
assert t != [(1, "1")]
def test_setdefault():
t = dictondisk.DictOnDisk(vanilla_dict)
assert t.setdefault(0, "aaaaa") == 1337
assert t.setdefault(89, "darkness") == "darkness"
assert t.setdefault((33, 12.23)) == "ipsum"
assert t.setdefault("🏯") == None
def test_view_keys():
pass
def test_view_values():
pass
def test_view_items():
pass
| 20.324176 | 58 | 0.593674 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 475 | 0.126599 |
a0bd4d5ee3152479bb0efe0eaded5fd65042adf4 | 1,904 | py | Python | backend/src/users/models.py | moatom/alistice | 222217928d9634b14e3c192abedc8c7d419ab868 | [
"MIT"
] | null | null | null | backend/src/users/models.py | moatom/alistice | 222217928d9634b14e3c192abedc8c7d419ab868 | [
"MIT"
] | null | null | null | backend/src/users/models.py | moatom/alistice | 222217928d9634b14e3c192abedc8c7d419ab868 | [
"MIT"
] | null | null | null | from src.extentions import db
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
import datetime as dt
# https://help.twitter.com/en/managing-your-account/twitter-username-rules
# https://office-hack.com/gmail/password/
class User(UserMixin, db.Model):
__tablename__ = 'user'
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(100), unique=True, nullable=False, index=True)
username = db.Column(db.String(15), unique=True, nullable=False, index=True)
name = db.Column(db.String(50), nullable=False, default="Anonymous")
password = db.Column(db.String(128), nullable=False)
root_id = db.Column(db.String(24))
# root_id = db.Column(db.Integer, db.ForeignKey('bookmark.id', ondelete='CASCADE'))
# https://stackoverflow.com/questions/414952/sqlalchemy-datetime-timezone
created_at = db.Column(db.DateTime, nullable=False, default=dt.datetime.utcnow)
# updated_at = Column(db.DateTime, nullable=False, default=dt.datetime.utcnow)
# bio = Column(db.String(300), nullable=True)
# root = db.relationship('Bookmark',
# cascade="all, delete-orphan",
# single_parent=True,
# foreign_keys=[root_id],
# backref=db.backref('root_s_owner',
# cascade="all, delete-orphan",
# passive_deletes=True,
# uselist=False)
# )
def set_password(self, password):
self.password = generate_password_hash(password)
def check_password(self, value):
return check_password_hash(self.password, value)
def __repr__(self):
"""Represent instance as a unique string."""
return '<User({!r})>'.format(self.username)
| 46.439024 | 87 | 0.628151 | 1,616 | 0.848739 | 0 | 0 | 0 | 0 | 0 | 0 | 899 | 0.472164 |
a0bead6599200d03855aef8174ff835ecca2f74f | 76,496 | py | Python | commonroad/scenario/lanelet.py | CommonRoad/commonroad-io | 93824961da9c41eb7768b5cf1acbed9a07446dc2 | [
"BSD-3-Clause"
] | 3 | 2022-01-05T09:10:18.000Z | 2022-03-22T15:09:43.000Z | commonroad/scenario/lanelet.py | CommonRoad/commonroad-io | 93824961da9c41eb7768b5cf1acbed9a07446dc2 | [
"BSD-3-Clause"
] | null | null | null | commonroad/scenario/lanelet.py | CommonRoad/commonroad-io | 93824961da9c41eb7768b5cf1acbed9a07446dc2 | [
"BSD-3-Clause"
] | null | null | null | import copy
import enum
from typing import *
import numpy as np
from shapely.geometry import MultiPolygon as ShapelyMultiPolygon
from shapely.geometry import Point as ShapelyPoint
from shapely.geometry import Polygon as ShapelyPolygon
from shapely.strtree import STRtree
import commonroad.geometry.transform
from commonroad.common.validity import *
from commonroad.geometry.shape import Polygon, ShapeGroup, Circle, Rectangle, Shape
from commonroad.scenario.intersection import Intersection
from commonroad.scenario.obstacle import Obstacle
from commonroad.scenario.traffic_sign import TrafficSign, TrafficLight
from commonroad.visualization.drawable import IDrawable
from commonroad.visualization.param_server import ParamServer
from commonroad.visualization.renderer import IRenderer
__author__ = "Christian Pek, Sebastian Maierhofer"
__copyright__ = "TUM Cyber-Physical Systems Group"
__credits__ = ["BMW CAR@TUM"]
__version__ = "2022.1"
__maintainer__ = "Sebastian Maierhofer"
__email__ = "[email protected]"
__status__ = "released"
class LineMarking(enum.Enum):
"""
Enum describing different types of line markings, i.e. dashed or solid lines
"""
DASHED = 'dashed'
SOLID = 'solid'
BROAD_DASHED = 'broad_dashed'
BROAD_SOLID = 'broad_solid'
UNKNOWN = 'unknown'
NO_MARKING = 'no_marking'
class LaneletType(enum.Enum):
"""
Enum describing different types of lanelets
"""
URBAN = 'urban'
COUNTRY = 'country'
HIGHWAY = 'highway'
DRIVE_WAY = 'driveWay'
MAIN_CARRIAGE_WAY = 'mainCarriageWay'
ACCESS_RAMP = 'accessRamp'
EXIT_RAMP = 'exitRamp'
SHOULDER = 'shoulder'
BUS_LANE = 'busLane'
BUS_STOP = 'busStop'
BICYCLE_LANE = 'bicycleLane'
SIDEWALK = 'sidewalk'
CROSSWALK = 'crosswalk'
INTERSTATE = 'interstate'
INTERSECTION = 'intersection'
UNKNOWN = 'unknown'
class RoadUser(enum.Enum):
"""
Enum describing different types of road users
"""
VEHICLE = 'vehicle'
CAR = 'car'
TRUCK = 'truck'
BUS = 'bus'
PRIORITY_VEHICLE = 'priorityVehicle'
MOTORCYCLE = 'motorcycle'
BICYCLE = 'bicycle'
PEDESTRIAN = 'pedestrian'
TRAIN = 'train'
TAXI = 'taxi'
class StopLine:
"""Class which describes the stop line of a lanelet"""
def __init__(self, start: np.ndarray, end: np.ndarray, line_marking: LineMarking, traffic_sign_ref: Set[int] = None,
traffic_light_ref: Set[int] = None):
self._start = start
self._end = end
self._line_marking = line_marking
self._traffic_sign_ref = traffic_sign_ref
self._traffic_light_ref = traffic_light_ref
def __eq__(self, other):
if not isinstance(other, StopLine):
warnings.warn(f"Inequality between StopLine {repr(self)} and different type {type(other)}")
return False
prec = 10
start_string = np.array2string(np.around(self._start.astype(float), prec), precision=prec)
start_other_string = np.array2string(np.around(other.start.astype(float), prec), precision=prec)
end_string = np.array2string(np.around(self._end.astype(float), prec), precision=prec)
end_other_string = np.array2string(np.around(other.end.astype(float), prec), precision=prec)
if start_string == start_other_string and end_string == end_other_string \
and self._line_marking == other.line_marking and self._traffic_sign_ref == other.traffic_sign_ref \
and self._traffic_light_ref == other.traffic_light_ref:
return True
warnings.warn(f"Inequality of StopLine {repr(self)} and the other one {repr(other)}")
return False
def __hash__(self):
start_string = np.array2string(np.around(self._start.astype(float), 10), precision=10)
end_string = np.array2string(np.around(self._end.astype(float), 10), precision=10)
sign_ref = None if self._traffic_sign_ref is None else frozenset(self._traffic_sign_ref)
light_ref = None if self._traffic_light_ref is None else frozenset(self._traffic_light_ref)
return hash((start_string, end_string, self._line_marking, sign_ref,
light_ref))
def __str__(self):
return f'StopLine from {self._start} to {self._end}'
def __repr__(self):
return f"StopLine(start={self._start.tolist()}, end={self._end.tolist()}, line_marking={self._line_marking}, " \
f"traffic_sign_ref={self._traffic_sign_ref}, traffic_light_ref={self._traffic_light_ref})"
@property
def start(self) -> np.ndarray:
return self._start
@start.setter
def start(self, value: np.ndarray):
self._start = value
@property
def end(self) -> np.ndarray:
return self._end
@end.setter
def end(self, value: np.ndarray):
self._end = value
@property
def line_marking(self) -> LineMarking:
return self._line_marking
@line_marking.setter
def line_marking(self, marking: LineMarking):
self._line_marking = marking
@property
def traffic_sign_ref(self) -> Set[int]:
return self._traffic_sign_ref
@traffic_sign_ref.setter
def traffic_sign_ref(self, references: Set[int]):
self._traffic_sign_ref = references
@property
def traffic_light_ref(self) -> Set[int]:
return self._traffic_light_ref
@traffic_light_ref.setter
def traffic_light_ref(self, references: Set[int]):
self._traffic_light_ref = references
def translate_rotate(self, translation: np.ndarray, angle: float):
"""
This method translates and rotates a stop line
:param translation: The translation given as [x_off,y_off] for the x and y translation
:param angle: The rotation angle in radian (counter-clockwise defined)
"""
assert is_real_number_vector(translation, 2), '<Lanelet/translate_rotate>: provided translation ' \
'is not valid! translation = {}'.format(translation)
assert is_valid_orientation(
angle), '<Lanelet/translate_rotate>: provided angle is not valid! angle = {}'.format(angle)
# create transformation matrix
t_m = commonroad.geometry.transform.translation_rotation_matrix(translation, angle)
line_vertices = np.array([self._start, self._end])
# transform center vertices
tmp = t_m.dot(np.vstack((line_vertices.transpose(), np.ones((1, line_vertices.shape[0])))))
tmp = tmp[0:2, :].transpose()
self._start, self._end = tmp[0], tmp[1]
class Lanelet:
"""
Class which describes a Lanelet entity according to the CommonRoad specification. Each lanelet is described by a
left and right boundary (polylines). Furthermore, lanelets have relations to other lanelets, e.g. an adjacent left
neighbor or a predecessor.
"""
def __init__(self, left_vertices: np.ndarray, center_vertices: np.ndarray, right_vertices: np.ndarray,
lanelet_id: int, predecessor=None, successor=None, adjacent_left=None,
adjacent_left_same_direction=None, adjacent_right=None, adjacent_right_same_direction=None,
line_marking_left_vertices=LineMarking.NO_MARKING, line_marking_right_vertices=LineMarking.NO_MARKING,
stop_line=None, lanelet_type=None, user_one_way=None, user_bidirectional=None, traffic_signs=None,
traffic_lights=None, ):
"""
Constructor of a Lanelet object
:param left_vertices: The vertices of the left boundary of the Lanelet described as a
polyline [[x0,y0],[x1,y1],...,[xn,yn]]
:param center_vertices: The vertices of the center line of the Lanelet described as a
polyline [[x0,y0],[x1,y1],...,[xn,yn]]
:param right_vertices: The vertices of the right boundary of the Lanelet described as a
polyline [[x0,y0],[x1,y1],...,[xn,yn]]
:param lanelet_id: The unique id (natural number) of the lanelet
:param predecessor: The list of predecessor lanelets (None if not existing)
:param successor: The list of successor lanelets (None if not existing)
:param adjacent_left: The adjacent left lanelet (None if not existing)
:param adjacent_left_same_direction: True if the adjacent left lanelet has the same driving direction,
false otherwise (None if no left adjacent lanelet exists)
:param adjacent_right: The adjacent right lanelet (None if not existing)
:param adjacent_right_same_direction: True if the adjacent right lanelet has the same driving direction,
false otherwise (None if no right adjacent lanelet exists)
:param line_marking_left_vertices: The type of line marking of the left boundary
:param line_marking_right_vertices: The type of line marking of the right boundary
:param stop_line: The stop line of the lanelet
:param lanelet_type: The types of lanelet applicable here
:param user_one_way: type of users that will use the lanelet as one-way
:param user_bidirectional: type of users that will use the lanelet as bidirectional way
:param traffic_signs: Traffic signs to be applied
:param traffic_lights: Traffic lights to follow
"""
# Set required properties
self._left_vertices = None
self._right_vertices = None
self._center_vertices = None
self._lanelet_id = None
self.lanelet_id = lanelet_id
self.left_vertices = left_vertices
self.right_vertices = right_vertices
self.center_vertices = center_vertices
# check if length of each polyline is the same
assert len(left_vertices[0]) == len(center_vertices[0]) == len(
right_vertices[0]), '<Lanelet/init>: Provided polylines do not share the same length! {}/{}/{}'.format(
len(left_vertices[0]), len(center_vertices[0]), len(right_vertices[0]))
# Set lane markings
self._line_marking_left_vertices = line_marking_left_vertices
self._line_marking_right_vertices = line_marking_right_vertices
# Set predecessors and successors
self._predecessor = None
if predecessor is None:
self._predecessor = []
else:
self.predecessor = predecessor
self._successor = None
if successor is None:
self._successor = []
else:
self.successor = successor
# Set adjacent lanelets
self._adj_left = None
self._adj_left_same_direction = None
if adjacent_left is not None:
self.adj_left = adjacent_left
self.adj_left_same_direction = adjacent_left_same_direction
self._adj_right = None
self._adj_right_same_direction = None
if adjacent_right is not None:
self.adj_right = adjacent_right
self.adj_right_same_direction = adjacent_right_same_direction
self._distance = None
self._inner_distance = None
# create empty polygon
self._polygon = Polygon(np.concatenate((self.right_vertices, np.flip(self.left_vertices, 0))))
self._dynamic_obstacles_on_lanelet = {}
self._static_obstacles_on_lanelet = set()
self._stop_line = None
if stop_line:
self.stop_line = stop_line
self._lanelet_type = None
if lanelet_type is None:
self._lanelet_type = set()
else:
self.lanelet_type = lanelet_type
self._user_one_way = None
if user_one_way is None:
self._user_one_way = set()
else:
self.user_one_way = user_one_way
self._user_bidirectional = None
if user_bidirectional is None:
self._user_bidirectional = set()
else:
self.user_bidirectional = user_bidirectional
# Set Traffic Rules
self._traffic_signs = None
if traffic_signs is None:
self._traffic_signs = set()
else:
self.traffic_signs = traffic_signs
self._traffic_lights = None
if traffic_lights is None:
self._traffic_lights = set()
else:
self.traffic_lights = traffic_lights
def __eq__(self, other):
if not isinstance(other, Lanelet):
warnings.warn(f"Inequality between Lanelet {repr(self)} and different type {type(other)}")
return False
list_elements_eq = self._stop_line == other.stop_line
lanelet_eq = True
polylines = [self._left_vertices, self._right_vertices, self._center_vertices]
polylines_other = [other.left_vertices, other.right_vertices, other.center_vertices]
for i in range(0, len(polylines)):
polyline = polylines[i]
polyline_other = polylines_other[i]
polyline_string = np.array2string(np.around(polyline.astype(float), 10), precision=10)
polyline_other_string = np.array2string(np.around(polyline_other.astype(float), 10), precision=10)
lanelet_eq = lanelet_eq and polyline_string == polyline_other_string
if lanelet_eq and self.lanelet_id == other.lanelet_id \
and self._line_marking_left_vertices == other.line_marking_left_vertices \
and self._line_marking_right_vertices == other.line_marking_right_vertices \
and set(self._predecessor) == set(other.predecessor) and set(self._successor) == set(other.successor) \
and self._adj_left == other.adj_left and self._adj_right == other.adj_right \
and self._adj_left_same_direction == other.adj_left_same_direction \
and self._adj_right_same_direction == other.adj_right_same_direction \
and self._lanelet_type == other.lanelet_type and self._user_one_way == self.user_one_way \
and self._user_bidirectional == other.user_bidirectional \
and self._traffic_signs == other.traffic_signs and self._traffic_lights == other.traffic_lights:
return list_elements_eq
warnings.warn(f"Inequality of Lanelet {repr(self)} and the other one {repr(other)}")
return False
def __hash__(self):
polylines = [self._left_vertices, self._right_vertices, self._center_vertices]
polyline_strings = []
for polyline in polylines:
polyline_string = np.array2string(np.around(polyline.astype(float), 10), precision=10)
polyline_strings.append(polyline_string)
elements = [self._predecessor, self._successor, self._lanelet_type, self._user_one_way,
self._user_bidirectional, self._traffic_signs, self._traffic_lights]
frozen_elements = [frozenset(e) for e in elements]
return hash((self._lanelet_id, tuple(polyline_strings), self._line_marking_left_vertices,
self._line_marking_right_vertices, self._stop_line, self._adj_left, self._adj_right,
self._adj_left_same_direction, self._adj_right_same_direction, tuple(frozen_elements)))
def __str__(self):
return f"Lanelet with id {self._lanelet_id} has predecessors {set(self._predecessor)}, successors " \
f"{set(self._successor)}, left adjacency {self._adj_left} with " \
f"{'same' if self._adj_left_same_direction else 'opposite'} direction, and " \
f"right adjacency with {'same' if self._adj_right_same_direction else 'opposite'} direction"
def __repr__(self):
return f"Lanelet(left_vertices={self._left_vertices.tolist()}, " \
f"center_vertices={self._center_vertices.tolist()}, " \
f"right_vertices={self._right_vertices.tolist()}, lanelet_id={self._lanelet_id}, " \
f"predecessor={self._predecessor}, successor={self._successor}, adjacent_left={self._adj_left}, " \
f"adjacent_left_same_direction={self._adj_left_same_direction}, adjacent_right={self._adj_right}, " \
f"adjacent_right_same_direction={self._adj_right_same_direction}, " \
f"line_marking_left_vertices={self._line_marking_left_vertices}, " \
f"line_marking_right_vertices={self._line_marking_right_vertices}), " \
f"stop_line={repr(self._stop_line)}, lanelet_type={self._lanelet_type}, " \
f"user_one_way={self._user_one_way}, " \
f"user_bidirectional={self._user_bidirectional}, traffic_signs={self._traffic_signs}, " \
f"traffic_lights={self._traffic_lights}"
@property
def distance(self) -> np.ndarray:
"""
:returns cumulative distance along center vertices
"""
if self._distance is None:
self._distance = self._compute_polyline_cumsum_dist([self.center_vertices])
return self._distance
@distance.setter
def distance(self, _):
warnings.warn('<Lanelet/distance> distance of lanelet is immutable')
@property
def inner_distance(self) -> np.ndarray:
"""
:returns minimum cumulative distance along left and right vertices, i.e., along the inner curve:
"""
if self._inner_distance is None:
self._inner_distance = self._compute_polyline_cumsum_dist([self.left_vertices, self.right_vertices])
return self._inner_distance
@property
def lanelet_id(self) -> int:
return self._lanelet_id
@lanelet_id.setter
def lanelet_id(self, l_id: int):
if self._lanelet_id is None:
assert is_natural_number(l_id), '<Lanelet/lanelet_id>: Provided lanelet_id is not valid! id={}'.format(l_id)
self._lanelet_id = l_id
else:
warnings.warn('<Lanelet/lanelet_id>: lanelet_id of lanelet is immutable')
@property
def left_vertices(self) -> np.ndarray:
return self._left_vertices
@left_vertices.setter
def left_vertices(self, polyline: np.ndarray):
if self._left_vertices is None:
self._left_vertices = polyline
assert is_valid_polyline(polyline), '<Lanelet/left_vertices>: The provided polyline ' \
'is not valid! id = {} polyline = {}'.format(self._lanelet_id, polyline)
else:
warnings.warn('<Lanelet/left_vertices>: left_vertices of lanelet are immutable!')
@property
def right_vertices(self) -> np.ndarray:
return self._right_vertices
@right_vertices.setter
def right_vertices(self, polyline: np.ndarray):
if self._right_vertices is None:
assert is_valid_polyline(polyline), '<Lanelet/right_vertices>: The provided polyline ' \
'is not valid! id = {}, polyline = {}'.format(self._lanelet_id,
polyline)
self._right_vertices = polyline
else:
warnings.warn('<Lanelet/right_vertices>: right_vertices of lanelet are immutable!')
@staticmethod
def _compute_polyline_cumsum_dist(polylines: List[np.ndarray], comparator=np.amin):
d = []
for polyline in polylines:
d.append(np.diff(polyline, axis=0))
segment_distances = np.empty((len(polylines[0]), len(polylines)))
for i, d_tmp in enumerate(d):
segment_distances[:, i] = np.append([0], np.sqrt((np.square(d_tmp)).sum(axis=1)))
return np.cumsum(comparator(segment_distances, axis=1))
@property
def center_vertices(self) -> np.ndarray:
return self._center_vertices
@center_vertices.setter
def center_vertices(self, polyline: np.ndarray):
if self._center_vertices is None:
assert is_valid_polyline(
polyline), '<Lanelet/center_vertices>: The provided polyline is not valid! polyline = {}'.format(
polyline)
self._center_vertices = polyline
else:
warnings.warn('<Lanelet/center_vertices>: center_vertices of lanelet are immutable!')
@property
def line_marking_left_vertices(self) -> LineMarking:
return self._line_marking_left_vertices
@line_marking_left_vertices.setter
def line_marking_left_vertices(self, line_marking_left_vertices: LineMarking):
if self._line_marking_left_vertices is None:
assert isinstance(line_marking_left_vertices,
LineMarking), '<Lanelet/line_marking_left_vertices>: Provided lane marking type of ' \
'left boundary is not valid! type = {}'.format(
type(line_marking_left_vertices))
self._line_marking_left_vertices = LineMarking.UNKNOWN
else:
warnings.warn('<Lanelet/line_marking_left_vertices>: line_marking_left_vertices of lanelet is immutable!')
@property
def line_marking_right_vertices(self) -> LineMarking:
return self._line_marking_right_vertices
@line_marking_right_vertices.setter
def line_marking_right_vertices(self, line_marking_right_vertices: LineMarking):
if self._line_marking_right_vertices is None:
assert isinstance(line_marking_right_vertices,
LineMarking), '<Lanelet/line_marking_right_vertices>: Provided lane marking type of ' \
'right boundary is not valid! type = {}'.format(
type(line_marking_right_vertices))
self._line_marking_right_vertices = LineMarking.UNKNOWN
else:
warnings.warn('<Lanelet/line_marking_right_vertices>: line_marking_right_vertices of lanelet is immutable!')
@property
def predecessor(self) -> list:
return self._predecessor
@predecessor.setter
def predecessor(self, predecessor: list):
if self._predecessor is None:
assert (is_list_of_natural_numbers(predecessor) and len(predecessor) >= 0), '<Lanelet/predecessor>: ' \
'Provided list ' \
'of predecessors is not ' \
'valid!' \
'predecessors = {}'.format(
predecessor)
self._predecessor = predecessor
else:
warnings.warn('<Lanelet/predecessor>: predecessor of lanelet is immutable!')
@property
def successor(self) -> list:
return self._successor
@successor.setter
def successor(self, successor: list):
if self._successor is None:
assert (is_list_of_natural_numbers(successor) and len(successor) >= 0), '<Lanelet/predecessor>: Provided ' \
'list of successors is not valid!' \
'successors = {}'.format(successor)
self._successor = successor
else:
warnings.warn('<Lanelet/successor>: successor of lanelet is immutable!')
@property
def adj_left(self) -> int:
return self._adj_left
@adj_left.setter
def adj_left(self, l_id: int):
if self._adj_left is None:
assert is_natural_number(l_id), '<Lanelet/adj_left>: provided id is not valid! id={}'.format(l_id)
self._adj_left = l_id
else:
warnings.warn('<Lanelet/adj_left>: adj_left of lanelet is immutable')
@property
def adj_left_same_direction(self) -> bool:
return self._adj_left_same_direction
@adj_left_same_direction.setter
def adj_left_same_direction(self, same: bool):
if self._adj_left_same_direction is None:
assert isinstance(same, bool), '<Lanelet/adj_left_same_direction>: provided direction ' \
'is not of type bool! type = {}'.format(type(same))
self._adj_left_same_direction = same
else:
warnings.warn('<Lanelet/adj_left_same_direction>: adj_left_same_direction of lanelet is immutable')
@property
def adj_right(self) -> int:
return self._adj_right
@adj_right.setter
def adj_right(self, l_id: int):
if self._adj_right is None:
assert is_natural_number(l_id), '<Lanelet/adj_right>: provided id is not valid! id={}'.format(l_id)
self._adj_right = l_id
else:
warnings.warn('<Lanelet/adj_right>: adj_right of lanelet is immutable')
@property
def adj_right_same_direction(self) -> bool:
return self._adj_right_same_direction
@adj_right_same_direction.setter
def adj_right_same_direction(self, same: bool):
if self._adj_right_same_direction is None:
assert isinstance(same, bool), '<Lanelet/adj_right_same_direction>: provided direction ' \
'is not of type bool! type = {}'.format(type(same))
self._adj_right_same_direction = same
else:
warnings.warn('<Lanelet/adj_right_same_direction>: adj_right_same_direction of lanelet is immutable')
@property
def dynamic_obstacles_on_lanelet(self) -> Dict[int, Set[int]]:
return self._dynamic_obstacles_on_lanelet
@dynamic_obstacles_on_lanelet.setter
def dynamic_obstacles_on_lanelet(self, obstacle_ids: Dict[int, Set[int]]):
assert isinstance(obstacle_ids, dict), '<Lanelet/obstacles_on_lanelet>: provided dictionary of ids is not a ' \
'dictionary! type = {}'.format(type(obstacle_ids))
self._dynamic_obstacles_on_lanelet = obstacle_ids
@property
def static_obstacles_on_lanelet(self) -> Union[None, Set[int]]:
return self._static_obstacles_on_lanelet
@static_obstacles_on_lanelet.setter
def static_obstacles_on_lanelet(self, obstacle_ids: Set[int]):
assert isinstance(obstacle_ids, set), '<Lanelet/obstacles_on_lanelet>: provided list of ids is not a ' \
'set! type = {}'.format(type(obstacle_ids))
self._static_obstacles_on_lanelet = obstacle_ids
@property
def stop_line(self) -> StopLine:
return self._stop_line
@stop_line.setter
def stop_line(self, stop_line: StopLine):
if self._stop_line is None:
assert isinstance(stop_line,
StopLine), '<Lanelet/stop_line>: ''Provided type is not valid! type = {}'.format(
type(stop_line))
self._stop_line = stop_line
else:
warnings.warn('<Lanelet/stop_line>: stop_line of lanelet is immutable!', stacklevel=1)
@property
def lanelet_type(self) -> Set[LaneletType]:
return self._lanelet_type
@lanelet_type.setter
def lanelet_type(self, lanelet_type: Set[LaneletType]):
if self._lanelet_type is None or len(self._lanelet_type) == 0:
assert isinstance(lanelet_type, set) and all(isinstance(elem, LaneletType) for elem in
lanelet_type), '<Lanelet/lanelet_type>: ''Provided type is ' \
'not valid! type = {}, ' \
'expected = Set[LaneletType]'.format(
type(lanelet_type))
self._lanelet_type = lanelet_type
else:
warnings.warn('<Lanelet/lanelet_type>: type of lanelet is immutable!')
@property
def user_one_way(self) -> Set[RoadUser]:
return self._user_one_way
@user_one_way.setter
def user_one_way(self, user_one_way: Set[RoadUser]):
if self._user_one_way is None:
assert isinstance(user_one_way, set) and all(
isinstance(elem, RoadUser) for elem in user_one_way), '<Lanelet/user_one_way>: ' \
'Provided type is ' \
'not valid! type = {}'.format(
type(user_one_way))
self._user_one_way = user_one_way
else:
warnings.warn('<Lanelet/user_one_way>: user_one_way of lanelet is immutable!')
@property
def user_bidirectional(self) -> Set[RoadUser]:
return self._user_bidirectional
@user_bidirectional.setter
def user_bidirectional(self, user_bidirectional: Set[RoadUser]):
if self._user_bidirectional is None:
assert isinstance(user_bidirectional, set) and all(
isinstance(elem, RoadUser) for elem in user_bidirectional), '<Lanelet/user_bidirectional>: ' \
'Provided type is not valid! type' \
' = {}'.format(type(user_bidirectional))
self._user_bidirectional = user_bidirectional
else:
warnings.warn('<Lanelet/user_bidirectional>: user_bidirectional of lanelet is immutable!')
@property
def traffic_signs(self) -> Set[int]:
return self._traffic_signs
@traffic_signs.setter
def traffic_signs(self, traffic_sign_ids: Set[int]):
if self._traffic_signs is None:
assert isinstance(traffic_sign_ids, set), '<Lanelet/traffic_signs>: provided list of ids is not a ' \
'set! type = {}'.format(type(traffic_sign_ids))
self._traffic_signs = traffic_sign_ids
else:
warnings.warn('<Lanelet/traffic_signs>: traffic_signs of lanelet is immutable!')
@property
def traffic_lights(self) -> Set[int]:
return self._traffic_lights
@traffic_lights.setter
def traffic_lights(self, traffic_light_ids: Set[int]):
if self._traffic_lights is None:
assert isinstance(traffic_light_ids, set), '<Lanelet/traffic_lights>: provided list of ids is not a ' \
'set! type = {}'.format(type(traffic_light_ids))
self._traffic_lights = traffic_light_ids
else:
warnings.warn('<Lanelet/traffic_lights>: traffic_lights of lanelet is immutable!')
@property
def polygon(self) -> Polygon:
return self._polygon
def add_predecessor(self, lanelet: int):
"""
Adds the ID of a predecessor lanelet to the list of predecessors.
:param lanelet: Predecessor lanelet ID.
"""
if lanelet not in self.predecessor:
self.predecessor.append(lanelet)
def remove_predecessor(self, lanelet: int):
"""
Removes the ID of a predecessor lanelet from the list of predecessors.
:param lanelet: Predecessor lanelet ID.
"""
if lanelet in self.predecessor:
self.predecessor.remove(lanelet)
def add_successor(self, lanelet: int):
"""
Adds the ID of a successor lanelet to the list of successors.
:param lanelet: Successor lanelet ID.
"""
if lanelet not in self.successor:
self.successor.append(lanelet)
def remove_successor(self, lanelet: int):
"""
Removes the ID of a successor lanelet from the list of successors.
:param lanelet: Successor lanelet ID.
"""
if lanelet in self.successor:
self.successor.remove(lanelet)
def translate_rotate(self, translation: np.ndarray, angle: float):
"""
This method translates and rotates a lanelet
:param translation: The translation given as [x_off,y_off] for the x and y translation
:param angle: The rotation angle in radian (counter-clockwise defined)
"""
assert is_real_number_vector(translation, 2), '<Lanelet/translate_rotate>: provided translation ' \
'is not valid! translation = {}'.format(translation)
assert is_valid_orientation(
angle), '<Lanelet/translate_rotate>: provided angle is not valid! angle = {}'.format(angle)
# create transformation matrix
t_m = commonroad.geometry.transform.translation_rotation_matrix(translation, angle)
# transform center vertices
tmp = t_m.dot(np.vstack((self.center_vertices.transpose(), np.ones((1, self.center_vertices.shape[0])))))
tmp = tmp[0:2, :]
self._center_vertices = tmp.transpose()
# transform left vertices
tmp = t_m.dot(np.vstack((self.left_vertices.transpose(), np.ones((1, self.left_vertices.shape[0])))))
tmp = tmp[0:2, :]
self._left_vertices = tmp.transpose()
# transform right vertices
tmp = t_m.dot(np.vstack((self.right_vertices.transpose(), np.ones((1, self.right_vertices.shape[0])))))
tmp = tmp[0:2, :]
self._right_vertices = tmp.transpose()
# transform the stop line
if self._stop_line is not None:
self._stop_line.translate_rotate(translation, angle)
# recreate polygon in case it existed
self._polygon = Polygon(np.concatenate((self.right_vertices, np.flip(self.left_vertices, 0))))
def interpolate_position(self, distance: float) -> Tuple[np.ndarray, np.ndarray, np.ndarray, int]:
"""
Computes the interpolated positions on the center/right/left polyline of the lanelet for a given distance
along the lanelet
:param distance: The distance for the interpolation
:return: The interpolated positions on the center/right/left polyline and the segment id of the polyline where
the interpolation takes place in the form ([x_c,y_c],[x_r,y_r],[x_l,y_l], segment_id)
"""
assert is_real_number(distance) and np.greater_equal(self.distance[-1], distance) and np.greater_equal(distance,
0), \
'<Lanelet/interpolate_position>: provided distance is not valid! distance = {}'.format(
distance)
idx = np.searchsorted(self.distance, distance) - 1
while not self.distance[idx] <= distance:
idx += 1
r = (distance - self.distance[idx]) / (self.distance[idx + 1] - self.distance[idx])
return ((1 - r) * self._center_vertices[idx] + r * self._center_vertices[idx + 1],
(1 - r) * self._right_vertices[idx] + r * self._right_vertices[idx + 1],
(1 - r) * self._left_vertices[idx] + r * self._left_vertices[idx + 1], idx)
def convert_to_polygon(self) -> Polygon:
"""
Converts the given lanelet to a polygon representation
:return: The polygon of the lanelet
"""
warnings.warn("Use the lanelet property <polygon> instead", DeprecationWarning)
return self._polygon
def contains_points(self, point_list: np.ndarray) -> List[bool]:
"""
Checks if a list of points is enclosed in the lanelet
:param point_list: The list of points in the form [[px1,py1],[px2,py2,],...]
:return: List of Boolean values with True indicating point is enclosed and False otherwise
"""
assert isinstance(point_list,
ValidTypes.ARRAY), '<Lanelet/contains_points>: provided list of points is not a list! type ' \
'= {}'.format(type(point_list))
assert is_valid_polyline(
point_list), 'Lanelet/contains_points>: provided list of points is malformed! points = {}'.format(
point_list)
return [self._polygon.contains_point(p) for p in point_list]
def get_obstacles(self, obstacles: List[Obstacle], time_step: int = 0) -> List[Obstacle]:
"""
Returns the subset of obstacles, which are located in the lanelet, of a given candidate set
:param obstacles: The set of obstacle candidates
:param time_step: The time step for the occupancy to check
:return:
"""
assert isinstance(obstacles, list) and all(
isinstance(o, Obstacle) for o in obstacles), '<Lanelet/get_obstacles>: Provided list of obstacles' \
' is malformed! obstacles = {}'.format(obstacles)
# output list
res = list()
lanelet_shapely_obj = self._polygon.shapely_object
# look at each obstacle
for o in obstacles:
o_shape = o.occupancy_at_time(time_step).shape
# vertices to check
shape_shapely_objects = list()
# distinguish between shape and shape group and extract vertices
if isinstance(o_shape, ShapeGroup):
shape_shapely_objects.extend([sh.shapely_object for sh in o_shape.shapes])
else:
shape_shapely_objects.append(o_shape.shapely_object)
# check if obstacle is in lane
for shapely_obj in shape_shapely_objects:
if lanelet_shapely_obj.intersects(shapely_obj):
res.append(o)
break
return res
@staticmethod
def _merge_static_obstacles_on_lanelet(obstacles_on_lanelet1: Set[int], obstacles_on_lanelet2: Set[int]):
"""
Merges obstacle IDs of static obstacles on two lanelets
:param obstacles_on_lanelet1: Obstacle IDs on the first lanelet
:param obstacles_on_lanelet2: Obstacle IDs on the second lanelet
:return: Merged obstacle IDs of static obstacles on lanelets
"""
for obs_id in obstacles_on_lanelet2:
if obs_id not in obstacles_on_lanelet1:
obstacles_on_lanelet1.add(obs_id)
return obstacles_on_lanelet1
@staticmethod
def _merge_dynamic_obstacles_on_lanelet(obstacles_on_lanelet1: Dict[int, Set[int]],
obstacles_on_lanelet2: Dict[int, Set[int]]):
"""
Merges obstacle IDs of static obstacles on two lanelets
:param obstacles_on_lanelet1: Obstacle IDs on the first lanelet
:param obstacles_on_lanelet2: Obstacle IDs on the second lanelet
:return: Merged obstacle IDs of static obstacles on lanelets
"""
if len(obstacles_on_lanelet2.items()) > 0:
for time_step, ids in obstacles_on_lanelet2.items():
for obs_id in ids:
if obstacles_on_lanelet1.get(time_step) is not None:
if obs_id not in obstacles_on_lanelet1[time_step]:
obstacles_on_lanelet1[time_step].add(obs_id)
else:
obstacles_on_lanelet1[time_step] = {obs_id}
return obstacles_on_lanelet1
@classmethod
def merge_lanelets(cls, lanelet1: 'Lanelet', lanelet2: 'Lanelet') -> 'Lanelet':
"""
Merges two lanelets which are in predecessor-successor relation
:param lanelet1: The first lanelet
:param lanelet2: The second lanelet
:return: Merged lanelet (predecessor => successor)
"""
assert isinstance(lanelet1, Lanelet), '<Lanelet/merge_lanelets>: lanelet1 is not a valid lanelet object!'
assert isinstance(lanelet2, Lanelet), '<Lanelet/merge_lanelets>: lanelet1 is not a valid lanelet object!'
# check connection via successor / predecessor
assert lanelet1.lanelet_id in lanelet2.successor or \
lanelet2.lanelet_id in lanelet1.successor or \
lanelet1.lanelet_id in lanelet2.predecessor or \
lanelet2.lanelet_id in lanelet1.predecessor, '<Lanelet/merge_lanelets>: cannot merge two not ' \
'connected lanelets! successors of l1 = {}, successors ' \
'of l2 = {}'.format(lanelet1.successor, lanelet2.successor)
# check pred and successor
if lanelet1.lanelet_id in lanelet2.predecessor or lanelet2.lanelet_id in lanelet1.successor:
pred = lanelet1
suc = lanelet2
else:
pred = lanelet2
suc = lanelet1
# build new merged lanelet (remove first node of successor if both lanes are connected)
# check connectedness
if np.isclose(pred.left_vertices[-1], suc.left_vertices[0]).all():
idx = 1
else:
idx = 0
# create new lanelet
left_vertices = np.concatenate((pred.left_vertices, suc.left_vertices[idx:]))
right_vertices = np.concatenate((pred.right_vertices, suc.right_vertices[idx:]))
center_vertices = np.concatenate((pred.center_vertices, suc.center_vertices[idx:]))
lanelet_id = int(str(pred.lanelet_id) + str(suc.lanelet_id))
predecessor = pred.predecessor
successor = suc.successor
static_obstacles_on_lanelet = cls._merge_static_obstacles_on_lanelet(lanelet1.static_obstacles_on_lanelet,
lanelet2.static_obstacles_on_lanelet)
dynamic_obstacles_on_lanelet = cls._merge_dynamic_obstacles_on_lanelet(lanelet1.dynamic_obstacles_on_lanelet,
lanelet2.dynamic_obstacles_on_lanelet)
new_lanelet = Lanelet(left_vertices, center_vertices, right_vertices, lanelet_id, predecessor=predecessor,
successor=successor)
new_lanelet.static_obstacles_on_lanelet = static_obstacles_on_lanelet
new_lanelet.dynamic_obstacles_on_lanelet = dynamic_obstacles_on_lanelet
return new_lanelet
@classmethod
def all_lanelets_by_merging_successors_from_lanelet(cls, lanelet: 'Lanelet',
network: 'LaneletNetwork', max_length: float = 150.0) \
-> Tuple[List['Lanelet'], List[List[int]]]:
"""
Computes all reachable lanelets starting from a provided lanelet
and merges them to a single lanelet for each route.
:param lanelet: The lanelet to start from
:param network: The network which contains all lanelets
:param max_length: maximal length of merged lanelets can be provided
:return: List of merged lanelets, Lists of lanelet ids of which each merged lanelet consists
"""
assert isinstance(lanelet, Lanelet), '<Lanelet>: provided lanelet is not a valid Lanelet!'
assert isinstance(network, LaneletNetwork), '<Lanelet>: provided lanelet network is not a ' \
'valid lanelet network!'
assert network.find_lanelet_by_id(lanelet.lanelet_id) is not None, '<Lanelet>: lanelet not ' \
'contained in network!'
if lanelet.successor is None or len(lanelet.successor) == 0:
return [lanelet], [[lanelet.lanelet_id]]
merge_jobs = lanelet.find_lanelet_successors_in_range(network, max_length=max_length)
merge_jobs = [[lanelet] + [network.find_lanelet_by_id(p) for p in path] for path in merge_jobs]
# Create merged lanelets from paths
merged_lanelets = list()
merge_jobs_final = []
for path in merge_jobs:
pred = path[0]
merge_jobs_tmp = [pred.lanelet_id]
for lanelet in path[1:]:
merge_jobs_tmp.append(lanelet.lanelet_id)
pred = Lanelet.merge_lanelets(pred, lanelet)
merge_jobs_final.append(merge_jobs_tmp)
merged_lanelets.append(pred)
return merged_lanelets, merge_jobs_final
def find_lanelet_successors_in_range(self, lanelet_network: "LaneletNetwork", max_length=50.0) -> List[List[int]]:
"""
Finds all possible successor paths (id sequences) within max_length.
:param lanelet_network: lanelet network
:param max_length: abort once length of path is reached
:return: list of lanelet IDs
"""
paths = [[s] for s in self.successor]
paths_final = []
lengths = [lanelet_network.find_lanelet_by_id(s).distance[-1] for s in self.successor]
while paths:
paths_next = []
lengths_next = []
for p, le in zip(paths, lengths):
successors = lanelet_network.find_lanelet_by_id(p[-1]).successor
if not successors:
paths_final.append(p)
else:
for s in successors:
if s in p or s == self.lanelet_id or le >= max_length:
# prevent loops and consider length of first successor
paths_final.append(p)
continue
l_next = le + lanelet_network.find_lanelet_by_id(s).distance[-1]
if l_next < max_length:
paths_next.append(p + [s])
lengths_next.append(l_next)
else:
paths_final.append(p + [s])
paths = paths_next
lengths = lengths_next
return paths_final
def add_dynamic_obstacle_to_lanelet(self, obstacle_id: int, time_step: int):
"""
Adds a dynamic obstacle ID to lanelet
:param obstacle_id: obstacle ID to add
:param time_step: time step at which the obstacle should be added
"""
if self.dynamic_obstacles_on_lanelet.get(time_step) is None:
self.dynamic_obstacles_on_lanelet[time_step] = set()
self.dynamic_obstacles_on_lanelet[time_step].add(obstacle_id)
def add_static_obstacle_to_lanelet(self, obstacle_id: int):
"""
Adds a static obstacle ID to lanelet
:param obstacle_id: obstacle ID to add
"""
self.static_obstacles_on_lanelet.add(obstacle_id)
def add_traffic_sign_to_lanelet(self, traffic_sign_id: int):
"""
Adds a traffic sign ID to lanelet
:param traffic_sign_id: traffic sign ID to add
"""
self.traffic_signs.add(traffic_sign_id)
def add_traffic_light_to_lanelet(self, traffic_light_id: int):
"""
Adds a traffic light ID to lanelet
:param traffic_light_id: traffic light ID to add
"""
self.traffic_lights.add(traffic_light_id)
def dynamic_obstacle_by_time_step(self, time_step) -> Set[int]:
"""
Returns all dynamic obstacles on lanelet at specific time step
:param time_step: time step of interest
:returns: list of obstacle IDs
"""
if self.dynamic_obstacles_on_lanelet.get(time_step) is not None:
return self.dynamic_obstacles_on_lanelet.get(time_step)
else:
return set()
class LaneletNetwork(IDrawable):
"""
Class which represents a network of connected lanelets
"""
def __init__(self):
"""
Constructor for LaneletNetwork
"""
self._lanelets: Dict[int, Lanelet] = {}
# lanelet_id, shapely_polygon
self._buffered_polygons: Dict[int, ShapelyPolygon] = {}
self._strtee = None
# id(shapely_polygon), lanelet_id
self._lanelet_id_index_by_id: Dict[int, int] = {}
self._intersections: Dict[int, Intersection] = {}
self._traffic_signs: Dict[int, TrafficSign] = {}
self._traffic_lights: Dict[int, TrafficLight] = {}
# pickling of STRtree is not supported by shapely at the moment
# use this workaround described in this issue:
# https://github.com/Toblerity/Shapely/issues/1033
def __getstate__(self):
state = self.__dict__.copy()
del state["_strtee"]
return state
def __setstate__(self, state):
self.__dict__.update(state)
self._create_strtree()
def __deepcopy__(self, memo):
cls = self.__class__
result = cls.__new__(cls)
# reset
self._strtee = None
memo[id(self)] = result
for k, v in self.__dict__.items():
setattr(result, k, copy.deepcopy(v, memo))
result._create_strtree()
# restore
self._create_strtree()
return result
def __eq__(self, other):
if not isinstance(other, LaneletNetwork):
warnings.warn(f"Inequality between LaneletNetwork {repr(self)} and different type {type(other)}")
return False
list_elements_eq = True
lanelet_network_eq = True
elements = [self._lanelets, self._intersections, self._traffic_signs, self._traffic_lights]
elements_other = [other._lanelets, other._intersections, other._traffic_signs, other._traffic_lights]
for i in range(0, len(elements)):
e = elements[i]
e_other = elements_other[i]
lanelet_network_eq = lanelet_network_eq and len(e) == len(e_other)
for k in e.keys():
if k not in e_other:
lanelet_network_eq = False
continue
if e.get(k) != e_other.get(k):
list_elements_eq = False
if not lanelet_network_eq:
warnings.warn(f"Inequality of LaneletNetwork {repr(self)} and the other one {repr(other)}")
return lanelet_network_eq and list_elements_eq
def __hash__(self):
return hash((frozenset(self._lanelets.items()), frozenset(self._intersections.items()),
frozenset(self._traffic_signs.items()), frozenset(self._traffic_lights.items())))
def __str__(self):
return f"LaneletNetwork consists of lanelets {set(self._lanelets.keys())}, " \
f"intersections {set(self._intersections.keys())}, " \
f"traffic signs {set(self._traffic_signs.keys())}, and traffic lights {set(self._traffic_lights.keys())}"
def __repr__(self):
return f"LaneletNetwork(lanelets={repr(self._lanelets)}, intersections={repr(self._intersections)}, " \
f"traffic_signs={repr(self._traffic_signs)}, traffic_lights={repr(self._traffic_lights)})"
def _get_lanelet_id_by_shapely_polygon(self, polygon: ShapelyPolygon) -> int:
return self._lanelet_id_index_by_id[id(polygon)]
@property
def lanelets(self) -> List[Lanelet]:
return list(self._lanelets.values())
@property
def lanelet_polygons(self) -> List[Polygon]:
return [la.polygon for la in self.lanelets]
@lanelets.setter
def lanelets(self, _):
warnings.warn('<LaneletNetwork/lanelets>: lanelets of network are immutable')
@property
def intersections(self) -> List[Intersection]:
return list(self._intersections.values())
@property
def traffic_signs(self) -> List[TrafficSign]:
return list(self._traffic_signs.values())
@property
def traffic_lights(self) -> List[TrafficLight]:
return list(self._traffic_lights.values())
@property
def map_inc_lanelets_to_intersections(self) -> Dict[int, Intersection]:
"""
:returns: dict that maps lanelet ids to the intersection of which it is an incoming lanelet.
"""
return {l_id: intersection for intersection in self.intersections for l_id in
list(intersection.map_incoming_lanelets.keys())}
@classmethod
def create_from_lanelet_list(cls, lanelets: list, cleanup_ids: bool = False):
"""
Creates a LaneletNetwork object from a given list of lanelets
:param lanelets: The list of lanelets
:param cleanup_ids: cleans up unused ids
:return: The LaneletNetwork for the given list of lanelets
"""
assert isinstance(lanelets, list) and all(
isinstance(la, Lanelet) for la in lanelets), '<LaneletNetwork/create_from_lanelet_list>:' \
'Provided list of lanelets is not valid! ' \
'lanelets = {}'.format(lanelets)
# create lanelet network
lanelet_network = cls()
# add each lanelet to the lanelet network
for la in lanelets:
lanelet_network.add_lanelet(copy.deepcopy(la), rtree=False)
if cleanup_ids:
lanelet_network.cleanup_lanelet_references()
lanelet_network._create_strtree()
return lanelet_network
@classmethod
def create_from_lanelet_network(cls, lanelet_network: 'LaneletNetwork', shape_input=None,
exclude_lanelet_types=None):
"""
Creates a lanelet network from a given lanelet network (copy); adding a shape reduces the lanelets to those
that intersect the shape provided and specifying a lanelet_type set excludes the lanelet types in the new
created network.
:param lanelet_network: The existing lanelet network
:param shape_input: The lanelets intersecting this shape will be in the new network
:param exclude_lanelet_types: Removes all lanelets with these lanelet_types
:return: The new lanelet network
"""
if exclude_lanelet_types is None:
exclude_lanelet_types = set()
new_lanelet_network = cls()
traffic_sign_ids = set()
traffic_light_ids = set()
lanelets = set()
if shape_input is not None:
for la in lanelet_network.lanelets:
if la.lanelet_type.intersection(exclude_lanelet_types) == set():
lanelet_polygon = la.polygon.shapely_object
if shape_input.shapely_object.intersects(lanelet_polygon):
for sign_id in la.traffic_signs:
traffic_sign_ids.add(sign_id)
for light_id in la.traffic_lights:
traffic_light_ids.add(light_id)
lanelets.add(la)
else:
for la in lanelet_network.lanelets:
if la.lanelet_type.intersection(exclude_lanelet_types) == set():
lanelets.add(la)
for sign_id in la.traffic_signs:
traffic_sign_ids.add(sign_id)
for light_id in la.traffic_lights:
traffic_light_ids.add(light_id)
for sign_id in traffic_sign_ids:
new_lanelet_network.add_traffic_sign(copy.deepcopy(lanelet_network.find_traffic_sign_by_id(sign_id)), set())
for light_id in traffic_light_ids:
new_lanelet_network.add_traffic_light(copy.deepcopy(lanelet_network.find_traffic_light_by_id(light_id)),
set())
for la in lanelets:
new_lanelet_network.add_lanelet(copy.deepcopy(la), rtree=False)
new_lanelet_network._create_strtree()
return new_lanelet_network
def _create_strtree(self):
"""
Creates spatial index for lanelets for faster querying the lanelets by position.
Since it is an immutable object, it has to be recreated after every lanelet addition or it should be done
once after all lanelets are added.
"""
# validate buffered polygons
def assert_shapely_polygon(lanelet_id, polygon):
if not isinstance(polygon, ShapelyPolygon):
warnings.warn(
f"Lanelet with id {lanelet_id}'s polygon is not a <shapely.geometry.Polygon> object! It will "
f"be OMITTED from STRtree, therefore this lanelet will NOT be contained in the results of the "
f"find_lanelet_by_<position/shape>() functions!!")
return False
else:
return True
self._buffered_polygons = {lanelet_id: lanelet_shapely_polygon for lanelet_id, lanelet_shapely_polygon in
self._buffered_polygons.items() if
assert_shapely_polygon(lanelet_id, lanelet_shapely_polygon)}
self._lanelet_id_index_by_id = {id(lanelet_shapely_polygon): lanelet_id for lanelet_id, lanelet_shapely_polygon
in self._buffered_polygons.items()}
self._strtee = STRtree(list(self._buffered_polygons.values()))
def remove_lanelet(self, lanelet_id: int, rtree: bool = True):
"""
Removes a lanelet from a lanelet network and deletes all references.
@param lanelet_id: ID of lanelet which should be removed.
@param rtree: Boolean indicating whether rtree should be initialized
"""
if lanelet_id in self._lanelets.keys():
del self._lanelets[lanelet_id]
del self._buffered_polygons[lanelet_id]
self.cleanup_lanelet_references()
if rtree:
self._create_strtree()
def cleanup_lanelet_references(self):
"""
Deletes lanelet IDs which do not exist in the lanelet network. Useful when cutting out lanelet networks.
"""
existing_ids = set(self._lanelets.keys())
for la in self.lanelets:
la._predecessor = list(set(la.predecessor).intersection(existing_ids))
la._successor = list(set(la.successor).intersection(existing_ids))
la._adj_left = None if la.adj_left is None or la.adj_left not in existing_ids else la.adj_left
la._adj_left_same_direction = None \
if la.adj_left_same_direction is None or la.adj_left not in existing_ids else la.adj_left_same_direction
la._adj_right = None if la.adj_right is None or la.adj_right not in existing_ids else la.adj_right
la._adj_right_same_direction = None \
if la.adj_right_same_direction is None or la.adj_right not in existing_ids else \
la.adj_right_same_direction
for inter in self.intersections:
for inc in inter.incomings:
inc._incoming_lanelets = set(inc.incoming_lanelets).intersection(existing_ids)
inc._successors_straight = set(inc.successors_straight).intersection(existing_ids)
inc._successors_right = set(inc.successors_right).intersection(existing_ids)
inc._successors_left = set(inc.successors_left).intersection(existing_ids)
inter._crossings = set(inter.crossings).intersection(existing_ids)
def remove_traffic_sign(self, traffic_sign_id: int):
"""
Removes a traffic sign from a lanelet network and deletes all references.
@param traffic_sign_id: ID of traffic sign which should be removed.
"""
if traffic_sign_id in self._traffic_signs.keys():
del self._traffic_signs[traffic_sign_id]
self.cleanup_traffic_sign_references()
def cleanup_traffic_sign_references(self):
"""
Deletes traffic sign IDs which do not exist in the lanelet network. Useful when cutting out lanelet networks.
"""
existing_ids = set(self._traffic_signs.keys())
for la in self.lanelets:
la._traffic_signs = la.traffic_signs.intersection(existing_ids)
if la.stop_line is not None and la.stop_line.traffic_sign_ref is not None:
la.stop_line._traffic_sign_ref = la.stop_line.traffic_sign_ref.intersection(existing_ids)
def remove_traffic_light(self, traffic_light_id: int):
"""
Removes a traffic light from a lanelet network and deletes all references.
@param traffic_light_id: ID of traffic sign which should be removed.
"""
if traffic_light_id in self._traffic_lights.keys():
del self._traffic_lights[traffic_light_id]
self.cleanup_traffic_light_references()
def cleanup_traffic_light_references(self):
"""
Deletes traffic light IDs which do not exist in the lanelet network. Useful when cutting out lanelet networks.
"""
existing_ids = set(self._traffic_lights.keys())
for la in self.lanelets:
la._traffic_lights = la.traffic_lights.intersection(existing_ids)
if la.stop_line is not None and la.stop_line.traffic_light_ref is not None:
la.stop_line._traffic_light_ref = la.stop_line.traffic_light_ref.intersection(existing_ids)
def remove_intersection(self, intersection_id: int):
"""
Removes a intersection from a lanelet network and deletes all references.
@param intersection_id: ID of intersection which should be removed.
"""
if intersection_id in self._intersections.keys():
del self._intersections[intersection_id]
def find_lanelet_by_id(self, lanelet_id: int) -> Lanelet:
"""
Finds a lanelet for a given lanelet_id
:param lanelet_id: The id of the lanelet to find
:return: The lanelet object if the id exists and None otherwise
"""
assert is_natural_number(
lanelet_id), '<LaneletNetwork/find_lanelet_by_id>: provided id is not valid! id = {}'.format(lanelet_id)
return self._lanelets[lanelet_id] if lanelet_id in self._lanelets else None
def find_traffic_sign_by_id(self, traffic_sign_id: int) -> TrafficSign:
"""
Finds a traffic sign for a given traffic_sign_id
:param traffic_sign_id: The id of the traffic sign to find
:return: The traffic sign object if the id exists and None otherwise
"""
assert is_natural_number(
traffic_sign_id), '<LaneletNetwork/find_traffic_sign_by_id>: provided id is not valid! ' \
'id = {}'.format(traffic_sign_id)
return self._traffic_signs[traffic_sign_id] if traffic_sign_id in self._traffic_signs else None
def find_traffic_light_by_id(self, traffic_light_id: int) -> TrafficLight:
"""
Finds a traffic light for a given traffic_light_id
:param traffic_light_id: The id of the traffic light to find
:return: The traffic light object if the id exists and None otherwise
"""
assert is_natural_number(
traffic_light_id), '<LaneletNetwork/find_traffic_light_by_id>: provided id is not valid! ' \
'id = {}'.format(traffic_light_id)
return self._traffic_lights[traffic_light_id] if traffic_light_id in self._traffic_lights else None
def find_intersection_by_id(self, intersection_id: int) -> Intersection:
"""
Finds a intersection for a given intersection_id
:param intersection_id: The id of the intersection to find
:return: The intersection object if the id exists and None otherwise
"""
assert is_natural_number(intersection_id), '<LaneletNetwork/find_intersection_by_id>: ' \
'provided id is not valid! id = {}'.format(intersection_id)
return self._intersections[intersection_id] if intersection_id in self._intersections else None
def add_lanelet(self, lanelet: Lanelet, rtree: bool = True):
"""
Adds a lanelet to the LaneletNetwork
:param lanelet: The lanelet to add
:param eps: The size increase of the buffered polygons
:param rtree: Boolean indicating whether rtree should be initialized
:return: True if the lanelet has successfully been added to the network, false otherwise
"""
assert isinstance(lanelet, Lanelet), '<LaneletNetwork/add_lanelet>: provided lanelet is not of ' \
'type lanelet! type = {}'.format(type(lanelet))
# check if lanelet already exists in network and warn user
if lanelet.lanelet_id in self._lanelets.keys():
warnings.warn('Lanelet already exists in network! No changes are made.')
return False
else:
self._lanelets[lanelet.lanelet_id] = lanelet
self._buffered_polygons[lanelet.lanelet_id] = lanelet.polygon.shapely_object
if rtree:
self._create_strtree()
return True
def add_traffic_sign(self, traffic_sign: TrafficSign, lanelet_ids: Set[int]):
"""
Adds a traffic sign to the LaneletNetwork
:param traffic_sign: The traffic sign to add
:param lanelet_ids: Lanelets the traffic sign should be referenced from
:return: True if the traffic sign has successfully been added to the network, false otherwise
"""
assert isinstance(traffic_sign, TrafficSign), '<LaneletNetwork/add_traffic_sign>: provided traffic sign is ' \
'not of type traffic_sign! type = {}'.format(type(traffic_sign))
# check if traffic already exists in network and warn user
if traffic_sign.traffic_sign_id in self._traffic_signs.keys():
warnings.warn('Traffic sign with ID {} already exists in network! '
'No changes are made.'.format(traffic_sign.traffic_sign_id))
return False
else:
self._traffic_signs[traffic_sign.traffic_sign_id] = traffic_sign
for lanelet_id in lanelet_ids:
lanelet = self.find_lanelet_by_id(lanelet_id)
if lanelet is not None:
lanelet.add_traffic_sign_to_lanelet(traffic_sign.traffic_sign_id)
else:
warnings.warn('Traffic sign cannot be referenced to lanelet because the lanelet does not exist.')
return True
def add_traffic_light(self, traffic_light: TrafficLight, lanelet_ids: Set[int]):
"""
Adds a traffic light to the LaneletNetwork
:param traffic_light: The traffic light to add
:param lanelet_ids: Lanelets the traffic sign should be referenced from
:return: True if the traffic light has successfully been added to the network, false otherwise
"""
assert isinstance(traffic_light, TrafficLight), '<LaneletNetwork/add_traffic_light>: provided traffic light ' \
'is not of type traffic_light! ' \
'type = {}'.format(type(traffic_light))
# check if traffic already exists in network and warn user
if traffic_light.traffic_light_id in self._traffic_lights.keys():
warnings.warn('Traffic light already exists in network! No changes are made.')
return False
else:
self._traffic_lights[traffic_light.traffic_light_id] = traffic_light
for lanelet_id in lanelet_ids:
lanelet = self.find_lanelet_by_id(lanelet_id)
if lanelet is not None:
lanelet.add_traffic_light_to_lanelet(traffic_light.traffic_light_id)
else:
warnings.warn('Traffic light cannot be referenced to lanelet because the lanelet does not exist.')
return True
def add_intersection(self, intersection: Intersection):
"""
Adds a intersection to the LaneletNetwork
:param intersection: The intersection to add
:return: True if the traffic light has successfully been added to the network, false otherwise
"""
assert isinstance(intersection, Intersection), '<LaneletNetwork/add_intersection>: provided intersection is ' \
'not of type Intersection! type = {}'.format(type(intersection))
# check if traffic already exists in network and warn user
if intersection.intersection_id in self._intersections.keys():
warnings.warn('Intersection already exists in network! No changes are made.')
return False
else:
self._intersections[intersection.intersection_id] = intersection
return True
def add_lanelets_from_network(self, lanelet_network: 'LaneletNetwork'):
"""
Adds lanelets from a given network object to the current network
:param lanelet_network: The lanelet network
:return: True if all lanelets have been added to the network, false otherwise
"""
flag = True
# add lanelets to the network
for la in lanelet_network.lanelets:
flag = flag and self.add_lanelet(la, rtree=False)
self._create_strtree()
return flag
def translate_rotate(self, translation: np.ndarray, angle: float):
"""
Translates and rotates the complete lanelet network
:param translation: The translation given as [x_off,y_off] for the x and y translation
:param angle: The rotation angle in radian (counter-clockwise defined)
"""
assert is_real_number_vector(translation,
2), '<LaneletNetwork/translate_rotate>: provided translation is not valid! ' \
'translation = {}'.format(translation)
assert is_valid_orientation(
angle), '<LaneletNetwork/translate_rotate>: provided angle is not valid! angle = {}'.format(angle)
# rotate each lanelet
for lanelet in self._lanelets.values():
lanelet.translate_rotate(translation, angle)
for traffic_sign in self._traffic_signs.values():
traffic_sign.translate_rotate(translation, angle)
for traffic_light in self._traffic_lights.values():
traffic_light.translate_rotate(translation, angle)
def find_lanelet_by_position(self, point_list: List[np.ndarray]) -> List[List[int]]:
"""
Finds the lanelet id of a given position
:param point_list: The list of positions to check
:return: A list of lanelet ids. If the position could not be matched to a lanelet, an empty list is returned
"""
assert isinstance(point_list,
ValidTypes.LISTS), '<Lanelet/contains_points>: provided list of points is not a list! type ' \
'= {}'.format(
type(point_list))
return [[self._get_lanelet_id_by_shapely_polygon(lanelet_shapely_polygon) for lanelet_shapely_polygon in
self._strtee.query(point) if lanelet_shapely_polygon.intersects(point)
or lanelet_shapely_polygon.buffer(1e-15).intersects(point)] for point in
[ShapelyPoint(point) for point in point_list]]
def find_lanelet_by_shape(self, shape: Shape) -> List[int]:
"""
Finds the lanelet id of a given shape
:param shape: The shape to check
:return: A list of lanelet ids. If the position could not be matched to a lanelet, an empty list is returned
"""
assert isinstance(shape, (Circle, Polygon, Rectangle)), '<Lanelet/find_lanelet_by_shape>: ' \
'provided shape is not a shape! ' \
'type = {}'.format(type(shape))
return [self._get_lanelet_id_by_shapely_polygon(lanelet_shapely_polygon) for lanelet_shapely_polygon in
self._strtee.query(shape.shapely_object) if lanelet_shapely_polygon.intersects(shape.shapely_object)]
def filter_obstacles_in_network(self, obstacles: List[Obstacle]) -> List[Obstacle]:
"""
Returns the list of obstacles which are located in the lanelet network
:param obstacles: The list of obstacles to check
:return: The list of obstacles which are located in the lanelet network
"""
res = list()
obstacle_to_lanelet_map = self.map_obstacles_to_lanelets(obstacles)
for k in obstacle_to_lanelet_map.keys():
obs = obstacle_to_lanelet_map[k]
for o in obs:
if o not in res:
res.append(o)
return res
def map_obstacles_to_lanelets(self, obstacles: List[Obstacle]) -> Dict[int, List[Obstacle]]:
"""
Maps a given list of obstacles to the lanelets of the lanelet network
:param obstacles: The list of CR obstacles
:return: A dictionary with the lanelet id as key and the list of obstacles on the lanelet as a List[Obstacles]
"""
mapping = {}
for la in self.lanelets:
# map obstacles to current lanelet
mapped_objs = la.get_obstacles(obstacles)
# check if mapping is not empty
if len(mapped_objs) > 0:
mapping[la.lanelet_id] = mapped_objs
return mapping
def lanelets_in_proximity(self, point: np.ndarray, radius: float) -> List[Lanelet]:
"""
Finds all lanelets which intersect a given circle, defined by the center point and radius
:param point: The center of the circle
:param radius: The radius of the circle
:return: The list of lanelets which intersect the given circle
"""
assert is_real_number_vector(point, length=2), '<LaneletNetwork/lanelets_in_proximity>: provided point is ' \
'not valid! point = {}'.format(point)
assert is_positive(
radius), '<LaneletNetwork/lanelets_in_proximity>: provided radius is not valid! radius = {}'.format(
radius)
# get list of lanelet ids
ids = self._lanelets.keys()
# output list
lanes = dict()
rad_sqr = radius ** 2
# distance dict for sorting
distance_list = list()
# go through list of lanelets
for i in ids:
# if current lanelet has not already been added to lanes list
if i not in lanes:
lanelet = self.find_lanelet_by_id(i)
# compute distances (we are not using the sqrt for computational effort)
distance = (lanelet.center_vertices - point) ** 2.
distance = distance[:, 0] + distance[:, 1]
# check if at least one distance is smaller than the radius
if any(np.greater_equal(rad_sqr, distance)):
lanes[i] = self.find_lanelet_by_id(i)
distance_list.append(np.min(distance))
# check if adjacent lanelets can be added as well
index_min_dist = np.argmin(distance - rad_sqr)
# check right side of lanelet
if lanelet.adj_right is not None:
p = (lanelet.right_vertices[index_min_dist, :] - point) ** 2
p = p[0] + p[1]
if np.greater(rad_sqr, p) and lanelet.adj_right not in lanes:
lanes[lanelet.adj_right] = self.find_lanelet_by_id(lanelet.adj_right)
distance_list.append(p)
# check left side of lanelet
if lanelet.adj_left is not None:
p = (lanelet.left_vertices[index_min_dist, :] - point) ** 2
p = p[0] + p[1]
if np.greater(rad_sqr, p) and lanelet.adj_left not in lanes:
lanes[lanelet.adj_left] = self.find_lanelet_by_id(lanelet.adj_left)
distance_list.append(p)
# sort list according to distance
indices = np.argsort(distance_list)
lanelets = list(lanes.values())
# return sorted list
return [lanelets[i] for i in indices]
def draw(self, renderer: IRenderer, draw_params: Union[ParamServer, dict, None] = None,
call_stack: Optional[Tuple[str, ...]] = tuple()):
renderer.draw_lanelet_network(self, draw_params, call_stack)
| 45.103774 | 120 | 0.629314 | 75,432 | 0.986091 | 0 | 0 | 25,972 | 0.339521 | 0 | 0 | 23,939 | 0.312944 |
a0bf221732ca55e79444af87da162c6c9266b8fc | 363 | py | Python | djangoProject/djangoProject/myApp/urls.py | EldiiarDzhunusov/Code | 6b0708e4007233d3efdc74c09d09ee5bc377a45d | [
"MIT"
] | 2 | 2020-10-12T06:50:03.000Z | 2021-06-08T17:19:43.000Z | djangoProject/djangoProject/myApp/urls.py | EldiiarDzhunusov/Code | 6b0708e4007233d3efdc74c09d09ee5bc377a45d | [
"MIT"
] | null | null | null | djangoProject/djangoProject/myApp/urls.py | EldiiarDzhunusov/Code | 6b0708e4007233d3efdc74c09d09ee5bc377a45d | [
"MIT"
] | 1 | 2020-12-22T16:44:50.000Z | 2020-12-22T16:44:50.000Z |
from django.urls import path
from . import views
urlpatterns = [
path("test/", views.index, name = "index"),
path('completed/',views.show_completed,name= "completed"),
path('<int:action_id>/', views.show_action, name='action'),
path('update/', views.update_status, name="update_status"),
path('new/', views.new_action,name = "new_action"),
] | 33 | 63 | 0.674931 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 105 | 0.289256 |
a0c050b20614c1dbb61208ccd768082e1160610d | 14,673 | py | Python | tests/test_data_frame.py | gordonwatts/dataframe_expressions | cf135415f739377e9c2accb82606957417c7e0e6 | [
"MIT"
] | 4 | 2020-03-16T14:22:33.000Z | 2021-09-08T17:56:47.000Z | tests/test_data_frame.py | gordonwatts/dataframe_expressions | cf135415f739377e9c2accb82606957417c7e0e6 | [
"MIT"
] | 26 | 2020-05-28T20:58:42.000Z | 2020-10-21T01:27:17.000Z | tests/test_data_frame.py | gordonwatts/dataframe_expressions | cf135415f739377e9c2accb82606957417c7e0e6 | [
"MIT"
] | null | null | null | import ast
from typing import List, Optional, cast
import pytest
from dataframe_expressions import (
Column, DataFrame, ast_Callable, ast_Column, ast_DataFrame, define_alias)
from .utils_for_testing import reset_var_counter # NOQA
# numpy math functions (??)
# Advanced math operators
# (https://docs.python.org/3/reference/datamodel.html?highlight=__add__#emulating-numeric-types)
# the operator "in" (contains)? to see if one jet is in another collection?
# the operator len
# Make sure if d1 and d2 are two different sized,sourced DataFrames, then d1[d2.x] fails
# Filter functions - so pass a filter that gets called with whatever you are filtering on, and
# returns.
# https://stackoverflow.com/questions/847936/how-can-i-find-the-number-of-arguments-of-a-python-function
# Aliases allow some recursion, but with total flexability. If there is a circle and you want
# things done a second time, they
# won't be. Perhaps when we have an actual problem we can resolve this.
def find_df(a: Optional[ast.AST]) -> List[ast_DataFrame]:
result: List[ast_DataFrame] = []
class find_it(ast.NodeVisitor):
def visit_ast_DataFrame(self, a: ast_DataFrame):
result.append(a)
if a is None:
return []
find_it().visit(a)
return result
def test_empty_ctor():
DataFrame()
def test_dataframe_attribute():
d = DataFrame()
ref = d.x
assert isinstance(ref, DataFrame)
assert isinstance(ref.child_expr, ast.AST)
assert ast.dump(ref.child_expr) == "Attribute(value=ast_DataFrame(), attr='x', ctx=Load())"
@pytest.mark.parametrize("comp_op, ast_type", [
(lambda a, b: a < b, ast.Lt),
(lambda a, b: a <= b, ast.LtE),
(lambda a, b: a > b, ast.Gt),
(lambda a, b: a >= b, ast.GtE),
(lambda a, b: a == b, ast.Eq),
(lambda a, b: a != b, ast.NotEq),
(lambda b, a: a < b, ast.Gt),
(lambda b, a: a <= b, ast.GtE),
(lambda b, a: a > b, ast.Lt),
(lambda b, a: a >= b, ast.LtE),
(lambda b, a: a == b, ast.Eq),
(lambda b, a: a != b, ast.NotEq),
])
def test_mask_operator_with_const(comp_op, ast_type):
d = DataFrame()
ref = comp_op(d.x, 10)
assert isinstance(ref, Column)
assert ref.type == type(bool)
assert isinstance(ref.child_expr, ast.Compare)
assert len(ref.child_expr.ops) == 1
assert len(ref.child_expr.comparators) == 1
left = ref.child_expr.left
right = ref.child_expr.comparators[0]
assert isinstance(left, ast_DataFrame)
assert isinstance(right, ast.Num)
assert isinstance(ref.child_expr.ops[0], ast_type)
def test_mask_operator_2nd_dataframe():
d = DataFrame()
ref = d.x < d.y
assert isinstance(ref, Column)
assert ref.type == type(bool)
assert ast.dump(ref.child_expr) == \
"Compare(left=ast_DataFrame(), ops=[Lt()], comparators=[ast_DataFrame()])"
assert isinstance(ref.child_expr, ast.Compare)
df = ref.child_expr.left # type: ast.AST
assert isinstance(df, ast_DataFrame)
parents = find_df(df.dataframe.child_expr)
assert len(parents) == 1
assert parents[0].dataframe is d
def test_mask_operator_and():
d = DataFrame()
ref1 = d.x != 10
ref2 = d.x != 8
ref3 = ref1 & ref2
assert ast.dump(ref3.child_expr) == \
"BoolOp(op=And(), values=[ast_Column(), ast_Column()])"
def test_mask_operator_and_attributes():
d = DataFrame()
ref1 = d.x
ref2 = d.x
ref3 = ref1 & ref2
assert ast.dump(ref3.child_expr) == \
"BoolOp(op=And(), values=[ast_DataFrame(), ast_DataFrame()])"
def test_mask_operator_or_attributes():
d = DataFrame()
ref1 = d.x
ref2 = d.x
ref3 = ref1 | ref2
assert ast.dump(ref3.child_expr) == \
"BoolOp(op=Or(), values=[Name(id='p', ctx=Load()), ast_DataFrame()])"
def test_mask_operator_and_attribute():
d = DataFrame()
ref1 = d.x
ref2 = d.x > 10
ref3 = ref1 & ref2
assert ast.dump(ref3.child_expr) == \
"BoolOp(op=And(), values=[ast_DataFrame(), ast_Column()])"
def test_mask_operator_invert_attributes():
d = DataFrame()
ref1 = d.x
ref3 = ~ref1
assert ref3.child_expr is not None
assert ast.dump(ref3.child_expr) == \
"UnaryOp(op=Invert(), operand=ast_DataFrame())"
def test_mask_operator_or():
d = DataFrame()
ref1 = d.x != 10
ref2 = d.x != 8
ref3 = ref1 | ref2
assert ast.dump(ref3.child_expr) == \
"BoolOp(op=Or(), values=[ast_Column(), ast_Column()])"
def test_mask_operator_not():
d = DataFrame()
ref1 = d.x != 10
ref3 = ~ref1
assert ast.dump(ref3.child_expr) == \
"UnaryOp(op=Invert(), operand=ast_Column())"
def test_invert_dataframe():
d = DataFrame()
ref1 = ~d
assert ref1.child_expr is not None
assert ast.dump(ref1.child_expr) == \
"UnaryOp(op=Invert(), operand=ast_DataFrame())"
assert ref1.filter is None
def test_masking_df():
d = DataFrame()
d1 = d[d.x > 10]
assert isinstance(d1, DataFrame)
assert isinstance(d1.filter, Column)
assert ast.dump(d1.filter.child_expr) == \
"Compare(left=ast_DataFrame(), ops=[Gt()], comparators=[Num(n=10)])"
def test_slicing_df():
d = DataFrame()
d1 = d[10]
assert isinstance(d1, DataFrame)
assert isinstance(d1.child_expr, ast.Subscript)
assert isinstance(d1.child_expr.slice, ast.Index)
assert isinstance(d1.child_expr.value, ast_DataFrame)
assert d1.child_expr.slice.value == 10
@pytest.mark.parametrize("bin_op, ast_op, reverse", [
(lambda a, b: a + b, ast.Add, False),
(lambda a, b: a - b, ast.Sub, False),
(lambda a, b: a * b, ast.Mult, False),
(lambda a, b: a / b, ast.Div, False),
(lambda a, b: b + a, ast.Add, True),
(lambda a, b: b - a, ast.Sub, True),
(lambda a, b: b * a, ast.Mult, True),
(lambda a, b: b / a, ast.Div, True),
])
def test_binary_operators(bin_op, ast_op, reverse):
d = DataFrame()
d1 = bin_op(d.x, 1000)
assert d1.filter is None
assert d1.child_expr is not None
assert isinstance(d1.child_expr, ast.BinOp)
left = d1.child_expr.left
right = d1.child_expr.right
if reverse:
left, right = right, left
assert ast.dump(left) == 'ast_DataFrame()'
assert ast.dump(right) == 'Num(n=1000)'
assert isinstance(d1.child_expr.op, ast_op)
def test_np_sin():
import numpy as np
d = DataFrame()
d1 = cast(DataFrame, np.sin(d.x)) # type: ignore
assert d1.filter is None
assert d1.child_expr is not None
assert ast.dump(d1.child_expr) == \
"Call(func=Name(id='sin', ctx=Load()), args=[ast_DataFrame()], keywords=[])"
def test_python_abs():
d = DataFrame()
d1 = abs(d.x)
assert d1.filter is None
assert d1.child_expr is not None
assert ast.dump(d1.child_expr) == \
"Call(func=Name(id='abs', ctx=Load()), args=[ast_DataFrame()], keywords=[])"
def test_np_sin_kwargs():
import numpy as np
d = DataFrame()
d1 = cast(DataFrame, np.sin(d.x, bogus=22.0)) # type: ignore
assert d1.filter is None
assert d1.child_expr is not None
assert ast.dump(d1.child_expr) == \
"Call(func=Name(id='sin', ctx=Load()), args=[ast_DataFrame()], " \
"keywords=[keyword(arg='bogus', value=Num(n=22.0))])"
def test_np_arctan2_with_args():
import numpy as np
d = DataFrame()
d1 = cast(DataFrame, np.arctan2(d.x, 100.0)) # type: ignore
assert d1.filter is None
assert d1.child_expr is not None
assert ast.dump(d1.child_expr) == \
"Call(func=Name(id='arctan2', ctx=Load()), args=[ast_DataFrame(), " \
"Num(n=100.0)], keywords=[])"
def test_np_func_with_division():
import numpy as np
d = DataFrame()
f1 = np.log10(1.0/(d-1.0)) # type: ignore
from dataframe_expressions import dumps
assert '\n'.join(dumps(f1)) == '''df_1 = DataFrame()
df_2 = df_1 - 1.0
df_3 = 1.0 / df_2
df_4 = log10(df_3)'''
def test_np_func_where():
import numpy as np
d = DataFrame()
f1 = np.where(d.x > 0, d.x, d.y)
from dataframe_expressions import dumps
assert '\n'.join(dumps(cast(DataFrame, f1))) == '''df_1 = DataFrame()
df_2 = df_1.x
df_3 = df_2 > 0
df_4 = df_1.y
df_5 = np_where(df_3,df_2,df_4)'''
def test_np_func_histogram():
import numpy as np
d = DataFrame()
f1 = np.histogram(d.x, bins=50, range=(-0.5, 10.0))
from dataframe_expressions import dumps
assert '\n'.join(dumps(cast(DataFrame, f1))) == '''df_1 = DataFrame()
df_2 = df_1.x
df_3 = np_histogram(df_2,bins=50,range=(-0.5,10.0))'''
def test_fluent_function_no_args():
d = DataFrame()
d1 = d.count()
assert d1.filter is None
assert d1.child_expr is not None
assert ast.dump(d1.child_expr) == \
"Call(func=Attribute(value=ast_DataFrame(), attr='count', ctx=Load()), args=[], " \
"keywords=[])"
def test_fluent_function_pos_arg():
d = DataFrame()
d1 = d.count(22.0)
assert d1.filter is None
assert d1.child_expr is not None
assert ast.dump(d1.child_expr) == \
"Call(func=Attribute(value=ast_DataFrame(), attr='count', ctx=Load()), " \
"args=[Num(n=22.0)], keywords=[])"
def test_fluent_function_kwarg():
d = DataFrame()
d1 = d.count(dude=22.0)
assert d1.filter is None
assert d1.child_expr is not None
assert ast.dump(d1.child_expr) == \
"Call(func=Attribute(value=ast_DataFrame(), attr='count', ctx=Load()), args=[], " \
"keywords=[keyword(arg='dude', value=Num(n=22.0))])"
def test_test_fluent_function_df_arg():
d = DataFrame()
d1 = d.count(d)
assert d1.filter is None
assert d1.child_expr is not None
assert ast.dump(d1.child_expr) == \
"Call(func=Attribute(value=ast_DataFrame(), attr='count', ctx=Load()), " \
"args=[ast_DataFrame()], keywords=[])"
def test_test_fluent_function_dfattr_arg():
d = DataFrame()
d1 = d.count(d.jets)
assert d1.filter is None
assert d1.child_expr is not None
assert ast.dump(d1.child_expr) == \
"Call(func=Attribute(value=ast_DataFrame(), attr='count', ctx=Load()), " \
"args=[ast_DataFrame()], keywords=[])"
def test_test_fluent_function_dfattrattr_arg():
d = DataFrame()
d1 = d.jets.count(d.jets)
assert d1.filter is None
assert d1.child_expr is not None
assert ast.dump(d1.child_expr) == \
"Call(func=Attribute(value=ast_DataFrame(), attr='count', ctx=Load()), " \
"args=[ast_DataFrame()], keywords=[])"
def test_test_fluent_function_dfattr1_arg():
d = DataFrame()
d1 = d.jets.count(d)
assert d1.filter is None
assert d1.child_expr is not None
assert ast.dump(d1.child_expr) == \
"Call(func=Attribute(value=ast_DataFrame(), attr='count', ctx=Load()), " \
"args=[ast_DataFrame()], keywords=[])"
def test_resolve_simple_alias():
define_alias("jets", "pts", lambda j: j.pt / 1000.0)
df = DataFrame()
df1 = df.jets.pts
assert df1.filter is None
assert df1.child_expr is not None
assert '1000' in ast.dump(df1.child_expr)
def test_resolve_hidden_alias():
define_alias("jets", "pt", lambda j: j.pt / 1000.0)
df = DataFrame()
df1 = df.jets.pt
assert df1.filter is None
assert df1.child_expr is not None
assert '1000' in ast.dump(df1.child_expr)
def test_resolve_dependent():
define_alias("jets", "pts", lambda j: j.pt / 1000.0)
define_alias("jets", "pt", lambda j: j.pt / 2000.0)
df = DataFrame()
df1 = df.jets.pts
assert df1.filter is None
assert df1.child_expr is not None
assert '1000' in ast.dump(df1.child_expr)
assert isinstance(df1.child_expr, ast.BinOp)
assert df1.child_expr.left is not None
assert isinstance(df1.child_expr.left, ast_DataFrame)
df2 = cast(ast_DataFrame, df1.child_expr.left)
assert df2.dataframe.child_expr is not None
assert '2000' in ast.dump(df2.dataframe.child_expr)
def check_for_compare(e: ast.AST, check: str):
assert isinstance(e, ast.Compare)
left = e.left # type: ast.AST
assert isinstance(left, ast_DataFrame)
assert left.dataframe.child_expr is not None
t = ast.dump(left.dataframe.child_expr)
assert check in t
def test_resolve_in_filter():
define_alias("jets", "pt", lambda j: j.pt / 2000.0)
df = DataFrame()
df1 = df.jets.pt[df.jets.pt > 50.0]
assert df1.filter is not None
assert isinstance(df1.filter, Column)
check_for_compare(df1.filter.child_expr, '2000')
def test_resolve_in_filter_twice():
define_alias("jets", "pt", lambda j: j.pt / 2000.0)
df = DataFrame()
df1 = df.jets.pt[(df.jets.pt > 50.0) & (df.jets.pt < 60.0)]
assert df1.filter is not None
assert isinstance(df1.filter.child_expr, ast.BoolOp)
bool_op = df1.filter.child_expr
assert len(bool_op.values) == 2
op_1 = bool_op.values[0] # type: ast.AST
op_2 = bool_op.values[1] # type: ast.AST
assert isinstance(op_1, ast_Column)
assert isinstance(op_2, ast_Column)
check_for_compare(op_1.column.child_expr, '2000')
check_for_compare(op_1.column.child_expr, '2000')
def test_lambda_argument():
df = DataFrame()
df1 = df.apply(lambda e: e)
assert df1.child_expr is not None
assert isinstance(df1.child_expr, ast.Call)
assert len(df1.child_expr.args) == 1
arg1 = df1.child_expr.args[0]
assert isinstance(arg1, ast_Callable)
def test_lambda_in_filter():
df = DataFrame()
df1 = df[df.apply(lambda e: e == 1)]
assert isinstance(df1.child_expr, ast_DataFrame)
assert df1.filter is not None
assert isinstance(df1.filter, Column)
assert isinstance(df1.filter.child_expr, ast.Call)
def test_shallow_copy():
df = DataFrame()
import copy
df1 = copy.copy(df)
assert df1 is not df
assert df1.child_expr is None
assert df1.filter is None
def test_shallow_copy_1():
df = DataFrame()
df1 = df.x
import copy
df2 = copy.copy(df1)
assert df2 is not df1
assert df2.child_expr is not None
assert df2.filter is None
def test_deep_copy():
df = DataFrame()
import copy
df1 = copy.deepcopy(df)
assert df1 is not df
assert df1.child_expr is None
assert df1.filter is None
def test_deep_copy_1():
df = DataFrame()
df1 = df.x
import copy
df2 = copy.deepcopy(df1)
assert df2 is not df1
assert df2.child_expr is not None
assert df2.filter is None
assert isinstance(df2.child_expr, ast.Attribute)
assert isinstance(df2.child_expr.value, ast_DataFrame)
df2_parent = cast(ast_DataFrame, df2.child_expr.value)
assert df2_parent is not df
| 28.827112 | 122 | 0.647584 | 117 | 0.007974 | 0 | 0 | 1,856 | 0.126491 | 0 | 0 | 3,130 | 0.213317 |
a0c2eb12b9028951da45c66cf06efe7db3fad008 | 520 | py | Python | redis/redismq/redismq.py | dineshkumar2509/learning-python | e8af11ff0b396da4c3f2cfe21d14131bae4b2adb | [
"MIT"
] | 86 | 2015-06-13T16:53:55.000Z | 2022-03-24T20:56:42.000Z | redis/redismq/redismq.py | pei-zheng-yi/learning-python | 55e350dfe44cf04f7d4408e76e72d2f467bd42ce | [
"MIT"
] | 9 | 2015-05-27T07:52:44.000Z | 2022-03-29T21:52:40.000Z | redis/redismq/redismq.py | pei-zheng-yi/learning-python | 55e350dfe44cf04f7d4408e76e72d2f467bd42ce | [
"MIT"
] | 124 | 2015-12-10T01:17:18.000Z | 2021-11-08T04:03:38.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import redis
rc = redis.StrictRedis(host='localhost', port=6379, db=0)
def fifo_push(q, data):
rc.lpush(q, data)
def fifo_pop(q):
return rc.rpop(q)
def filo_push(q, data):
rc.lpush(q, data)
def filo_pop(q):
return rc.lpop(q)
def safe_fifo_push(q, data):
rc.lpush(q, data)
def safe_fifo_pop(q, cache):
msg = rc.rpoplpush(q, cache)
# check and do something on msg
rc.lrem(cache, 1) # remove the msg in cache list.
return msg
| 15.294118 | 57 | 0.634615 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 117 | 0.225 |
a0c41cacd5163331beb9572314dcb4bf4d9b8235 | 12,660 | py | Python | main.py | ESSAKHI10/SharpZone | 1d145cb22c5a8f6777d2f6e05a9a16f8e528c92c | [
"MIT"
] | null | null | null | main.py | ESSAKHI10/SharpZone | 1d145cb22c5a8f6777d2f6e05a9a16f8e528c92c | [
"MIT"
] | null | null | null | main.py | ESSAKHI10/SharpZone | 1d145cb22c5a8f6777d2f6e05a9a16f8e528c92c | [
"MIT"
] | null | null | null | # import encode
import eel
import cv2
import io
import numpy as np
import base64
import os
import time
import face_recognition
import pickle
import imutils
import datetime
from multiprocessing.pool import ThreadPool
import random
import shutil
from database import *
from camera import VideoCamera
from SceneChangeDetect import sceneChangeDetect
import login
import encode_student_data
import warnings
warnings.filterwarnings('ignore')
eel.init('web')
# ------ Global Variable ----
camera_status = 1
capture_status = False
student_id = ''
fullnamee = ''
def recogFace(data, encoding):
return face_recognition.compare_faces(data["encodings"], encoding, tolerance=0.5)
def recogEncodings(rgb, boxes):
return face_recognition.face_encodings(rgb, boxes)
def recogLoc(rgb):
return face_recognition.face_locations(rgb, model="hog")
def gen1(url, student_class):
# change camera status for loading
eel.camera_status(3)
pool1 = ThreadPool(processes=1)
pool2 = ThreadPool(processes=2)
pool3 = ThreadPool(processes=3)
pool4 = ThreadPool(processes=4)
conn = create_connection()
cursor = conn.cursor()
sql = "SELECT student_id ,fullname FROM student_data WHERE class = ? "
val = [student_class]
cursor.execute(sql, val)
student_data = cursor.fetchall()
print('liste student : ')
print(student_data)
# Load the known face and encodings
# print("[INFO] loading encodings ..")
data = pickle.loads(open("encodings.pickle", "rb").read())
Attendees_Names = {}
encodings = []
boxes = []
frame = 0
Scene = sceneChangeDetect()
video = cv2.VideoCapture(url)
time.sleep(1.0)
global camera_status
camera_status = 1
# change the camera status
eel.camera_status(1)
while camera_status == 1:
frame += 1
if (frame == 100):
frame = 0
# print(camera_status)
success, img = video.read()
# if camera can't read frame(Camera error)
if success == False:
eel.camera_status(2)
break
if (Scene.detectChange(img) == True):
# Convert BGR to RGB
rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
rgb = imutils.resize(img, width=900)
r = img.shape[1] / float(rgb.shape[1])
# detect boxes
if (frame % 2 == 0):
boxes = pool1.apply_async(recogLoc, (rgb,)).get()
encodings = pool3.apply_async(
recogEncodings, (rgb, boxes,)).get()
names = []
# square over the facial encodings
for encoding in encodings:
# attempt to match each face then initialise a dicationary
# matches = face_recognition.compare_faces(data["encodings"], encoding,tolerance=0.5)
matches = pool2.apply_async(recogFace, (data, encoding,)).get()
name = "Unkown_"
# check to see if we have found a match
if True in matches:
# find the indexes of all matched faces then initialize a
# dicationary to count the total number of times each face matched
matchedIds = [i for (i, b) in enumerate(matches) if b]
print('matches id ')
print(matchedIds)
counts = {}
counts.clear()
# loop over the recognized faces
for i in matchedIds:
name = data["names"][i]
print(name)
counts[name] = counts.get(name, 0) + 1
print('this is counts')
print(counts)
# determine the recognized faces with largest number
name = max(counts, key=counts.get)
print('d')
print(name)
if (name not in Attendees_Names):
Attendees_Names[name] = 1
for y in student_data:
nom = name.split('_')
if nom[0] in y:
print(y[1])
x = datetime.datetime.now()
date = str(x.day) + "-" + \
str(x.month) + "-" + str(x.year)
pool4.apply_async(
submit_live_attendance, (nom[0], student_class, date,))
eel.updateAttendance(y[1])()
names.append(name)
# loop over recognized faces
for ((top, right, bottom, left), name) in zip(boxes, names):
print('names')
print(names)
top = int(top * r)
right = int(right * r)
bottom = int(bottom * r)
left = int(left * r)
# draw the predicted face name on the image
cv2.rectangle(img, (left, top), (right, bottom),
(0, 255, 0), 2)
y = top - 15 if top - 15 > 15 else top + 15
nom = name.split('_')
cv2.putText(img, nom[1], (left, y), cv2.FONT_HERSHEY_SIMPLEX,
0.75, (0, 255, 0), 2)
ret, jpeg = cv2.imencode('.jpg', img)
img = jpeg.tobytes()
yield img
# camera is stopped by user
if success == True:
eel.camera_status(0)
@eel.expose
def start_video_py(cam_type, student_class):
switch = {
'1': 0,
'2': 1,
}
y = gen1(switch[cam_type], student_class)
print('yyyyyyyyyyyyyyyyyyyyyyyyyyyyyy')
print(y)
print('yyyyyyyyyyyyyyyyyyyyyyyyyyyyyy')
for each in y:
blob = base64.b64encode(each)
blob = blob.decode("utf-8")
eel.updateImageSrc(blob)()
@eel.expose
def stop_video_py():
global camera_status
camera_status = 0
@eel.expose
def capture_photo_py(url):
print('smile')
y = gen(url)
for each in y:
blob = base64.b64encode(each)
blob = blob.decode("utf-8")
eel.updateStudentImageSrc(blob)()
def gen(url):
video = cv2.VideoCapture(url)
global camera_status
global capture_status
camera_status = 1
while camera_status == 1:
success, img = video.read()
if success == False:
print("cam nt cnt")
break
if capture_status == True:
save_path = 'dataset/' + student_id + '_' + fullnamee
filename = save_path + "/photo" + \
str(random.randint(0, 999)) + ".jpg"
if not os.path.exists(save_path):
os.makedirs(save_path)
cv2.imwrite(filename, img)
send_capture_photo(img)
capture_status = False
ret, jpeg = cv2.imencode('.jpg', img)
img = jpeg.tobytes()
yield img
def submit_live_attendance(stu_id, student_class, date):
attendance_class = {
"C2": "INSERT INTO C2(student_id,attendance_date) VALUES(?, ?);",
"C1": "INSERT INTO C1(student_id,attendance_date) VALUES(?, ?);",
}
# adding data to database
conn = create_connection()
cursor = conn.cursor()
sql = attendance_class[student_class]
val = [stu_id, date]
cursor.execute(sql, val)
conn.commit()
conn.close()
@eel.expose
def save_photo(studentId, full):
global student_id
global fullnamee
global capture_status
student_id = studentId
fullnamee = full
capture_status = True
def send_capture_photo(img):
ret, jpeg = cv2.imencode('.jpg', img)
img = jpeg.tobytes()
blob = base64.b64encode(img)
blob = blob.decode("utf-8")
eel.showCapturePhoto(blob)
# adding new student data
@eel.expose
def submit_student_data(stu_id, fullname, student_class, session):
try:
encode_student_data.encode_student_data(stu_id)
# adding data to database
conn = create_connection()
cursor = conn.cursor()
sql = "INSERT INTO student_data(student_id,fullname,class,session) VALUES(?, ?, ?, ?);"
val = [stu_id, fullname, student_class, session]
cursor.execute(sql, val)
conn.commit()
eel.student_data_saved()
conn.close()
except:
# delete face data from file
delete_student_data_file(student_id)
eel.failed_data_submit()
@eel.expose
def fetch_class_data(search_class):
conn = create_connection()
cursor = conn.cursor()
val = [search_class]
sql = "SELECT * FROM student_data WHERE class = ?"
result = cursor.execute(sql, val)
for x in result:
eel.setTableData(x[0], x[1], x[2], x[3])
conn.close()
def delete_student_data_file(student_id):
# delete face data from file
# load the face data
with open('encodings.pickle', 'rb') as f:
face_data = pickle.load(f)
index = []
encodings = face_data['encodings']
names = face_data['names']
# count face data length
for i, item in enumerate(names):
if student_id in item:
index.append(i)
# delete id
for i in index:
names.remove(student_id)
# delete encoding
for i in index:
del encodings[index[0]]
# saved modified face data
face_data['names'] = names
face_data['encodings'] = encodings
f = open("encodings.pickle", "wb")
f.write(pickle.dumps(face_data))
f.close()
@eel.expose
def deleteStudent(student_id):
try:
# delete student image folder
try:
path = 'dataset/' + student_id
shutil.rmtree(path)
except Exception as e:
print(e)
# delete student data from database
conn = create_connection()
cursor = conn.cursor()
val = [student_id]
sql = "DELETE FROM student_data where student_id = ?"
cursor.execute(sql, val)
conn.commit()
conn.close()
# print("delete success database")
# delete face data from file
delete_student_data_file(student_id)
eel.deleteStatus(student_id)
except Exception as e:
print(e)
eel.deleteStatus("")
@eel.expose
def fetchAttendance(attendanceClass, attendanceDate):
student_class = {
'C1': "SELECT DISTINCT(d.student_id),d.fullname,d.class,ac.attendance_date FROM C1 ac,student_data d WHERE ac.student_id=d.student_id AND attendance_date = ?;",
'C2': "SELECT DISTINCT(d.student_id),d.fullname,d.class,ac.attendance_date FROM C2 ac,student_data d WHERE ac.student_id=d.student_id AND attendance_date = ?;",
}
conn = create_connection()
cursor = conn.cursor()
val = [attendanceDate]
sql = student_class[attendanceClass]
cursor.execute(sql, val)
result = cursor.fetchall()
print(len(result))
if len(result) > 0:
for x in result:
eel.attendanceTable(x[0], x[1], x[2], x[3])
else:
eel.attendanceTable("no result found", "", "", "")
conn.close()
@eel.expose
def fetch_graph_data(graphClass):
student_class = {
'C1': "SELECT DISTINCT(attendance_date) FROM C1 ORDER BY attendance_date ASC LIMIT 06 ",
'C2': "SELECT DISTINCT(attendance_date) FROM C2 ORDER BY attendance_date ASC LIMIT 06 ",
}
attendance_class = {
'C1': "SELECT COUNT(DISTINCT(student_id)) FROM C1 WHERE attendance_date = ? ;",
'C2': "SELECT COUNT(DISTINCT(student_id)) FROM C2 WHERE attendance_date = ? ;",
}
conn = create_connection()
cursor = conn.cursor()
sql = student_class[graphClass]
result = cursor.execute(sql)
date_arr = []
data_arr = []
for x in result:
date_arr.append(x[0])
# print(date_arr)
sql = attendance_class[graphClass]
for x in date_arr:
val = [x]
result = cursor.execute(sql, val)
for x in result:
data_arr.append(x[0])
# print(data_arr)
cursor.close()
eel.updateGraph(date_arr, data_arr)
eel.start('template/pages/samples/login.html', size=(1307, 713))
#eel.start('template/index.html', size=(1307, 713))
# eel.start('dashboard.html', size=(1307, 713))
| 29.648712 | 169 | 0.562243 | 0 | 0 | 5,558 | 0.439021 | 4,506 | 0.355924 | 0 | 0 | 2,765 | 0.218404 |
39f81d8b6eef50e0aea91f95d8884d5a0a59d256 | 3,713 | py | Python | models/job.py | k-wojcik/kylin_client_tool | 0fe827d1c8a86e3da61c85c48f78ce03c9260f3c | [
"Apache-2.0"
] | null | null | null | models/job.py | k-wojcik/kylin_client_tool | 0fe827d1c8a86e3da61c85c48f78ce03c9260f3c | [
"Apache-2.0"
] | null | null | null | models/job.py | k-wojcik/kylin_client_tool | 0fe827d1c8a86e3da61c85c48f78ce03c9260f3c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = 'Huang, Hua'
from models.object import JsonSerializableObj
class CubeJobStatus:
NEW = 'NEW'
PENDING = 'PENDING'
RUNNING = 'RUNNING'
ERROR = 'ERROR'
FINISHED = 'FINISHED'
DISCARDED = 'DISCARDED'
class JobInstance(JsonSerializableObj):
def __init__(self):
JsonSerializableObj.__init__(self)
self.uuid = None
self.last_modified = None
self.name = None
self.type = None
self.duration = None
self.related_cube = None
self.related_segment = None
self.exec_start_time = None
self.exec_end_time = None
self.mr_waiting = None
self.steps = None
self.submitter = None
@staticmethod
def from_json(json_dict):
if not json_dict or type(json_dict) != dict: return None
ji = JobInstance()
ji.uuid = json_dict.get('uuid')
ji.last_modified = json_dict.get('last_modified')
ji.name = json_dict.get('name')
ji.type = json_dict.get('type')
ji.duration = json_dict.get('duration')
ji.related_cube = json_dict.get('related_cube')
ji.related_segment = json_dict.get('related_segment')
ji.exec_start_time = json_dict.get('exec_start_time')
ji.exec_end_time = json_dict.get('exec_end_time')
ji.mr_waiting = json_dict.get('mr_waiting')
# deserialize json for steps
if json_dict.get('steps') and type(json_dict.get('steps')) == list:
step_list = json_dict.get('steps')
ji.steps = [JobStep.from_json(step) for step in step_list]
ji.submitter = json_dict.get('submitter')
return ji
def get_status(self):
if not self.steps:
return CubeJobStatus.ERROR
for job_step in self.steps:
if job_step.step_status in CubeJobStatus.ERROR:
return CubeJobStatus.ERROR
if job_step.step_status in CubeJobStatus.DISCARDED:
return CubeJobStatus.DISCARDED
# check the last step
job_step = self.steps[-1]
if job_step.step_status not in CubeJobStatus.FINISHED:
return CubeJobStatus.RUNNING
return CubeJobStatus.FINISHED
def get_current_step(self):
if not self.steps:
return 0
step_id = 1
for job_step in self.steps:
if job_step.step_status not in CubeJobStatus.FINISHED:
return step_id
step_id += 1
return len(self.steps)
class JobStep(JsonSerializableObj):
def __init__(self):
JsonSerializableObj.__init__(self)
self.name = None
self.sequence_id = None
self.exec_cmd = None
self.interrupt_cmd = None
self.exec_start_time = None
self.exec_end_time = None
self.exec_wait_time = None
self.step_status = None
self.cmd_type = None
self.info = None
self.run_async = None
@staticmethod
def from_json(json_dict):
if not json_dict or type(json_dict) != dict: return None
js = JobStep()
js.name = json_dict.get('name')
js.sequence_id = json_dict.get('sequence_id')
js.exec_cmd = json_dict.get('exec_cmd')
js.interrupt_cmd = json_dict.get('interrupt_cmd')
js.exec_start_time = json_dict.get('exec_start_time')
js.exec_end_time = json_dict.get('exec_end_time')
js.exec_wait_time = json_dict.get('exec_wait_time')
js.step_status = json_dict.get('step_status')
js.cmd_type = json_dict.get('cmd_type')
js.info = json_dict.get('info')
js.run_async = json_dict.get('run_async')
return js
| 30.434426 | 75 | 0.622408 | 3,607 | 0.971452 | 0 | 0 | 1,677 | 0.451656 | 0 | 0 | 417 | 0.112308 |
39f8dcdaeba92c1fff96ab2beb0ef7065bdd2f6c | 1,770 | py | Python | stakingsvc/walletgui/views/paymentmethodview.py | biz2013/xwjy | 8f4b5e3e3fc964796134052ff34d58d31ed41904 | [
"Apache-2.0"
] | 1 | 2019-12-15T16:56:44.000Z | 2019-12-15T16:56:44.000Z | stakingsvc/walletgui/views/paymentmethodview.py | biz2013/xwjy | 8f4b5e3e3fc964796134052ff34d58d31ed41904 | [
"Apache-2.0"
] | 87 | 2018-01-06T10:18:31.000Z | 2022-03-11T23:32:30.000Z | stakingsvc/walletgui/views/paymentmethodview.py | biz2013/xwjy | 8f4b5e3e3fc964796134052ff34d58d31ed41904 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import logging, sys
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from walletgui.controller.global_constants import *
from walletgui.controller.crypto_utils import CryptoUtility
from walletgui.controller.walletmanager import WalletManager
from walletgui.controller.paymentmethodmanager import PaymentMethodManager
from walletgui.views import errorpageview
from walletgui.views.models.useraccountinfo import *
logger = logging.getLogger("site.dashboard")
@login_required
def create(request):
try:
return render(request, 'walletgui/balance.html',
{'account': None, 'userpaymentmethod': None })
except Exception as e:
error_msg = '用户主页显示遇到错误: {0}'.format(sys.exc_info()[0])
logger.exception(error_msg)
return errorpageview.show_error(request, ERR_CRITICAL_IRRECOVERABLE,
'系统遇到问题,请稍后再试。。。{0}'.format(error_msg))
def edit(request):
try:
return render(request, 'walletgui/balance.html',
{'account': None, 'userpaymentmethod': None })
except Exception as e:
error_msg = '用户主页显示遇到错误: {0}'.format(sys.exc_info()[0])
logger.exception(error_msg)
return errorpageview.show_error(request, ERR_CRITICAL_IRRECOVERABLE,
'系统遇到问题,请稍后再试。。。{0}'.format(error_msg))
def delete(request):
try:
return render(request, 'walletgui/balance.html',
{'account': None, 'userpaymentmethod': None })
except Exception as e:
error_msg = '用户主页显示遇到错误: {0}'.format(sys.exc_info()[0])
logger.exception(error_msg)
return errorpageview.show_error(request, ERR_CRITICAL_IRRECOVERABLE,
'系统遇到问题,请稍后再试。。。{0}'.format(error_msg))
| 37.659574 | 76 | 0.70565 | 0 | 0 | 0 | 0 | 467 | 0.243229 | 0 | 0 | 473 | 0.246354 |
39f8e72f0d8a4ab5e6ca1adccd579c3125c23d90 | 1,643 | py | Python | tools.py | yflyzhang/cascade_virality | 9d856a3fbe45330a9434ba4bad9d5f248e2f1dd5 | [
"MIT"
] | 6 | 2020-09-09T15:31:02.000Z | 2022-02-16T04:57:55.000Z | tools.py | yflyzhang/cascade_virality | 9d856a3fbe45330a9434ba4bad9d5f248e2f1dd5 | [
"MIT"
] | null | null | null | tools.py | yflyzhang/cascade_virality | 9d856a3fbe45330a9434ba4bad9d5f248e2f1dd5 | [
"MIT"
] | null | null | null | import numpy as np
import networkx as nx
# For illustration purpose only [easy to understand the process]
# -----------------------------
def pure_cascade_virality(G):
'''G is a directed graph(tree)'''
if not nx.is_weakly_connected(G):
# return None
return
nodes = [k for (k,v) in G.out_degree() if v>0] # non-leaf nodes
virality = 0
for source in nodes:
path_lens = nx.single_source_shortest_path_length(G, source) # shortest path length
path_lens = {k: v for k, v in path_lens.items() if v > 0} # filter 0
virality += np.array(list(path_lens.values())).mean() # mean length from source to other nodes
return virality
# Works in a recursive manner [more efficient]
# -----------------------------
def recursive_path_length(G, V, seed):
'''G is a directed graph(tree)'''
V[seed] = []
for i in G.successors(seed):
V[seed].append(1)
V[seed] += [j+1 for j in recursive_path_length(G, V, i)]
return V[seed]
def recursive_cascade_virality(G, source=None):
'''G is a directed graph(tree)'''
if not nx.is_weakly_connected(G):
# return None
return
if not source:
# if root is not given, find it by yourself
source = [k for (k,v) in G.in_degree() if v==0][0]
V_dic = {}
recursive_path_length(G, V_dic, source)
# return V_dic # return original paths
virality = 0
for (k, v) in V_dic.items():
# print(k, v)
if len(v)>0:
virality += np.mean(v)
return virality # return cascade virality
| 23.471429 | 105 | 0.57395 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 504 | 0.306756 |
39f9818d1295e4cbcfc1bb13178c81b8bc72f7ba | 1,492 | py | Python | pyjira/actions.py | FulcrumIT/pyjira | 8ed0d22136808ba95ace253e66dd4ad7bb6b387a | [
"MIT"
] | 1 | 2020-11-05T10:24:15.000Z | 2020-11-05T10:24:15.000Z | pyjira/actions.py | FulcrumIT/pyjira | 8ed0d22136808ba95ace253e66dd4ad7bb6b387a | [
"MIT"
] | null | null | null | pyjira/actions.py | FulcrumIT/pyjira | 8ed0d22136808ba95ace253e66dd4ad7bb6b387a | [
"MIT"
] | 2 | 2017-05-15T20:06:25.000Z | 2020-11-17T09:46:34.000Z | import pyjira.api as _api
import json as _json
def get_issues(id, limit=50):
"""Return 50 issues for a project.
Parameters:
- id: id of a project.
- limit: max number of results to be returned.
"""
return _api.rest("/search?jql=project=" + str(id) + "&maxResults=" + str(limit))
def get_issue(id):
"""Get issue and its details.
Parameters:
- id: id of an issue.
"""
return _api.rest("/issue/" + str(id))
def get_all_fields():
"""Get all existing fields."""
return _api.rest("/field")
def get_field(id):
"""Get field and its details.
Parameters:
- id: id of a field.
"""
fields = _json.loads(get_all_fields())
for f in fields:
if (f["id"] == str(id) or
f["id"].replace("customfield_", "") == str(id)):
return _json.dumps(f)
def get_issue_fields(id, field_names_enabled=True):
"""Get all fields listed for an issue.
Parameters:
- id: id of an issue.
- field_names_enabled: if False, returns result with "customfield_" names.
True by default.
"""
issue = _json.loads(get_issue(id))
result = {}
for key, value in issue["fields"].items():
if ("customfield_" in key and
value and field_names_enabled):
field = _json.loads(get_field(key))
field_name = field["name"]
result[field_name] = value
elif value:
result[key] = value
return _json.dumps(result)
| 24.866667 | 84 | 0.589812 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 618 | 0.414209 |
39fb765d92c4d3395b8dec3f9fb952f0fa19dddd | 963 | py | Python | gongish/cli/serve.py | meyt/gongish | 0e3cd478677c19c9331a2b563ce792d16f2860b3 | [
"MIT"
] | null | null | null | gongish/cli/serve.py | meyt/gongish | 0e3cd478677c19c9331a2b563ce792d16f2860b3 | [
"MIT"
] | 1 | 2021-09-11T22:53:48.000Z | 2021-09-11T22:53:48.000Z | gongish/cli/serve.py | meyt/gongish | 0e3cd478677c19c9331a2b563ce792d16f2860b3 | [
"MIT"
] | null | null | null | import importlib
from argparse import ArgumentParser
from wsgiref.simple_server import make_server
p = ArgumentParser(
prog="gongish serve", description="Serve a WSGI application"
)
p.add_argument(
"module",
nargs="?",
help="Module and application name (e.g: myapp:app)",
type=str,
)
p.add_argument(
"-b",
"--bind",
type=str,
help="Bind address (default: localhost:8080)",
default="localhost:8080",
)
def main(args):
args = p.parse_args(args)
module_name, module_attr = args.module.split(":")
module = importlib.import_module(module_name)
app = getattr(module, module_attr)
bind = args.bind
if bind.startswith(":"):
host = "localhost"
port = bind[1:]
elif ":" in bind:
host, port = bind.split(":")
else:
host = bind
port = "8080"
httpd = make_server(host, int(port), app)
print(f"Serving http://{host}:{port}")
httpd.serve_forever()
| 22.395349 | 64 | 0.626168 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 226 | 0.234683 |
39fbc1222f2bd73553fac90c67abef716e48ef7b | 2,248 | py | Python | tests/test_cmd_trie.py | ncloudioj/rhino-rox | 7e3c70edebca5cc0f847d777c2bff02218b4ca69 | [
"BSD-3-Clause"
] | 1 | 2016-06-14T11:16:43.000Z | 2016-06-14T11:16:43.000Z | tests/test_cmd_trie.py | ncloudioj/rhino-rox | 7e3c70edebca5cc0f847d777c2bff02218b4ca69 | [
"BSD-3-Clause"
] | null | null | null | tests/test_cmd_trie.py | ncloudioj/rhino-rox | 7e3c70edebca5cc0f847d777c2bff02218b4ca69 | [
"BSD-3-Clause"
] | null | null | null | import unittest
import redis
import random
class TestTrieCmd(unittest.TestCase):
rr = redis.Redis("localhost", 6000)
def tearDown(self):
self.rr.execute_command("del trie")
def test_basic_cmds(self):
self.rr.execute_command("rset trie ape 1")
self.rr.execute_command("rset trie app 2")
ret = self.rr.execute_command("rget trie app")
self.assertEqual(ret, "2")
ret = self.rr.execute_command("rlen trie")
self.assertEqual(ret, 2)
ret = self.rr.execute_command("rexists trie ape")
self.assertTrue(ret)
ret = self.rr.execute_command("rdel trie ape")
ret = self.rr.execute_command("rexists trie ape")
self.assertFalse(ret)
def test_prefix(self):
self.rr.execute_command("rset trie apply 1")
self.rr.execute_command("rset trie apple 2")
self.rr.execute_command("rset trie ape 3")
self.rr.execute_command("rset trie apolo 4")
self.rr.execute_command("rset trie arm 5")
ret = self.rr.execute_command("rpget trie ap")
self.assertListEqual(ret, ["ape", "3", "apolo", "4", "apple", "2",
"apply", "1"])
def test_iterator(self):
self.rr.execute_command("rset trie apply 1")
self.rr.execute_command("rset trie apple 2")
self.rr.execute_command("rset trie ape 3")
ret = self.rr.execute_command("rkeys trie")
self.assertListEqual(ret, ["ape", "apple", "apply"])
ret = self.rr.execute_command("rvalues trie")
self.assertListEqual(ret, ["3", "2", "1"])
ret = self.rr.execute_command("rgetall trie")
self.assertListEqual(ret, ["ape", "3", "apple", "2", "apply", "1"])
def test_pressure_test(self):
inserted = dict()
for i in range(10000):
key, val = "%d" % random.randint(1, 1000), "%s" % random.random()
self.rr.execute_command("rset trie %s %s" % (key, val))
inserted[key] = val
keys = self.rr.execute_command("rkeys trie")
values = self.rr.execute_command("rvalues trie")
self.assertSetEqual(set(keys), set(inserted.keys()))
self.assertSetEqual(set(values), set(inserted.values()))
| 35.125 | 77 | 0.607651 | 2,202 | 0.979537 | 0 | 0 | 0 | 0 | 0 | 0 | 481 | 0.213968 |
39fbe8706a2051eee9dadaa5adf1cf67f5342a04 | 325 | py | Python | 4. 01.07.2021/0. Secret Messages. New position.py | AntonVasko/CodeClub-2021-SUMMER | 14a80168bb7c2eb3c0c157d6d5b7630c05decb31 | [
"CC0-1.0"
] | null | null | null | 4. 01.07.2021/0. Secret Messages. New position.py | AntonVasko/CodeClub-2021-SUMMER | 14a80168bb7c2eb3c0c157d6d5b7630c05decb31 | [
"CC0-1.0"
] | null | null | null | 4. 01.07.2021/0. Secret Messages. New position.py | AntonVasko/CodeClub-2021-SUMMER | 14a80168bb7c2eb3c0c157d6d5b7630c05decb31 | [
"CC0-1.0"
] | null | null | null | #Secret Messages. New position
alphabet = 'abcdefghijklmnopqrstuvwxyz'
key = 3
character = input('Please enter a character ')
position = alphabet.find(character)
print('Position of a character ', character, ' is ', position)
newPosition = position + key
print('New position of a character ', character, ' is ', newPosition)
| 32.5 | 69 | 0.747692 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 153 | 0.470769 |
39fcb7feb468394c971a4be4fe1ebd1c774cf3a6 | 1,376 | py | Python | examples/plot/lines.py | beidongjiedeguang/manim-express | e9c89b74da3692db3ea9b568727e78d5cbcef503 | [
"MIT"
] | 12 | 2021-06-14T07:28:29.000Z | 2022-02-25T02:49:49.000Z | examples/plot/lines.py | beidongjiedeguang/manim-kunyuan | e9c89b74da3692db3ea9b568727e78d5cbcef503 | [
"MIT"
] | 1 | 2022-02-01T12:30:14.000Z | 2022-02-01T12:30:14.000Z | examples/plot/lines.py | beidongjiedeguang/manim-express | e9c89b74da3692db3ea9b568727e78d5cbcef503 | [
"MIT"
] | 2 | 2021-05-13T13:24:15.000Z | 2021-05-18T02:56:22.000Z | from examples.example_imports import *
from manim_express.eager import PlotObj
scene = EagerModeScene(screen_size=Size.bigger)
graph = Line().scale(0.2)
# t0 = time.time()
#
# delta_t = 0.5
# for a in np.linspace(3, 12, 3):
# graph2 = ParametricCurve(lambda t: [t,
# 0.8 * np.abs(t) ** (6 / 7) + 0.9 * np.sqrt(abs(a - t ** 2)) * np.sin(
# a * t + 0.2),
# 0],
# t_range=(-math.sqrt(a), math.sqrt(a))).scale(0.5)
# scene.play(Transform(graph, graph2), run_time=3)
ps = np.random.rand(10, 3)
print(ps.shape)
print(ps[:, 0].max())
theta = np.linspace(0, 2 * PI, 100)
x = np.cos(theta)
y = np.sin(theta)
p = PlotObj(x, y)
scene.play(ShowCreation(p))
s = PlotObj(theta, x).set_color(RED)
scene.play(ShowCreation(s))
grid = p.get_grid(3, 3)
scene.add(grid)
scene.play(grid.animate.shift(LEFT))
scene.play(grid.animate.set_submobject_colors_by_gradient(BLUE, GREEN, RED))
scene.play(grid.animate.set_height(TAU - MED_SMALL_BUFF))
# scene.play(grid.animate.apply_complex_function(np.exp), run_time=5)
scene.play(
grid.animate.apply_function(
lambda p: [
p[0] + 0.5 * math.sin(p[1]),
p[1] + 0.5 * math.sin(p[0]),
p[2]
]
),
run_time=5,
)
scene.hold_on()
| 27.52 | 111 | 0.5625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 529 | 0.384448 |
39fede8d13d0249be971c45d4492a0a209527ae6 | 785 | py | Python | get_observation.py | RadixSeven/FhirGaP | 1fb8ff8b86089cdec9b1f796e06aeb0e20db14a0 | [
"Apache-2.0"
] | null | null | null | get_observation.py | RadixSeven/FhirGaP | 1fb8ff8b86089cdec9b1f796e06aeb0e20db14a0 | [
"Apache-2.0"
] | null | null | null | get_observation.py | RadixSeven/FhirGaP | 1fb8ff8b86089cdec9b1f796e06aeb0e20db14a0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Note that this is python3 only
import argparse
import requests
parser = argparse.ArgumentParser(
"Get an observation from a FHIR server with authentication")
parser.add_argument(
"id", help="The observation id to retrieve")
parser.add_argument(
"auth", default="Admin",
help="The authorization string to use. \"Bearer \" will be added to "
"the front.")
parser.add_argument(
"--url", default="http://35.245.174.218:8080/hapi-fhir-jpaserver/fhir/",
help="The base url of the server")
args = parser.parse_args()
headers = {
'Content-Type': "application/fhir+json; charset=utf-8",
'Authorization': "Bearer " + args.auth,
}
response = requests.get(args.url + "/Observation/" + args.id, headers=headers)
print(response.json())
| 30.192308 | 78 | 0.699363 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 417 | 0.53121 |
39ff330d14f36471f4ac2d1038f80fb721a10e6c | 14,331 | py | Python | resources/src/mythbox/mythtv/enums.py | bopopescu/ServerStatus | a883598248ad6f5273eb3be498e3b04a1fab6510 | [
"MIT"
] | null | null | null | resources/src/mythbox/mythtv/enums.py | bopopescu/ServerStatus | a883598248ad6f5273eb3be498e3b04a1fab6510 | [
"MIT"
] | 1 | 2015-04-21T22:05:02.000Z | 2015-04-22T22:27:15.000Z | resources/src/mythbox/mythtv/enums.py | GetSomeBlocks/Score_Soccer | a883598248ad6f5273eb3be498e3b04a1fab6510 | [
"MIT"
] | 2 | 2018-04-17T17:34:39.000Z | 2020-07-26T03:43:33.000Z | #
# MythBox for XBMC - http://mythbox.googlecode.com
# Copyright (C) 2010 [email protected]
#
# 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, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
from odict import odict
class FlagMask(object):
# from libs/libmythtv/programinfo.h
FL_COMMFLAG = 0x01
FL_CUTLIST = 0x02
FL_AUTOEXP = 0x04
FL_EDITING = 0x08
FL_BOOKMARK = 0x10
FL_INUSERECORDING = 0x0020
FL_INUSEPLAYING = 0x0040
FL_TRANSCODED = 0x0400
FL_WATCHED = 0x0800
FL_PRESERVED = 0x1000
class RecordingStatus(object):
DELETED = -5
STOPPED = -4
RECORDED = -3
RECORDING = -2
WILL_RECORD = -1
UNKNOWN = 0
MANUAL_OVERRIDE = 1
PREVIOUS_RECORDING = 2
CURRENT_RECORDING = 3
EARLIER_SHOWING = 4
TOO_MANY_RECORDINGS = 5
CANCELLED = 6
CONFLICT = 7
LATER_SHOWING = 8
REPEAT = 9
OVERLAP = 10
LOW_DISK_SPACE = 11
TUNER_BUSY = 12
translations = {
DELETED : 88,
STOPPED : 89,
RECORDED : 90,
RECORDING : 91,
WILL_RECORD : 92,
UNKNOWN : 93,
MANUAL_OVERRIDE : 94,
PREVIOUS_RECORDING : 95,
CURRENT_RECORDING : 96,
EARLIER_SHOWING : 97,
TOO_MANY_RECORDINGS: 98,
CANCELLED : 99,
CONFLICT :100,
LATER_SHOWING :101,
REPEAT :102,
OVERLAP :103,
LOW_DISK_SPACE :104,
TUNER_BUSY :105
}
class ScheduleType(object):
'''See recordingtypes.cpp'''
NOT_RECORDING = 0
ONCE = 1
DAILY = 2
CHANNEL = 3
ALWAYS = 4
WEEKLY = 5
FIND_ONE = 6
OVERRIDE = 7
DONT_RECORD = 8
FIND_DAILY = 9
FIND_WEEKLY = 10
translations = odict([
(ONCE ,111),
(DAILY ,112),
(WEEKLY ,115),
(FIND_ONE ,116),
(FIND_DAILY ,119),
(FIND_WEEKLY ,120),
(CHANNEL ,113),
(ALWAYS ,114),
(OVERRIDE ,117),
(DONT_RECORD ,118),
(NOT_RECORDING,170)])
long_translations = odict([
(ONCE ,135),
(DAILY ,136),
(WEEKLY ,139),
(FIND_ONE ,140),
(FIND_DAILY ,143),
(FIND_WEEKLY ,144),
(CHANNEL ,137),
(ALWAYS ,138),
(OVERRIDE ,141),
(DONT_RECORD ,142),
(NOT_RECORDING,170)])
class EpisodeFilter(object):
"""
Really part of the CheckForDupesIn enum, but separated out since
presented as a separate chooser on the UI.
If the value is not NONE, logically OR with the CheckForDupesIn value
to derive the correct value for the record.dupin column.
"""
# RecordingDupInType:
# kDupsNewEpi = 0x10, 16
# kDupsExRepeats = 0x20, 32
# kDupsExGeneric = 0x40, 64
# kDupsFirstNew = 0x80 128
NONE = 0
NEW_EPISODES_ONLY = 16
EXCLUDE_REPEATS = 32
EXCLUDE_GENERICS = 64
EXCLUDE_REPEATS_AND_GENERICS = 96
# Record new episode first showings - not supported yet
# FIRST_NEW = 128
translations = odict([
(NONE ,201),
(NEW_EPISODES_ONLY ,152),
(EXCLUDE_REPEATS ,151),
(EXCLUDE_GENERICS ,202),
(EXCLUDE_REPEATS_AND_GENERICS,203)])
class CheckForDupesIn(object):
"""
RecordingDupInType:
kDupsInRecorded = 0x01, 1
kDupsInOldRecorded = 0x02, 2
kDupsInAll = 0x0F, 15
"""
CURRENT_RECORDINGS = 1
PREVIOUS_RECORDINGS = 2
ALL_RECORDINGS = 15
translations = odict([
(ALL_RECORDINGS ,153),
(CURRENT_RECORDINGS ,149),
(PREVIOUS_RECORDINGS,150)])
# --------------------------------------------------------------------------------------------------------------
# Duplicate Check Method Check for Duplicates in Episode Filter dupin dupmethod Makes sense
# --------------------------------------------------------------------------------------------------------------
# None All Recordings None 15 1 Y
# Subtitle All Recordings None 15 2 Y
# Description All Recordings None 15 4 Y
# Subtitle & Desc All Recordings None 15 6 Y
# Subtitle then Desc All Recordings None 15 8 Y
#
# None Current Recordings None 1 1 Y
# Subtitle Current Recordings None 1 2 Y
#
# None Current Recordings New Epi Only 17 (16+1) 1 Y
# None All Recordings New Epi Only 31 (16+15) 1 Y
# None All Recordings Exclude Generics 79 (64+15 1 Y
# None Previous Recordings Exclude Rep&Gen 98 (64+32+2) 1 Y
#
class CheckForDupesUsing(object):
# TODO: Rename to RecordingDupMethodType
NONE = 1
SUBTITLE = 2
DESCRIPTION = 4
SUBTITLE_AND_DESCRIPTION = 6
SUBTITLE_THEN_DESCRIPTION = 8 # TODO: Verify if exists in protocol 40
translations = odict([
(NONE, 145),
(SUBTITLE, 146),
(DESCRIPTION, 147),
(SUBTITLE_AND_DESCRIPTION, 148),
(SUBTITLE_THEN_DESCRIPTION, 200)])
class TVState(object):
"""
Pre protocol version 44 TV State
File : /mythtv/libs/libmythtv/tv.h
Object : TVState - enumeration of the states used by TV and TVRec
Protocol: QUERY_REMOTEENCODER::GETSTATE
"""
#
# Error State, if we ever try to enter this state errored is set.
#
Error = -1
#
# None State, this is the initial state in both TV and TVRec, it
# indicates that we are ready to change to some other state.
#
OK = 0
#
# Watching LiveTV is the state for when we are watching a
# recording and the user has control over the channel and
# the tuner to use.
#
WatchingLiveTV = 1
#
# Watching Pre-recorded is a TV only state for when we are
# watching a pre-existing recording.
#
WatchingPreRecorded = 2
#
# Watching Recording is the state for when we are watching
# an in progress recording, but the user does not have control
# over the channel and tuner to use.
#
WatchingRecording = 3
#
# Recording Only is a TVRec only state for when we are recording
# a program, but there is no one currently watching it.
#
RecordingOnly = 4
#
# This is a placeholder state which we never actualy enter,
# but is returned by GetState() when we are in the process
# of changing the state.
#
ChangingState = 5
class TVState44(object):
"""
Protocol version 44 onwards TVState
"""
#
# Error State, if we ever try to enter this state errored is set.
#
Error = -1
#
# None State, this is the initial state in both TV and TVRec, it
# indicates that we are ready to change to some other state.
#
OK = 0
#
# Watching LiveTV is the state for when we are watching a
# recording and the user has control over the channel and
# the tuner to use.
#
WatchingLiveTV = 1
#
# Watching Pre-recorded is a TV only state for when we are
# watching a pre-existing recording.
#
WatchingPreRecorded = 2
#
# Watching Video is the state when we are watching a video and is not
# a dvd
WatchingVideo = 3
#
# Watching DVD is the state when we are watching a DVD
#
WatchingDVD = 4
#
# Watching Recording is the state for when we are watching
# an in progress recording, but the user does not have control
# over the channel and tuner to use.
#
WatchingRecording = 5
#
# Recording Only is a TVRec only state for when we are recording
# a program, but there is no one currently watching it.
#
RecordingOnly = 6
#
# This is a placeholder state which we never actualy enter,
# but is returned by GetState() when we are in the process
# of changing the state.
#
ChangingState = 7
class TVState58(object):
"""
Protocol version 58 onwards TVState
"""
#
# Error State, if we ever try to enter this state errored is set.
#
Error = -1
#
# None State, this is the initial state in both TV and TVRec, it
# indicates that we are ready to change to some other state.
#
OK = 0
#
# Watching LiveTV is the state for when we are watching a
# recording and the user has control over the channel and
# the tuner to use.
#
WatchingLiveTV = 1
#
# Watching Pre-recorded is a TV only state for when we are
# watching a pre-existing recording.
#
WatchingPreRecorded = 2
#
# Watching Video is the state when we are watching a video and is not
# a dvd
WatchingVideo = 3
#
# Watching DVD is the state when we are watching a DVD
#
WatchingDVD = 4
#
# Watching BD is the state when we are watching a Bluray Disc
#
WatchingBD = 5
#
# Watching Recording is the state for when we are watching
# an in progress recording, but the user does not have control
# over the channel and tuner to use.
#
WatchingRecording = 6
#
# Recording Only is a TVRec only state for when we are recording
# a program, but there is no one currently watching it.
#
RecordingOnly = 7
#
# This is a placeholder state which we never actualy enter,
# but is returned by GetState() when we are in the process
# of changing the state.
#
ChangingState = 8
class JobStatus(object):
"""
@see: Job.status
"""
UNKNOWN = 0x0000
QUEUED = 0x0001
PENDING = 0x0002
STARTING = 0x0003
RUNNING = 0x0004
STOPPING = 0x0005
PAUSED = 0x0006
RETRYING = 0x0007
ERRORING = 0x0008
ABORTING = 0x0009
DONE = 0x0100 # Mask to indicate the job is done no matter what the status
FINISHED = 0x0110 # 272
ABORTED = 0x0120 # 288
ERRORED = 0x0130 # 304
CANCELED = 0x0140 # 320
translations = odict([
(UNKNOWN, 260),
(QUEUED, 261),
(PENDING, 262),
(STARTING, 263),
(RUNNING, 264),
(STOPPING, 265),
(PAUSED, 266),
(RETRYING, 267),
(ERRORING, 268),
(ABORTING, 269),
(DONE, 270),
(FINISHED, 271),
(ABORTED, 272),
(ERRORED, 273),
(CANCELED, 274)])
class JobType:
"""
@see: Job.jobType
"""
NONE = 0x0000
SYSTEMJOB = 0x00ff
TRANSCODE = 0x0001
COMMFLAG = 0x0002
USERJOB = 0xff00
USERJOB1 = 0x0100
USERJOB2 = 0x0200
USERJOB3 = 0x0400
USERJOB4 = 0x0800
translations = odict([
(NONE, 250),
(SYSTEMJOB, 251),
(TRANSCODE, 252),
(COMMFLAG, 253),
(USERJOB, 254),
(USERJOB1, 255),
(USERJOB2, 256),
(USERJOB3, 257),
(USERJOB4, 258)])
class Upcoming(object):
# TODO: Verify MANUAL_OVERRIDE == ForceRecord from mythweb
SCHEDULED = (RecordingStatus.WILL_RECORD, RecordingStatus.MANUAL_OVERRIDE)
# TODO: MythWeb has 'NeverRecord' ... what is the equivalent enum?
DUPLICATES = (RecordingStatus.PREVIOUS_RECORDING, RecordingStatus.CURRENT_RECORDING)
CONFLICTS = (RecordingStatus.CONFLICT, RecordingStatus.OVERLAP)
# TODO: All else...
DEACTIVATED = ()
class CommercialDetectionType(object):
COMMERCIAL_FREE = -2
UNINITIALIZED = -1
OFF = 0
BLANK_FRAME = 1
SCENE_CHANGE = 2
LOGO_CHANGE = 4
BLANK_FRAME_AND_SCENE_CHANGE = BLANK_FRAME | SCENE_CHANGE # = 3
ALL = BLANK_FRAME | SCENE_CHANGE | LOGO_CHANGE # = 7
M2 = 0x00000100 # = 256
M2_LOGO_CHANGE = M2 | LOGO_CHANGE # = 260
M2_BLANK_FRAME = M2 | BLANK_FRAME # = 257
M2_SCENE_CHANGE = M2 | SCENE_CHANGE # = 258
M2_ALL = M2_LOGO_CHANGE | M2_BLANK_FRAME # = 262
PREPOSTROLL = 0x00000200 # = 512
PREPOSTROLL_ALL = PREPOSTROLL | BLANK_FRAME | SCENE_CHANGE # = 515
| 29.670807 | 114 | 0.526551 | 11,928 | 0.832322 | 0 | 0 | 0 | 0 | 0 | 0 | 6,662 | 0.464866 |
2600aabf67e890934f21d69c79a38729246c8b46 | 3,989 | py | Python | model_training_scripts/image_processing.py | jc2554/iVending | 2a6b04143a56e202eba99b0a509945cf31aa956d | [
"MIT"
] | null | null | null | model_training_scripts/image_processing.py | jc2554/iVending | 2a6b04143a56e202eba99b0a509945cf31aa956d | [
"MIT"
] | null | null | null | model_training_scripts/image_processing.py | jc2554/iVending | 2a6b04143a56e202eba99b0a509945cf31aa956d | [
"MIT"
] | null | null | null | """
script to post-process training images by using OpenCV face detection
and normalization
MIT License
Copyright (c) 2019 JinJie Chen
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, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
import argparse
import cv2
import numpy as np
import os
"""
process all image in the user_id subdirectory , save processed images in the
user_id folderdirectory
"""
def process_images(user_id):
images = []
labels = []
labels_dic = {}
# list of people (subdirectory folder names)
people = [person for person in os.listdir("raw_image_data/")] if user_id == -1 else [str(user_id)]
count = 0
for i, person in enumerate(people):
labels_dic[i] = person
image_names = [image for image in os.listdir("raw_image_data/" + person)]
if not os.path.exists('image_data/'+person):
os.makedirs('image_data/'+person)
for j, image_name in enumerate(image_names):
image = cv2.imread("raw_image_data/" + person + '/' + image_name, 1)
images.append(image)
labels.append(person)
# face deection using the openCV Cascade Classifier
scale_factor = 1.2
min_neighbors = 5
min_size = (5, 5)
biggest_only = True
faces_coord = classifier.detectMultiScale(image,
scaleFactor=scale_factor,
minNeighbors=min_neighbors,
minSize=min_size,
flags=cv2.CASCADE_SCALE_IMAGE)
if not isinstance(faces_coord, type(None)):
faces = normalize_faces(image ,faces_coord)
cv2.imwrite('image_data/'+person+'/%s.jpeg' % (j), faces[0])
count += 1
print("Number of face image Generated: ", count)
return (images, np.array(labels), labels_dic)
"""
Normalize image by
Truncate out the face from teh image using the bounding box
Resize the image with interpolation using openCv
"""
def normalize_faces(image, faces_coord, size=(160, 160)):
faces = []
# cut image by the bounding box
for (x, y, w, h) in faces_coord:
w_rm = int(0.3 * w / 2)
faces.append(image[y: y + h, x + w_rm: x + w - w_rm])
images_norm = []
#resize image
for face in faces:
if image.shape < size:
image_norm = cv2.resize(face, size, interpolation=cv2.INTER_AREA)
else:
image_norm = cv2.resize(face, size, interpolation=cv2.INTER_CUBIC)
images_norm.append(image_norm)
return images_norm
parser = argparse.ArgumentParser()
parser.add_argument(
'--user', help='user id, -1 for all')
args = parser.parse_args()
print(args)
classifier = cv2.CascadeClassifier("../src/models/haarcascade_frontalface_default.xml")
images, labels, labels_dic = process_images(args.user)
print("num images: ", len(images))
print("labels_dic: ", labels_dic)
| 36.263636 | 102 | 0.656806 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,794 | 0.449737 |
260184f873fdef40a6660e5cdbc4d152fa8c734a | 1,816 | py | Python | flask_map.py | zenranda/proj5-map | 13dc8866483f45ac806342c1b3aa2eec1354a0dc | [
"Artistic-2.0"
] | null | null | null | flask_map.py | zenranda/proj5-map | 13dc8866483f45ac806342c1b3aa2eec1354a0dc | [
"Artistic-2.0"
] | null | null | null | flask_map.py | zenranda/proj5-map | 13dc8866483f45ac806342c1b3aa2eec1354a0dc | [
"Artistic-2.0"
] | null | null | null | import flask
from flask import render_template
from flask import request
from flask import url_for
import json
import logging
###
# Globals
###
app = flask.Flask(__name__)
import CONFIG
###
# Pages
###
@app.route("/")
@app.route("/index")
@app.route("/map")
def index():
app.logger.debug("Main page entry")
if 'map' not in flask.session:
app.logger.debug("Sending map file")
app.logger.debug("Sending keys...")
with open('SECRETS.py') as key: #sends access token to the page
ent = "" #in theory, sensitive information
for line in key:
while ent == "":
ent = line
flask.session['confidental'] = ent
app.logger.debug("Sending loc data...")
with open('POI.txt') as points:
data = [] #reads the list of points
for line in points:
item = []
line = line.strip()
k = line.split("|")
item.append(k[0]) #puts each part of the point (name, lat, long) into a list
item.append(k[1])
item.append(k[2])
data.append(item) #adds the list with the data to another list
flask.session['points'] = data #sends that list to jinja
return flask.render_template('map.html')
@app.errorhandler(404)
def page_not_found(error):
app.logger.debug("Page not found")
flask.session['linkback'] = flask.url_for("index")
return flask.render_template('page_not_found.html'), 404
#############
#
# Set up to run from cgi-bin script, from
# gunicorn, or stand-alone.
#
app.secret_key = CONFIG.secret_key
app.debug=CONFIG.DEBUG
app.logger.setLevel(logging.DEBUG)
if __name__ == "__main__":
print("Opening for global access on port {}".format(CONFIG.PORT))
app.run(port=CONFIG.PORT, host="0.0.0.0")
| 25.222222 | 91 | 0.614537 | 0 | 0 | 0 | 0 | 1,274 | 0.701542 | 0 | 0 | 596 | 0.328194 |
2602aa16755c35ffe309d7e1deefd2b15d53fedd | 3,717 | py | Python | tcvx21/grillix_post/observables/parallel_gradient_m.py | dsoliveir/TCV-X21 | 784c55adb33417e21a6736e2504a3895a9348dbe | [
"CC-BY-4.0"
] | 1 | 2021-12-13T11:52:39.000Z | 2021-12-13T11:52:39.000Z | tcvx21/grillix_post/observables/parallel_gradient_m.py | dsoliveir/TCV-X21 | 784c55adb33417e21a6736e2504a3895a9348dbe | [
"CC-BY-4.0"
] | 2 | 2021-12-18T17:18:52.000Z | 2022-01-26T09:23:23.000Z | tcvx21/grillix_post/observables/parallel_gradient_m.py | dsoliveir/TCV-X21 | 784c55adb33417e21a6736e2504a3895a9348dbe | [
"CC-BY-4.0"
] | 2 | 2021-12-13T12:56:09.000Z | 2022-01-25T20:30:28.000Z | import xarray as xr
import numpy as np
from pathlib import Path
from tcvx21.grillix_post.components import FieldlineTracer
from tcvx21.grillix_post.lineouts import Lineout
xr.set_options(keep_attrs=True)
def initialise_lineout_for_parallel_gradient(
lineout, grid, equi, norm, npol, stored_trace: Path = None
):
"""
Traces to find the forward and reverse lineouts for a given lineout
Expensive! Needs to be done once per lineout that you want to take gradients with
"""
fieldline_tracer = FieldlineTracer(equi)
try:
print(f"Attempting to read stored trace from {stored_trace}")
ds = xr.open_dataset(stored_trace)
assert np.allclose(ds["lineout_x"], lineout.r_points)
assert np.allclose(ds["lineout_y"], lineout.z_points)
except (FileNotFoundError, ValueError):
forward_trace, reverse_trace = fieldline_tracer.find_neighbouring_points(
lineout.r_points, lineout.z_points, n_toroidal_planes=int(npol)
)
ds = xr.Dataset(
data_vars=dict(
forward_x=("points", forward_trace[:, 0]),
forward_y=("points", forward_trace[:, 1]),
forward_l=("points", forward_trace[:, 2]),
reverse_x=("points", reverse_trace[:, 0]),
reverse_y=("points", reverse_trace[:, 1]),
reverse_l=("points", reverse_trace[:, 2]),
lineout_x=("points", lineout.r_points),
lineout_y=("points", lineout.z_points),
)
)
if stored_trace is not None:
if stored_trace.exists():
stored_trace.unlink()
ds.to_netcdf(stored_trace)
lineout.forward_lineout = Lineout(ds["forward_x"], ds["forward_y"])
lineout.forward_lineout.setup_interpolation_matrix(grid, use_source_points=True)
lineout.reverse_lineout = Lineout(ds["reverse_x"], ds["reverse_y"])
lineout.reverse_lineout.setup_interpolation_matrix(grid, use_source_points=True)
lineout.forward_distance = xr.DataArray(
ds["forward_l"], dims="interp_points"
).assign_attrs(norm=norm.R0)
lineout.reverse_distance = xr.DataArray(
ds["reverse_l"], dims="interp_points"
).assign_attrs(norm=norm.R0)
def compute_parallel_gradient(lineout, field):
"""
Computes the parallel gradient via centred differences
Note that you should multiply this by the penalisation direction function to get the direction 'towards the
wall'. This isn't quite the same as projecting onto the wall normal, but for computing the parallel
heat flux this is actually more helpful
"""
assert hasattr(lineout, "forward_lineout") and hasattr(
lineout, "reverse_lineout"
), f"Have to call initialise_lineout_for_parallel_gradient on lineout before trying to compute_parallel_gradient"
parallel_gradients = [
compute_gradient_on_plane(lineout, field, plane)
for plane in range(field.sizes["phi"])
]
return xr.concat(parallel_gradients, dim="phi")
def compute_gradient_on_plane(lineout, field, plane):
"""Computes the parallel gradient on a single plane"""
forward_value = lineout.forward_lineout.interpolate(
field.isel(phi=np.mod(plane + 1, field.sizes["phi"]))
)
reverse_value = lineout.forward_lineout.interpolate(
field.isel(phi=np.mod(plane - 1, field.sizes["phi"]))
)
two_plane_distance = lineout.forward_distance - lineout.reverse_distance
centred_difference = forward_value - reverse_value
return (
(centred_difference / two_plane_distance)
.assign_coords(phi=plane)
.assign_attrs(norm=field.norm / two_plane_distance.norm)
)
| 37.17 | 117 | 0.684154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 955 | 0.256928 |
2602c88691bffc3721e77c257e3bfd7bb2de90f1 | 246 | py | Python | skypy/galaxy/tests/test_import.py | ArthurTolley/skypy | 5621877ada75c667b1af7e665b02a91026f7ef0f | [
"BSD-3-Clause"
] | 1 | 2020-12-28T18:00:24.000Z | 2020-12-28T18:00:24.000Z | skypy/galaxy/tests/test_import.py | ArthurTolley/skypy | 5621877ada75c667b1af7e665b02a91026f7ef0f | [
"BSD-3-Clause"
] | 2 | 2020-12-28T20:14:40.000Z | 2020-12-28T21:49:27.000Z | skypy/galaxy/tests/test_import.py | ArthurTolley/skypy | 5621877ada75c667b1af7e665b02a91026f7ef0f | [
"BSD-3-Clause"
] | null | null | null | def test_import():
import skypy.galaxy
import skypy.galaxy.ellipticity
import skypy.galaxy.luminosity
import skypy.galaxy.redshift
import skypy.galaxy.size
import skypy.galaxy.spectrum
import skypy.galaxy.stellar_mass
| 27.333333 | 36 | 0.756098 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2603181f0b3082fdc38b19973a3aa85c33523f68 | 22,466 | py | Python | tests/hwsim/test_ap_ht.py | rzr/wpasupplicant | 3f7ac05878ba965e941f2b5b80b8cb744e63f506 | [
"Unlicense"
] | 19 | 2015-04-02T13:50:00.000Z | 2022-01-19T02:45:18.000Z | tests/hwsim/test_ap_ht.py | jku/hostap | a61fcc131aa6a7e396eee6a3c613001bf0475cd1 | [
"Unlicense"
] | 3 | 2016-03-16T13:46:10.000Z | 2016-08-30T12:42:52.000Z | tests/hwsim/test_ap_ht.py | jku/hostap | a61fcc131aa6a7e396eee6a3c613001bf0475cd1 | [
"Unlicense"
] | 11 | 2015-05-18T07:37:12.000Z | 2021-11-12T10:28:50.000Z | # Test cases for HT operations with hostapd
# Copyright (c) 2013-2014, Jouni Malinen <[email protected]>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import time
import logging
logger = logging.getLogger()
import struct
import subprocess
import hostapd
def clear_scan_cache(ifname):
subprocess.call(['sudo', 'ifconfig', ifname, 'up'])
subprocess.call(['sudo', 'iw', ifname, 'scan', 'freq', '2412', 'flush'])
time.sleep(0.1)
subprocess.call(['sudo', 'ifconfig', ifname, 'down'])
def test_ap_ht40_scan(dev, apdev):
"""HT40 co-ex scan"""
clear_scan_cache(apdev[0]['ifname'])
params = { "ssid": "test-ht40",
"channel": "5",
"ht_capab": "[HT40-]"}
hapd = hostapd.add_ap(apdev[0]['ifname'], params, wait_enabled=False)
state = hapd.get_status_field("state")
if state != "HT_SCAN":
time.sleep(0.1)
state = hapd.get_status_field("state")
if state != "HT_SCAN":
raise Exception("Unexpected interface state - expected HT_SCAN")
ev = hapd.wait_event(["AP-ENABLED"], timeout=10)
if not ev:
raise Exception("AP setup timed out")
state = hapd.get_status_field("state")
if state != "ENABLED":
raise Exception("Unexpected interface state - expected ENABLED")
freq = hapd.get_status_field("freq")
if freq != "2432":
raise Exception("Unexpected frequency")
pri = hapd.get_status_field("channel")
if pri != "5":
raise Exception("Unexpected primary channel")
sec = hapd.get_status_field("secondary_channel")
if sec != "-1":
raise Exception("Unexpected secondary channel")
dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)
def test_ap_ht40_scan_conflict(dev, apdev):
"""HT40 co-ex scan conflict"""
clear_scan_cache(apdev[0]['ifname'])
params = { "ssid": "test-ht40",
"channel": "6",
"ht_capab": "[HT40+]"}
hostapd.add_ap(apdev[1]['ifname'], params)
params = { "ssid": "test-ht40",
"channel": "5",
"ht_capab": "[HT40-]"}
hapd = hostapd.add_ap(apdev[0]['ifname'], params, wait_enabled=False)
state = hapd.get_status_field("state")
if state != "HT_SCAN":
time.sleep(0.1)
state = hapd.get_status_field("state")
if state != "HT_SCAN":
raise Exception("Unexpected interface state - expected HT_SCAN")
ev = hapd.wait_event(["AP-ENABLED"], timeout=10)
if not ev:
raise Exception("AP setup timed out")
state = hapd.get_status_field("state")
if state != "ENABLED":
raise Exception("Unexpected interface state - expected ENABLED")
freq = hapd.get_status_field("freq")
if freq != "2432":
raise Exception("Unexpected frequency")
pri = hapd.get_status_field("channel")
if pri != "5":
raise Exception("Unexpected primary channel")
sec = hapd.get_status_field("secondary_channel")
if sec != "0":
raise Exception("Unexpected secondary channel: " + sec)
dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)
def test_ap_ht40_scan_legacy_conflict(dev, apdev):
"""HT40 co-ex scan conflict with legacy 20 MHz AP"""
clear_scan_cache(apdev[0]['ifname'])
params = { "ssid": "legacy-20",
"channel": "7", "ieee80211n": "0" }
hostapd.add_ap(apdev[1]['ifname'], params)
params = { "ssid": "test-ht40",
"channel": "5",
"ht_capab": "[HT40-]"}
hapd = hostapd.add_ap(apdev[0]['ifname'], params, wait_enabled=False)
state = hapd.get_status_field("state")
if state != "HT_SCAN":
time.sleep(0.1)
state = hapd.get_status_field("state")
if state != "HT_SCAN":
raise Exception("Unexpected interface state - expected HT_SCAN")
ev = hapd.wait_event(["AP-ENABLED"], timeout=10)
if not ev:
raise Exception("AP setup timed out")
state = hapd.get_status_field("state")
if state != "ENABLED":
raise Exception("Unexpected interface state - expected ENABLED")
freq = hapd.get_status_field("freq")
if freq != "2432":
raise Exception("Unexpected frequency: " + freq)
pri = hapd.get_status_field("channel")
if pri != "5":
raise Exception("Unexpected primary channel: " + pri)
sec = hapd.get_status_field("secondary_channel")
if sec != "0":
raise Exception("Unexpected secondary channel: " + sec)
dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)
def test_ap_ht40_scan_match(dev, apdev):
"""HT40 co-ex scan matching configuration"""
clear_scan_cache(apdev[0]['ifname'])
params = { "ssid": "test-ht40",
"channel": "5",
"ht_capab": "[HT40-]"}
hostapd.add_ap(apdev[1]['ifname'], params)
params = { "ssid": "test-ht40",
"channel": "5",
"ht_capab": "[HT40-]"}
hapd = hostapd.add_ap(apdev[0]['ifname'], params, wait_enabled=False)
state = hapd.get_status_field("state")
if state != "HT_SCAN":
time.sleep(0.1)
state = hapd.get_status_field("state")
if state != "HT_SCAN":
raise Exception("Unexpected interface state - expected HT_SCAN")
ev = hapd.wait_event(["AP-ENABLED"], timeout=10)
if not ev:
raise Exception("AP setup timed out")
state = hapd.get_status_field("state")
if state != "ENABLED":
raise Exception("Unexpected interface state - expected ENABLED")
freq = hapd.get_status_field("freq")
if freq != "2432":
raise Exception("Unexpected frequency")
pri = hapd.get_status_field("channel")
if pri != "5":
raise Exception("Unexpected primary channel")
sec = hapd.get_status_field("secondary_channel")
if sec != "-1":
raise Exception("Unexpected secondary channel: " + sec)
dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)
def test_ap_ht40_5ghz_match(dev, apdev):
"""HT40 co-ex scan on 5 GHz with matching pri/sec channel"""
clear_scan_cache(apdev[0]['ifname'])
try:
params = { "ssid": "test-ht40",
"hw_mode": "a",
"channel": "36",
"country_code": "US",
"ht_capab": "[HT40+]"}
hostapd.add_ap(apdev[1]['ifname'], params)
params = { "ssid": "test-ht40",
"hw_mode": "a",
"channel": "36",
"ht_capab": "[HT40+]"}
hapd = hostapd.add_ap(apdev[0]['ifname'], params, wait_enabled=False)
state = hapd.get_status_field("state")
if state != "HT_SCAN":
time.sleep(0.1)
state = hapd.get_status_field("state")
if state != "HT_SCAN":
raise Exception("Unexpected interface state - expected HT_SCAN")
ev = hapd.wait_event(["AP-ENABLED"], timeout=10)
if not ev:
raise Exception("AP setup timed out")
state = hapd.get_status_field("state")
if state != "ENABLED":
raise Exception("Unexpected interface state - expected ENABLED")
freq = hapd.get_status_field("freq")
if freq != "5180":
raise Exception("Unexpected frequency")
pri = hapd.get_status_field("channel")
if pri != "36":
raise Exception("Unexpected primary channel")
sec = hapd.get_status_field("secondary_channel")
if sec != "1":
raise Exception("Unexpected secondary channel: " + sec)
dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)
finally:
subprocess.call(['sudo', 'iw', 'reg', 'set', '00'])
def test_ap_ht40_5ghz_switch(dev, apdev):
"""HT40 co-ex scan on 5 GHz switching pri/sec channel"""
clear_scan_cache(apdev[0]['ifname'])
try:
params = { "ssid": "test-ht40",
"hw_mode": "a",
"channel": "36",
"country_code": "US",
"ht_capab": "[HT40+]"}
hostapd.add_ap(apdev[1]['ifname'], params)
params = { "ssid": "test-ht40",
"hw_mode": "a",
"channel": "40",
"ht_capab": "[HT40-]"}
hapd = hostapd.add_ap(apdev[0]['ifname'], params, wait_enabled=False)
state = hapd.get_status_field("state")
if state != "HT_SCAN":
time.sleep(0.1)
state = hapd.get_status_field("state")
if state != "HT_SCAN":
raise Exception("Unexpected interface state - expected HT_SCAN")
ev = hapd.wait_event(["AP-ENABLED"], timeout=10)
if not ev:
raise Exception("AP setup timed out")
state = hapd.get_status_field("state")
if state != "ENABLED":
raise Exception("Unexpected interface state - expected ENABLED")
freq = hapd.get_status_field("freq")
if freq != "5180":
raise Exception("Unexpected frequency: " + freq)
pri = hapd.get_status_field("channel")
if pri != "36":
raise Exception("Unexpected primary channel: " + pri)
sec = hapd.get_status_field("secondary_channel")
if sec != "1":
raise Exception("Unexpected secondary channel: " + sec)
dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)
finally:
subprocess.call(['sudo', 'iw', 'reg', 'set', '00'])
def test_ap_ht40_5ghz_switch2(dev, apdev):
"""HT40 co-ex scan on 5 GHz switching pri/sec channel (2)"""
clear_scan_cache(apdev[0]['ifname'])
try:
params = { "ssid": "test-ht40",
"hw_mode": "a",
"channel": "36",
"country_code": "US",
"ht_capab": "[HT40+]"}
hostapd.add_ap(apdev[1]['ifname'], params)
id = dev[0].add_network()
dev[0].set_network(id, "mode", "2")
dev[0].set_network_quoted(id, "ssid", "wpas-ap-open")
dev[0].set_network(id, "key_mgmt", "NONE")
dev[0].set_network(id, "frequency", "5200")
dev[0].set_network(id, "scan_freq", "5200")
dev[0].select_network(id)
time.sleep(1)
params = { "ssid": "test-ht40",
"hw_mode": "a",
"channel": "40",
"ht_capab": "[HT40-]"}
hapd = hostapd.add_ap(apdev[0]['ifname'], params, wait_enabled=False)
state = hapd.get_status_field("state")
if state != "HT_SCAN":
time.sleep(0.1)
state = hapd.get_status_field("state")
if state != "HT_SCAN":
raise Exception("Unexpected interface state - expected HT_SCAN")
ev = hapd.wait_event(["AP-ENABLED"], timeout=10)
if not ev:
raise Exception("AP setup timed out")
state = hapd.get_status_field("state")
if state != "ENABLED":
raise Exception("Unexpected interface state - expected ENABLED")
freq = hapd.get_status_field("freq")
if freq != "5180":
raise Exception("Unexpected frequency: " + freq)
pri = hapd.get_status_field("channel")
if pri != "36":
raise Exception("Unexpected primary channel: " + pri)
sec = hapd.get_status_field("secondary_channel")
if sec != "1":
raise Exception("Unexpected secondary channel: " + sec)
dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)
finally:
subprocess.call(['sudo', 'iw', 'reg', 'set', '00'])
def test_obss_scan(dev, apdev):
"""Overlapping BSS scan request"""
params = { "ssid": "obss-scan",
"channel": "6",
"ht_capab": "[HT40-]",
"obss_interval": "10" }
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
params = { "ssid": "another-bss",
"channel": "9",
"ieee80211n": "0" }
hostapd.add_ap(apdev[1]['ifname'], params)
dev[0].connect("obss-scan", key_mgmt="NONE", scan_freq="2437")
hapd.set("ext_mgmt_frame_handling", "1")
logger.info("Waiting for OBSS scan to occur")
ev = dev[0].wait_event(["CTRL-EVENT-SCAN-STARTED"], timeout=15)
if ev is None:
raise Exception("Timed out while waiting for OBSS scan to start")
ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], timeout=10)
if ev is None:
raise Exception("Timed out while waiting for OBSS scan results")
received = False
for i in range(0, 4):
frame = hapd.mgmt_rx(timeout=5)
if frame is None:
raise Exception("MGMT RX wait timed out")
if frame['subtype'] != 13:
continue
payload = frame['payload']
if len(payload) < 3:
continue
(category, action, ie) = struct.unpack('BBB', payload[0:3])
if category != 4:
continue
if action != 0:
continue
if ie == 72:
logger.info("20/40 BSS Coexistence report received")
received = True
break
if not received:
raise Exception("20/40 BSS Coexistence report not seen")
def test_obss_scan_40_intolerant(dev, apdev):
"""Overlapping BSS scan request with 40 MHz intolerant AP"""
params = { "ssid": "obss-scan",
"channel": "6",
"ht_capab": "[HT40-]",
"obss_interval": "10" }
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
params = { "ssid": "another-bss",
"channel": "7",
"ht_capab": "[40-INTOLERANT]" }
hostapd.add_ap(apdev[1]['ifname'], params)
dev[0].connect("obss-scan", key_mgmt="NONE", scan_freq="2437")
hapd.set("ext_mgmt_frame_handling", "1")
logger.info("Waiting for OBSS scan to occur")
ev = dev[0].wait_event(["CTRL-EVENT-SCAN-STARTED"], timeout=15)
if ev is None:
raise Exception("Timed out while waiting for OBSS scan to start")
ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], timeout=10)
if ev is None:
raise Exception("Timed out while waiting for OBSS scan results")
received = False
for i in range(0, 4):
frame = hapd.mgmt_rx(timeout=5)
if frame is None:
raise Exception("MGMT RX wait timed out")
if frame['subtype'] != 13:
continue
payload = frame['payload']
if len(payload) < 3:
continue
(category, action, ie) = struct.unpack('BBB', payload[0:3])
if category != 4:
continue
if action != 0:
continue
if ie == 72:
logger.info("20/40 BSS Coexistence report received")
received = True
break
if not received:
raise Exception("20/40 BSS Coexistence report not seen")
def test_olbc(dev, apdev):
"""OLBC detection"""
params = { "ssid": "test-olbc",
"channel": "6",
"ht_capab": "[HT40-]",
"ap_table_expiration_time": "2" }
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
status = hapd.get_status()
if status['olbc'] != '0' or status['olbc_ht'] != '0':
raise Exception("Unexpected OLBC information")
params = { "ssid": "olbc-ap",
"hw_mode": "b",
"channel": "6",
"wmm_enabled": "0" }
hostapd.add_ap(apdev[1]['ifname'], params)
time.sleep(0.5)
status = hapd.get_status()
if status['olbc'] != '1' or status['olbc_ht'] != '1':
raise Exception("Missing OLBC information")
hapd_global = hostapd.HostapdGlobal()
hapd_global.remove(apdev[1]['ifname'])
logger.info("Waiting for OLBC state to time out")
cleared = False
for i in range(0, 15):
time.sleep(1)
status = hapd.get_status()
if status['olbc'] == '0' and status['olbc_ht'] == '0':
cleared = True
break
if not cleared:
raise Exception("OLBC state did nto time out")
def test_olbc_5ghz(dev, apdev):
"""OLBC detection on 5 GHz"""
try:
params = { "ssid": "test-olbc",
"country_code": "FI",
"hw_mode": "a",
"channel": "36",
"ht_capab": "[HT40+]" }
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
status = hapd.get_status()
if status['olbc'] != '0' or status['olbc_ht'] != '0':
raise Exception("Unexpected OLBC information")
params = { "ssid": "olbc-ap",
"country_code": "FI",
"hw_mode": "a",
"channel": "36",
"ieee80211n": "0",
"wmm_enabled": "0" }
hostapd.add_ap(apdev[1]['ifname'], params)
time.sleep(0.5)
status = hapd.get_status()
if status['olbc_ht'] != '1':
raise Exception("Missing OLBC information")
finally:
subprocess.call(['sudo', 'iw', 'reg', 'set', '00'])
def test_ap_require_ht(dev, apdev):
"""Require HT"""
params = { "ssid": "require-ht",
"require_ht": "1" }
hapd = hostapd.add_ap(apdev[0]['ifname'], params, wait_enabled=False)
dev[1].connect("require-ht", key_mgmt="NONE", scan_freq="2412",
disable_ht="1", wait_connect=False)
dev[0].connect("require-ht", key_mgmt="NONE", scan_freq="2412")
ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"])
if ev is None:
raise Exception("Association rejection timed out")
if "status_code=27" not in ev:
raise Exception("Unexpected rejection status code")
dev[2].connect("require-ht", key_mgmt="NONE", scan_freq="2412",
ht_mcs="0x01 00 00 00 00 00 00 00 00 00",
disable_max_amsdu="1", ampdu_factor="2",
ampdu_density="1", disable_ht40="1", disable_sgi="1",
disable_ldpc="1")
def test_ap_require_ht_limited_rates(dev, apdev):
"""Require HT with limited supported rates"""
params = { "ssid": "require-ht",
"supported_rates": "60 120 240 360 480 540",
"require_ht": "1" }
hapd = hostapd.add_ap(apdev[0]['ifname'], params, wait_enabled=False)
dev[1].connect("require-ht", key_mgmt="NONE", scan_freq="2412",
disable_ht="1", wait_connect=False)
dev[0].connect("require-ht", key_mgmt="NONE", scan_freq="2412")
ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"])
if ev is None:
raise Exception("Association rejection timed out")
if "status_code=27" not in ev:
raise Exception("Unexpected rejection status code")
def test_ap_ht_capab_not_supported(dev, apdev):
"""HT configuration with driver not supporting all ht_capab entries"""
params = { "ssid": "test-ht40",
"channel": "5",
"ht_capab": "[HT40-][LDPC][SMPS-STATIC][SMPS-DYNAMIC][GF][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][RX-STBC12][RX-STBC123][DELAYED-BA][MAX-AMSDU-7935][DSSS_CCK-40][LSIG-TXOP-PROT]"}
hapd = hostapd.add_ap(apdev[0]['ifname'], params, no_enable=True)
if "FAIL" not in hapd.request("ENABLE"):
raise Exception("Unexpected ENABLE success")
def test_ap_ht_40mhz_intolerant_sta(dev, apdev):
"""Associated STA indicating 40 MHz intolerant"""
clear_scan_cache(apdev[0]['ifname'])
params = { "ssid": "intolerant",
"channel": "6",
"ht_capab": "[HT40-]" }
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
if hapd.get_status_field("num_sta_ht40_intolerant") != "0":
raise Exception("Unexpected num_sta_ht40_intolerant value")
if hapd.get_status_field("secondary_channel") != "-1":
raise Exception("Unexpected secondary_channel")
dev[0].connect("intolerant", key_mgmt="NONE", scan_freq="2437")
if hapd.get_status_field("num_sta_ht40_intolerant") != "0":
raise Exception("Unexpected num_sta_ht40_intolerant value")
if hapd.get_status_field("secondary_channel") != "-1":
raise Exception("Unexpected secondary_channel")
dev[2].connect("intolerant", key_mgmt="NONE", scan_freq="2437",
ht40_intolerant="1")
time.sleep(1)
if hapd.get_status_field("num_sta_ht40_intolerant") != "1":
raise Exception("Unexpected num_sta_ht40_intolerant value (expected 1)")
if hapd.get_status_field("secondary_channel") != "0":
raise Exception("Unexpected secondary_channel (did not disable 40 MHz)")
dev[2].request("DISCONNECT")
time.sleep(1)
if hapd.get_status_field("num_sta_ht40_intolerant") != "0":
raise Exception("Unexpected num_sta_ht40_intolerant value (expected 0)")
if hapd.get_status_field("secondary_channel") != "-1":
raise Exception("Unexpected secondary_channel (did not re-enable 40 MHz)")
def test_ap_ht_40mhz_intolerant_ap(dev, apdev):
"""Associated STA reports 40 MHz intolerant AP after association"""
clear_scan_cache(apdev[0]['ifname'])
params = { "ssid": "ht",
"channel": "6",
"ht_capab": "[HT40-]",
"obss_interval": "1" }
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
dev[0].connect("ht", key_mgmt="NONE", scan_freq="2437")
if hapd.get_status_field("secondary_channel") != "-1":
raise Exception("Unexpected secondary channel information")
logger.info("Start 40 MHz intolerant AP")
params = { "ssid": "intolerant",
"channel": "5",
"ht_capab": "[40-INTOLERANT]" }
hapd2 = hostapd.add_ap(apdev[1]['ifname'], params)
logger.info("Waiting for co-ex report from STA")
ok = False
for i in range(0, 20):
time.sleep(1)
if hapd.get_status_field("secondary_channel") == "0":
logger.info("AP moved to 20 MHz channel")
ok = True
break
if not ok:
raise Exception("AP did not move to 20 MHz channel")
if "OK" not in hapd2.request("DISABLE"):
raise Exception("Failed to disable 40 MHz intolerant AP")
# make sure the intolerant AP disappears from scan results more quickly
dev[0].scan(only_new=True)
dev[0].scan(freq="2432", only_new=True)
logger.info("Waiting for AP to move back to 40 MHz channel")
ok = False
for i in range(0, 30):
time.sleep(1)
if hapd.get_status_field("secondary_channel") == "-1":
ok = True
if not ok:
raise Exception("AP did not move to 40 MHz channel")
| 37.694631 | 199 | 0.582614 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7,982 | 0.355292 |
26043d5d77004fcf11c43eb7691efa8015b6c1e6 | 1,039 | py | Python | rhymes.py | hayderkharrufa/arabic_poetry_generator | 82f2ed726ec6270c3ee1d2f7c7aa1783df973708 | [
"MIT"
] | 72 | 2020-05-29T19:58:22.000Z | 2022-03-11T18:53:56.000Z | rhymes.py | mahfoudhich/arabic_poem_generator | 82f2ed726ec6270c3ee1d2f7c7aa1783df973708 | [
"MIT"
] | 1 | 2020-06-12T11:03:45.000Z | 2020-08-05T17:52:27.000Z | rhymes.py | mahfoudhich/arabic_poem_generator | 82f2ed726ec6270c3ee1d2f7c7aa1783df973708 | [
"MIT"
] | 34 | 2020-06-04T14:38:39.000Z | 2022-03-16T20:50:56.000Z | # coding: utf-8
# author: Haydara https://www.youtube.com/haydara
import pickle
with open('vocabs.pkl', 'rb') as pickle_load:
voc_list = pickle.load(pickle_load)
allowed_chars = ['ذ', 'ض', 'ص', 'ث', 'ق', 'ف', 'غ', 'ع', 'ه', 'خ', 'ح', 'ج', 'د',
'ش', 'س', 'ي', 'ب', 'ل', 'ا', 'أ', 'ت', 'ن', 'م', 'ك', 'ط', 'ئ', 'ء', 'ؤ', 'ر', 'ى',
'ة', 'و', 'ز', 'ظ', 'ّ', ' ']
max_word_length = 9
def rhymes_with(word):
if word not in ['الله', 'والله', 'بالله', 'لله', 'تالله']:
word = word.replace('ّ', '')
ending = word[-2:]
rhymes = []
for w in voc_list:
if len(w) < max_word_length and w.endswith(ending):
rhymes.append(w)
return rhymes
def rhymes_with_last_n_chars(word, n):
if word not in ['الله', 'والله', 'بالله', 'لله', 'تالله', 'فالله']:
word = word.replace('ّ', '')
ending = word[-n:]
rhymes = []
for w in voc_list:
if len(w) < max_word_length and w.endswith(ending):
rhymes.append(w)
return rhymes
| 29.685714 | 102 | 0.505294 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 356 | 0.316444 |
2604cf6f50e982afd7ab5c70c9417b6682140a5d | 6,513 | py | Python | tests/test_facade.py | seucolega/lista-de-listas-cli | 48815fac9cf3332c5e4fbc935d6ddd09be2738a8 | [
"MIT"
] | null | null | null | tests/test_facade.py | seucolega/lista-de-listas-cli | 48815fac9cf3332c5e4fbc935d6ddd09be2738a8 | [
"MIT"
] | null | null | null | tests/test_facade.py | seucolega/lista-de-listas-cli | 48815fac9cf3332c5e4fbc935d6ddd09be2738a8 | [
"MIT"
] | null | null | null | import facade
import pytest
import schemas
@pytest.fixture(autouse=True)
def configure_db_session(db_session):
facade.db_session = db_session
def test_get_item_list__empty():
assert facade.get_item_list() == []
def test_get_item_list__with_item(item_1):
assert facade.get_item_list() == [item_1]
def test_get_actionable_items__empty():
assert facade.get_actionable_items() == []
def test_get_actionable_items__with_a_done_item(done_item_1):
assert facade.get_actionable_items() == []
def test_get_actionable_items__with_done_and_undone_items(
done_item_1, undone_item_1
):
assert facade.get_actionable_items() == [undone_item_1]
def test_get_actionable_items_with_the_tag__empty(tag_1):
assert facade.get_actionable_items_with_the_tag(tag_1) == []
def test_get_inbox_items__empty():
assert facade.get_inbox_items() == []
def test_get_inbox_items__with_a_done_item(done_item_1):
assert facade.get_inbox_items() == []
def test_get_inbox_items__with_done_and_undone_items(
done_item_1, undone_item_1
):
assert facade.get_inbox_items() == [undone_item_1]
def test_get_inbox_items__with_a_undone_and_tagged_item(undone_item_1, tag_1):
undone_item_1.tags = [tag_1]
assert facade.get_inbox_items() == []
def test_get_actionable_items_with_the_tag__with_a_done_item(
tag_1, done_item_1
):
assert facade.get_actionable_items_with_the_tag(tag_1) == []
def test_get_actionable_items_with_the_tag__with_items_without_the_tag(
tag_1, done_item_1, undone_item_1
):
assert facade.get_actionable_items_with_the_tag(tag_1) == []
def test_get_actionable_items_with_the_tag__with_items_and_the_tag(
tag_1, done_item_1, undone_item_1
):
tag_1.items = [done_item_1, undone_item_1]
assert facade.get_actionable_items_with_the_tag(tag_1) == [undone_item_1]
def test_get_item(item_1):
assert facade.get_item(item_id=item_1.id) == item_1
def test_create_item():
item = schemas.ItemCreate(name='Something')
assert facade.create_item(item=item).id
@pytest.mark.parametrize('status', [*schemas.ItemStatus])
def test_set_item_status(item_1, status):
facade.set_item_status(item=item_1, status=status)
assert item_1.status == status
def test_get_tag_list__empty():
assert facade.get_tag_list() == []
def test_get_list_of_tags_with_items(item_1, tag_1, tag_2):
item_1.tags = [tag_1]
assert facade.get_list_of_tags_with_items() == [tag_1]
def test_get_actionable_tag_list(tag_1, child_tag_1_of_parent_tag_1):
result = facade.get_actionable_tag_list()
assert result == [tag_1, child_tag_1_of_parent_tag_1]
def test_get_tag_list__with_item(db_session, tag_1):
assert facade.get_tag_list() == [tag_1]
def test_get_tag_list_without_parent(
parent_tag_1, child_tag_1_of_parent_tag_1
):
assert facade.get_tag_list_without_parent() == [parent_tag_1]
def test_get_tag(tag_1):
assert facade.get_tag(tag_id=tag_1.id) == tag_1
def test_create_tag():
tag = schemas.TagCreate(name='Tag Name')
assert facade.create_tag(tag=tag).id
def test_get_tag_by_name__case_insensitive(tag_1):
tag_1.name = 'Next Actions'
assert facade.get_tag_by_name('next actions')
def test_get_tag_by_name__not_found(tag_1):
tag_1.name = 'Next Actions'
assert not facade.get_tag_by_name('waiting')
def test_get_item_text_to_show__item_name_without_tags(item_1):
item_1.name = 'Item name'
item_1.tags = []
assert facade.get_item_text_to_show(item_1) == item_1.name
def test_get_item_text_to_show__item_with_one_tag(item_1, tag_1):
item_1.name = 'Item name'
item_1.tags = [tag_1]
tag_1.name = 'Waiting'
expected = 'Item name @Waiting'
assert facade.get_item_text_to_show(item_1) == expected
def test_get_item_text_to_show__item_with_one_spaced_tag(item_1, tag_1):
item_1.name = 'Item name'
item_1.tags = [tag_1]
tag_1.name = 'First Tag'
expected = 'Item name @First_Tag'
assert facade.get_item_text_to_show(item_1) == expected
def test_get_item_text_to_show__item_with_two_tags(item_1, tag_1, tag_2):
item_1.name = 'Item name'
item_1.tags = [tag_1, tag_2]
tag_1.name = 'First Tag'
tag_2.name = 'Second Tag'
expected = 'Item name @First_Tag @Second_Tag'
assert facade.get_item_text_to_show(item_1) == expected
def test_get_item_text_to_show__item_with_one_tag_and_context(item_1, tag_1):
item_1.name = 'Item name'
item_1.tags = [tag_1]
tag_1.name = 'Waiting'
result = facade.get_item_text_to_show(item=item_1, context=tag_1)
expected = 'Item name'
assert result == expected
def test_get_item_text_to_show__item_with_two_tags_and_context(
item_1, tag_1, tag_2
):
item_1.name = 'Item name'
item_1.tags = [tag_1, tag_2]
tag_1.name = 'First Tag'
tag_2.name = 'Second Tag'
result = facade.get_item_text_to_show(item=item_1, context=tag_1)
expected = 'Item name @Second_Tag'
assert result == expected
def test_get_tag_text_to_show__tag_without_parent_tag(tag_1):
assert facade.get_tag_text_to_show(tag_1) == tag_1.name
def test_get_tag_text_to_show__item_with_parent_tag(
parent_tag_1, child_tag_1_of_parent_tag_1
):
child_tag_1_of_parent_tag_1.name = 'Tag name'
parent_tag_1.name = 'Waiting'
expected = 'Tag name @Waiting'
assert facade.get_tag_text_to_show(child_tag_1_of_parent_tag_1) == expected
def test_get_tag_text_to_show__item_with_one_spaced_tag(
parent_tag_1, child_tag_1_of_parent_tag_1
):
child_tag_1_of_parent_tag_1.name = 'Tag name'
parent_tag_1.name = 'Parent Tag'
expected = 'Tag name @Parent_Tag'
assert facade.get_tag_text_to_show(child_tag_1_of_parent_tag_1) == expected
def test_get_tag_text_to_show__item_with_one_tag_and_context(
parent_tag_1, child_tag_1_of_parent_tag_1
):
child_tag_1_of_parent_tag_1.name = 'Tag name'
parent_tag_1.name = 'Waiting'
result = facade.get_tag_text_to_show(
tag=child_tag_1_of_parent_tag_1, context=parent_tag_1
)
expected = 'Tag name'
assert result == expected
def test_get_list_of_tags_with_actionable_items__with_a_done_item(
done_item_1, tag_1
):
done_item_1.tags = [tag_1]
assert facade.get_list_of_tags_with_actionable_items() == []
def test_get_list_of_tags_with_actionable_items__with_an_undone_item(
undone_item_1, tag_1
):
undone_item_1.tags = [tag_1]
assert facade.get_list_of_tags_with_actionable_items() == [tag_1]
| 24.484962 | 79 | 0.76094 | 0 | 0 | 0 | 0 | 292 | 0.044833 | 0 | 0 | 442 | 0.067864 |
2607fe4913aa92b0a573f52ce885f77ac1e7a144 | 17,667 | py | Python | ots_eval/outlier_detection/doots.py | YellowOfTheEgg/ots-eval | 8ec08e60330d41f8f7ffd571dd6301cdedaefd99 | [
"BSD-3-Clause"
] | 3 | 2021-03-28T14:46:57.000Z | 2022-01-03T17:25:19.000Z | ots_eval/outlier_detection/doots.py | YellowOfTheEgg/ots-eval | 8ec08e60330d41f8f7ffd571dd6301cdedaefd99 | [
"BSD-3-Clause"
] | null | null | null | ots_eval/outlier_detection/doots.py | YellowOfTheEgg/ots-eval | 8ec08e60330d41f8f7ffd571dd6301cdedaefd99 | [
"BSD-3-Clause"
] | 1 | 2022-01-11T10:56:14.000Z | 2022-01-11T10:56:14.000Z | import pandas
import numpy as np
from .reference_histogram_outlier import HistOutlier
from typing import Union, Tuple
class DOOTS(object):
def __init__(self, data: pandas.DataFrame, weighting: bool = False, jaccard: bool = False):
"""
Params:
data (DataFrame) - pandas DataFrame with columns 'object_id', 'time', 'cluster_id' containing objects,
timestamps, cluster belongings, features ..
Note: The first three columns can have custom names as long as they represent the object
identifier, the timestamp and the cluster identifier in the right order
Optional:
weighting (boolean) - indicating whether the weighting function should be applied
jaccard (boolean) - indicating whether the jaccard index should be used instead of the asymmetric proportion
"""
self._data = data
self._weighting = weighting
self._jaccard = jaccard
self._outlier_result = None
self._outlier_rating = None
self._column_names = data.columns.values
self._object_column_name = self._column_names[0]
self._time_column_name = self._column_names[1]
self._cluster_column_name = self._column_names[2]
self._cluster_compositions = self.obtain_cluster_compositions()
def get_outliers(self, tau: float) -> Tuple[pandas.DataFrame, pandas.DataFrame]:
"""
Parameters:
tau (float) - threshold for outlier detection
Returns:
data (DataFrame) - pandas DataFrame with columns 'object_id', 'time', 'cluster_id', 'outlier'
outlier_result (DataFrame) - pandas DataFrame with columns 'object_id', 'start_time', 'end_time',
'cluster_end_time', 'rating', 'distance' and 'outlier'
"""
self.calc_outlier_degree()
return self.mark_outliers(tau)
def calc_outlier_degree(self) -> pandas.DataFrame:
"""
Returns:
outlier_rating (DataFrame) - pandas DataFrame with the columns 'object_id', 'start_time', 'end_time',
'cluster_end_time', 'rating' and 'distance' containing the subsequences'
distances to the reference sequence per time period
"""
rating = self.calc_outlier_rating()
outlier = HistOutlier()
self._outlier_rating = outlier.calc_outlier_degree(rating, self._data)
return self._outlier_rating
def mark_outliers(self, tau: float) -> Tuple[pandas.DataFrame, pandas.DataFrame]:
"""
Parameters:
tau (float) - threshold for outlier detection
Returns:
data (DataFrame) - pandas DataFrame with columns 'object_id', 'time', 'cluster_id', 'outlier'
outlier_result (DataFrame) - pandas DataFrame with columns 'object_id', 'start_time', 'end_time',
'cluster_end_time', 'rating', 'distance' and 'outlier'
"""
print('TAU: ', str(tau))
self._outlier_result = self._outlier_rating[(self._outlier_rating['distance'] >= tau) |
(self._outlier_rating['distance'] == -1)]
# mark outliers in the clusters
self._data = self._data.assign(outlier=1)
self._data = self._data.astype({self._object_column_name: str})
self._outlier_result = self._outlier_result.astype({self._object_column_name: str})
time_points = self._data[self._time_column_name].unique().tolist()
time_points.sort()
# mark outliers detected by distance with -1
for index, row in self._outlier_result.iterrows():
for time_point in time_points[
time_points.index(int(row['start_time'])):time_points.index(int(row['end_time'])) + 1]:
self._data.loc[(self._data[self._time_column_name] == time_point) &
(self._data[self._object_column_name] == row[self._object_column_name]), 'outlier'] = -1
conseq_outliers = self._outlier_result[self._outlier_result['distance'] == -1]
# mark conseq cluster outliers with -2, mark conseq outliers which also are outliers by distance with -3
for index, row in conseq_outliers.iterrows():
for time_point in time_points[
time_points.index(int(row['start_time'])):time_points.index(int(row['end_time'])) + 1]:
if self._data.loc[(self._data[self._time_column_name] == time_point) &
(self._data[self._object_column_name] == row[self._object_column_name]),
'outlier'].item() in [-1, -2, -3]:
self._data.loc[(self._data[self._time_column_name] == time_point) &
(self._data[self._object_column_name] == row[self._object_column_name]),
'outlier'] = -3
else:
self._data.loc[(self._data[self._time_column_name] == int(time_point)) &
(self._data[self._object_column_name] == row[self._object_column_name]),
'outlier'] = -2
return self._data, self._outlier_result
def rate_object(self, id: Union[int, str, list] = None, start_time: int = None, end_time: int = None) -> dict:
"""
Optional:
id (int, str, list) - int, str, list or None representing the data points that should be rated. If id is
None, all objects are rated
start_time (int) - time that should be considered as beginning
end_time (int) - int representing the timestamp which should be rated up to
Returns:
ratings (dict) - dict {<object_id>: <rating>} with ratings of objects
"""
ids_to_rate = self.get_ids_to_rate(id, self._object_column_name)
if end_time is None:
end_time = np.max(self._data[self._time_column_name].unique())
ratings = self.calc_object_rating(ids_to_rate, end_time, start_time)
return ratings
def calc_object_rating(self, ids_to_rate: list, end_time: int, start_time: int = None) -> dict:
"""
Params:
ids_to_rate (list) - list of data points that should be rated
end_time (int) - representing the timestamp which should be rated up to
Optional:
start_time (int) - time that should be considered as beginning
Returns:
ratings (dict) - dict {<object_id>: <rating>} with ratings of objects
"""
ratings = {}
gr_clusters = self._data.groupby(self._object_column_name)
# iterate over object ids
for id in ids_to_rate:
cur_group = gr_clusters.get_group(id)
cur_group = cur_group[cur_group[self._time_column_name] <= end_time]
if start_time is not None:
cur_group = cur_group[cur_group[self._time_column_name] >= start_time]
if len(cur_group[cur_group[self._time_column_name] == end_time][self._cluster_column_name]) == 0:
# print('Object does not exist for timestamp ', str(end_time))
continue
# id of the cluster of the last considered timestamp
last_cluster = cur_group[cur_group[self._time_column_name] == end_time][self._cluster_column_name].iloc[0]
# if object is an outlier for the considered timestamp, it gets worst rating of 0.0
if int(last_cluster) < 0:
ratings[id] = 0.0
continue
cluster_ids = cur_group[self._cluster_column_name].unique()
object_ratings = []
num_clusters = 0
has_outlier = False
for cluster in cluster_ids:
if cluster == last_cluster:
continue
# Add the proportion of clusters before last timestamp, that merged in last cluster
else:
# outliers get worst rating of 0.0
if int(cluster) < 0:
object_ratings.append(0.0)
has_outlier = True
else:
object_ratings.append(self._cluster_compositions[last_cluster][cluster])
num_clusters += 1
if not has_outlier and len(object_ratings) == 0:
# print(str(id) + " has no data before t=" + str(end_time))
continue
if self._weighting:
try:
weighting_denominator = 0
for i in range(1, num_clusters + 1):
weighting_denominator += i
if num_clusters > 0:
object_rating = 0
for i in range(num_clusters):
object_rating += object_ratings[i] * ((i + 1) / weighting_denominator)
else:
continue
except (TypeError, ZeroDivisionError):
# print(str(id) + " is not assigned to any cluster before t=" + str(end_time))
continue
else:
try:
object_rating = np.sum(object_ratings)
object_rating /= num_clusters
except (TypeError, ZeroDivisionError):
# print(str(id) + " is not assigned to any cluster before t=" + str(end_time))
continue
ratings[id] = round(object_rating, 3)
return ratings
def calc_outlier_rating(self) -> pandas.DataFrame:
"""
Returns:
data (DataFrame) - pandas DataFrame with columns 'object_id', 'start_time', 'end_time', 'cluster_end_time', 'rating'
containing the outlier rating for all subsequences
"""
ratings = []
timestamps = self._data[self._time_column_name].unique()
timestamps.sort()
for i in range(0, len(timestamps) - 1):
for j in range(i + 1, len(timestamps)):
time_ratings = self.rate_object(start_time=timestamps[i], end_time=timestamps[j])
for object in time_ratings:
cluster = self._data[(self._data[self._object_column_name] == object) &
(self._data[self._time_column_name] == timestamps[j])
][self._cluster_column_name].item()
ratings.append([object, timestamps[i], timestamps[j], cluster, time_ratings[object]])
outlier_rating = pandas.DataFrame(ratings, columns=[self._object_column_name, 'start_time', 'end_time',
'cluster_end_time', 'rating'])
return outlier_rating
######## HELPER FUNCTIONS ########
def get_feature_list(self, objects: list, time: int) -> np.ndarray:
"""
Params:
objects (list) - list of objects_ids that belong to considered cluster
time (int) - time of cluster that is considered
Returns:
feature_list (array) - array of shape (num_objects, num_features) containing the features of objects in the considered cluster
"""
feature_list = []
for obj in objects:
features = self._data[
(self._data[self._object_column_name] == obj) & (self._data[self._time_column_name] == time)]
features = \
features.drop([self._object_column_name, self._cluster_column_name, self._time_column_name],
axis=1).iloc[0].tolist()
if len(features) <= 0:
print("No features found for object ", str(obj))
continue
feature_list.append(features)
return np.array(feature_list)
def get_num_timestamps(self, start_time: int, end_time: int) -> int:
"""
Params:
start_time (int) - first timestamp to be considered
end_time (int) - last timestamp to be considered
Returns:
num_timestamps (int) - number of timestamps between start_time and end_time
"""
timestamp_list = self._data[self._time_column_name].unique()
if start_time is not None:
timestamp_list = [i for i in timestamp_list if i >= start_time]
if end_time is not None:
timestamp_list = [i for i in timestamp_list if i <= end_time]
num_timestamps = len(timestamp_list)
return num_timestamps
def get_ids_to_rate(self, id: Union[int, str, list], id_name: str, start_time: int = None, end_time: int = None) -> list:
"""
Params:
id (int, str, list) - int, str, list or None representing the data points that should be rated. If id is
None, all objects are rated
id_name (str) - either self._cluster_column_name or self._object_column_name, which ids to extract
Optional:
start_time (int) - which timestamp to start at
end_time (int) - whicht timestamp to stop at
Returns:
ids_to_rate (list) - list of ids that should be rated
"""
if id is None:
data = self._data.copy()
if start_time is not None:
data = data[data[self._time_column_name] >= start_time]
if end_time is not None:
data = data[data[self._time_column_name] <= end_time]
ids_to_rate = data[id_name].unique().tolist()
elif isinstance(id, int) or isinstance(id, str):
ids_to_rate = [id]
elif isinstance(id, list):
ids_to_rate = id[:]
else:
raise Exception('id has to be int, str, list or None')
return ids_to_rate
def obtain_cluster_compositions(self) -> dict:
"""
Returns:
cluster_compositions (dict) - dict of dicts {<cluster_id>: {<cluster_id>: <proportion>}} with cluster
compositions
Example:
{5: {1: 1.0, 2: 0.1, 4: 0.5}} describes that
100% of cluster 1, 10% of cluster 2 and 50% of cluster 4 belong to cluster 5
"""
cluster_compositions = {}
g_clusters = self._data.groupby([self._time_column_name, self._cluster_column_name])
if not self._jaccard:
cluster_members = self._data.groupby(self._cluster_column_name).count()
# iterate over all clusters - 'group' contains the time and cluster_id
# and 'objects' is the corresponding dataframe
for group, objects in g_clusters:
# Ignore outliers
if int(group[1]) < 0:
continue
objects = objects[self._object_column_name].values.tolist()
# temporal intersection
# select considered clusters with later timestamps than the current one to check which clusters the
# current one merged into and count, how many objects of the current cluster are in the considered clusters
# example of a series from the dataframe: [cluster_id, count] with [2, 10]
# meaning: 10 objects of the current cluster merged into the cluster with the id 2
temp_intersection = (self._data.loc[(self._data[self._object_column_name].isin(objects)) &
(self._data[self._time_column_name] > group[0])]
).groupby(self._cluster_column_name).count()
# iterate over all clusters which the current cluster has merged into
# 'cluster' contains the cluster_id
# and 'con_objects' is the corresponding number of objects of the temporal intersection
for cluster, num_objects in temp_intersection.iterrows():
# Ignore outliers
if int(cluster) < 0:
continue
# for all considered clusters save the proportion of the current cluster that merged into the considered
# one
# example: {3: {2: 0.3}, 4: {2: 0.1}}
# meaning: 30% of (current) cluster 2 merged into (considered) cluster 3 and 10% into (considered) cluster 4
if cluster not in cluster_compositions:
cluster_compositions[cluster] = {}
if self._jaccard:
# cardinality of the union of both considered clusters
card_union = len(self._data.loc[(self._data[self._cluster_column_name] == cluster) |
(self._data[self._cluster_column_name] == group[1])]
[self._object_column_name].unique())
# jaccard distance
cluster_compositions[cluster][group[1]] = round(float(num_objects.values[1]) /
float(card_union), 3)
else:
cluster_compositions[cluster][group[1]] = round(float(num_objects.values[1]) /
float(cluster_members.loc[group[1]].values[1]), 3)
if group[1] not in cluster_compositions:
cluster_compositions[group[1]] = {}
return cluster_compositions
| 49.487395 | 138 | 0.572819 | 17,546 | 0.993151 | 0 | 0 | 0 | 0 | 0 | 0 | 6,533 | 0.369785 |
260902dd3e508f3dd93dbd19435e62ca56223adf | 3,405 | py | Python | SWIG_fast_functions/test.py | twni2016/OrganSegRSTN_PyTorch | bf571320e718c8f138e04d48645e3b4dfe75801d | [
"MIT"
] | 100 | 2018-08-01T04:42:36.000Z | 2022-03-23T07:01:21.000Z | SWIG_fast_functions/test.py | bharat3012/OrganSegRSTN_PyTorch | aff23489b1f3006761e3270178adfcccb63d0de9 | [
"MIT"
] | 12 | 2018-08-07T10:35:47.000Z | 2022-02-21T09:09:42.000Z | SWIG_fast_functions/test.py | bharat3012/OrganSegRSTN_PyTorch | aff23489b1f3006761e3270178adfcccb63d0de9 | [
"MIT"
] | 35 | 2018-08-06T21:27:36.000Z | 2021-11-03T10:20:16.000Z | import numpy as np
import fast_functions as ff
import time
def DSC_computation(label, pred):
pred_sum = pred.sum()
label_sum = label.sum()
inter_sum = (pred & label).sum()
return 2 * float(inter_sum) / (pred_sum + label_sum), inter_sum, pred_sum, label_sum
def post_processing(F, S, threshold, top2):
F_sum = F.sum()
if F_sum == 0:
return F
if F_sum >= np.product(F.shape) / 2:
return F
height = F.shape[0]
width = F.shape[1]
depth = F.shape[2]
ll = np.array(np.nonzero(S))
marked = np.zeros(F.shape, dtype = np.bool)
queue = np.zeros((F_sum, 3), dtype = np.int)
volume = np.zeros(F_sum, dtype = np.int)
head = 0
tail = 0
bestHead = 0
bestTail = 0
bestHead2 = 0
bestTail2 = 0
for l in range(ll.shape[1]):
if not marked[ll[0, l], ll[1, l], ll[2, l]]:
temp = head
marked[ll[0, l], ll[1, l], ll[2, l]] = True
queue[tail, :] = [ll[0, l], ll[1, l], ll[2, l]]
tail = tail + 1
while (head < tail):
t1 = queue[head, 0]
t2 = queue[head, 1]
t3 = queue[head, 2]
if t1 > 0 and F[t1 - 1, t2, t3] and not marked[t1 - 1, t2, t3]:
marked[t1 - 1, t2, t3] = True
queue[tail, :] = [t1 - 1, t2, t3]
tail = tail + 1
if t1 < height - 1 and F[t1 + 1, t2, t3] and not marked[t1 + 1, t2, t3]:
marked[t1 + 1, t2, t3] = True
queue[tail, :] = [t1 + 1, t2, t3]
tail = tail + 1
if t2 > 0 and F[t1, t2 - 1, t3] and not marked[t1, t2 - 1, t3]:
marked[t1, t2 - 1, t3] = True
queue[tail, :] = [t1, t2 - 1, t3]
tail = tail + 1
if t2 < width - 1 and F[t1, t2 + 1, t3] and not marked[t1, t2 + 1, t3]:
marked[t1, t2 + 1, t3] = True
queue[tail, :] = [t1, t2 + 1, t3]
tail = tail + 1
if t3 > 0 and F[t1, t2, t3 - 1] and not marked[t1, t2, t3 - 1]:
marked[t1, t2, t3 - 1] = True
queue[tail, :] = [t1, t2, t3 - 1]
tail = tail + 1
if t3 < depth - 1 and F[t1, t2, t3 + 1] and not marked[t1, t2, t3 + 1]:
marked[t1, t2, t3 + 1] = True
queue[tail, :] = [t1, t2, t3 + 1]
tail = tail + 1
head = head + 1
if tail - temp > bestTail - bestHead:
bestHead2 = bestHead
bestTail2 = bestTail
bestHead = temp
bestTail = tail
elif tail - temp > bestTail2 - bestHead2:
bestHead2 = temp
bestTail2 = tail
volume[temp: tail] = tail - temp
volume = volume[0: tail]
if top2:
target_voxel = np.where(volume >= (bestTail2 - bestHead2) * threshold)
else:
target_voxel = np.where(volume >= (bestTail - bestHead) * threshold)
F0 = np.zeros(F.shape, dtype = np.bool)
F0[tuple(map(tuple, np.transpose(queue[target_voxel, :])))] = True
return F0
print('python')
G = np.zeros((512,512,240),dtype=np.uint8)
G[128:384,128:384,60:180]=1
volume_data = np.load('1.npz')
F = volume_data['volume'].astype(np.uint8)
start_time = time.time()
F = post_processing(F, F, 1.0, False)
print(time.time() - start_time)
start_time = time.time()
for l in range(10):
DSC = DSC_computation(F,G)
print(DSC)
print(time.time() - start_time)
print('SWIG')
volume_data = np.load('1.npz')
G = np.zeros((512,512,240),dtype=np.uint8)
G[128:384,128:384,60:180]=1
F = volume_data['volume'].astype(np.uint8)
start_time = time.time()
ff.post_processing(F, F, 1.0, False)
print(time.time() - start_time)
start_time = time.time()
for l in range(10):
P = np.zeros(3, dtype = np.uint32)
ff.DSC_computation(F,G,P)
print(P, float(P[2]) * 2 / (P[0] + P[1]))
print(time.time() - start_time)
| 29.608696 | 85 | 0.595888 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 44 | 0.012922 |
260aad7a8e1f7dc10f9fc0b29cb23cbf4ba1d39e | 221 | py | Python | smart-chatbot-zero/Rerank/data_preprocess1.py | WenRichard/Customer-Chatbot | 48508c40574ffac8ced414a5bea799e2c85341ca | [
"MIT"
] | 268 | 2019-07-26T01:40:43.000Z | 2022-03-28T14:54:57.000Z | xiaotian-chatbot1.0/Rerank/data_preprocess1.py | abc668/Customer-Chatbot | 48508c40574ffac8ced414a5bea799e2c85341ca | [
"MIT"
] | 7 | 2019-08-13T04:17:55.000Z | 2020-08-06T08:57:34.000Z | xiaotian-chatbot1.0/Rerank/data_preprocess1.py | abc668/Customer-Chatbot | 48508c40574ffac8ced414a5bea799e2c85341ca | [
"MIT"
] | 113 | 2019-07-26T01:40:47.000Z | 2022-03-18T13:22:44.000Z | # -*- coding: utf-8 -*-
# @Time : 2019/5/25 16:09
# @Author : Alan
# @Email : [email protected]
# @File : data_preprocess2.py
# @Software: PyCharm
# 自己写一个生成词表的函数
def read(stopword_file, in_file):
pass | 20.090909 | 36 | 0.638009 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 194 | 0.791837 |
260b023afea60f62495ec2404352213dae65708e | 1,160 | py | Python | PageMonitor/project/lib/config.py | DanylZhang/IdeaWorkspace | 726be80db4ca7dac4104ebaa22b795f37aca73e0 | [
"MIT"
] | null | null | null | PageMonitor/project/lib/config.py | DanylZhang/IdeaWorkspace | 726be80db4ca7dac4104ebaa22b795f37aca73e0 | [
"MIT"
] | null | null | null | PageMonitor/project/lib/config.py | DanylZhang/IdeaWorkspace | 726be80db4ca7dac4104ebaa22b795f37aca73e0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding:utf-8
import pymysql
default_config = {
'host': '139.196.96.149',
'port': 13306,
'user': 'dataway-rw',
'password': 'QqHVMhmN*8',
'db': 'jumei',
'charset': 'utf8mb4'
}
apollo_config = {
'host': '127.0.0.1',
'port': 11306,
'user': 'apollo-rw',
'password': 'QBT094bt',
'db': 'apollo',
'charset': 'utf8mb4',
'autocommit': True
}
allsite_config = {
'host': '127.0.0.1',
'port': 15306,
'user': 'apollo-rw',
'password': 'QBT094bt',
'db': 'all_site',
'charset': 'utf8mb4'
}
dataway_config = {
'host': '139.196.96.149',
'port': 13306,
'user': 'dataway-rw',
'password': 'QqHVMhmN*8',
'db': 'jumei',
'charset': 'utf8mb4'
}
dw_entity_config = {
'host': '127.0.0.1',
'port': 18306,
'user': 'qbt',
'password': 'QBT094bt',
'db': 'dw_entity',
'charset': 'utf8mb4',
'autocommit': True
}
channel_config = {
'host': 'channel.ecdataway.com',
'port': 3306,
'user': 'comment_catcher',
'password': 'cc33770880',
'db': 'monitor',
'charset': 'utf8mb4',
'cursorclass': pymysql.cursors.DictCursor
}
| 20.714286 | 45 | 0.546552 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 646 | 0.556897 |
260b70a7a637b6e3448163b26c95e89556398218 | 70 | py | Python | 24/aoc24-1-cython.py | combs/AdventOfCode2021 | 925df8a3526cb9c0dde368cf828673f345096e06 | [
"MIT"
] | null | null | null | 24/aoc24-1-cython.py | combs/AdventOfCode2021 | 925df8a3526cb9c0dde368cf828673f345096e06 | [
"MIT"
] | null | null | null | 24/aoc24-1-cython.py | combs/AdventOfCode2021 | 925df8a3526cb9c0dde368cf828673f345096e06 | [
"MIT"
] | null | null | null | import pyximport
pyximport.install()
from aoc24 import do_it
do_it()
| 11.666667 | 23 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
260b9f9c6262684a4bbfdcc0510786d9313421e4 | 358 | py | Python | tests/main.py | zodiuxus/opensimplex | d8c761d91834a809e51987d25439549c50f0effb | [
"MIT"
] | null | null | null | tests/main.py | zodiuxus/opensimplex | d8c761d91834a809e51987d25439549c50f0effb | [
"MIT"
] | null | null | null | tests/main.py | zodiuxus/opensimplex | d8c761d91834a809e51987d25439549c50f0effb | [
"MIT"
] | null | null | null | from opensimplex import OpenSimplex
import torch, time
def opensimplex_test(device: str):
generator = torch.Generator(device=device)
start = time.time()
os = OpenSimplex(generator=generator)
end = time.time()
return os.noise2(10,10), device, end-start
print(opensimplex_test('cuda'))
print('')
print(opensimplex_test('cpu')) | 27.538462 | 47 | 0.701117 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 0.036313 |
260c11b37ca0f5a211fd4291ad4e8a2a93dbd3d4 | 83 | py | Python | pybktreespellchecker/__init__.py | tomasrasymas/pybktree-spell-checker | e1f7547957a4257a9b6ce470ebc8bcc95767c5d4 | [
"MIT"
] | 3 | 2019-01-07T21:34:29.000Z | 2020-07-20T23:43:01.000Z | pybktreespellchecker/__init__.py | tomasrasymas/pybktree-spell-checker | e1f7547957a4257a9b6ce470ebc8bcc95767c5d4 | [
"MIT"
] | null | null | null | pybktreespellchecker/__init__.py | tomasrasymas/pybktree-spell-checker | e1f7547957a4257a9b6ce470ebc8bcc95767c5d4 | [
"MIT"
] | null | null | null | from .levenshtein_distance import levenshtein_distance
from .bk_tree import BKTree
| 27.666667 | 54 | 0.879518 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
260d3744fb17af1e21703f4ae4917654e0d07e54 | 10,731 | py | Python | part1/ELMo/modules/elmo.py | peter850706/Contextual-embeddings-for-sequence-classification | e26ba68f6aa30ec07319dcd37a04a8f56e07d7b0 | [
"MIT"
] | null | null | null | part1/ELMo/modules/elmo.py | peter850706/Contextual-embeddings-for-sequence-classification | e26ba68f6aa30ec07319dcd37a04a8f56e07d7b0 | [
"MIT"
] | null | null | null | part1/ELMo/modules/elmo.py | peter850706/Contextual-embeddings-for-sequence-classification | e26ba68f6aa30ec07319dcd37a04a8f56e07d7b0 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from collections import namedtuple
from ELMo.modules.char_embedding import CharEmbedding
class ELMo(nn.Module):
"""Implement the Embeddings from Language Models (ELMo) as described in "Deep contextualized word representations" (https://arxiv.org/pdf/1802.05365.pdf)
Args:
hidden_size (int): The number of features in the hidden state h of the language models.
dim_projection (int):
char_embedding_kwargs (dict): The parameters for the CharEmbedding class (refer to modules/char_embedding.py).
"""
def __init__(self, hidden_size=2048, dim_projection=512, **char_embedding_kwargs):
super(ELMo, self).__init__()
self.char_embedding = CharEmbedding(**char_embedding_kwargs)
"""
self.output_layer = nn.Sequential(nn.Linear(dim_projection, dim_projection),
nn.ReLU(inplace=True))
"""
# forward language model
self.forward_lm = nn.Sequential()
self.forward_lm.add_module('lstm0', nn.LSTM(input_size=char_embedding_kwargs['projection_size'],
hidden_size=hidden_size,
num_layers=1,
dropout=0,
bidirectional=False))
self.forward_lm.add_module('linear0', nn.Linear(hidden_size, dim_projection))
self.forward_lm.add_module('lstm1', nn.LSTM(input_size=dim_projection,
hidden_size=hidden_size,
num_layers=1,
dropout=0,
bidirectional=False))
self.forward_lm.add_module('linear1', nn.Linear(hidden_size, dim_projection))
for name, param in self.forward_lm.named_parameters():
if 'lstm' in name and param.requires_grad:
# orthogonal initialization
if 'weight' in name:
nn.init.orthogonal_(param)
# bias = [b_ig | b_fg | b_gg | b_og], set b_fg (forget gate) to 1 and other gates to 0
elif 'bias' in name:
n = param.size(0)
param.data.fill_(0)
param.data[n // 4 : n // 2].fill_(1)
# backward language model
self.backward_lm = nn.Sequential()
self.backward_lm.add_module('lstm0', nn.LSTM(input_size=char_embedding_kwargs['projection_size'],
hidden_size=hidden_size,
num_layers=1,
dropout=0,
bidirectional=False))
self.backward_lm.add_module('linear0', nn.Linear(hidden_size, dim_projection))
self.backward_lm.add_module('lstm1', nn.LSTM(input_size=dim_projection,
hidden_size=hidden_size,
num_layers=1,
dropout=0,
bidirectional=False))
self.backward_lm.add_module('linear1', nn.Linear(hidden_size, dim_projection))
for name, param in self.backward_lm.named_parameters():
if 'lstm' in name and param.requires_grad:
# orthogonal initialization
if 'weight' in name:
nn.init.orthogonal_(param)
# bias = [b_ig | b_fg | b_gg | b_og], set b_fg (forget gate) to 1 and other gates to 0
elif 'bias' in name:
n = param.size(0)
param.data.fill_(0)
param.data[n // 4 : n // 2].fill_(1)
def packed_forward(self, rnn, padded_input, lengths):
"""
Args:
rnn:
padded_input (tensor) (padded_len, batch, features): The padded input.
lengths (LongTensor) (batch, ): The original length of the padded_input
Return:
padded_output (tensor) (padded_len, batch, features):
"""
lengths, sorted_indexes = torch.sort(lengths, descending=True) # sorted by descending order
padded_input = padded_input.index_select(dim=1, index=sorted_indexes)
packed_input = pack_padded_sequence(input=padded_input, lengths=lengths)
packed_output, _ = rnn(packed_input)
padded_output, _ = pad_packed_sequence(sequence=packed_output, padding_value=0)
unsorted_indexes = torch.argsort(sorted_indexes) # recover the original order
return padded_output.index_select(dim=1, index=unsorted_indexes)
def forward(self, forward_input, backward_input, word_lens):
"""
Args:
forward_input (tensor) (batch, padded_len):
word_lens (LongTensor) (batch, ): The original length of the input sentences.
Returns:
logits (dict):
forward (tensor) (batch, padded_len, dim_projection):
backward (tensor) (batch, padded_len, dim_projection):
"""
forward_char_embedding_features = self.char_embedding(forward_input).transpose(1, 0) # (padded_len, batch, projection_size)
backward_char_embedding_features = self.char_embedding(backward_input).transpose(1, 0) # (padded_len, batch, projection_size)
forward_lm_layer0_features = self.forward_lm.linear0(self.packed_forward(self.forward_lm.lstm0, forward_char_embedding_features, word_lens)) # (padded_len, batch, projection_size)
backward_lm_layer0_features = self.backward_lm.linear0(self.packed_forward(self.backward_lm.lstm0, backward_char_embedding_features, word_lens)) # (padded_len, batch, projection_size)
forward_lm_layer1_features = self.forward_lm.linear1(self.packed_forward(self.forward_lm.lstm1, forward_lm_layer0_features, word_lens)) # (padded_len, batch, projection_size)
backward_lm_layer1_features = self.backward_lm.linear1(self.packed_forward(self.backward_lm.lstm1, backward_lm_layer0_features, word_lens)) # (padded_len, batch, projection_size)
"""
# residual connection
forward_lm_layer1_features = forward_lm_layer0_features + forward_lm_layer1_features
backward_lm_layer1_features = backward_lm_layer0_features + backward_lm_layer1_features
#
forward_logits = self.output_layer(forward_lm_layer1_features)
backward_logits = self.output_layer(backward_lm_layer1_features)
"""
# residual connnection between layer0 and layer1
forward_logits = (forward_lm_layer0_features + forward_lm_layer1_features).transpose(1, 0)
backward_logits = (backward_lm_layer0_features + backward_lm_layer1_features).transpose(1, 0)
return {'forward': forward_logits, 'backward': backward_logits}
def concat_features(self, forward_features, backward_features, word_lens):
padded_len, batch, _ = backward_features.size()
indexes = list(range(padded_len))
for i in range(batch):
reversed_indexes = indexes[:word_lens[i]][::-1] + indexes[word_lens[i]:]
backward_features[:, i, :] = backward_features[:, i, :].index_select(dim=0,
index=torch.tensor(reversed_indexes,
dtype=torch.long,
device=word_lens.device))
return torch.cat([forward_features, backward_features], dim=-1)
def extract_features(self, forward_input, backward_input, word_lens):
"""
Args:
forward_input (tensor) (batch, padded_len):
word_lens (LongTensor) (batch, ): The original length of the input sentences.
Returns:
logits (dict):
forward (tensor) (batch, padded_len, dim_projection):
backward (tensor) (batch, padded_len, dim_projection):
"""
forward_char_embedding_features = self.char_embedding(forward_input).transpose(1, 0) # (padded_len, batch, projection_size)
backward_char_embedding_features = self.char_embedding(backward_input).transpose(1, 0) # (padded_len, batch, projection_size)
forward_lm_layer0_features = self.forward_lm.linear0(self.packed_forward(self.forward_lm.lstm0, forward_char_embedding_features, word_lens)) # (padded_len, batch, projection_size)
backward_lm_layer0_features = self.backward_lm.linear0(self.packed_forward(self.backward_lm.lstm0, backward_char_embedding_features, word_lens)) # (padded_len, batch, projection_size)
forward_lm_layer1_features = self.forward_lm.linear1(self.packed_forward(self.forward_lm.lstm1, forward_lm_layer0_features, word_lens)) # (padded_len, batch, projection_size)
backward_lm_layer1_features = self.backward_lm.linear1(self.packed_forward(self.backward_lm.lstm1, backward_lm_layer0_features, word_lens)) # (padded_len, batch, projection_size)
# concatenate forward and backward features
char_embedding_features = self.concat_features(forward_char_embedding_features,
backward_char_embedding_features,
word_lens).transpose(1, 0) # (batch, padded_len, 2 * projection_size)
lm_layer0_features = self.concat_features(forward_lm_layer0_features,
backward_lm_layer0_features,
word_lens).transpose(1, 0) # (batch, padded_len, 2 * projection_size)
lm_layer1_features = self.concat_features(forward_lm_layer1_features,
backward_lm_layer1_features,
word_lens).transpose(1, 0) # (batch, padded_len, 2 * projection_size)
Features = namedtuple('ELMoFeatures', ['char_embedding', 'lm_layer0', 'lm_layer1'])
return Features(*[char_embedding_features, lm_layer0_features, lm_layer1_features]) | 63.875 | 191 | 0.594353 | 10,532 | 0.981456 | 0 | 0 | 0 | 0 | 0 | 0 | 3,239 | 0.301836 |
260d56541b9590ff3dcf8aa4ac7f649e63e42413 | 3,106 | py | Python | src/app/externalOutages/createRealTimeOutage.py | nagasudhirpulla/wrldc_codebook | 8fbc795074e16e2012b29ae875b99aa721a7f021 | [
"MIT"
] | null | null | null | src/app/externalOutages/createRealTimeOutage.py | nagasudhirpulla/wrldc_codebook | 8fbc795074e16e2012b29ae875b99aa721a7f021 | [
"MIT"
] | 21 | 2021-01-08T18:03:32.000Z | 2021-02-02T16:17:34.000Z | src/app/externalOutages/createRealTimeOutage.py | nagasudhirpulla/wrldc_codebook | 8fbc795074e16e2012b29ae875b99aa721a7f021 | [
"MIT"
] | null | null | null | import datetime as dt
import cx_Oracle
from src.app.externalOutages.getReasonId import getReasonId
def createRealTimeOutage(pwcDbConnStr: str, elemTypeId: int, elementId: int, outageDt: dt.datetime, outageTypeId: int,
reason: str, elementName: str, sdReqId: int, outageTagId: int) -> int:
"""create a new row in real time outages pwc table and return the id of newly created row
Args:
pwcDbConnStr (str): [description]
elemTypeId (int): [description]
elementId (int): [description]
outageDt (dt.datetime): [description]
outageTypeId (int): [description]
reason (str): [description]
elementName (str): [description]
sdReqId (int): [description]
outageTagId (int): [description]
Returns:
int: id of newly created row
"""
newRtoId = -1
if outageDt == None:
return -1
if reason == None or reason == "":
reason = "NA"
reasId = getReasonId(pwcDbConnStr, reason, outageTypeId)
if reasId == -1:
return -1
outageDate: dt.datetime = dt.datetime(
outageDt.year, outageDt.month, outageDt.day)
outageTime: str = dt.datetime.strftime(outageDt, "%H:%M")
newRtoIdFetchSql = """
SELECT MAX(rto.ID)+1 FROM REPORTING_WEB_UI_UAT.real_time_outage rto
"""
rtoInsertSql = """
insert into reporting_web_ui_uat.real_time_outage rto(ID, ENTITY_ID, ELEMENT_ID, OUTAGE_DATE,
OUTAGE_TIME, RELAY_INDICATION_SENDING_ID, RELAY_INDICATION_RECIEVING_ID, CREATED_DATE,
SHUT_DOWN_TYPE, REASON_ID, CREATED_BY, MODIFIED_BY, REGION_ID, ELEMENTNAME,
SHUTDOWNREQUEST_ID, LOAD_AFFECTED, IS_LOAD_OR_GEN_AFFECTED, SHUTDOWN_TAG_ID, IS_DELETED) values
(:id, :elemTypeId, :elementId, :outageDate, :outageTime, 0, 0, CURRENT_TIMESTAMP, :outageTypeId,
:reasonId, 123, 123, 4, :elementName, :sdReqId, 0, 0, :outageTagId, NULL)
"""
dbConn = None
dbCur = None
try:
# get connection with raw data table
dbConn = cx_Oracle.connect(pwcDbConnStr)
# get cursor for raw data table
dbCur = dbConn.cursor()
# execute the new rto id fetch sql
dbCur.execute(newRtoIdFetchSql)
dbRows = dbCur.fetchall()
newRtoId = dbRows[0][0]
sqlData = {"id": newRtoId, "elemTypeId": elemTypeId, "elementId": elementId,
"outageDate": outageDate, "outageTime": outageTime,
"outageTypeId": outageTypeId, "reasonId": reasId,
"elementName": elementName, "sdReqId": sdReqId,
"outageTagId": outageTagId}
# execute the new row insertion sql
dbCur.execute(rtoInsertSql, sqlData)
# commit the changes
dbConn.commit()
except Exception as e:
newRtoId = -1
print('Error while creating new real time outage entry in pwc table')
print(e)
finally:
# closing database cursor and connection
if dbCur is not None:
dbCur.close()
if dbConn is not None:
dbConn.close()
return newRtoId
| 36.541176 | 118 | 0.640052 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,550 | 0.499034 |
260e0a514e1da67dfebf1f15683649ad98d25110 | 918 | py | Python | src/backend/marsha/core/utils/jitsi_utils.py | insad-video/marsha | 1e6a708c74527f50c4aa24d811049492e75f47a0 | [
"MIT"
] | null | null | null | src/backend/marsha/core/utils/jitsi_utils.py | insad-video/marsha | 1e6a708c74527f50c4aa24d811049492e75f47a0 | [
"MIT"
] | null | null | null | src/backend/marsha/core/utils/jitsi_utils.py | insad-video/marsha | 1e6a708c74527f50c4aa24d811049492e75f47a0 | [
"MIT"
] | null | null | null | """Utils for jitsi"""
from datetime import timedelta
from django.conf import settings
from django.utils import timezone
import jwt
def create_payload(room, moderator=True):
"""Create the payload so that it contains each information jitsi requires"""
token_payload = {
"exp": timezone.now()
+ timedelta(seconds=settings.JITSI_JWT_TOKEN_EXPIRATION_SECONDS),
"iat": timezone.now(),
"moderator": moderator,
"aud": "jitsi",
"iss": settings.JITSI_JWT_APP_ID,
"sub": settings.JITSI_DOMAIN,
"room": room,
}
return token_payload
def generate_token(room, moderator):
"""Generate the access token that will give access to the room"""
token_payload = create_payload(room=room, moderator=moderator)
token = jwt.encode(
token_payload,
settings.JITSI_JWT_APP_SECRET,
algorithm="HS256",
)
return token
| 25.5 | 80 | 0.668845 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 218 | 0.237473 |
260f70e32d8dcbedd3be143cdb372b3adae4699c | 1,356 | py | Python | python/code_challenges/hashtable/test_hashtable.py | u-will/data-structures-and-algorithms | 7ef7b5a527fbcacef8cbfe7a01fc69990c7358c3 | [
"MIT"
] | null | null | null | python/code_challenges/hashtable/test_hashtable.py | u-will/data-structures-and-algorithms | 7ef7b5a527fbcacef8cbfe7a01fc69990c7358c3 | [
"MIT"
] | null | null | null | python/code_challenges/hashtable/test_hashtable.py | u-will/data-structures-and-algorithms | 7ef7b5a527fbcacef8cbfe7a01fc69990c7358c3 | [
"MIT"
] | null | null | null | from hashtable import Hashtable
def test_create():
hashtable = Hashtable()
assert hashtable
def test_predictable_hash():
hashtable = Hashtable()
initial = hashtable._hash('spam')
secondary = hashtable._hash('spam')
assert initial == secondary
def test_in_range_hash():
hashtable = Hashtable()
actual = hashtable._hash('spam')
assert 0 <= actual < hashtable._size
def test_same_hash():
hashtable = Hashtable()
initial = hashtable._hash('listen')
secondary = hashtable._hash('silent')
assert initial == secondary
def test_different_hash():
hashtable = Hashtable()
initial = hashtable._hash('glisten')
secondary = hashtable._hash('silent')
assert initial != secondary
def test_get_apple():
hashtable = Hashtable()
hashtable.add("apple", "Used for apple sauce")
actual = hashtable.get("apple")
expected = "Used for apple sauce"
assert actual == expected
def test_get_silent_and_listen():
hashtable = Hashtable()
hashtable.add('listen','to me')
hashtable.add('silent','so quiet')
assert hashtable.get('listen') == 'to me'
assert hashtable.get('silent') == 'so quiet'
def test_contains():
hashtable = Hashtable()
hashtable.add('hello', 'me')
actual = hashtable.contains('hello')
expect = True
assert actual == expect
| 22.983051 | 50 | 0.672566 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 193 | 0.14233 |
261019984f7fcb844ce180e8d6381fbe39be01a7 | 65,879 | py | Python | Code/CustomObjects.py | dluke/lex-talionis | 1e02bcd4afdd22737aa3450bbcb269e69551bc39 | [
"MIT"
] | 1 | 2019-07-02T12:50:46.000Z | 2019-07-02T12:50:46.000Z | Code/CustomObjects.py | dluke/lex-talionis | 1e02bcd4afdd22737aa3450bbcb269e69551bc39 | [
"MIT"
] | null | null | null | Code/CustomObjects.py | dluke/lex-talionis | 1e02bcd4afdd22737aa3450bbcb269e69551bc39 | [
"MIT"
] | null | null | null | import os, pickle, re
import GlobalConstants as GC
import configuration as cf
# Custom Imports
import MenuFunctions
import Utility, Image_Modification, Engine, InputManager
import logging
logger = logging.getLogger(__name__)
# === Simple Finite State Machine Object ===============================
class StateMachine(object):
def __init__(self, startingstate):
self.state = []
self.state.append(startingstate)
self.state_log = []
def changeState(self, newstate):
self.state.append(newstate)
def back(self):
self.state.pop()
def getState(self):
return self.state[-1]
def clear(self):
self.state = []
# Keeps track of the state at every tick
def update(self):
self.state_log.append(self.getState())
# === CURSOR OBJECT =============================================
class Cursor(object):
def __init__(self, sprite, position, fake=False):
self.spriteName = sprite
self.fake = fake
self.loadSprites()
self.position = position
self.currentSelectedUnit = None
self.secondSelectedUnit = None
self.currentHoveredUnit = None
self.currentHoveredTile = None
self.camera_follow = None
self.fluid_helper = InputManager.FluidScroll(cf.OPTIONS['Cursor Speed'])
self.movePath = []
self.drawState = 0 # If cursor will be drawn
self.spriteOffset = [0, 0]
def draw(self, surf):
if self.drawState or self.fake: # Only draws if cursor is on
x, y = self.position
# The space Rect is constructed like so so as to center the cursor sprite
topleft = x * GC.TILEWIDTH - max(0, (self.image.get_width() - 16)/2), y * GC.TILEHEIGHT - max(0, (self.image.get_height() - 16)/2)
topleft = topleft[0] - self.spriteOffset[0], topleft[1] - self.spriteOffset[1]
surf.blit(self.image, topleft)
# Reset sprite offset afterwards
if self.spriteOffset[0] > 0:
self.spriteOffset[0] -= 4
elif self.spriteOffset[0] < 0:
self.spriteOffset[0] += 4
if self.spriteOffset[1] > 0:
self.spriteOffset[1] -= 4
elif self.spriteOffset[1] < 0:
self.spriteOffset[1] += 4
def getHoveredUnit(self, gameStateObj):
for unit in gameStateObj.allunits:
if unit.position == self.position:
return unit
return None
def init_displays(self):
self.unit_info_disp = None
self.tile_info_disp = None
self.obj_info_disp = None
self.unit_info_offset = 0
self.tile_info_offset = 0
self.obj_info_offset = 0
self.remove_unit_info = True
self.tile_left = False
self.obj_top = False
def removeSprites(self):
self.sprite = None
self.image = None
self.passivesprite, self.activesprite, self.redsprite = None, None, None
# Current displays
self.init_displays()
def loadSprites(self):
# Load sprite
self.sprite = GC.IMAGESDICT[self.spriteName]
self.passivesprite, self.activesprite, self.redsprite, self.formationsprite = self.formatSprite(self.sprite)
self.image = Engine.subsurface(self.passivesprite, (GC.CURSORSPRITECOUNTER.count*GC.TILEWIDTH*2, 0, GC.TILEWIDTH*2, GC.TILEHEIGHT*2)) # 32*32
# Current displays
self.init_displays()
def remove_unit_display(self):
self.remove_unit_info = True
def move(self, move, gameStateObj):
dx, dy = move
gameStateObj.allarrows = [] # Clear all arrows
GC.SOUNDDICT['Select 5'].stop() # Play cursor sound on move
GC.SOUNDDICT['Select 5'].play()
x, y = self.position
self.position = x + dx, y + dy
self.place_arrows(gameStateObj)
# Remove unit display
self.remove_unit_display()
# Sprite Offset -- but only if we're not traveling too fast
if cf.OPTIONS['Cursor Speed'] >= 40:
self.spriteOffset[0] += 12*dx
self.spriteOffset[1] += 12*dy
def place_arrows(self, gameStateObj):
if gameStateObj.stateMachine.getState() == 'move' and gameStateObj.highlight_manager.check_arrow(self.position):
self.movePath = self.currentSelectedUnit.getPath(gameStateObj, self.position)
self.constructArrows(self.movePath[::-1], gameStateObj)
# The algorithm below is all hard-coded in, which sucks, should change it later, but it WORKS, so thats good
# ALSO IS EXTREMELY SHITTY ALGORITHM I DON'T UNDERSTAND. was found using trial and error, for the most part
def constructArrows(self, movePath, gameStateObj):
arrow = None
if len(movePath) <= 1: # ie, we haven't really moved yet
return
for index in range(len(movePath)):
if index == 0:
directionTuple = (movePath[index + 1][0] - movePath[index][0], movePath[index + 1][1] - movePath[index][1])
if directionTuple == (1, 0): # right
arrow = ArrowObject((0, 0), movePath[index])
elif directionTuple == (-1, 0): # left
arrow = ArrowObject((1, 1), movePath[index])
elif directionTuple == (0, 1): # up
arrow = ArrowObject((0, 1), movePath[index])
elif directionTuple == (0, -1): # down
arrow = ArrowObject((1, 0), movePath[index])
elif index == len(movePath) - 1:
directionTuple = (movePath[index][0] - movePath[index - 1][0], movePath[index][1] - movePath[index - 1][1])
if directionTuple == (1, 0):
arrow = ArrowObject((0, 6), movePath[index])
elif directionTuple == (-1, 0):
arrow = ArrowObject((1, 7), movePath[index])
elif directionTuple == (0, -1):
arrow = ArrowObject((1, 6), movePath[index])
elif directionTuple == (0, 1):
arrow = ArrowObject((0, 7), movePath[index])
else: # Neither beginning nor end of arrow
directionTuple = (movePath[index + 1][0] - movePath[index - 1][0], movePath[index + 1][1] - movePath[index - 1][1])
modifierTuple = (movePath[index][0] - movePath[index - 1][0], movePath[index][1] - movePath[index - 1][1])
if directionTuple == (2, 0) or directionTuple == (-2, 0): # right or left
arrow = ArrowObject((0, 3), movePath[index])
elif directionTuple == (0, 2) or directionTuple == (0, -2): # up or down
arrow = ArrowObject((0, 2), movePath[index])
elif directionTuple == (1, -1) or directionTuple == (-1, 1):
if modifierTuple == (0, -1) or modifierTuple == (-1, 0):
# print "topleft"
arrow = ArrowObject((0, 4), movePath[index])
else:
# print "bottomright"
arrow = ArrowObject((1, 5), movePath[index])
elif directionTuple == (1, 1) or directionTuple == (-1, -1):
if modifierTuple == (0, -1) or modifierTuple == (1, 0):
# print "topright"
arrow = ArrowObject((0, 5), movePath[index])
else: # (0, 1) is one of the modifier tuples that does here.
# print "bottomleft"
arrow = ArrowObject((1, 4), movePath[index])
gameStateObj.allarrows.append(arrow)
def handleMovement(self, gameStateObj):
# Handle Cursor movement - Move the cursor around
# Refuses to move Cursor if not enough time has passed since the cursor has last moved. This is
# a hack to slow down cursor movement rate.
directions = self.fluid_helper.get_directions()
if 'LEFT' in directions and self.position[0] > 0:
self.move((-1, 0), gameStateObj)
if self.position[0] <= gameStateObj.cameraOffset.get_x() + 2: # Cursor controls camera movement
# Set x is move the camera. Move it to its x_pos - 1, cause we're moving left
gameStateObj.cameraOffset.set_x(gameStateObj.cameraOffset.x - 1)
elif 'RIGHT' in directions and self.position[0] < (gameStateObj.map.width - 1):
self.move((1, 0), gameStateObj)
if self.position[0] >= (GC.WINWIDTH/GC.TILEWIDTH + gameStateObj.cameraOffset.get_x() - 3):
gameStateObj.cameraOffset.set_x(gameStateObj.cameraOffset.x + 1)
if 'UP' in directions and self.position[1] > 0:
self.move((0, -1), gameStateObj)
if self.position[1] <= gameStateObj.cameraOffset.get_y() + 2:
gameStateObj.cameraOffset.set_y(gameStateObj.cameraOffset.y - 1)
elif 'DOWN' in directions and self.position[1] < (gameStateObj.map.height - 1):
self.move((0, 1), gameStateObj)
if self.position[1] >= (GC.WINHEIGHT/GC.TILEHEIGHT + gameStateObj.cameraOffset.get_y() - 3):
gameStateObj.cameraOffset.set_y(gameStateObj.cameraOffset.y + 1)
def setPosition(self, newposition, gameStateObj):
if not newposition:
return
logger.debug('Cursor new position %s', newposition)
self.position = newposition
# Recenter camera
if self.position[0] <= gameStateObj.cameraOffset.get_x() + 2: # Too far left
gameStateObj.cameraOffset.set_x(self.position[0] - 3) # Testing...
if self.position[0] >= (GC.WINWIDTH/GC.TILEWIDTH + gameStateObj.cameraOffset.get_x() - 3):
gameStateObj.cameraOffset.set_x(self.position[0] + 4 - GC.WINWIDTH/GC.TILEWIDTH)
if self.position[1] <= gameStateObj.cameraOffset.get_y() + 2:
gameStateObj.cameraOffset.set_y(self.position[1] - 2)
if self.position[1] >= (GC.WINHEIGHT/GC.TILEHEIGHT + gameStateObj.cameraOffset.get_y() - 3):
gameStateObj.cameraOffset.set_y(self.position[1] + 3 - GC.WINHEIGHT/GC.TILEHEIGHT)
# Remove unit display
self.remove_unit_display()
def forcePosition(self, newposition, gameStateObj):
if not newposition:
return
logger.debug('Cursor new position %s', newposition)
self.position = newposition
# Recenter camera
if self.position[0] <= gameStateObj.cameraOffset.get_x() + 2: # Too far left
gameStateObj.cameraOffset.force_x(self.position[0] - 3) # Testing...
if self.position[0] >= (GC.WINWIDTH/GC.TILEWIDTH + gameStateObj.cameraOffset.get_x() - 3):
gameStateObj.cameraOffset.force_x(self.position[0] + 4 - GC.WINWIDTH/GC.TILEWIDTH)
if self.position[1] <= gameStateObj.cameraOffset.get_y() + 2:
gameStateObj.cameraOffset.force_y(self.position[1] - 2)
if self.position[1] >= (GC.WINHEIGHT/GC.TILEHEIGHT + gameStateObj.cameraOffset.get_y() - 3):
gameStateObj.cameraOffset.force_y(self.position[1] + 3 - GC.WINHEIGHT/GC.TILEHEIGHT)
# Remove unit display
self.remove_unit_display()
def autocursor(self, gameStateObj, force=False):
player_units = [unit for unit in gameStateObj.allunits if unit.team == 'player' and unit.position]
lord = [unit for unit in player_units if 'Lord' in unit.tags]
if force:
if lord:
gameStateObj.cursor.forcePosition(lord[0].position, gameStateObj)
elif player_units:
gameStateObj.cursor.forcePosition(player_units[0].position, gameStateObj)
else:
if lord:
gameStateObj.cursor.setPosition(lord[0].position, gameStateObj)
elif player_units:
gameStateObj.cursor.setPosition(player_units[0].position, gameStateObj)
def formatSprite(self, sprite):
# Sprites are in 64 x 64 boxes
passivesprite = Engine.subsurface(sprite, (0, 0, GC.TILEWIDTH*2*4, GC.TILEHEIGHT*2))
redsprite = Engine.subsurface(sprite, (0, GC.TILEHEIGHT*2, GC.TILEWIDTH*2*4, GC.TILEHEIGHT*2))
activesprite = Engine.subsurface(sprite, (0, GC.TILEHEIGHT*4, GC.TILEWIDTH*2, GC.TILEHEIGHT*2))
formationsprite = Engine.subsurface(sprite, (GC.TILEWIDTH*2*2, GC.TILEHEIGHT*4, GC.TILEWIDTH*2*2, GC.TILEHEIGHT*2))
return passivesprite, activesprite, redsprite, formationsprite
def drawPortraits(self, surf, gameStateObj):
legal_states = ['free', 'prep_formation', 'prep_formation_select']
# Unit Info handling
if self.remove_unit_info:
if gameStateObj.stateMachine.getState() in legal_states and self.currentHoveredUnit: # Get this
self.remove_unit_info = False
self.unit_info_disp = self.currentHoveredUnit.createPortrait(gameStateObj)
self.unit_info_offset = min(self.unit_info_disp.get_width(), self.unit_info_offset)
elif self.unit_info_disp:
self.unit_info_offset += 20
if self.unit_info_offset >= 200:
self.unit_info_disp = None
else:
self.unit_info_offset -= 20
self.unit_info_offset = max(0, self.unit_info_offset)
# Tile Info Handling
if gameStateObj.stateMachine.getState() in legal_states and cf.OPTIONS['Show Terrain']:
gameStateObj.cursor.currentHoveredTile = gameStateObj.map.tiles[gameStateObj.cursor.position]
if gameStateObj.cursor.currentHoveredTile:
self.tile_info_disp = gameStateObj.cursor.currentHoveredTile.getDisplay(gameStateObj)
self.tile_info_offset = min(self.tile_info_disp.get_width(), self.tile_info_offset)
self.tile_info_offset -= 20
self.tile_info_offset = max(0, self.tile_info_offset)
elif self.tile_info_disp:
self.tile_info_offset += 20
if self.tile_info_offset >= 200:
self.tile_info_disp = None
# Objective Info Handling
if gameStateObj.stateMachine.getState() in legal_states and cf.OPTIONS['Show Objective']:
self.obj_info_disp = gameStateObj.objective.draw(gameStateObj)
self.obj_info_offset -= 20
self.obj_info_offset = max(0, self.obj_info_offset)
elif self.obj_info_disp:
self.obj_info_offset += 20
if self.obj_info_offset >= 200:
self.obj_info_disp = None
# === Final blitting
# Should be in topleft, unless cursor is in topleft, in which case it should be in bottomleft
if self.unit_info_disp:
if self.position[1] < GC.TILEY/2 + gameStateObj.cameraOffset.get_y() and \
not (self.position[0] > GC.TILEX/2 + gameStateObj.cameraOffset.get_x() - 1):
surf.blit(self.unit_info_disp, (0 - self.unit_info_offset, GC.WINHEIGHT - 0 - self.unit_info_disp.get_height()))
else:
surf.blit(self.unit_info_disp, (0 - self.unit_info_offset, 0))
if self.tile_info_disp:
# Should be in bottom, no matter what. Can be in bottomleft or bottomright, depending on where cursor is
if self.position[0] > GC.WINWIDTH/2/GC.TILEWIDTH + gameStateObj.cameraOffset.get_x() - 1: # If cursor is right
if self.tile_left:
self.tile_left = False
self.tile_info_offset = self.tile_info_disp.get_width()
surf.blit(self.tile_info_disp, (5 - self.tile_info_offset, GC.WINHEIGHT - self.tile_info_disp.get_height() - 3)) # Bottomleft
else:
if not self.tile_left:
self.tile_left = True
self.tile_info_offset = self.tile_info_disp.get_width()
pos = (GC.WINWIDTH - self.tile_info_disp.get_width() - 5 + self.tile_info_offset, GC.WINHEIGHT - self.tile_info_disp.get_height() - 3)
surf.blit(self.tile_info_disp, pos) # Bottomright
if self.obj_info_disp:
# Should be in topright, unless the cursor is in the topright
# TopRight - I believe this has RIGHT precedence
if self.position[1] < GC.WINHEIGHT/2/GC.TILEHEIGHT + gameStateObj.cameraOffset.get_y() - 1 and \
gameStateObj.cursor.position[0] > GC.WINWIDTH/2/GC.TILEWIDTH + gameStateObj.cameraOffset.get_x() - 1:
# Gotta place in bottomright, because cursor is in topright
if self.obj_top:
self.obj_top = False
self.obj_info_offset = self.obj_info_disp.get_width()
pos = (GC.WINWIDTH - GC.TILEWIDTH/4 + self.obj_info_offset - self.obj_info_disp.get_width(),
GC.WINHEIGHT - GC.TILEHEIGHT/4 - self.obj_info_disp.get_height())
surf.blit(self.obj_info_disp, pos) # Should be bottom right
else:
# Place in topright
if not self.obj_top:
self.obj_top = True
self.obj_info_offset = self.obj_info_disp.get_width()
surf.blit(self.obj_info_disp, (GC.WINWIDTH - GC.TILEWIDTH/4 + self.obj_info_offset - self.obj_info_disp.get_width(), 1))
def take_input(self, eventList, gameStateObj):
if not self.fake:
self.fluid_helper.update(gameStateObj)
# Handle cursor movement
self.handleMovement(gameStateObj)
def update(self, gameStateObj):
self.currentHoveredUnit = gameStateObj.grid_manager.get_unit_node(self.position)
if not self.drawState:
self.remove_unit_display()
self.fluid_helper.update_speed(cf.OPTIONS['Cursor Speed'])
if gameStateObj.stateMachine.getState() == 'prep_formation_select':
if 'Formation' in gameStateObj.map.tile_info_dict[self.position]:
self.image = Engine.subsurface(self.formationsprite, (0, 0, GC.TILEWIDTH*2, GC.TILEHEIGHT*2))
else:
self.image = Engine.subsurface(self.formationsprite, (GC.CURSORSPRITECOUNTER.count/2*GC.TILEWIDTH*2, 0, GC.TILEWIDTH*2, GC.TILEHEIGHT*2))
elif self.drawState == 2 and gameStateObj.stateMachine.getState() != 'dialogue': # Red if it is selecting...
self.image = Engine.subsurface(self.redsprite, (GC.CURSORSPRITECOUNTER.count*GC.TILEWIDTH*2, 0, GC.TILEWIDTH*2, GC.TILEHEIGHT*2))
elif self.currentHoveredUnit and self.currentHoveredUnit.team == 'player' and not self.currentHoveredUnit.isDone():
self.image = self.activesprite
else:
self.image = Engine.subsurface(self.passivesprite, (GC.CURSORSPRITECOUNTER.count*GC.TILEWIDTH*2, 0, GC.TILEWIDTH*2, GC.TILEHEIGHT*2))
# === GENERIC HIGHLIGHT OBJECT ===================================
class Highlight(object):
def __init__(self, sprite):
self.sprite = sprite
self.image = Engine.subsurface(self.sprite, (0, 0, GC.TILEWIDTH, GC.TILEHEIGHT)) # First image
def draw(self, surf, position, updateIndex, transition):
updateIndex = int(updateIndex) # Confirm int
rect = (updateIndex*GC.TILEWIDTH + transition, transition, GC.TILEWIDTH - transition, GC.TILEHEIGHT - transition)
self.image = Engine.subsurface(self.sprite, rect)
x, y = position
topleft = x * GC.TILEWIDTH, y * GC.TILEHEIGHT
surf.blit(self.image, topleft)
# === HIGHLIGHT MANAGER ===========================================
class HighlightController(object):
def __init__(self):
self.types = {'spell': [Highlight(GC.IMAGESDICT['GreenHighlight']), 7],
'spell2': [Highlight(GC.IMAGESDICT['GreenHighlight']), 7],
'attack': [Highlight(GC.IMAGESDICT['RedHighlight']), 7],
'splash': [Highlight(GC.IMAGESDICT['LightRedHighlight']), 7],
'possible_move': [Highlight(GC.IMAGESDICT['LightBlueHighlight']), 7],
'move': [Highlight(GC.IMAGESDICT['BlueHighlight']), 7],
'aura': [Highlight(GC.IMAGESDICT['LightPurpleHighlight']), 7],
'spell_splash': [Highlight(GC.IMAGESDICT['LightGreenHighlight']), 7]}
self.highlights = {t: set() for t in self.types.keys()}
self.lasthighlightUpdate = 0
self.updateIndex = 0
self.current_hover = None
def add_highlight(self, position, name, allow_overlap=False):
if not allow_overlap:
for t in self.types.keys():
self.highlights[t].discard(position)
self.highlights[name].add(position)
self.types[name][1] = 7 # Reset transitions
def remove_highlights(self, name=None):
if name in self.types:
self.highlights[name] = set()
self.types[name][1] = 7 # Reset transitions
else:
self.highlights = {t: set() for t in self.types.keys()}
# Reset transitions
for hl_name in self.types:
self.types[hl_name][1] = 7
self.current_hover = None
def remove_aura_highlights(self):
self.highlights['aura'] = set()
def update(self):
self.updateIndex += .25
if self.updateIndex >= 16:
self.updateIndex = 0
def draw(self, surf):
for name in self.highlights.keys():
transition = self.types[name][1]
if transition > 0:
transition -= 1
self.types[name][1] = transition
for pos in self.highlights[name]:
self.types[name][0].draw(surf, pos, self.updateIndex, transition)
def check_arrow(self, pos):
if pos in self.highlights['move']:
return True
return False
def handle_hover(self, gameStateObj):
cur_hover = gameStateObj.cursor.getHoveredUnit(gameStateObj)
if self.current_hover and (not cur_hover or cur_hover != self.current_hover):
self.remove_highlights()
# self.current_hover.remove_aura_highlights(gameStateObj)
if cur_hover and cur_hover != self.current_hover:
ValidMoves = cur_hover.getValidMoves(gameStateObj)
if cur_hover.getMainSpell():
cur_hover.displayExcessSpellAttacks(gameStateObj, ValidMoves, light=True)
if cur_hover.getMainWeapon():
cur_hover.displayExcessAttacks(gameStateObj, ValidMoves, light=True)
cur_hover.displayMoves(gameStateObj, ValidMoves, light=True)
cur_hover.add_aura_highlights(gameStateObj)
self.current_hover = cur_hover
# === BOUNDARY MANAGER ============================================
class BoundaryManager(object):
def __init__(self, tilemap):
self.types = {'attack': GC.IMAGESDICT['RedBoundary'],
'all_attack': GC.IMAGESDICT['PurpleBoundary'],
'spell': GC.IMAGESDICT['GreenBoundary'],
'all_spell': GC.IMAGESDICT['BlueBoundary']}
self.gridHeight = tilemap.height
self.gridWidth = tilemap.width
self.grids = {'attack': self.init_grid(),
'spell': self.init_grid(),
'movement': self.init_grid()}
self.dictionaries = {'attack': {},
'spell': {},
'movement': {}}
self.order = ['all_spell', 'all_attack', 'spell', 'attack']
self.draw_flag = False
self.all_on_flag = False
self.displaying_units = set()
self.surf = None
def init_grid(self):
cells = []
for x in range(self.gridWidth):
for y in range(self.gridHeight):
cells.append(set())
return cells
def check_bounds(self, pos):
if pos[0] >= 0 and pos[1] >= 0 and pos[0] < self.gridWidth and pos[1] < self.gridHeight:
return True
return False
def toggle_unit(self, unit, gameStateObj):
if unit.id in self.displaying_units:
self.displaying_units.discard(unit.id)
unit.flickerRed = False
# self.remove_unit(unit, gameStateObj)
else:
self.displaying_units.add(unit.id)
unit.flickerRed = True
# self.add_unit(unit, gameStateObj)
self.surf = None
def _set(self, positions, kind, u_id):
this_grid = self.grids[kind]
self.dictionaries[kind][u_id] = set()
for pos in positions:
this_grid[pos[0] * self.gridHeight + pos[1]].add(u_id)
self.dictionaries[kind][u_id].add(pos)
# self.print_grid(kind)
def clear(self, kind=False):
if kind:
kinds = [kind]
else:
kinds = self.grids.keys()
for k in kinds:
for x in range(self.gridWidth):
for y in range(self.gridHeight):
self.grids[k][x * self.gridHeight + y] = set()
self.surf = None
def _add_unit(self, unit, gameStateObj):
ValidMoves = unit.getValidMoves(gameStateObj, force=True)
ValidAttacks, ValidSpells = [], []
if unit.getMainWeapon():
ValidAttacks = unit.getExcessAttacks(gameStateObj, ValidMoves, boundary=True)
if unit.getMainSpell():
ValidSpells = unit.getExcessSpellAttacks(gameStateObj, ValidMoves, boundary=True)
self._set(ValidAttacks, 'attack', unit.id)
self._set(ValidSpells, 'spell', unit.id)
# self._set(ValidMoves, 'movement', unit.id)
area_of_influence = Utility.find_manhattan_spheres(range(1, unit.stats['MOV'] + 1), unit.position)
area_of_influence = {pos for pos in area_of_influence if gameStateObj.map.check_bounds(pos)}
self._set(area_of_influence, 'movement', unit.id)
# print(unit.name, unit.position, unit.klass, unit.event_id)
self.surf = None
def _remove_unit(self, unit, gameStateObj):
for kind, grid in self.grids.iteritems():
if unit.id in self.dictionaries[kind]:
for (x, y) in self.dictionaries[kind][unit.id]:
grid[x * self.gridHeight + y].discard(unit.id)
self.surf = None
def leave(self, unit, gameStateObj):
if unit.team.startswith('enemy'):
self._remove_unit(unit, gameStateObj)
# Update ranges of other units that might be affected by my leaving
if unit.position:
x, y = unit.position
other_units = gameStateObj.get_unit_from_id(self.grids['movement'][x * self.gridHeight + y])
# other_units = set()
# for key, grid in self.grids.iteritems():
# What other units were affecting that position -- only enemies can affect position
# other_units |= gameStateObj.get_unit_from_id(grid[x * self.gridHeight + y])
other_units = {other_unit for other_unit in other_units if not gameStateObj.compare_teams(unit.team, other_unit.team)}
for other_unit in other_units:
self._remove_unit(other_unit, gameStateObj)
for other_unit in other_units:
self._add_unit(other_unit, gameStateObj)
def arrive(self, unit, gameStateObj):
if unit.position:
if unit.team.startswith('enemy'):
self._add_unit(unit, gameStateObj)
# Update ranges of other units that might be affected by my arrival
x, y = unit.position
other_units = gameStateObj.get_unit_from_id(self.grids['movement'][x * self.gridHeight + y])
# other_units = set()
# for key, grid in self.grids.iteritems():
# What other units were affecting that position -- only enemies can affect position
# other_units |= gameStateObj.get_unit_from_id(grid[x * self.gridHeight + y])
other_units = {other_unit for other_unit in other_units if not gameStateObj.compare_teams(unit.team, other_unit.team)}
# print([(other_unit.name, other_unit.position, other_unit.event_id, other_unit.klass, x, y) for other_unit in other_units])
for other_unit in other_units:
self._remove_unit(other_unit, gameStateObj)
for other_unit in other_units:
self._add_unit(other_unit, gameStateObj)
# Called when map changes
def reset(self, gameStateObj):
self.clear()
for unit in gameStateObj.allunits:
if unit.position and unit.team.startswith('enemy'):
self._add_unit(unit, gameStateObj)
"""
# Deprecated
# Called when map changes
def reset_pos(self, pos_group, gameStateObj):
other_units = set()
for key, grid in self.grids.iteritems():
# What other units are affecting those positions -- need to check every grid because line of sight might change
for (x, y) in pos_group:
other_units |= gameStateObj.get_unit_from_id(grid[x * self.gridHeight + y])
for other_unit in other_units:
self._remove_unit(other_unit, gameStateObj)
for other_unit in other_units:
self._add_unit(other_unit, gameStateObj)
"""
def toggle_all_enemy_attacks(self, gameStateObj):
if self.all_on_flag:
self.clear_all_enemy_attacks(gameStateObj)
else:
self.show_all_enemy_attacks(gameStateObj)
def show_all_enemy_attacks(self, gameStateObj):
self.all_on_flag = True
self.surf = None
def clear_all_enemy_attacks(self, gameStateObj):
self.all_on_flag = False
self.surf = None
def draw(self, surf, (width, height)):
if self.draw_flag:
if not self.surf:
self.surf = Engine.create_surface((width, height), transparent=True)
for grid_name in self.order:
if grid_name == 'attack' and not self.displaying_units:
continue
elif grid_name == 'spell' and not self.displaying_units:
continue
elif grid_name == 'all_attack' and not self.all_on_flag:
continue
elif grid_name == 'all_spell' and not self.all_on_flag:
continue
if grid_name == 'all_attack' or grid_name == 'attack':
grid = self.grids['attack']
else:
grid = self.grids['spell']
for y in range(self.gridHeight):
for x in range(self.gridWidth):
cell = grid[x * self.gridHeight + y]
if cell:
display = any(u_id in self.displaying_units for u_id in cell) if self.displaying_units else False
# print(x, y, cell, display)
# If there's one above this
if grid_name == 'all_attack' and display:
continue
if grid_name == 'all_spell' and display:
continue
if grid_name == 'attack' and not display:
continue
if grid_name == 'spell' and not display:
continue
image = self.get_image(grid, x, y, grid_name)
topleft = x * GC.TILEWIDTH, y * GC.TILEHEIGHT
self.surf.blit(image, topleft)
# else:
# print('- '),
# print('\n'),
surf.blit(self.surf, (0, 0))
def get_image(self, grid, x, y, grid_name):
top_pos = (x, y - 1)
left_pos = (x - 1, y)
right_pos = (x + 1, y)
bottom_pos = (x, y + 1)
if grid_name == 'all_attack' or grid_name == 'all_spell':
top = bool(grid[x * self.gridHeight + y - 1]) if self.check_bounds(top_pos) else False
left = bool(grid[(x - 1) * self.gridHeight + y]) if self.check_bounds(left_pos) else False
right = bool(grid[(x + 1) * self.gridHeight + y]) if self.check_bounds(right_pos) else False
bottom = bool(grid[x * self.gridHeight + y + 1]) if self.check_bounds(bottom_pos) else False
else:
top = any(u_id in self.displaying_units for u_id in grid[x * self.gridHeight + y - 1]) if self.check_bounds(top_pos) else False
left = any(u_id in self.displaying_units for u_id in grid[(x - 1) * self.gridHeight + y]) if self.check_bounds(left_pos) else False
right = any(u_id in self.displaying_units for u_id in grid[(x + 1) * self.gridHeight + y]) if self.check_bounds(right_pos) else False
bottom = any(u_id in self.displaying_units for u_id in grid[x * self.gridHeight + y + 1]) if self.check_bounds(bottom_pos) else False
index = top*8 + left*4 + right*2 + bottom # Binary logic to get correct index
# print(str(index) + ' '),
return Engine.subsurface(self.types[grid_name], (index*GC.TILEWIDTH, 0, GC.TILEWIDTH, GC.TILEHEIGHT))
def print_grid(self, grid_name):
for y in range(self.gridHeight):
for x in range(self.gridWidth):
cell = self.grids[grid_name][x * self.gridHeight + y]
if cell:
print(cell),
else:
print('- '),
print('\n'),
# === GENERIC ARROW OBJECT ===================================================
class ArrowObject(object):
sprite = GC.IMAGESDICT['MovementArrows']
def __init__(self, index, position):
rindex, cindex = index
left = 1+((GC.TILEWIDTH+2)*cindex)+(1*int(cindex/2))
top = 1+((GC.TILEHEIGHT+2)*rindex)
self.image = Engine.subsurface(self.sprite, (left, top, GC.TILEWIDTH, GC.TILEHEIGHT))
self.position = position
def draw(self, surf):
x, y = self.position
topleft = x * GC.TILEWIDTH, y * GC.TILEHEIGHT
surf.blit(self.image, topleft)
# === GENERIC ANIMATION OBJECT ===================================
# for miss and no damage animations
class Animation(object):
def __init__(self, sprite, position, frames, total_num_frames=None, animation_speed=75,
loop=False, hold=False, ignore_map=False, start_time=0, on=True, set_timing=None):
self.sprite = sprite
self.position = position
self.frame_x = frames[0]
self.frame_y = frames[1]
self.total_num_frames = total_num_frames if total_num_frames else self.frame_x * self.frame_y
self.frameCount = 0
self.animation_speed = animation_speed
self.loop = loop
self.hold = hold
self.start_time = start_time
self.on = on
self.tint = False
self.ignore_map = ignore_map # Whether the position of the Animation sould be relative to the map
self.lastUpdate = Engine.get_time()
self.set_timing = set_timing
if self.set_timing:
assert len([timing for timing in self.set_timing if timing > 0]) == self.total_num_frames, \
'%s %s'%(len(self.set_timing), len(self.total_num_frames))
self.timing_count = -1
self.indiv_width, self.indiv_height = self.sprite.get_width()/self.frame_x, self.sprite.get_height()/self.frame_y
self.image = Engine.subsurface(self.sprite, (0, 0, self.indiv_width, self.indiv_height))
def draw(self, surf, gameStateObj=None, blend=None):
if self.on and self.frameCount >= 0 and Engine.get_time() > self.start_time:
# The animation is too far to the right. Must move left. (" - 32")
image = self.image
x, y = self.position
if self.ignore_map:
topleft = x, y
else:
topleft = (x-gameStateObj.cameraOffset.x-1)*GC.TILEWIDTH, (y-gameStateObj.cameraOffset.y)*GC.TILEHEIGHT
if blend:
image = Image_Modification.change_image_color(image, blend)
if self.tint:
Engine.blit(surf, image, topleft, image.get_rect(), Engine.BLEND_RGB_ADD)
else:
surf.blit(image, topleft)
def update(self, gameStateObj=None):
currentTime = Engine.get_time()
if self.on and currentTime > self.start_time:
# If this animation has every frame's count defined
if self.set_timing:
num_frames = self.set_timing[self.frameCount]
# If you get a -1 on set timing, switch to blend tint
while num_frames < 0:
self.tint = not self.tint
self.frameCount += 1
num_frames = self.set_timing[self.frameCount]
self.timing_count += 1
if self.timing_count >= num_frames:
self.timing_count = 0
self.frameCount += 1
if self.frameCount >= self.total_num_frames:
if self.loop:
self.frameCount = 0
elif self.hold:
self.frameCount = self.total_num_frames - 1
else:
if gameStateObj and self in gameStateObj.allanimations:
gameStateObj.allanimations.remove(self)
return True
if self.frameCount >= 0:
rect = (self.frameCount%self.frame_x * self.indiv_width, self.frameCount/self.frame_x * self.indiv_height,
self.indiv_width, self.indiv_height)
self.image = Engine.subsurface(self.sprite, rect)
# Otherwise
elif currentTime - self.lastUpdate > self.animation_speed:
self.frameCount += int((currentTime - self.lastUpdate)/self.animation_speed) # 1
self.lastUpdate = currentTime
if self.frameCount >= self.total_num_frames:
if self.loop: # Reset framecount
self.frameCount = 0
elif self.hold:
self.frameCount = self.total_num_frames - 1 # Hold on last frame
else:
if gameStateObj and self in gameStateObj.allanimations:
gameStateObj.allanimations.remove(self)
return True
if self.frameCount >= 0:
rect = (self.frameCount%self.frame_x * self.indiv_width, self.frameCount/self.frame_x * self.indiv_height,
self.indiv_width, self.indiv_height)
self.image = Engine.subsurface(self.sprite, rect)
# === PHASE OBJECT ============================================================
class Phase(object):
def __init__(self, gameStateObj):
self.phase_in = []
self.phase_in.append(PhaseIn('player', 'PlayerTurnBanner', 800))
self.phase_in.append(PhaseIn('enemy', 'EnemyTurnBanner', 800))
self.phase_in.append(PhaseIn('enemy2', 'Enemy2TurnBanner', 800))
self.phase_in.append(PhaseIn('other', 'OtherTurnBanner', 800))
self.order = ('player', 'enemy', 'enemy2', 'other')
self.current = 3 if gameStateObj.turncount == 0 else 0
self.previous = 0
def get_current_phase(self):
return self.order[self.current]
def get_previous_phase(self):
return self.order[self.previous]
def _next(self):
self.current += 1
if self.current >= len(self.order):
self.current = 0
def next(self, gameStateObj):
self.previous = self.current
# Actually change phase
if gameStateObj.allunits:
self._next()
while not any(self.get_current_phase() == unit.team for unit in gameStateObj.allunits if unit.position) \
and self.current != 0: # Also, never skip player phase
self._next()
else:
self.current = 0 # If no units at all, just default to player phase?
def slide_in(self, gameStateObj):
self.phase_in[self.current].begin(gameStateObj)
def update(self):
return self.phase_in[self.current].update()
def draw(self, surf):
self.phase_in[self.current].draw(surf)
class PhaseIn(object):
def __init__(self, name, spritename, display_time):
self.name = name
self.spritename = spritename
self.loadSprites()
self.display_time = display_time
self.topleft = ((GC.WINWIDTH - self.image.get_width())/2, (GC.WINHEIGHT - self.image.get_height())/2)
self.start_time = None # Don't define it here. Define it at first update
def loadSprites(self):
self.image = GC.IMAGESDICT[self.spritename]
self.transition = GC.IMAGESDICT['PhaseTransition'] # The Black Squares that happen during a phase transition
self.transition_size = (16, 16)
def removeSprites(self):
self.image = None
self.transition = None
def update(self):
if Engine.get_time() - self.start_time >= self.display_time:
return True
else:
return False
def begin(self, gameStateObj):
currentTime = Engine.get_time()
GC.SOUNDDICT['Next Turn'].play()
if self.name == 'player':
# Keeps track of where units started their turns (mainly)
for unit in gameStateObj.allunits:
unit.previous_position = unit.position
# Set position over leader lord
if cf.OPTIONS['Autocursor']:
gameStateObj.cursor.autocursor(gameStateObj)
else: # Set position to where it was when we ended turn
gameStateObj.cursor.setPosition(gameStateObj.statedict['previous_cursor_position'], gameStateObj)
self.start_time = currentTime
def draw(self, surf):
currentTime = Engine.get_time()
time_passed = currentTime - self.start_time
if cf.OPTIONS['debug'] and time_passed < 0:
logger.error('This phase has a negative time_passed! %s %s %s', time_passed, currentTime, self.start_time)
max_opaque = 160
# Blit the banner
# position
if time_passed < 100:
offset = self.topleft[0] + 100 - time_passed
trans = 100 - time_passed
elif time_passed > self.display_time - 100:
offset = self.topleft[0] + self.display_time - 100 - time_passed
trans = -(self.display_time - 100 - time_passed)
else:
offset = self.topleft[0]
trans = 0
# transparency
image = Image_Modification.flickerImageTranslucent(self.image.copy(), trans)
surf.blit(image, (offset, self.topleft[1]))
# === Handle the transition
most_dark_surf = Engine.subsurface(self.transition, (8*self.transition_size[0], 0, self.transition_size[0], self.transition_size[1])).copy()
# If we're in the first half
if time_passed < self.display_time/2:
transition_space = Engine.create_surface((GC.WINWIDTH, GC.WINHEIGHT/2 - 75/2 + time_passed/(self.display_time/2/20)), transparent=True)
# Make more transparent based on time.
alpha = int(max_opaque * time_passed/float(self.display_time/2))
Engine.fill(most_dark_surf, (255, 255, 255, alpha), None, Engine.BLEND_RGBA_MULT)
# If we're in the second half
else:
# Clamp time_passed at display time
time_passed = min(self.display_time, time_passed)
pos = (GC.WINWIDTH, GC.WINHEIGHT/2 - 75/2 + 40/2 - (time_passed - self.display_time/2)/(self.display_time/2/20))
transition_space = Engine.create_surface(pos, transparent=True)
# Make less transparent based on time.
alpha = int(max_opaque - max_opaque*(time_passed - self.display_time/2)/float(self.display_time/2))
alpha = min(255, max(0, alpha))
Engine.fill(most_dark_surf, (255, 255, 255, alpha), None, Engine.BLEND_RGBA_MULT)
# transition_space.convert_alpha()
# Tile
for x in range(0, transition_space.get_width(), 16):
for y in range(0, transition_space.get_height(), 16):
transition_space.blit(most_dark_surf, (x, y))
# Now blit transition space
surf.blit(transition_space, (0, 0))
# Other transition_space
surf.blit(transition_space, (0, GC.WINHEIGHT - transition_space.get_height()))
# === WEAPON TRIANGLE OBJECT ==================================================
class Weapon_Triangle(object):
def __init__(self, fp):
self.types = []
self.advantage = {}
self.disadvantage = {}
self.type_to_index = {}
self.index_to_type = {}
self.magic_types = []
self.parse_file(fp)
def number(self):
return len(self.types)
def parse_file(self, fp):
lines = []
with open(fp) as w_fp:
lines = w_fp.readlines()
for index, line in enumerate(lines):
split_line = line.strip().split(';')
name = split_line[0]
advantage = split_line[1].split(',')
disadvantage = split_line[2].split(',')
magic = True if split_line[3] == 'M' else False
# Ascend
self.types.append(name)
self.type_to_index[name] = index
self.index_to_type[index] = name
self.advantage[name] = advantage
self.disadvantage[name] = disadvantage
if magic:
self.magic_types.append(name)
self.type_to_index['Consumable'] = len(lines)
self.index_to_type[len(lines)] = 'Consumable'
def compute_advantage(self, weapon1, weapon2):
""" Returns two-tuple describing advantage """
if not weapon1 and not weapon2:
return (0, 0) # If either does not have a weapon, neither has advantage
if not weapon1:
return (0, 2)
if not weapon2:
return (2, 0)
weapon1_advantage, weapon2_advantage = 0, 0
for weapon1_type in weapon1.TYPE:
for weapon2_type in weapon2.TYPE:
if weapon2_type in self.advantage[weapon1_type]:
weapon1_advantage += 1
if weapon2_type in self.disadvantage[weapon1_type]:
weapon1_advantage -= 1
if weapon1_type in self.advantage[weapon2_type]:
weapon2_advantage += 1
if weapon1_type in self.disadvantage[weapon2_type]:
weapon2_advantage -= 1
# Handle reverse (reaver) weapons
if weapon1.reverse or weapon2.reverse:
return (-2*weapon1_advantage, -2*weapon2_advantage)
else:
return (weapon1_advantage, weapon2_advantage)
def isMagic(self, item):
if item.magic or item.magic_at_range or any(w_type in self.magic_types for w_type in item.TYPE):
return True
return False
class Weapon_Exp(object):
def __init__(self, fp):
self.wexp_dict = {}
self.sorted_list = []
self.parse_file(fp)
def parse_file(self, fp):
lines = []
with open(fp) as w_fp:
lines = w_fp.readlines()
for index, line in enumerate(lines):
split_line = line.strip().split(';')
letter = split_line[0]
number = int(split_line[1])
self.wexp_dict[letter] = number
self.sorted_list = sorted(self.wexp_dict.items(), key=lambda x: x[1])
def number_to_letter(self, wexp):
current_letter = "--"
for letter, number in self.sorted_list:
if wexp >= number:
current_letter = letter
else:
break
return current_letter
# Returns a float between 0 and 1 desribing how closes number is to next tier from previous tier
def percentage(self, wexp):
current_percentage = 0.0
# print(wexp, self.sorted_list)
for index, (letter, number) in enumerate(self.sorted_list):
if index + 1 >= len(self.sorted_list):
current_percentage = 1.0
break
elif wexp >= number:
difference = float(self.sorted_list[index+1][1] - number)
if wexp - number >= difference:
continue
current_percentage = (wexp - number)/difference
# print('WEXP', wexp, number, difference, current_percentage)
break
return current_percentage
# === SAVESLOTS ===============================================================
class SaveSlot(object):
def __init__(self, metadata_fp, number):
self.no_name = '--NO DATA--'
self.name = self.no_name
self.playtime = 0
self.realtime = 0
self.kind = None # Prep, Base, Suspend, Battle, Start
self.number = number
self.metadata_fp = metadata_fp
self.true_fp = metadata_fp[:-4]
self.read()
def read(self):
try:
if os.path.exists(self.metadata_fp):
with open(self.metadata_fp, 'rb') as loadFile:
save_metadata = pickle.load(loadFile)
self.name = save_metadata['name']
self.playtime = save_metadata['playtime']
self.realtime = save_metadata['realtime']
self.kind = save_metadata['kind']
except ValueError as e:
print('***Value Error: %s' % (e))
except ImportError as e:
print('***Import Error: %s' % (e))
except TypeError as e:
print('***Type Error: %s' % (e))
except KeyError as e:
print('***Key Error: %s' % (e))
except IOError as e:
print('***IO Error: %s' % (e))
def get_name(self):
return self.name + (' - ' + self.kind if self.kind else '')
def loadGame(self):
with open(self.true_fp, 'rb') as loadFile:
saveObj = pickle.load(loadFile)
return saveObj
# === MAPSELECTHELPER =========================================================
class MapSelectHelper(object):
def __init__(self, pos_list):
self.pos_list = pos_list
# For a given position, determine which position in self.pos_list is closest
def get_closest(self, position):
min_distance, closest = 100, None
for pos in self.pos_list:
dist = Utility.calculate_distance(pos, position)
if dist < min_distance:
closest = pos
min_distance = dist
return closest
# For a given position, determine which position in self.pos_list is the closest position in the downward direction
def get_down(self, position):
min_distance, closest = 100, None
for pos in self.pos_list:
if pos[1] > position[1]: # If further down than the position
dist = Utility.calculate_distance(pos, position)
if dist < min_distance:
closest = pos
min_distance = dist
if closest is None: # Nothing was found in the down direction
# Just find the closest
closest = self.get_closest(position)
return closest
def get_up(self, position):
min_distance, closest = 100, None
for pos in self.pos_list:
if pos[1] < position[1]: # If further up than the position
dist = Utility.calculate_distance(pos, position)
if dist < min_distance:
closest = pos
min_distance = dist
if closest is None: # Nothing was found in the down direction
# Just find the closest
closest = self.get_closest(position)
return closest
def get_right(self, position):
min_distance, closest = 100, None
for pos in self.pos_list:
if pos[0] > position[0]: # If further right than the position
dist = Utility.calculate_distance(pos, position)
if dist < min_distance:
closest = pos
min_distance = dist
if closest is None: # Nothing was found in the down direction
# Just find the closest
closest = self.get_closest(position)
return closest
def get_left(self, position):
min_distance, closest = 100, None
for pos in self.pos_list:
if pos[0] < position[0]: # If further left than the position
dist = Utility.calculate_distance(pos, position)
if dist < min_distance:
closest = pos
min_distance = dist
if closest is None: # Nothing was found in the down direction
# Just find the closest
closest = self.get_closest(position)
return closest
class CameraOffset(object):
def __init__(self, x, y):
# Where the camera is supposed to be
self.x = x
self.y = y
# Where the camera actually is
self.current_x = x
self.current_y = y
# Where the camera was
self.old_x = x
self.old_y = y
self.speed = 6.0 # Linear.
self.pan_flag = False
self.pan_to = []
def set_x(self, x):
self.x = x
self.old_x = x
def set_y(self, y):
self.y = y
self.old_y = y
def force_x(self, x):
self.current_x = self.x = x
def force_y(self, y):
self.current_y = self.y = y
def set_xy(self, x, y):
self.x = x
self.y = y
self.old_x = x
self.old_y = y
def get_xy(self):
return (self.current_x, self.current_y)
def get_x(self):
return self.current_x
def get_y(self):
return self.current_y
def center2(self, old, new):
x1, y1 = old
x2, y2 = new
# logger.debug('Camera Center: %s %s %s %s', (x1, y1), (x2, y2), self.x, self.y)
max_x = max(x1, x2)
max_y = max(y1, y2)
min_x = min(x1, x2)
min_y = min(y1, y2)
if self.x > min_x - 4 or self.x + GC.TILEX < max_x + 4 or self.y > min_y - 3 or self.y + GC.TILEY < max_y + 3:
self.x = (max_x + min_x)/2 - GC.TILEX/2
self.y = (max_y + min_y)/2 - GC.TILEY/2
# logger.debug('New Camera: %s %s', self.x, self.y)
def check_loc(self):
# logger.debug('Camera %s %s %s %s', self.current_x, self.current_y, self.x, self.y)
if not self.pan_to and self.current_x == self.x and self.current_y == self.y:
self.pan_flag = False
return True
return False
def map_pan(self, tile_map, cursor_pos):
corners = [(0, 0), (0, tile_map.height - 1), (tile_map.width - 1, tile_map.height - 1), (tile_map.width - 1, 0)]
distance = [Utility.calculate_distance(cursor_pos, corner) for corner in corners]
closest_corner, idx = min((val, idx) for (idx, val) in enumerate(distance))
# print(self.current_x, self.current_y)
# print(corners, distance, closest_corner, idx)
self.pan_to = corners[idx:] + corners[:idx]
# print(self.pan_to)
def update(self, gameStateObj):
gameStateObj.set_camera_limits()
if self.current_x != self.x:
if self.current_x > self.x:
self.current_x -= 0.125 if self.pan_flag else (self.current_x - self.x)/self.speed
elif self.current_x < self.x:
self.current_x += 0.125 if self.pan_flag else (self.x - self.current_x)/self.speed
if self.current_y != self.y:
if self.current_y > self.y:
self.current_y -= 0.125 if self.pan_flag else (self.current_y - self.y)/self.speed
elif self.current_y < self.y:
self.current_y += 0.125 if self.pan_flag else (self.y - self.current_y)/self.speed
# If they are close enough, make them so.
if abs(self.current_x - self.x) < 0.125:
self.current_x = self.x
if abs(self.current_y - self.y) < 0.125:
self.current_y = self.y
# Move to next place on the list
if self.pan_to and self.current_y == self.y and self.current_x == self.x:
self.x, self.y = self.pan_to.pop()
# Make sure current_x and current_y do not go off screen
if self.current_x < 0:
self.current_x = 0
elif self.current_x > (gameStateObj.map.width - GC.TILEX): # Need this minus to account for size of screen
self.current_x = (gameStateObj.map.width - GC.TILEX)
if self.current_y < 0:
self.current_y = 0
elif self.current_y > (gameStateObj.map.height - GC.TILEY):
self.current_y = (gameStateObj.map.height - GC.TILEY)
# logger.debug('Camera %s %s %s %s', self.current_x, self.current_y, self.x, self.y)
class Objective(object):
def __init__(self, display_name, win_condition, loss_condition):
self.display_name_string = display_name
self.win_condition_string = win_condition
self.loss_condition_string = loss_condition
self.connectives = ['OR', 'AND']
self.removeSprites()
def removeSprites(self):
# For drawing
self.BGSurf = None
self.surf_width = 0
self.num_lines = 0
def serialize(self):
return (self.display_name_string, self.win_condition_string, self.loss_condition_string)
@classmethod
def deserialize(cls, info):
return cls(info[0], info[1], info[2])
def eval_string(self, text, gameStateObj):
# Parse evals
to_evaluate = re.findall(r'\{[^}]*\}', text)
evaluated = []
for evaluate in to_evaluate:
evaluated.append(str(eval(evaluate[1:-1])))
for index in range(len(to_evaluate)):
text = text.replace(to_evaluate[index], evaluated[index])
return text
def split_string(self, text):
return text.split(',')
def get_size(self, text_lines):
longest_surf_width = 0
for line in text_lines:
guess = GC.FONT['text_white'].size(line)[0]
if guess > longest_surf_width:
longest_surf_width = guess
return longest_surf_width
# Mini-Objective that shows up in free state
def draw(self, gameStateObj):
text_lines = self.split_string(self.eval_string(self.display_name_string, gameStateObj))
longest_surf_width = self.get_size(text_lines)
if longest_surf_width != self.surf_width or len(text_lines) != self.num_lines:
self.num_lines = len(text_lines)
self.surf_width = longest_surf_width
surf_height = 16 * self.num_lines + 8
# Blit background
BGSurf = MenuFunctions.CreateBaseMenuSurf((self.surf_width + 16, surf_height), 'BaseMenuBackgroundOpaque')
if self.num_lines == 1:
BGSurf.blit(GC.IMAGESDICT['Shimmer1'], (BGSurf.get_width() - 1 - GC.IMAGESDICT['Shimmer1'].get_width(), 4))
elif self.num_lines == 2:
BGSurf.blit(GC.IMAGESDICT['Shimmer2'], (BGSurf.get_width() - 1 - GC.IMAGESDICT['Shimmer2'].get_width(), 4))
self.BGSurf = Engine.create_surface((BGSurf.get_width(), BGSurf.get_height() + 3), transparent=True, convert=True)
self.BGSurf.blit(BGSurf, (0, 3))
gem = GC.IMAGESDICT['BlueCombatGem']
self.BGSurf.blit(gem, (BGSurf.get_width()/2 - gem.get_width()/2, 0))
# Now make translucent
self.BGSurf = Image_Modification.flickerImageTranslucent(self.BGSurf, 20)
temp_surf = self.BGSurf.copy()
for index, line in enumerate(text_lines):
position = temp_surf.get_width()/2 - GC.FONT['text_white'].size(line)[0]/2, 16 * index + 6
GC.FONT['text_white'].blit(line, temp_surf, position)
return temp_surf
def get_win_conditions(self, gameStateObj):
text_list = self.split_string(self.eval_string(self.win_condition_string, gameStateObj))
win_cons = [text for text in text_list if text not in self.connectives]
connectives = [text for text in text_list if text in self.connectives]
return win_cons, connectives
def get_loss_conditions(self, gameStateObj):
text_list = self.split_string(self.eval_string(self.loss_condition_string, gameStateObj))
loss_cons = [text for text in text_list if text not in self.connectives]
connectives = [text for text in text_list if text in self.connectives]
return loss_cons, connectives
# === HANDLES PRESSING INFO AND APPLYING HELP MENU ===========================
def handle_info_key(gameStateObj, metaDataObj, chosen_unit=None, one_unit_only=False, scroll_units=None):
gameStateObj.cursor.currentHoveredUnit = gameStateObj.cursor.getHoveredUnit(gameStateObj)
if chosen_unit:
my_unit = chosen_unit
elif gameStateObj.cursor.currentHoveredUnit:
my_unit = gameStateObj.cursor.currentHoveredUnit
else:
return
GC.SOUNDDICT['Select 1'].play()
gameStateObj.info_menu_struct['one_unit_only'] = one_unit_only
gameStateObj.info_menu_struct['scroll_units'] = scroll_units
gameStateObj.info_menu_struct['chosen_unit'] = my_unit
gameStateObj.stateMachine.changeState('info_menu')
gameStateObj.stateMachine.changeState('transition_out')
# === HANDLES PRESSING AUX ===================================================
def handle_aux_key(gameStateObj):
avail_units = [unit.position for unit in gameStateObj.allunits if unit.team == 'player' and unit.position and not unit.isDone()]
if avail_units:
if handle_aux_key.counter > len(avail_units) - 1:
handle_aux_key.counter = 0
pos = avail_units[handle_aux_key.counter]
GC.SOUNDDICT['Select 4'].play()
gameStateObj.cursor.setPosition(pos, gameStateObj)
# Increment counter
handle_aux_key.counter += 1
# Initialize counter
handle_aux_key.counter = 0
class WeaponIcon(object):
def __init__(self, name=None, idx=None, grey=False):
if name:
self.name = name
self.idx = WEAPON_TRIANGLE.type_to_index[self.name]
else:
self.name = None
self.idx = idx
self.set_grey(grey)
def set_grey(self, grey):
self.grey = grey
self.create_image()
def create_image(self):
# Weapon Icons Pictures
if self.grey:
weaponIcons = GC.ITEMDICT['Gray_Wexp_Icons']
else:
weaponIcons = GC.ITEMDICT['Wexp_Icons']
self.image = Engine.subsurface(weaponIcons, (0, 16*self.idx, 16, 16))
def draw(self, surf, topleft, cooldown=False):
surf.blit(self.image, topleft)
class LevelStatistic(object):
def __init__(self, gameStateObj, metaDataObj):
self.name = metaDataObj['name']
self.turncount = gameStateObj.turncount
self.stats = self.get_records(gameStateObj)
def get_records(self, gameStateObj):
records = {}
for unit in gameStateObj.allunits:
if unit.team == 'player' and not unit.generic_flag:
records[unit.name] = unit.records
return records
@staticmethod
def formula(record):
return record['kills']*cf.CONSTANTS['kill_worth'] + record['damage'] + record['healing']
def get_mvp(self):
tp = 0
current_mvp = 'Ophie'
for unit, record in self.stats.iteritems():
test = self.formula(record)
if test > tp:
tp = test
current_mvp = unit
return current_mvp
WEAPON_TRIANGLE = Weapon_Triangle(Engine.engine_constants['home'] + "Data/weapon_triangle.txt")
WEAPON_EXP = Weapon_Exp(Engine.engine_constants['home'] + "Data/weapon_exp.txt")
| 45.781098 | 154 | 0.579441 | 63,059 | 0.957194 | 0 | 0 | 229 | 0.003476 | 0 | 0 | 9,487 | 0.144006 |
26155a333ec0b9d8dbde784e29edc2aabd3bd42b | 1,707 | py | Python | tests/test_characters.py | uliang/BloodSword | fc7e173ce56989c48009ec86d834072f9f2e70ac | [
"BSD-2-Clause"
] | null | null | null | tests/test_characters.py | uliang/BloodSword | fc7e173ce56989c48009ec86d834072f9f2e70ac | [
"BSD-2-Clause"
] | null | null | null | tests/test_characters.py | uliang/BloodSword | fc7e173ce56989c48009ec86d834072f9f2e70ac | [
"BSD-2-Clause"
] | null | null | null | import pytest
from bloodsword.characters.sage import Sage
from bloodsword.characters.warrior import Warrior
from bloodsword.descriptors.armour import Armour
@pytest.fixture
def warrior():
return Warrior("Warrior", rank=2)
@pytest.fixture
def sage():
return Sage("Sage", rank=2)
def test_character_initialization(warrior, sage):
assert str(
warrior) == "<Name:Warrior Fighting Prowess=8 Psychic Ability=6 Awareness=6 Endurance=12>"
assert str(
sage) == "<Name:Sage Fighting Prowess=7 Psychic Ability=7 Awareness=6 Endurance=10>"
def test_endurance_cannot_exceed_max(warrior):
warrior.endurance = 13
assert warrior.endurance == 12
def test_endurance_increments(warrior):
warrior.endurance = 10
warrior.endurance += 1
assert warrior.endurance == 11
def test_endurance_increments_beyond_max(warrior):
warrior.endurance = 10
warrior.endurance += 5
assert warrior.endurance == 12
def test_attribute_decrements(warrior, sage):
sage.endurance -= 1
assert sage.endurance == 9
warrior.endurance -= 1
assert warrior.endurance == 11
sage.psychic_ability -= 2
assert sage.psychic_ability == 5
def test_attribute_decrement_clips_at_zero(sage, warrior):
sage.psychic_ability -= 10
assert sage.psychic_ability == 0
warrior.endurance -= 20
assert warrior.endurance == 0
def test_that_character_can_only_carry_one_piece_of_armour(warrior):
initial_no_items_carried = len(warrior.items_carried)
new_armour = Armour('ringmail', damage_reduction=2)
warrior.armour = new_armour
assert warrior.armour.damage_reduction == 2
assert len(warrior.items_carried) == initial_no_items_carried
| 25.863636 | 98 | 0.741652 | 0 | 0 | 0 | 0 | 127 | 0.0744 | 0 | 0 | 178 | 0.104277 |
2616d68573a5381dc443c6d189b9ad8fa29013e9 | 201 | py | Python | examples/nod.py | Antoniii/In_Rust_We_Trust | 43513b4a34b2d7e20950db9a0ac811721db06a1a | [
"MIT"
] | null | null | null | examples/nod.py | Antoniii/In_Rust_We_Trust | 43513b4a34b2d7e20950db9a0ac811721db06a1a | [
"MIT"
] | null | null | null | examples/nod.py | Antoniii/In_Rust_We_Trust | 43513b4a34b2d7e20950db9a0ac811721db06a1a | [
"MIT"
] | null | null | null | def nod(x,y):
if y != 0:
return nod(y, x % y)
else:
return x
n1 = int(input("Введите n1: "))
n2 = int(input("Введите n2: "))
print("НОД = ", nod(n1,n2))
print("НОK = ", int((n1*n2)/nod(n1,n2))) | 18.272727 | 40 | 0.547264 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 63 | 0.286364 |
2616fa0e716ad26e2e73aae0033703cf5ccaa90b | 2,417 | py | Python | UML2ER/contracts/HContract03_IsolatedLHS.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 3 | 2017-06-02T19:26:27.000Z | 2021-06-14T04:25:45.000Z | UML2ER/contracts/HContract03_IsolatedLHS.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 8 | 2016-08-24T07:04:07.000Z | 2017-05-26T16:22:47.000Z | UML2ER/contracts/HContract03_IsolatedLHS.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 1 | 2019-10-31T06:00:23.000Z | 2019-10-31T06:00:23.000Z | from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HContract03_IsolatedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HContract03_IsolatedLHS
"""
# Flag this instance as compiled now
self.is_compiled = True
super(HContract03_IsolatedLHS, self).__init__(name='HContract03_IsolatedLHS', num_nodes=0, edges=[])
# Add the edges
self.add_edges([])
# Set the graph attributes
self["mm__"] = ['MT_pre__FamiliesToPersonsMM', 'MoTifRule']
self["MT_constraint__"] = """return True"""
self["name"] = """"""
self["GUID__"] = uuid.uuid3(uuid.NAMESPACE_DNS,'HContract03_IsolatedLHS')
self["equations"] = []
# Set the node attributes
# match class Property(Property) node
self.add_node()
self.vs[0]["MT_pre__attr1"] = """return True"""
self.vs[0]["MT_label__"] = """1"""
self.vs[0]["mm__"] = """MT_pre__Property"""
self.vs[0]["GUID__"] = uuid.uuid3(uuid.NAMESPACE_DNS,'Property')
# match class Class(Class) node
self.add_node()
self.vs[1]["MT_pre__attr1"] = """return True"""
self.vs[1]["MT_label__"] = """2"""
self.vs[1]["mm__"] = """MT_pre__Class"""
self.vs[1]["GUID__"] = uuid.uuid3(uuid.NAMESPACE_DNS,'Class')
# match class Package(Package) node
self.add_node()
self.vs[2]["MT_pre__attr1"] = """return True"""
self.vs[2]["MT_label__"] = """3"""
self.vs[2]["mm__"] = """MT_pre__Package"""
self.vs[2]["GUID__"] = uuid.uuid3(uuid.NAMESPACE_DNS,'Package')
# apply class Feature(Feature) node
self.add_node()
self.vs[3]["MT_pre__attr1"] = """return True"""
self.vs[3]["MT_label__"] = """4"""
self.vs[3]["mm__"] = """MT_pre__Feature"""
self.vs[3]["GUID__"] = uuid.uuid3(uuid.NAMESPACE_DNS,'Feature')
# apply class ERModel(ERModel) node
self.add_node()
self.vs[4]["MT_pre__attr1"] = """return True"""
self.vs[4]["MT_label__"] = """5"""
self.vs[4]["mm__"] = """MT_pre__ERModel"""
self.vs[4]["GUID__"] = uuid.uuid3(uuid.NAMESPACE_DNS,'ERModel')
# define evaluation methods for each apply class.
def eval_attr11(self, attr_value, this):
return True
def eval_attr12(self, attr_value, this):
return True
def eval_attr13(self, attr_value, this):
return True
def eval_attr14(self, attr_value, this):
return True
def eval_attr15(self, attr_value, this):
return True
def constraint(self, PreNode, graph):
return True
| 29.839506 | 102 | 0.679355 | 2,338 | 0.967315 | 0 | 0 | 0 | 0 | 0 | 0 | 1,048 | 0.433595 |
261a000d9348f195b1440a4cf608cb7c86cce74a | 7,359 | py | Python | tests/test_mappings.py | cpenv/cpenv | 07e1a6b5d1b20af4adff0c5a6987c7cdc784cc39 | [
"MIT"
] | 15 | 2017-02-14T04:16:59.000Z | 2021-10-05T15:20:02.000Z | tests/test_mappings.py | cpenv/cpenv | 07e1a6b5d1b20af4adff0c5a6987c7cdc784cc39 | [
"MIT"
] | 32 | 2015-11-04T15:53:50.000Z | 2021-12-12T03:28:23.000Z | tests/test_mappings.py | cpenv/cpenv | 07e1a6b5d1b20af4adff0c5a6987c7cdc784cc39 | [
"MIT"
] | 2 | 2017-02-24T16:30:39.000Z | 2021-09-24T05:26:05.000Z | # -*- coding: utf-8 -*-
# Local imports
from cpenv import mappings
from cpenv.compat import platform
def test_platform_values():
'''join_dicts with platform values'''
tests = {
'implicit_set': {
'osx': 'osx',
'linux': 'linux',
'win': 'win',
},
'implicit_prepend': {
'osx': ['osx0', 'osx1'],
'linux': ['linux0', 'linux1'],
'win': ['win0', 'win1'],
},
'explicit_set': {
'set': {
'osx': 'osx',
'linux': 'linux',
'win': 'win',
}
},
'explicit_ops': {
'osx': [{'append': 'osx0'}, {'prepend': 'osx1'}],
'linux': [{'append': 'linux0'}, {'prepend': 'linux1'}],
'win': [{'append': 'win0'}, {'prepend': 'win1'}],
}
}
expected = {
'implicit_set': tests['implicit_set'],
'implicit_prepend': tests['implicit_prepend'],
'explicit_set': tests['explicit_set']['set'],
'explicit_ops': {
'osx': ['osx1', 'osx0'],
'linux': ['linux1', 'linux0'],
'win': ['win1', 'win0'],
}
}
results = mappings.join_dicts(tests)
p = platform
assert results['implicit_set'] == expected['implicit_set'][p]
assert results['implicit_prepend'] == expected['implicit_prepend'][p]
assert results['explicit_set'] == expected['explicit_set'][p]
assert results['explicit_ops'] == expected['explicit_ops'][p]
def test_join_case_insensitivity():
'''join_dicts is case insensitive'''
a = {'Var': 'a'} # Original mixed case
b = {'VAR': 'b'} # UPPER - set
c = {'var': ['0', '1']} # lower - prepend
# Ensure Var is properly set and case of key is changed
result = mappings.join_dicts(a, b)
assert result['VAR'] == 'b'
# Ensure Var is properly set, prepended to and case of key is changed
result = mappings.join_dicts(a, b, c)
assert result['var'] == ['0', '1', 'b']
def test_implicit_set_values():
'''join_dicts implicitly sets values'''
a = {'var': ['x', 'y']}
b = {'var': 'z'}
c = {'var': 'a'}
result = mappings.join_dicts(a, b)
assert result['var'] == b['var']
result = mappings.join_dicts(a, b, c)
assert result['var'] == c['var']
def test_implicit_prepend_values():
'''join_dicts implicitly prepends values'''
a = {'var': 'z'}
b = {'var': ['x', 'y']}
c = {'var': ['0', '1']}
result = mappings.join_dicts(a, b)
assert result['var'] == ['x', 'y', 'z']
result = mappings.join_dicts(a, b, c)
assert result['var'] == ['0', '1', 'x', 'y', 'z']
def test_explicit_set():
'''join_dicts with explicitly set items'''
a = {
'A': '0',
'B': ['1', '2']
}
# Explicit set str, list, non-existant key
b = {
'A': {'set': '1'},
'B': {'set': ['2', '3']},
'C': {'set': '4'},
}
result = mappings.join_dicts(a, b)
assert result == {'A': '1', 'B': ['2', '3'], 'C': '4'}
# Explicit set in list of ops
c = {
'A': [
{'set': '10'},
{'append': '20'},
]
}
result = mappings.join_dicts(a, b, c)
assert result == {'A': ['10', '20'], 'B': ['2', '3'], 'C': '4'}
def test_explicit_unset():
'''join_dicts with explicitly unset keys'''
a = {'A': '0'}
b = {'A': {'unset': '1'}}
result = mappings.join_dicts(a, b)
assert result == {}
def test_explicit_append():
'''join_dicts with explicitly appended values'''
a = {'A': '0'}
# Append one value
b = {'A': {'append': '1'}}
result = mappings.join_dicts(a, b)
assert result == {'A': ['0', '1']}
# Append list of values
c = {'A': {'append': ['2', '3']}}
result = mappings.join_dicts(a, b, c)
assert result == {'A': ['0', '1', '2', '3']}
# Multiple append operations
d = {'A': [{'append': '4'}, {'append': '5'}]}
result = mappings.join_dicts(a, b, c, d)
assert result == {'A': ['0', '1', '2', '3', '4', '5']}
# Append to non-existant var
e = {'B': {'append': '6'}}
result = mappings.join_dicts(a, b, c, d, e)
assert result == {'A': ['0', '1', '2', '3', '4', '5'], 'B': ['6']}
# Append duplicates are ignored
f = {'A': {'append': ['0', '5', '6']}}
result = mappings.join_dicts(a, b, c, d, e, f)
assert result == {'A': ['0', '1', '2', '3', '4', '5', '6'], 'B': ['6']}
def test_explicit_prepend():
'''join_dicts with explicitly prepended values'''
a = {'A': '0'}
# Prepend one value
b = {'A': {'prepend': '1'}}
result = mappings.join_dicts(a, b)
assert result == {'A': ['1', '0']}
# Prepend list of values
c = {'A': {'prepend': ['2', '3']}}
result = mappings.join_dicts(a, b, c)
assert result == {'A': ['2', '3', '1', '0']}
# Multiple prepend operations
d = {'A': [{'prepend': '4'}, {'prepend': '5'}]}
result = mappings.join_dicts(a, b, c, d)
assert result == {'A': ['5', '4', '2', '3', '1', '0']}
# Prepend to non-existant var
e = {'B': {'prepend': '6'}}
result = mappings.join_dicts(a, b, c, d, e)
assert result == {'A': ['5', '4', '2', '3', '1', '0'], 'B': ['6']}
# Prepend duplicates are ignored
f = {'A': {'prepend': ['0', '5', '6']}}
result = mappings.join_dicts(a, b, c, d, e, f)
assert result == {'A': ['6', '5', '4', '2', '3', '1', '0'], 'B': ['6']}
def test_explicit_remove():
'''join_dicts with explicitly removed values'''
a = {'A': ['0', '1', '2', '3', '4']}
# Remove one value
b = {'A': {'remove': '1'}}
result = mappings.join_dicts(a, b)
assert result == {'A': ['0', '2', '3', '4']}
# Remove list of values
c = {'A': {'remove': ['2', '4']}}
result = mappings.join_dicts(a, b, c)
assert result == {'A': ['0', '3']}
# Multiple remove operations
d = {'A': [{'remove': '0'}, {'remove': '3'}], 'B': {'remove': '6'}}
result = mappings.join_dicts(a, b, c, d)
assert result == {}
def test_explicit_complex_operation():
'''join_dicts with multiple explicit operations'''
a = {
'A': ['0', '1', '2'],
'B': '100',
'C': ['0'],
'D': '200',
}
b = {
'A': [
{'remove': ['1', '2']},
{'append': 'B'},
{'prepend': ['A', 'C']},
],
'B': [
{'set': ['A', 'B']},
{'prepend': 'C'},
{'remove': 'B'},
],
'C': [
{'set': ['A', 'B', 'C']},
{'prepend': 'Z'}
],
'D': {'remove': '200'},
}
expected = {
'A': ['A', 'C', '0', 'B'],
'B': ['C', 'A'],
'C': ['Z', 'A', 'B', 'C'],
}
result = mappings.join_dicts(a, b)
assert result == expected
def test_env_to_dict():
'''env_to_dict converts environment mapping to dict'''
env = {
'PATH': 'X:Y:Z',
'VAR': 'VALUE',
}
result = mappings.env_to_dict(env, pathsep=':')
assert result == {'PATH': ['X', 'Y', 'Z'], 'VAR': 'VALUE'}
def test_dict_to_env():
'''dict_to_env converts dict to environment mapping'''
data = {
'PATH': ['X', 'Y', 'Z'],
'VAR': 'VALUE',
}
result = mappings.dict_to_env(data, pathsep=':')
assert result == {'PATH': 'X:Y:Z', 'VAR': 'VALUE'}
| 27.055147 | 75 | 0.467455 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,865 | 0.389319 |
261aa67b18ad9245d7a07ef83e4b670e255e83ff | 98 | py | Python | src/db.py | jpocentek/flask-project-template | 0ba32002d847b04243181485d3c2ec146beb991b | [
"MIT"
] | null | null | null | src/db.py | jpocentek/flask-project-template | 0ba32002d847b04243181485d3c2ec146beb991b | [
"MIT"
] | null | null | null | src/db.py | jpocentek/flask-project-template | 0ba32002d847b04243181485d3c2ec146beb991b | [
"MIT"
] | null | null | null | """Database class."""
from flask_sqlalchemy import SQLAlchemy # type: ignore
db = SQLAlchemy()
| 16.333333 | 55 | 0.72449 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 35 | 0.357143 |
261cb72cdb5369f93d2ed990d5292c026f4a45f8 | 3,313 | py | Python | logial_puzzle/logical_puzzle.py | Adeon18/logical_puzzle | 9a5d210bed51a779ceb5b15f720fdecf1860ff76 | [
"MIT"
] | null | null | null | logial_puzzle/logical_puzzle.py | Adeon18/logical_puzzle | 9a5d210bed51a779ceb5b15f720fdecf1860ff76 | [
"MIT"
] | null | null | null | logial_puzzle/logical_puzzle.py | Adeon18/logical_puzzle | 9a5d210bed51a779ceb5b15f720fdecf1860ff76 | [
"MIT"
] | null | null | null | '''
https://github.com/Adeon18/logical_puzzle
'''
# There are now proper commits in this repository becouse I
# created 1 repo for 2 tasks and then had to move
import math
def check_rows(board: list) -> bool:
'''
Check for row correction in board.
>>> check_rows(["**** ****", "***1 ****", "** 3****", "* 4 1****",\
" 9 5 ", " 6 83 *", "3 1 **", " 8 2***", " 2 ****"])
True
'''
for row in board:
used_elems = []
for elem in row:
if elem == ' ' or elem == '*':
continue
# Check for repetitiveness
if int(elem) in range(1, 10) and int(elem) not in used_elems:
used_elems.append(int(elem))
elif int(elem) in range(1, 10) and int(elem) in used_elems:
return False
return True
def check_colls(board: list) -> bool:
'''
Check for column correction in board.
>>> check_colls(["**** ****", "***1 ****", "** 3****", "* 4 1****",\
" 9 5 ", " 6 83 *", "3 1 **", " 8 2***", " 2 ****"])
False
'''
new_lst = []
# We flip it and check for row correction
for i, row in enumerate(board):
new_elem = ''
for j, _ in enumerate(row):
new_elem += board[j][i]
new_lst.append(new_elem)
return check_rows(new_lst)
def get_color_comb(board: list, horizontal_coord: int,\
vertical_coord: int) -> str:
'''
Get one color combiation data. Return the elements which are in one color.
'''
# There's definately a better way to do this.
# Originally I wanted to do a diagonal search but it did not work even
# though i tried many times so I just get the cordinate and
# move down and then to the right.
line = ''
for vertical in range(vertical_coord, vertical_coord+5):
if board[vertical][horizontal_coord].isdigit():
line += board[vertical][horizontal_coord]
for horizontal in range(horizontal_coord + 1, horizontal_coord+5):
if board[vertical_coord+4][horizontal].isdigit():
line += board[vertical_coord+4][horizontal]
return line
def check_color(board: list) -> bool:
'''
Check for all colors, return False if any combination is wrong.
>>> check_color(["**** ****", "***1 ****", "** 3****", "* 4 1****",\
" 9 5 ", " 6 83 *", "3 1 **", " 8 2***", " 2 ****"])
True
'''
dimension = 9
for i in range(0, dimension-4):
hor_coord = i
# Get the vert coord
vert_coord = math.floor(dimension/2) - i
# Pass it to a func and return the combination of nums in one color
combination = get_color_comb(board, hor_coord, vert_coord)
# Check for repetition immediately
if len(combination) != len(set(combination)):
return False
return True
def validate_board(board: list) -> bool:
'''
The main function for checking the board.
>>> validate_board(["**** ****", "***1 ****", "** 3****", "* 4 1****",\
" 9 5 ", " 6 83 *", "3 1 **", " 8 2***", " 2 ****"])
False
'''
if check_rows(board) and check_colls(board) and check_color(board):
return True
return False
if __name__ == '__main__':
import doctest
print(doctest.testmod())
| 29.318584 | 78 | 0.543616 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,506 | 0.454573 |
261cd8b29762935b9416a0a01f195708019addab | 1,528 | py | Python | tests/test_signing.py | apache/incubator-milagro-mfa-server | b33dfe864ff0bcb8a26a46745b9c596d72d22ccf | [
"Apache-2.0"
] | 21 | 2016-09-18T19:13:58.000Z | 2021-11-10T18:35:30.000Z | tests/test_signing.py | apache/incubator-milagro-mfa-server | b33dfe864ff0bcb8a26a46745b9c596d72d22ccf | [
"Apache-2.0"
] | 3 | 2016-09-21T14:58:41.000Z | 2019-05-29T23:35:32.000Z | tests/test_signing.py | apache/incubator-milagro-mfa-server | b33dfe864ff0bcb8a26a46745b9c596d72d22ccf | [
"Apache-2.0"
] | 15 | 2016-05-24T11:15:47.000Z | 2021-11-10T18:35:22.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from mpin_utils.common import signMessage, verifySignature
def test_signing_valid():
message = 'Hello world!'
key = 'super secret'
expected_signature = 'f577954ea54f8e8cc1b7d5d238dde635a783a3a37a4ba44877e9f63269cd4b53'
signature = signMessage(message, key)
assert signature == expected_signature
valid, reason, code = verifySignature(message, signature, key)
assert valid
assert reason == 'Valid signature'
assert code == 200
def test_signing_invalid():
message = 'Hello world!'
key = 'super secret'
signature = 'invalid signature'
valid, reason, code = verifySignature(message, signature, key)
assert not valid
assert reason == 'Invalid signature'
assert code == 401
| 32.510638 | 91 | 0.744764 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 946 | 0.61911 |
261cf1e1d0b31aa16744bdc1d7356972182ab39f | 587 | py | Python | src/symplectic/test/test_jsonformat.py | pysymplectic/symplectic | bdb46157757eb6e1e12fd3694fdbd0bbf18a70db | [
"MIT"
] | null | null | null | src/symplectic/test/test_jsonformat.py | pysymplectic/symplectic | bdb46157757eb6e1e12fd3694fdbd0bbf18a70db | [
"MIT"
] | 1 | 2017-11-15T22:38:40.000Z | 2018-01-24T02:28:29.000Z | src/symplectic/test/test_jsonformat.py | pysymplectic/symplectic | bdb46157757eb6e1e12fd3694fdbd0bbf18a70db | [
"MIT"
] | null | null | null | import tempfile
import unittest
from symplectic import jsonformat
class JSONFormatTest(unittest.TestCase):
def test_parse(self):
with tempfile.NamedTemporaryFile() as fp:
fp.write("""
{
"title": "things",
"slug": "stuff",
"date": "2017-09-14 22:21",
"author": "Foo Bar",
"contents": "stuff sure are things"
}
""".encode('utf-8'))
fp.flush()
res, = jsonformat.posts_from_json_files([fp.name])
self.assertEquals(res.title, 'things')
| 25.521739 | 62 | 0.531516 | 517 | 0.88075 | 0 | 0 | 0 | 0 | 0 | 0 | 243 | 0.413969 |
261ded6e9abcc1091124bde1d09dfb13cef1f119 | 2,285 | py | Python | yatube/posts/tests/test_forms.py | ShumilovAlexandr/hw03_forms | e75fd9a4db1fa7091205877f86d48613febf1484 | [
"MIT"
] | null | null | null | yatube/posts/tests/test_forms.py | ShumilovAlexandr/hw03_forms | e75fd9a4db1fa7091205877f86d48613febf1484 | [
"MIT"
] | null | null | null | yatube/posts/tests/test_forms.py | ShumilovAlexandr/hw03_forms | e75fd9a4db1fa7091205877f86d48613febf1484 | [
"MIT"
] | null | null | null | import shutil
import tempfile
from django import forms
from django.test import Client, TestCase
from django.urls import reverse
from posts.forms import PostForm
from posts.models import Group, Post, User
from django.conf import settings
TEMP_MEDIA_ROOT = tempfile.mkdtemp(dir=settings.BASE_DIR)
class StaticURLTests(TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.user = User.objects.create_user(username = 'auth')
cls.group = Group.objects.create(
title = 'Test title',
slug = 'test-slug',
description = 'Test description'
)
cls.post = Post.objects.create(
pk = '1',
text='Текстовый текст',
author=cls.user,
group = cls.group,
)
cls.form = PostForm()
cls.guest_client = Client()
cls.authorized_client = Client()
#Авторизуем пользователя
cls.authorized_client.force_login(cls.user)
@classmethod
def tearDownClass(cls):
super().tearDownClass()
shutil.rmtree(TEMP_MEDIA_ROOT, ignore_errors=True)
def test_create_post(self):
posts_count = Post.objects.count()
form_data = {
'text': 'Текстовый текст',
'group': self.group.id,
'author':self.user
}
response = self.authorized_client.post(
reverse('posts:post_create'),
data=form_data,
follow=True
)
self.assertRedirects(response, reverse('posts:profile', args=[self.user.username]))
self.assertEqual(Post.objects.count(), posts_count+1)
self.assertTrue(
Post.objects.filter(
text = 'Текстовый текст',
group = self.group,
author = self.user
).exists()
)
def test_title_label(self):
text_label = self.form.fields['text'].label
self.assertTrue(text_label, 'Введите текст')
def test_title_label(self):
group_label = self.form.fields['group'].label
self.assertTrue(group_label, 'Выберите группу')
def test_title_help_text(self):
title_help_text = self.form.fields['text'].help_text
self.assertTrue(title_help_text, 'Напишите Ваш комментарий')
| 27.865854 | 91 | 0.615755 | 2,093 | 0.873175 | 0 | 0 | 819 | 0.341677 | 0 | 0 | 369 | 0.153942 |
261e064420fd7dcd06ca3011998456030259d91a | 8,460 | py | Python | python_module/test/unit/functional/test_functional.py | WestCityInstitute/MegEngine | f91881ffdc051ab49314b1bd12c4a07a862dc9c6 | [
"Apache-2.0"
] | 2 | 2020-03-26T08:26:29.000Z | 2020-06-01T14:41:38.000Z | python_module/test/unit/functional/test_functional.py | ted51/MegEngine | f91881ffdc051ab49314b1bd12c4a07a862dc9c6 | [
"Apache-2.0"
] | null | null | null | python_module/test/unit/functional/test_functional.py | ted51/MegEngine | f91881ffdc051ab49314b1bd12c4a07a862dc9c6 | [
"Apache-2.0"
] | 1 | 2020-11-09T06:29:51.000Z | 2020-11-09T06:29:51.000Z | # -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
import numpy as np
from helpers import opr_test
import megengine.functional as F
from megengine import Buffer, jit, tensor
from megengine.test import assertTensorClose
def test_flatten():
data0_shape = (2, 3, 4, 5)
data1_shape = (4, 5, 6, 7)
data0 = np.random.random(data0_shape).astype(np.float32)
data1 = np.random.random(data1_shape).astype(np.float32)
def compare_fn(x, y):
assert x.numpy().shape == y
output0 = (2 * 3 * 4 * 5,)
output1 = (4 * 5 * 6 * 7,)
cases = [{"input": data0, "output": output0}, {"input": data1, "output": output1}]
opr_test(cases, F.flatten, compare_fn=compare_fn)
output0 = (2, 3 * 4 * 5)
output1 = (4, 5 * 6 * 7)
cases = [{"input": data0, "output": output0}, {"input": data1, "output": output1}]
opr_test(cases, F.flatten, compare_fn=compare_fn, start_axis=1)
output0 = (2, 3, 4 * 5)
output1 = (4, 5, 6 * 7)
cases = [{"input": data0, "output": output0}, {"input": data1, "output": output1}]
opr_test(cases, F.flatten, compare_fn=compare_fn, start_axis=2)
output0 = (2, 3 * 4, 5)
output1 = (4, 5 * 6, 7)
cases = [{"input": data0, "output": output0}, {"input": data1, "output": output1}]
opr_test(cases, F.flatten, compare_fn=compare_fn, start_axis=1, end_axis=2)
def test_where():
maskv0 = np.array([[1, 0], [0, 1]], dtype=np.int32)
xv0 = np.array([[1, np.inf], [np.nan, 4]], dtype=np.float32)
yv0 = np.array([[5, 6], [7, 8]], dtype=np.float32)
maskv1 = np.array([[1, 0, 1], [1, 0, 0], [1, 1, 0]], dtype=np.int32)
xv1 = np.array([[1, np.inf, 2], [0, np.nan, 4], [1, 5, 7]], dtype=np.float32)
yv1 = np.array([[5, 6, 9], [2, 7, 8], [2, 1, 9]], dtype=np.float32)
cases = [{"input": [maskv0, xv0, yv0]}, {"input": [maskv1, xv1, yv1]}]
opr_test(cases, F.where, ref_fn=np.where)
def test_eye():
dtype = np.float32
cases = [{"input": [10, 20]}, {"input": [20, 30]}]
opr_test(cases, F.eye, ref_fn=lambda n, m: np.eye(n, m).astype(dtype), dtype=dtype)
def test_concat():
def get_data_shape(length: int):
return (length, 2, 3)
data1 = np.random.random(get_data_shape(5)).astype("float32")
data2 = np.random.random(get_data_shape(6)).astype("float32")
data3 = np.random.random(get_data_shape(7)).astype("float32")
def run(data1, data2):
return F.concat([data1, data2])
cases = [{"input": [data1, data2]}, {"input": [data1, data3]}]
opr_test(cases, run, ref_fn=lambda x, y: np.concatenate([x, y]))
def test_matrix_mul():
shape1 = (2, 3)
shape2 = (3, 4)
shape3 = (4, 5)
data1 = np.random.random(shape1).astype("float32")
data2 = np.random.random(shape2).astype("float32")
data3 = np.random.random(shape3).astype("float32")
cases = [{"input": [data1, data2]}, {"input": [data2, data3]}]
opr_test(cases, F.matrix_mul, ref_fn=np.matmul)
def test_batched_matrix_mul():
batch_size = 10
shape1 = (batch_size, 2, 3)
shape2 = (batch_size, 3, 4)
shape3 = (batch_size, 4, 5)
data1 = np.random.random(shape1).astype("float32")
data2 = np.random.random(shape2).astype("float32")
data3 = np.random.random(shape3).astype("float32")
cases = [{"input": [data1, data2]}, {"input": [data2, data3]}]
for i in range(0, batch_size):
def compare_fn(x, y):
x.numpy()[i, ...] == y
opr_test(
cases,
F.batched_matrix_mul,
compare_fn=compare_fn,
ref_fn=lambda x, y: np.matmul(x[i, ...], y[i, ...]),
)
def test_sort():
data1_shape = (10, 3)
data2_shape = (12, 2)
data1 = np.random.random(data1_shape).astype(np.float32)
data2 = np.random.random(data2_shape).astype(np.float32)
output0 = [np.sort(data1), np.argsort(data1).astype(np.int32)]
output1 = [np.sort(data2), np.argsort(data2).astype(np.int32)]
cases = [
{"input": data1, "output": output0},
{"input": data2, "output": output1},
]
opr_test(cases, F.sort)
def test_round():
data1_shape = (15,)
data2_shape = (25,)
data1 = np.random.random(data1_shape).astype(np.float32)
data2 = np.random.random(data2_shape).astype(np.float32)
cases = [{"input": data1}, {"input": data2}]
opr_test(cases, F.round, ref_fn=np.round)
def test_broadcast_to():
input1_shape = (20, 30)
output1_shape = (30, 20, 30)
data1 = np.random.random(input1_shape).astype(np.float32)
input2_shape = (10, 20)
output2_shape = (20, 10, 20)
data2 = np.random.random(input2_shape).astype(np.float32)
def compare_fn(x, y):
assert x.numpy().shape == y
cases = [
{"input": [data1, output1_shape], "output": output1_shape},
{"input": [data2, output2_shape], "output": output2_shape},
]
opr_test(cases, F.broadcast_to, compare_fn=compare_fn)
def test_add_update():
shape = (2, 3)
v = np.random.random(shape).astype(np.float32)
b = Buffer(v)
u = F.add_update(b, 1)
assertTensorClose(u.numpy(), v + 1)
u = F.add_update(b, 1)
assertTensorClose(u.numpy(), v + 2)
x = np.ones((2, 2), dtype=np.float32)
y = x * 0.5
dest = tensor(x)
delta = tensor(y)
r = F.add_update(dest, delta, alpha=tensor(0.9), beta=0.1, bias=0.1)
assertTensorClose(r.numpy(), x * 0.9 + y * 0.1 + 0.1)
def test_add_update_params():
b = np.random.random((2, 3)).astype(np.float32)
y = Buffer(b)
@jit.trace
def f(x):
return F.add_update(y, x)
f(np.zeros((2, 3)).astype(np.float32))
z = Buffer(np.zeros((2, 3)).astype(np.float32))
F.add_update(y, z, beta=0.1)
res = f(np.ones((2, 3)).astype(np.float32))
assertTensorClose(res, b + 1)
def test_cross_entropy_with_softmax():
data1_shape = (1, 2)
label1_shape = (1,)
data2_shape = (1, 3)
label2_shape = (1,)
data1 = np.array([1, 0.5], dtype=np.float32).reshape(data1_shape)
label1 = np.array([1], dtype=np.int32).reshape(label1_shape)
expect1 = F.cross_entropy(F.softmax(tensor(data1)), tensor(label1)).numpy()
data2 = np.array([0.3, 0.4, 0.3], dtype=np.float32).reshape(data2_shape)
label2 = np.array([1], dtype=np.int32).reshape(label2_shape)
expect2 = F.cross_entropy(F.softmax(tensor(data2)), tensor(label2)).numpy()
cases = [
{"input": [data1, label1], "output": expect1,},
{"input": [data2, label2], "output": expect2,},
]
opr_test(cases, F.cross_entropy_with_softmax)
def test_cross_entropy():
data1_shape = (1, 2)
label1_shape = (1,)
data2_shape = (1, 3)
label2_shape = (1,)
data1 = np.array([0.5, 0.5], dtype=np.float32).reshape(data1_shape)
label1 = np.array([1], dtype=np.int32).reshape(label1_shape)
expect1 = np.array([-np.log(0.5)], dtype=np.float32)
data2 = np.array([0.3, 0.4, 0.3], dtype=np.float32).reshape(data2_shape)
label2 = np.array([1], dtype=np.int32).reshape(label2_shape)
expect2 = np.array([-np.log(0.4)], dtype=np.float32)
cases = [
{"input": [data1, label1], "output": expect1,},
{"input": [data2, label2], "output": expect2,},
]
opr_test(cases, F.cross_entropy)
def test_binary_cross_entropy():
data1_shape = (2, 2)
label1_shape = (2, 2)
data2_shape = (2, 3)
label2_shape = (2, 3)
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def compare_fn(x, y):
assertTensorClose(x.numpy(), y, max_err=5e-4)
np.random.seed(123)
data1 = sigmoid(np.random.uniform(size=data1_shape).astype(np.float32))
label1 = np.random.uniform(size=label1_shape).astype(np.float32)
expect1 = np.array([0.6361], dtype=np.float32)
np.random.seed(123)
data2 = sigmoid(np.random.uniform(size=data2_shape).astype(np.float32))
label2 = np.random.uniform(size=label2_shape).astype(np.float32)
expect2 = np.array([0.6750], dtype=np.float32)
cases = [
{"input": [data1, label1], "output": expect1,},
{"input": [data2, label2], "output": expect2,},
]
opr_test(cases, F.binary_cross_entropy, compare_fn=compare_fn)
| 32.045455 | 88 | 0.61513 | 0 | 0 | 0 | 0 | 58 | 0.006856 | 0 | 0 | 804 | 0.095035 |
261ea5255801b00d98a0de6fa447d7ccb3d9504f | 2,964 | py | Python | workflows/pipe-common/pipeline/common/container.py | msleprosy/cloud-pipeline | bccc2b196fad982380efc37a1c3785098bec6c85 | [
"Apache-2.0"
] | 126 | 2019-03-22T19:40:38.000Z | 2022-02-16T13:01:44.000Z | workflows/pipe-common/pipeline/common/container.py | msleprosy/cloud-pipeline | bccc2b196fad982380efc37a1c3785098bec6c85 | [
"Apache-2.0"
] | 1,189 | 2019-03-25T10:39:27.000Z | 2022-03-31T12:50:33.000Z | workflows/pipe-common/pipeline/common/container.py | msleprosy/cloud-pipeline | bccc2b196fad982380efc37a1c3785098bec6c85 | [
"Apache-2.0"
] | 62 | 2019-03-22T22:09:49.000Z | 2022-03-08T12:05:56.000Z | # Copyright 2017-2019 EPAM Systems, Inc. (https://www.epam.com/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
class EnvironmentParametersParser:
def __init__(self, skip_params):
self.skip_params = skip_params
self.list_delimiter = ','
self.param_type_suffix = '_PARAM_TYPE'
self.pattern_prefix = 'p_'
self.exclude_suffix = '_exclude'
self.original_suffix = '_ORIGINAL'
self.preprocessed_types = {'common', 'input'}
def collect_params_from_env(self):
all_params = {}
file_patterns = {}
exclude_patterns = {}
param_types = {}
for name, param in os.environ.iteritems():
if name in self.skip_params:
continue
if name + self.param_type_suffix in os.environ:
if name.startswith(self.pattern_prefix):
if name.endswith(self.exclude_suffix):
exclude_patterns[
name[len(self.pattern_prefix):len(self.exclude_suffix) - 1]] = self.parse_param(param)
else:
file_patterns[name[len(self.pattern_prefix):]] = self.parse_param(param)
else:
param_type = os.environ[name + self.param_type_suffix]
param_types[name] = param_type
if param_type in self.preprocessed_types:
all_params[name] = os.environ[name + self.original_suffix]
else:
all_params[name] = param
return all_params, file_patterns, exclude_patterns, param_types
def parse_param(self, param):
return param.split(self.list_delimiter)
@classmethod
def get_env_value(cls, env_name, param_name=None, default_value=None):
if param_name is not None and param_name in os.environ:
return os.environ[param_name]
elif env_name in os.environ:
return os.environ[env_name]
elif default_value is None:
raise RuntimeError('Required parameter {} is not set'.format(env_name))
else:
return default_value
@classmethod
def has_flag(cls, env_name):
if env_name not in os.environ:
return False
if not os.environ[env_name]:
return False
if os.environ[env_name].lower() == 'true':
return True
else:
return False
| 39 | 114 | 0.619096 | 2,340 | 0.789474 | 0 | 0 | 722 | 0.24359 | 0 | 0 | 693 | 0.233806 |
261ef34aec94e0b7c7ad1e655cd7ebdf1e882520 | 243,870 | py | Python | code/learning/nominalization.py | ktwaco/nlproject | 16f02158fecdfe55a73a2c5c1e78376da935b50d | [
"Apache-2.0"
] | null | null | null | code/learning/nominalization.py | ktwaco/nlproject | 16f02158fecdfe55a73a2c5c1e78376da935b50d | [
"Apache-2.0"
] | null | null | null | code/learning/nominalization.py | ktwaco/nlproject | 16f02158fecdfe55a73a2c5c1e78376da935b50d | [
"Apache-2.0"
] | null | null | null | nominalization_list=["Buddhism",
"Catholicity",
"Catholicism",
"Doppler",
"evangelicality",
"Frenchness",
"Gaussianity",
"Gothicness",
"Indianness",
"Irishness",
"Jewishness",
"Malthusianism",
"mosaicity",
"Nordicness",
"northernness",
"Polishness",
"Protestantism",
"regency",
"Welshness",
"abandonment",
"abasement",
"abashment",
"abatement",
"abbreviation",
"abdication",
"abducence",
"abduction",
"aberration",
"aberrance",
"abetment",
"abeyance",
"abhorrence",
"abidance",
"abience",
"abjection",
"abjuration",
"ablation",
"ablativity",
"ability",
"ableness",
"abnegation",
"abnormality",
"abnormalness",
"abolition",
"abolishment",
"aboriginality",
"abortion",
"abortiveness",
"abortivity",
"abrasion",
"abrasiveness",
"abrasivity",
"abridgment",
"abrogation",
"abruptness",
"abscission",
"abscondence",
"absence",
"absoluteness",
"absolution",
"absorption",
"absorbance",
"absorbability",
"absorbency",
"absorptivity",
"abstention",
"abstinence",
"abstinency",
"abstemiousness",
"abstinence",
"abstinency",
"abstraction",
"abstractness",
"abstraction",
"abstracting",
"abstractedness",
"abstruseness",
"abstrusity",
"absurdity",
"abundance",
"abundancy",
"abusiveness",
"accession",
"acceleration",
"accentuation",
"acceptance",
"acceptation",
"acceptability",
"acceptableness",
"accessibility",
"accidentality",
"acclamation",
"acclimation",
"acclimatization",
"acclimatation",
"accommodation",
"accomplishment",
"accordance",
"accounting",
"accountability",
"accreditation",
"accretion",
"accrual",
"accruement",
"accumulation",
"accuracy",
"accurateness",
"accusation",
"acellularity",
"acentricity",
"acerbity",
"acetification",
"acetylation",
"ache",
"achievability",
"achievement",
"achromaticity",
"acidity",
"acidification",
"acidogenicity",
"acidophilicity",
"acidulation",
"acknowledgement",
"acnegenicity",
"acquaintance",
"acquiescence",
"acquiescence",
"acquisition",
"acquirement",
"acquisitiveness",
"acquittal",
"acridity",
"acrimoniousness",
"actinicity",
"actionability",
"activation",
"activity",
"activeness",
"actuality",
"actuation",
"acuity",
"acuteness",
"acylicity",
"acyclicity",
"adamancy",
"adaptation",
"adaption",
"adaptability",
"adaptiveness",
"adaptivity",
"addition",
"addiction",
"addictiveness",
"additivity",
"additiveness",
"adduction",
"adenization",
"adeptness",
"adequateness",
"adequation",
"adequacy",
"adherence",
"adhesion",
"adherency",
"adhesiveness",
"adhesivity",
"adiabaticity",
"adience",
"adiposity",
"adjacency",
"adjunction",
"adjournment",
"adjudication",
"adjuration",
"adjustment",
"adjustability",
"adjuvancy",
"adjuvance",
"administration",
"admirableness",
"admiration",
"admissibility",
"admission",
"admittance",
"admixture",
"admonition",
"admonishment",
"adolescence",
"adoration",
"adornment",
"adrenalectomization",
"adroitness",
"adsorption",
"adsorbence",
"adsorptivity",
"adulation",
"adultness",
"adulteration",
"adumbration",
"advancement",
"advantageousness",
"adventitiousness",
"adventuresomeness",
"adventurousness",
"advertisement",
"advertising",
"advisability",
"advocacy",
"advocation",
"aeration",
"aeriality",
"aerobicity",
"aerogenicity",
"aerosolization",
"aerotolerance",
"afebrility",
"affability",
"affection",
"affectedness",
"affectivity",
"affectiveness",
"affiliation",
"affirmation",
"affixation",
"affliction",
"affluence",
"afforestation",
"ageing",
"agedness",
"agelessness",
"agglomeration",
"agglomeration",
"agglutination",
"aggrandizement",
"aggravation",
"aggregation",
"aggregation",
"aggressiveness",
"aggressivity",
"agility",
"agitation",
"agnosticism",
"agreement",
"agreeableness",
"agreeability",
"aimlessness",
"airtightness",
"airworthyness",
"airworthiness",
"airiness",
"air-sickness",
"alation",
"alcoholization",
"alertness",
"algidity",
"alienness",
"alienation",
"alignment",
"alikeness",
"aliphaticity",
"aliveness",
"alkalescence",
"alkalification",
"alkalinity",
"alkalization",
"alkylation",
"allegation",
"allelism",
"allergenicity",
"allergization",
"alleviation",
"allocation",
"allogenicity",
"alloimmunity",
"alloplasticity",
"alloreactivity",
"allospecificity",
"allostery",
"allostericity",
"allotment",
"allotetraploidy",
"allotypy",
"allowance",
"allowability",
"allusion",
"allurement",
"allusiveness",
"alliance",
"aloneness",
"aloofness",
"alteration",
"alterability",
"alternation",
"alternativeness",
"alternativity",
"alveolation",
"amalgamation",
"amassment",
"amazement",
"ambience",
"ambiguity",
"ambiguousness",
"ambilaterality",
"ambilevosity",
"ambisexuality",
"ambitiousness",
"ambition",
"ambivalence",
"ambivalency",
"ambulancy",
"ambulation",
"amelioration",
"amenability",
"amendment",
"amiability",
"amicability",
"amidation",
"ammoniagenicity",
"ammoniation",
"amnionicity",
"amorality",
"amorousness",
"amorphousness",
"amortization",
"amphibiousness",
"amphipathicity",
"amphiphilicity",
"amphoricity",
"amphotericity",
"ampleness",
"amplifiability",
"amplification",
"amputation",
"amusement",
"amyotrophia",
"anaerobicity",
"anaesthetisation",
"anality",
"analogousness",
"analyticity",
"analyzability",
"analysis",
"analyzation",
"anaphylactogenicity",
"anaplasticity",
"anastomosis",
"ancientness",
"androgenicity",
"androgenization",
"androgynousness",
"anechoicity",
"anemophily",
"anergy",
"aneuploidy",
"angiogenicity",
"angioinvasiveness",
"angioinvasivity",
"angiospasticity",
"anglicization",
"angriness",
"anguish",
"angularity",
"angulation",
"angulation",
"animadversion",
"animation",
"animation",
"anionicity",
"anisogamy",
"anisotonicity",
"annealment",
"annexation",
"annihilation",
"annotation",
"announcement",
"annoyance",
"annuality",
"annulment",
"annularity",
"annunciation",
"anointment",
"anomaly",
"anomality",
"anomericity",
"anonymity",
"anonymousness",
"anovularity",
"antagonism",
"antagonism",
"antagonization",
"antecedence",
"antecedent",
"anteflexion",
"anteriority",
"anteriorness",
"anteroposteriorness",
"anteroposteriority",
"anthropocentricity",
"anthropophily",
"antiatherogenicity",
"anticarcinogenicity",
"anticariogenicity",
"anticholinergicity",
"anticipation",
"anticoagulation",
"anticomplementarity",
"anticomplementariness",
"antidromicity",
"antigenicity",
"antineoplasticity",
"antinociception",
"antiparallelism",
"antiplasticity",
"antiquity",
"antisociality",
"antispasticity",
"antitoxicity",
"antitumorigenicity",
"antitussiveness",
"anxiety",
"anxiousness",
"apartness",
"apathy",
"aperiodicity",
"aphasia",
"aplasticity",
"apolarity",
"apparency",
"appeal",
"appearance",
"appeasement",
"appetitiveness",
"applause",
"applicability",
"application",
"appointment",
"apportionment",
"apposition",
"appositeness",
"appraisal",
"appraisement",
"appreciability",
"appreciation",
"appreciativeness",
"apprehension",
"apprehension",
"apprehensiveness",
"approachability",
"appropriateness",
"appropriation",
"approval",
"approvement",
"approximation",
"aptness",
"aptitude",
"apyrogenicity",
"aquosity",
"arability",
"arbitrariness",
"arbitration",
"arboreality",
"arborescence",
"arc",
"arcuation",
"ardency",
"arduousness",
"argentaffinity",
"argument",
"argumentativeness",
"argyrophilicity",
"argyrophobia",
"aridity",
"arisal",
"aromaticity",
"arousal",
"arraignment",
"arrangement",
"arrest",
"arrestment",
"arrhythmicity",
"arrhythmogenicity",
"arrival",
"arrogance",
"arrogation",
"arterialization",
"arteriosity",
"artfulness",
"articulation",
"articulateness",
"artificiality",
"artificialness",
"artlessness",
"ascension",
"ascent",
"ascendance",
"ascendancy",
"ascertainment",
"ascription",
"asepticity",
"asexuality",
"asexualization",
"ashenness",
"ashiness",
"aspecificity",
"aspersion",
"asphyxiation",
"aspiration",
"aspiration",
"assailability",
"assassination",
"assault",
"assaultiveness",
"assembly",
"assemblage",
"assertion",
"assertiveness",
"assertivity",
"assessment",
"assession",
"asseveration",
"assiduousness",
"assiduity",
"assignment",
"assignability",
"assimilability",
"assimilation",
"assistance",
"association",
"assortedness",
"assuagement",
"assumption",
"asthmogenicity",
"astigmaticity",
"astonishment",
"astringency",
"astuteness",
"asymmetry",
"asymmetricity",
"asymptomaticity",
"atavism",
"atherogenesis",
"atherogenicity",
"athymicity",
"atomicity",
"atomization",
"atonality",
"atonement",
"atonicity",
"atopicity",
"atoxicity",
"atoxigenicity",
"atraumaticity",
"attachment",
"attainment",
"attainability",
"attainableness",
"attendance",
"attention",
"attentiveness",
"attenuance",
"attenuation",
"attestation",
"attraction",
"attractiveness",
"attractivity",
"attributability",
"attribution",
"attunement",
"atypicality",
"atypicalness",
"audacity",
"audaciousness",
"audibility",
"augmentation",
"augury",
"auscultation",
"auspiciousness",
"austereness",
"austerity",
"authenticity",
"authentication",
"authorship",
"authoritarianism",
"authoritativeness",
"authorization",
"autism",
"autoaggressivity",
"autoaggressiveness",
"autochthony",
"autoecism",
"autoeroticism",
"autoimmunity",
"autolysis",
"automation",
"automaticity",
"autonomicity",
"autoperfusion",
"autoplasticity",
"autoreactivity",
"autoregulation",
"autotoxicity",
"autotransplantation",
"autoxidation",
"auto-oxidation",
"auto-oxidization",
"auxotrophicity",
"availability",
"avalvularity",
"avariciousness",
"averageness",
"aversion",
"aversiveness",
"aversion",
"avianization",
"avidity",
"avirulence",
"avoidance",
"avoidability",
"avowal",
"avulsion",
"avuncularity",
"awakeness",
"awakening",
"awareness",
"awayness",
"awesomeness",
"awfulness",
"awkwardness",
"axiality",
"axotomy",
"axotomization",
"bacillarity",
"backup",
"backness",
"backwardness",
"bactericidality",
"bacteriocinogenicity",
"bacteriogenicity",
"bacteriotoxicity",
"badness",
"bafflement",
"bag",
"bagginess",
"balancement",
"baldness",
"ballisticity",
"ballottement",
"ballotability",
"ban",
"banality",
"banishment",
"bankruptcy",
"bankruptcy",
"baptism",
"bar",
"barbarism",
"bareness",
"barrenness",
"baseness",
"bashfulness",
"basicity",
"basicness",
"basophily",
"bastardization",
"battery",
"battle",
"battiness",
"bearability",
"beardlessness",
"beastliness",
"beautification",
"becomingness",
"bedevilment",
"bedfastness",
"bedriddenness",
"beguilement",
"behavior",
"belatedness",
"believability",
"belief",
"belittlement",
"bellicosity",
"belligerence",
"belligerency",
"beneficence",
"beneficialness",
"beneficiality",
"benevolence",
"benignity",
"benignancy",
"bentness",
"bequeathal",
"bereavement",
"bestiality",
"bestowal",
"betrayal",
"betrothal",
"betrothment",
"betterment",
"bewilderment",
"bewilderingness",
"bewitchery",
"bewitchment",
"biarticularity",
"biblicality",
"bicameralism",
"biconcavity",
"bicuspidality",
"bid",
"bidirectionality",
"bienniality",
"biexponentiality",
"bifidity",
"bifocality",
"bifunctionality",
"bifurcation",
"bigness",
"bilaterality",
"bilateralness",
"bilingualism",
"bilinguality",
"biliousness",
"bimodality",
"binaurality",
"bindingness",
"binocularity",
"binomiality",
"binuclearity",
"bioactivity",
"biocompatibility",
"biodegradability",
"biodegradation",
"bioequivalence",
"bioequivalency",
"biogenicity",
"biopsychosociality",
"bioreversibility",
"bipartisanism",
"bipartisanship",
"bipartiteness",
"bipedality",
"bipedalism",
"biphasicity",
"bipolarity",
"bipotentiality",
"biracialism",
"birefringence",
"birefringency",
"bisection",
"bisexuality",
"bispecificity",
"bite",
"bitterness",
"bivalence",
"bivalency",
"bizarreness",
"blackness",
"blamelessness",
"blameworthiness",
"blandness",
"blankness",
"blast",
"blastogenicity",
"blastomogenicity",
"blatancy",
"bleakness",
"blessing",
"blessedness",
"blindness",
"blissfulness",
"bloatedness",
"blockage",
"blocking",
"blondness",
"bloodlessness",
"bloodiness",
"bloody-mindedness",
"blueness",
"bluntness",
"blur",
"board",
"boastfulness",
"boat",
"bobsledding",
"boisterousness",
"boldness",
"bomb",
"bombing",
"bombardment",
"bonding",
"boniness",
"boost",
"bootlessness",
"borrowing",
"bosselation",
"bothersomeness",
"bottom",
"bottomlessness",
"boundness",
"boundlessness",
"bountifulness",
"bovinity",
"bowdlerization",
"boyishness",
"brachymorphy",
"brainlessness",
"brain-washing",
"branching",
"brashness",
"bravery",
"brawniness",
"breach",
"break",
"breakage",
"breakup",
"breakability",
"breathing",
"breathlessness",
"breed",
"breeding",
"breeziness",
"bribery",
"brick",
"brevity",
"brightness",
"brilliance",
"brilliancy",
"briskness",
"brittleness",
"broadness",
"broadcast",
"broad-mindedness",
"brokenheartedness",
"bromation",
"bromination",
"bromization",
"brooding",
"broodiness",
"brotherliness",
"brownness",
"bruise",
"brush",
"brush-off",
"brusqueness",
"brutality",
"brutalization",
"bubble",
"bud",
"buffer",
"build",
"buildup",
"bulbosity",
"bulkiness",
"bullation",
"bumpiness",
"bunch",
"buoyancy",
"buoyance",
"burdensomeness",
"burst",
"bushiness",
"busyness",
"butchery",
"button",
"cage",
"cajolery",
"cajolement",
"calamitousness",
"calcareousness",
"calcification",
"calculability",
"calculation",
"calculation",
"calibration",
"callousness",
"callowness",
"calm",
"calmness",
"caloricity",
"calving",
"campaign",
"canaliculization",
"canalization",
"cancellation",
"cancerogenicity",
"cancerosity",
"cancerousness",
"candidness",
"candor",
"cannibalism",
"cannibalization",
"cannulation",
"cannulization",
"cantankerousness",
"capability",
"capaciousness",
"capitalization",
"capitation",
"capitulation",
"caponization",
"capriciousness",
"captain",
"captivation",
"captivity",
"capture",
"carbolation",
"carbolization",
"carbonation",
"carbonization",
"carcinogenicity",
"carcinogenity",
"cardioactivity",
"cardiogenicity",
"cardioselectivity",
"cardioselectiveness",
"cardiotoxicity",
"carefreeness",
"carefulness",
"carelessness",
"cariogenicity",
"cariosity",
"carnivory",
"carnivorousness",
"carousal",
"car sickness",
"castigation",
"casualness",
"catabolization",
"catalysis",
"cataractogenicity",
"categorization",
"catheterization",
"catholicity",
"catholicism",
"cationicity",
"caudality",
"causality",
"causativity",
"cause",
"causation",
"causticity",
"cauterization",
"cautiousness",
"cavitation",
"cessation",
"ceaselessness",
"cession",
"celebration",
"cellularity",
"cellulosity",
"cementation",
"centrality",
"centralization",
"centricity",
"centrifugality",
"centrifugalization",
"centrifugation",
"centripetality",
"certainty",
"certitude",
"certification",
"certification",
"chalkiness",
"chamaecephaly",
"chanciness",
"change",
"changeability",
"changeableness",
"changelessness",
"chaoticity",
"chaoticness",
"characterization",
"charge",
"chargeability",
"charitability",
"chase",
"chat",
"chattiness",
"cheapness",
"checkup",
"cheerfulness",
"cheerlessness",
"chelation",
"chemiluminescence",
"chemolithotrophicity",
"chemoresponsiveness",
"chemosensitivity",
"chemosensitiveness",
"chemotacticity",
"chewing",
"childishness",
"childlessness",
"childlikeness",
"chillness",
"chilliness",
"chirality",
"chitinization",
"chlorination",
"chloroformization",
"choiceness",
"cholinoceptivity",
"choice",
"chorionicity",
"chromaffinity",
"chromaticness",
"chromaticity",
"chromogenicity",
"chronotropicity",
"chubbiness",
"ciliation",
"ciliotoxicity",
"circuitousness",
"circuity",
"circularity",
"circularization",
"circumcision",
"circumnavigation",
"circumscription",
"circumspection",
"circumstantiality",
"circumvention",
"citation",
"civility",
"civilization",
"claim",
"clamminess",
"clandestineness",
"clarification",
"classicality",
"classifiability",
"classification",
"classlessness",
"clastogenicity",
"clavelization",
"cleanness",
"clean",
"cleanup",
"cleanliness",
"clearness",
"clarity",
"clear-headedness",
"clear-sightedness",
"cleavage",
"clemency",
"cleverness",
"click",
"clonality",
"cloning",
"clonicity",
"closeout",
"closing",
"closeness",
"closedness",
"cloudlessness",
"cloudiness",
"clumsiness",
"clustering",
"coagulability",
"coagulation",
"coalescence",
"coamplification",
"coaptation",
"coarctation",
"coarseness",
"coarsity",
"coating",
"cocainization",
"cocarcinogenicity",
"cochleotopicity",
"coconsciousness",
"coding",
"codification",
"coercion",
"coerciveness",
"coercivity",
"coexistence",
"cogency",
"cognateness",
"cognitivity",
"cognitiveness",
"cognizance",
"cohabitation",
"coherency",
"cohesion",
"coherence",
"coherence",
"coherency",
"cohesiveness",
"cohesivity",
"coincidence",
"coincidence",
"coincidency",
"coinjection",
"coldness",
"cold-heartedness",
"colicinogenicity",
"collaboration",
"collapsability",
"collapse",
"collapsibility",
"collation",
"collaterality",
"collection",
"collectivity",
"collectiveness",
"collectivization",
"collision",
"collocation",
"colloidality",
"colloquiality",
"collusion",
"colonization",
"colorfulness",
"colorlessness",
"combat",
"combativeness",
"combination",
"combustibility",
"comedogenicity",
"comfortableness",
"comfortability",
"comfortlessness",
"command",
"commemoration",
"commencement",
"commensalism",
"commensality",
"commensurability",
"commensuration",
"comment",
"commerciality",
"commercialization",
"comminution",
"commiseration",
"commitment",
"committal",
"committedness",
"commonness",
"communality",
"communicability",
"communication",
"communicativeness",
"commutability",
"commutation",
"compactness",
"companionability",
"comparability",
"comparativeness",
"comparativity",
"comparison",
"compartmentalization",
"compatibility",
"competition",
"competence",
"competency",
"competitiveness",
"competitivity",
"compilation",
"compilement",
"complacency",
"complacence",
"complaint",
"complaisance",
"complementation",
"complementariness",
"completion",
"completeness",
"completedness",
"complexity",
"complexness",
"complexation",
"compliancy",
"compliance",
"complication",
"complicatedness",
"complicacy",
"complicity",
"complimentarity",
"compliance",
"comportment",
"composition",
"compositeness",
"compositionality",
"compoundness",
"comprehensibility",
"comprehensiveness",
"compression",
"compromise",
"compulsiveness",
"compulsoriness",
"computation",
"computerization",
"concatenation",
"concavity",
"concaveness",
"concealment",
"concession",
"conceitedness",
"conceivability",
"concentration",
"concentricity",
"conceptualization",
"concernment",
"concertedness",
"conciliator",
"conciliation",
"concision",
"conciseness",
"conclusion",
"conclusiveness",
"concoction",
"concomitance",
"concomitancy",
"concordance",
"concordancy",
"concreteness",
"concupiscence",
"concurrence",
"concurrency",
"concussion",
"condemnation",
"condensibility",
"condensation",
"condescension",
"conditioning",
"conditionality",
"conduciveness",
"conduction",
"conductivity",
"conductiveness",
"confabulation",
"confederation",
"conferment",
"conferral",
"confession",
"confidence",
"confidentiality",
"configurability",
"confinement",
"confinement",
"confirmation",
"confiscation",
"confluence",
"confocality",
"conformance",
"conformity",
"conformation",
"conformability",
"confrontation",
"confusion",
"confutation",
"congealment",
"congelation",
"congenericity",
"congeniality",
"congenicity",
"congestion",
"congratulation",
"congregation",
"congruity",
"congruence",
"conicity",
"conicality",
"conjecture",
"conjunction",
"conjugality",
"conjugation",
"conjugativity",
"connection",
"connectedness",
"connectivity",
"connivance",
"connotation",
"connubiality",
"conquest",
"consanguinity",
"conscientiousness",
"consciousness",
"conscription",
"consecration",
"consecutiveness",
"consensuality",
"consent",
"consequentiality",
"conservatism",
"conservativeness",
"conservativity",
"conservation",
"consideration",
"considerateness",
"consignment",
"consistence",
"consistency",
"consolation",
"consolidation",
"consonance",
"consonancy",
"conspecificity",
"conspicuousness",
"conspicuity",
"conspiracy",
"constancy",
"consternation",
"constipation",
"constitution",
"constitutionality",
"constitutionalization",
"constitutivity",
"constitutiveness",
"constraint",
"constrainment",
"constriction",
"constricture",
"construction",
"constructiveness",
"constructivity",
"construal",
"consultation",
"consumption",
"consummation",
"contact",
"contagiousness",
"contagiosity",
"containment",
"contamination",
"contemplation",
"contemplativeness",
"contemporaneity",
"contemporaneousness",
"contemporariness",
"contention",
"contentment",
"contentness",
"contentiousness",
"contextuality",
"contiguousness",
"contiguity",
"continency",
"continence",
"continentality",
"contingence",
"continuation",
"continuance",
"continuousness",
"continuity",
"contortion",
"contracture",
"contractibility",
"contractility",
"contradiction",
"contradictoriness",
"contraindication",
"contralaterality",
"contrariness",
"contrariety",
"contrastiveness",
"contrastivity",
"contravention",
"contribution",
"contrition",
"contrivance",
"controllability",
"controlledness",
"controllingness",
"controversiality",
"contumely",
"contusion",
"convalescence",
"convention",
"convergence",
"convergency",
"conversance",
"conversation",
"convertibility",
"convexity",
"conveyance",
"conviction",
"convincibility",
"convincingness",
"conviviality",
"convolutedness",
"convulsiveness",
"convulsivity",
"coolness",
"coordination",
"coordinateness",
"coossification",
"copiousness",
"copulation",
"cordiality",
"coronality",
"corporateness",
"corporeity",
"corpulency",
"corpulence",
"correctness",
"correctitude",
"correction",
"correctiveness",
"correctivity",
"correlation",
"correlativity",
"correlativeness",
"correspondence",
"correspondency",
"corrigibility",
"corroboration",
"corrosion",
"corrosiveness",
"corrosivity",
"corrugation",
"corruptness",
"corruption",
"corruption",
"corruptibility",
"coruscation",
"cosensitization",
"cosmeticity",
"costiveness",
"costliness",
"cotransfection",
"counseling",
"count",
"countability",
"counteraction",
"courageousness",
"courteousness",
"courtesy",
"courtliness",
"covalency",
"covalence",
"covertness",
"covetousness",
"cowardliness",
"coyness",
"cozenage",
"cosiness",
"cochromatography",
"co-cultivation",
"coexistence",
"cooperation",
"cooption",
"co-optation",
"craftiness",
"crash-landing",
"craving",
"cravenness",
"craziness",
"creak",
"creakiness",
"creaminess",
"creation",
"creativeness",
"creativity",
"credibility",
"creditableness",
"creditability",
"credit-worthiness",
"credulousness",
"credulity",
"cremation",
"crepitation",
"cribration",
"cribriformity",
"criminality",
"criminalization",
"crispness",
"criticality",
"criticalness",
"criticism",
"crookedness",
"crossing",
"crossness",
"crossbreeding",
"crosslinkage",
"cross fertilization",
"crowdedness",
"crudeness",
"crudity",
"cruelness",
"cruelty",
"crumbliness",
"crunch",
"crusade",
"crustiness",
"cryopreservation",
"crypticity",
"cryptogenicity",
"crystallization",
"cuddliness",
"cull",
"culmination",
"culpability",
"cultivability",
"cultivation",
"culturability",
"cumbersomeness",
"cumulation",
"cumulativeness",
"cumulativity",
"curability",
"curableness",
"curativity",
"curativeness",
"cure",
"curettage",
"curetting",
"curettement",
"curiosity",
"curiousness",
"curl-up",
"curliness",
"currentness",
"cursiveness",
"curtness",
"curtailment",
"cut-through",
"cuteness",
"cyclicity",
"cylindricality",
"cymbocephaly",
"cynicism",
"cytogeneticity",
"cytogenicity",
"cytopathicity",
"cytopathogenicity",
"cytophilicity",
"cytoprotectivity",
"cytoreductivity",
"cytospin",
"cytostaticity",
"cytotoxicity",
"cytotoxity",
"dailiness",
"daintiness",
"dalliance",
"damnation",
"dampness",
"dangerousness",
"dansylation",
"dare",
"darkness",
"dash",
"dauntlessness",
"dazzlement",
"deadness",
"deadliness",
"deafness",
"deafferentation",
"deafferentation",
"dealing",
"deal",
"dealcoholization",
"deallergization",
"deamidation",
"deamidization",
"deamination",
"dearness",
"deathlessness",
"debarment",
"debasement",
"debate",
"debilitation",
"debridement",
"debulkment",
"debut",
"decadence",
"decalcification",
"decampment",
"decantation",
"decapitation",
"decarbonization",
"decarboxylation",
"decay",
"deceitfulness",
"deception",
"deceleration",
"decentralization",
"deceptiveness",
"decerebration",
"dechlorination",
"decision",
"deciduousness",
"decimation",
"decipherment",
"decisiveness",
"declamation",
"declaration",
"declassification",
"decline",
"declension",
"declination",
"decolonization",
"decolorization",
"decompensation",
"decomposition",
"decompression",
"decontamination",
"decontrol",
"decoration",
"decorativeness",
"decorousness",
"decrease",
"decree",
"decrepitude",
"decrepitation",
"decussation",
"dedication",
"dedifferentiation",
"deduction",
"deduction",
"deepness",
"depth",
"deepening",
"defacement",
"defamation",
"defaunation",
"defeat",
"defecation",
"defection",
"defectiveness",
"defectivity",
"defencelessness",
"defence",
"defensibility",
"defensiveness",
"deferment",
"deference",
"deferentiality",
"defibrillation",
"deficiency",
"deficience",
"defilement",
"definability",
"definition",
"definiteness",
"definitiveness",
"deflation",
"deflection",
"deflectability",
"defoliation",
"deforestation",
"deformation",
"defrayment",
"deftness",
"defiance",
"degeneration",
"degeneracy",
"deglycosylation",
"degradation",
"degranulation",
"dehalogenation",
"dehematization",
"dehiscence",
"dehumanization",
"dehydration",
"dehydrogenation",
"dehydrogenization",
"deification",
"deinduction",
"deinstitutionalization",
"deionization",
"dejection",
"dejection",
"delectability",
"delegation",
"deletion",
"deleteriousness",
"deliberateness",
"deliberation",
"deliberativeness",
"delicacy",
"deliciousness",
"delightfulness",
"delimitation",
"delineation",
"delinquency",
"deliquescence",
"delirium",
"deliriousness",
"deliverance",
"delivery",
"delocalization",
"delusion",
"delusionality",
"demagnetization",
"demand",
"demandingness",
"demarcation",
"dementedness",
"demetalization",
"demethylation",
"demilitarization",
"demineralization",
"demobilization",
"democratization",
"demolition",
"demonetization",
"demonstrability",
"demonstration",
"demonstrativeness",
"demonstrativity",
"demoralization",
"demorphinization",
"demotion",
"demurral",
"demureness",
"demustardization",
"demyelination",
"demyelinisation",
"denationalization",
"denaturation",
"dendriticness",
"denervation",
"denigration",
"denitrification",
"denomination",
"denotation",
"denunciation",
"denouncement",
"density",
"denseness",
"dentation",
"dentulousness",
"denudation",
"denudement",
"denial",
"deodorization",
"deoxidation",
"deoxidization",
"depancreatization",
"departure",
"dependence",
"dependability",
"dependableness",
"dependence",
"dependency",
"dephosphorylation",
"depiction",
"dipilation",
"depilation",
"deplasmolysis",
"depletion",
"deplorableness",
"deployment",
"depolarization",
"depolymerization",
"depopulation",
"deportation",
"deposition",
"deposal",
"deposition",
"depravation",
"depravity",
"deprecation",
"depreciation",
"depression",
"depression",
"depressiveness",
"depressivity",
"deprivation",
"deprivement",
"deprival",
"deproteinization",
"depuration",
"deputization",
"derailment",
"derangement",
"derangement",
"deregulation",
"dereliction",
"derepression",
"derision",
"derivativeness",
"derivatization",
"derivation",
"derogation",
"desalination",
"desaturation",
"descent",
"description",
"descriptiveness",
"desecration",
"desegregation",
"desensitization",
"desertion",
"desexualization",
"design",
"designing",
"designation",
"desirability",
"desirableness",
"desistance",
"desolation",
"desorbtion",
"despeciation",
"desperation",
"desperateness",
"despoilment",
"despondency",
"destabilization",
"destituteness",
"destitution",
"destruction",
"destructibility",
"destructiveness",
"destructivity",
"detachment",
"detachability",
"detachment",
"detainment",
"detention",
"detection",
"detectability",
"deterrence",
"determent",
"detergency",
"deterioration",
"determinacy",
"determinateness",
"determination",
"determination",
"deterrence",
"deterrency",
"detestation",
"detonation",
"detoxification",
"detraction",
"detrainment",
"deuteration",
"devaluation",
"devastation",
"development",
"deviance",
"deviancy",
"deviation",
"deviousness",
"devisal",
"devitalization",
"devolution",
"devotion",
"devotion",
"devotedness",
"devoutness",
"dextrality",
"dextrinization",
"dextrocularity",
"dexterity",
"dexterousness",
"de-epicardialization",
"diabetogenicity",
"diabolicalness",
"diagnosability",
"diagnosis",
"diagnosticity",
"diagonality",
"dialyzability",
"dialyzation",
"dialysis",
"diaphaneity",
"diaphanousness",
"diarrheogenicity",
"diazotization",
"dibasicity",
"dichorionicity",
"dichotomization",
"dichotomousness",
"dictation",
"didacticism",
"death",
"dietotoxicity",
"difference",
"differentness",
"differentiality",
"differentiation",
"difficulty",
"difficultness",
"diffluence",
"diffraction",
"diffusion",
"diffuseness",
"diffusibility",
"diffusivity",
"diffusiveness",
"digestion",
"digestibility",
"digestivity",
"digestiveness",
"digitalisation",
"digitization",
"digression",
"dilatancy",
"dilatation",
"dilation",
"dilatoriness",
"diligence",
"dilution",
"diluteness",
"dimness",
"dimensionality",
"dimericity",
"diminishment",
"diminution",
"diminutiveness",
"dinginess",
"diphasicity",
"diploidness",
"diploidy",
"dipsogenicity",
"direction",
"directness",
"directionality",
"dirtiness",
"disablement",
"disability",
"disadvantagement",
"disadvantageousness",
"disaffection",
"disagreement",
"disagreeableness",
"disagreeability",
"disallowance",
"disappearance",
"disappointment",
"disapproval",
"disarmament",
"disarrangement",
"disassociation",
"disastrousness",
"disavowal",
"disbandment",
"disbelief",
"disbursement",
"discernment",
"discernibility",
"discernibleness",
"discharge",
"disciplinarity",
"disclosure",
"discoloration",
"discomfiture",
"discomposure",
"disconfirmation",
"disconnection",
"disconnectedness",
"disconnection",
"discontentment",
"discontentment",
"discontinuance",
"discontinuation",
"discontinuity",
"discontinuousness",
"discordancy",
"discordance",
"discouragement",
"discourteousness",
"discourtesy",
"discovery",
"discretion",
"discreetness",
"discrepancy",
"discreteness",
"discrimination",
"discrimination",
"discriminativeness",
"discursiveness",
"discursivity",
"discussion",
"disdain",
"diseasedness",
"disembarkation",
"disembodiment",
"disembowelment",
"disenchantment",
"disenfranchisement",
"disengagement",
"disentanglement",
"disfigurement",
"disfiguration",
"disgruntlement",
"disgustingness",
"disharmony",
"disheartenment",
"dishevelment",
"dishonesty",
"disillusionment",
"disinclination",
"disinfection",
"disingenuousness",
"disinheritance",
"disintegration",
"disinterment",
"disinterestedness",
"disjunction",
"disjointedness",
"dislocation",
"dislodgement",
"disloyalty",
"dismantlement",
"dismemberment",
"dismissal",
"dismission",
"disobedience",
"disocclusion",
"dissolubility",
"disorderedness",
"disorderliness",
"disorganization",
"disorientation",
"disownment",
"disparagement",
"disparity",
"disparateness",
"dispassionateness",
"dispensability",
"dispensal",
"dispersion",
"dispersal",
"dispersement",
"dispersibility",
"dispersiveness",
"dispersivity",
"dispiritment",
"displacement",
"disposability",
"disposal",
"disposition",
"dispossession",
"disproportionateness",
"disproof",
"disputation",
"disqualification",
"disreputableness",
"disrespectfulness",
"disruption",
"disrupture",
"disruptiveness",
"dissatisfaction",
"dissection",
"dissemblance",
"dissemination",
"dissidence",
"dissimilarity",
"dissimilitude",
"dissimilation",
"dissimulation",
"dissipation",
"dissipation",
"dissociability",
"dissociation",
"dissociativity",
"dissoluteness",
"dissolution",
"dissonance",
"dissuasion",
"distality",
"distalness",
"distance",
"distantness",
"distastefulness",
"distension",
"distillation",
"distinctness",
"distinction",
"distinctiveness",
"distinguishment",
"distinction",
"distinguishability",
"distortion",
"distraction",
"distractedness",
"distraint",
"distribution",
"distributivity",
"distributiveness",
"distrustfulness",
"disturbance",
"disubstitution",
"disunion",
"diurnality",
"divagation",
"divalency",
"divergence",
"divergency",
"divergence",
"diversity",
"diverseness",
"diversification",
"diversion",
"divestiture",
"divestment",
"division",
"divination",
"divinity",
"divisibility",
"divisiveness",
"divorcement",
"divulgence",
"divulsion",
"dizygoticity",
"dizziness",
"docility",
"documentation",
"doggedness",
"dogmatism",
"dogmatization",
"dolichocephalism",
"dolichocephaly",
"dolichomorphy",
"dolorousness",
"domesticity",
"domesticality",
"domestication",
"dominance",
"dominancy",
"domination",
"donation",
"doneness",
"dormancy",
"dorsality",
"dosing",
"dottiness",
"doubtfulness",
"dowdiness",
"drabness",
"draftiness",
"drainage",
"dramatization",
"drawing",
"dreadfulness",
"dreamlessness",
"dreaminess",
"dreariness",
"dressing",
"drift",
"drinkability",
"drowning",
"drowsiness",
"drunkenness",
"drunkenness",
"dryness",
"duality",
"dubiousness",
"dubiety",
"ductility",
"dullness",
"dumbness",
"dumpiness",
"duplexity",
"duplication",
"duplicature",
"durability",
"duskiness",
"dustiness",
"dutifulness",
"dwarfishness",
"dynamism",
"dynamicity",
"dynamization",
"dysfunctionality",
"dysplasia",
"eagerness",
"earliness",
"earnestness",
"earthliness",
"earthiness",
"ear-mindedness",
"easiness",
"easygoingness",
"ebullience",
"eccentricity",
"echinulation",
"echogenicity",
"echolucency",
"economicalness",
"economization",
"ecphoria",
"edentulousness",
"edibility",
"edification",
"educability",
"education",
"eduction",
"edulcoration",
"eeriness",
"effacement",
"effectiveness",
"effectuality",
"effectualness",
"effectuation",
"effeminacy",
"effervescence",
"effervescence",
"effeteness",
"efficacy",
"efficacity",
"efficaciousness",
"efficiency",
"efficience",
"efflorescence",
"efflorescence",
"effortlessness",
"effulgence",
"effusiveness",
"egestion",
"egocentricity",
"egocentrism",
"ejection",
"elaborateness",
"elaboration",
"elasticity",
"elation",
"elation",
"elderliness",
"election",
"electivity",
"electiveness",
"electricity",
"electrification",
"electrocution",
"electrogenicity",
"electromagnetism",
"electromagnetics",
"electronegativity",
"electrophilicity",
"electropositivity",
"electrovalence",
"electroversion",
"elegance",
"elementariness",
"elicitation",
"elision",
"eligibility",
"elimination",
"elongation",
"elopement",
"eloquence",
"elucidation",
"elusion",
"elusiveness",
"elution",
"emaciation",
"emanation",
"emancipation",
"emasculation",
"embalmment",
"embargo",
"embarkation",
"embarkment",
"embarrassment",
"embedment",
"embedding",
"embellishment",
"embezzlement",
"embitterment",
"embodiment",
"emboldenment",
"embolisation",
"embossment",
"embrace",
"embracement",
"embrocation",
"embroidery",
"embroilment",
"emendation",
"emergence",
"emigration",
"eminence",
"eminency",
"emission",
"emolliency",
"emotionality",
"emotionlessness",
"emotivity",
"emotiveness",
"emphasis",
"emphaticness",
"employment",
"employability",
"empowerment",
"emptiness",
"emulation",
"emulsion",
"emulsification",
"enablement",
"enactment",
"encampment",
"encapsulation",
"encasement",
"encephalitogenicity",
"enchainment",
"enchantment",
"encirclement",
"enclosure",
"encoding",
"encodement",
"encompassment",
"encounter",
"encouragement",
"encroachment",
"encrustation",
"encumbrance",
"endangerment",
"endearment",
"endeavor",
"endemicity",
"endemism",
"endlessness",
"endocrinosity",
"endogenicity",
"endogeneity",
"endomorphy",
"endorsement",
"endothelialization",
"endotoxicity",
"endowment",
"endurability",
"endurance",
"energization",
"enervation",
"enfeeblement",
"enfoldment",
"enforcement",
"enforceability",
"enfranchisement",
"engagement",
"engineer",
"engraftment",
"engraving",
"engrossment",
"engulfment",
"enhancement",
"injunction",
"enjoyment",
"enjoyableness",
"enjoyability",
"enlargement",
"enlightenment",
"enlistment",
"enlivenment",
"enmeshment",
"ennoblement",
"enormousness",
"enormity",
"enrichment",
"enrollment",
"enshrinement",
"ensilage",
"enslavement",
"ensnarement",
"entailment",
"entanglement",
"entry",
"enteropathogenicity",
"enterotoxigenicity",
"entertainment",
"enthrallment",
"enthusiasm",
"enticement",
"entirety",
"entireness",
"entitlement",
"entombment",
"entrainment",
"entrancement",
"entrapment",
"entreaty",
"entrenchment",
"entrustment",
"entwinement",
"enucleation",
"enumeration",
"enunciation",
"envelopment",
"envenomation",
"enviability",
"envy",
"enviousness",
"environmentality",
"enwrapment",
"enzooticity",
"ephemerality",
"epidemicity",
"epilation",
"epileptogenicity",
"episodicity",
"epithelialization",
"epizooticity",
"equability",
"equality",
"equalization",
"equanimity",
"equation",
"equimolarity",
"equipment",
"equipotency",
"equipotence",
"equipotentiality",
"equitableness",
"equity",
"equitability",
"equitoxicity",
"equivalence",
"equivalency",
"equivocality",
"equivocalness",
"equivocity",
"equivocation",
"eradication",
"erasure",
"erection",
"erectness",
"erectility",
"erosion",
"erogeneity",
"erosiveness",
"erosivity",
"eroticism",
"eroticization",
"erotization",
"erotosexuality",
"erroneousness",
"eructation",
"erudition",
"eruption",
"eruptiveness",
"eruptivity",
"erythemogenicity",
"escalation",
"escape",
"esotericity",
"espousal",
"essentiality",
"essentialness",
"establishment",
"esterification",
"estimability",
"estimate",
"estimation",
"estrangement",
"estrogenicity",
"estrogenization",
"ethereality",
"etherization",
"ethicality",
"ethnicity",
"eukaryoticity",
"eunuchoidism",
"euploidy",
"evacuation",
"evasion",
"evaluability",
"evaluation",
"evaluativeness",
"evanescence",
"evaporation",
"evasiveness",
"evenness",
"eventfulness",
"eventuation",
"everlastingness",
"everydayness",
"eviction",
"evidence",
"evisceration",
"evocativeness",
"evocation",
"evolutivity",
"evolutiveness",
"evolution",
"evolvement",
"exacerbation",
"exactitude",
"exactness",
"exaction",
"exaggeration",
"exaltation",
"examination",
"exasperation",
"excavation",
"exceedance",
"excellency",
"excellence",
"exception",
"exceptionality",
"excessiveness",
"exchange",
"exchangeability",
"excision",
"excitability",
"excitement",
"exclamation",
"exclusion",
"exclusivity",
"exclusiveness",
"excogitation",
"excommunication",
"excoriation",
"excretion",
"exculpation",
"excuse",
"execration",
"execution",
"exemplariness",
"exemplarity",
"exemplification",
"exemption",
"exemption",
"exergonicity",
"exertion",
"exfoliation",
"exhalation",
"exhaustion",
"exhaustiveness",
"exhaustivity",
"exhibition",
"exhilaration",
"exhortation",
"exhumation",
"exigence",
"exigency",
"exiguity",
"exiguousness",
"existence",
"existentiality",
"exogenicity",
"exoneration",
"exorbitance",
"exorcism",
"exosmosis",
"exothermicity",
"exotoxicity",
"expansion",
"expandability",
"expansiveness",
"expansivity",
"expatriation",
"expectation",
"expectance",
"expectancy",
"expectoration",
"expediency",
"expedience",
"expedition",
"expeditiousness",
"expulsion",
"expellation",
"expenditure",
"expense",
"expendability",
"expense",
"expensiveness",
"experience",
"experimentation",
"expertness",
"expiation",
"expiration",
"explanation",
"explicability",
"explication",
"explicitness",
"explosion",
"exploitation",
"exploitativeness",
"exploration",
"explosiveness",
"explosivity",
"exponentiality",
"export",
"exportation",
"exportability",
"exposition",
"exposal",
"expostulation",
"expression",
"expressiveness",
"expressivity",
"expropriation",
"expurgation",
"exquisiteness",
"exsanguination",
"exsanguinity",
"exsection",
"extemporaneousness",
"extemporization",
"extension",
"extensiveness",
"extensivity",
"extenuation",
"exteriority",
"exteriorization",
"extermination",
"externalization",
"extinction",
"extinguishment",
"extirpation",
"extortion",
"extracellularity",
"extracorporeality",
"extraction",
"extractability",
"extractableness",
"extradition",
"extraneousness",
"extraordinariness",
"extrapolation",
"extraterritoriality",
"extravagance",
"extravasation",
"extremity",
"extremeness",
"extremism",
"extrication",
"extrinsicness",
"extrovertedness",
"extrusion",
"extubation",
"exuberance",
"exuberancy",
"exultation",
"eyelessness",
"fabrication",
"face-off",
"facelessness",
"facetiousness",
"facilitativeness",
"factitiousness",
"factorization",
"factuality",
"factualness",
"facultativeness",
"fade-out",
"failure",
"faintness",
"fairness",
"faithfulness",
"faithlessness",
"fall",
"fallaciousness",
"fallibility",
"falseness",
"falsity",
"falsification",
"familiality",
"familiarity",
"familiarization",
"fancifulness",
"fantasticality",
"faradization",
"farawayness",
"farcicality",
"farrowing",
"farsightedness",
"fascicularity",
"fashionability",
"fashionableness",
"fastness",
"fast",
"fastidiousness",
"fatness",
"fatality",
"fatalness",
"fatefulness",
"fatherlessness",
"fathomlessness",
"fattiness",
"fatuousness",
"fatuity",
"faultlessness",
"faultiness",
"favorableness",
"favorability",
"fearfulness",
"fearlessness",
"fearsomeness",
"feasibility",
"feasibleness",
"featherbedding",
"febrility",
"fecklessness",
"fecundity",
"fecundation",
"federation",
"feebleness",
"felicity",
"felicitousness",
"feloniousness",
"femaleness",
"femininity",
"fenestration",
"fermentation",
"ferocity",
"ferociousness",
"ferromagnetism",
"fertility",
"fertilization",
"fervency",
"fervidity",
"fervor",
"fervidness",
"festination",
"festivity",
"festiveness",
"fetidness",
"fetidity",
"feverishness",
"feyness",
"fibrillarity",
"fibrillation",
"fibrinogenicity",
"fibroelasticity",
"fibrogenicity",
"fibrousness",
"fibrosity",
"fickleness",
"fictitiousness",
"fidgetiness",
"fierceness",
"fieriness",
"figurativeness",
"filamentousness",
"filing",
"filiality",
"filminess",
"filtration",
"filterability",
"filthiness",
"filtration",
"fimbriation",
"finality",
"finalization",
"financing",
"fineness",
"finiteness",
"finity",
"finitude",
"firing",
"firmness",
"fiscality",
"fissility",
"fissiparousness",
"fitness",
"fitting",
"fitment",
"fitfulness",
"fixation",
"flabbiness",
"flaccidity",
"flaccidness",
"flagellation",
"flagrancy",
"flakiness",
"flamboyance",
"flammability",
"flare-up",
"flatness",
"flattery",
"flatulence",
"flatulency",
"flawlessness",
"fleetness",
"fleetingness",
"fleshiness",
"flexion",
"flexure",
"flexibility",
"flick",
"flicker",
"flightlessness",
"flimsiness",
"flip",
"flippancy",
"flirtation",
"flotation",
"flocculence",
"flocculency",
"floppiness",
"floridity",
"floridness",
"flowering",
"flowerlessness",
"fluctuance",
"fluctuancy",
"fluctuation",
"fluency",
"fluffiness",
"fluidity",
"fluidization",
"fluorescence",
"fluoridation",
"fluoridization",
"fluorination",
"flushing",
"flushness",
"flight",
"flying",
"foaminess",
"focality",
"fogginess",
"foliaceousness",
"follicularity",
"follow-up",
"follow-up",
"fomentation",
"fondness",
"foolhardiness",
"foolishness",
"forbearance",
"forcement",
"forcefulness",
"forcibility",
"foreclosure",
"foreignness",
"foreknowledge",
"foreseeability",
"forestallment",
"forfeiture",
"forgery",
"forgetfulness",
"forgiveness",
"forlornness",
"formation",
"formality",
"formalization",
"formativeness",
"formlessness",
"formulation",
"fornication",
"forthcomingness",
"forthrightness",
"fortification",
"fortuitousness",
"fortuity",
"forwardness",
"fossilization",
"fostering",
"foulness",
"foundation",
"foxiness",
"fractionation",
"fractiousness",
"fracture",
"fragility",
"fragmentation",
"fragmentariness",
"fragrance",
"frailty",
"frailness",
"frankness",
"fraternization",
"fraudulence",
"freakishness",
"freedom",
"freeness",
"freezing",
"freeze-up",
"frequency",
"frequence",
"frequentation",
"freshness",
"fretfulness",
"friability",
"friendlessness",
"friendliness",
"frightfulness",
"frigidness",
"frigidity",
"frivolity",
"frivolousness",
"frizziness",
"frontality",
"frostiness",
"frothiness",
"fructification",
"frugality",
"fruitfulness",
"fruitlessness",
"frustration",
"fugitiveness",
"fulfillment",
"fulguration",
"fullness",
"fulminancy",
"fulmination",
"fulsomeness",
"fumigation",
"functionality",
"fundamentality",
"fungation",
"fungosity",
"funniness",
"furiousness",
"furriness",
"furtherance",
"furtiveness",
"fusion",
"fusibility",
"fussiness",
"futility",
"futurity",
"futurelessness",
"fuzziness",
"gallantry",
"galvanization",
"garnishment",
"garrulity",
"garrulousness",
"gaseousness",
"gasification",
"gasp",
"gathering",
"gaucheness",
"gauntness",
"gawkiness",
"gayness",
"gaiety",
"gelation",
"gelatinization",
"gelatinousness",
"gemellarity",
"generality",
"generalism",
"generalizability",
"generalization",
"generation",
"generativeness",
"generativity",
"genericism",
"genericity",
"genericness",
"generosity",
"generousness",
"geniality",
"genicity",
"genitality",
"genotoxicity",
"genotypicity",
"gentility",
"gentleness",
"genuflection",
"genuineness",
"genuinity",
"genus-specificity",
"geometricity",
"germination",
"gesticulation",
"ghostliness",
"gibbosity",
"gibbousness",
"giddiness",
"giftedness",
"gingerness",
"gift",
"givenness",
"glabrousness",
"gladness",
"glamorization",
"glamorousness",
"glandularity",
"glandulousness",
"glassiness",
"glaucousness",
"glibness",
"globality",
"globularity",
"globularness",
"gloominess",
"glorification",
"gloriousness",
"glow",
"glucogenicity",
"glumness",
"glutinousness",
"glycerolization",
"glycosylation",
"glycosylation",
"godlessness",
"goitrogenicity",
"goodness",
"good-naturedness",
"goriness",
"government",
"governance",
"gracefulness",
"gracelessness",
"graciousness",
"graciosity",
"grading",
"gradualness",
"graduality",
"graduation",
"grammaticality",
"grammaticalness",
"gram-negativity",
"gram-postitivity",
"grandness",
"grandiosity",
"granularity",
"granulation",
"graphicness",
"grasp",
"gratefulness",
"gratification",
"gratuity",
"gratuitousness",
"graveness",
"gravitation",
"greasiness",
"greatness",
"greediness",
"greenness",
"greenishness",
"greeting",
"gregariousness",
"greyness",
"grievousness",
"grimness",
"grittiness",
"grogginess",
"grooming",
"grossness",
"grotesqueness",
"grounding",
"groundlessness",
"grouping",
"growth",
"grown-up",
"gruesomeness",
"gruffness",
"grumpiness",
"grunt",
"guess",
"guilefulness",
"guilelessness",
"guiltlessness",
"guiltiness",
"guilt",
"gullibility",
"gumminess",
"gutlessness",
"gyration",
"gyrosity",
"habitability",
"habitualness",
"habituation",
"hack",
"haggardness",
"hairlessness",
"hairiness",
"hallucination",
"halogenation",
"halophilicity",
"handsomeness",
"handiness",
"hanging",
"hang-up",
"hankering",
"haplessness",
"haploidentity",
"happiness",
"harassment",
"hardness",
"hardiness",
"harm",
"harmfulness",
"harmlessness",
"harmoniousness",
"harmonization",
"harshness",
"harvesting",
"hastiness",
"hate",
"hatred",
"hatefulness",
"haughtiness",
"haulage",
"hazardousness",
"haziness",
"headlessness",
"healing",
"healthfulness",
"healthiness",
"hearing",
"heartlessness",
"heartiness",
"heating",
"heat-inactivation",
"heave",
"heaviness",
"hedonicity",
"heedfulness",
"heedlessness",
"heftiness",
"heinousness",
"helicality",
"help",
"helping",
"helpfulness",
"helplessness",
"haemagglutination",
"hematophagy",
"hematotoxicity",
"hemisection",
"hemisphericity",
"hemizygosity",
"hemolysis",
"hemolyzation",
"hemorrhagicity",
"heparinization",
"hepatectomization",
"hepatization",
"hepatocarcinogenicity",
"hepatocellularity",
"hepatotoxicity",
"herbaceousness",
"herbalism",
"herbivory",
"hereditariness",
"heredofamiliality",
"heritability",
"hermeticity",
"herniation",
"heroism",
"hesitancy",
"hesitance",
"hesitation",
"heterocellularity",
"heterochirality",
"heterochronicity",
"heterodispersity",
"heterodispersion",
"heterodoxy",
"heteroeciousness",
"heterogeneousness",
"heterogeneity",
"heterogenicity",
"heterogenousness",
"heteroimmunity",
"heteromorphy",
"heteroploidy",
"heterosexuality",
"heterotopicity",
"heterozygosity",
"hexagonality",
"hibernation",
"hideousness",
"hieroglyphicity",
"height",
"highness",
"high-mindedness",
"hijacking",
"hilariousness",
"hilliness",
"hindrance",
"hire",
"hirsuteness",
"hirsutism",
"hirudinization",
"hiss",
"histocompatibility",
"histoincompatibility",
"historicity",
"hit",
"hitch",
"hoariness",
"hoarseness",
"hoax",
"holding",
"holisticity",
"holler",
"hollowness",
"holoendemicity",
"holiness",
"homelessness",
"homelikeness",
"homeliness",
"homeoviscosity",
"homesickness",
"homicidality",
"homogeneity",
"homogeneousness",
"homogenicity",
"homogenization",
"homogeny",
"homonomy",
"homonymity",
"homonymy",
"homosexuality",
"homotopicity",
"homotopy",
"homotypicity",
"homozygosity",
"honesty",
"honk",
"hook-up",
"hope",
"hopefulness",
"hopelessness",
"horizontality",
"hornedness",
"hornlessness",
"horniness",
"horribleness",
"horridness",
"hospitality",
"hospitability",
"hospitalization",
"hostility",
"hotness",
"howl",
"huff",
"hug",
"hugeness",
"humanness",
"humanity",
"humaneness",
"humanization",
"humility",
"humbleness",
"humidity",
"humiliation",
"humorousness",
"hunger",
"hunting",
"hurtfulness",
"husbandry",
"huskiness",
"hybridism",
"hybridity",
"hybridisation",
"hydration",
"hydraulicity",
"hydroelectricity",
"hydrogenation",
"hydrogenization",
"hydropathicity",
"hydrophilicity",
"hydrophily",
"hydrophobicity",
"hydroxylation",
"hygroscopicity",
"hyperactivation",
"hyperactivity",
"hyperacuity",
"hyperaffectivity",
"hyperbaricity",
"hyperbolicity",
"hypercellularity",
"hyperchromaticity",
"hyperchromicity",
"hypercoagulability",
"hyperdiploidy",
"hyperdynamia",
"hyperimmunity",
"hyperimmunization",
"hyperluteinization",
"hypernormality",
"hyperosmoticity",
"hyperplasticity",
"hyperploidy",
"hyperpolarization",
"hyperreactivity",
"hyperreactiveness",
"hyperresponsivity",
"hyperresponsiveness",
"hypersalinity",
"hypersensitivity",
"hypersensitiveness",
"hypertensiveness",
"hypertonicity",
"hypertoxicity",
"hypertrophication",
"hypervariability",
"hyperventilation",
"hyphenation",
"hypnogenicity",
"hypnoidization",
"hypoactivity",
"hypobaricity",
"hypocellularity",
"hypochromicity",
"hypocoagulability",
"hypodensity",
"hypodiploidy",
"hypodynamia",
"hypoechoicity",
"hypofrontality",
"hypognathism",
"hypomania",
"hypophysectomization",
"hypopigmentation",
"hypoplasticity",
"hyporeactiveness",
"hyporeactivity",
"hyposensitivity",
"hyposensitiveness",
"hypotriploidy",
"hypoxicity",
"hypsodonty",
"hysteria",
"iatrogenicity",
"ichthyotoxicity",
"ictericity",
"icterogenicity",
"iciness",
"ideality",
"idealness",
"idealism",
"idealization",
"identicality",
"identicalness",
"identifiability",
"identification",
"idiomaticness",
"idiomaticity",
"idleness",
"idolization",
"ignition",
"ignominiousness",
"ignorance",
"illness",
"illegality",
"illegibility",
"illegitimacy",
"illiberality",
"illicitness",
"illogicality",
"illogicalness",
"illumination",
"illusiveness",
"illusoriness",
"illustration",
"illustriousness",
"ill-treatment",
"imaginability",
"imaginativeness",
"imbecility",
"imbibition",
"imitation",
"imitativeness",
"immanence",
"immateriality",
"immaturity",
"immatureness",
"immediateness",
"immediacy",
"immensity",
"immersal",
"immigration",
"imminency",
"immiscibility",
"immobility",
"immobilization",
"immoderacy",
"immodesty",
"immolation",
"immorality",
"immortality",
"immortalization",
"immovability",
"immunity",
"immunization",
"immunocompetence",
"immunocompetency",
"immunodeficiency",
"immunodominance",
"immunodominancy",
"immunoflourescence",
"immunofluorescence",
"immunogenicity",
"immunoincompetence",
"immunoincompetency",
"immunoisolation",
"immunopathogenicity",
"immunopositivity",
"immunoprecipitability",
"immunoprecipitation",
"immunoprotectivity",
"immunoreaction",
"immunoreactivity",
"immunosorbency",
"immunosorbence",
"immunostaining",
"immunosuppression",
"immunosuppressiveness",
"immunosuppressivity",
"immunotropicity",
"immurement",
"immutability",
"impaction",
"impactedness",
"impairment",
"impalement",
"impartment",
"impartiality",
"impassableness",
"impassability",
"impassiveness",
"impassivity",
"impatency",
"impatience",
"impeachment",
"impeccability",
"impedance",
"impendence",
"impenetrability",
"impenitence",
"imperativeness",
"imperfection",
"imperfectness",
"imperforation",
"imperilment",
"imperiousness",
"imperiosity",
"impermanence",
"impermanency",
"impermeableness",
"impermeability",
"impersonality",
"impersonalness",
"impersonation",
"impertinence",
"imperturbability",
"imperviousness",
"impetuosity",
"impetuousness",
"impingement",
"impishness",
"implantation",
"implantability",
"implementation",
"implication",
"implicitness",
"implicity",
"implosion",
"implication",
"impoliteness",
"imponderability",
"imponderableness",
"importation",
"importance",
"importunity",
"imposition",
"impossibility",
"impotence",
"impotency",
"impoundment",
"impracticability",
"impracticableness",
"impracticality",
"imprecation",
"impregnability",
"impregnation",
"impression",
"impressment",
"impressionability",
"impressionableness",
"impressiveness",
"imprisonment",
"improbability",
"impropriety",
"improvement",
"improval",
"improvidence",
"improvisation",
"imprudence",
"impudence",
"impugnment",
"impulsiveness",
"impulsivity",
"impurity",
"imputation",
"inaccessibility",
"inaccuracy",
"inactivation",
"inactivity",
"inactiveness",
"inadequacy",
"inadequateness",
"inadmissibility",
"inadvertence",
"inadvertency",
"inagglutinability",
"inalienability",
"inanity",
"inapplicability",
"inappropriateness",
"inaptness",
"inarticulateness",
"inattentiveness",
"inaudibility",
"inauguration",
"inauspiciousness",
"incalculability",
"incandescence",
"incapability",
"incapacitation",
"incarceration",
"incautiousness",
"incendiarism",
"incessancy",
"incestuousness",
"inchoateness",
"incineration",
"incipiency",
"incipience",
"incision",
"incisiveness",
"incitement",
"inclemency",
"inclination",
"inclusion",
"inclusiveness",
"inclusivity",
"incoagulability",
"incoherence",
"incoherency",
"incomparability",
"incompatibility",
"incompetence",
"incompetency",
"incompleteness",
"incomprehensibility",
"incompressibility",
"inconceivability",
"inconclusiveness",
"incongruity",
"incongruousness",
"inconsequence",
"inconsequentiality",
"inconsiderateness",
"inconsistency",
"inconsolability",
"inconsolableness",
"inconspicuousness",
"inconstancy",
"incontestability",
"incontinence",
"incontrovertibility",
"inconvenience",
"inconvertibility",
"incoordination",
"incorporation",
"incorrectness",
"incorrigibility",
"incorruptibility",
"increasement",
"incredibility",
"incredulousness",
"incrementalism",
"incrementality",
"incrimination",
"incubation",
"inculcation",
"incumbency",
"incurrence",
"incurability",
"indebtedness",
"indecency",
"indecisiveness",
"indecorousness",
"indefatigability",
"indefensibility",
"indefiniteness",
"indelibility",
"indelicacy",
"indemnification",
"indentation",
"indention",
"independence",
"independency",
"indestructibility",
"indestructibleness",
"indeterminacy",
"indetermination",
"indeterminateness",
"indeterminism",
"indexing",
"indexation",
"indication",
"indicativeness",
"indictment",
"indifference",
"indigenousness",
"indigence",
"indigency",
"indigestibility",
"indigestibleness",
"indignance",
"indignation",
"indirectness",
"indirection",
"indiscernibility",
"indiscretion",
"indiscriminateness",
"indispensability",
"indisposition",
"indistinctness",
"indistinguishability",
"individuality",
"individualization",
"indivisibility",
"indivisibleness",
"indoctrination",
"indolence",
"indolency",
"indubitability",
"indubitableness",
"inducement",
"induction",
"inducibility",
"induction",
"inductance",
"inductiveness",
"inductivity",
"indulgence",
"indulgence",
"industrialization",
"industriousness",
"inebriation",
"inedibility",
"ineffectiveness",
"ineffectivity",
"ineffectuality",
"inefficiency",
"inelasticity",
"ineligibility",
"ineluctability",
"ineptitude",
"ineptness",
"ineradicability",
"inertia",
"inertness",
"inertion",
"inescapability",
"inestimableness",
"inevitability",
"inevitableness",
"inexactitude",
"inexactness",
"inexcusability",
"inexhaustibility",
"inexhaustibleness",
"inexorability",
"inexpedience",
"inexpediency",
"inexpensiveness",
"inexpertness",
"inextricability",
"infallibility",
"infamy",
"infantility",
"infatuation",
"infection",
"infectedness",
"infectibility",
"infectiousness",
"infectiosity",
"infectiveness",
"inference",
"inferiority",
"infertility",
"infestation",
"infestment",
"infiltration",
"infiniteness",
"infinitesimality",
"infirmity",
"inflammation",
"inflammability",
"inflatability",
"inflation",
"inflection",
"inflexibility",
"infliction",
"informality",
"informativeness",
"informativity",
"informedness",
"infrequency",
"infrequence",
"infringement",
"infusion",
"infusibility",
"ingeniousness",
"ingenuousness",
"ingestion",
"ingratiation",
"inhabitation",
"inhabitability",
"inhalation",
"inhaling",
"inherence",
"inherency",
"inheritance",
"inhibition",
"inhibitability",
"inhibitedness",
"inhospitability",
"inhumanity",
"iniquity",
"iniquitousness",
"initialness",
"initiation",
"injection",
"injectability",
"injudiciousness",
"injury",
"injuriousness",
"innateness",
"innerness",
"innervation",
"innocence",
"innocuousness",
"innovation",
"innovativeness",
"inoculability",
"inoculation",
"inoffensiveness",
"inoperability",
"inoperativeness",
"inoperativity",
"inopportuneness",
"inosculation",
"inotropicity",
"input",
"inquiry",
"inquisitiveness",
"insalubrity",
"insanity",
"insatiability",
"insatiableness",
"inscription",
"inscrutability",
"insectivory",
"insecurity",
"insemination",
"insensibility",
"insensitivity",
"insensitiveness",
"inseparability",
"insertion",
"insideness",
"insidiousness",
"insidiosity",
"insignificance",
"insignificancy",
"insincerity",
"insinuation",
"insipidness",
"insipidity",
"insistance",
"insistence",
"insolence",
"insolubility",
"insolubleness",
"insolvency",
"insonation",
"insouciance",
"inspection",
"inspiration",
"inspissation",
"installation",
"instantaneousness",
"instantaneity",
"instigation",
"instilation",
"instillment",
"instinctiveness",
"institution",
"institutionality",
"institutionalization",
"instruction",
"instructiveness",
"instrumentality",
"insubordination",
"insubstantiality",
"insufferability",
"insufficiency",
"insufficience",
"insularity",
"insulation",
"insulinogenicity",
"insulin dependency",
"insupportability",
"insurability",
"insurance",
"insurmountability",
"intactness",
"intangibility",
"integrality",
"integration",
"integrativeness",
"intellectualism",
"intellectuality",
"intellectualization",
"intelligence",
"intelligibility",
"intelligibleness",
"intemperance",
"intemperateness",
"intention",
"intensity",
"intenseness",
"intensification",
"intensiveness",
"intentness",
"intentionality",
"interment",
"interaction",
"interactivity",
"interactiveness",
"intercalarity",
"intercalation",
"intercession",
"intercellularity",
"interception",
"interchangeability",
"interchangeableness",
"intercommunication",
"intercurrence",
"interdependence",
"interdependency",
"interdiction",
"interdigitation",
"interdisciplinarity",
"interest",
"interestingness",
"interface",
"interfacing",
"interference",
"interiority",
"interjection",
"interlacement",
"interlinkage",
"intermarriage",
"intermediacy",
"interminableness",
"interminability",
"intermittency",
"intermittence",
"intermixture",
"internment",
"internship",
"internality",
"internalization",
"internationality",
"internationalization",
"interpellation",
"interpenetration",
"interpersonality",
"interpersonalness",
"interpolation",
"interposition",
"interposal",
"interpretation",
"interrelation",
"interrelationship",
"interrogation",
"interruption",
"interrupture",
"intersection",
"intersexualism",
"interspecificity",
"interspersion",
"intertwinement",
"intervention",
"intimacy",
"intimateness",
"intimation",
"intimidation",
"intolerability",
"intolerance",
"intoxication",
"intracapsularity",
"intracellularity",
"intractability",
"intractableness",
"intramolecularity",
"intramuscularity",
"intransigence",
"intransitivity",
"intransitiveness",
"intra-articularity",
"intrepidity",
"intricacy",
"intrinsicality",
"introduction",
"introspection",
"introspectiveness",
"introversion",
"intrusion",
"intrusiveness",
"intubation",
"intuition",
"intuitiveness",
"intumescence",
"inundation",
"inurement",
"invasion",
"invagination",
"invalidity",
"invalidness",
"invalidation",
"invariability",
"invariableness",
"invasiveness",
"invasivity",
"invention",
"inventiveness",
"inversion",
"investment",
"investigation",
"invidiousness",
"invigilation",
"invigoration",
"invincibility",
"invincibleness",
"inviolability",
"inviolateness",
"invisibility",
"invitation",
"invocation",
"involuntariness",
"involuntarity",
"involution",
"involvement",
"invulnerability",
"inwardness",
"iodination",
"iodization",
"ionicity",
"ionization",
"ionogenicity",
"ipsilaterality",
"irascibility",
"iridescence",
"irradiation",
"irrationality",
"irreconcilability",
"irreducibility",
"irrefutability",
"irregularity",
"irrelevance",
"irrelevancy",
"irremediability",
"irremovability",
"irreparability",
"irreplaceability",
"irrepressibility",
"irresolution",
"irresoluteness",
"irresponsibility",
"irretrievability",
"irreverence",
"irreversibility",
"irrevocability",
"irrigation",
"irritability",
"irritableness",
"irritation",
"isodiametricity",
"isogeneity",
"isogenicity",
"isolation",
"isometricity",
"isomorphy",
"isomorphicity",
"isomorphism",
"isotonicity",
"isotropicity",
"isotypicality",
"iso-osmoticity",
"issuance",
"issue",
"italicization",
"itchiness",
"itemization",
"iteration",
"iteroparity",
"itinerancy",
"jauntiness",
"jealousy",
"jejuneness",
"jeopardization",
"jerkiness",
"jitteriness",
"jocoseness",
"jocosity",
"jocularity",
"jogging",
"jointness",
"jolliness",
"jollity",
"joviality",
"joyfulness",
"joylessness",
"joyousness",
"judgement",
"judiciousness",
"juiciness",
"jump",
"jumpiness",
"justice",
"justness",
"justifiability",
"justification",
"juvenility",
"juxtaposition",
"keenness",
"ketogenicity",
"kick",
"kidnapping",
"killing",
"kindness",
"kindliness",
"kinkiness",
"knottiness",
"knowledge",
"knowledgeability",
"knowledgeableness",
"labeling",
"labiality",
"lability",
"laboriousness",
"laceration",
"lack",
"lacrimation",
"lactiferousness",
"lacunarity",
"laciness",
"ladenness",
"ladylikeness",
"lambency",
"lameness",
"lamellarity",
"lamentation",
"lamentability",
"laminarity",
"landing",
"landlessness",
"languidness",
"languidity",
"lankness",
"lanuginousness",
"lap",
"lapinization",
"largeness",
"lasciviousness",
"lashing",
"lateness",
"latency",
"laudableness",
"laudability",
"lavishness",
"lawfulness",
"lawlessness",
"laxness",
"laxity",
"laxativeness",
"laziness",
"leadenness",
"leaflessness",
"leafiness",
"leakage",
"leakiness",
"leanness",
"leatheriness",
"lecherousness",
"lecture",
"leftness",
"left handedness",
"legality",
"legalization",
"leggedness",
"legibility",
"legislation",
"legitimacy",
"legitimation",
"legitimatization",
"leglessness",
"leisureliness",
"lengthening",
"lengthiness",
"leniency",
"leprousness",
"lethality",
"lethalness",
"lethargy",
"leukemogenicity",
"leukotoxicity",
"levelness",
"levitation",
"lewdness",
"lexicality",
"liability",
"liaison",
"liberality",
"liberalness",
"liberalization",
"liberation",
"libidinousness",
"licensure",
"licentiousness",
"licking",
"lifelessness",
"lifelikeness",
"ligation",
"lightness",
"lighting",
"lighting",
"light-heartedness",
"light-inducement",
"light-mindedness",
"likeableness",
"likability",
"likeness",
"likeliness",
"likelihood",
"limberness",
"liminality",
"limitation",
"limitlessness",
"limpness",
"limpidity",
"lineup",
"lineality",
"linearity",
"linearization",
"linkage",
"lionization",
"lipogenicity",
"lipophilicity",
"lipotropism",
"lip-reading",
"liquefaction",
"liquification",
"liquidity",
"liquidation",
"lissencephaly",
"lissomness",
"listing",
"listlessness",
"literalness",
"literality",
"literacy",
"lithogenicity",
"litigation",
"litigiousness",
"litigiosity",
"littleness",
"living",
"liveness",
"liveliness",
"lividity",
"lividness",
"loading",
"lobbying",
"lobedness",
"lobularity",
"lobularness",
"localness",
"localization",
"location",
"locomotiveness",
"locomotivity",
"locularity",
"loculation",
"loculation",
"lodgement",
"lodging",
"loftiness",
"logicalness",
"logicality",
"loneliness",
"lonesomeness",
"length",
"longness",
"longing",
"longitudinality",
"long-livedness",
"long-windedness",
"lookup",
"looniness",
"looseness",
"loosening",
"loquacity",
"loquaciousness",
"loss",
"loudness",
"lousiness",
"lovelessness",
"loveliness",
"lovesickness",
"lowness",
"lowliness",
"low density",
"low dose",
"low field",
"low grade",
"low risk",
"loyalty",
"lubrication",
"lucency",
"lucidity",
"lucklessness",
"luckiness",
"lucrativeness",
"lugubriousness",
"lukewarmness",
"luminol-dependence",
"luminol-enhancement",
"luminosity",
"luminousness",
"lumpiness",
"lunge",
"lung colonization",
"luridness",
"lusciousness",
"lust",
"luteinization",
"luxuriance",
"lymphocyte-predominance",
"lymphocyte-specificity",
"lymphocytotoxicity",
"lymphotropicity",
"lyophilization",
"lyotropicity",
"lypophilicity",
"lysis",
"lysogenicity",
"lysogenization",
"maceration",
"maceration",
"macromolecularity",
"macronodularity",
"macrovascularity",
"macularity",
"madness",
"magicity",
"magnanimity",
"magnetism",
"magnetization",
"magnificence",
"magnification",
"magniloquence",
"mailing",
"maim",
"maintenance",
"maintainability",
"mischief-making",
"merry-making",
"decision-making",
"lovemaking",
"makeup",
"maladaptiveness",
"maladaptivity",
"maladjustment",
"maladroitness",
"malaxation",
"maleness",
"malevolence",
"malformation",
"maliciousness",
"malignment",
"malignity",
"malignity",
"malignancy",
"malignance",
"malleability",
"malnutrition",
"maltreatment",
"mamillation",
"mamillation",
"management",
"manageability",
"manageableness",
"managerialism",
"manifestation",
"manifestness",
"manifestation",
"manifoldness",
"manipulation",
"manliness",
"mannose-resistance",
"manoeuvrability",
"manumission",
"mapping",
"marbleization",
"marginality",
"marination",
"markup",
"markedness",
"marketability",
"marriageability",
"marriage",
"marsupialization",
"marvelousness",
"masculinity",
"masculinization",
"massiveness",
"massivity",
"mass production",
"masterfulness",
"masterlessness",
"masterliness",
"mastication",
"psychon",
"masturbation",
"matching",
"mating",
"materiality",
"materialization",
"maternality",
"maternalism",
"matriculation",
"matrilineality",
"matrocliny",
"maturation",
"maturation",
"maturity",
"matureness",
"mawkishness",
"maximality",
"maximization",
"meagerness",
"meanness",
"meaningfulness",
"meaninglessness",
"measurability",
"measurement",
"measurelessness",
"meatiness",
"mechanicality",
"mechanization",
"meddlesomeness",
"mediation",
"mediacy",
"medicality",
"medication",
"mediocrity",
"meditation",
"meditativeness",
"meekness",
"megalocephaly",
"melanogenicity",
"melioration",
"mellowness",
"melodiousness",
"memorability",
"memorableness",
"memorialization",
"memorization",
"mendacity",
"menstruation",
"mental illness",
"mental retardation",
"mercerization",
"merchandiser",
"mercifulness",
"mercilessness",
"mercuriality",
"mercurialness",
"mercurialization",
"meretriciousness",
"mergence",
"merger",
"meritoriousness",
"merriness",
"mesmerization",
"mesomorphy",
"messiness",
"metabolizability",
"metabolization",
"metallicity",
"metallization",
"metallophilicity",
"metaplasticity",
"metastability",
"metastasisation",
"metastaticity",
"methylation",
"meticulousness",
"micellarity",
"microaerophily",
"microcrystallinity",
"microcytotoxicity",
"microimmunofluorescence",
"microinjection",
"microinvasiveness",
"micromolarity",
"micronization",
"micronodularity",
"microscopicity",
"microvascularity",
"middleness",
"midpregnancy",
"migration",
"migratoriness",
"mildness",
"militantness",
"militancy",
"militarization",
"milking",
"milkiness",
"millimolarity",
"millinormality",
"mimicry",
"mindfulness",
"mindlessness",
"mineralization",
"miniaturization",
"minification",
"minimality",
"minimization",
"ministration",
"minuteness",
"mirthfulness",
"mirthlessness",
"misapplication",
"misapprehension",
"misappropriation",
"misbehaviour",
"miscalculation",
"miscellaneousness",
"mischievousness",
"miscibility",
"misconception",
"misconduct",
"misconstruction",
"misdiagnosis",
"misdirection",
"misery",
"miserliness",
"misfire",
"misgovernment",
"misguidance",
"misguidedness",
"misidentification",
"misinformation",
"misinterpretation",
"misjudgement",
"misleadingness",
"mismanagement",
"misplacement",
"mispronunciation",
"misquotation",
"misreading",
"misrepresentation",
"missingness",
"misspelling",
"misstatement",
"mistakenness",
"mistranslation",
"mistrust",
"mistrustfulness",
"mistiness",
"misunderstanding",
"misuse",
"mitigation",
"mitogenicity",
"mixture",
"mix-up",
"mixedness",
"hypermobility",
"mobilization",
"mockery",
"mock-up",
"modality",
"moderation",
"moderateness",
"moderation",
"modernity",
"modernness",
"modernization",
"modesty",
"modification",
"modularity",
"modulation",
"moisture",
"moistness",
"molding",
"moldability",
"moldiness",
"molecularity",
"molestation",
"mollification",
"molting",
"moltenness",
"momentousness",
"monasticism",
"monaurality",
"mongoloidism",
"montitoring",
"monobasicity",
"monochromaticity",
"monoclonality",
"monocularity",
"monocyclicity",
"monoecy",
"monomericity",
"mononuclearity",
"monopolarity",
"monopolization",
"monosexuality",
"monospecificity",
"monosyllabicity",
"monosynapticity",
"monotonicity",
"monotony",
"monotonousness",
"monovalency",
"monovalence",
"monovularity",
"monozygosity",
"monstrosity",
"monumentality",
"moodiness",
"moonlessness",
"mootness",
"morality",
"moralization",
"morbidity",
"morbidness",
"moribundity",
"moroseness",
"morosity",
"morphinization",
"mortality",
"mortification",
"motherlessness",
"motherliness",
"motility",
"motionlessness",
"motivation",
"motivelessness",
"motorization",
"mount",
"mountainousness",
"mourning",
"mournfulness",
"mousiness",
"movability",
"movement",
"mucoidness",
"mucoidity",
"mucopurulence",
"mucosity",
"muddiness",
"mugginess",
"mulishness",
"multicellularity",
"multicentricity",
"multiclonality",
"multidimensionality",
"multidisciplinarity",
"multifactoriality",
"multifariousness",
"multifocality",
"multiformity",
"multifunctionality",
"multilevelness",
"multilobularity",
"multilocularity",
"multimodality",
"multinodularity",
"multinuclearity",
"multiphasicity",
"multiplicity",
"multiplexity",
"multiplication",
"multipolarity",
"multipotentiality",
"mummification",
"mundanity",
"municipality",
"munificence",
"murderousness",
"murkiness",
"muscularity",
"muscularization",
"musicality",
"mustiness",
"mutability",
"mutagenicity",
"mutation",
"muteness",
"mutism",
"mutilation",
"mutuality",
"muzziness",
"myelination",
"myelinisation",
"myelinotoxicity",
"myelotoxicity",
"myoelectricity",
"myogenicity",
"mysteriousness",
"mysticism",
"mysticity",
"mysticality",
"mystification",
"nailing",
"naivete",
"naiveness",
"naivety",
"nakedness",
"namelessness",
"narcotization",
"narration",
"narrativity",
"narrowness",
"narrowing",
"narrow-mindedness",
"nasality",
"nasalance",
"nasalization",
"nascence",
"nascency",
"nastiness",
"nationality",
"nationalization",
"nativity",
"nativeness",
"nattiness",
"naturalness",
"naturality",
"naturalization",
"naughtiness",
"nauseation",
"nauseousness",
"nauticality",
"navigability",
"navigation",
"nearness",
"nearsightedness",
"neatness",
"nebulization",
"nebulousness",
"necessity",
"necessitation",
"necrogenicity",
"necrosis",
"needfulness",
"needlessness",
"neediness",
"nefariousness",
"negation",
"negativeness",
"negativity",
"neglect",
"neglection",
"neglectfulness",
"negligence",
"negligency",
"negligibility",
"negotiability",
"negotiation",
"neighbourliness",
"neonatality",
"neoplasticity",
"nephrectomization",
"nephritogenicity",
"nephrogenicity",
"nephrotoxicity",
"nervelessness",
"nervousness",
"nescience",
"nesslerization",
"neuralness",
"neuritogenicity",
"neurogenicity",
"neuronotropicity",
"neuroticity",
"neurotoxicity",
"neurotrophicity",
"neurotropicity",
"neurovascularity",
"neutrality",
"neutralization",
"newness",
"newslessness",
"niceness",
"nidality",
"niggardliness",
"nihilism",
"nimbleness",
"nitrogenization",
"nitrosation",
"nobility",
"nobleness",
"noble-mindedness",
"nocturnality",
"nocturnalism",
"nod",
"nodality",
"nodularity",
"noiselessness",
"noisiness",
"nomination",
"nonactivation",
"nonantigenicity",
"nonchalance",
"nonconformism",
"nonencapsulation",
"nonessentiality",
"nonfunctionality",
"nonhumanness",
"nonimmunity",
"noninfectiousness",
"noninvasiveness",
"noninvasivity",
"nonirradiation",
"nonlethality",
"nonlinearity",
"nonocclusiveness",
"nonopacity",
"nonorganicity",
"nonparallelism",
"nonradioactivity",
"nonrandomness",
"nonreactivity",
"nonreactiveness",
"nonreciprocity",
"nonreciprocality",
"nonselectivity",
"nonselectiveness",
"nonsensicality",
"nonsensicalness",
"nonspecificity",
"nontoxicity",
"nonviability",
"nonvirulence",
"nonabsorbability",
"non-adherence",
"non-alignment",
"noncompliance",
"non-motility",
"nonpolarity",
"non-violence",
"noradrenergicity",
"normality",
"normalcy",
"normalness",
"normalization",
"normativity",
"normativeness",
"normergy",
"normocellularity",
"normotonicity",
"nosocomiality",
"nosotoxicity",
"nosiness",
"notability",
"noteworthiness",
"noticeability",
"notifiability",
"notification",
"notoriousness",
"notoriety",
"nourishment",
"novelty",
"noxiousness",
"nubility",
"nucleolarity",
"nucleophilicity",
"nudity",
"nullity",
"nullification",
"nulliparousness",
"numbness",
"numeracy",
"numerosity",
"numerousness",
"numinousness",
"numinosity",
"nutritiousness",
"nutritiveness",
"obduracy",
"obdurateness",
"obedience",
"obediency",
"obesity",
"obfuscation",
"objection",
"objectionability",
"objectiveness",
"objectivity",
"objurgation",
"oblateness",
"obligation",
"obligatoriness",
"obliquity",
"obliqueness",
"obliteration",
"obliviousness",
"oblongness",
"obnoxiousness",
"obscenity",
"obscurity",
"obscuration",
"obsequiousness",
"observability",
"observance",
"observation",
"obsession",
"obsessiveness",
"obsolescence",
"obsoleteness",
"obstinacy",
"obstinancy",
"obstreperousness",
"obstruction",
"obstructiveness",
"obtainment",
"obtention",
"obtainability",
"obtrusion",
"obtrusiveness",
"obtundation",
"obtuseness",
"obtusion",
"obviation",
"obviousness",
"occasionality",
"occlusion",
"occlusiveness",
"occlusivity",
"occupancy",
"occupation",
"occurrence",
"octagonality",
"oculomotricity",
"oddness",
"oddity",
"odoriferousness",
"odourlessness",
"offense",
"offensiveness",
"offering",
"officiality",
"officiation",
"officiousness",
"oiliness",
"oldness",
"oleaginousness",
"ominousness",
"omission",
"omnipotence",
"omnipotency",
"omniscience",
"omnivorousness",
"oncogenicity",
"oneness",
"onerousness",
"one-dimensionality",
"ontogenicity",
"opacification",
"opalescence",
"opacity",
"opaqueness",
"openness",
"open-endedness",
"operability",
"operation",
"operationality",
"operativeness",
"operativity",
"opinionatedness",
"opportuneness",
"opportunism",
"opposition",
"oppression",
"oppression",
"oppressiveness",
"opsonification",
"opsonization",
"optimality",
"optimism",
"optimization",
"optionality",
"opulence",
"orality",
"oration",
"orchestration",
"ordination",
"ordering",
"orderliness",
"ordinariness",
"organicity",
"organization",
"organophilicity",
"organ specificity",
"orientation",
"originality",
"origination",
"ornamentation",
"ornateness",
"orthocephaly",
"orthodoxy",
"orthorhombicity",
"oscillation",
"oscitation",
"osmication",
"osmiophily",
"osmiophilicity",
"osmolarity",
"osmophilicity",
"osmosis",
"osmoticity",
"ossification",
"ostentation",
"osteogenicity",
"ostracism",
"ostracization",
"ototoxicity",
"ouster",
"outness",
"outgoingness",
"outlandishness",
"outlay",
"outrageousness",
"outsideness",
"outspan",
"outspokenness",
"ovalness",
"ovality",
"ovarian independence",
"ovariectomization",
"overaction",
"overbearingness",
"overcapitalization",
"over-estimation",
"over-payment",
"overridingness",
"overrun",
"oversight",
"overstatement",
"overtness",
"overtaxation",
"overweightness",
"over-confidence",
"overeating",
"over-emphasis",
"overenthusiasm",
"over-exertion",
"over-exposure",
"over-indulgence",
"over-simplification",
"over-strain",
"ovigerousness",
"oviparity",
"oviparousness",
"ovoviviparity",
"ovoviviparousness",
"ownership",
"oxidization",
"oxidation",
"oxygenation",
"oxygenicity",
"oxygenization",
"ozonization",
"pacificity",
"pacification",
"paganism",
"painfulness",
"painlessness",
"painting",
"palatability",
"palatableness",
"paleness",
"palindromicity",
"palliation",
"pallidness",
"pallidity",
"palpability",
"palpation",
"palpitation",
"panning",
"panagglutinability",
"pandemicity",
"panoramicity",
"papillation",
"papularity",
"paradoxicality",
"parallelism",
"parallelity",
"parallelness",
"paralysis",
"paralyzation",
"paralytogenicity",
"paramagnetism",
"parametricity",
"paramountcy",
"paramutability",
"paramutagenicity",
"paranoidity",
"paranormality",
"paraphrase",
"parasite specificity",
"parasitization",
"paraspecificity",
"parochialism",
"parochiality",
"parody",
"parousness",
"parsimoniousness",
"parsimony",
"partiality",
"partialness",
"participation",
"particularity",
"particularness",
"particularization",
"partisanship",
"partition",
"parvicellularity",
"passage",
"passability",
"passableness",
"passionlessness",
"passivity",
"passiveness",
"passivization",
"pastness",
"pasteurization",
"patchiness",
"patency",
"pathergization",
"patheticness",
"pathlessness",
"pathogeneticity",
"pathogenicity",
"pathognomicity",
"pathognomonicity",
"patience",
"patiency",
"patient-centeredness",
"patrilineality",
"patronization",
"patulousness",
"paunchiness",
"pauperization",
"payment",
"peacefulness",
"peakedness",
"pearliness",
"peculation",
"peculiarity",
"peculiarness",
"pedantry",
"peek",
"peerlessness",
"peevishness",
"pellagragenicity",
"pellation",
"pellucidity",
"penality",
"penalization",
"pendency",
"pendulosity",
"pendulousness",
"penetrability",
"penetration",
"penetrance",
"penetrativity",
"penetrativeness",
"peninsularity",
"penitence",
"pennilessness",
"pensiveness",
"pentagonality",
"pentavalence",
"penuriousness",
"pepperiness",
"peptonization",
"perambulation",
"perceivability",
"perception",
"perceptibility",
"perceptiveness",
"perceptivity",
"percipience",
"percolation",
"percussion",
"perenniality",
"perfection",
"perfectness",
"perfection",
"perfectibility",
"perfervidity",
"perfervidness",
"perfervor",
"perforation",
"performance",
"perfunctoriness",
"perfusion",
"perfusal",
"perilousness",
"perinatality",
"periodicity",
"peripherality",
"perishability",
"perishableness",
"peritonealization",
"peritonization",
"perivascularity",
"perkiness",
"permanence",
"permanency",
"permeability",
"permeation",
"permissibility",
"permissibleness",
"permissiveness",
"permissivity",
"permission",
"permutation",
"perniciousness",
"peroxidization",
"perpendicularity",
"perpetration",
"perpetuity",
"perpetuality",
"perpetuation",
"perplexity",
"perplexedness",
"persecution",
"perseverance",
"persistence",
"persistency",
"persistence",
"personalization",
"personification",
"perspicacity",
"perspicaciousness",
"perspicuity",
"perspicuousness",
"perspiration",
"persuasion",
"persuasiveness",
"pertness",
"pertinacity",
"pertinence",
"pertinency",
"perturbation",
"perturbance",
"perusal",
"pervasion",
"pervasiveness",
"perversity",
"perverseness",
"perversion",
"perviousness",
"pessimism",
"pestiferousness",
"petrifaction",
"petrification",
"pettiness",
"petulance",
"phagocytability",
"phagocyticity",
"phagocytization",
"phagocytosis",
"phalangization",
"phallicity",
"phase-in",
"phasicness",
"phasicity",
"phenolization",
"phenomenality",
"phlebotomization",
"phlogogenicity",
"phobicity",
"phobicness",
"phosphorescence",
"phosphorylation",
"photoactivation",
"photochromogenicity",
"photoreactivity",
"photosensitivity",
"photosensitiveness",
"photosensitization",
"photostability",
"phototoxicity",
"phylogenicity",
"physicality",
"physicalness",
"phytopathogenicity",
"phytotoxicity",
"pickup",
"picturesqueness",
"piebaldness",
"piercing",
"piggishness",
"pig-headedness",
"pilferage",
"pillage",
"pilosity",
"pinch",
"pinkness",
"pinnation",
"pinnateness",
"piety",
"piousness",
"piquancy",
"pitch",
"pithiness",
"pitilessness",
"placation",
"placement",
"placidity",
"placidness",
"plagiarism",
"plainness",
"plaintiveness",
"planeness",
"planlessness",
"planting",
"plasmolyzability",
"plasticity",
"plausibility",
"playfulness",
"pleading",
"pleasantness",
"pleasure",
"pleasingness",
"pleasurability",
"pleasurableness",
"pleiotropicity",
"plentifulness",
"pleochroism",
"pleurality",
"pliability",
"pliancy",
"plication",
"plosiveness",
"plumpness",
"pluripotentiality",
"pluripotentialness",
"pneumaticity",
"pneumotropicity",
"poeticality",
"poignancy",
"poignance",
"pointedness",
"pointlessness",
"poise",
"poisoning",
"poisonousness",
"pokiness",
"polarization",
"politeness",
"politicization",
"pollination",
"pollution",
"polybasicity",
"polycentricity",
"polychromaticity",
"polycrotism",
"polycyclicity",
"polygenicity",
"polygonality",
"polymerism",
"polymericity",
"polymerization",
"polymorphousness",
"polynuclearity",
"polynucleolarity",
"polyphasicity",
"polyphyleticism",
"polyspecificity",
"polyunsaturation",
"polyvalence",
"polyvalency",
"polyvalentness",
"pomposity",
"pompousness",
"ponderousness",
"ponderosity",
"pontificality",
"pontification",
"poverty",
"poorness",
"pop-up",
"popularization",
"population",
"porosity",
"porousness",
"portability",
"portrayal",
"positionality",
"positivity",
"positiveness",
"possessiveness",
"possibility",
"posteriorness",
"postfixation",
"postmaturity",
"postmaturation",
"postponement",
"postpubescence",
"postulation",
"posturing",
"potability",
"potableness",
"potence",
"potency",
"potentiality",
"potentiation",
"pottiness",
"powerfulness",
"powerlessness",
"practicability",
"practicalness",
"practicality",
"practice",
"praiseworthiness",
"prandiality",
"preachment",
"preadolescence",
"prearrangement",
"precariousness",
"precession",
"preciousness",
"preciosity",
"precipitability",
"precipitation",
"precipitateness",
"precipitousness",
"precision",
"preciseness",
"preclusion",
"precociousness",
"precocity",
"preconception",
"preconsciousness",
"predatoriness",
"predestination",
"predestination",
"predetermination",
"predication",
"prediction",
"predictability",
"predictivity",
"predictiveness",
"predisposition",
"predisposal",
"predisposal",
"predisposition",
"predominance",
"predominancy",
"predomination",
"prefabrication",
"preferment",
"preferability",
"preferentiality",
"prefixation",
"pregnancy",
"prehensility",
"preincubation",
"prejudgment",
"preleukemic",
"preliminarity",
"premalignancy",
"prematureness",
"premeditation",
"premorbidity",
"preoccupation",
"preoccupancy",
"preordainment",
"preordination",
"preparation",
"preparedness",
"prepayment",
"preponderance",
"preponderancy",
"preponderance",
"prepossession",
"prepotency",
"prepubescence",
"prescience",
"prescription",
"prescriptivism",
"prescriptiveness",
"presenility",
"presence",
"presentness",
"presentment",
"presentation",
"presentability",
"preservability",
"preservation",
"presidence",
"pressure",
"prestigiousness",
"presumption",
"presupposition",
"pretence",
"pretension",
"pretention",
"pretentiousness",
"preternaturalness",
"pretreatment",
"prettiness",
"prevalence",
"prevalency",
"prevarication",
"prevention",
"preventability",
"preventiveness",
"previability",
"previousness",
"predigestion",
"pre-eminence",
"preemption",
"pricelessness",
"prickliness",
"priestliness",
"priggishness",
"primness",
"primariness",
"primeness",
"primitiveness",
"primitivity",
"primordiality",
"printability",
"priority",
"prioritization",
"privacy",
"privateness",
"proactivity",
"proactiveness",
"probability",
"probing",
"procedurality",
"processing",
"proclamation",
"procrastination",
"procreation",
"procreativity",
"procreativeness",
"procumbency",
"procurement",
"prodigality",
"production",
"productiveness",
"productivity",
"profanation",
"profanity",
"profaneness",
"profession",
"professionalism",
"professionality",
"professionalization",
"proficiency",
"profitableness",
"profitability",
"profitlessness",
"profligacy",
"profundity",
"profoundness",
"profuseness",
"profusion",
"profusity",
"prognosis",
"prognostication",
"programmability",
"progression",
"progressivity",
"progressiveness",
"prohibition",
"prohibitiveness",
"projection",
"projectivity",
"proliferation",
"prolification",
"prolificacy",
"prolificity",
"prolixity",
"prolongation",
"prolongment",
"prominence",
"prominency",
"promiscuity",
"promiscuousness",
"promise",
"promotability",
"promotion",
"promptness",
"promptitude",
"promulgation",
"pronation",
"proneness",
"pronouncement",
"pronunciation",
"pronounceability",
"propagation",
"properness",
"prophecy",
"propitiation",
"propitiousness",
"proportionment",
"proportionality",
"proposition",
"proposal",
"proprietariness",
"proprioceptivity",
"propulsiveness",
"proration",
"proscription",
"prosecution",
"proselytization",
"prospection",
"prospectiveness",
"prospectivity",
"prosperity",
"prostitution",
"prostration",
"prostration",
"protection",
"protectiveness",
"protectivity",
"protestation",
"protonation",
"prototrophicity",
"prototrophy",
"protraction",
"protrusion",
"protrusiveness",
"protuberance",
"pride",
"provability",
"proof",
"provision",
"provincialism",
"provinciality",
"provisionality",
"provocativeness",
"provocation",
"proximality",
"prudence",
"prurience",
"pruriency",
"pruritogenicity",
"pseudodominance",
"pseudolobulation",
"pseudonormalization",
"pseudotetraploidy",
"psychoactivity",
"psychodynamism",
"psychogenicity",
"psychosexuality",
"psychoticity",
"psychotogenicity",
"psycho-analysis",
"psychrophilicity",
"pubescence",
"publicness",
"publicization",
"publicity",
"publication",
"pudginess",
"puerility",
"puerperality",
"puff",
"puffiness",
"pugnacity",
"pugnaciousness",
"puissance",
"pull-up",
"pullulation",
"pulpiness",
"pulsation",
"pulsatility",
"pulverization",
"punch-drunkenness",
"punctation",
"punctiliousness",
"punctuality",
"punctuation",
"pungency",
"punishment",
"punishableness",
"punishability",
"punitiveness",
"punitivity",
"purchasability",
"purchase",
"purity",
"pureness",
"purgation",
"purification",
"purpleness",
"purposefulness",
"purposelessness",
"purposiveness",
"purposivity",
"pursuance",
"pursuit",
"pursual",
"purulence",
"purulency",
"purveyance",
"push-up",
"pusillanimity",
"putrefaction",
"putrification",
"putrescence",
"putridity",
"puzzle",
"pyogenicity",
"pyramidality",
"pyridoxylation",
"pyrogenicity",
"quadrangularity",
"quadrisection",
"quadrivalence",
"quaintness",
"qualification",
"quantification",
"quantitation",
"quantitativeness",
"quantitativity",
"quantumness",
"quarrelsomeness",
"quasidominance",
"queasiness",
"queerness",
"quenchlessness",
"querulousness",
"questioning",
"questionableness",
"questionability",
"quickness",
"quiescence",
"quiescency",
"quietness",
"quietude",
"quit",
"quotability",
"quotation",
"rabidity",
"rabidness",
"racemization",
"rachiresistance",
"raciality",
"racism",
"raciness",
"radiability",
"radiality",
"radiance",
"radiancy",
"radiation",
"radicalness",
"radicalism",
"radicality",
"radioactivity",
"radiocurability",
"radioiodination",
"radiolucence",
"radiolucency",
"radiopacity",
"radiopaqueness",
"radiosensitivity",
"radiosensitiveness",
"radiotransparency",
"radiotransparence",
"raggedness",
"rakishness",
"ramification",
"ramosity",
"rancidity",
"rancidness",
"rancidification",
"randomness",
"randiness",
"ranking",
"rankness",
"rant",
"rapacity",
"rapaciousness",
"rapidity",
"rapidness",
"rareness",
"rarity",
"rarefication",
"rarefaction",
"rashness",
"rasp",
"ratification",
"rationality",
"rationalization",
"rattling",
"ravishment",
"rawness",
"reabsorption",
"reacquisition",
"reaction",
"reactivation",
"reactivity",
"reactiveness",
"read",
"reading",
"readability",
"readjustment",
"readiness",
"reaffirmation",
"realness",
"reality",
"realisticness",
"realism",
"realizability",
"realization",
"reanimation",
"reappearance",
"rearing",
"rearmament",
"rearrangement",
"reasonableness",
"reasonability",
"reasonlessness",
"reassertion",
"reassurement",
"reassurance",
"rebellion",
"rebelliousness",
"rebound",
"rebuff",
"rebuke",
"rebuttal",
"recalcitrance",
"recalcitrancy",
"recall",
"recantation",
"recap",
"recapitulation",
"recapture",
"recession",
"receival",
"receipt",
"reception",
"recentness",
"recency",
"receptivity",
"receptiveness",
"recessiveness",
"recessivity",
"reciprocity",
"reciprocality",
"reciprocation",
"recitation",
"recital",
"recklessness",
"reckoning",
"reclamation",
"reclassification",
"reclination",
"recognizability",
"recognition",
"recoil",
"recollection",
"recombination",
"recommendation",
"reconcilability",
"reconciliation",
"reconcilement",
"reconsideration",
"reconstitution",
"reconstruction",
"reconstructure",
"recording",
"recoupment",
"recovery",
"recoverability",
"recreation",
"recrimination",
"recruitment",
"rectangularity",
"rectification",
"rectilinearity",
"recumbency",
"recumbence",
"recuperation",
"recuperativeness",
"recurrence",
"recurrency",
"recurvature",
"recurvation",
"recusancy",
"recycling",
"redness",
"redaction",
"reddishness",
"redemption",
"redeemability",
"redeployment",
"redirection",
"redistribution",
"redolence",
"redressment",
"redressal",
"reduction",
"reducement",
"reducibility",
"reductivity",
"reductiveness",
"redundancy",
"redundance",
"reduplication",
"reevaluation",
"refection",
"reference",
"referral",
"referability",
"referentiality",
"refinement",
"refinement",
"refit",
"reflation",
"reflection",
"reflectiveness",
"reflectivity",
"reflexiveness",
"reflexivity",
"reforestation",
"reformation",
"refraction",
"refractility",
"refractiveness",
"refractoriness",
"refrainment",
"refrangibility",
"refreshment",
"refrigeration",
"refulgence",
"refurbishment",
"refusal",
"refutation",
"regainment",
"regalement",
"regard",
"regeneration",
"regenerativity",
"regimentation",
"regionality",
"registration",
"regression",
"regressivity",
"regressiveness",
"regret",
"regretfulness",
"regrettability",
"regroupment",
"regularity",
"regularization",
"regulation",
"regurgitation",
"rehabilitation",
"rehearsal",
"reimbursement",
"reincarnation",
"reinforcement",
"reinstatement",
"reinsurance",
"reiteration",
"rejection",
"rejuvenation",
"relapse",
"relation",
"relatedness",
"relativity",
"relativeness",
"relative hypofrontality",
"relaxation",
"relay",
"release",
"relegation",
"relentlessness",
"relevance",
"relevancy",
"reliability",
"reliance",
"relief",
"religiousness",
"religiosity",
"relinquishment",
"relish",
"relocation",
"reluctance",
"reluctancy",
"reliance",
"remand",
"remark",
"remarriage",
"remediability",
"remediality",
"remembrance",
"remilitarization",
"remineralization",
"reminiscence",
"reminiscence",
"remissness",
"remittance",
"remission",
"remittal",
"remittence",
"remonstrance",
"remorsefulness",
"remorselessness",
"remoteness",
"removability",
"removableness",
"removement",
"removal",
"remuneration",
"remunerativeness",
"rendering",
"rendition",
"renewal",
"renewability",
"renunciation",
"renouncement",
"renovation",
"reopening",
"reoperation",
"reorganization",
"reorganizer",
"reorientation",
"reorientation",
"repairability",
"reparability",
"repatriation",
"repayment",
"repetition",
"repeatedness",
"repellency",
"repentance",
"repentance",
"repetitiousness",
"repetitiveness",
"repetitivity",
"replacement",
"replaceability",
"replantation",
"replay",
"replenishment",
"repletion",
"replication",
"reply",
"reportability",
"reposal",
"reposition",
"repositioning",
"reprehension",
"representation",
"representativeness",
"repression",
"repression",
"repressiveness",
"reprieval",
"reprieve",
"reproachfulness",
"reprobation",
"reproduction",
"reproducibility",
"reproductiveness",
"reproof",
"repudiation",
"repugnance",
"repulsiveness",
"reputability",
"requirement",
"requital",
"recision",
"rescue",
"resection",
"resectability",
"resemblance",
"resentment",
"resentfulness",
"reservation",
"reservedness",
"resetting",
"resettlement",
"residence",
"residentiality",
"residuality",
"resignation",
"resilience",
"resiliency",
"resinousness",
"resistance",
"resistance",
"resistancy",
"resistiveness",
"resistivity",
"resoluteness",
"resolution",
"resolvability",
"resolution",
"resonance",
"resonancy",
"resonance",
"resorbtion",
"resorptivity",
"resourcefulness",
"respect",
"respectability",
"respectableness",
"respectfulness",
"respectiveness",
"respirability",
"respiration",
"resplendence",
"resplendency",
"response",
"respondence",
"respondency",
"responsibility",
"responsibleness",
"responsiveness",
"responsivity",
"restatement",
"restfulness",
"restiveness",
"restlessness",
"restorativeness",
"restoration",
"restorement",
"restoral",
"restraint",
"restrainment",
"restraint",
"restriction",
"restrictiveness",
"restrictivity",
"restructuring",
"resumption",
"resurgence",
"resurgency",
"resurrection",
"resuscitation",
"resynthesis",
"retention",
"retainment",
"retaliation",
"retardation",
"retardance",
"retardment",
"retardedness",
"retentiveness",
"retentivity",
"reticence",
"reticularity",
"reticulation",
"retinotopicity",
"retinotoxicity",
"retirement",
"retiral",
"retracement",
"retraction",
"retractability",
"retractility",
"retreatment",
"retrenchment",
"retrievability",
"retrieval",
"retroactivity",
"retroflexion",
"retrogression",
"retrospectivity",
"returnability",
"reusability",
"reuse",
"revaluation",
"revealment",
"revealingness",
"revelry",
"reverberation",
"reverence",
"reversal",
"reversibility",
"reversion",
"revertibility",
"revilement",
"revision",
"revisal",
"revisitation",
"revitalization",
"revival",
"revocation",
"revolutionization",
"revolution",
"re-afforestation",
"re-count",
"re-examination",
"re-formation",
"rheumatogenicity",
"rhythmicity",
"richness",
"ride",
"ridiculousness",
"rightness",
"righteousness",
"rightfulness",
"right-handedness",
"rigidity",
"rigidness",
"rigorousness",
"rinsing",
"rinse",
"ripeness",
"rise",
"risibility",
"riskiness",
"rivality",
"robustness",
"robusticity",
"rockiness",
"roguishness",
"roll",
"romanticism",
"romanticization",
"rooflessness",
"rootedness",
"rootlessness",
"rostrality",
"rot",
"rotation",
"rottenness",
"rotundity",
"roughness",
"roundness",
"routineness",
"rowdiness",
"rub",
"rubberiness",
"ruddiness",
"rudeness",
"rudimentation",
"ruefulness",
"rufosity",
"ruggedness",
"ruin",
"ruination",
"rule",
"ruling",
"rumination",
"run",
"running",
"run-up",
"runniness",
"rupture",
"ruralness",
"rusticity",
"rustication",
"rustling",
"rustle",
"rustiness",
"ruthlessness",
"saccharinity",
"sacculation",
"sacramentality",
"sacredness",
"sacrifice",
"sacrification",
"sacrosanctity",
"sadness",
"sadism",
"safety",
"safeness",
"sagacity",
"sailing",
"saintliness",
"salaciousness",
"salacity",
"salience",
"saliency",
"salification",
"salinity",
"salivation",
"sallowness",
"saltness",
"salting-in",
"saltiness",
"salubriousness",
"salubrity",
"salvage",
"sameness",
"sanctification",
"sanction",
"sandiness",
"sanity",
"sanguinity",
"sanitization",
"sapience",
"saplessness",
"saponaceousness",
"sarcogenicity",
"satiation",
"satirization",
"satisfactoriness",
"satisfaction",
"saturability",
"saturation",
"sauciness",
"savageness",
"savagery",
"save",
"face-saving",
"savoriness",
"savviness",
"scabrousness",
"scaling",
"scale-up",
"scaliness",
"scan",
"scanning",
"scandalousness",
"scantiness",
"scarcity",
"scarceness",
"scarification",
"scariness",
"scattering",
"scentlessness",
"scepticalness",
"scepticism",
"schematicity",
"schizoaffectivity",
"schizoidness",
"schizophrenicity",
"scholarliness",
"scholasticism",
"scientificness",
"scientificity",
"scintillation",
"sclerogenicity",
"sclerosis",
"scotochromogenicity",
"scrape",
"scratchiness",
"scream",
"screening",
"scrupulousness",
"scrupulosity",
"scrutiny",
"scrutinization",
"scurrility",
"scurrilousness",
"seamlessness",
"seasonality",
"sea-sickness",
"secession",
"seclusion",
"secludedness",
"seclusion",
"secrecy",
"secretion",
"secretiveness",
"sectarianism",
"sectility",
"secularism",
"secularity",
"secularization",
"security",
"securement",
"sedation",
"sedateness",
"sedentariness",
"sedentarity",
"sedimentation",
"sedimentability",
"seditiousness",
"seduction",
"seductiveness",
"seeding",
"seedlessness",
"seediness",
"seemliness",
"seepage",
"segmentation",
"segmentality",
"segregation",
"seismicity",
"seizure",
"selection",
"selectivity",
"selectiveness",
"selfishness",
"self-assurance",
"self-assuredness",
"self-complacency",
"self-confidence",
"self-consciousness",
"self-denial",
"self-importance",
"self-indulgence",
"self-interest",
"self-possession",
"self-reliance",
"self-sufficiency",
"self-will",
"sale",
"semelparity",
"semicircularness",
"semipermeability",
"semiquantitativeness",
"semirecumbency",
"senescence",
"senility",
"seniority",
"senselessness",
"sensibility",
"sensibleness",
"sensitivity",
"sensitiveness",
"sensitization",
"sensoriness",
"sensuality",
"sensuousness",
"sentimentality",
"sentimentalism",
"sentimentalization",
"separability",
"separateness",
"separation",
"septicity",
"sequencing",
"sequentiality",
"sequestration",
"sequestration",
"serenity",
"seriality",
"serialization",
"seriousness",
"seroconversion",
"seronegativity",
"seropositivity",
"seropositiveness",
"serotyping",
"serosity",
"service",
"serve",
"serving",
"servility",
"sessility",
"setting",
"set-aside",
"setup",
"settlement",
"severance",
"severeness",
"severity",
"sexlessness",
"sexuality",
"sex-specificity",
"shabbiness",
"shadowing",
"shadowiness",
"shagginess",
"shake-up",
"shakiness",
"shallowness",
"shamefulness",
"shamelessness",
"shapelessness",
"sharpness",
"sheepishness",
"sheerness",
"shiftlessness",
"shiftiness",
"shininess",
"shipment",
"shoddiness",
"shooting",
"shortness",
"shortage",
"shortening",
"showiness",
"shrewdness",
"shrewishness",
"shrillness",
"shrinkage",
"shyness",
"sibilancy",
"sibilance",
"sieving",
"sightlessness",
"signaling",
"signalization",
"significance",
"significancy",
"signification",
"silence",
"silkiness",
"silliness",
"similarity",
"simplicity",
"simpleness",
"simplification",
"simulation",
"simultaneousness",
"simultaneity",
"sincereness",
"sincerity",
"sinfulness",
"singleness",
"singlehood",
"single-strandedness",
"singularity",
"singularization",
"sinistrality",
"sinistrocularity",
"sinlessness",
"sinuosity",
"sinuousness",
"sinusoidality",
"sinusoidalization",
"sit-up",
"site-specificity",
"situation",
"situatedness",
"sizableness",
"sketch",
"sketchiness",
"skewness",
"skillfulness",
"skinniness",
"skittishness",
"slackness",
"slam",
"slanginess",
"slap",
"slaughtering",
"slaughtery",
"sleekness",
"sleeplessness",
"sleepiness",
"sleevelessness",
"slenderness",
"slenderization",
"slickness",
"slightness",
"slight",
"slimness",
"slipperiness",
"sloppiness",
"slothfulness",
"slovenliness",
"slowness",
"sluggishness",
"slyness",
"smallness",
"smartness",
"smokelessness",
"smokiness",
"smoothness",
"smugness",
"smuttiness",
"sneeze",
"snobbishness",
"snowblindness",
"snowiness",
"snugness",
"sobriety",
"soberness",
"sociability",
"sociableness",
"sociality",
"socialization",
"softness",
"sogginess",
"soilage",
"solemnness",
"solemnity",
"solemnization",
"solicitation",
"solicitude",
"solicitousness",
"solidity",
"solidness",
"solidarity",
"solidification",
"solitariness",
"solubilization",
"solubility",
"solvability",
"solution",
"solvency",
"somatization",
"sombreness",
"somnolence",
"sonolucency",
"sonority",
"sonorousness",
"sootiness",
"sorption",
"sordidness",
"soreness",
"sorrow",
"sorrowfulness",
"soulfulness",
"soullessness",
"soundness",
"soundlessness",
"sourness",
"sovereignty",
"sovietization",
"spacing",
"spaciousness",
"spareness",
"sparseness",
"sparsity",
"spasmodicity",
"spasmogenicity",
"spasticity",
"spatiality",
"spatulation",
"speech",
"specialness",
"specialisation",
"specificness",
"specificity",
"specification",
"speciousness",
"specklessness",
"spectacularity",
"speculation",
"speechlessness",
"speedup",
"spermatogenicity",
"spermotoxicity",
"sphacelation",
"sphericality",
"sphygmicity",
"spicularity",
"spiciness",
"spillage",
"spin",
"spinelessness",
"spinosity",
"spininess",
"spirality",
"spiritlessness",
"spirituality",
"spiritualization",
"spitefulness",
"splayfootedness",
"splendour",
"splicing",
"splintage",
"spoilage",
"spoilation",
"sponginess",
"sponsorship",
"spontaneity",
"spontaneousness",
"sporadicity",
"sportiveness",
"spotting",
"spotlessness",
"spottiness",
"sprightliness",
"spruceness",
"spuriousness",
"squalor",
"squamation",
"squareness",
"squatness",
"squeamishness",
"stableness",
"stability",
"stagnancy",
"stagnation",
"staidness",
"staining",
"stainability",
"stainlessness",
"staleness",
"standardness",
"standardization",
"startup",
"startlingness",
"starvation",
"statement",
"statelessness",
"stateliness",
"statewideness",
"stationarity",
"stationariness",
"staunchness",
"staunchness",
"steadfastness",
"steadiness",
"steepness",
"steerability",
"stenothermality",
"stenoticity",
"step-up",
"stereoselectivity",
"stereospecificity",
"stereotypicity",
"stericity",
"sterility",
"sterilisation",
"sternness",
"steroidogenicity",
"stickiness",
"stiffness",
"stillness",
"stimulation",
"stinginess",
"stipulation",
"stir",
"stolidity",
"stolidness",
"storage",
"storminess",
"stoutness",
"straightness",
"strangeness",
"strangulation",
"stratification",
"streakiness",
"streamlinedness",
"strenuousness",
"stretch",
"strictness",
"stridulation",
"stringency",
"stripping",
"striving",
"strength",
"struggle",
"strychninization",
"stubbornness",
"studiousness",
"study",
"stuffiness",
"stultification",
"stupefaction",
"stupefication",
"stupidity",
"sturdiness",
"stylishness",
"stylization",
"suavity",
"subacuteness",
"subconfluence",
"subconfluency",
"subconsciousness",
"subcultivation",
"subdivision",
"subduction",
"subexcitation",
"subfertility",
"subintrance",
"subjacency",
"subjection",
"subjectiveness",
"subjectivity",
"subjunction",
"subjugation",
"sublethality",
"sublimation",
"sublimeness",
"sublimity",
"subliminality",
"subluxation",
"submergence",
"submissiveness",
"submissivity",
"submission",
"submittal",
"subnormality",
"suboptimality",
"subordinateness",
"subordinacy",
"subordinance",
"subordination",
"subordinance",
"subornation",
"subscription",
"subsequence",
"subservience",
"subsidence",
"subsidization",
"subsistence",
"substantiality",
"substantiation",
"substantiveness",
"substitution",
"subsumption",
"subtlety",
"subtleness",
"subtraction",
"subversion",
"sub-classification",
"success",
"succession",
"successfulness",
"successiveness",
"successivity",
"succinctness",
"succulence",
"suction",
"suddenness",
"sufficiency",
"sufficience",
"sufficientness",
"suffocation",
"suffusion",
"suggestion",
"suggestiveness",
"suicidality",
"suitability",
"suitableness",
"sulcation",
"sulfonation",
"sufurization",
"sulfurization",
"sulkiness",
"sullenness",
"sulfation",
"sultriness",
"summation",
"summarization",
"sumptuousness",
"sunkenness",
"sunniness",
"superannuation",
"superbness",
"superciliousness",
"superficiality",
"superficialness",
"superfusion",
"superimposition",
"superinduction",
"superintendence",
"superintendency",
"superiority",
"supernormality",
"supersaturation",
"supersession",
"superselectivity",
"supersensitivity",
"supersensitiveness",
"superstitiousness",
"supervention",
"supervirulence",
"supervision",
"supination",
"suppleness",
"supplementation",
"supplementarity",
"supplication",
"supportiveness",
"supposition",
"supposal",
"suppression",
"suppressiveness",
"suppressivity",
"suppuration",
"supramaximality",
"supravitality",
"supremacy",
"sureness",
"surfactancy",
"surliness",
"surprisal",
"surprisingness",
"surrogacy",
"survey",
"survival",
"suscitation",
"suspicion",
"suspension",
"suspiciousness",
"sustainment",
"sustainedness",
"suturation",
"swampiness",
"sweetness",
"swelling",
"swiftness",
"swimming",
"swollenness",
"syllabication",
"syllabification",
"symbolization",
"symmetry",
"synchronization",
"synchroneity",
"synchronism",
"synchronousness",
"synchrony",
"syncopation",
"syncytiality",
"syndication",
"syngeneicity",
"synteny",
"synthesis",
"synthesization",
"syntropy",
"systematicity",
"systematicness",
"systematization",
"systemicity",
"tabulation",
"taciturnity",
"tactlessness",
"tactfulness",
"tacticity",
"tactility",
"taillessness",
"taintlessness",
"takeover",
"taking",
"take-up",
"talkativeness",
"tallness",
"tameness",
"tanness",
"tangentiality",
"tangibility",
"tap",
"tapping",
"tapeinocephalism",
"tapeinocephaly",
"taper",
"tardiness",
"tartness",
"tastefulness",
"tastelessness",
"tastiness",
"tautness",
"tawdriness",
"tax",
"taxability",
"teaching",
"tear-off",
"tearfulness",
"tearlessness",
"tedium",
"tediousness",
"telocentricity",
"temperance",
"temperateness",
"temporariness",
"temporization",
"temptation",
"tenability",
"tenableness",
"tenaciousness",
"tenacity",
"tendency",
"tendence",
"tendentiousness",
"tenderness",
"tenotomization",
"tenseness",
"tensity",
"tension",
"tentativeness",
"tentativity",
"tenuity",
"tenuousness",
"tepidity",
"tepidness",
"teratogeneticity",
"teratogenicity",
"tergiversation",
"terminality",
"termination",
"terrestriality",
"terrestrialness",
"terrorization",
"terseness",
"teslaization",
"testing",
"testimony",
"testiness",
"tetanization",
"tetravalency",
"thankfulness",
"thanklessness",
"thaw",
"theorization",
"thermicity",
"thermochroism",
"thermolability",
"thermoluminescence",
"thermoplasticity",
"thermoresistance",
"thermotolerance",
"thickness",
"thinness",
"thought",
"thirstiness",
"thirst",
"thoroughness",
"thoughtfulness",
"thoughtlessness",
"three-dimensionality",
"thriftlessness",
"thriftiness",
"thrombogenicity",
"thrombosis",
"throw",
"thymus dependency",
"thyroidectomization",
"thyroidization",
"thyrotoxicity",
"tidiness",
"tie-up",
"tightness",
"tillage",
"tilt",
"timelessness",
"timeliness",
"timidity",
"timidness",
"tingibility",
"tipping",
"tiredness",
"tirelessness",
"titillation",
"titration",
"tolerableness",
"tolerability",
"tolerance",
"toleration",
"tolerogenicity",
"tonelessness",
"tonicity",
"tonotopicity",
"toot",
"toothlessness",
"top-up",
"topicality",
"topicalness",
"toricity",
"torpidity",
"torpidness",
"torpor",
"torridity",
"tortuosity",
"tortuousness",
"tortuousity",
"torture",
"toss",
"totality",
"totipotentiality",
"touch",
"touch-up",
"touchiness",
"toughness",
"tour",
"toxicity",
"toxicogenicity",
"toxigenicity",
"traceability",
"traceableness",
"tracklessness",
"tractability",
"trade",
"traditionality",
"traduction",
"trainability",
"tranquility",
"tranquilization",
"transaction",
"transamination",
"transcendence",
"transcendency",
"transcription",
"transduction",
"transsection",
"transfection",
"transferal",
"transference",
"transferability",
"transfiguration",
"transfixation",
"transfixion",
"transformation",
"transformability",
"transfusion",
"transgression",
"transience",
"transiency",
"transientness",
"transilience",
"transillumination",
"transit",
"transitionality",
"transitoriness",
"translatability",
"translation",
"transliteration",
"translocation",
"translucence",
"translucency",
"transmigration",
"transmissibility",
"transmittance",
"transmittal",
"transmission",
"transmogrification",
"transmurality",
"transmutation",
"transparentness",
"transparence",
"transparency",
"transpiration",
"transplantation",
"transplantability",
"transport",
"transportation",
"transposability",
"transposition",
"transposal",
"transsexualism",
"transsexuality",
"transshipment",
"transudation",
"transversity",
"trapping",
"trapment",
"traumaticity",
"traumatogenicity",
"travel",
"traversal",
"traversement",
"traversion",
"treacherousness",
"treatment",
"treatability",
"tremulousness",
"trenchancy",
"trephination",
"trespass",
"triangularity",
"trichinization",
"trickiness",
"trigeminality",
"trilateralism",
"trill",
"trilobation",
"tripartitism",
"triphasicity",
"triplicity",
"trisection",
"triteness",
"tritiation",
"tritiation",
"trivalency",
"trivalence",
"triviality",
"trivialization",
"trophicity",
"tropicity",
"tropicality",
"troublesomeness",
"truancy",
"truculence",
"truculency",
"trueness",
"truncation",
"trustfulness",
"trustworthiness",
"truthfulness",
"trypsinization",
"tuberculation",
"tuberculization",
"tuberosity",
"tubularity",
"tumidity",
"tumorigenicity",
"tumor-specificity",
"tumultuousness",
"tunability",
"tune-up",
"tunefulness",
"turbidness",
"turbidity",
"turgescence",
"turgidity",
"turgor",
"turgidization",
"tussle",
"twang",
"tweet",
"twitter",
"two-dimensionality",
"tympanicity",
"typing",
"type-specificity",
"typicalness",
"typicality",
"typification",
"tyrannization",
"ubiquitousness",
"ubiquity",
"ugliness",
"ulceration",
"ulcerogenicity",
"ultimacy",
"ultraviolet",
"unability",
"inability",
"unacceptableness",
"unacceptability",
"unaffectedness",
"unanimity",
"unattractiveness",
"unavailability",
"unavoidability",
"unawareness",
"unbalancement",
"unceremoniousness",
"uncertainness",
"uncertitude",
"unclearness",
"unclarity",
"uncomfortableness",
"uncommonness",
"uncompensation",
"unconsciousness",
"uncouthness",
"undefinedness",
"underaction",
"underestimation",
"underestimate",
"underexposure",
"undernourishment",
"underpayment",
"understandability",
"understatement",
"undervaluation",
"underweightness",
"undesirability",
"undetection",
"undiagnosis",
"undifferentiatedness",
"undulation",
"uneasiness",
"unemployment",
"unequalness",
"unequality",
"unequivocalness",
"unequivocality",
"unevenness",
"uneventfulness",
"unexpectedness",
"unfairness",
"unfaithfulness",
"unfamiliarity",
"unfavorableness",
"unfavorability",
"unfitness",
"unfoldment",
"unfortunateness",
"unfoundedness",
"unfriendliness",
"unhappiness",
"unhealthiness",
"unicellularity",
"unidirectionality",
"unifocality",
"uniformity",
"uniformness",
"unification",
"unilamellarity",
"unilaterality",
"unilocularity",
"unimodality",
"unimportance",
"unimpressiveness",
"uninvolvement",
"unipolarity",
"uniqueness",
"unicity",
"unisexuality",
"unitarity",
"unitariness",
"unity",
"univalence",
"univalency",
"universality",
"universalization",
"unlearnedness",
"unlikeness",
"unlikeliness",
"unlimitedness",
"unnaturalness",
"unnecessariness",
"unnecessity",
"unpairedness",
"unperfusion",
"unpleasantness",
"unpopularity",
"unpredictability",
"unproductiveness",
"unproductivity",
"unprotectedness",
"unprotection",
"unreactivity",
"unreactiveness",
"unreasonableness",
"unrelatedness",
"unreliability",
"unremarkableness",
"unresectability",
"unresponsiveness",
"unresponsivity",
"unrestraint",
"unsaturatedness",
"unsaturation",
"unsightliness",
"unspecificity",
"unspecificness",
"unstableness",
"unstability",
"instability",
"unstructuredness",
"unsuccessfulness",
"untenability",
"untowardness",
"untreatability",
"untreatment",
"untruthfulness",
"unusualness",
"unusuality",
"unwantedness",
"unwieldiness",
"unwillingness",
"upliftment",
"uprightness",
"upsetness",
"up-to-dateness",
"urbanness",
"urbanity",
"urbanization",
"ureotelism",
"theraphosid",
"urethrality",
"urgency",
"urination",
"uropathogenicity",
"urtication",
"usability",
"usableness",
"use",
"usage",
"usefulness",
"uselessness",
"usualness",
"usuriousness",
"usurpation",
"utilitarianism",
"utilization",
"uxoriousness",
"vacancy",
"vacation",
"vaccination",
"vacillation",
"vacuolarity",
"vacuolation",
"vacuity",
"vagotonicity",
"vagrancy",
"vagueness",
"vanity",
"vaingloriousness",
"validity",
"validness",
"validation",
"valuation",
"valuelessness",
"vandalization",
"vanishment",
"vapidity",
"vapidness",
"vaporization",
"variability",
"variableness",
"variance",
"varicellization",
"varicosity",
"variedness",
"variousness",
"variation",
"vascularity",
"vascularization",
"vasculotoxicity",
"vasoactivity",
"vasoconstrictivity",
"vasoconstrictiveness",
"vasoformativity",
"vasospasticity",
"vasotonicity",
"vasotrophicity",
"vastness",
"vectoriality",
"vegetality",
"vegetation",
"vegetativeness",
"vegetativity",
"vehemence",
"venality",
"veneration",
"vengefulness",
"venomousness",
"ventilation",
"veracity",
"veraciousness",
"verbality",
"verbalness",
"verbalization",
"verbatimness",
"verboseness",
"verbosity",
"verdancy",
"verification",
"versatility",
"versification",
"verticality",
"verticillation",
"vestigiality",
"vexation",
"viability",
"vibration",
"viciousness",
"victimization",
"vigilance",
"vigorousness",
"vileness",
"vilification",
"villainousness",
"vindication",
"vindictiveness",
"violation",
"violence",
"virginity",
"virility",
"virilization",
"virtuality",
"virulence",
"virulency",
"virus specificity",
"viscosity",
"viscousness",
"visibility",
"visitation",
"visuality",
"visualization",
"vitality",
"vitalization",
"vitiation",
"vitreousness",
"vitrification",
"vituperation",
"vivacity",
"vivaciousness",
"vividness",
"vivification",
"viviparity",
"viviparousness",
"vivisection",
"vocalization",
"vociferation",
"voicelessness",
"voiding",
"volatility",
"volatilization",
"voltage-dependence",
"volubility",
"voluminosity",
"voluminousness",
"voluntariness",
"voluntarity",
"volunteerism",
"voluptuousness",
"vomition",
"voracity",
"voraciousness",
"vouchsafement",
"vulcanization",
"vulgarity",
"vulgarization",
"vulnerability",
"wakefulness",
"wanness",
"wantonness",
"warmth",
"warmness",
"warm-up",
"warpage",
"wartiness",
"wariness",
"washout",
"wastage",
"wastefulness",
"watchfulness",
"waterproofness",
"wateriness",
"waviness",
"wax-up",
"wealthiness",
"weaning",
"weariness",
"weighing",
"weightlessness",
"weightiness",
"weirdness",
"welcomeness",
"wellness",
"well-definedness",
"wellhead",
"westernization",
"wetness",
"wheeziness",
"whimsicality",
"whiteness",
"wholeness",
"wickedness",
"width",
"wideness",
"wildness",
"wilfulness",
"willingness",
"winding",
"windlessness",
"windiness",
"winglessness",
"wink",
"winsomeness",
"wirelessness",
"wisdom",
"wiseness",
"wishfulness",
"wistfulness",
"withdrawal",
"witlessness",
"womanization",
"woodenness",
"wordlessness",
"wordiness",
"work-up",
"worldliness",
"worthlessness",
"worthwhileness",
"worthiness",
"wrathfulness",
"wretchedness",
"wriggle",
"writing",
"write-off",
"write-up",
"wrongness",
"wrongfulness",
"xenogenicity",
"yearning",
"yellowness",
"youngness",
"youth",
"youthfulness",
"zonality",
"zoophilism",
"zygocity",
"zymogenicity",
"capacitation",
"conglutination",
"cornification",
"decapsulation",
"decoction",
"decortication",
"defibrination",
"defloration",
"detoxication",
"detoxicator",
"devascularization",
"disarticulation",
"disjunction",
"furcation",
"hyposensitization",
"hypotonicity",
"individuation",
"luxation",
"micturition",
"micturation",
"obturation",
"overcorrection",
"politzerization",
"recalcification",
"reeducation",
"reinnervation",
"saucerization",
"sporulation",
"stochasticity",
"subinvolution",
"trifurcation",
"villosity",
"hypermaturity",
"gracility",
"douching",
"gravidity",
"compartmentation",
"Mohammedanism",
"bioelectricity",
"cementification",
"circumduction",
"coinsurance",
"evagination",
"exanimation",
"hyperemotivity",
"hyperirritability",
"inhumation",
"lateroflexion",
"lubrification",
"readaptation",
"reconversion",
"refixation",
"reintervention",
"retrocession",
"telecommunication",
"unbridling",
"verbigeration",
"interruptibility",
"washability",
"grayishness",
"customization",
"vasectomization",
"girlishness",
"territoriality",
"autotomization",
"acid-fastness",
"drug resistance",
"legal blindness",
"manic depressiveness",
"obsessive compulsiveness",
"extractivity",
"extractiveness",
"drug-fastness",
"amination",
"annulation",
"asynchronousness",
"blaseness",
"breathiness",
"buckiness",
"dehumidification",
"desquamation",
"electrocauterization",
"electrohydraulics",
"excitativity",
"excitativeness",
"gassiness",
"habilitation",
"hyperosmia",
"hyposthenuria",
"immotility",
"ingestibility",
"isotopicity",
"nonconductivity",
"nondependence",
"nonseasonality",
"oppositionality",
"overanxiousness",
"overanxiety",
"lightheadedness",
"Machiavellianism",
"manipulativeness",
"preadmission",
"premixture",
"prolation",
"prolateness",
"mercuration",
"migrancy",
"readmission",
"readmittance",
"recementation",
"reinsertion",
"relationality",
"remobilization",
"multiloculation",
"septation",
"serration",
"thermostability",
"situationality",
"secondment",
"thorniness",
"steeliness",
"unaggressiveness",
"stressfulness",
"stresslessness",
"uninsuredness",
"uninsurance",
"sweatiness",
"uninterruptibility",
"unmarriedness",
"unsatisfactoriness",
"unsureness",
"wettability",
"crampiness",
"woolliness",
"yellowishness",
"degradability",
"dimerization",
"dorsiflexion",
"autogenicity",
"goallessness",
"hypervigilance",
"incongruence",
"incongruency",
"incongruity",
"curation",
"cuticularization",
"chromicity",
"specularity",
"modifiability",
"straightforwardness",
"succumbency",
"multilingualism",
"multilinguality",
"multipotency",
"nonlegality",
"saponification",
"nucleation",
"suppressibility",
"syntonicity",
"trefoilness",
"realignment",
"reapplication",
"reappraisal",
"reappraisement",
"regrowth",
"repressibility",
"retrogradation",
"nonendemicity",
"nonrandomization",
"oligoclonality",
"reestablishment",
"renaturation",
"transactivation",
"accouplement",
"unsafeness",
"unsafety",
"bidimensionality",
"bogginess",
"xanthation",
"enlacement",
"erubescence",
"revendication",
"synostosis",
"waxiness",
"fruitiness",
"penetrancy",
"penetrance",
"pulselessness",
"sigmoidity",
"photoallergenicity",
"acculturation",
"anteversion",
"necking",
"distractibility",
"tone deafness",
"heterauxesis",
"hyalinization",
"colliquation",
"adherentness",
"adherence",
"adherency",
"lateralization",
"overventilation",
"acetylization",
"counterindication",
"desiccation",
"druggedness",
"misarticulation",
"neovascularity",
"photolysis",
"plasticization",
"privatization",
"reanalysis",
"reassessment",
"recatheterization",
"rehydration",
"solvation",
"hypomobility",
"biotinylation",
"permeabilization",
"tensility",
"coadministration",
"mobility",
"bleeding",
"comigration",
"defiance",
"emaciation",
"excitement",
"fissuration",
"frustration",
"humidification",
"lamination",
"micromanipulation",
"outdatedness",
"perfidiousness",
"perfidy",
"polyploidity",
"polyploidy",
"radiosensitization",
"randomization",
"reinduction",
"reinducement",
"reoxidation",
"canonicality",
"explantation",
"methodicalness",
"sonication",
"mercuriation",
"superposition",
"immunotitration",
"retransplantation",
"blowing",
"fudging",
"hematoxicity",
"electioneering",
"externality",
"trituration",
"variolation",
"in-migration",
"tamponade",
"tamponment",
"brachiation",
"conglobation",
"gemination",
"colocalization",
"tensioactivity",
"raucousness",
"mixability",
"timorousness",
"brazenness",
"chastisement",
"coevality",
"convocation",
"finickiness",
"implausibility",
"indomitability",
"ineffability",
"litheness",
"lubricity",
"lubriciousness",
"lucubration",
"odiousness",
"peremptoriness",
"personableness",
"prudishness",
"caseation",
"degermination",
"disinfestation",
"exsiccation",
"frugivory",
"insusceptability",
"jactitation",
"orbicularity",
"refringence",
"refringency",
"sclerosity",
"sentiency",
"sentience",
"sublation",
"subtility",
"adaptativity",
"assortativeness",
"assortativity",
"biaxiality",
"oxidizability",
"intersubjectivity",
"intersubjectiveness",
"veridicality",
"nonporosity",
"unselectivity",
"predonation",
"prestress",
"densification",
"survivability",
"hireability",
"includability",
"mineability",
"rinsability",
"shapability",
"skill-lessness",
"spryness",
"will-lessness",
"tradability",
"foldability",
"ionizability",
"preconcentration",
"reassembly",
"recruitability",
"regulatability",
"nonsensitivity",
"nonexchangeability",
"nonfluorescence",
"nonadhesiveness",
"nonacuity",
"nonaggressiveness",
"nonconcordance",
"nonrecurrence",
"nonrepresentativeness",
"non-evidence",
"nonhomogeneity",
"nonhomogeneousness",
"limitedness",
"out-of-dateness",
"myeloablation",
"antiangiogenicity",
"de-escalation",
"cogeneration",
"resale",
"color blindness",
"notation",
"beatification",
"boorishness",
"edacity",
"exsertion",
"extricability",
"implacability",
"impecuniousness",
"mendicancy",
"exposition",
"atypicity",
"aggression",
"chastity",
"drainability",
"sickliness",
"dealation",
"surrogation",
"alliteration",
"applanation",
"approbation",
"aviation",
"cerebration",
"coronation",
"dealkylation",
"debromination",
"dilapidation",
"electrodesiccation",
"estivation",
"fistulation",
"horripilation",
"ideation",
"incrustation",
"encrustation",
"inspissation",
"instauration",
"medullation",
"nodulation",
"nutation",
"overpopulation",
"peregrination",
"peroxidation",
"perseveration",
"perturbation",
"prolongation",
"ratiocination",
"reprecipitation",
"resupination",
"revaluation",
"saltation",
"spoliation",
"transubstantiation",
"underpopulation",
"valuation",
"vermiculation",
"vermiculation",
"godliness",
"well-posedness",
"ill-posedness",
"self-reflectiveness",
"autoinoculation",
"inappetence",
"infelicity",
"infelicitousness",
"interrelatedness",
"jointedness",
"trabecularity",
"misexpression",
"nervousness",
"nerviness",
"nonadjacency",
"nonelasticity",
"nonfermentability",
"nonresistance",
"non-rhythmicity",
"opposability",
"overripeness",
"quintessentiality",
"recondensation",
"reinversion",
"religation",
"retting",
"rugosity",
"runtedness",
"stimulability",
"transcribability",
"transgressiveness",
"unimolecularity",
"twitchiness",
"underrepresentation",
"untimeliness",
"unadaptability",
"unambitiousness",
"unforeseeableness",
"unforeseeability",
"unpersuasiveness",
"unpropitiousness",
"unpunctuality",
"unreadiness",
"unrepeatability",
"unsusceptibility",
"unthriftiness",
"untraceability",
"untrustworthiness",
"nonassertiveness",
"noncommunicativeness",
"noncytopathogenicity",
"nondegradability",
"nonfibrillarity",
"noninfectivity",
"nonresorbability",
"non-sterility",
"nonsuppressibility",
"nonteratogenicity",
"executability",
"fabulousness",
"sexiness",
"searchability",
"collectibility",
"passibility",
"introgression",
"multiphasity",
"nonstationarity",
"prepatency",
"repellence",
"repellency",
"semirigidity",
"tumescence",
"detumescence",
"frozenness",
"subdominance",
"counterargument",
"overadjustment",
"overaggressiveness",
"overalertness",
"overambition",
"overambitiousness",
"overanalysis",
"overapplication",
"overattention",
"overcautiousness",
"overcentralization",
"overclassification",
"overcomplexity",
"overcomplication",
"overinvestigation",
"overcompression",
"overspecification",
"overconcernedness",
"overconscientiousness",
"overcount",
"overcultivation",
"overgrazing",
"overdependence",
"overdependency",
"overdramatization",
"overeagerness",
"overeducation",
"overemotionality",
"overexaggeration",
"overexcitement",
"overexcitement",
"overexpansion",
"overfamiliarity",
"overfatness",
"overfertilization",
"overgeneralization",
"overhastiness",
"overhunting",
"overidentification",
"overinterpretation",
"overinvestment",
"overlength",
"overmanagement",
"undermanagement",
"overmedication",
"undermedication",
"overoptimism",
"overprescription",
"overpromise",
"overpromotion",
"overprotection",
"overreaction",
"underreaction",
"overregulation",
"overreliance",
"overreliance",
"overresponse",
"overrigidity",
"overseriousness",
"oversolicitousness",
"overspecialization",
"overtalkativeness",
"overutilization",
"overwinding",
"overzealousness",
"obnubilation",
"overeruption",
"overgrowth",
"overhydration",
"overingestion",
"oversedation",
"oversensing",
"overextension",
"overaccumulation",
"overcoating",
"overdistension",
"overdrainage",
"underdrainage",
"overexcitability",
"overexuberance",
"overfitting",
"overgenerality",
"overwriting",
"insertability",
"packability",
"homobisexuality",
"hypersexuality",
"hyposexuality",
"multisexuality",
"nonheterosexuality",
"sociosexuality",
"bioabsorbability",
"bioresorbability",
"declotting",
"vasoconstriction",
"bioresorption",
"defluoridation",
"desulfurization",
"cooperativeness",
"cooperativity",
"weediness",
"palmation",
"slurping",
"hypoimmunity",
"ictogenicity",
"self-absorption",
"corticodependence",
"corticodependency",
"disempowerment",
"multigravidity",
"neovascularization",
"undervirilization",
"disinsection",
"cockiness",
"underdosage",
"gentrification",
"unaccessibility",
"alignability",
"unalignability",
"dislocatability",
"indentability",
"nontypeability",
"polyagglutinability",
"rechargeability",
"spreadability",
"unevaluability",
"trilinearity",
"anharmonicity",
"harmonicity",
"bilinearity",
"equiangularity",
"serospecificity",
"metaphoricity",
"dissymmetry",
"ungrammaticality",
"pragmaticality",
"ahistoricity",
"indexicality",
"anamorphosis",
"anamorphism",
"quizzicality",
"quizzicalness",
"etiopathogenicity",
"monochorionicity",
"thermophilicity",
"thermophily",
"ego-syntonicity",
"circumvallation",
"indehiscence",
"remanence",
"cursoriality",
"gramineousness",
"unconscionability",
"defervescence",
"sparge",
"monophagy",
"polyphagy",
"nigrescence",
"reprehensibility",
"commodification",
"dyscoordination",
"subvocalization",
"folivory",
"geophagy",
"piscivory",
"sanguivory",
"coimmunoprecipitation",
"photoincorporation",
"predegeneration",
"contextualization",
"deinactivation",
"autoaggregation",
"preclassification",
"outsourcing",
"primigravidity",
"maleficence",
"nonmaleficence",
"postmodernity",
"postmodernism",
"refashioning",
"benchmarking",
"acontractility",
"rightsizing",
"verotoxicity",
"structuredness",
"interwovenness",
"centeredness",
"assuredness",
"blindedness",
"bloodedness",
"bondedness",
"boundedness",
"constrictedness",
"directedness",
"embeddedness",
"expectedness",
"facedness",
"formedness",
"groundedness",
"orientedness",
"polledness",
"scriptedness",
"skewedness",
"speededness",
"strandedness",
"wrinkledness",
"directiveness",
"directivity",
"obligingness",
"lastingness",
"lovingness",
"twinness",
"chemoinvasiveness",
"immersiveness",
"lesivity",
"ferroelectricity",
"postprocessing",
"destruction",
"comestibility",
"erodibility",
"exhaustibility",
"extendibility",
"impermissibility",
"incoercibility",
"indicibility",
"infeasibleness",
"infeasibility",
"invertibility",
"irreproducibility",
"nondigestibility",
"processibility",
"semiflexibility",
"undiscernibleness",
"unfeasibility",
"compactibility",
"adsorbability",
"associability",
"computability",
"differentiability",
"dilatability",
"equiprobability",
"falsifiability",
"floatability",
"imputability",
"inalterability",
"incommensurability",
"inexcitability",
"leachability",
"meltability",
"modulability",
"patentability",
"relatability",
"scalability",
"sterilizability",
"stretchability",
"unaccountability",
"unpalatability",
"cuttability",
"livability",
"rentability",
"spinnability",
"upgradeability",
"autoxidizability",
"valuability",
"valuableness",
"arousability",
"attachability",
"auditability",
"biosolubility",
"biostability",
"calcifiability",
"compostability",
"conditionability",
"conductibility",
"cytocompatibility",
"designability",
"evolvability",
"hemocompatibility",
"hyperthermostability",
"hypoexcitability",
"immunostainability",
"irresectability",
"irresolvability",
"lysability",
"manufacturability",
"multiprogrammability",
"multistability",
"noncomparability",
"noncompatibility",
"nonrepeatability",
"nonstability",
"photoinducibility",
"photoinstability",
"photoreversibility",
"polymerizability",
"primability",
"reactivatability",
"reagibility",
"redispersibility",
"regenerability",
"regulability",
"replantability",
"resuscitability",
"satisfiability",
"saturatability",
"supportability",
"switchability",
"targetability",
"trackability",
"transducibility",
"traversability",
"ultrafilterability",
"unculturability",
"unmodifiability",
"unretractability",
"xenotransplantability",
"deemphasis",
"detubularization",
"potentization",
"superficialization",
"unconstitutionality",
"heterochromatization",
"mischaracterization",
"misalliance",
"misallocation",
"misassignment",
"miscommunication",
"misdivision",
"mislocation",
"misorientation",
"missorting",
"conventionalization",
"demulsification",
"ammonification",
"basification",
"delignification",
"lignification",
"demagnification",
"interesterification",
"reification",
"saccharification",
"vinification",
"ultrapurity",
"ultrafiltration",
"impermeabilization",
"disenrollment",
"disinvestment",
"unadvisability",
"unanswerableness",
"unapproachableness",
"unapproachability",
"unassailableness",
"unchangeableness",
"unchangeability",
"undecipherability",
"undeniableness",
"undistinguishableness",
"unfathomableness",
"unimpeachableness",
"unknowableness",
"unknowability",
"unmistakableness",
"unpreventableness",
"unthinkableness",
"unthinkability",
"undercooling",
"underproduction",
"triboluminescence",
"translocalization",
"retrodiction",
"resyllabification",
"restandardization",
"nondiscrimination",
"sacralization",
"infraposition",
"oedipality",
"angiospermy",
"angiospermy",
"angiospermy",
"angiospermy",
"chasmogamy",
"cleistogamy",
"gymnospermy",
"anormality",
"weepiness",
"endophily",
"exophily",
"extremophily",
"xerophily",
"self-medication",
"anhydration",
"beneficiation",
"benzylation",
"carbonylation",
"conflation",
"depauperation",
"desulfonation",
"diagnostication",
"disaccommodation",
"instatement",
"jugulation",
"objectivation",
"radioiodination",
"reaccommodation",
"recidivation",
"reconciliation",
"seriation",
"lexicalization",
"nominalization",
"orthogonalization",
"parallelization",
"potentialization",
"renormalization",
"textualization",
"valorization",
"homopolymerization",
"graphitization",
"latitudinarianism",
"revalorization",
"warmheartedness",
"self-actualization",
"surgency",
"counterinsurgency",
"insurgence",
"insurgency",
"multivalency",
"multivalence",
"regardlessness",
"unacceptance",
"underachievement",
"uncompaction",
"homologization",
"modelization",
"objectivization",
"reenactment",
"babysitting",
"portliness",
"headiness",
"venturesomeness",
"loathsomeness",
"unwholesomeness",
"indecipherableness",
"thoroughgoingness",
"irrecoverableness",
"irrecoverability",
"inquisitorialness",
"indescribableness",
"extrapunitiveness",
"extrapunitivity",
"intropunitiveness",
"intropunitivity",
"recollectiveness",
"irresponsiveness",
"inextirpableness",
"inextirpability",
"inharmoniousness",
"inexpressiveness",
"homoeologousness",
"warrantableness",
"indefinableness",
"implicativeness",
"downtroddenness",
"dictatorialness",
"windowlessness",
"watertightness",
"unskillfulness",
"ingressiveness",
"cheeriness",
"vexatiousness",
"verrucoseness",
"verrucosity",
"unceasingness",
"tackiness",
"rivalrousness",
"gustativeness",
"graspableness",
"graspability",
"forcelessness",
"egregiousness",
"vaporousness",
"unctuousness",
"selflessness",
"lopsidedness",
"uptightness",
"baselessness",
"unitiveness",
"prayerfulness",
"biorhythmicity",
"homoscedasticity",
"inauthenticity",
"pseudoplasticity",
"aeroelasticity",
"elastoplasticity",
"thermoelasticity",
"preposterousness",
"magnetoelectricity",
"nonconcentricity",
"readhesion",
"readherence",
"inherence",
"Eurocentrism",
"pluviosity",
"macroptery",
"telecentricity",
"afrocentricity",
"Afrocentrism",
"unselfishness",
"centroacinarity",
"morbosity",
"sublinearity",
"subpolarity",
"subpotency",
"anchorlessness",
"armlessness",
"eventlessness",
"hatlessness",
"risklessness",
"shoelessness",
"spacelessness",
"structurelessness",
"supportlessness",
"consilience",
"decumbency",
"decumbence",
"inexistence",
"interjacency",
"noncompetence",
"nonresidence",
"nonresidency",
"nontransparency",
"semitransparency",
"predelinquency",
"superpotency",
"preexistence",
"protension",
"ingression",
"emersion",
"nonconcurrence",
"unsubstantiality",
"componentiality",
"inessentiality",
"isochronicity",
"transonicity",
"triaxiality",
"eusociality",
"recomposition",
"aflagellarity",
"octoploidy",
"papillarity",
"eurythermality",
"curvaceousness",
"instantiation",
"radiosterilization",
"isostructurality",
"unduplication",
"reserpinization",
"monodispersity",
"monodisperseness",
"monodispersion",
"monodispersal",
"supralinearity",
"superlinearity",
"pedunculation",
"fasciculation",
"denticulation",
"nondivision",
"configurality",
"eburnation",
"quick-wittedness",
"conformism",
"unilineality",
"transdisciplinarity",
"duplicity",
"nonproportionality",
"polyfunctionality",
"unhomogeneity",
"codirectionality",
"nonrationality",
"extensionality",
"fluxionality",
"staminality",
"clinality",
"challengeability",
"characterizability",
"representability",
"objectifiability",
"manipulatability",
"indissociability",
"dischargeability",
"visualizability",
"unverifiability",
"undisputability",
"unanalyzability",
"transmutability",
"manifestability",
"incorporability",
"hybridizability",
"discoverability",
"decomposability",
"cultivatability",
"unexcitability",
"relocatability",
"performability",
"describability",
"contestability",
"confirmability",
"committability",
"addressability",
"utilizability",
"reviewability",
"restorability",
"rejectability",
"recallability",
"quenchability",
"machinability",
"inspirability",
"improvability",
"importability",
"factorability",
"elicitability",
"defendability",
"damageability",
"breathability",
"rotatability",
"rescuability",
"refutability",
"pressability",
"matchability",
"locatability",
"inferability",
"ignorability",
"freezability",
"excisability",
"escapability",
"decidability",
"clottability",
"cleanability",
"activability",
"writability",
"unusability",
"titrability",
"sealability",
"linkability",
"isolability",
"evitability",
"bondability",
"saleability",
"chemoreceptiveness",
"stereoregularity",
"polymolecularity",
"noncircularity",
"contractivity",
"commutativity",
"isostaticity",
"unprogressiveness",
"noncompetition",
"coextensiveness",
"underperformance",
"reinvestment",
"recommitment",
"reelection",
"rewind",
"sodicity",
"glaciation",
"desertification",
"sensationalization",
"directionalization",
"deseasonalization",
"bureaucratization",
"sectionalization",
"psychologization",
"essentialization",
"destigmatization",
"denicotinization",
"delegitimization",
"delegitimation",
"reactualization",
"protocolization",
"paraffinization",
"marginalization",
"corporatization",
"symptomatization",
"androgenization",
"symmetrization",
"schematization",
"relativization",
"pneumatization",
"maximalization",
"minimalization",
"channelization",
"atropinization",
"Africanization",
"texturization",
"systemization",
"racialization",
"preconization",
"platinization",
"isotonization",
"formolization",
"suberization",
"salinization",
"robotization",
"monetization",
"latinization",
"hepatization",
"activization",
"odorization",
"deaeration",
"decarbonation",
"gelatination",
"homologation",
"nitrogenation",
"ozonation",
"passivation",
"revegetation",
"subinoculation",
"deselection",
"cross-correlation",
"photorespiration",
"pyrolysis",
"phoniness",
"gynodioecy",
"elaborativeness",
"insightfulness",
"pulsativity",
"probativeness",
"unusefulness",
"univocity",
"planfulness",
"wobbliness",
"unjustness",
"trendiness",
"crossresistance",
"over-abundance",
"platinate",
"platination",
"biomineralization",
"promotiveness",
"scrum",
"connexity",
"well-formedness",
"well-foundedness",
"self-injuriousness",
"unpretentiousness",
"unconspicuousness",
"noncontagiousness",
"discontiguity",
"presumptuousness",
"momentaneousness",
"contemptuousness",
"pluriparity",
"coterminosity",
"vociferousness",
"monogyny",
"torturosity",
"granulosity",
"wondrousness",
"ravenousness",
"posedness",
"datedness",
"alteredness",
"deservingness",
"guardedness",
"fixity",
"fixedness",
"accusatoriness",
"beaniness",
"blockiness",
"boxiness",
"burstiness",
"choosiness",
"clumpiness",
"cold-hardiness",
"crashworthiness",
"drug-refractoriness",
"edginess",
"fatherliness",
"newsworthiness",
"non-leakiness",
"noncontemporariness",
"nonhardiness",
"nuttiness",
"paltriness",
"photorefractoriness",
"pushiness",
"quasi-steadiness",
"refactoriness",
"scotorefractoriness",
"smudginess",
"springiness",
"uncanniness",
"user-friendliness",
"yolkiness",
"dysmorphogenicity",
"verotoxigenicity",
"isocentricity",
"reablement",
"reapportionment",
"reascertainment",
"reenlistment",
"apexification",
"biostimulation",
"electrovaporization",
"photodestruction",
"predilation",
"butylation",
"waterlessness",
"thornlessness",
"queenlessness",
"footlessness",
"normlessness",
"electroresponsiveness",
"thermoresponsiveness",
"thermoresponsivity",
"immunoresponsiveness",
"photoresponsiveness",
"photoresponsivity",
"graviresponsiveness",
"vasoresponsiveness",
"vasoresponsivity",
"overresponsiveness",
"osmoresponsiveness",
"osmoresponsivity",
"nonrighthandedness",
"hyperdefensiveness",
"outerdirectedness",
"hyperadhesiveness",
"overfriendliness",
"microroughness",
"prosocialness",
"prosociality",
"nonuniqueness",
"intendedness",
"womanliness",
"unsharpness",
"adaptedness",
"curvedness",
"wantedness",
"jaggedness",
"overinclusion",
"crispiness",
"snuffliness",
"tickliness",
"topsy-turviness",
"topsy-turvydom",
"scruffiness",
"branchiness",
"twistiness",
"trustiness",
"stemminess",
"peachiness",
"folksiness",
"crankiness",
"clinginess",
"blobbiness",
"tipsiness",
"spaciness",
"runtiness",
"raspiness",
"gutsiness",
"gustiness",
"curviness",
"bossiness",
"bawdiness",
"dewiness",
"crassness",
"appression",
"photoablation",
"repigmentation",
"pigmentation",
"tetrapolarity",
"quadrupedality",
"preverbality",
"uneffectiveness",
"progredience",
"nonplanarity",
"superelasticity",
"untethering",
"superfluidity",
"preadaptation",
"preadaption",
"vernalization",
"multilinearity",
"unrepresentativeness",
"redislocation",
"cocontraction",
"unsaturability",
"distractiveness",
"noncrystallinity",
"subadditivity",
"ultrasensitivity",
"paracrystallinity",
"noncentrality",
"unsolvability",
"repolymerization",
"integrability",
"semimalignancy",
"binormality",
"unsustainability",
"preapplication",
"unsurmountability",
"binning",
"aciduricity",
"untestability",
"outpouching",
"etherification",
"electrolysis",
"deconcentration",
"unreceptivity",
"unreceptiveness",
"semilethality",
"pathoplasticity",
"dislodgeability",
"formability",
"germinability",
"inadaptability",
"involatility",
"photolability",
"settleability",
"vagility",
"inharmonicity",
"mutarotation",
"augmentability",
"preorganization",
"hypertenseness",
"hypertension",
"hypertensity",
"nonindependence",
"heteropolarity",
"autoactivity",
"nonuniversality",
"localizability",
"hereditability",
"conflictiveness",
"autoreduction",
"underrecognition",
"monomerization",
"proximalization",
"decriminalization",
"catastrophization",
"distalization",
"optimalization",
"supersensitization",
"concretization",
"neuralization",
"crosshybridization",
"mechanosensitivity",
"polyreactivity",
"polymodality",
"monolaterality",
"osmolality",
"multiploidy",
"superstimulation",
"vasomotoricity",
"fractality",
"fractalness",
"tuberization",
"superposability",
"reaeration",
"libration",
"nonneutrality",
"performativity",
"semicastration",
"circumnutation",
"nondiploidy",
"subdiploidy",
"autoinhibition",
"neuroplasticity",
"noncongruence",
"autorhythmicity",
"aquation",
"oxidability",
"zonation",
"reinfection",
"nonsaturability",
"nonenhancement",
"nontolerance",
"nonmucoidness",
"nonredundancy",
"noninvolvement",
"nondefectiveness",
"noncomplementarity",
"errorproneness",
"nonautonomy",
"redesignation",
"ketonization",
"contraception",
"radioprotection",
"filmlessness",
"nestedness",
"bioprocessing",
"cohorting",
"fractioning",
"thin-sectioning",
"respecification",
"neocapillarity",
"enantioseparation",
"temperature sensitivity",
"two-sidedness",
"right-sidedness",
"leftsidedness",
"self-directedness",
"work-relatedness",
"mixed-handedness",
"open-mindedness",
"goal-directedness",
"self-destructiveness",
"self-destruction",
"group-specificity",
"species specificity",
"self-administration",
"matter-of-factness",
"Lyonization",
"photodisruption",
"denitrogenation",
"autoamputation",
"self-evidentness",
"self-evidence",
"warm-bloodedness",
"well-preservedness",
"assortiveness",
"rollerblading",
"extraimmunization",
"pseudomalignancy",
"overdetermination",
"xenotransplantation",
"overexpression",
"electroporation",
"stepwiseness",
"autophosphorylation",
"ambidexterity",
"ambidextrousness",
"vesication",
"wooziness",
"scapegoating",
"codependence",
"codependency",
"subfecundity",
"pelletization",
"perdeuteration",
"perifusion",
"photodecomposition",
"photoexcitation",
"photoinactivation",
"photoinduction",
"photoisomerization",
"photooxidation",
"photooxidization",
"photopolymerization",
"photoreactivation",
"photoreduction",
"photostimulation",
"pinealectomy",
"pinocytosis",
"preabsorption",
"preactivation",
"precoating",
"preconditioning",
"predefinition",
"preestablishment",
"preexposure",
"pre-exposition",
"preimmunization",
"preinduction",
"preinfection",
"preirradiation",
"premedication",
"preprocessing",
"prereduction",
"preselection",
"presensitization",
"prespecification",
"prestimulation",
"pretesting",
"proteolysis",
"pseudostratification",
"purebredness",
"pyrophosphorylation",
"quadruplication",
"quantization",
"ranching",
"reaccumulation",
"readministration",
"reaggregation",
"reallocation",
"reamputation",
"reassignment",
"reassociation",
"reattachment",
"rebleeding",
"recalculation",
"recanalization",
"recharge",
"recirculation",
"recolonization",
"recommencement",
"recomputation",
"reconceptualization",
"reconfirmation",
"reconnection",
"recrystallization",
"recultivation",
"redefinition",
"redescription",
"redetermination",
"rediscovery",
"redissolution",
"reemphasis",
"reexpression",
"reformulation",
"rehospitalization",
"reimmunization",
"reimplantation",
"reincubation",
"reinfusion",
"reinitiation",
"reinjection",
"reinjury",
"reinoculation",
"reinstitution",
"reinterpretation",
"reintroduction",
"reintubation",
"reinvestigation",
"reisolation",
"remeasurement",
"remediation",
"remyelination",
"reoccurrence",
"unsuitability",
"unsuitableness",
"reoxygenation",
"reperfusion",
"repolarization",
"repopulation",
"resequencing",
"resolubilization",
"respiration",
"restimulation",
"resuspension",
"retransfusion",
"reutilization",
"revaccination",
"revascularization",
"ritualization",
"sensibilization",
"siliconization",
"silylation",
"sludging",
"speciation",
"spiralization",
"strangulation",
"subsaturation",
"subspecialization",
"synthetization",
"teletransmission",
"thermoregulation",
"thermosensitization",
"tolerization",
"tosylation",
"traumatization",
"triangulation",
"tubulation",
"tuftedness",
"unbiasedness",
"unboundedness",
"uncircumcision",
"unconnectedness",
"undecidedness",
"underemphasis",
"underhydroxylation",
"underutilization",
"undevelopment",
"undirectedness",
"undocumentedness",
"unencapsulation",
"unforgivingness",
"unforgiveness",
"unfulfillment",
"unimpairment",
"uninhibitedness",
"unintendedness",
"unionization",
"unligation",
"unmethylation",
"unpreparedness",
"unrewardingness",
"unstabilization",
"monodispersal",
"monodispersity",
"monodispersion",
"monoinfection",
"monophosphorylation",
"multilamination",
"multilobation",
"necrotization",
"nonaffectedness",
"noncommunication",
"noncomplication",
"nondepression",
"nondifferentiation",
"nonimmunosuppression",
"noninteraction",
"nonlactation",
"nonpretreatment",
"nonrelatedness",
"nonstimulation",
"nonsuppression",
"nonsurvival",
"nontreatment",
"nonvaccination",
"nonventilation",
"nonvisualization",
"objectification",
"oligomerization",
"operationalization",
"ordination",
"osmoregulation",
"overcompensation",
"overdevelopment",
"overdiagnosis",
"overrepresentation",
"oversaturation",
"overtraining",
"oviposition",
"oxidation",
"overreplication",
"psychomotoricity",
"antimitogenicity",
"comutagenicity",
"enantiospecificity",
"neuropathogenicity",
"pharmacotoxicity",
"thymocytotoxicity",
"gonadotoxicity",
"isoionicity",
"multiethnicity",
"syncarcinogenicity",
"arthrogenicity",
"melanocytotoxicity",
"nephropathogenicity",
"ciguatoxicity",
"mechanoelectricity",
"nephrocarcinogenicity",
"photomutagenicity",
"erythematogenicity",
"ethnocentrism",
"ethnocentricity",
"microepidemicity",
"neurotoxigenicity",
"radiotoxicity",
"virogenicity",
"erythrotoxicity",
"immunocytotoxicity",
"neurocarcinogenicity",
"cationization",
"cotranscription",
"departmentalization",
"parameterization",
"resocialization",
"recontamination",
"incrementation",
"demasculinization",
"digitilization",
"micromodification",
"revalidation",
"subcategorization",
"depoliticization",
"devitrification",
"diverticulization",
"dorsalization",
"pustulation",
"skeletonization",
"Americanization",
"deacidification",
"defenestration",
"exflagellation",
"pressurization",
"reconfiguration",
"reincorporation",
"thermocauterization",
"alphabetization",
"anodization",
"bicompartmentalization",
"colorization",
"disincorporation",
"federalization",
"glucuronization",
"haploidization",
"impersonalization",
"sexualization",
"coexpression",
"imprecision",
"impreciseness",
"reexpansion",
"recompression",
"cotransmission",
"reassortment",
"overtreatment",
"redevelopment",
"ensheathment",
"undertreatment",
"emplacement",
"encystation",
"encystment",
"interprofessionalism",
"neuroprotectiveness",
"neuroprotectivity",
"selectability",
"overproduction",
"multimericity",
"cardioprotectiveness",
"cleavability",
"synonymity",
"synonymousness",
"heteronuclearity",
"nonpermissiveness",
"nonpermissivity",
"longstandingness",
"acylation",
"uncontrollability",
"quantifiability",
"immunomagnetism",
"costimulation",
"unconventionality",
"organotypicity",
"republication",
"nonpalpability",
"radioprotectivity",
"euthanization",
"proarrhythmicity",
"hydrolyzability",
"multiresistance",
"enantioselectivity",
"microporosity",
"electroneutrality",
"fermentability",
"supramolecularity",
"resorbability",
"activatability",
"nondestructiveness",
"multidirectionality",
"recursivity",
"recursiveness",
"subsidiarity",
"ellipticity",
"hyperdensity",
"unsteadiness",
"recommendability",
"immunoactivity",
"osteoinductivity",
"gastroprotectivity",
"superfluousness",
"heteroplasmicity",
"recordability",
"supercriticality",
"nongenotoxicity",
"brain death",
"multilamellarity",
"unintentionality",
"luminescence",
"amyloidogenicity",
"distensibility",
"apposition",
"transversality",
"significativity",
"significativeness",
"coaxiality",
"nonclassicality",
"hepatoprotectivity",
"sinisterness",
"trienniality",
"Unitarianism",
"velvetiness",
"woodiness",
"libertarianism",
"manipulability",
"mealiness",
"mushiness",
"omnipresence",
"panickiness",
"percussiveness",
"pickiness",
"producibility",
"productibility",
"reediness",
"reimbursability",
"salvageability",
"serviceability",
"sliminess",
"speediness",
"spikiness",
"starkness",
"stockiness",
"stridency",
"stringiness",
"stubbiness",
"stumpiness",
"superlativeness",
"swartness",
"tacitness",
"tetragonality",
"textuality",
"ticklishness",
"tiresomeness",
"titularity",
"tonalness",
"tonality",
"transitivity",
"transitiveness",
"unidimensionality",
"unruliness",
"valiance",
"venerability",
"veritability",
"vernacularity",
"vibrance",
"vibrancy",
"victoriousness",
"virtuousness",
"waywardness",
"wholesomeness",
"wryness",
"zealousness",
"fusogenicity",
"immunonegativity",
"titratability",
"agranularity",
"tridimensionality",
"reexposure",
"unhelpfulness",
"superparamagnetism",
"unconditionality",
"thermoneutrality",
"myelination",
"immunodetectability",
"nonproductivity",
"nonproductiveness",
"nondetectability",
"hyperthermophilicity",
"evaporativity",
"nonvascularity",
"colinearity",
"multinationality",
"helicity",
"transdominance",
"unwellness",
"educativeness",
"seroreversion",
"dysregulation",
"multiprofessionality",
"electroinsertion",
"cumbrousness",
"disinflation",
"polymorphy",
"zoophilism",
"anisotropicity",
"bilobularity",
"congruousness",
"cymbocephaly",
"devaluation",
"disharmony",
"dizygosity",
"exothermality",
"connation",
"epithelization",
"abscession",
"automatization",
"adoptability",
"ageism",
"alloincompatibility",
"ambidirectionality",
"aneuploidogenicity",
"asphericity",
"biculturality",
"chemoprotectiveness",
"coassembly",
"conflictuality",
"emulsifiability",
"equiluminosity",
"hyperinvasiveness",
"hyperstability",
"coregulation",
"covariability",
"crunchiness",
"disproportionality",
"hypermutation",
"hyperpermeability",
"hypnotizability",
"hypofluorescence",
"hypoechogenicity",
"immunoassayability",
"inadvisability",
"immunotargetability",
"inefficacity",
"inefficacy",
"inefficaciousness",
"inequivalence",
"inequivalency",
"inextractability",
"inheritability",
"monofollicularity",
"multibranching",
"multicausality",
"multidetermination",
"multideterminism",
"multispecificity",
"neuroinvasiveness",
"neuroinvasivity",
"nonadditivity",
"nonautomaticity",
"nonbipolarity",
"nonclonality",
"noncooperativity",
"noncontingency",
"noncompensation",
"noncorrelatedness",
"noncorrelation",
"noncoplanarity",
"nonculturability",
"nondialyzability",
"nondisjunction",
"nondissociability",
"nondiabetogenicity",
"workability",
"wordlikeness",
"wearability",
"untranslatability",
"unsoundness",
"unrecognizableness",
"unprovability",
"unmanageability",
"unlawfulness",
"underprediction",
"underprescription",
"undersedation",
"undifferentiation",
"uncommunicativeness",
"achirality",
"aggregatability",
"alkaliphily",
"allotransplantation",
"altriciality",
"antiferromagnetism",
"antirepression",
"bronchoactivity",
"catenation",
"expressibility",
"misattribution",
"nonequivalency",
"nonequivalence",
"fewness",
"fertilizability",
"fictionality",
"generationality",
"heterosexism",
"heteromultimerization",
"heterodimerization",
"xenoreactivity",
"verifiability",
"underphosphorylation",
"unclottability",
"uncooperativeness",
"underdeterminedness",
"undependability",
"autofluorescence",
"coinheritance",
"cryoprecipitability",
"venodilation",
"ventralization",
"vasodilation",
"uninducibility",
"underactivity",
"undecidability",
"underdetection",
"ultrapurification",
"typeability",
"trimodality",
"tripolarity",
"transportability",
"tubularization",
"undercorrection",
"ubiquitination",
"tumbliness",
"transphosphorylation",
"transfectability",
"transcomplementation",
"thromboresistance",
"teachability",
"synchronicity",
"surmountability",
"substitutability",
"subsensitivity",
"superobesity",
"subspecificity",
"subcriticality",
"subcompartmentalization",
"stimulatability",
"specifiability",
"unfrequency",
"tetramerization",
"thermalization",
"tempestuousness",
"taxonicity",
"tautomerization",
"synonymization",
"suspensiveness",
"susceptibility",
"superovulation",
"superinfection",
"supercondensation",
"superactivation",
"subfebrility",
"solation",
"spermiation",
"annualization",
"anonymization",
"antennarity",
"anteriorization",
"apodization",
"arylation",
"associativity",
"autocatalysis",
"autodegradation",
"autotransfusion",
"axenization",
"baricity",
"bilineality",
"blotchiness",
"chemoattraction",
"collegiality",
"derivability",
"briefness",
"capitation",
"chemo-sensitization",
"chemoprevention",
"cocolonization",
"coenrichment",
"coexposure",
"coregistration",
"claustrophobia",
"coactivity",
"cocirculation",
"cocrystallization",
"cofractionation",
"coimmobilization",
"coinfusion",
"collateralization",
"comodulation",
"concordance",
"compensability",
"copromotion",
"cosolubilization",
"crossability",
"cryotreatment",
"cyanylation",
"cytoadherence",
"cytoadhesion",
"cytoadhesiveness",
"deadenylation",
"deaggregation",
"debondment",
"decongestion",
"deenergization",
"deepithelialization",
"defasciculation",
"defluorination",
"deformylation",
"defunctionalization",
"deliverability",
"demembranation",
"demonstratability",
"denaturation",
"deparaffinization",
"depotentiation",
"deprojection",
"desalinization",
"determinability",
"determinableness",
"mechanoreceptivity",
"medicalization",
"microcannulation",
"electroactivity",
"feeblemindedness",
"dysmaturity",
"dyssynchrony",
"embryofeto-toxicity",
"discretization",
"epifluorescence",
"epiluminescence",
"equiluminance",
"euryhalinity",
"exogastrulation",
"faddiness",
"fibrillogenicity",
"flexibilization",
"foveation",
"framelessness",
"gastrotoxicity",
"geranylgeranylation",
"gradability",
"kinesigenicity",
"liposolubility",
"misrecognition",
"hyperaggregation",
"hyperarticulation",
"hyperarticulateness",
"hypercontractility",
"hyperechogenicity",
"hyperexpression",
"hyperfluorescence",
"hypergranularity",
"hyperinducibility",
"hyperinflation",
"hypermethylation",
"hypermotility",
"hypernucleation",
"hepatoxicity",
"histofluorescence",
"misperception",
"misregulation",
"mislocalization",
"stabilization",
"sidedness",
"shareability",
"seroreactivity",
"semiweekliness",
"semidominance",
"semiconservativeness",
"repurification",
"replicability",
"resterilizability",
"reincarceration",
"nitrosylation",
"noncariogenicity",
"immunodepletion",
"imprintability",
"interfertility",
"insonification",
"multistrandedness",
"isofluorescence",
"isointensity",
"isopotentiality",
"isosmolarity",
"kosmotropicity",
"macroencapsulation",
"intravasation",
"isodensity",
"lactonization",
"mobilizability",
"nondipolarity",
"nonemergence",
"nonevaluability",
"noneffectiveness",
"nonexponentiality",
"nonfluency",
"lossiness",
"photoconductivity",
"photoprotectiveness",
"perseverativeness",
"nonexcitability",
"nonfamiliarity",
"nonurgency",
"lichenification",
"licitness",
"medialization",
"lipidation",
"nonoperability",
"nonmodifiability",
"noninducibility",
"noninhibition",
"noninjury",
"nonnegativity",
"nonnegotiation",
"nonoptimality",
"nonperforation",
"nonpermeability",
"nonpacing",
"nonprolongation",
"nonreducibility",
"nonresectability",
"nonrigidity",
"nonreversibility",
"nonsecretion",
"mimetization",
"morcellation",
"monophosphorylation",
"multiplication",
"multivariance",
"nonsupplementation",
"nonsusceptibility",
"nontransplantation",
"nontransferability",
"nonrenewability",
"inviability",
"oblation",
"overconsumption",
"overassociation",
"overdetection",
"overelongation",
"overinsertion",
"overlearning",
"overreferral",
"overprotectiveness",
"oversensitivity",
"oversensitiveness",
"overproliferation",
"overtranscription",
"overprediction",
"oversecretion",
"oversynthesis",
"nonthresholdness",
"multimerization",
"perfusability",
"pourability",
"precontraction",
"preobesity",
"preprotection",
"preregistration",
"phosphonylation",
"phosphorylatability",
"photogenotoxicity",
"pharmacoresistance",
"photoregulation",
"polyadenylation",
"polyglutamylation",
"phototumorigenicity",
"plurihormonality",
"poeticality",
"polarizability",
"protectability",
"sublocalization",
"scorability",
"seroincidence",
"senescence",
"screenability",
"sclerotization",
"reventilation",
"reunification",
"retrusion",
"retrotransposition",
"retrotransposal",
"retrotranscription",
"retraumatization",
"retransformation",
"rigidification",
"reperforation",
"reobliteration",
"renegotiation",
"relocalization",
"reinternalization",
"reentry",
"reentrance",
"reemergence",
"radioprotectability",
"restitution",
"residualization",
"resensitization",
"resistibility",
"rephosphorylation",
"reperitonealization",
"reocclusion",
"remapping",
"relipidation",
"relaxivity",
"reinvention",
"reinflation",
"reextraction",
"rededication",
"recategorization",
"reformability",
"regioselectivity",
"reendothelialization",
"reflectability",
"reexcision",
"reelevation",
"reirradiation",
"reesterification",
"reepithelialization",
"redetection",
"redissection",
"reequilibration",
"reconstructability",
"reamplification",
"recrudescence",
"rearterialization",
"reabsorptivity",
"reapproximation",
"reafference",
"reafferentation",
"radioresponsiveness",
"radioresponsivity",
"quaternization",
"pupariation",
"pseudotoxicity",
"lognormality",
"haploinsufficiency",
"unsociability",
"deflagration",
"grubbiness",
"fluidification",
"overactivity",
"reclusiveness",
"semiconsciousness",
"temperamentalness",
"thirstlessness",
"unrecordability",
"tubulation",
"tubulation",
"chewiness",
"theatricality",
"threadiness",
"uncleanliness",
"uncleanness",
"chondrification",
"dissociality",
"functionlessness",
"fantasticality",
"hyperresonance",
"griminess",
"multiaxiality",
"multiseptation",
"phonation",
"raylessness",
"retrodisplacement",
"viscidity",
"untidiness",
"unreadability",
"unemployability",
"unprofitability",
"unprofitableness",
"tomboyishness",
"stimulativeness",
"rugosity",
"acid-resistance",
"redheadedness",
"rumplessness",
"whiskeredness",
"windedness",
"sassiness",
"unscrupulousness",
"unserviceability",
"unserviceableness",
"unselfconsciousness",
"unprofessionalism",
"unprofessionality",
"unimaginativeness",
"uglification",
"terminability",
"tenselessness",
"tectonization",
"ridability",
"rhematization",
"revivescence",
"neoclassicism",
"nidification",
"nodulization",
"organizability",
"schizotypality",
"joblessness",
"self-awareness",
"problematization",
"cost effectiveness",
"ellipticalness",
"ellipticality",
"imageability",
"reachability",
"nondirectiveness",
"multilobulation",
"incomitancy",
"incomitance",
"unsupportability",
"uninterpretability",
"bilobarity",
"examinability",
"reconsolidation",
"chewability",
"nonportability",
"propositionality",
"unicentricity",
"unobtrusiveness",
"bifascicularity",
"ratability",
"postposition",
"noncompressibility",
"hispanicity",
"quasiperiodicity",
"cross-disciplinarity",
"aestheticity",
"agglutinogenicity",
"alphabeticity",
"anatomicity",
"asymmetry",
"atavism",
"basophily",
"cyclicality",
"cylindricity",
"desamidation",
"desamidization",
"dendricity",
"disorientation",
"dynamism",
"endothermicity",
"fimbriation",
"isoenzymicity",
"sphericity",
"septation",
"disharmony",
"Episcopalianism",
"nonvolatility",
"earlessness",
"fundability",
"nonflammability",
"unattainability",
"remanipulation",
"unidentifiability",
"uncongeniality",
"underventilation",
"unabsorbability",
"flowability",
"overtiredness",
"crushability",
"misadministration",
"castability",
"unbreakability",
"pre-approval",
"retrial",
"nondisjunction",
"slinkiness",
"unworthiness",
"lunglessness",
"unsocialness",
"hyperoxygenation",
"temporalization",
"interlineation",
"labialization",
"foodlessness",
"doubtlessness",
"demonization",
"uninformativeness",
"uninformativity",
"unaffordability",
"flightiness",
"sappiness",
"tonguedness",
"achiness",
"naplessness",
"painterliness",
"summarizability",
"babyishness",
"bearishness",
"blithesomeness",
"bedazzlement",
"blurriness",
"clownishness",
"dethronement",
"elfishness",
"featherlessness",
"flirtatiousness",
"foresightedness",
"houselessness",
"humorlessness",
"limblessness",
"lusterlessness",
"manlikeness",
"muskiness",
"owlishness",
"administrability",
"amercement",
"caddishness",
"catechization",
"churlishness",
"clayeyness",
"countersignature",
"crossreference",
"derisiveness",
"digressiveness",
"disbarment",
"disestablishment",
"drollness",
"easterliness",
"disaffection",
"faddishness",
"fiendishness",
"emulousness",
"ghoulishness",
"hellishness",
"hoggishness",
"housewifeliness",
"impressibility",
"irruption",
"loutishness",
"lumpishness",
"monkishness",
"mussiness",
"oafishness",
"peppiness",
"pharisaicalness",
"pridefulness",
"rapturousness",
"reformativeness",
"resistlessness",
"rhizomatousness",
"routinization",
"prettification",
"shirtlessness",
"sottishness",
"subversiveness",
"superscription",
"toilsomeness",
"zestfulness",
"vendibility",
"troublousness",
"snappiness",
"sluttishness",
"snappishness",
"starlessness",
"tamelessness",
"westerliness",
"intromission",
"precancellation",
"seasonableness",
"seasonability",
"predaceousness",
"predacity",
"erasability",
"musicalization",
"stodginess",
"presettlement",
"ropiness",
"enthronement",
"knowability",
"mussitation",
"oscularity",
"pixilation",
"circumambience",
"circumambiency",
"nectarivory",
"nugaciousness",
"deracination",
"discommodiousness",
"floriferousness",
"fossoriality",
"grandiloquence",
"lactescence",
"corkiness",
"dementation",
"compartment",
"relubrication",
"reacceleration",
"reacceptance",
"reacclimatization",
"reaccreditation",
"reacquaintance",
"reannexation",
"reappointment",
"reappropriation",
"reapproval",
"reargument",
"rearousal",
"rearticulation",
"reascent",
"reascension",
"reascendancy",
"reattainment",
"reattribution",
"reauthorization",
"rebalancement",
"rebaptism",
"reassumption",
"rebid",
"reboiling",
"recentralization",
"recentrifugation",
"recodification",
"recoloration",
"recompilation",
"reconcentration",
"reconquest",
"reconsecration",
"recontact",
"reconviction",
"redefection",
"redelivery",
"redeposition",
"redigestion",
"rediscussion",
"redisposal",
"redisposition",
"redistillation",
"redrawing",
"re-eligibility",
"re-emission",
"re-employment",
"re-encounter",
"re-endowment",
"re-energization",
"re-engagement",
"re-engraving",
"re-enlistment",
"re-enrollment",
"re-enthronement",
"re-equipment",
"re-erection",
"re-escalation",
"re-estimate",
"re-estimation",
"re-experience",
"re-exportation",
"re-export",
"refiling",
"refiring",
"forgeability",
"refortification",
"refoundation",
"regrading",
"regrounding",
"rehanging",
"rehire",
"rehumanization",
"reidentification",
"reignition",
"reimmersion",
"reimportation",
"reimposition",
"reindictment",
"reinhabitation",
"reinspection",
"reinspiration",
"reinstallation",
"reinstitutionalization",
"reinterment",
"reinvasion",
"reinvigoration",
"rejudgement",
"rekeying",
"relaunch",
"relicensure",
"reliquefaction",
"relinkage",
"rematerialization",
"remigration",
"remotivatation",
"remotivation",
"renationalization",
"reobservation",
"reoccupation",
"reoccupancy",
"reorchestration",
"repopularization",
"repressurization",
"reprivatization",
"repunctuation",
"resolidification",
"reregistration",
"reregulation",
"re-release",
"resecurement",
"resegregation",
"respiritualization",
"respotting",
"restabilization",
"resubmission",
"resystematization",
"retransmission",
"transmissivity",
"transmissiveness",
"revisualization",
"long sightedness",
"self-centeredness",
"reprogrammability",
"hypersomnolence",
"algesia",
"underexertion",
"hyporesonance",
"hyporesonance",
"hypoventilation",
"ovulation",
"distractability",
"absentmindedness",
"hypoemotivity",
"hypertalkativity",
"hypertalkativeness",
"pseudoimpotence",
"pseudofrigidity",
"uncoordination",
"hyperalertness",
"dopiness",
"dopeyness",
"hyperexcitation",
"hyperexcitement",
"hyperexcitability",
"hyperdefecation",
"infibulation",
"dehydroxylation",
"delamination",
"demodulation",
"demystification",
"deoxygenation",
"depersonalization",
"depigmentation",
"depressurization",
"deprotonation",
"desensitization",
"desulfation",
"desynchronization",
"diacetylation",
"diacylation",
"dialkylation",
"dideuteration",
"diesterification",
"difluorination",
"dihalogenation",
"dihydrogenation",
"dihydroxylation",
"diiodination",
"dimethylation",
"diphosphorylation",
"disaggregation",
"disambiguation",
"disassembly",
"editorialization",
"effluxion",
"effusion",
"electrocoagulation",
"electrodialysis",
"electroejaculation",
"elutriation",
"engorgement",
"epimerization",
"epoxidization",
"equilibration",
"etiolation",
"euhydration",
"euthanatization",
"exenteration",
"feminization",
"fictionalization",
"flocculation",
"focalization",
"forestation",
"formalinization",
"formylation",
"gastrulation",
"gestation",
"hemoagglutination",
"hemodialysis",
"hemodilution",
"hemicastration",
"haemoperfusion",
"heterotransplantation",
"heterotransplantability",
"hyperextension",
"hypermodification",
"hyperpigmentation",
"hypersensitization",
"hyperstimulation",
"hypertransfusion",
"hypohydration",
"hypomethylation",
"hypomineralization",
"initialization",
"insolubilization",
"insufflation",
"interconnectedness",
"interconnection",
"interconversion",
"interconvertibility",
"intercorrelation",
"interiorization",
"intussusception",
"isoimmunization",
"isomerization",
"locomotion",
"lypophilization",
"macroaggregation",
"mainstreaming",
"maladaptedness",
"margination",
"melanization",
"microaggregation",
"microcomputerization",
"microdissection",
"microencapsulation",
"microfiltration",
"microperfusion",
"misalignment",
"misclassification",
"misincorporation",
"misspecification",
"mistreatment",
"moisturization",
"immunoabsorbtion",
"immunoabsorption",
"immunoadsorbtion",
"immunodepression",
"immunoenhancement",
"immunomodulation",
"immunoregulation",
"immunostimulation",
"bioactivation",
"bruxism",
"echolocation",
"functionalization",
"underdiagnosis",
"rethrombosis",
"semisynthesis",
"oligomericity",
"transgenicity",
"gluconeogenicity",
"viscoelasticity",
"embryotoxicity",
"isopycnicity",
"autophagy",
"nonpathogenicity",
"heterodimericity",
"nontumorigenicity",
"noncytotoxicity",
"anxiogenicity",
"piezoelectricity",
"antiandrogenicity",
"nonallergicity",
"radioimmunology",
"hyperendemicity",
"excitotoxicity",
"motoricity",
"diamagnetism",
"bronchospasticity",
"immunospecificity",
"haptics",
"hapticity",
"monotypicity",
"nonimmunogenicity",
"nonmutagenicity",
"rhombicity",
"alloantigenicity",
"subtoxicity",
"antithrombogenicity",
"hypoosmoticity",
"hypotrophicity",
"promutagenicity",
"biospecificity",
"noncarcinogenicity",
"isostericity",
"photoelasticity",
"apathogenicity",
"recombinogenicity",
"alkalophilicity",
"nonmonotonicity",
"fetotoxicity",
"immunotoxicity",
"nontoxigenicity",
"rheogenicity",
"autoantigenicity",
"uterotrophicity",
"nonmitogenicity",
"congophilicity",
"arthritogenicity",
"heterospecificity",
"enterotoxicity",
"porphyrinogenicity",
"neurospecificity",
"nonpyrogenicity",
"regiospecificity",
"emetogenicity",
"hepatotrophicity",
"nonthrombogenicity",
"reactogenicity",
"echoicity",
"heterocliticity",
"hyperandrogenicity",
"iconicity",
"cataleptogenicity",
"dysrhythmicity",
"argentophilicity",
"organospecificity",
"hyperoncoticity",
"bathochromicity",
"entomopathogenicity",
"hypertensinogenicity",
"noncyclicity",
"triclinicity",
"progestogenicity",
"subperiodicity",
"syllabicity",
"thrombophilicity",
"histotoxicity",
"pyelonephritogenicity",
"toxinogenicity",
"angiocentricity",
"hypoallergenicity",
"tremorgenicity",
"pulsivity",
"pulsiveness",
"physiopathogenicity",
"pneumotoxicity",
"porphyrogenicity",
"ribosylation",
"deactivation",
"immunolocalization",
"deacylation",
"aromatization",
"arborization",
"inception",
"microdilution",
"deconvolution",
"deacetylation",
"aminoacylation",
"coincubation",
"deethylation",
"sialylation",
"readdition",
"cytodifferentiation",
"vesiculation",
"hyperfiltration",
"autocorrelation",
"alloimmunization",
"deprotection",
"delipidation",
"contradistinction",
"covariation",
"desialylation",
"immunoneutralization",
"electroelution",
"regionalization",
"reacylation",
"bioaccumulation",
"decondensation",
"reintegration",
"overstimulation",
"encapsidation",
"decidualization",
"reexploration",
"coactivation",
"microtitration",
"striation",
"transdifferentiation",
"collimation",
"zonation",
"deconjugation",
"transesterification",
"microagglutination",
"microagglutination",
"ethylation",
"organification",
"labilization",
"actualization",
"hyperproduction",
"hyperproliferation",
"ultrasonication",
"counterregulation",
"coaggregation",
"glucosylation",
"immunoinhibition",
"antiaggregation",
"dispensarization",
"lipoxygenation",
"multinucleation",
"coevolution",
"cosegregation",
"cotransformation",
"copolymerization",
"derotation",
"copurification",
"crossreaction",
"cross-reactivity",
"demedullation",
"autodigestion",
"coelution",
"maldigestion",
"microembolization",
"superprecipitation",
"disregulation",
"hyperfractionation",
"disproportionation",
"neuromodulation",
"autoinduction",
"autoinduction",
"dishabituation",
"hemocoagulation",
"hypercoagulation",
"autoactivation",
"cryoprotection",
"dissertation",
"hyposecretion",
"microdetermination",
"photodegradation",
"photodissociation",
"recertification",
"galactosylation",
"hyperhydration",
"neurostimulation",
"pupation",
"codistribution",
"curarization",
"disinsertion",
"hyperinnervation",
"microcatheterization",
"autoimmunization",
"autoinjection",
"decannulation",
"dysmyelination",
"hyperacetylation",
"malignization",
"radiolocalization",
"recalibration",
"redifferentiation",
"comedication",
"cosedimentation",
"collaborativeness",
"seroprevalence",
"malrotation",
"nonsignificance",
"superhelicity",
"comorbidity",
"curvilinearity",
"unambiguity",
"unambiguousness",
"sigmoidality",
"assessability",
"downregulation",
"repeatability",
"iterativeness",
"nonobesity",
"T-cell dependency",
"antioxidativity",
"speculativeness",
"glucuronidation",
"hyperintensity",
"administration",
"reinfarction",
"nonuniformity",
"osseointegration",
"releasability",
"morphofunctionality",
"endocytosis",
"photorefractivity",
"upregulation",
"neuroactivity",
"rebreathing",
"chromatofocusing",
"multiplanarity",
"prototypicality",
"hyperechoicity",
"multiplicativity",
"hemi-methylation",
"hemi-deletion",
"nonresponsivity",
"nonresponsiveness",
"monoexponentiality",
"bioavailability",
"myristoylation",
"interpretability",
"hyporesponsiveness",
"hyporesponsivity",
"superimposability",
"impermeance",
"membrane-impermeance",
"ADP-ribosylation",
"adenosine diphosphate-ribosylation",
"nonexistence",
"subtractivity",
"affordability",
"testability",
"dorsoventrality",
"cotreatment",
"thermosensitivity",
"monofunctionality",
"uncorrelatedness",
"immunopurification",
"hyperphosphorylation",
"coinfection",
"sustainability",
"processiveness",
"displaceability",
"cytoreduction",
"explorativity",
"bounciness",
"compressibility",
"desultoriness",
"extensibility",
"infra-occlusion",
"multidrug resistance",
"orthocephaly",
"orthognathism",
"stenothermy",
"pluripotency",
"pluripotence",
"multiloculation",
"striation",
"retroflexion",
"hierarchicality",
"hoariness",
"ironicalness",
"legitimization",
"metricity",
"orientation",
"pathologicality",
"physiologicity",
"pleochroism",
"protheticity",
"protheticness",
"Pentecostalism",
"totipotency",
"transmittability",
"trichromaticity",
"stereotypicality",
"stoicism",
"symmetricity",
"acetowhiteness",
"adversarialness",
"aggregability",
"aglycosylation",
"alloresponsiveness",
"aneugenicity",
"antigenization",
"antioncogenicity",
"application",
"application",
"artifactuality",
"atherothrombogenicity",
"autoagglutination",
"autoclavability",
"autogeneration",
"autoproliferation",
"autosensitization",
"bacillarity",
"backcrossing",
"barbarianism",
"barosensitivity",
"bendability",
"benzofusion",
"benzoylation",
"biclonality",
"biethnicity",
"biotolerance",
"bioinertness",
"bioadhesiveness",
"bioconversion",
"biomagnification",
"bioreduction",
"bioremediation",
"biotransformation",
"biovariance",
"biradicality",
"bisintercalation",
"bistability",
"blackishness",
"blockability",
"bruisability",
"cancerization",
"canonicity",
"capillarization",
"centrifugation",
"chelatability",
"chemoresistance",
"circumscription",
"coacervation",
"coacervation",
"coapplication",
"coarticulation",
"co-development",
"coelectroporation",
"coencapsidation",
"coextraction",
"cohybridization",
"coingestion",
"coinoculation",
"collinearity",
"comanagement",
"comitogenicity",
"conformality",
"confusability",
"consumability",
"cooxidation",
"coperfusion",
"coplanarity",
"coproduction",
"coresistance",
"corticosensitivity",
"cosecretion",
"cosponsorship",
"cosynthesis",
"cotransferal",
"counteractivity",
"counterproductivity",
"countertransport",
"cytotonicity",
"deadaptation",
"decatenation",
"deconditioning",
"deconstruction",
"deetiolation",
"defeminization",
"defibrinogenation",
"deformability",
"degalactosylation",
"deglyceration",
"dehydrochlorination",
"denitration",
"deproteination",
"desolvation",
"destablization",
"desulfuration",
"deuteriation",
"dicentricity",
"digitation",
"digitation",
"dilaceration",
"dioeciousness",
"dioecy",
"discretionality",
"discriminability",
"disinhibition",
"dismutation",
"dissipativity",
"dissolvability",
"documentability",
"downmodulation",
"encryption",
"expectability",
"explainability",
"exploitability",
"dysfluency",
"dysimmunity",
"dysrhythmogenicity",
"echodensity",
"effortfulness",
"Englishness",
"electroinjection",
"electrondensity",
"electronlucency",
"electrosensitivity",
"electrotransference",
"elutability",
"embrittlement",
"emissivity",
"engraftability",
"enteroinvasiveness",
"enteroinvasivity",
"epoxidation",
"crossclamping",
"crossprotection",
"cryofixation",
"fiduciality",
"frangibility",
"frontoparallelness",
"gaslessness",
"globalization",
"graininess",
"haptenation",
"hatchability",
"hemiprotonation",
"hemotoxicity",
"heterochromatinization",
"hexacoordination",
"homochirality",
"homodimerization",
"homoplasmicity",
"hydrosolubility",
"hyperaggregability",
"hypercontraction",
"hypercontracture",
"hyperextensibility",
"hyperfiltration",
"hyperinduction",
"hypermutability",
"hypersusceptibility",
"hypersynchrony",
"hypersynchronism",
"hypoendemicity",
"hypoestrogenicity",
"hypoinvasiveness",
"hypophosphorylation",
"hyporesponse",
"hypovirulence",
"imperceptiveness",
"imperceptivity",
"indissolubility",
"inextensibility",
"immunochemiluminescence",
"immunocytofluorescence",
"immunoexpression",
"immunogeneicity",
"immunoselection",
"inadaptivity",
"inhalability",
"instability",
"interconnectivity",
"interconnectiveness",
"intermodality",
"interoperability",
"coagglutination",
"contentedness",
"deiodination",
"ferrugination",
"hyperlucency",
"isoimmunity",
"noncomitance",
"noncomitancy",
"overgenerosity",
"peaceableness",
"photoluminescence",
"photoprotection",
"photoreaction",
"self-fertilization",
"self-tolerance",
"short-sightedness",
"annulation",
"droopiness",
"Basqueness",
"biooxidation",
"boneheadedness",
"chestiness",
"clawlessness",
"cell-mediated immunity",
"comitance",
"daftness",
"diffidence",
"hyperfunctionality",
"hypocalcification",
"inoculativity",
"intergradation",
"maladministration",
"mucoadhesiveness",
"mucoadhesivity",
"nonexclusivity",
"nonreligiousness",
"nonvitality",
"obsessionality",
"obsessionallty",
"overinflation",
"overmaturity",
"parturiency",
"prelogicality",
"prescribability",
"proscriptiveness",
"recheck",
"redintegration",
"scalelessness",
"somnolescence",
"spongiosity",
"stretchiness",
"structuralization",
"sugariness",
"transactionality",
"unassertiveness",
"unfashionableness",
"unintelligibility",
"unintelligibleness",
"unkemptness",
"unorthodoxy",
"unreachability",
"unreality",
"unripeness",
"venesection",
"wrinkliness",
"assayability",
"barodenervation",
"baroregulation",
"bioluminescence",
"headedness",
"comitiality",
"crystallizability",
"decoloration",
"dimidiation",
"dimidiation",
"epileptoidness",
"ergodicity",
"florescence",
"preexcitation",
"Confucianism",
"alkalinization",
"cubicity",
"decapacitation",
"cytoimmunity",
"pyrrolylation",
"self-employment",
"ethoxylation",
"enterogenicity",
"heptagonality",
"inutility",
"lution",
"nonstereospecificity",
"nonaxiality",
"nonpersistence",
"non-drowsiness",
"nonconfluence",
"nonawareness",
"nonpatency",
"nondifferentiality",
"nontenderness",
"nonresonance",
"non-availability",
"noncoherence",
"nonlubrication",
"nonstoichiometricity",
"nonbiodegradability",
"sulfoconjugation",
"crossrecognition",
"hyperresponse",
"transrepression",
"re-presentation",
"microheterogeneity",
"photoirradiation",
"re-creation",
"cointegration",
"nondiscrimination",
"electrotransformation",
"backmutation",
"redetachment",
"antiketogenicity",
"microapplication",
"permselectivity",
"photoconversion",
"homotransplantation",
"photoionization",
"nonagglutinability",
"overarousal",
"malalignment",
"autostimulation",
"autoinfection",
"cofermentation",
"radialization",
"hydrogenicity",
"pseudoprecocity",
"apoptogenicity",
"gestagenicity",
"transamidation",
"uridylylation",
"underreplication",
"pseudouridylation",
"deubiquitination",
"autointegration",
"phosphospecificity",
"rhythmogenicity",
"isorhythmicity",
"uninodularity",
"hypogranularity",
"mycotoxicity",
"fibrodysplasia",
"hyperelasticity",
"nulligravidity",
"autolymphocytotoxicity",
"antagonicity",
"syndiotacticity",
"deblocking",
"undersensing",
"photosynthesis",
"warehousing",
"telemonitoring",
"resourcing",
"resinification",
"batching",
"maltracking",
"preceptoring",
"paragliding",
"morselization",
"morselization",
"maldescent",
"subluxation",
"plantarflexion",
"hyperglycosylation",
"hypersegmentation",
"sialation",
"proclination",
"decellularization",
"deglycerolization",
"preadjustment",
"de-efferentation",
"de-efferentation",
"telemanipulation",
"polyubiquitination",
"arginylation",
"sumoylation",
"ultracentrifugation",
"monoubiquitination",
"vitamin A deficiency",
"multisensoriness",
"hypernasality",
"proceptiveness",
"proceptivity",
"osteoconductivity",
"osteoconductiveness",
"hypofunctionality",
"reclosure",
"rhizogenicity",
"tessellation",
"pyridoxalation",
"superantigenicity",
"pseudorandomness",
"pseudonormality",
"reattendance",
"undersaturation",
"reincrease",
"precultivation",
"precertification",
"nitrification",
"pseudoconditioning",
"pseudoelasticity",
"pseudodeficiency",
"coaction",
"pseudoinfection",
"pseudoreversion",
"pseudoenhancement",
"agroinoculation",
"multiexponentiality",
"overactivation",
"presaturation",
"cryocoagulation",
"misregistration",
"malsegregation",
"photomodification",
"embryolethality",
"reprotonation",
"retroillumination",
"misinsertion",
"normoventilation",
"multifollicularity",
"resequestration",
"parasuicidality",
"decorrelation",
"photorelease",
"debenzylation",
"deafferentiation",
"cyclopropanation",
"monooxygenation",
"disfacilitation",
"redilation",
"microabrasion",
"autorefraction",
"lithiation",
"derecruitment",
"periadolescence",
"hydroboration",
"endoreplication",
"nitrosatability",
"cryosurvival",
"toxification",
"reobstruction",
"microirradiation",
"decruitment",
"recyclability",
"paramutation",
"nondelinquency",
"graviresponse",
"reresection",
"reossification",
"microaspiration",
"predilution",
"isoelasticity",
"enantiomerization",
"hyperhaploidy",
"inevaluability",
"liposculpture",
"coimmunization",
"antifeedancy",
"prefiltration",
"hydrosilylation",
"reproliferation",
"cyclocondensation",
"thromboexclusion",
"olefination",
"hemofiltration",
"cooccurrence",
"rereduction",
"photogeneration",
"autosexuality",
"matrifocality",
"monitorization",
"preassessment",
"hyperdiagnosis",
"autohydrolysis",
"exocytosis",
"thrombolysis",
"parabiosis",
"rediagnosis",
"arthrodesis",
"coelectrophoresis",
"leukapheresis",
"autophagocytosis",
"apheresis",
"ecdysis",
"ionophoresis",
"prediagnosis",
"microiontophoresis",
"pheresis",
"solvolysis",
"serodiagnosis",
"lipolysis",
"thermolysis",
"cytolysis",
"apoptosis",
"reelectrophoresis",
"glycolysis",
"reexcitation",
"refibrillation",
"concatemerization",
"photocatalysis",
"immunoelectrophoresis",
"phosphorolysis",
"microdialysis",
"histolysis",
"tocolysis",
"underdialysis",
"normoreactivity",
"electromotility",
"hypocontractility",
"osmosensitivity",
"adrenoreactivity",
"uroselectivity",
"bioreactivity",
"overselectivity",
"electroconductivity",
"anticorrosiveness",
"posteriorization",
"autoproteolysis",
"fibrinolysis",
"overreactivity",
"overreactiveness",
"areactivity",
"hyperreflectivity",
"radioimmunoreactivity",
"immunoinfertility",
"semisterility",
"photorearrangement",
"electrochemiluminescence",
"microvillosity",
"irrefragability",
"maturability",
"bindability",
"bioincompatibility",
"codability",
"storability",
"expansibility",
"peroxidizability",
"microlymphocytotoxicity",
"diastereoselectivity",
"chemoselectivity",
"anticooperativity",
"multireactivity",
"vasoselectivity",
"vasoreactivity",
"consanguinity",
"hypermasculinity",
"gravisensitivity",
"learnability",
"combinability",
"polishability",
"immunocytolocalization",
"bioaccessibility",
"superexcitability",
"loadability",
"biodurability",
"immunocrossreactivity",
"transfectivity",
"seroimmunity",
"neurosensitivity",
"dysmotility",
"photoaffinity",
"thermoconductivity",
"biodiversity",
"videodensity",
"immunodensity",
"immunosensitivity",
"hypomotility",
"noncommutativity",
"enantiopurity",
"thermoactivity",
"managedness",
"fittedness",
"bow-leggedness",
"exactingness",
"brokenness",
"accentedness",
"upsettingness",
"disturbingness",
"value-ladenness",
"theory-ladenness",
"fecundability",
"hyperpolarizability",
"vasopermeability",
"radiosensibility",
"infecundability",
"catchability",
"catchableness",
"correctability",
"eradicability",
"disaggregability",
"dewaterability",
"electroluminescence",
"cardiovirulence",
"brunescence",
"immunoluminescence",
"nonvirginity",
"reherniation",
"restenting",
"coconversion",
"misacylation",
"undercondensation",
"despiralization",
"hyperattenuation",
"reisomerization",
"rereplacement",
"emmetropization",
"spinalization",
"resterilization",
"mentalization",
"collagenization",
"repermeabilization",
"climatization",
"prerandomization",
"insulinization",
"stereoblindness",
"restedness",
"pawedness",
"left-pawedness",
"right-pawedness",
"discohesiveness",
"extendedness",
"fittingness",
"bioeffectiveness",
"buriedness",
"uprootedness",
"onesidedness",
"roundedness",
"protectedness",
"compactability",
"hypoaggregability",
"microanastomosis",
"neurolysis",
"emperipolesis",
"microelectrophoresis",
"reentrainment",
"nonabstinence",
"thermodependence",
"thermodependency",
"hypervirulence",
"hyperdivergence",
"hyperdivergency",
"immunoabsorbence",
"hypodivergence",
"hypodivergency",
"immunoadjuvancy",
"tangency",
"nonmalignancy",
"allopregnancy",
"attractancy",
"attractance",
"cosolvency",
"coresidency",
"descendancy",
"nonconstancy",
"nonambulancy",
"biopersistency",
"biopersistence",
"enteroadherence",
"trypanotolerance",
"overdominance",
"nurturance",
"halotolerance",
"isoluminance",
"postconfluence",
"polyresistance",
"immunotolerance",
"osmotolerance",
"vicariance",
"underdominance",
"hyperresistance",
"monoresistance",
"continuancy",
"barotolerance",
"nonpenetrance",
"heteroresistance",
"cytoadherence",
"radioluminescence",
"impersistence",
"antiadherence",
"chromatolysis",
"heterosynapsis",
"mucolysis",
"diacytosis",
"hemidecortication",
"autoresuscitation",
"subfractionation",
"hypersecretion",
"noncompleteness",
"desalivation",
"photocoagulation",
"transmodulation",
"hyperaccumulation",
"backpropagation",
"transregulation",
"rereplication",
"missegregation",
"preoxygenation",
"semiquantitation",
"interoperation",
"conidiation",
"remethylation",
"coisolation",
"entitativity",
"immunopotentiation",
"autoinflation",
"upmodulation",
"electrolocation",
"coassociation",
"underevaluation",
"resecretion",
"submersion",
"recompensation",
"prefractionation",
"cohabitation",
"retrodifferentiation",
"remedication",
"endoreduplication",
"redispersion",
"redispersal",
"outmigration",
"hemoconcentration",
"relactation",
"regranulation",
"preassociation",
"overpenetration",
"lymphoproliferation",
"crossvalidation",
"counterrotation",
"retrotranslocation",
"recannulation",
"dwarfness",
"reulceration",
"varifocality",
"corticoresistance",
"cholinoreactivity",
"antiulcerogenicity",
"non-neurotoxicity",
"embryospecificity",
"fatigability",
"fatiguableness",
"multilinkage",
"equieffectiveness",
"preadsorption",
"preconfluence",
"cotransduction",
"preoedipality",
"antihepatotoxicity",
"nonmethylation",
"semiselectivity",
"nonsupportiveness",
"nonimmunoreactivity",
"nonsimultaneity",
"immunoresistance",
"re-collection",
"rerevision",
"co-use",
"pre-epidemic",
"quasireversibility",
"quasistability",
"quasirandomness",
"pseudoperiodicity",
"quasiequivalence",
"proarrhythmogenicity",
"antiarrhythmogenicity",
"pseudohomozygosity",
"biovularity",
"alinearity",
"paucicellularity",
"noncollinearity",
"isoosmolarity",
"hyperlinearity",
"nonsimilarity",
"isopolarity",
"pluridisciplinarity",
"moliness",
"nappiness",
"multicollinearity",
"deductibility",
"equifinality",
"persuasibility",
"intersterility",
"influenceability",
"isoantigenicity",
"weldability",
"revivability",
"nameability",
"triclonality",
"hyperemotionality",
"nonnormality",
"hyperfrontality",
"hypoemotionality",
"multifractality",
"prochirality",
"animality",
"plurifocality",
"susceptivity",
"susceptiveness",
"colorability",
"fungibility",
"depressibility",
"evocability",
"electrocontractility",
"severability",
"renormalizability",
"mailability",
"inexpressibility",
"untouchability",
"premunity",
"premunition",
"vasocontractility",
"hepatoselectivity",
"nonimpulsivity",
"cryosensitivity",
"disconnectivity",
"sorptivity",
"sorptiveness",
"nonadaptivity",
"nonadaptiveness",
"unsensitivity",
"injectivity",
"rejectivity",
"denotativeness",
"photopositivity",
"semiconductivity",
"remissiveness",
"photonegativity",
"unexpensiveness",
"calculativeness",
"exploitiveness",
"genitivity",
"perfectiveness",
"disponibility",
"delusiveness",
"tensibility",
"reflexibility",
"putrescibility",
"corrodibility",
"irreductibility",
"subdivisibility",
"nonmiscibility",
"introducibility",
"previsibility",
"constructibility",
"ductibility",
"transfusibility",
"indefectibility",
"explosibility",
"insuppressibility",
"receptibility",
"partibility",
"submergibility",
"noncoincidence",
"immunosenescence",
"photochemiluminescence",
"immunopotency",
"bioinequivalence",
"orienteering",
"nullizygosity",
"mesoporosity",
"irreligiosity",
"irreligiousness",
"anfractuosity",
"macroporosity",
"hyperviscosity",
"heteroporosity",
"elastoviscosity",
"zygosity",
"autozygosity",
"microviscosity",
"nanoporosity",
"normoviscosity",
"age-specificity",
"biotoxicity",
"nondeductibility",
"bioerodibility",
"cotransducibility",
"supersusceptibility",
"thermoinducibility",
"trypanosusceptibility",
"nonvisibility",
"nontransmissibility",
"nonreproducibility",
"thermoreversibility",
"derepressibility",
"non-distensibility",
"uninsurability",
"clunkiness",
"polyglycylation",
"exsheathment",
"outplacement",
"micromanagement",
"underinvestment",
"overachievement",
"misadjustment",
"muddledness",
"muddlement",
"enhancement",
"secernment",
"entrancement",
"disimprovement",
"englobement",
"overassessment",
"adenylylation",
"realimentation",
"deciliation",
"phytoremediation",
"preconstriction",
"electrorotation",
"spheronization",
"deendothelialization",
"contrasuppression",
"back-diffusion",
"deocclusion",
"neuroadaptation",
"seroreaction",
"dealumination",
"codispersion",
"codispersal",
"hemitransection",
"microconcentration",
"unreflectiveness",
"nocivity",
"introvertiveness",
"nonobjectivity",
"dissuasiveness",
"discoursiveness",
"protractiveness",
"overadditivity",
"myoactivity",
"erectivity",
"normosensitivity",
"chemoreactivity",
"transactivity",
"detectivity",
"detectiveness",
"monosensitivity",
"isoeffectiveness",
"isoeffectivity",
"predilectiveness",
"overinclusiveness",
"nondefensiveness",
"antiinvasiveness",
"nonintrusiveness",
"initiativeness",
"hypersuppressiveness",
"chemoattractiveness",
"chemoattractivity",
"nonrecursiveness",
"affiliativeness",
"unsupportiveness",
"semipermissiveness",
"semipermissivity",
"nondisruptiveness",
"pseudopositivity",
"nonreceptivity",
"hyperreflexivity",
"anxioselectivity",
"immunoselectivity",
"disassortativeness",
"psychoreactivity",
"osmoreceptivity",
"osmoreception",
"anticompetitiveness",
"bioselectivity",
"monoreactivity",
"underadditivity",
"superadditivity",
"indistinctiveness",
"seclusiveness",
"undecisiveness",
"uncreativeness",
"progenitiveness",
"prefigurativeness",
"inconsecutiveness",
"executiveness",
"subselectivity",
"supraadditivity",
"hemadsorption",
"multitasking",
"nonblindness",
"handsearch",
"speechreading",
"retrofilling",
"malabsorption",
"misreporting",
"cytoprotection",
"allogrooming",
"microdrilling",
"presenescence",
"nonrespondence",
"unequivalence",
"unequivalentness",
"warfarinization",
"undermasculinization",
"electropermeabilization",
"photorepair",
"autorefractoriness",
"creatureliness",
"sagginess",
"over-tidiness",
"orneriness",
"bloodthirstiness",
"hemoglobinization",
"ischemization",
"methanolysis",
"radiolysis",
"multivesiculation",
"multivesiculation",
"pyruvylation",
"fat-solubility",
"star-shapedness",
"four-dimensionality",
"reefing",
"all-inclusiveness",
"self-assembly",
"self-selection",
"self-organization",
"self-incompatibility",
"self-consistency",
"self-generation",
"self-recognition",
"self-sustainment",
"self-sustainment",
"self-replication",
"self-perpetuation",
"self-protection",
"self-protectiveness",
"self-recording",
"self-transcendence",
"self-righteousness",
"self-compatibility",
"self-determination",
"self-imposition",
"self-reflection",
"self-insurance",
"self-identification",
"self-feeding",
"uncontractibility",
"photoreducibility",
"serosusceptibility",
"reinducibility",
"dissectibility",
"nonaccessibility",
"unsuppressibility",
"bioreducibility",
"superinducibility",
"immunoaccessibility",
"semisusceptibility",
"noncollapsibility",
"nonpermanence",
"insentience",
"marcescence",
"concrescence",
"supervenience",
"decrescence",
"occurrence",
"lutescence",
"accumbence",
"irrevelance",
"subsistence",
"subsistency",
"semitranslucence",
"semitranslucency",
"conscience",
"plurivalence",
"nonerodibility",
"noneligibility",
"spumescence",
"infestivity",
"infestiveness",
"hyperreality",
"hyperrealism",
"recuperability",
"protensity",
"irreality",
"incommunicability",
"developability",
"approvability",
"revisability",
"revocability",
"protractility",
"playability",
"picturability",
"intertextuality",
"dorsiventrality",
"bitonality",
"anelasticity",
"readaptability",
"pumpability",
"justiciability",
"intercommunicability",
"insolvability",
"imputrescibility",
"hardenability",
"age-hardenability",
"electability",
"appetibility",
"affectability",
"coequality",
"alienability",
"unpossibility",
"soothability",
"clearability",
"heteroscedasticity",
"polysensitivity",
"leukocytotoxicity",
"subacidity",
"multisensitivity",
"endemoepidemicity",
"hyperalkalinity",
"intensitivity",
"nonstereoselectivity",
"neuroadaptivity",
"nephroprotectivity",
"hyperselectivity",
"preservativity",
"palmitylation",
"antiracism",
"malformation",
"thymotoxicity",
"venenosity",
"isotransplantation",
"excochleation",
"autovaccination",
"latentiation",
"microincineration",
"autodestruction",
"fabulation",
"hornification",
"isosensitization",
"skeletization",
"lixiviation",
"transfaunation",
"detubation",
"photovaporization",
"prosection",
"larviposition",
"microfibrillarity",
"nitridation",
"nitriding",
"demucosation",
"monocontamination",
"enflagellation",
"axiation",
"autocomplementarity",
"despecification",
"perflation",
"anxio-depression",
"acetoacetylation",
"isoagglutination",
"peptization",
"diverticularization",
"enzymolysis",
"nictation",
"seroresponse",
"osteocompatibility",
"nonhistocompatibility",
"heterocyclization",
"fissioning",
"coprescription",
"arrosion",
"texturing",
"missplicing",
"microinsemination",
"resaturation",
"photooxygenation",
"transplacement",
"preauthorization",
"hypohaploidy",
"detailedness",
"unworldliness",
"sisterliness",
"leukoreduction",
"unreservedness",
"paralogy",
"iatrogeny",
"neoteny",
"bacterivory",
"schizogony",
"anisochrony",
"barbarousness",
"necessitousness",
"agamospermy",
"electrocatalysis",
"stereoanomaly",
"tautology",
"comicality",
"unpracticality",
"single-mindedness",
"photocytotoxicity",
"infecundity",
"reinfestation",
"intrinsicality",
"precession",
"precautiousness",
"myrmecochory",
"determination",
"determinacy",
"deturgescence",
"depletability",
"desamination",
"deration",
"demarketing",
"anticorrelation",
"correlatedness",
"endonucleolysis",
"depredation",
"delisting",
"denaturalization",
"decimalization",
"succinylation",
"fucosylation",
"polysensitization",
"bioconcentration",
"normotension",
"photophosphorylation",
"carboxymethylation",
"rediffusion",
"retroperfusion",
"microstimulation",
"monodeiodination",
"electrosynthesis",
"disobliteration",
"disaffiliation",
"underglycosylation",
"reambulation",
"nonvitreousness",
"preaggregation",
"polyinnervation",
"overtransfusion",
"overdispersion",
"overdispersal",
"overdilation",
"dishomogeneousness",
"objectlessness",
"winterhardiness",
"evenhandedness",
"unkindness",
"relaxedness",
"hotheadedness",
"restrictedness",
"deservedness",
"discontentedness",
"law-abidingness",
"sonoluminescence",
"appetence",
"appetency",
"incoincidence",
"wingedness",
"sissiness",
"fumblingness",
"forbiddenness",
"thermoremanence",
"embryonation",
"larviciding",
"electroformation",
"demythologization",
"faceting",
"infilling",
"imbrication",
"backlighting",
"infantilization",
"juvenilization",
"ginning",
"gendering",
"jousting",
"endomorphy",
"mesomorphy",
"microhomology",
"gluttony",
"gluttonousness",
"incurvation",
"fettling",
"encagement",
"inhabitation",
"hanggliding",
"egression",
"defunding",
"basting",
"overfulfillment",
"decryption",
"decryptment",
"alkylization",
"advection",
"adaptation",
"ghostwriting",
"allylation",
"languaging",
"lading",
"fairing",
"encipherment",
"denaturization",
"befuddlement",
"haying",
"reticulation",
"cathection",
"adequation",
"abrasion",
"laxation",
"inspiration",
"innervation",
"imposturing",
"enframement",
"enculturation",
"nidation",
"caramelization",
"detubulation",
"canonization",
"deflagellation",
"transstimulation",
"supercompensation",
"alkoxylation",
"afterripening",
"absolutization",
"abruption",
"abreaction",
"vegetalization",
"animalization",
"undemandingness",
"latticing",
"transistorization",
"colchicinization",
"devocalization",
"polyploidization",
"chemosterilization",
"proletarianization",
"recontextualization",
"pluralization",
"semanticization",
"intermediation",
"registration",
"jellification",
"metalation",
"exulceration",
"eructation",
"instrumentalization",
"insolation",
"ingathering",
"indigenization",
"incommodation",
"unfailingness",
"iodation",
"exudation",
"selfsameness",
"yieldingness",
"evocation",
"hypermineralization",
"dearterialization",
"revictimization",
"sectorization",
"photolysability",
"dividedness",
"hierarchization",
"goffering",
"ghettoization",
"unsettledness",
"gemmation",
"realkalinization",
"recurarization",
"neutralizability",
"fetishization",
"factionalization",
"embankment",
"elicitation",
"overfishing",
"delethalization",
"deculturation",
"decaffeination",
"opaquing",
"tenderization",
"reharvest",
"carjacking",
"carburization",
"backstabbing",
"adventurement",
"acculturization",
"abstriction",
"abduction",
"hemagglutinability",
"unitization",
"spatialization",
"vitaminization",
"radicalization",
"unerringness",
"palletization",
"premunization",
"diagonalization",
"segmentalization",
"suburbanization",
"podzolization",
"partialization",
"abnormalization",
"winterization",
"Islamization",
"diphthongization",
"chromization",
"volatization",
"technologization",
"metaphorization",
"laryngealization",
"Japanization",
"institutionization",
"Hinduization",
"dolomitization",
"diagrammatization",
"desocialization",
"commoditization",
"axiomatization",
"anthropomorphization",
"vowelization",
"uniformization",
"unassumingness",
"syntonization",
"syncretism",
"substantialization",
"rhythmization",
"rhotacization",
"uncomplainingness",
"parasailing",
"revolatilization",
"phonologization",
"occidentalization",
"novelization",
"mortalization",
"martyrization",
"majorization",
"literalization",
"Italianization",
"fractionalization",
"evaporization",
"Europeanization",
"chemicalization",
"allegorization",
"overflying",
"re-enforcement",
"thematization",
"positivization",
"photocyclization",
"hypervascularization",
"negativization",
"refertilization",
"conjunctivalization",
"coendocytosis",
"nutrification",
"volcanization",
"unpretendingness",
"fractionization",
"serpentinization",
"unbefittingness",
"thirtysomething",
"Mendelization",
"redecoration",
"levigation",
"spheroidization",
"cognizance",
"ruggedization",
"vaporing",
"unresistingness",
"intercompatibility",
"photoproduction",
"production",
"preproduction",
"photoengraving",
"reconveyance",
"interassociation",
"photoetching",
"orientalization",
"orientalizing",
"fasciation",
"constation",
"numeration",
"guesstimation",
"downheartedness",
"underhandedness",
"hardheadedness",
"kindheartedness",
"freewheelingness",
"enduringness",
"strikingness",
"soothingness",
"astonishingness",
"grudgingness",
"engagedness",
"quick-temperedness",
"stuntedness",
"spiritedness",
"low-spiritedness",
"strainedness",
"settledness",
"undegradability",
"secretability",
"entrainability",
"reabsorbability",
"swellability",
"automatability",
"deployability",
"immunizability",
"distillability",
"retainability",
"occultation",
"obstipation",
"obduration",
"nuancing",
"neologizing",
"electroexcitability",
"noncurability",
"nicotinization",
"totalization",
"eserinization",
"containerization",
"graftability",
"renaturability",
"reflectedness",
"methylatability",
"nonintegrability",
"verbalizability",
"monostability",
"bacterization",
"palatalization",
"palladization",
"palladinization",
"devitaminization",
"nonidentifiability",
"compartmentization",
"acetalization",
"hawkishness",
"phosphatization",
"officialization",
"resourcelessness",
"affectlessness",
"porcelainization",
"effeminization",
"jarovization",
"silverization",
"unhealthfulness",
"dreamfulness",
"reflectorization",
"proletarization",
"politicalization",
"hellenization",
"glottalization",
"germanization",
"dematerialization",
"enhanceability",
"nonprobability",
"class consciousness",
"test-wiseness",
"oftenness",
"cyclicization",
"forsakenness",
"traditionalization",
"retraditionalization",
"syphilization",
"sulfatization",
"picturization",
"phoneticization",
"parochialization",
"mythicization",
"mythicizing",
"mercurization",
"hypostatization",
"formulization",
"emotionalization",
"desacralization",
"dehepatization",
"aldolization",
"oppositeness",
"consubstantiality",
"sociocentricity",
"deindustrialization",
"descriptivism",
"lovableness",
"lovability",
"standardizability",
"irrecuperability",
"unenforceability",
"uncultivability",
"propagability",
"unviability",
"microwavability",
"superplasticity",
"indetectability",
"harvestability",
"nonanalyticity",
"extinguishability",
"glycerinization",
"expertization",
"mythologization",
"focusability",
"hydrodistension",
"devolatilization",
"diploidization",
"banalization",
"deaminization",
"methanization",
"pharyngealization",
"pronominalization",
"suberization",
"nonassessability",
"thinkability",
"surreality",
"cognizability",
"autoionization",
"shiftability",
"uncoagulability",
"polytonality",
"biologization",
"reharmonization",
"recapitalization",
"metropolitanization",
"excludability",
"pyritization",
"openability",
"bleachability",
"concealability",
"drivability",
"suspectability",
"nonmeasurability",
"iodinatability",
"serotypability",
"photoreactivability",
"unclonability",
"nonsalvageability",
"dosability",
"appliability",
"unmarketability",
"evangelization",
"biosorption",
"abacillarity",
"overemployment",
"encashment",
"coadjustment",
"defragmentation",
"implacement",
"immergence",
"immitigability",
"uniformitarianism",
"holometabolism",
"maturescence",
"unlevelness",
"effectlessness",
"rewardlessness",
"racelessness",
"carlessness",
"complaintlessness",
"boundarylessness",
"rolelessness",
"subseptation",
"heteromerization",
"hypoactivation",
"ununiformity",
"microanalysis",
"recusal",
"excursion",
"desorbability",
"reconfigurability",
"unlikeability",
"surveyability",
"guidability",
"photodegradability",
"revealability",
"inabsorbability",
"sonorancy",
"sonorance",
"irretraceability",
"salvability",
"vitrifiability",
"forgettability",
"forgivability",
"findability",
"governableness",
"governability",
"deniability",
"readjustability",
"copyrightability",
"duplicatability",
"merchantability",
"nestability",
"limitableness",
"gorgeousness",
"disputatiousness",
"sanctimoniousness",
"fugacity",
"fugaciousness",
"euphoniousness",
"ceremoniousness",
"fructuousness",
"bijectivity",
"nonbijectivity",
"underproductivity",
"trajection",
"subjectification",
"retrojection",
"silicification",
"silicification",
"prenotification",
"verbification",
"russification",
"lithification",
"denazification",
"denazification",
"reverification",
"interstratification",
"scissiparity",
"adjection",
"ecotoxicity",
"antibody specificity",
"lymphotoxicity",
"digitoxicity",
"microseismicity",
"digoxin toxicity",
"incohesiveness",
"undemonstrativeness",
"presuppression",
"repossession",
"deaccession",
"propertylessness",
"defectlessness",
"sonlessness",
"genetic susceptibility",
"genetic predisposition",
"genetic induction",
"genetic dominance",
"genetic diversity",
"dyeability",
"resemblance",
"chivalrousness",
"weaponization",
"conveyorization",
"aestheticization",
"securitization",
"incompliance",
"guanylylation",
"epigyny",
"proterandrousness",
"homosociality",
"homodynamy",
"mammillation",
"mamillation",
"actinomorphy",
"holomorphy",
"lymphangio-invasion",
"irrotationality",
"intersectionality",
"actionality",
"tonification",
"mucification",
"disidentification",
"sclerification",
"decertification",
"carnification",
"dezincification",
"underspecification",
"statistical significance",
"premodification",
"nitrosification",
"modificability",
"restratification",
"amplification",
"sparsification",
"ferrimagnetism",
"regnancy",
"predesignation",
"heavy-handedness",
"high-handedness",
"neat-handedness",
"left-hand drive",
"left-hand driving",
"light-handedness",
"one-handedness",
"pervaporation",
"incurvature",
"unneighborliness",
"pseudorandomization",
"unorderliness",
"summerliness",
"periodization",
"chemisorption",
"misestimation",
"misevaluation",
"comminution",
"comminution",
"electrocapillarity",
"psychotoxicity",
"predicability",
"stepmotherliness",
"chemical dependence",
"chemical dependency",
"affination",
"appendance",
"southernliness",
"rippliness",
"penecontemporaneity",
"distendedness",
"hydrogenolysis",
"hydrogenolysis",
"acetolysis",
"vasoparalysis",
"arm wrestling",
"self-fertility",
"self-sterility",
"electrodeposition",
"calcination",
"decaudation",
"acerbation",
"self-pollination",
"gentlemanliness",
"self-induction",
"self-assertiveness",
"geometrization",
"monosymmetry",
"sulphureousness",
"spiroergometry",
"sulfitation",
"monomethylation",
"self-esterification",
"roadworthiness",
"possessedness",
"lightfastness",
"papillation",
"phenylation",
"abidingness",
"favoredness",
"decollation",
"adhibition",
"umbrageousness",
"intubation",
"hyperdimensionality",
"suffixation",
"petechiation",
"disintoxication",
"uninventiveness",
"bioprecipitation",
"pseudosexuality",
"pseudophosphorylation",
"exfusion",
"neoexpression",
"overperfusion",
"underperfusion",
"xenoperfusion",
"autorepression",
"upconversion",
"bioinversion",
"reinclusion",
"electroconversion",
"oversuppression",
"deadhesion",
"preimmersion",
"overfullness",
"nonmodularity",
"antipolarity",
"pseudonodularity",
"pseudolobularity",
"dysvascularity",
"mesioangularity",
"isovascularity",
"periplanarity",
"antiperiplanarity",
"nonequimolarity",
"disequilibration",
"milliosmolarity",
"prerequirement",
"epipolarity",
"nonregularity",
"unbundling",
"unsatisfiability",
"uncatchability",
"unconsolability",
"implementability",
"customizability",
"universalizability",
"semistability",
"shockability",
"contactability",
"nonrecoverability",
"correlatability",
"glucuronylation",
"orientability",
"explorability",
"parallelizability",
"resealability",
"archivability",
"relaxability",
"ultrastability",
"consolability",
"connectability",
"noninterchangeability",
"noncontrollability",
"preformulation",
"foamability",
"climbability",
"rewritability",
"extirpability",
"interviewability",
"fracturability",
"embarrassability",
"invadability",
"nonnegotiability",
"extrudability",
"cleansability",
"functionability",
"tailorability",
"suspensibility",
"labelability",
"handleability",
"establishability",
"reestablishability",
"attackability",
"twistability",
"permutability",
"peelability",
"conservability",
"ejectability",
"vaporizability",
"tannability",
"succussion",
"perturbability",
"maskability",
"distortability",
"cookability",
"abstractability",
"cross-linkability",
"triability",
"duplicability",
"condemnability",
"spendability",
"sinterability",
"attractability",
"strainability",
"rescalability",
"pleasability",
"electrifiability",
"multiplicability",
"rollability",
"seeability",
"mountability",
"polyisoprenylation",
"inspectability",
"impalatability",
"guessability",
"forecastability",
"flocculability",
"deterrability",
"discardability",
"undangerousness",
"eliteness",
"crippleness",
"well-adjustedness",
"disjointness",
"tandemness",
"injuredness",
"fillingness",
"overlaxness",
"cliquishness",
"advisedness",
"acquirability",
"overmodulation",
"overwear",
"non-pre-exposure",
"provokingness",
"orderedness",
"nonconformability",
"autochthony",
"anisogamy",
"cloyingness",
"patternization",
"postsynchronization",
"hyperparasitization",
"hyperparasitism",
"bioconjugation",
"immunodecoration",
"immunolocation",
"deindividuation",
"crossregulation",
"cryoablation",
"backcalculation",
"underexcretion",
"undertransfusion",
"underenumeration",
"teleoperation",
"seroagglutination",
"reinsemination",
"reaspiration",
"preequilibration",
"photoepilation",
"photoaccumulation",
"evapotranspiration",
"mistranscription",
"disfranchisement",
"cyanoethylation",
"perchlorination",
"reamination",
"hydroformylation",
"domiciliation",
"deflocculation",
"endosporulation",
"balkanization",
"zeolitization",
"exponentiation",
"oximation",
"noncomedogenicity",
"depurination",
"hydroxymethylation",
"carbethoxylation",
"reacetylation",
"glycerination",
"ingurgitation",
"solarization",
"nonexcision",
"camelization",
"preopsonization",
"hydrophobization",
"muddleheadedness",
"reanesthetization",
"ledging",
"multipositionality",
"intercomparability",
"licensability",
"conjugability",
"depyrimidination",
"decyclization",
"strobilation",
"insaturation",
"marketization",
"codetermination",
"misappreciation",
"wiliness",
"sightliness",
"good-heartedness",
"unkindliness",
"evil-mindedness",
"like-mindedness",
"serious-mindedness",
"small-mindedness",
"strong-mindedness",
"tough-mindedness",
"weak-mindedness",
"brachistocephaly",
"brachistocephaly",
"dolichocephalism",
"dolichocephaly",
"isocephaly",
"isocephaly",
"lissencephaly",
"megalocephaly",
"pyrgocephaly",
"subdolichocephalism",
"subdolichocephaly",
"subdolichocephalism",
"subdolichocephaly",
"trigonocephaly",
"wizardliness",
"ungodliness",
"uproariousness",
"hetero-oligomerization",
"co-overexpression",
"homo-oligomerization",
"sharp-sightedness",
"pre-analysis",
"kingliness",
"intensionality",
"gastroresistance",
"gastroretentivity",
"thermoinduction",
"thermocoagulation",
"thermoinactivation",
"silanization",
"avascularization",
"devisceration",
"vermination",
"self-application",
"autospecificity",
"roundheadedness",
"actinautography",
"garishness",
"mitoinhibition",
"sham-immunization",
"monosensitization",
"haptenization",
"deepidermization",
"epidermization",
"electropolymerization",
"dephytinization",
"delipidization",
"tubulization",
"reparameterization",
"recircularization",
"protonization",
"desympathization",
"precompression",
"neurotization",
"deendothelization",
"desialization",
"anastomization",
"telementoring",
"operatability",
"allocatability",
"censoriousness",
"symplecticity",
"diatropicity",
"guanidination",
"pyridylamination",
"sigmoid",
"hydridization",
"multimorbidity",
"reproductibility",
"pushability",
"invasibility",
"phytoavailability",
"hypomutability",
"denaturability",
"multihormonality",
"intersectorality",
"cryostability",
"migrability",
"hyperosmolality",
"quasi-irreversibility",
"quasi-independence",
"quasisymmetry",
"quasi-integration",
"quasi-integrability",
"poling",
"megalencephaly",
"sensitizability",
"reactability",
"immunocompatibility",
"synchronizability",
"syringeability",
"subclonality",
"osmoprotection",
"osmoadaptation",
"osmodependence",
"osmoinducibility",
"isofunctionality",
"nonseparability",
"autoagglutinability",
"photodissociability",
"hemodialyzability",
"burnishability",
"weanability",
"coresponsibility",
"pluckability",
"hypovariability",
"nonapplicability",
"nonrejectability",
"chimerization",
"relysogenization",
"fragmentability",
"suturability",
"nonorthogonality",
"superinfectability",
"superluminality",
"virtuelessness",
"polytenization",
"modularization",
"lichenization",
"remodification",
"degasification",
"destratification",
"coalification",
"genderlessness",
"prehension",
"patrifocality",
"bioassessment",
"plastification",
"proportionment",
"rufescence",
"rubescence",
"self-responsibility",
"chondrotoxicity",
"profluence",
"self-regulation",
"biopan",
"coaddition",
"self-measurement",
"biofiltration",
"redisplacement",
"transglucosylation",
"carboxylmethylation",
"missetting",
"reptation",
"immunoextraction",
"upwelling",
"nanoindentation",
"microsampling",
"anomerization",
"cotoxicity",
"hemiresection",
"cyclocryocoagulation",
"immunoseparation",
"hyperexcretion",
"macrocyclization",
"thyroiditogenicity",
"trypanoresistance",
"nonadmission",
"reconsultation",
"technicalization",
"mathematization",
"interlamination",
"bioenrichment",
"laterization",
"salination",
"brecciation",
"weatherization",
"sufflation",
"colonialization",
"municipalization",
"normodensity",
"normohydration",
"normoresponsiveness",
"normotolerance",
"normofrequency",
"phosphorization",
"microejection",
"transconformation",
"decompaction",
"inerrancy",
"turgency",
"enantioresolution",
"zygomorphy",
"cycloisomerization",
"aminoethylation",
"somatosensoriality",
"somatostatin-immunoreactivity",
"thionation",
"prechlorination",
"angularization",
"spirantization",
"appealability",
"detribalization",
"nippiness",
"desepidermization",
"detersion",
"creolization",
"scientization",
"cerebroselectivity",
"cranialization",
"desensibilization",
"desensitization",
"corticalization",
"conferrability",
"verticalization",
"invalidization",
"misconstruction",
"miscomprehension",
"transmittancy",
"corotation",
"desialyzation",
"subjectivization",
"histodiagnosis",
"micropinocytosis",
"tunnelization",
"prehospitalization",
"photopolymerizability",
"demyelinisation",
"undermineralization",
"rerandomization",
"clusterization",
"mechanoresponsiveness",
"monophthongization",
"Nazification",
"tanglement",
"Arabization",
"virilocality",
"photomagnetism",
"tube-feeding",
"sugar-coating",
"indecomposability",
"summability",
"apodicticity",
"expellability",
"signability",
"leakproofness",
"unhomelikeness",
"causability",
"walkability",
"tearability",
"vesiculosity",
"quadrifurcation",
"placeability",
"oculomotoricity",
"oculotoxicity",
"tauroconjugation",
"glyco-oxidation",
"cross-sensitization",
"sulphoreduction",
"sulfonylation",
"leukodepletion",
"organosolubility",
"organomodification",
"godlikeness",
"fakability",
"judgability",
"allotransplantability",
"hypoextensibility",
"ovulability",
"hyperreagibility",
"thermosensibility",
"reavailability",
"thromboresistivity",
"thrombotization",
"prosociability",
"milkability",
"non-reactivability",
"reactivability",
"photosensibility",
"peroxidability",
"acidostability",
"subexcitability",
"thermoprecipitability",
"torquability",
"myeloprotection",
"thermoinstability",
"nonacceptability",
"self-termination",
"non-significativity",
"superstability",
"chemosensibility",
"avitality",
"subculturability",
"self-representation",
"haplolethality",
"identitylessness",
"translucidity",
"tinniness",
"semi-dwarfness",
"tractility",
"heterocercality",
"protrusility",
"back-transformation",
"interpretation",
"permutation",
"excarnation",
"riskfulness",
"worthfulness",
"echinulation",
"colorfastness",
"yuckiness",
"treatment priority index",
"colligation",
"age-fractionation",
"rugation",
"sulcation",
"X-irradiation",
"dilucidation",
"circumstantiation",
"renomination",
"regermination",
"eradiation",
"fragmentation",
"functionation",
"fermentation",
"interreaction",
"typologization",
"recontrol",
"allosensitization",
"manualization",
"prereaction",
"nonnegligence",
"slip-resistance",
"disaffirmance",
"self-enhancement",
"recontraction",
"introduction",
"supercontraction",
"telecontrol",
"intervariability",
"nonresponsibility",
"self-fluorescence",
"TRAIL-resistance",
"sloganeering",
"clamber",
"enregistration",
"pseudoreplication",
"back-transplantation",
"pseudomaturation",
"pseudopolymorphism",
"pseudotolerance",
"unseriousness",
"neoromanticism",
"chronomodulation",
"temperature resistance",
"prepositioning",
"self-description",
"runnability",
"cross-polarization",
"nucleotoxicity",
"backprojection",
"coinduction",
"unsolubility",
"scurredness",
"uxorilocality",
"combustion",
"canceration",
"miscorrection",
"maternalization",
"overattachment",
"scotomization",
"lavation",
"curvefitting",
"repletion",
"remanufacture",
"reradiation",
"reselection",
"refractionation",
"cross-pollination",
"recommunication",
"reconvergence",
"anticlastogenicity",
"retrospection",
"allostimulation",
"immunodetection",
"underimmunization",
"antigenotoxicity",
"underascertainment",
"self-similarity",
"autocleavage",
"deesterification",
"bioabsorption",
"reapproachment",
"dephlogistication",
"codelivery",
"dentalization",
"clinorotation",
"adjectivization",
"desugarization",
"hyperbolization",
"Christianization",
"cosmopolitanization",
"reamendment",
"bipolarization",
"horizontalization",
"vernacularization",
"informalization",
"laicization",
"mediatization",
"phonemicization",
"heroization",
"Indianization",
"artificialization",
"ruralization",
"roentgenization",
"electroreduction",
"sulfidization",
"mutualization",
"Moslemization",
"histamine-immunoreactivity",
"reconduction",
"territorialization",
"hypercoagulability",
"hypercoaguability",
"hyperinfection",
"immunoactivation",
"immunoprotection",
"prefiguration",
"formularization",
"insularization",
"propolization",
"convolution",
"commutation",
"chloridization",
"consubstantiation",
"coappearance",
"microcalcification",
"microdeletion",
"cyanization",
"coarctation",
"inventorization",
"oxidoreduction",
"derestriction",
"dechristianization",
"polycondensation",
"communalization",
"chaptalization",
"vacuumization",
"incapsulation",
"ideologization",
"impartibility",
"preligation",
"incarnation",
"prephosphorylation",
"readvancement",
"complexification",
"convection",
"interpendence",
"disenablement",
"circumfusion",
"intergrowth",
"lenticulation",
"irradication",
"combination",
"perhydrogenation",
"quintuplication",
"hydrochlorination",
"convocation",
"rubrication",
"subrogation",
"interfoliation",
"reevocation",
"recorrection",
"superelevation",
"propylation",
"obliviation",
"detortion",
"self-differentiation",
"self-digestion",
"self-infection",
"degermination",
"angulation",
"aralkylation",
"subirrigation",
"desideration",
"styrenation",
"stablishment",
"denitrogenization",
"desterilization",
"Romanization",
"deglamorization",
"pegylation",
"self-correction",
"self-correctiveness",
"prepublication",
"subdelegation",
"antiquation",
"silication",
"precognition",
"kaolinization",
"underconfidence",
"prevision",
"preinformation",
"re-evolution",
"pedestrianization",
"solidarization",
"velarization",
"pre-enrollment",
"self-discrepancy",
"proportionation",
"phosphoration",
"self-formation",
"interfusion",
"intermigration",
"bituminization",
"self-instruction",
"circumvention",
"self-preoccupation",
"hydrotreatment",
"hydroextraction",
"fair-mindedness",
"cross-sterility",
"simplemindedness",
"left-footedness",
"hand-pollination",
"worn-outness",
"re-enlargement",
"self-adaptivity",
"syncarpy",
"plenteousness",
"self-registration",
"intercomparison",
"self-adaptation",
"self-donation",
"self-objectification",
"self-election",
"sideswipe",
"electroviscosity",
"self-evolution",
"full-bloodedness",
"night blindness",
"discongruity",
"deorbit",
"detruncation",
"heavy-tailedness",
"zincification",
"favorization",
"disunification",
"deflavination",
"pre-entry",
"self-expressiveness",
"self-treatment",
"self-creation",
"self-transformation",
"top-heaviness",
"right-footedness",
"self-disclosure",
"quasineutrality",
"pre-expansion",
"pre-examination",
"devalorization",
"self-expansion",
"re-extension",
"self-amputation",
"self-explanation",
"re-evacuation",
"acumination",
"divarication",
"epuration",
"precoagulation",
"denasalization",
"somnambulation",
"despiritualization",
"repolonization",
"overorganization",
"reemergence",
"physiognomization",
"delegalization",
"grammaticization",
"civilianization",
"elaidinization",
"spermatization",
"propionylation",
"Russianization",
"nativization",
"provincialization",
"warm",
"self-propulsion",
"prelocalization",
"coadaptation",
"self-intersection",
"left-eyedness",
"vasculation",
"co-occupation",
"co-occupancy",
"surface-coating",
"self-declaration",
"pre-experience",
"cross-immunization",
"self-dissociation",
"right-eyedness",
"many-sidedness",
"cross-agglutination",
"re-empowerment",
"self-excitation",
"self-integration",
"self-suppression",
"self-ionization",
"self-movement",
"self-comparison",
"asynchronicity",
"paternalization",
"sedimentation",
"self-performance",
"radioactivation",
"self-payment",
"self-harm",
"quasi-universality",
"self-alignment",
"self-reduction",
"self-acquisition",
"self-definition",
"zygodactylism",
"lumination",
"self-heating",
"underconsumption",
"exsufflation",
"oxicity",
"roentgenopacity",
"psychrotolerance",
"electroexcision",
"sleep walking",
"introflexion",
"mesoendemicity",
"bioaugmentation",
"semicrystallinity",
"transdetermination",
"hyperaggressiveness",
"fluoration",
"argentation",
"cryoprecipitation",
"hygienization",
"posttesting",
"nonaddiction",
"homogenation",
"electrization",
"fasciculation",
"patrilocality",
"matrilocality",
"hypoacidity",
"domesticality",
"anacidity",
"inequality",
"spheroidicity",
"nonuterotrophicity",
"nonpreventability",
"photochromicity",
"anility",
"conduplication",
"crenulation",
"infixation",
"perennation",
"petrification",
"stuckness",
"withdrawnness",
"ergogenicity",
"edematization",
"microlocalization",
"hyperemization",
"stabilizability",
"syndactylization",
"ossification",
"insudation",
"antitermination",
"gravistimulation",
"chemodenervation",
"degradation",
"preinoculation",
"preillumination",
"micropropagation",
"bronchoconstriction",
"prevaccination",
"preinitiation",
"exarticulation",
"postincubation",
"retroinfusion",
"seroreversion",
"seroconversion",
"retroconversion",
"excyclotorsion",
"reaccession",
"stereoinversion",
"undiversion",
"retroversion",
"multiphosphorylation",
"counterselection",
"non-cross-resistance",
"non-cross-reactivity",
"non-cross-validation",
"undissociability",
"nonanxiety",
"devisability",
"photoinhibition",
"propulsion",
"renaturation",
"envenomation",
"nonadiabaticity",
"biflagellarity",
"nonnephrotoxicity",
"nonsolubility",
"nonmarriage",
"multifractionation",
"prelamination",
"glycogenation",
"prefermentation",
"anation",
"nondistension",
"dioxygenation",
"noninferiority",
"nontransformability",
"nonregistration",
"nonmasking",
"nonutilization",
"unilocality",
"nonadjustment",
"nonextension",
"unweanability",
"parcellation",
"transmutation",
"spherulation",
"monoalkylation",
"blastulation",
"autoassociation",
"nonprototypicality",
"nondeformability",
"nonassociation",
"nonopacification",
"retropulsion",
"photoregeneration",
"overinitiation",
"nonmutability",
"nonabsorption",
"amnioinfusion",
"preinfusion",
"pretransfusion",
"malperfusion",
"microinfusion",
"evulsion",
"nonquiescence",
"noninterpretability",
"nonhostility",
"nontransmission",
"noninnocence",
"nondelivery",
"nonpredictability",
"nondiscordance",
"preperfusion",
"myelosuppression",
"immunodiffusion",
"myelodepression",
"interdiffusion",
"hemotransfusion",
"nonneutralizability",
"nonconversion",
"nonserviceability",
"pronatality",
"nonusage",
"nonremoval",
"cosuppression",
"hemifusion",
"electrofusion",
"noncorrespondence",
"anisochronicity",
"overspecificity",
"heterodispersion",
"heterodispersity",
"nondistraction",
"nondehydration",
"nonadequacy",
"nonsurmountability",
"nonsalinity",
"nonobtrusiveness",
"nonmovement",
"noninflation",
"pentafluorobenzylation",
"eversion",
"nonexistence",
"nondivergence",
"nonvalidity",
"nonrevertibility",
"nonrenewal",
"nonrenewal",
"nondilution",
"nondilution",
"nonstenosis",
"nontranslatability",
"noncontainment",
"nonvariability",
"noncontextuality",
"nonconfirmation",
"nonacquisition",
"nontransplantability",
"nonmaturity",
"nonvulnerability",
"nonretrieval",
"nonenrollment",
"nonsustainability",
"nonretention",
"nonpredisposition",
"nonrobustness",
"noninvasion",
"nonhyperdiploidy",
"nonarrhythmogenicity",
"nonamplification",
"nonsingularity",
"nonflocculence",
"nonconvexity",
"nonveridicality",
"nonlimitation",
"nonexpandability",
"noneruption",
"nonequidistance",
"nonconnectivity",
"nonusefulness",
"nonnestedness",
"nonintimacy",
"nonambiguity",
"nonambiguousness",
"nonshyness",
"nonrestenosis",
"nonrecognizability",
"nonperfection",
"nonorthodoxy",
"nonmodality",
"nonnullity",
"nongraviresponsiveness",
"nonequality",
"nonconfinement",
"nonabundance",
"nonexpectancy",
"nondistinguishability",
"noncrossing",
"noncommutability",
"noninclusion",
"nonfragility",
"flat-footedness",
"gradedness",
"disappointedness",
"pronouncedness",
"desaturatedness",
"matedness",
"uprisal",
"uprising",
"machination",
"rewardingness",
"drivenness",
"biasedness",
"compellingness",
"nonattractiveness",
"beardedness",
"nonadsorbability",
"nonadaptability",
"taperedness",
"nontonality",
"unbalancedness",
"limitingness",
"nonsurvivability",
"twistedness",
"nonresuscitation",
"nonrelaxation",
"nonpreparation",
"sustainedness",
"pairedness",
"nonsingleness",
"nonreplication",
"valuedness",
"differentiatedness",
"cryodestruction",
"nonheaviness",
"noncontinence",
"noninversion",
"nonimmunodeficiency",
"nonenolizability",
"nondextrality",
"nondecomposability",
"nonconvergence",
"nonreality",
"nonrealness",
"noncoagulation",
"nonapplication",
"nontransference",
"nonstainability",
"nonretrievability",
"nonrepression",
"nonreplication",
"replication",
"flavescence",
"nonrecording",
"nonpurity",
"nonpermissibility",
"nonfrailty",
"nonfiniteness",
"noncrowdedness",
"nonlucidity",
"nonhypermobility",
"nonintellectualism",
"nonintellectuality",
"nongenerality",
"nonfreedom",
"nonfreeness",
"nonfitness",
"nonenforcement",
"nonauthoritarianism",
"nonaberrance",
"nondemonstrability",
"nonsatisfactoriness",
"nonavoidance",
"nonachievement",
"nontransposability",
"nonsubtraction",
"uveitogenicity",
"aflatoxigenicity",
"periodontopathogenicity",
"topogenicity",
"nonclumsiness",
"nonbalancedness",
"nonappression",
"nonrectangularity",
"nonparadoxicality",
"nonrecirculation",
"nonobservation",
"nonnaivete",
"nonimplementation",
"nonhypersensitivity",
"nonfibrillation",
"nonfeasibility",
"nonexportability",
"nonequiluminance",
"nonculpability",
"noncaptivity",
"nonbiocompatibility",
"nonfrequency",
"rotamericity",
"karyophilicity",
"somnogenicity",
"nonaffluence",
"nonacceptance",
"nonablation",
"nonconflictuality",
"nontubulation",
"nonavoidance",
"nonstereotypicality",
"nonutilizability",
"nonresolvability",
"nonreplaceability",
"nonreliance",
"nonpublication",
"nonprominence",
"nontraversability",
"rematuration",
"reacidification",
"reachievement",
"reaccomplishment",
"reopacification",
"reimplementation",
"nonpresence",
"nonpotency",
"nonpalatability",
"nonimpotence",
"nonimpotency",
"reinstruction",
"nonmortality",
"nonmodernity",
"nonmeasurement",
"refucosylation",
"nonjustification",
"nonjealousy",
"nonextremeness",
"nonextremism",
"noninertness",
"noninertia",
"nonethnicity",
"resialylation",
"reabstraction",
"repullulation",
"nonemotiveness",
"repercolation",
"nonconjugality",
"reconjugation",
"intervention",
"nonweakness",
"nonsuperficiality",
"nonspeededness",
"nonreliability",
"nonprimeness",
"nonpredominance",
"nonpossessiveness",
"refaunation",
"reglucosylation",
"permethylation",
"thiophosphorylation",
"dethiophosphorylation",
"electrostimulation",
"inhalation",
"underinflation",
"reprioritization",
"cryoactivation",
"overconcentration",
"methicillin resistance",
"diafiltration",
"adrenodemedullation",
"refunctionalization",
"nonmeritoriousness",
"nondifferentiability",
"nondenseness",
"nondensity",
"preretirement",
"nonactivatability",
"reinhibition",
"subsampling",
"resupplementation",
"nonrepressiveness",
"nonreportability",
"nonphototoxicity",
"nonpackability",
"noniridescence",
"noninformedness",
"nonefficiency",
"nondistinction",
"nondistinctness",
"nondiscrepancy",
"noncoolness",
"noncomprehensiveness",
"detyrosination",
"tyrosination",
"deplasticization",
"photoassimilation",
"deprofessionalization",
"adaptogenicity",
"thiophilicity",
"rehybridization",
"deacclimation",
"retubularization",
"cellularization",
"lipidization",
"tribalization",
"nonamenability",
"deobstruction",
"reaugmentation",
"reacclimation",
"nonsparseness",
"nonsparsity",
"nonsolitariness",
"peridiploidy",
"multimodularity",
"deinsertion",
"polyinnervation",
"recellularization",
"acellularization",
"plastination",
"hydratability",
"retinoylation",
"tibialization",
"misreplication",
"missionization",
"nonobservability",
"nonlabiality",
"nonhermeticity",
"nonglassiness",
"nonforgetfulness",
"nonexploitativeness",
"noncompulsoriness",
"multilamellation",
"metachronicity",
"stereogenicity",
"bihemisphericity",
"lipoylation",
"reinvocation",
"rediversion",
"deribosylation",
"derandomization",
"mismeasurement",
"mismeasure",
"uninfluenceability",
"deramification",
"misutilization",
"misprescription",
"misaminoacylation",
"miscalibration",
"reoptimization",
"reexcretion",
"misanalysis",
"miscategorization",
"reperitonization",
"miscompartmentalization",
"misdistribution",
"deetherification",
"misprojection",
"hemidecortication",
"mythification",
"misassembly",
"denucleation",
"deferration",
"deexcitation",
"misbisection",
"reprojection",
"hexacoordination",
"nonregulation",
"multiseptation",
"polysialylation",
"polyglutamation",
"citraconylation",
"desmethylation",
"misligation",
"misactivation",
"devolution",
"detelencephalization",
"transphosphatidylation",
"semiquantification",
"overexcretion",
"overstabilization",
"oversialylation",
"nonpliability",
"underreferral",
"overreplacement",
"organification",
"nonperpendicularity",
"nonisoluminance",
"nonlowness",
"nonintensity",
"undernotification",
"undervaccination",
"underarousal",
"hyperarousal",
"undertriage",
"preclearance",
"underpreparation",
"semi-immunity",
"nondesirability",
"noncredibility",
"noncorrelativity",
"nonconcavity",
"noncoagulability",
"premyelination",
"reepithelization",
"remedicalization",
"underresponsiveness",
"immunosurveillance",
"overcompliance",
"transductance",
"insulinoresistance",
"misfeasance",
"reneutralization",
"osmoresistance",
"nonunivocity",
"nonsubmersion",
"nonstraightness",
"nonstickiness",
"nonsphericity",
"nonphotoresponsiveness",
"nonimmunotoxicity",
"nonfecundity",
"predepolarization",
"subconductance",
"mistransfusion",
"reproposal",
"nonconfusability",
"crosstolerance",
"nonburstiness",
"nonanalyzability",
"nonwaxiness",
"nontranslucency",
"misprediction",
"prerotation",
"preplacement",
"prerelease",
"nonavoidability",
"nonforeignness",
"nonexternality",
"underappreciation",
"misattachment",
"semipurification",
"misselection",
"preacidification",
"noncrispness",
"noncorrectness",
"noncontemporaneousness",
"noncontemporaneity",
"precommitment",
"subdigestion",
"unfreezability",
"superfractionation",
"preincorporation",
"nontransducibility",
"nontolerability",
"subpassage",
"nonstorability",
"nonsensuality",
"misdifferentiation",
"miscoordination",
"pseudoresistance",
"antiresonance",
"multinucleoside resistance",
"prereading",
"predepletion",
"immunoquantification",
"misdeployment",
"antipromotion",
"superresolution",
"irrepeatability",
"mispatterning",
"nonpronounceability",
"prediffusion",
"nonelectronegativity",
"misfunction",
"deamplification",
"reapposition",
"prebleed",
"prebleeding",
"poststratification",
"nonperversity",
"non-perverseness",
"endothelization",
"misadaptation",
"suprainfection",
"postosmication",
"multimalformation",
"preinjection",
"unprotectiveness",
"preinflation",
"preconstruction",
"preconstruction",
"postdiagnosis",
"interregulation",
"subdislocation",
"subpatency",
"postfiltration",
"uninvasiveness",
"supramodality",
"postretirement",
"subsensitization",
"prerecognition",
"precalibration",
"planification",
"sonification",
"chronification",
"peritetraploidy",
"predeposition",
"postlexicality",
"extraperitonization",
"anticytotoxicity",
"superhydrophobicity",
"postdiction",
"unarousability",
"ultrametricity",
"superdeformation",
"pretermination",
"precondensation",
"precollection",
"precalcification",
"multistationarity",
"antihypersensitivity",
"superperfusion",
"substratification",
"prepolymerization",
"postpatency",
"postmodification",
"prelatency",
"multirecurrence",
"pretoxicity",
"postnormality",
"amplication",
"automodification",
"autocapture",
"autocovariance",
"autodephosphorylation",
"antiaromaticity",
"autocytotoxicity",
"superrepression",
"superphosphorylation",
"preozonation",
"preinclusion",
"ultradeformability",
"multicompetence",
"multicompetency",
"presecretion",
"intraperitonealization",
"autoinactivation",
"autorecognition",
"resegmentation",
"preinversion",
"prefragmentation",
"prefertility",
"superradiance",
"superdominance",
"subfunctionalization",
"presegregation",
"predivision",
"perimortality",
"antisymmetry",
"supraconductivity",
"multicatheterization",
"multifragmentation",
"antilethality",
"antiemotionality",
"anticoagulability",
"unobstructiveness",
"superexpression",
"suborganization",
"multivariation",
"predevelopment",
"metamagnetism",
"unintrusiveness",
"superluminosity",
"superinvasiveness",
"subsegmentation",
"submargination",
"subdetectability",
"pseudotriploidy",
"pseudostupidity",
"precontemplativeness",
"pseudodiffusion",
"pseudodecidualization",
"pseudobipolarity",
"preresonance",
"preisolation",
"precavitation",
"prealignment",
"preaddition",
"multideficiency",
"metarepresentation",
"subvitality",
"interporosity",
"superaddition",
"subselection",
"preorientation",
"preactivity",
"premolarization",
"preinactivation",
"predisinfection",
"preadsorbent",
"subresistance",
"ultrafractionation",
"subministration",
"subestimation",
"pseudospecificity",
"pseudointegrability",
"pseudoincontinence",
"pseudohomogeneity",
"pretrypsinization",
"lipotoxicity",
"premethylation",
"premeasurement",
"predistribution",
"preacclimatization",
"overanticoagulation",
"underanticoagulation",
"transmetalation",
"microdeposition",
"superinstability",
"superstrength",
"hydrodistillation",
"desymmetrization",
"aziridination",
"preinhibition",
"neurosensitization",
"postdisinfection",
"multitonality",
"multiduplication",
"multicompression",
"seroprotection",
"osteointegration",
"antiplasticization",
"antivariance",
"postpolymerization",
"superluminescence",
"unregulatability",
"supercooperativity",
"ultraporosity",
"unlocalizability",
"suprasensitivity",
"superlipophilicity",
"sorbability",
"pseudogravidity",
"pseudoclonality",
"multifinality",
"multiflagellation",
"interreproducibility",
"intercooperativity",
"superinfusion",
"superspecificity",
"superimmunity",
"pseudostability",
"pseudoselectivity",
"pseudosolubility",
"pseudosenility",
"pseudoheterosexuality",
"pretextuality",
"periselectivity",
"supraluminosity",
"subresponsiveness",
"sex-typedness",
"pseudodementia",
"pseudocontinence",
"mucosalization",
"nitroreduction",
"preelasticity",
"prerelaxation",
"preassignment",
"pseudoadditivity",
"previsualization",
"predesensitization",
"precompetence",
"preclosure",
"maleylation",
"monoprotonation",
"preassembly",
"postintensification",
"subwakefulness",
"untightness",
"autoamplification",
"autocompression",
"autocastration",
"postcalibration",
"multiovulation",
"superconduction",
"intertransformation",
"extrarotation",
"superinnervation",
"subcertification",
"transvaluation",
"pseudoherniation",
"pseudodependence",
"pseudocorrelation",
"preverification",
"pretranslation",
"presatiation",
"prerepresentation",
"preprotonation",
"prepasteurization",
"preidentification",
"prehabituation",
"pregermination",
"predetection",
"interreliability",
"preconjugation",
"multitoxicity",
"multilocalization",
"multidiagnosis",
"intraconversion",
"subtolerance",
"antiredundancy",
"unsecurity",
"unlinearity",
"unequidistance",
"undiscussibility",
"unconstructiveness",
"suprastimulation",
"supraposition",
"superselection",
"superresistance",
"supermethylation",
"superfrequency",
"supercontractility",
"superbasicity",
"superadvancement",
"suboptimization",
"subdifferentiation",
"presolution",
"presegmentation",
"prequalification",
"nonclearing",
"preopening",
"preopening",
"preinvestigation",
"preintroduction",
"preinstrumentation",
"preenhancement",
"antilinearity",
"preacceleration",
"preabrasion",
"postmaterialism",
"suprabioavailability",
"supermotility",
"superintensity",
"postchlorination",
"subendemicity",
"subendemism",
"insulin sensitivity",
"precalculation",
"intrarotation",
"intrapunitivity",
"intrapunitiveness",
"postlatency",
"interdispersion",
"intercoordination",
"intercompensation",
"unisolatability",
"unintuitiveness",
"unalienability",
"antimalignancy",
"supraovulation",
"superwidth",
"superrotation",
"superprotonation",
"superproduction",
"supermaturity",
"superfluorescence",
"superdrainage",
"superadequacy",
"subnotification",
"substability",
"subcapitation",
"pseudoprominence",
"subdisciplinarity",
"pseudoarticulation",
"pseudoacidity",
"presolubilization",
"prerecency",
"prepreparation",
"preoscillation",
"premastication",
"prelyophilization",
"preinfestation",
"prehyperpolarization",
"pregalactosylation",
"predissolution",
"preinflammation",
"predisengagement",
"precyclization",
"postconsciousness",
"postmodernization",
"postluminescence",
"multifurcation",
"interindependence",
"antipersistence",
"multicoordination",
"multicoordination",
"multichemoresistance",
"antidominance",
"interplacement",
"intercitation",
"extrasynthesis",
"superfractionality",
"unwholeness",
"pseudoautism",
"pseudoanergy",
"pseudoabnormality",
"unstageability",
"unsettleability",
"unordinariness",
"uninvadability",
"uninfectability",
"unexpediency",
"unduplication ",
"unduplication",
"uncontentiousness",
"ultradensity",
"ultracompetitiveness",
"suprasaturation",
"supervulnerability",
"supervalence",
"supervalency",
"supertransparency",
"supersuppression",
"superspecialization",
"superspecialization",
"supersonication",
"superpurification",
"superpersistence",
"supernucleophilicity",
"supermutability",
"superlightness",
"superinhibition",
"superimpression",
"superflexibility",
"superfertility",
"superextension",
"superdispersion",
"superdispersion",
"superdiamagnetism",
"supercompression",
"subzonation",
"submodularity",
"subionization",
"subemergence",
"subduality",
"subaridity",
"pseudoturbulence",
"pseudotranslation",
"pseudosuspension",
"pseudopurity",
"pseudoneutrality",
"pseudoloculation",
"pseudoinversion",
"pseudofemininity",
"pseudodenervation",
"pseudoconvergence",
"pseudocompliance",
"pseudoautoimmunity",
"preutilization",
"presubmission",
"presecretion",
"prereconstitution",
"prepressurization",
"debenzoylation",
"preprecipitation",
"prenegotiation",
"prenebulization",
"premoderation",
"premicroinjection",
"premanagement",
"prelocation",
"prelevation",
"preiodination",
"preinfiltration",
"preindentation",
"prefamiliarization",
"preextension",
"preenlargement",
"preelevation",
"predistension",
"precrystallization",
"precorrosion",
"precomplementation",
"precirculation",
"precapacitation",
"prebooking",
"preadhesion",
"preacceptance",
"postosmification",
"postoptimization",
"postgeneration",
"postcultivation",
"preintegration",
"multisimultaneity",
"multiseasonality",
"multirotation",
"multirepresentationality",
"multiregulation",
"multiproduction",
"multioptionality",
"preamplification",
"multidivision",
"multidegeneracy",
"multicorrelation",
"multicoincidence",
"multiangulation",
"multiangulation",
"intrarelatedness",
"deidentification",
"intracorrelation",
"intertransplantation",
"intersubstitution",
"desufflation",
"interpassage",
"intercrossability",
"interchelation",
"multiorientation",
"interarticulation",
"interadjustment",
"infraversion",
"multiliteracy",
"sequence specificity",
"level-headedness",
"co-presentation",
"Helicobacter pylori negativity",
"H. pylori negativity",
"antimicrobial drug resistance",
"progesterone receptor negativity",
"state-dependence",
"state-dependency",
"light-dependence",
"size-dependence",
"precompaction",
"stage management",
"drug dependence",
"isoelectrofocusing",
"benzoannulation",
"microfabrication",
"glutamylation",
"photoconductance",
"oxidoreductivity",
"agroinfiltration",
"phosphoregulation",
"cyclotrimerization",
"cyclopolymerization",
"precoordination",
"pansexualism",
"pansexuality",
"pansophism",
"pansophy",
"mucoactivity",
"overprojection",
"viscoplasticity",
"hypermucoviscosity",
"macroviscosity",
"thermoviscoelasticity",
"magnetoviscosity",
"monoacetylation",
"nanomanipulation",
"nanodimensionality",
"nanomagnetism",
"nanofabrication",
"nanoencapsulation",
"nanoroughness",
"nanofiltration",
"nanoconfinement",
"biosecurity",
"glutathionylation",
"antineutrophil cytoplasmic antibody positivity",
"ANCA positivity",
"ANCA negativity",
"cANCA positivity",
"diffeomorphism",
"nondiffraction",
"stereodifferentiation",
"enantiodifferentiation",
"predifferentiation",
"osteodifferentiation",
"diffuse-porousness",
"neurodifferentiation",
"thermodiffractometry",
"microdifferentiation",
"isodiffusivity",
"haplosufficiency",
"nine-coordination",
"nine-coordination",
"phytosanitation",
"non-phytotoxicity",
"thermodenaturation",
"thermoablation",
"kriging",
"mesogenicity",
"baroactivation",
"salt sensitivity",
"steroid sensitivity",
"strain specificity",
"salt solubility",
"osmoinduction",
"photocarcinogenicity",
"smoltification",
"folliculocentricity",
"redemonstration",
"hyperenhancement",
"hypoinflation",
"panculture",
"osteoproductivity",
"kocherization",
"pansensitivity",
"neuropsychotoxicity",
"adhesion",
"deglutination",
"encephalomalacia",
"hypoenhancement",
"immuno-cross-reaction",
"hydrodissection",
"hyperexpansion",
"photoexposure",
"surveillance",
"radioablation",
"hyperpronation",
"photodistribution",
"chemodifferentiation",
"monorhythmicity",
"orangishness",
"creepiness",
"sonodegradation",
"sono-abrasion",
"co-deposition",
"biodeposition",
"depollution",
"scrapability",
"reopposition",
"prophylaxis",
"hypercoordination",
"immunoablation",
"immaturation",
"immaturation",
"crawliness",
"detumescence",
"underpenetration",
"chemoembolysis",
"reinsufflation",
"pinchability",
"peristalsis",
"intransience",
"hyperflexibility",
"hydrodelineation",
"bolus",
"reintensification",
"polysaturation",
"phlegminess",
"photodocumentation",
"hypolobulation",
"hyperlobulation",
"hyperdistensibility",
"photoimmunology",
"viroimmunology",
"lymphodepletion",
"vitamin B1 deficiency",
"refabrication",
"recauterization",
"C4d-positivity",
"Fos-like immunoreactivity",
"preadjudication",
"5 alpha-reduction",
"bisociation",
"ensilability",
"autorotation",
"obesity-proneness",
"ouabain resistance",
"detorsion",
"chin-up",
"self-degradation",
"rifampin resistance",
"rifampicin resistance",
"pseudorotation",
"lichenification",
"scuba diving",
"serodiscordancy",
"self-inactivation",
"re-elaboration",
"substance P-immunoreactivity",
"substance P-like immunoreactivity",
"supertransfection",
"self-dilation",
"autodonation",
"quinonization",
"tissue equivalent",
"tetracycline resistance",
"thioguanine resistance",
"6-thioguanine resistance",
"T cell independence",
"denitrosation",
"subdistribution",
"structuration",
"biosafety",
"microdiscontinuity",
"self-incineration",
"vitamin D deficiency",
"vasoactive intestinal polypeptide immunoreactivity",
"vasoactive intestinal peptide immunoreactivity",
"virus neutralization",
"water deprivation",
"water-insolubility",
"zinc deficiency",
"multidifferentiation",
"servo-ventilation",
"transculturation",
"hyperaeration",
"predimerization",
"discriminateness",
"valency",
"valence",
"quaquaversal",
"biodistribution",
"quasi-tangency",
"counteradaptation",
"counterpulsation",
"cryoreduction",
"cryoinjury",
"cryostorage",
"decoagulation",
"denitrosylation",
"detritylation",
"dearylation",
"decrystallization",
"degustation",
"degustation",
"deligation",
"decurarization",
"desialation",
"decomplementation",
"dehospitalization",
"deglaciation",
"decoherence",
"detritiation",
"retitration",
"logroll",
"recombination",
"re-restoration",
"re-prescription",
"predenaturation",
"reincision",
"subrandomization",
"subanalysis",
"hyperflexion",
"self-catheterization",
"margination",
"subfragmentation",
"narrowheartedness",
"subregistration",
"multiubiquitination",
"multicommutation",
"pseudosimulation",
"multimedication",
"multistratification",
"multicolonization",
"multiexcitation",
"ploidy",
"neofunctionalization",
"multisegmentation",
"multialignment",
"multicompartmentation",
"multiauthorship",
"dispersion",
"semi-responsiveness",
"multimodulation",
"vesiculation",
"multivaccination",
"multifiltration",
"pseudocompliance",
"pseudoreduction",
"multireflection",
"pseudostabilization",
"pseudoherniation",
"pseudomediation",
"bloatiness",
"unfindability",
"pseudocopulation",
"dysdifferentiation",
"dysadaptation",
"dysinnervation",
"dysautoregulation",
"dyspigmentation",
"liver specificity",
"electroactivation",
"midocclusion",
"discord",
"subneutralization",
"non-neutralization",
"electromigration",
"deserosalization",
"electrodiagnosis",
"electroviscoelasticity",
"electroresection",
"shunt dependence",
"pexy",
"cross-contamination",
"cross-presentation",
"cross-tabulation",
"cross-transmission",
"cross-desensitization",
"cross-section",
"cross-sensitivity",
"dystaxia",
"demargination",
"blenderization",
"repalpation",
"redictation",
"precatheterization",
"reinstrumentation",
"non-turbidity",
"methadone dependence",
"re-interrogatation",
"re-interrogation",
"penicillin resistance",
"excerebration",
"reirrigation",
"exclosure",
"medevac",
"immunosufficiency",
"heart-cut",
"denormalization",
"contrast enhancement",
"capillary electrophoresis",
"chemoembolization",
"exsorption",
"prenormalization",
"barreloid",
"extraperitonealization",
"gradience",
"extrastimulation",
"goal orientation",
"goal orientation",
"topicalization",
"haemoptysis",
"pleurodesis",
"ultrafiltration",
"reauscultation",
"isoattenuation",
"isoattenuation",
"cell-type specificity",
"cell-type selectivity",
"autotransport",
"autoligation",
"autoanalysis",
"autoignition",
"autoaugmentation",
"autoconvolution",
"autosuggestion",
"autosuggestibility",
"autopolymerization",
"autosensitivity",
"autoabsorption",
"autosterilization",
"automanipulation",
"autointerference",
"autoluminescence",
"autoexposure",
"autoimplantation",
"athero-susceptibility",
"athero-resistance",
"sonoporation",
"protein energy malnutrition",
"hemisacralization",
"neurovascularization",
"coumadinization",
"hand-injection",
"progesterone receptor positivity",
"PR positivity",
"PR negativity",
"disimpaction",
"retroflexion",
"homoconjugation",
"postdilation",
"step-section",
"burpiness",
"shunt treatment",
"rebolus",
"estrogen receptor positivity",
"ER positivity",
"endoplasmic reticulum retention",
"ER retention",
"autoanticoagulation",
"hemiconvexity",
"pertussis toxin sensitivity",
"PTX sensitivity",
"paclitaxel resistance",
"PTX resistance",
"head injury",
"head restraint",
"hyperexcitement",
"hyperexcitation",
"hypersynchronization",
"hyperconcentration",
"hypersalivation",
"hypergranulation",
"hyperfusion",
"hyperandrogenization",
"hyperandrogenization",
"hyperoxidation",
"prepurification",
"hyperlactation",
"hyperconjugation",
"hypersensibility",
"hyperinvolution",
"hyper-refringence",
"hyperabsorption",
"hyperchlorination",
"hyperconstriction",
"hyperperfusion",
"hyperpigmentation",
"hyperrotation",
"rate dependence",]
| 16.549267 | 53 | 0.755804 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 214,378 | 0.879067 |
26200a7b0fdb3b7f678a0edc56db44b7bab13d20 | 2,029 | py | Python | tests/test_bulk_stats.py | sixy6e/eo-tools | 9e2772a5f15e04f6f7e3941541381544247ae1f2 | [
"Apache-2.0"
] | 3 | 2018-04-24T05:57:35.000Z | 2019-07-23T13:06:11.000Z | tests/test_bulk_stats.py | sixy6e/eo-tools | 9e2772a5f15e04f6f7e3941541381544247ae1f2 | [
"Apache-2.0"
] | 1 | 2015-06-17T04:39:23.000Z | 2015-06-17T04:39:23.000Z | tests/test_bulk_stats.py | sixy6e/eo-tools | 9e2772a5f15e04f6f7e3941541381544247ae1f2 | [
"Apache-2.0"
] | 2 | 2016-04-04T10:23:27.000Z | 2020-02-28T08:43:49.000Z | #!/usr/bin/env python
# ===============================================================================
# Copyright 2015 Geoscience Australia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ===============================================================================
import unittest
import numpy.testing as npt
import numpy
from eotools.bulk_stats import bulk_stats
from scipy import stats
class TestStats(unittest.TestCase):
"""
Unittests for the bulk_stats funtion.
"""
def setUp(self):
self.data = numpy.random.ranf((10, 100, 100))
self.result = bulk_stats(self.data, double=True)
def test_mean(self):
"""
Test that the mean value is the same.
"""
control = numpy.mean(self.data, axis=0)
npt.assert_allclose(control, self.result[1])
def test_variance(self):
"""
Test that the variance is the same.
"""
control = numpy.var(self.data, axis=0, ddof=1)
npt.assert_allclose(control, self.result[3])
def test_standard_deviation(self):
"""
Test that the standard deviation is the same.
"""
control = numpy.std(self.data, axis=0, ddof=1)
npt.assert_allclose(control, self.result[4])
def test_geometric_mean(self):
"""
Test that the geometric mean is the same.
"""
control = stats.gmean(self.data, axis=0)
npt.assert_allclose(control, self.result[-1])
if __name__ == '__main__':
npt.run_module_suite()
| 27.794521 | 81 | 0.609167 | 1,073 | 0.528832 | 0 | 0 | 0 | 0 | 0 | 0 | 1,071 | 0.527846 |
2620addb6c0a2614912637726159387427b444d3 | 2,516 | py | Python | python-skylark/skylark/tests/nla/test_nla.py | xdata-skylark/libskylark | 89c3736136a24d519c14fc0738c21f37f1e10360 | [
"Apache-2.0"
] | 86 | 2015-01-20T03:12:46.000Z | 2022-01-10T04:05:21.000Z | python-skylark/skylark/tests/nla/test_nla.py | xdata-skylark/libskylark | 89c3736136a24d519c14fc0738c21f37f1e10360 | [
"Apache-2.0"
] | 48 | 2015-05-12T09:31:23.000Z | 2018-12-05T14:45:46.000Z | python-skylark/skylark/tests/nla/test_nla.py | xdata-skylark/libskylark | 89c3736136a24d519c14fc0738c21f37f1e10360 | [
"Apache-2.0"
] | 25 | 2015-01-18T23:02:11.000Z | 2021-06-12T07:30:35.000Z | import unittest
import numpy as np
import El
import skylark.nla as sl_nla
from .. import utils
class NLATestCase(unittest.TestCase):
"""Tests nla functions."""
def test_approximate_svd(self):
"""Compute the SVD of **A** such that **SVD(A) = U S V^T**."""
n = 100
# Generate random matrix
A = El.DistMatrix()
El.Uniform(A, n, n)
A = A.Matrix()
# Dimension to apply along.
k = n
U = El.Matrix()
S = El.Matrix()
V = El.Matrix()
sl_nla.approximate_svd(A, U, S, V, k = k)
# Check result
RESULT = El.Matrix()
El.Zeros(RESULT, n, n)
El.DiagonalScale( El.RIGHT, El.NORMAL, S, U );
El.Gemm( El.NORMAL, El.ADJOINT, 1, U, V, 1, RESULT );
self.assertTrue(utils.equal(A, RESULT))
def test_approximate_symmetric_svd(self):
"""Compute the SVD of symmetric **A** such that **SVD(A) = V S V^T**"""
n = 100
A = El.DistMatrix()
El.Uniform(A, n, n)
A = A.Matrix()
# Make A symmetric
for i in xrange(0, A.Height()):
for j in xrange(0, i+1):
A.Set(j,i, A.Get(i,j))
# Usign symmetric SVD
SA = El.Matrix()
VA = El.Matrix()
sl_nla.approximate_symmetric_svd(A, SA, VA, k = n)
# Check result
VAT = El.Matrix()
El.Copy(VA, VAT)
RESULT = El.Matrix()
El.Zeros(RESULT, n, n)
El.DiagonalScale( El.RIGHT, El.NORMAL, SA, VAT );
El.Gemm( El.NORMAL, El.ADJOINT, 1, VAT, VA, 1, RESULT );
self.assertTrue(utils.equal(A, RESULT))
def test_faster_least_squares_NORMAL(self):
"""Solution to argmin_X ||A * X - B||_F"""
m = 500
n = 100
# Generate problem
A, B, X, X_opt= (El.Matrix(), El.Matrix(), El.Matrix(), El.Matrix())
El.Gaussian(A, m, n)
El.Gaussian(X_opt, n, 1)
El.Zeros(B, m, 1)
El.Gemm( El.NORMAL, El.NORMAL, 1, A, X_opt, 0, B);
# Solve it using faster least squares
sl_nla.faster_least_squares(A, B, X)
# Check the norm of our solution
El.Gemm( El.NORMAL, El.NORMAL, 1, A, X, -1, B);
self.assertAlmostEqual(El.Norm(B), 0)
# Checking the solution
self.assertTrue(utils.equal(X_opt, X))
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(NLATestCase)
unittest.TextTestRunner(verbosity=1).run(suite) | 25.938144 | 79 | 0.543323 | 2,262 | 0.899046 | 0 | 0 | 0 | 0 | 0 | 0 | 439 | 0.174483 |
2620ea952fc9ad7c4d6a79e6e5fedbfdc07b3d8b | 563 | py | Python | tut 9 blurring.py | arpit456jain/open-cv-tuts | 2ef213b9522a145fa51342d8a1385222cbe265c3 | [
"MIT"
] | null | null | null | tut 9 blurring.py | arpit456jain/open-cv-tuts | 2ef213b9522a145fa51342d8a1385222cbe265c3 | [
"MIT"
] | null | null | null | tut 9 blurring.py | arpit456jain/open-cv-tuts | 2ef213b9522a145fa51342d8a1385222cbe265c3 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
from matplotlib import pyplot as plt
img = cv2.imread("images/watter.jpeg")
img = cv2.cvtColor(img,cv2.COLOR_BGR2RGB)
kernel = np.ones((5,5),np.float32)/25
dst1 = cv2.filter2D(img,-1,kernel)
blur = cv2.blur(img,(5,5))
g_blur = cv2.GaussianBlur(img,(5,5),0)
median_blur = cv2.medianBlur(img,5)
titles = ['image','smooth 1','blur','gaussian blur','median blur']
images = [img,dst1,blur,g_blur,median_blur]
for i in range(5):
plt.subplot(2,3,i+1)
plt.title(titles[i])
plt.imshow(images[i],cmap = 'gray')
plt.show()
| 21.653846 | 66 | 0.687389 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 77 | 0.136767 |
2621a6ccabece576b91cf545a302da60ca663e33 | 302 | py | Python | oauth2_provider/http.py | manelclos/django-oauth-toolkit | c2ca9ccdfc0a0fb5e03ce4d83dafbf2e32545bd3 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | oauth2_provider/http.py | manelclos/django-oauth-toolkit | c2ca9ccdfc0a0fb5e03ce4d83dafbf2e32545bd3 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2018-03-27T11:33:23.000Z | 2018-03-27T11:33:23.000Z | oauth2_provider/http.py | manelclos/django-oauth-toolkit | c2ca9ccdfc0a0fb5e03ce4d83dafbf2e32545bd3 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2021-02-13T11:53:48.000Z | 2021-02-13T11:53:48.000Z | from django.http import HttpResponseRedirect
class HttpResponseUriRedirect(HttpResponseRedirect):
def __init__(self, redirect_to, allowed_schemes, *args, **kwargs):
self.allowed_schemes = allowed_schemes
super(HttpResponseUriRedirect, self).__init__(redirect_to, *args, **kwargs)
| 37.75 | 83 | 0.774834 | 254 | 0.84106 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2621c3a515fc4c1d4a5faef8759aaadc1e7eaeca | 8,587 | py | Python | backend/main.py | jinjf553/hook_up_rent | 401ce94f3140d602bf0a95302ee47b7ef213b911 | [
"MIT"
] | null | null | null | backend/main.py | jinjf553/hook_up_rent | 401ce94f3140d602bf0a95302ee47b7ef213b911 | [
"MIT"
] | null | null | null | backend/main.py | jinjf553/hook_up_rent | 401ce94f3140d602bf0a95302ee47b7ef213b911 | [
"MIT"
] | null | null | null | import time
from datetime import timedelta
from random import choice
from typing import List, Optional
from fastapi import Depends, FastAPI, File, UploadFile
from fastapi.staticfiles import StaticFiles
from passlib.context import CryptContext
from pydantic import BaseModel
from sqlalchemy.orm import Session
from config import ACCESS_TOKEN_EXPIRE_MINUTES, HEADERS, STATIC_DIR
from orm import DBSession, DBUser
from utils import create_access_token, get_current_user
app = FastAPI()
''' 运行命令: uvicorn main:app --reload --host 0.0.0.0 --port 8000'''
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
class User(BaseModel):
# id: int
username: str
password: str
status: Optional[int] = 0
description: Optional[str] = ''
body: Optional[dict] = {'token': ''}
class Config:
orm_mode = True
class Houses(BaseModel):
title: str
description: str
price: str
size: str
oriented: str
roomType: str
floor: str
community: str
houseImg: str
supporting: str
class Config:
orm_mode = True
@app.get("/")
def read_root():
return {"Hello": "World"}
@app.post("/user/registered", response_model=User)
async def user_register(user: User, db: Session = Depends(DBSession)):
# 密码加密
password = CryptContext(schemes=["bcrypt"],
deprecated="auto").hash(user.password)
db_user = DBUser(username=user.username, password=password)
DBUser.add(db, db_user)
db_user.status, db_user.description = 200, '注册陈功!'
return db_user
@app.post("/user/login", response_model=User)
async def register(user: User, db: Session = Depends(DBSession)):
db_user = DBUser.get_by_username(db, user.username)
# 密码加密
verify = CryptContext(schemes=["bcrypt"], deprecated="auto")
access_token_expires = timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES)
access_token = create_access_token(
data={"sub": user.username}, expires_delta=access_token_expires
)
if not db_user:
db_user = User(username='', password='')
db_user.status = 300
db_user.description = '用户不存在!'
return db_user
elif not verify.verify(user.password, db_user.password):
db_user.status = 300
db_user.description = '你的账号或密码错误!'
return db_user
else:
db_user.status, db_user.description = 200, '账号登录成功!'
db_user.body['token'] = access_token
print(db_user.status)
return db_user
@app.get("/user", response_model=User)
async def read_users_me(username: User = Depends(get_current_user), db: Session = Depends(DBSession)):
print('login_username: ', username, time.strftime('%M%S'))
db_user: User = DBUser.get_by_username(db, username)
if not db_user or not username:
db_user = User(username='', password='', status=400, description='登录信息失效,请重新登录!')
return db_user
db_user.description, db_user.status = '成功', 200
if 'token' in db_user.body:
db_user.body.pop('token')
db_user.body.update({'avatar': choice(HEADERS),
'nickname': f'好客_{str(db_user.id).rjust(6, "0")}',
'gender': choice(['男', '女']),
'phone': '小米', 'id': db_user.id})
return db_user
@app.get("/houses/condition")
async def get_houses_condition(id: str, db: Session = Depends(DBSession)):
response_json = {'status': 200, 'description': '请求成功', 'body': {
'area': {'label': '区域', 'value': 'area', 'children': [{'label': '不限', 'value': 'null'}, {'label': '朝阳', 'value': 'AREA|zhaoyang'}]},
'characteristic': [{'label': '集中供暖', 'value': 'CHAR|jizhonggongnuan'}],
'floor': [{'label': '高楼层', 'value': 'FLOOR|1'}],
'rentType': [{'label': '不限', 'value': 'null'}],
'oriented': [{'label': '东', 'value': 'ORIEN|1'}],
'price': [{'label': '不限', 'value': 'null'}],
'roomType': [{'label': '一室', 'value': 'ROOM|1'}],
'subway': {'label': '地铁', 'value': 'subway', 'children': [{'label': '不限', 'value': 'null'}]}
}}
if id == 'AREA|1111':
return response_json
else:
response_json['body']['area']['children'] = [{'label': '不限', 'value': 'null'}, {'label': '宝山', 'value': 'AREA|baoshan'}]
return response_json
@app.get("/houses")
async def get_houses(cityId, area, mode, price, more, start, end, db: Session = Depends(DBSession)):
response_json = {'status': 200, 'description': '请求成功', 'body': {
'list': [{'houseCode': '11', 'title': '线上', 'desc': 'subtitle', 'houseImg': 'static/images/轮播1.jpg', 'tags': ['近地铁'], 'price': 2000}]
}}
if area == 'AREA|zhaoyang':
return response_json
else:
response_json['body']['list'][0]['title'] = '线下'
return response_json
@app.get("/houses/params")
async def get_houses_params():
response_json = {'status': 200, 'description': '请求成功', 'body': {
'floor': [{'value': '1', 'label': '高楼层'}, {'value': '2', 'label': '中楼层'}, {'value': '3', 'label': '低楼层'}],
'roomType': [{'value': '1', 'label': '一室'}, {'value': '2', 'label': '二室'}, {'value': '3', 'label': '三室'}, {'value': '4', 'label': '四室'}],
'oriented': [{'value': '1', 'label': '东'}, {'value': '2', 'label': '南'}, {'value': '3', 'label': '西'}, {'value': '4', 'label': '北'}]}}
return response_json
@app.post("/house/image")
async def post_houses_image(file: List[UploadFile] = File(...), username: User = Depends(get_current_user)):
response_json = {'status': 200, 'description': '请求成功', 'body': []}
for x in file:
with open(f'{STATIC_DIR}/{x.filename}', 'wb') as f:
f.write(await x.read())
response_json['body'].append(x.filename)
return response_json
@app.get("/houses/{roomId}")
async def get_houses_room(roomId: int, db: Session = Depends(DBSession)):
response_json = {'status': 200,
'description': '请求成功',
'body': {'houseCode': '1111',
'title': '整租 中山路 历史最低点',
'community': '中山花园',
'description':
'近地铁,附近有商场!254对数据集跑一下第二版仿真工程。 -- 3月7号demo版本2. 五个城市五个机型对应的TOP5数据标注2.0 (北京只有一条) deviceId的数量大于203. 不care城市五个机型对应的TOP数据标注2.0( 2和3的deviceId不能重复 ) # 先不做254对数据集跑一下第二版仿真工程。 -- 3月7号demo版本2. 五个城市五个机型对应的TOP5数据标注2.0 (北京只有一条) deviceId的数量大于203. 不care城市五个机型对应的TOP数据标注2.0( 2和3的deviceId不能重复 ) # 先不做254对数据集跑一下第二版仿真工程。 -- 3月7号demo版本2. 五个城市五个机型对应的TOP5数据标注2.0 (北京只有一条) deviceId的数量大于203. 不care城市五个机型对应的TOP数据标注2.0( 2和3的deviceId不能重复 ) # 先不做',
'size': 100,
'floor': '高楼层',
'price': 3000,
'oriented': ['南'],
'roomType': '三室',
'supporting': ['衣柜', '洗衣机'],
'tags': ['近地铁', '集中供暖', '新上', '随时看房'],
'houseImg': [
'static/images/轮播1.jpg',
'static/images/轮播2.jpg',
'static/images/轮播3.jpg'
]}}
return response_json
@app.get("/user/houses")
async def get_user_houses(username: User = Depends(get_current_user), db: Session = Depends(DBSession)):
print('username: ', username, time.strftime('%M%S'), type(username))
response_json = {'status': 200, 'description': '请求成功', 'body': [
{'houseCode': '1111',
'title': '整租 中山路 历史最低点',
'desc':
'近地铁,附近有商场!254对数据集跑一下第二版仿真工程。',
'price': 3000,
'tags': ['近地铁', '集中供暖', '新上', '随时看房'],
'houseImg': 'static/images/轮播1.jpg'}
]}
if not username:
response_json = {'status': 400, 'description': 'token已过期', 'body': []}
print(username)
return response_json
@app.post("/user/houses")
async def post_user_houses(house: Houses, username: User = Depends(get_current_user), db: Session = Depends(DBSession)):
response_json = {'status': 200, 'description': '请求成功'}
if not username:
response_json = {'status': 400, 'description': 'token已过期'}
# print(house)
return response_json
@app.get("/area/community")
async def get_area_community(name: str, id: str):
response_json = {'status': 200, 'description': '请求成功', 'body': [
{'community': '123', 'communityName': name}
]}
return response_json
@app.get("/items/{item_id}")
def read_item(item_id: int, q: str = None):
return {"item_id": item_id, "q": q}
| 37.995575 | 448 | 0.584721 | 462 | 0.048463 | 0 | 0 | 8,392 | 0.880311 | 7,873 | 0.825868 | 3,601 | 0.37774 |
262261b72d2641412ed943023fa74d4339a36852 | 7,665 | py | Python | mmdet/models/losses/iou_losses.py | jie311/miemiedetection | b0e7a45717fe6c9cf9bf3c0f47d47a2e6c68b1b6 | [
"Apache-2.0"
] | 65 | 2021-12-30T03:30:52.000Z | 2022-03-25T01:44:32.000Z | mmdet/models/losses/iou_losses.py | jie311/miemiedetection | b0e7a45717fe6c9cf9bf3c0f47d47a2e6c68b1b6 | [
"Apache-2.0"
] | 1 | 2021-12-31T01:51:35.000Z | 2022-01-01T14:42:37.000Z | mmdet/models/losses/iou_losses.py | jie311/miemiedetection | b0e7a45717fe6c9cf9bf3c0f47d47a2e6c68b1b6 | [
"Apache-2.0"
] | 7 | 2021-12-31T09:25:06.000Z | 2022-03-10T01:25:09.000Z | #! /usr/bin/env python
# coding=utf-8
# ================================================================
#
# Author : miemie2013
# Created date: 2020-10-15 14:50:03
# Description : pytorch_ppyolo
#
# ================================================================
import torch
import torch.nn as nn
import torch as T
import torch.nn.functional as F
import numpy as np
from mmdet.models.bbox_utils import bbox_iou
class IouLoss(nn.Module):
"""
iou loss, see https://arxiv.org/abs/1908.03851
loss = 1.0 - iou * iou
Args:
loss_weight (float): iou loss weight, default is 2.5
max_height (int): max height of input to support random shape input
max_width (int): max width of input to support random shape input
ciou_term (bool): whether to add ciou_term
loss_square (bool): whether to square the iou term
"""
def __init__(self,
loss_weight=2.5,
giou=False,
diou=False,
ciou=False,
loss_square=True):
super(IouLoss, self).__init__()
self.loss_weight = loss_weight
self.giou = giou
self.diou = diou
self.ciou = ciou
self.loss_square = loss_square
def forward(self, pbox, gbox):
iou = bbox_iou(
pbox, gbox, giou=self.giou, diou=self.diou, ciou=self.ciou)
if self.loss_square:
loss_iou = 1 - iou * iou
else:
loss_iou = 1 - iou
loss_iou = loss_iou * self.loss_weight
return loss_iou
class IouAwareLoss(IouLoss):
"""
iou aware loss, see https://arxiv.org/abs/1912.05992
Args:
loss_weight (float): iou aware loss weight, default is 1.0
max_height (int): max height of input to support random shape input
max_width (int): max width of input to support random shape input
"""
def __init__(self, loss_weight=1.0, giou=False, diou=False, ciou=False):
super(IouAwareLoss, self).__init__(
loss_weight=loss_weight, giou=giou, diou=diou, ciou=ciou)
def forward(self, ioup, pbox, gbox):
iou = bbox_iou(
pbox, gbox, giou=self.giou, diou=self.diou, ciou=self.ciou)
# iou.requires_grad = False
iou = iou.detach()
loss_iou_aware = F.binary_cross_entropy_with_logits(
ioup, iou, reduction='none')
loss_iou_aware = loss_iou_aware * self.loss_weight
return loss_iou_aware
class MyIOUloss(nn.Module):
def __init__(self, reduction="none", loss_type="iou"):
super(MyIOUloss, self).__init__()
self.reduction = reduction
self.loss_type = loss_type
def forward(self, pred, target):
'''
输入矩形的格式是cx cy w h
'''
assert pred.shape[0] == target.shape[0]
boxes1 = pred
boxes2 = target
# 变成左上角坐标、右下角坐标
boxes1_x0y0x1y1 = torch.cat([boxes1[:, :2] - boxes1[:, 2:] * 0.5,
boxes1[:, :2] + boxes1[:, 2:] * 0.5], dim=-1)
boxes2_x0y0x1y1 = torch.cat([boxes2[:, :2] - boxes2[:, 2:] * 0.5,
boxes2[:, :2] + boxes2[:, 2:] * 0.5], dim=-1)
# 两个矩形的面积
boxes1_area = (boxes1_x0y0x1y1[:, 2] - boxes1_x0y0x1y1[:, 0]) * (boxes1_x0y0x1y1[:, 3] - boxes1_x0y0x1y1[:, 1])
boxes2_area = (boxes2_x0y0x1y1[:, 2] - boxes2_x0y0x1y1[:, 0]) * (boxes2_x0y0x1y1[:, 3] - boxes2_x0y0x1y1[:, 1])
# 相交矩形的左上角坐标、右下角坐标
left_up = torch.maximum(boxes1_x0y0x1y1[:, :2], boxes2_x0y0x1y1[:, :2])
right_down = torch.minimum(boxes1_x0y0x1y1[:, 2:], boxes2_x0y0x1y1[:, 2:])
# 相交矩形的面积inter_area。iou
inter_section = F.relu(right_down - left_up)
inter_area = inter_section[:, 0] * inter_section[:, 1]
union_area = boxes1_area + boxes2_area - inter_area
iou = inter_area / (union_area + 1e-16)
if self.loss_type == "iou":
loss = 1 - iou ** 2
elif self.loss_type == "giou":
# 包围矩形的左上角坐标、右下角坐标
enclose_left_up = torch.minimum(boxes1_x0y0x1y1[:, :2], boxes2_x0y0x1y1[:, :2])
enclose_right_down = torch.maximum(boxes1_x0y0x1y1[:, 2:], boxes2_x0y0x1y1[:, 2:])
# 包围矩形的面积
enclose_wh = enclose_right_down - enclose_left_up
enclose_area = enclose_wh[:, 0] * enclose_wh[:, 1]
giou = iou - (enclose_area - union_area) / enclose_area
# giou限制在区间[-1.0, 1.0]内
giou = torch.clamp(giou, -1.0, 1.0)
loss = 1 - giou
if self.reduction == "mean":
loss = loss.mean()
elif self.reduction == "sum":
loss = loss.sum()
return loss
class GIoULoss(object):
"""
Generalized Intersection over Union, see https://arxiv.org/abs/1902.09630
Args:
loss_weight (float): giou loss weight, default as 1
eps (float): epsilon to avoid divide by zero, default as 1e-10
reduction (string): Options are "none", "mean" and "sum". default as none
"""
def __init__(self, loss_weight=1., eps=1e-10, reduction='none'):
self.loss_weight = loss_weight
self.eps = eps
assert reduction in ('none', 'mean', 'sum')
self.reduction = reduction
def bbox_overlap(self, box1, box2, eps=1e-10):
"""calculate the iou of box1 and box2
Args:
box1 (Tensor): box1 with the shape (..., 4)
box2 (Tensor): box1 with the shape (..., 4)
eps (float): epsilon to avoid divide by zero
Return:
iou (Tensor): iou of box1 and box2
overlap (Tensor): overlap of box1 and box2
union (Tensor): union of box1 and box2
"""
x1, y1, x2, y2 = box1
x1g, y1g, x2g, y2g = box2
xkis1 = torch.maximum(x1, x1g)
ykis1 = torch.maximum(y1, y1g)
xkis2 = torch.minimum(x2, x2g)
ykis2 = torch.minimum(y2, y2g)
w_inter = F.relu(xkis2 - xkis1)
h_inter = F.relu(ykis2 - ykis1)
overlap = w_inter * h_inter
area1 = (x2 - x1) * (y2 - y1)
area2 = (x2g - x1g) * (y2g - y1g)
union = area1 + area2 - overlap + eps
iou = overlap / union
return iou, overlap, union
def __call__(self, pbox, gbox, iou_weight=1., loc_reweight=None):
# x1, y1, x2, y2 = paddle.split(pbox, num_or_sections=4, axis=-1)
# x1g, y1g, x2g, y2g = paddle.split(gbox, num_or_sections=4, axis=-1)
# torch的split和paddle有点不同,torch的第二个参数表示的是每一份的大小,paddle的第二个参数表示的是分成几份。
x1, y1, x2, y2 = torch.split(pbox, split_size_or_sections=1, dim=-1)
x1g, y1g, x2g, y2g = torch.split(gbox, split_size_or_sections=1, dim=-1)
box1 = [x1, y1, x2, y2]
box2 = [x1g, y1g, x2g, y2g]
iou, overlap, union = self.bbox_overlap(box1, box2, self.eps)
xc1 = torch.minimum(x1, x1g)
yc1 = torch.minimum(y1, y1g)
xc2 = torch.maximum(x2, x2g)
yc2 = torch.maximum(y2, y2g)
area_c = (xc2 - xc1) * (yc2 - yc1) + self.eps
miou = iou - ((area_c - union) / area_c)
if loc_reweight is not None:
loc_reweight = torch.reshape(loc_reweight, shape=(-1, 1))
loc_thresh = 0.9
giou = 1 - (1 - loc_thresh
) * miou - loc_thresh * miou * loc_reweight
else:
giou = 1 - miou
if self.reduction == 'none':
loss = giou
elif self.reduction == 'sum':
loss = torch.sum(giou * iou_weight)
else:
loss = torch.mean(giou * iou_weight)
return loss * self.loss_weight
| 35.486111 | 119 | 0.562818 | 7,464 | 0.944213 | 0 | 0 | 0 | 0 | 0 | 0 | 2,393 | 0.30272 |
2624bc257e8f901aa965ba0e22d2dad3a916b18b | 312 | py | Python | assignments/assignment2/solutions/Jlopezjlx/src/src/account/forms.py | Jlopezjlx/python-mentorship | d104205bb9330ed5fc0ade433fb9a5aae5df4585 | [
"Apache-2.0"
] | 1 | 2019-04-07T12:26:20.000Z | 2019-04-07T12:26:20.000Z | assignments/assignment2/solutions/Jlopezjlx/src/src/account/forms.py | Jlopezjlx/python-mentorship | d104205bb9330ed5fc0ade433fb9a5aae5df4585 | [
"Apache-2.0"
] | null | null | null | assignments/assignment2/solutions/Jlopezjlx/src/src/account/forms.py | Jlopezjlx/python-mentorship | d104205bb9330ed5fc0ade433fb9a5aae5df4585 | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth import get_user_model
from .models import Account
from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
User = get_user_model()
class CustomCreateUser(UserCreationForm):
class Meta:
model = Account
fields = ('username',) | 22.285714 | 70 | 0.759615 | 113 | 0.362179 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 0.032051 |
2624f3ec627e513d71eae77da294d30a7ee77f1c | 489 | py | Python | pygame_gui/elements/__init__.py | jtiai/pygame_gui | 3da0e1f2c4c60a2780c798d5592f2603ba786b34 | [
"MIT"
] | null | null | null | pygame_gui/elements/__init__.py | jtiai/pygame_gui | 3da0e1f2c4c60a2780c798d5592f2603ba786b34 | [
"MIT"
] | null | null | null | pygame_gui/elements/__init__.py | jtiai/pygame_gui | 3da0e1f2c4c60a2780c798d5592f2603ba786b34 | [
"MIT"
] | null | null | null | from .ui_image import UIImage
from .ui_button import UIButton
from .ui_horizontal_slider import UIHorizontalSlider
from .ui_vertical_scroll_bar import UIVerticalScrollBar
from .ui_label import UILabel
from .ui_screen_space_health_bar import UIScreenSpaceHealthBar
from .ui_tool_tip import UITooltip
from .ui_drop_down_menu import UIDropDownMenu
from .ui_text_box import UITextBox
from .ui_world_space_health_bar import UIWorldSpaceHealthBar
from .ui_text_entry_line import UITextEntryLine
| 40.75 | 62 | 0.887526 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
262e2a6baf3b88e437fd423ee773c563521113f5 | 337 | py | Python | src/movie.py | cannibalcheeseburger/RaMu-Discord-bot | 6644cec0d249e6a5061ed16035102f97f9fc7ba7 | [
"MIT"
] | 2 | 2020-05-28T12:50:33.000Z | 2020-05-29T09:06:01.000Z | src/movie.py | cannibalcheeseburger/RaMu-Discord-bot | 6644cec0d249e6a5061ed16035102f97f9fc7ba7 | [
"MIT"
] | 2 | 2021-03-31T19:55:09.000Z | 2021-12-13T20:42:08.000Z | src/movie.py | cannibalcheeseburger/RaMu-Discord-bot | 6644cec0d249e6a5061ed16035102f97f9fc7ba7 | [
"MIT"
] | null | null | null | import imdb
def movie(name):
ia = imdb.IMDb()
movie_obj = ia.search_movie(name)
el = ia.get_movie(movie_obj[0].movieID)
title = str(el.get('title'))
year = str(el.get('year'))
plot = str(el.get('plot')[0])
ty = False
if str(el.get('kind')) == 'tv series':
ty = True
return(title,year,plot,ty) | 25.923077 | 43 | 0.581602 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 36 | 0.106825 |
263290a43a7fd76dbddf7ceb014df04f20ba0371 | 7,249 | py | Python | micropy/project/modules/packages.py | MathijsNL/micropy-cli | 2dec0ca3045a22f6552dc3813bedaf552d4bad2c | [
"MIT"
] | null | null | null | micropy/project/modules/packages.py | MathijsNL/micropy-cli | 2dec0ca3045a22f6552dc3813bedaf552d4bad2c | [
"MIT"
] | null | null | null | micropy/project/modules/packages.py | MathijsNL/micropy-cli | 2dec0ca3045a22f6552dc3813bedaf552d4bad2c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Project Packages Module."""
import shutil
from pathlib import Path
from typing import Any, Union
from boltons import fileutils
from micropy import utils
from micropy.packages import (LocalDependencySource, PackageDependencySource,
create_dependency_source)
from micropy.project.modules import ProjectModule
class PackagesModule(ProjectModule):
"""Project Module for handling requirements.
Args:
path (str): Path to create requirements file at.
packages (dict, optional): Initial packages to use.
Defaults to None.
"""
PRIORITY: int = 8
def __init__(self, path, packages=None, **kwargs):
super().__init__(**kwargs)
self._path = Path(path)
self._loaded = False
packages = packages or {}
self.name = "packages"
self.packages = {**packages}
@property
def path(self):
"""Path to requirements file.
Returns:
Path: Path to file
"""
path = self.parent.path / self._path
return path
@property
def pkg_path(self):
"""Path to package data folder.
Returns:
Path: Path to folder.
"""
return self.parent.data_path / self.parent.name
@property
def config(self):
"""Config values specific to component.
Returns:
dict: Component config.
"""
return {
self.name: self.packages
}
@property
def context(self):
"""Context values specific to component.
Returns:
dict: Context values.
"""
_paths = set(self.parent.context.get('paths', set()))
_paths.add(self.pkg_path)
return {
'paths': _paths
}
def install_package(self, source: Union[LocalDependencySource, PackageDependencySource]) -> Any:
with source as files:
if isinstance(files, list):
self.log.debug(f"installing {source} as module(s)")
# Iterates over flattened list of stubs tuple
file_paths = [(f, (self.pkg_path / f.name)) for f in list(sum(files, ()))]
for paths in file_paths:
return shutil.move(*paths) # overwrites if existing
self.log.debug(f'installing {source} as package')
pkg_path = self.pkg_path / source.package.name
return fileutils.copytree(files, pkg_path)
@ProjectModule.hook(dev=False)
def add_from_file(self, path=None, dev=False, **kwargs):
"""Loads all requirements from file.
Args:
path (str): Path to file. Defaults to self.path.
dev (bool, optional): If dev requirements should be loaded.
Defaults to False.
"""
reqs = utils.iter_requirements(self.path)
for req in reqs:
self.add_package(req, fetch=True)
return reqs
@ProjectModule.hook()
def add_package(self, package, dev=False, **kwargs):
"""Add requirement to project.
Args:
package (str): package name/spec
dev (bool, optional): If dev requirements should be loaded.
Defaults to False.
Returns:
dict: Dictionary of packages
"""
source = create_dependency_source(package)
pkg = source.package
self.log.info(f"Adding $[{pkg.name}] to requirements...")
if self.packages.get(pkg.name, None):
self.log.error(f"$[{pkg}] is already installed!")
self.update()
return None
self.packages[pkg.name] = pkg.pretty_specs
try:
self.load()
except ValueError:
self.log.error(f"Failed to find package $[{pkg.name}]!")
self.log.error("Is it available on PyPi?")
self.packages.pop(pkg.name)
self.parent.config.pop(f"{self.name}.{pkg}")
except Exception as e:
self.log.error(
f"An error occured during the installation of $[{pkg.name}]!",
exception=e)
self.packages.pop(pkg.name)
self.parent.config.pop(f"{self.name}.{pkg}")
else:
self.parent.config.set(f"{self.name}.{pkg}", pkg.pretty_specs)
self.log.success("Package installed!")
finally:
return self.packages
def load(self, fetch=True, **kwargs):
"""Retrieves and stubs project requirements."""
self.pkg_path.mkdir(exist_ok=True)
if self.path.exists():
packages = utils.iter_requirements(self.path)
for p in packages:
pkg = create_dependency_source(p.line).package
self.packages.update({pkg.name: pkg.pretty_specs})
self.parent.config.set(f'{self.name}.{pkg.name}', pkg.pretty_specs)
pkg_keys = set(self.packages.keys())
pkg_cache = self.parent._get_cache(self.name)
new_pkgs = pkg_keys.copy()
if pkg_cache:
new_pkgs = new_pkgs - set(pkg_cache)
new_pkgs = [f"{name}{s if s != '*' else ''}"
for name, s in self.packages.items() if name in new_pkgs]
if fetch:
if new_pkgs:
self.log.title("Fetching Requirements")
for req in new_pkgs:
def format_desc(p): return "".join(self.log.iter_formatted(f"$B[{p}]"))
source = create_dependency_source(
req, format_desc=lambda p: f"{self.log.get_service()} {format_desc(p)}")
self.install_package(source)
self.update()
self.parent._set_cache(self.name, list(pkg_keys))
def create(self):
"""Create project files."""
return self.update()
def update(self):
"""Dumps packages to file at path."""
self.parent.config.set(self.name, self.packages)
ctx_paths = self.parent.context.get('paths')
ctx_paths.add(self.pkg_path)
if not self.path.exists():
self.path.touch()
pkgs = [(f"{name}{spec}" if spec and spec != "*" else name)
for name, spec in self.packages.items()]
with self.path.open('r+') as f:
content = [c.strip() for c in f.readlines() if c.strip() != '']
_lines = sorted(set(pkgs) | set(content))
lines = [l + "\n" for l in _lines]
f.seek(0)
f.writelines(lines)
class DevPackagesModule(PackagesModule):
"""Project Module for Dev Packages."""
PRIORITY: int = 7
def __init__(self, path, **kwargs):
super().__init__(path, **kwargs)
self.packages.update({'micropy-cli': '*'})
self.name = "dev-packages"
def load(self, *args, **kwargs):
"""Load component."""
return super().load(*args, **kwargs, fetch=False)
@ProjectModule.hook(dev=True)
def add_package(self, package, **kwargs):
"""Adds package."""
return super().add_package(package, **kwargs)
@ProjectModule.hook(dev=True)
def add_from_file(self, path=None, **kwargs):
"""Adds packages from file."""
return super().add_from_file(path=path, **kwargs)
| 32.95 | 100 | 0.572769 | 6,875 | 0.948407 | 0 | 0 | 3,151 | 0.434681 | 0 | 0 | 2,026 | 0.279487 |
2636d97a76008661a130b2893ade3f12667ed659 | 361 | py | Python | soxs/background/__init__.py | gb-heimaf/lynx-x-ray-observatory | a1e5a17cab3763975e0d3dc0840f0359de8c8087 | [
"BSD-3-Clause"
] | 10 | 2020-05-08T01:38:18.000Z | 2021-09-30T16:55:49.000Z | soxs/background/__init__.py | gb-heimaf/lynx-x-ray-observatory | a1e5a17cab3763975e0d3dc0840f0359de8c8087 | [
"BSD-3-Clause"
] | 7 | 2018-10-03T11:56:01.000Z | 2021-08-12T17:54:51.000Z | soxs/background/__init__.py | gb-heimaf/lynx-x-ray-observatory | a1e5a17cab3763975e0d3dc0840f0359de8c8087 | [
"BSD-3-Clause"
] | 6 | 2016-11-17T21:15:22.000Z | 2021-04-10T11:42:24.000Z | from .foreground import make_foreground
from .point_sources import make_ptsrc_background, \
make_point_sources_file, make_point_source_list
from .instrument import make_instrument_background
from .spectra import BackgroundSpectrum, \
ConvolvedBackgroundSpectrum
from .events import add_background_from_file
from .instrument import InstrumentalBackground | 45.125 | 51 | 0.869806 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2636fef4d07451a8ef4cb29191498d6952487c63 | 3,945 | py | Python | backup/guitemplates/endofsessiondialog.py | calebtrahan/KujiIn_Python | 0599d36993fa1d5988a4cf3206a12fdbe63781d8 | [
"MIT"
] | null | null | null | backup/guitemplates/endofsessiondialog.py | calebtrahan/KujiIn_Python | 0599d36993fa1d5988a4cf3206a12fdbe63781d8 | [
"MIT"
] | null | null | null | backup/guitemplates/endofsessiondialog.py | calebtrahan/KujiIn_Python | 0599d36993fa1d5988a4cf3206a12fdbe63781d8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'endofsessiondialog.ui'
#
# Created by: PyQt4 UI code generator 4.11.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_sessioncompletedDialog(object):
def setupUi(self, sessioncompletedDialog):
sessioncompletedDialog.setObjectName(_fromUtf8("sessioncompletedDialog"))
sessioncompletedDialog.resize(391, 142)
self.sessioncompletedtopLabel = QtGui.QLabel(sessioncompletedDialog)
self.sessioncompletedtopLabel.setGeometry(QtCore.QRect(30, 10, 331, 20))
self.sessioncompletedtopLabel.setAlignment(QtCore.Qt.AlignCenter)
self.sessioncompletedtopLabel.setObjectName(_fromUtf8("sessioncompletedtopLabel"))
self.sessioncompletedTotalTimeCompletedLabel = QtGui.QLabel(sessioncompletedDialog)
self.sessioncompletedTotalTimeCompletedLabel.setGeometry(QtCore.QRect(30, 40, 331, 20))
self.sessioncompletedTotalTimeCompletedLabel.setAlignment(QtCore.Qt.AlignCenter)
self.sessioncompletedTotalTimeCompletedLabel.setObjectName(_fromUtf8("sessioncompletedTotalTimeCompletedLabel"))
self.sessioncompletedexportQuestionLabel = QtGui.QLabel(sessioncompletedDialog)
self.sessioncompletedexportQuestionLabel.setGeometry(QtCore.QRect(30, 70, 331, 20))
self.sessioncompletedexportQuestionLabel.setAlignment(QtCore.Qt.AlignCenter)
self.sessioncompletedexportQuestionLabel.setObjectName(_fromUtf8("sessioncompletedexportQuestionLabel"))
self.horizontalLayoutWidget = QtGui.QWidget(sessioncompletedDialog)
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(210, 100, 168, 41))
self.horizontalLayoutWidget.setObjectName(_fromUtf8("horizontalLayoutWidget"))
self.sessioncompletebuttonLayout = QtGui.QHBoxLayout(self.horizontalLayoutWidget)
self.sessioncompletebuttonLayout.setMargin(0)
self.sessioncompletebuttonLayout.setObjectName(_fromUtf8("sessioncompletebuttonLayout"))
self.sessioncompleteExportYesButton = QtGui.QPushButton(self.horizontalLayoutWidget)
self.sessioncompleteExportYesButton.setObjectName(_fromUtf8("sessioncompleteExportYesButton"))
self.sessioncompletebuttonLayout.addWidget(self.sessioncompleteExportYesButton)
self.sessioncompleteExportNoButton = QtGui.QPushButton(self.horizontalLayoutWidget)
self.sessioncompleteExportNoButton.setObjectName(_fromUtf8("sessioncompleteExportNoButton"))
self.sessioncompletebuttonLayout.addWidget(self.sessioncompleteExportNoButton)
self.retranslateUi(sessioncompletedDialog)
QtCore.QMetaObject.connectSlotsByName(sessioncompletedDialog)
def retranslateUi(self, sessioncompletedDialog):
sessioncompletedDialog.setWindowTitle(_translate("sessioncompletedDialog", "Dialog", None))
self.sessioncompletedtopLabel.setText(_translate("sessioncompletedDialog", "Session Completed! Great Work!", None))
self.sessioncompletedTotalTimeCompletedLabel.setText(_translate("sessioncompletedDialog", "You Have Now Completed x Hours And x Minutes ", None))
self.sessioncompletedexportQuestionLabel.setText(_translate("sessioncompletedDialog", "Would You Like To Export This Session For Later Use?", None))
self.sessioncompleteExportYesButton.setText(_translate("sessioncompletedDialog", "YES", None))
self.sessioncompleteExportNoButton.setText(_translate("sessioncompletedDialog", "NO", None))
| 60.692308 | 156 | 0.78834 | 3,280 | 0.831432 | 0 | 0 | 0 | 0 | 0 | 0 | 737 | 0.186819 |
2637a434166fe45c22b4c9ec763b7c85c5947d98 | 8,679 | py | Python | test/test_logic.py | peteut/ramda.py | d315a9717ebd639366bf3fe26bad9e3d08ec3c49 | [
"MIT"
] | null | null | null | test/test_logic.py | peteut/ramda.py | d315a9717ebd639366bf3fe26bad9e3d08ec3c49 | [
"MIT"
] | 12 | 2017-09-03T15:25:48.000Z | 2020-04-11T15:22:01.000Z | test/test_logic.py | peteut/ramda.py | d315a9717ebd639366bf3fe26bad9e3d08ec3c49 | [
"MIT"
] | 1 | 2020-04-11T07:36:47.000Z | 2020-04-11T07:36:47.000Z | import ramda as R
from ramda.shared import eq
from .common import get_arity
import pytest
try:
from collections.abc import Callable
except ImportError:
from collections import Callable
@pytest.fixture
def odd():
return lambda n: n % 2 != 0
@pytest.fixture
def lt20():
return lambda n: n < 20
@pytest.fixture
def gt5():
return lambda n: n > 5
@pytest.fixture
def plus_eq():
return lambda w, x, y, z: w + x == y + z
@pytest.fixture
def even():
return lambda x: x % 2 == 0
@pytest.fixture
def between():
return lambda a, b, c: a < b and b < c
def describe_all_pass():
def it_reports_wheter_all_preds_are_satified(odd, lt20, gt5):
ok = R.all_pass([odd, lt20, gt5])
eq(ok(7), True)
eq(ok(9), True)
eq(ok(10), False)
eq(ok(3), False)
eq(ok(21), False)
def it_returns_true_on_empty_predicate_list():
eq(R.all_pass([])(3), True)
def it_returns_a_curried_function_whose_arity_matches(odd, gt5, plus_eq):
eq(get_arity(R.all_pass([odd, gt5, plus_eq])), 4)
eq(R.all_pass([odd, gt5, plus_eq])(9, 9, 9, 9), True)
eq(R.all_pass([odd, gt5, plus_eq])(9)(9)(9)(9), True)
def describe_any_pass():
@pytest.fixture
def gt20():
return lambda n: n > 20
@pytest.fixture
def lt5():
return lambda n: n < 5
def it_report_wheter_any_preds_are_satisfied(odd, gt20, lt5):
ok = R.any_pass([odd, gt20, lt5])
eq(ok(7), True)
eq(ok(9), True)
eq(ok(10), False)
eq(ok(18), False)
eq(ok(3), True)
eq(ok(22), True)
def it_returns_false_for_an_empty_pred_list():
eq(R.any_pass([])(3), False)
def it_returns_a_curried_function_whose_arity_matches(odd, lt5, plus_eq):
eq(get_arity(R.any_pass([odd, lt5, plus_eq])), 4)
eq(R.any_pass([odd, lt5, plus_eq])(6, 7, 8, 9), False)
eq(R.any_pass([odd, lt5, plus_eq])(6)(7)(8)(9), False)
def describe_if_else():
@pytest.fixture
def t():
return lambda a: a + 1
@pytest.fixture
def identity():
return lambda a: a
@pytest.fixture
def is_list():
return lambda a: isinstance(a, list)
def it_calls_the_truth_case_function_if_validator_returns_truthy(
identity, t):
def v(a):
return isinstance(a, int)
eq(R.if_else(v, t, identity)(10), 11)
def it_calls_the_false_case_function_if_validator_returns_falsy(
identity, t):
def v(a):
return isinstance(a, int)
eq(R.if_else(v, t, identity)("hello"), "hello")
def it_calls_the_case_on_list_items(
is_list, identity):
l = [[1, 2, 3, 4, 5], 10, [0, 1], 15]
list_to_len = R.map(R.if_else(is_list, len, identity))
eq(list_to_len(l), [5, 10, 2, 15])
def it_passes_the_argument_to_the_true_case_function(identity):
def v(*_):
return True
def on_true(a, b):
eq(a, 123)
eq(b, "abc")
R.if_else(v, on_true, identity)(123, "abc")
def it_returns_a_function_whose_arity_equals_the_max_arity():
def a0():
return 0
def a1(x):
return x
def a2(x, y):
return x + y
eq(get_arity(R.if_else(a0, a1, a2)), 2)
eq(get_arity(R.if_else(a0, a2, a1)), 2)
eq(get_arity(R.if_else(a1, a0, a2)), 2)
eq(get_arity(R.if_else(a1, a2, a0)), 2)
eq(get_arity(R.if_else(a2, a0, a1)), 2)
eq(get_arity(R.if_else(a2, a1, a0)), 2)
def it_returns_a_curried_function(t, identity):
def v(a):
return isinstance(a, int)
is_number = R.if_else(v)
eq(is_number(t, identity)(15), 16)
eq(is_number(t, identity)("hello"), "hello")
fn = R.if_else(R.gt, R.subtract, R.add)
eq(fn(2)(7), 9)
eq(fn(2, 7), 9)
eq(fn(7)(2), 5)
eq(fn(7, 2), 5)
def describe_cond():
def it_returns_a_function():
eq(isinstance(R.cond([]), Callable), True)
def it_returns_a_conditional_function():
fn = R.cond([
[R.equals(0), R.always("water freezes at 0°C")],
[R.equals(100), R.always("water boils at 100°C")],
[lambda _: True,
lambda temp: "nothing special happens at {}'°C".format(temp)]
])
eq(fn(0), "water freezes at 0°C")
eq(fn(50), "nothing special happens at 50°C")
eq(fn(100), "water boils at 100°C")
def it_returns_a_function_which_returns_none_if_none_of_the_preds_matches():
fn = R.cond([
[R.equals("foo"), R.always(1)],
[R.equals("bar"), R.always(2)]
])
eq(fn("quux"), None)
def it_predicates_are_tested_order():
fn = R.cond([
[lambda _: True, R.always("foo")],
[lambda _: True, R.always("bar")],
[lambda _: True, R.always("baz")]
])
eq(fn(), "foo")
def it_forwards_all_args_to_preds_and_to_transformers():
fn = R.cond([
[lambda _, x: x == 42, lambda *args: len(args)]
])
eq(fn(21, 42), 2)
def it_retains_highest_predicate_arity():
fn = R.cond([
[R.n_ary(2, lambda *_: True), lambda _: True],
[R.n_ary(3, lambda *_: True), lambda _: True],
[R.n_ary(1, lambda *_: True), lambda _: True]
])
eq(get_arity(fn), 3)
def describe_and_():
@pytest.fixture
def half_truth():
return R.and_(True)
def it_compares_two_values():
eq(R.and_(True, True), True)
eq(R.and_(True, False), False)
eq(R.and_(False, True), False)
eq(R.and_(False, False), False)
def it_is_curried(half_truth):
eq(half_truth(False), False)
eq(half_truth(True), True)
def describe_or_():
def it_compares_two_values():
eq(R.or_(True, True), True)
eq(R.or_(True, False), True)
eq(R.or_(False, True), True)
eq(R.or_(False, False), False)
def it_is_curried():
eq(R.or_(False)(False), False)
eq(R.or_(False)(True), True)
def describe_not_():
def it_reverses_argument():
eq(R.not_(False), True)
eq(R.not_(1), False)
eq(R.not_(""), True)
def describe_is_empty():
def it_returnns_false_for_none():
eq(R.is_empty(None), False)
def it_returns_true_for_empty_string():
eq(R.is_empty(""), True)
def it_returns_true_for_empty_list():
eq(R.is_empty([]), True)
eq(R.is_empty([[]]), False)
def it_returns_true_for_empty_dict():
eq(R.is_empty({}), True)
eq(R.is_empty({"a": 1}), False)
def describe_until():
def it_applies_fn_until_pred_is_satisfied():
eq(R.until(R.gt(R.__, 100), R.multiply(2), 1), 128)
def it_ignores_fn_if_predicate_is_always_true():
eq(R.until(lambda _: True, lambda _: True, False), False)
def describe_when():
def it_calls_the_when_true_fn_if_pred_returns_a_truthy_value():
eq(R.when(R.is_(int), R.add(1))(10), 11)
def it_returns_the_arg_if_pred_returns_a_falsy_value():
eq(R.when(R.is_(int), R.add(1))("hello"), "hello")
def it_return_a_curried_function():
if_is_number = R.when(R.is_(int))
eq(if_is_number(R.add(1))(15), 16)
eq(if_is_number(R.add(1))("hello"), "hello")
def describe_both():
@pytest.fixture
def gt10():
return lambda x: x > 10
@pytest.fixture
def total20():
return lambda a, b, c: a + b + c == 20
def it_combines_two_boolean_returning_fns_into_one(even, gt10):
f = R.both(even, gt10)
eq(f(8), False)
eq(f(13), False)
eq(f(14), True)
def it_accepts_fns_that_take_multiple_parameters(between, total20):
f = R.both(between, total20)
eq(f(4, 5, 11), True)
eq(f(12, 2, 6), False)
eq(f(5, 6, 15), False)
def it_does_short_circuit():
def f():
return False
effect = "not evaluated"
def z():
nonlocal effect
effect = "Z got evaluated"
R.both(f, z)()
eq(effect, 'not evaluated')
def it_is_curried(even, gt10):
even_and = R.both(even)
eq(even_and(gt10)(11), False)
eq(even_and(gt10)(12), True)
def describe_complement():
def it_creates_boolean_returning_fn_that_reversed_another(even):
f = R.complement(even)
eq(f(8), False)
eq(f(13), True)
def it_accepts_a_function_that_take_multiple_parameters(between):
f = R.complement(between)
eq(f(4, 5, 11), False)
eq(f(12, 2, 6), True)
| 26.460366 | 80 | 0.57449 | 0 | 0 | 0 | 0 | 906 | 0.104318 | 0 | 0 | 317 | 0.0365 |
263cf4e525b99a26c7f1cf3f1ee37f07078de9e0 | 7,168 | py | Python | src/covid19/dash_forecast.py | marhoy/covid19 | b53f7b812edea46bca6b27ac106d2363ee5d44d5 | [
"MIT"
] | null | null | null | src/covid19/dash_forecast.py | marhoy/covid19 | b53f7b812edea46bca6b27ac106d2363ee5d44d5 | [
"MIT"
] | null | null | null | src/covid19/dash_forecast.py | marhoy/covid19 | b53f7b812edea46bca6b27ac106d2363ee5d44d5 | [
"MIT"
] | null | null | null | """The dash-tab with forecast data."""
from typing import List
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objects as go
from dash.dependencies import Input, Output
import covid19.forecast
from covid19.data import DAY_ZERO_START
from .dash_app import app
tab_forecast = html.Div(
[
dbc.Row(
[
dbc.Col(
dbc.FormGroup(
[
dbc.Label("Select country"),
dcc.Dropdown(
id="forecast-country-selector",
options=covid19.dash_app.all_countries,
value="Norway",
clearable=False,
),
]
),
md=6,
),
dbc.Col(
dbc.FormGroup(
[
dbc.Label("The day when spreading is under control"),
dcc.Slider(
id="day-of-control",
min=60,
max=180,
step=10,
marks={i: f"{i}" for i in range(60, 181, 10)},
value=120,
),
]
),
md=6,
),
]
),
dbc.Row(
[
dbc.Col(
dbc.FormGroup(
[
dbc.Label("Factor of unrecorded cases"),
dcc.Slider(
id="unrecorded-factor",
min=1,
max=5,
step=1,
marks={i: f"{i}" for i in range(1, 6)},
value=3,
),
]
),
md=6,
),
dbc.Col(
dbc.FormGroup(
[
dbc.Label(
"Number of days it takes to recover from the infection"
),
dcc.Slider(
id="recovery-days",
min=5,
max=25,
step=5,
marks={i: f"{i}" for i in range(5, 26, 5)},
value=15,
),
]
),
md=6,
),
]
),
dbc.Row(
dbc.Col(
dbc.FormGroup(
[
dbc.Label("Select plot scale"),
dbc.RadioItems(
id="forecast-figure-scale",
options=[
{"value": "linear", "label": "Linear"},
{"value": "log", "label": "Logarithmic"},
],
value="linear",
),
]
),
md=6,
)
),
dbc.Row([dbc.Col(dcc.Graph(id="forecast-figure"), md=12)]),
dbc.Row(
[
dbc.Col(
[
html.H3("About the model"),
dcc.Markdown(
"""
This is how the forecast model works:
The measures taken in e.g. China and South Korea have shown that they were
able to drive the growth towards 1.0 in an exponential way.
**NB: The model assumes that the country in question is taking measures
that are as effective as the ones taken in China**
* The current growth rate is estimated by using an exponentially weighted
average of the last 7 days.
* The growth rate is assumed to converge towards 1.0 in an exponential
decay.
The speed of the decay is controlled by the parameter "Day when under
control" below.
* Patients are assumed to be ill from the day they are infected.
* They are assumed to have recovered after the number of days you specify.
"""
),
]
)
]
),
]
)
@app.callback(
Output("forecast-country-selector", "options"),
[Input("interval-component", "n_intervals")],
)
def forecast_country_selector_options(*_) -> List[dict]:
"""Scheduled update of dropdown options.
Returns:
List[dict]: All countries.
"""
return covid19.dash_app.all_countries
@app.callback(
Output("forecast-figure", "figure"),
[
Input("forecast-country-selector", "value"),
Input("day-of-control", "value"),
Input("unrecorded-factor", "value"),
Input("recovery-days", "value"),
Input("forecast-figure-scale", "value"),
],
)
def forecast_figure_figure(
country: str,
day_of_control: int,
unrecorded_factor: float,
recovery_days: int,
y_axis_type: str,
) -> go.Figure:
"""Create figure with the forecasts."""
infected = covid19.dash_app.infected
observed_data, forecast, being_ill = covid19.forecast.create_forecast(
infected[country],
day_of_control=day_of_control,
days_to_recover=recovery_days,
forecast_start=-1,
ratio_avg_days=4,
)
observed_data *= unrecorded_factor
forecast *= unrecorded_factor
being_ill *= unrecorded_factor
fig = go.Figure(
layout={
"title": "Forecast: Number of infected and ill people over time",
"xaxis": {
"title": f"Days since more that {DAY_ZERO_START}"
f" people confirmed infected"
},
"yaxis": {"type": y_axis_type},
"margin": {"l": 0, "r": 0},
}
)
fig.add_trace(
go.Scatter(
x=observed_data.index,
y=observed_data.values,
name="Currently infected",
line=dict(color="green", width=8),
mode="lines",
)
)
fig.add_trace(
go.Scatter(
x=forecast.index,
y=forecast.values,
name="Forecast infected",
line=dict(color="green", width=3, dash="dash"),
mode="lines",
)
)
fig.add_trace(
go.Scatter(
x=being_ill.index,
y=being_ill.values,
name="People being ill",
line=dict(color="orange", width=3, dash="dash"),
mode="lines",
)
)
return fig
| 32 | 87 | 0.410435 | 0 | 0 | 0 | 0 | 2,318 | 0.323382 | 0 | 0 | 1,971 | 0.274972 |
263d7e9a9f0a66a08ad20dffde0a31855dd85fee | 145 | py | Python | 1132.py | barroslipe/urionlinejudge | a20d8199d9a92b30ea394a6c949967d2fc51aa34 | [
"MIT"
] | null | null | null | 1132.py | barroslipe/urionlinejudge | a20d8199d9a92b30ea394a6c949967d2fc51aa34 | [
"MIT"
] | null | null | null | 1132.py | barroslipe/urionlinejudge | a20d8199d9a92b30ea394a6c949967d2fc51aa34 | [
"MIT"
] | null | null | null | x = int(input())
y = int(input())
if x > y:
x, y = y, x
soma = 0
for i in range(x, y + 1):
if i%13 != 0:
soma += i
print(soma) | 12.083333 | 25 | 0.448276 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
263e270fa7c082211ad5f457c9821af9b682d010 | 91 | py | Python | contract-event-listener/src/config/__init__.py | xcantera/demo-provide-baseline | 985f391973fa6ca0761104b55077fded28f152fc | [
"CC0-1.0"
] | 3 | 2020-11-17T23:19:20.000Z | 2021-03-29T15:08:56.000Z | contract-event-listener/src/config/__init__.py | xcantera/demo-provide-baseline | 985f391973fa6ca0761104b55077fded28f152fc | [
"CC0-1.0"
] | null | null | null | contract-event-listener/src/config/__init__.py | xcantera/demo-provide-baseline | 985f391973fa6ca0761104b55077fded28f152fc | [
"CC0-1.0"
] | 1 | 2020-12-11T00:26:33.000Z | 2020-12-11T00:26:33.000Z | from .schema import ( # noqa
Config,
SQSReceiver,
LogReceiver,
Receiver
)
| 13 | 29 | 0.615385 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0.065934 |
263e3167efd7fced0be59c8dcec4e3dcbfdbafc7 | 193 | py | Python | CodeForces/579A. Raising Bacteria/Raising Bacteria.py | tameemalaa/Solved-Problems | 9e8bc96eb60f200787f2682e974ec6509a7c1734 | [
"MIT"
] | null | null | null | CodeForces/579A. Raising Bacteria/Raising Bacteria.py | tameemalaa/Solved-Problems | 9e8bc96eb60f200787f2682e974ec6509a7c1734 | [
"MIT"
] | null | null | null | CodeForces/579A. Raising Bacteria/Raising Bacteria.py | tameemalaa/Solved-Problems | 9e8bc96eb60f200787f2682e974ec6509a7c1734 | [
"MIT"
] | null | null | null | # Solution by : Tameem Alaa El-Deen Sayed
n = int(input())
c= 0
while n >= 1 :
if n % 2 == 0 :
n = n /2
else:
n = n -1
n = n / 2
c = c + 1
print (c) | 16.083333 | 41 | 0.393782 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 41 | 0.212435 |
263f1ba2adc1731ba0f7b0bae1afb72287535d53 | 11,877 | py | Python | Vaccine_page/vaccine_maps_population.py | ScilifelabDataCentre/Covid_portal_vis | f41c1fe3b3d271b4d414378d622443f066a69d71 | [
"MIT"
] | null | null | null | Vaccine_page/vaccine_maps_population.py | ScilifelabDataCentre/Covid_portal_vis | f41c1fe3b3d271b4d414378d622443f066a69d71 | [
"MIT"
] | 2 | 2021-02-24T11:59:16.000Z | 2021-04-27T07:48:50.000Z | Vaccine_page/vaccine_maps_population.py | ScilifelabDataCentre/Covid_portal_vis | f41c1fe3b3d271b4d414378d622443f066a69d71 | [
"MIT"
] | 7 | 2021-02-18T14:50:03.000Z | 2021-11-11T11:41:07.000Z | import plotly.express as px
import plotly.graph_objects as go
import pandas as pd
import json
import os
from vaccine_dataprep_Swedentots import (
df_vacc_lan, # data on 1st 2 doses
third_vacc_dose_lan, # data on 3rd dose
# df_vacc_ålders_lan, # a switch to age data for 1st and second doses?
SCB_population, # raw population counts for each lan
)
# map
with open("sweden-counties.geojson", "r") as sw:
jdata = json.load(sw)
# dictionary to match data and map
counties_id_map = {}
for feature in jdata["features"]:
feature["id"] = feature["properties"]["cartodb_id"]
counties_id_map[feature["properties"]["name"]] = feature["id"]
# data to match to map (make 3 maps ultimately, with each data frame linked to a new map)
# df_vacc_lan = df_vacc_ålders_lan #if we switch, we need to do this and get rid of date stuff and switch to using totals instead
# Need to make calculation based on population data - need to match SCB population data
df_vacc_lan = pd.merge(
df_vacc_lan, SCB_population, how="left", left_on="Region", right_on="Lan"
)
df_vacc_lan["Vacc_perc_population"] = (
df_vacc_lan["Antal vaccinerade"] / df_vacc_lan["Population"]
) * 100
third_vacc_dose_lan = pd.merge(
third_vacc_dose_lan, SCB_population, how="left", left_on="Region", right_on="Lan"
)
third_vacc_dose_lan["Vacc_perc_population"] = (
third_vacc_dose_lan["Antal vaccinerade"] / third_vacc_dose_lan["Population"]
) * 100
# first two doses
one_dose_lan_pop = df_vacc_lan[
(df_vacc_lan["date"] == df_vacc_lan["date"].max())
# (df_vacc_lan["Åldersgrupp"] == "Totalt")
& (df_vacc_lan["Vaccinationsstatus"] == "Minst 1 dos")
]
one_dose_lan_pop.drop(
one_dose_lan_pop[(one_dose_lan_pop["Region"] == "Sweden")].index, inplace=True
)
one_dose_lan_pop = one_dose_lan_pop.replace("Minst 1 dos", "One dose")
two_dose_lan_pop = df_vacc_lan[
(df_vacc_lan["date"] == df_vacc_lan["date"].max())
# (df_vacc_lan["Åldersgrupp"] == "Totalt")
& (df_vacc_lan["Vaccinationsstatus"] == "Minst 2 doser")
]
two_dose_lan_pop.drop(
two_dose_lan_pop[(two_dose_lan_pop["Region"] == "Sweden")].index, inplace=True
)
two_dose_lan_pop = two_dose_lan_pop.replace("Minst 2 doser", "Two doses")
# third dose
third_vacc_dose_lan_pop = third_vacc_dose_lan[
(third_vacc_dose_lan["Åldersgrupp"] == "Totalt")
]
third_vacc_dose_lan_pop.drop(
third_vacc_dose_lan_pop[(third_vacc_dose_lan_pop["Region"] == "Sweden")].index,
inplace=True,
)
third_vacc_dose_lan_pop = third_vacc_dose_lan_pop.replace("3 doser", "Three doses")
# Tie each dataframe to the map
# one dose
one_dose_lan_pop["id"] = one_dose_lan_pop["Region"].apply(lambda x: counties_id_map[x])
# two doses
two_dose_lan_pop["id"] = two_dose_lan_pop["Region"].apply(lambda x: counties_id_map[x])
# three doses
third_vacc_dose_lan_pop["id"] = third_vacc_dose_lan_pop["Region"].apply(
lambda x: counties_id_map[x]
)
# print(one_dose_lan_pop)
# print(two_dose_lan_pop)
# print(third_vacc_dose_lan_pop)
map_colour = px.colors.diverging.RdBu
map_colour[5] = "rgb(255,255,204)"
splits = [0.00, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.0]
lat_foc = 62.45
lon_foc = 20.5
# One dose
onedose_pop_map_plot = px.choropleth(
one_dose_lan_pop,
geojson=jdata,
locations="id",
color=one_dose_lan_pop["Vacc_perc_population"],
# Below gives discrete colours for ranges
color_continuous_scale=[
(splits[0], map_colour[10]),
(splits[1], map_colour[10]),
(splits[1], map_colour[9]),
(splits[2], map_colour[9]),
(splits[2], map_colour[8]),
(splits[3], map_colour[8]),
(splits[3], map_colour[7]),
(splits[4], map_colour[7]),
(splits[4], map_colour[6]),
(splits[5], map_colour[6]),
(splits[5], map_colour[5]),
(splits[6], map_colour[5]),
(splits[6], map_colour[4]),
(splits[7], map_colour[4]),
(splits[7], map_colour[3]),
(splits[8], map_colour[3]),
(splits[8], map_colour[2]),
(splits[9], map_colour[2]),
(splits[9], map_colour[1]),
(splits[10], map_colour[1]),
],
# this keeps the range of colours constant regardless of data
range_color=[0, 100],
scope="europe",
hover_name="Region",
hover_data={
"Vacc_perc_population": ":.2f",
"Vaccinationsstatus": True, # ":.2f",
"id": False,
},
labels={
"Vacc_perc_population": "Percentage of population<br>vaccinated (%)",
"Vaccinationsstatus": "<br>Number of Doses",
},
)
# this section deals with the exact focus on the map
onedose_pop_map_plot.update_layout(
geo=dict(
lonaxis_range=[20, 90], # the logitudinal range to consider
lataxis_range=[48, 100], # the logitudinal range to consider
projection_scale=4.55, # this is kind of like zoom
center=dict(lat=lat_foc, lon=lon_foc), # this will center on the point
visible=False,
)
)
onedose_pop_map_plot.update_layout(margin={"r": 0, "t": 0, "l": 0, "b": 0})
onedose_pop_map_plot.update_layout(dragmode=False)
# The below labels the colourbar categories
onedose_pop_map_plot.update_layout(
coloraxis_colorbar=dict(
title="<b>"
+ "Percentage of population<br>vaccinated with<br>one dose"
+ "</b>",
tickvals=[5, 15, 25, 35, 45, 55, 65, 75, 85, 95],
ticktext=[
"00.00 - 9.99%",
"10.00 - 19.99%",
"20.00 - 29.99%",
"30.00 - 39.99%",
"40.00 - 49.99%",
"50.00 - 59.99%",
"60.00 - 69.99%",
"70.00 - 79.99%",
"80.00 - 89.99%",
"90.00 - 100.00%",
],
x=0.51,
y=0.40,
thicknessmode="pixels",
thickness=10,
lenmode="pixels",
len=285,
),
font=dict(size=14),
)
onedose_pop_map_plot.update_traces(marker_line_color="white")
# onedose_pop_map_plot.show()
# two doses
twodoses_pop_map_plot = px.choropleth(
two_dose_lan_pop,
geojson=jdata,
locations="id",
color=two_dose_lan_pop["Vacc_perc_population"],
# Below gives discrete colours for ranges
color_continuous_scale=[
(splits[0], map_colour[10]),
(splits[1], map_colour[10]),
(splits[1], map_colour[9]),
(splits[2], map_colour[9]),
(splits[2], map_colour[8]),
(splits[3], map_colour[8]),
(splits[3], map_colour[7]),
(splits[4], map_colour[7]),
(splits[4], map_colour[6]),
(splits[5], map_colour[6]),
(splits[5], map_colour[5]),
(splits[6], map_colour[5]),
(splits[6], map_colour[4]),
(splits[7], map_colour[4]),
(splits[7], map_colour[3]),
(splits[8], map_colour[3]),
(splits[8], map_colour[2]),
(splits[9], map_colour[2]),
(splits[9], map_colour[1]),
(splits[10], map_colour[1]),
],
# this keeps the range of colours constant regardless of data
range_color=[0, 100],
scope="europe",
hover_name="Region",
hover_data={
"Vacc_perc_population": ":.2f",
"Vaccinationsstatus": True, # ":.2f",
"id": False,
},
labels={
"Vacc_perc_population": "Percentage of population<br>vaccinated (%)",
"Vaccinationsstatus": "<br>Number of Doses",
},
)
# # this section deals with the exact focus on the map
twodoses_pop_map_plot.update_layout(
geo=dict(
lonaxis_range=[20, 90], # the logitudinal range to consider
lataxis_range=[48, 100], # the logitudinal range to consider
projection_scale=4.55, # this is kind of like zoom
center=dict(lat=lat_foc, lon=lon_foc), # this will center on the point
visible=False,
)
)
twodoses_pop_map_plot.update_layout(margin={"r": 0, "t": 0, "l": 0, "b": 0})
twodoses_pop_map_plot.update_layout(dragmode=False)
# The below labels the colourbar categories
twodoses_pop_map_plot.update_layout(
coloraxis_colorbar=dict(
title="<b>"
+ "Percentage of population<br>vaccinated with<br>two doses"
+ "</b>",
tickvals=[5, 15, 25, 35, 45, 55, 65, 75, 85, 95],
ticktext=[
"00.00 - 9.99%",
"10.00 - 19.99%",
"20.00 - 29.99%",
"30.00 - 39.99%",
"40.00 - 49.99%",
"50.00 - 59.99%",
"60.00 - 69.99%",
"70.00 - 79.99%",
"80.00 - 89.99%",
"90.00 - 100.00%",
],
x=0.51,
y=0.40,
thicknessmode="pixels",
thickness=10,
lenmode="pixels",
len=285,
),
font=dict(size=14),
)
twodoses_pop_map_plot.update_traces(marker_line_color="white")
# twodoses_pop_map_plot.show()
# three doses
threedoses_pop_map_plot = px.choropleth(
third_vacc_dose_lan_pop,
geojson=jdata,
locations="id",
color=third_vacc_dose_lan_pop["Vacc_perc_population"],
# Below gives discrete colours for ranges
color_continuous_scale=[
(splits[0], map_colour[10]),
(splits[1], map_colour[10]),
(splits[1], map_colour[9]),
(splits[2], map_colour[9]),
(splits[2], map_colour[8]),
(splits[3], map_colour[8]),
(splits[3], map_colour[7]),
(splits[4], map_colour[7]),
(splits[4], map_colour[6]),
(splits[5], map_colour[6]),
(splits[5], map_colour[5]),
(splits[6], map_colour[5]),
(splits[6], map_colour[4]),
(splits[7], map_colour[4]),
(splits[7], map_colour[3]),
(splits[8], map_colour[3]),
(splits[8], map_colour[2]),
(splits[9], map_colour[2]),
(splits[9], map_colour[1]),
(splits[10], map_colour[1]),
],
# this keeps the range of colours constant regardless of data
range_color=[0, 100],
scope="europe",
hover_name="Region",
hover_data={
"Vacc_perc_population": ":.2f",
"Vaccinationsstatus": True, # ":.2f",
"id": False,
},
labels={
"Vacc_perc_population": "Percentage of population<br>vaccinated (%)",
"Vaccinationsstatus": "<br>Number of Doses",
},
)
# this section deals with the exact focus on the map
threedoses_pop_map_plot.update_layout(
geo=dict(
lonaxis_range=[20, 90], # the logitudinal range to consider
lataxis_range=[48, 100], # the logitudinal range to consider
projection_scale=4.55, # this is kind of like zoom
center=dict(lat=lat_foc, lon=lon_foc), # this will center on the point
visible=False,
)
)
threedoses_pop_map_plot.update_layout(margin={"r": 0, "t": 0, "l": 0, "b": 0})
threedoses_pop_map_plot.update_layout(dragmode=False)
# The below labels the colourbar categories
threedoses_pop_map_plot.update_layout(
coloraxis_colorbar=dict(
title="<b>"
+ "Percentage of population<br>vaccinated with<br>three doses"
+ "</b>",
tickvals=[5, 15, 25, 35, 45, 55, 65, 75, 85, 95],
ticktext=[
"00.00 - 9.99%",
"10.00 - 19.99%",
"20.00 - 29.99%",
"30.00 - 39.99%",
"40.00 - 49.99%",
"50.00 - 59.99%",
"60.00 - 69.99%",
"70.00 - 79.99%",
"80.00 - 89.99%",
"90.00 - 100.00%",
],
x=0.51,
y=0.40,
thicknessmode="pixels",
thickness=10,
lenmode="pixels",
len=285,
),
font=dict(size=14),
)
threedoses_pop_map_plot.update_traces(marker_line_color="white")
# threedoses_pop_map_plot.show()
if not os.path.isdir("Plots/"):
os.mkdir("Plots/")
# write out FoHM graphs
onedose_pop_map_plot.write_json("Plots/onedose_pop_map.json")
twodoses_pop_map_plot.write_json("Plots/twodose_pop_map.json")
threedoses_pop_map_plot.write_json("Plots/threedose_pop_map.json")
| 31.841823 | 129 | 0.613707 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,923 | 0.330163 |
263ffe0fb0dfe081b932ef96364418b62b9cad91 | 1,520 | py | Python | regression/other/pybindgen/classes/gen.py | ExternalRepositories/shroud | 86c39d2324d947d28055f9024f52cc493eb0c813 | [
"BSD-3-Clause"
] | 73 | 2017-10-11T17:01:50.000Z | 2022-01-01T21:42:12.000Z | regression/other/pybindgen/classes/gen.py | ExternalRepositories/shroud | 86c39d2324d947d28055f9024f52cc493eb0c813 | [
"BSD-3-Clause"
] | 29 | 2018-03-21T19:34:29.000Z | 2022-02-04T18:13:14.000Z | regression/other/pybindgen/classes/gen.py | ExternalRepositories/shroud | 86c39d2324d947d28055f9024f52cc493eb0c813 | [
"BSD-3-Clause"
] | 8 | 2017-11-22T14:27:01.000Z | 2022-03-30T08:49:03.000Z | # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and
# other Shroud Project Developers.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (BSD-3-Clause)
#
########################################################################
"""
Generate a module for classes using PyBindGen
"""
import pybindgen
from pybindgen import (param, retval)
def generate(fp):
mod = pybindgen.Module('classes')
mod.add_include('"classes.hpp"')
namespace = mod.add_cpp_namespace('classes')
class1 = namespace.add_class('Class1')
class1.add_enum('DIRECTION', ['UP', 'DOWN', 'LEFT', 'RIGHT'])
# class1.add_function('AcceptEnum', None, [param('MyEnum_e', 'value')])
class1.add_instance_attribute('m_flag', 'int')
class1.add_constructor([param('int', 'flag')])
class1.add_constructor([])
class1.add_method('Method1', None, [])
sclass = namespace.add_class("Singleton", is_singleton=True)
sclass.add_method("getReference", retval("classes::Singleton&", caller_owns_return=True), [],
is_static=True)
# mod.add_class('Class1',
# memory_policy=cppclass.ReferenceCountingMethodsPolicy(
# incref_method='Ref',
# decref_method='Unref',
# peekref_method='PeekRef')
# )
# mod.add_function('DoSomething', retval('Class1 *', caller_owns_return=False), [])
mod.generate(fp)
if __name__ == '__main__':
import sys
generate(sys.stdout)
| 33.043478 | 97 | 0.623026 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 889 | 0.584868 |
26406e10e1297a7c9003be939dfb3100b8150501 | 9,995 | py | Python | stanCode_Projects/my_photoshop/blur.py | EricCheng8679/sc-projects | 85f478ecf4c04f3ee79fd4c911a7122b286aff06 | [
"MIT"
] | null | null | null | stanCode_Projects/my_photoshop/blur.py | EricCheng8679/sc-projects | 85f478ecf4c04f3ee79fd4c911a7122b286aff06 | [
"MIT"
] | null | null | null | stanCode_Projects/my_photoshop/blur.py | EricCheng8679/sc-projects | 85f478ecf4c04f3ee79fd4c911a7122b286aff06 | [
"MIT"
] | null | null | null | """
File: blur.py
-------------------------------
This file shows the original image(smiley-face.png)
first, and then its blurred image. The blur algorithm
uses the average RGB values of a pixel's nearest neighbors.
"""
from simpleimage import SimpleImage
BLURRED_SCALE = 9
def blur(old_img):
"""
:param old_img: a original image
:return: a blurred image
"""
blur_img = SimpleImage.blank(old_img.width, old_img.height)
for x in range(old_img.width):
for y in range(old_img.height):
if x == 0 and y == 0: # Upper left corner
old_pixel_00 = old_img.get_pixel(x, y) # Reference point
old_pixel_s = old_img.get_pixel(x, y + 1) # South
old_pixel_e = old_img.get_pixel(x + 1, y) # East
old_pixel_se = old_img.get_pixel(x + 1, y + 1) # Southeast
blur_pixel = blur_img.get_pixel(x, y)
blur_pixel.red = (old_pixel_00.red + old_pixel_s.red + old_pixel_e.red + old_pixel_se.red) // 4
blur_pixel.green = (old_pixel_00.green + old_pixel_s.green + old_pixel_e.green + old_pixel_se.green) \
// 4
blur_pixel.blue = (old_pixel_00.blue + old_pixel_s.blue + old_pixel_e.blue + old_pixel_se.blue) // 4
elif x == 0 and y == old_img.height - 1: # Bottom left
old_pixel_0h = old_img.get_pixel(x, y)
old_pixel_n = old_img.get_pixel(x, y - 1) # North
old_pixel_e = old_img.get_pixel(x + 1, y)
old_pixel_ne = old_img.get_pixel(x + 1, y - 1) # Northeast
blur_pixel = blur_img.get_pixel(x, y)
blur_pixel.red = (old_pixel_0h.red + old_pixel_n.red + old_pixel_e.red + old_pixel_ne.red) // 4
blur_pixel.green = (old_pixel_0h.green + old_pixel_n.green + old_pixel_e.green + old_pixel_ne.green) \
// 4
blur_pixel.blue = (old_pixel_0h.blue + old_pixel_n.blue + old_pixel_e.blue + old_pixel_ne.blue) // 4
elif x == old_img.width - 1 and y == 0: # Upper right corner
old_pixel_w0 = old_img.get_pixel(x, y)
old_pixel_s = old_img.get_pixel(x, y + 1)
old_pixel_w = old_img.get_pixel(x - 1, y) # West
old_pixel_sw = old_img.get_pixel(x - 1, y + 1) # Southwest
blur_pixel = blur_img.get_pixel(x, y)
blur_pixel.red = (old_pixel_w0.red + old_pixel_s.red + old_pixel_w.red + old_pixel_sw.red) // 4
blur_pixel.green = (old_pixel_w0.green + old_pixel_s.green + old_pixel_w.green + old_pixel_sw.green) \
// 4
blur_pixel.blue = (old_pixel_w0.blue + old_pixel_s.blue + old_pixel_w.blue + old_pixel_sw.blue) // 4
elif x == old_img.width - 1 and y == old_img.height - 1: # Bottom right corner
old_pixel_wh = old_img.get_pixel(x, y)
old_pixel_n = old_img.get_pixel(x, y - 1)
old_pixel_w = old_img.get_pixel(x - 1, y)
old_pixel_nw = old_img.get_pixel(x - 1, y - 1) # Northwest
blur_pixel = blur_img.get_pixel(x, y)
blur_pixel.red = (old_pixel_wh.red + old_pixel_n.red + old_pixel_w.red + old_pixel_nw.red) // 4
blur_pixel.green = (old_pixel_wh.green + old_pixel_n.green + old_pixel_w.green + old_pixel_nw.green) \
// 4
blur_pixel.blue = (old_pixel_wh.blue + old_pixel_n.blue + old_pixel_w.blue + old_pixel_nw.blue) // 4
elif x == 0 and y != 0 and y != old_img.height - 1: # Left side except for head and tail
old_pixel_0y = old_img.get_pixel(x, y)
old_pixel_n = old_img.get_pixel(x, y - 1)
old_pixel_s = old_img.get_pixel(x, y + 1)
old_pixel_ne = old_img.get_pixel(x + 1, y - 1)
old_pixel_e = old_img.get_pixel(x + 1, y)
old_pixel_se = old_img.get_pixel(x + 1, y + 1)
blur_pixel = blur_img.get_pixel(x, y)
blur_pixel.red = (old_pixel_0y.red + old_pixel_n.red + old_pixel_s.red + old_pixel_ne.red +
old_pixel_e.red + old_pixel_se.red) // 6
blur_pixel.green = (old_pixel_0y.green + old_pixel_n.green + old_pixel_s.green + old_pixel_ne.green +
old_pixel_e.green + old_pixel_se.green) // 6
blur_pixel.blue = (old_pixel_0y.blue + old_pixel_n.blue + old_pixel_s.blue + old_pixel_ne.blue +
old_pixel_e.blue + old_pixel_se.blue) // 6
elif y == 0 and x != 0 and x != old_img.width - 1: # Top except for head and tail
old_pixel_x0 = old_img.get_pixel(x, y)
old_pixel_w = old_img.get_pixel(x - 1, y)
old_pixel_sw = old_img.get_pixel(x - 1, y + 1)
old_pixel_s = old_img.get_pixel(x, y + 1)
old_pixel_e = old_img.get_pixel(x + 1, y)
old_pixel_se = old_img.get_pixel(x + 1, y + 1)
blur_pixel = blur_img.get_pixel(x, y)
blur_pixel.red = (old_pixel_x0.red + old_pixel_w.red + old_pixel_s.red + old_pixel_sw.red +
old_pixel_e.red + old_pixel_se.red) // 6
blur_pixel.green = (old_pixel_x0.green + old_pixel_w.green + old_pixel_s.green + old_pixel_sw.green +
old_pixel_e.green + old_pixel_se.green) // 6
blur_pixel.blue = (old_pixel_x0.blue + old_pixel_w.blue + old_pixel_s.blue + old_pixel_sw.blue +
old_pixel_e.blue + old_pixel_se.blue) // 6
elif x == old_img.width - 1 and y != 0 and y != old_img.height - 1: # right side except for head and tail
old_pixel_wy = old_img.get_pixel(x, y)
old_pixel_n = old_img.get_pixel(x, y - 1)
old_pixel_nw = old_img.get_pixel(x - 1, y - 1)
old_pixel_w = old_img.get_pixel(x - 1, y)
old_pixel_sw = old_img.get_pixel(x - 1, y + 1)
old_pixel_s = old_img.get_pixel(x, y + 1)
blur_pixel = blur_img.get_pixel(x, y)
blur_pixel.red = (old_pixel_wy.red + old_pixel_n.red + old_pixel_s.red + old_pixel_nw.red +
old_pixel_w.red + old_pixel_sw.red) // 6
blur_pixel.green = (old_pixel_wy.green + old_pixel_n.green + old_pixel_s.green + old_pixel_nw.green +
old_pixel_w.green + old_pixel_sw.green) // 6
blur_pixel.blue = (old_pixel_wy.blue + old_pixel_n.blue + old_pixel_s.blue + old_pixel_nw.blue +
old_pixel_w.blue + old_pixel_sw.blue) // 6
elif y == old_img.height - 1 and x != 0 and x != old_img.width - 1: # Bottom except for head and tail
old_pixel_xh = old_img.get_pixel(x, y)
old_pixel_w = old_img.get_pixel(x - 1, y)
old_pixel_nw = old_img.get_pixel(x - 1, y - 1)
old_pixel_n = old_img.get_pixel(x, y - 1)
old_pixel_ne = old_img.get_pixel(x + 1, y - 1)
old_pixel_e = old_img.get_pixel(x + 1, y)
blur_pixel = blur_img.get_pixel(x, y)
blur_pixel.red = (old_pixel_xh.red + old_pixel_w.red + old_pixel_nw.red + old_pixel_n.red +
old_pixel_e.red + old_pixel_ne.red) // 6
blur_pixel.green = (old_pixel_xh.green + old_pixel_w.green + old_pixel_nw.green + old_pixel_n.green +
old_pixel_e.green + old_pixel_ne.green) // 6
blur_pixel.blue = (old_pixel_xh.blue + old_pixel_w.blue + old_pixel_nw.blue + old_pixel_n.blue +
old_pixel_e.blue + old_pixel_ne.blue) // 6
else: # middle parts having 8 neighbors
old_pixel_xy = old_img.get_pixel(x, y)
old_pixel_w = old_img.get_pixel(x - 1, y)
old_pixel_nw = old_img.get_pixel(x - 1, y - 1)
old_pixel_n = old_img.get_pixel(x, y - 1)
old_pixel_ne = old_img.get_pixel(x + 1, y - 1)
old_pixel_s = old_img.get_pixel(x, y + 1)
old_pixel_sw = old_img.get_pixel(x - 1, y + 1)
old_pixel_e = old_img.get_pixel(x + 1, y)
old_pixel_se = old_img.get_pixel(x + 1, y + 1)
blur_pixel = blur_img.get_pixel(x, y)
blur_pixel.red = (old_pixel_xy.red + old_pixel_w.red + old_pixel_nw.red + old_pixel_n.red +
old_pixel_e.red + old_pixel_ne.red + old_pixel_s.red + old_pixel_sw.red +
old_pixel_se.red) // 9
blur_pixel.green = (old_pixel_xy.green + old_pixel_w.green + old_pixel_nw.green + old_pixel_n.green +
old_pixel_e.green + old_pixel_ne.green + old_pixel_s.green + old_pixel_sw.green +
old_pixel_se.green) // 9
blur_pixel.blue = (old_pixel_xy.blue + old_pixel_w.blue + old_pixel_nw.blue + old_pixel_n.blue +
old_pixel_e.blue + old_pixel_ne.blue + old_pixel_s.blue + old_pixel_sw.blue +
old_pixel_se.blue) // 9
return blur_img
def main():
"""
This program blurs a image. The practical approach is to find average values of RGB with adjacent pixels
Then,it would show the blurred one by repeating the above approach some times.
"""
old_img = SimpleImage("images/smiley-face.png")
old_img.show()
blurred_img = blur(old_img)
for i in range(BLURRED_SCALE):
blurred_img = blur(blurred_img)
blurred_img.show()
if __name__ == '__main__':
main()
| 63.66242 | 118 | 0.561681 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 862 | 0.086243 |
26406e146753c756d9c6b32ec6a428c03630d569 | 650 | py | Python | app/__init__.py | Moobusy/learnpython | a9a35dec18fcdc4238e83f881c6e308667ec7029 | [
"MIT"
] | null | null | null | app/__init__.py | Moobusy/learnpython | a9a35dec18fcdc4238e83f881c6e308667ec7029 | [
"MIT"
] | null | null | null | app/__init__.py | Moobusy/learnpython | a9a35dec18fcdc4238e83f881c6e308667ec7029 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Docer
~~~~~~
A document viewing platform.
:copyright: (c) 2015 by Docer.Org.
:license: MIT, see LICENSE for more details.
'''
from flask import Flask
from flask.ext.mongoengine import MongoEngine
from app.frontend import frontend as frontend_blueprint
from app.backend import backend as backend_blueprint
app = Flask(__name__)
app.config.from_object('config.DevelopmentConfig')
# mongodb
mongo = MongoEngine(app)
def create_app():
"""Create a flask app with a config."""
app.register_blueprint(frontend_blueprint)
app.register_blueprint(backend_blueprint, name = 'admin', url_prefix = '/admin')
return app | 24.074074 | 81 | 0.747692 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 247 | 0.38 |
2641b42023211ee1b539a62e50d934444683d94e | 953 | py | Python | main.py | ghosh-r/text_scraper_for_bengali_poems | da148a0e8680fe365d4177fe269be875b0150c5c | [
"Apache-2.0"
] | null | null | null | main.py | ghosh-r/text_scraper_for_bengali_poems | da148a0e8680fe365d4177fe269be875b0150c5c | [
"Apache-2.0"
] | null | null | null | main.py | ghosh-r/text_scraper_for_bengali_poems | da148a0e8680fe365d4177fe269be875b0150c5c | [
"Apache-2.0"
] | null | null | null | from typing import List
from sys import argv
from tqdm import tqdm
from time import sleep
from random import uniform
from bs4 import BeautifulSoup
import requests
from get_pages_urls import get_list_pages
from get_urls import get_urls_per_page
from write_poem import write_poem
def main(root_url: str,
poet_url: str,
text_file: str
) -> None:
poems_list_pages = get_list_pages(root_url=root_url, poet_url=poet_url)
poem_pages = [get_urls_per_page(page) for page in poems_list_pages]
INDIV_POEM_URLS = []
for url_group in poem_pages:
for url in url_group:
INDIV_POEM_URLS.append(url)
for indiv_poem_url in tqdm(INDIV_POEM_URLS):
random_sleep_sec = uniform(0, 5)
sleep(random_sleep_sec)
write_poem(url=indiv_poem_url, text_file=text_file)
return
if __name__ == '__main__':
main(root_url=argv[1], poet_url=argv[2], text_file=argv[3]) | 24.435897 | 75 | 0.713536 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 0.010493 |
2641f16660f596ae7a11f3f894108dc509f1b570 | 12,597 | py | Python | aliens4friends/models/tinfoilhat.py | noi-techpark/solda-aliens4friends | 65f65f4e6775405e3098b2bac3f5903ff1c56795 | [
"Apache-2.0"
] | null | null | null | aliens4friends/models/tinfoilhat.py | noi-techpark/solda-aliens4friends | 65f65f4e6775405e3098b2bac3f5903ff1c56795 | [
"Apache-2.0"
] | null | null | null | aliens4friends/models/tinfoilhat.py | noi-techpark/solda-aliens4friends | 65f65f4e6775405e3098b2bac3f5903ff1c56795 | [
"Apache-2.0"
] | null | null | null | # SPDX-FileCopyrightText: NOI Techpark <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0
import logging
from typing import List, Dict, TypeVar, Optional
from copy import deepcopy
from deepdiff import DeepDiff
from .base import BaseModel, DictModel, ModelError
from aliens4friends.commons.utils import sha1sum_str
logger = logging.getLogger(__name__)
class SourceFile(BaseModel):
def __init__(
self,
rootpath: Optional[str] = None,
relpath: Optional[str] = None,
src_uri: Optional[str] = None,
sha1_cksum: Optional[str] = None,
git_sha1: Optional[str] = None,
tags: Optional[List[str]] = None
) -> None:
self.rootpath = rootpath
self.relpath = relpath
self.src_uri = src_uri
self.sha1_cksum = sha1_cksum
self.git_sha1 = git_sha1
self.tags = tags
# TODO: a specific class for tags should be added,
# like in tinfoilhat
class FileWithSize(BaseModel):
def __init__(
self,
path: Optional[str] = None,
sha256: Optional[str] = None,
size: int = 0
) -> None:
self.path = path
self.sha256 = sha256
self.size = size
class FileContainer(BaseModel):
def __init__(
self,
file_dir: Optional[str] = None,
files: Optional[List[FileWithSize]] = None
) -> None:
self.file_dir = file_dir
self.files = FileWithSize.drilldown(files)
class DependsProvides(BaseModel):
def __init__(
self,
depends: List[str],
provides: List[str]
):
self.depends = depends
self.provides = provides
_TDependsProvidesContainer = TypeVar('_TDependsProvidesContainer', bound='DependsProvidesContainer')
class DependsProvidesContainer(DictModel):
"""DictModel for 'depends' and 'provides' of bitbake recipes; the key is the
machine name, since the same recipe, built for different machines, may have
different build dependencies
"""
subclass = DependsProvides
@staticmethod
def merge(
old: Dict[str, _TDependsProvidesContainer],
new: Dict[str, _TDependsProvidesContainer]
) -> Dict[str, _TDependsProvidesContainer]:
res = {}
ids = set(list(old) + list(new))
for id in ids:
if id in new and id in old:
logger.debug(f"{id} found in new and old, checking consistency")
diff = DeepDiff(old[id].depends, new[id].depends, ignore_order=True)
if diff:
logger.warning(
"depends mismatch for machine"
f" '{id}', diff is: {diff}"
)
new[id].provides = list(set(old[id].provides + new[id].provides))
res[id] = new[id]
elif id in new:
logger.debug(f"depends_provides for machine '{id}' found in new")
res[id] = new[id]
elif id in old:
logger.debug(f"depends_provides for machine '{id}' found in old")
res[id] = old[id]
return res
class PackageMetaData(BaseModel):
def __init__(
self,
name: Optional[str] = None,
base_name: Optional[str] = None,
version: Optional[str] = None,
revision: Optional[str] = None,
package_arch: Optional[str] = None,
recipe_name: Optional[str] = None,
recipe_version: Optional[str] = None,
recipe_revision: Optional[str] = None,
license: Optional[str] = None,
summary: Optional[str] = None,
description: Optional[str] = None,
depends: Optional[List[str]] = None,
provides: Optional[List[str]] = None
) -> None:
self.name = name
self.base_name = base_name
self.version = version
self.revision = revision
self.package_arch = package_arch
self.recipe_name = recipe_name
self.recipe_version = recipe_version
self.recipe_revision = recipe_revision
self.license = license
self.summary = summary
self.description = description
self.depends = depends
self.provides = provides
_TPackage = TypeVar('_TPackage', bound='Package')
class Package(BaseModel):
def __init__(
self,
metadata: Optional[PackageMetaData] = None,
files: Optional[FileContainer] = None,
chk_sum: Optional[str] = None
) -> None:
self.metadata = PackageMetaData.decode(metadata)
self.files = FileContainer.decode(files)
self.chk_sum = chk_sum
class PackageWithTags(BaseModel):
def __init__(
self,
package: Optional[Package] = None,
tags: Optional[List[str]] = None
) -> None:
self.package = Package.decode(package)
self.tags = tags
_TPackageContainer = TypeVar('_TPackageContainer', bound='PackageContainer')
class PackageContainer(DictModel):
subclass = PackageWithTags
@staticmethod
def merge(
old: Dict[str, _TPackageContainer],
new: Dict[str, _TPackageContainer]
) -> Dict[str, _TPackageContainer]:
res = {}
ids = set(list(old) + list(new))
for id in ids:
if id in new and id in old:
logger.debug(f"{id} found in new and old, merging")
diff = DeepDiff(
old[id],
new[id],
ignore_order=True,
exclude_paths=[
'root.tags', # here we expect differences that we want
# to merge
'root.package.files.file_dir', # specific to
# local build, needed just for aliensrc
# package creation in a previous stage;
# we expect it may be different if
# tinfoilhat files to merge have been
# generated in different local builds, but
# it doesn't matter here
]
)
if diff:
raise ModelError(
f"can't merge {id}, because some package fields"
f" mismatch, diff is: {diff}"
)
res[id] = deepcopy(new[id])
res[id].tags = list(set(old[id].tags + new[id].tags))
elif id in new and id not in old:
logger.debug(f"{id} found in new")
res[id] = new[id]
elif id not in new and id in old:
logger.debug(f"{id} found in old")
res[id] = old[id]
return res
class RecipeMetaData(BaseModel):
def __init__(
self,
name: Optional[str] = None,
base_name: Optional[str] = None,
version: Optional[str] = None,
revision: Optional[str] = None,
variant: Optional[str] = None,
author: Optional[str] = None,
homepage: Optional[str] = None,
summary: Optional[str] = None,
description: Optional[str] = None,
license: Optional[str] = None,
depends_provides: Optional[Dict[str, DependsProvides]] = None
) -> None:
self.name = name
self.base_name = base_name
self.version = version
self.revision = revision
self.variant = variant
self.author = author
self.homepage = homepage
self.summary = summary
self.description = description
self.license = license
self.depends_provides = DependsProvidesContainer.decode(depends_provides)
@staticmethod
def merge(old: 'RecipeMetaData', new: 'RecipeMetaData') -> 'RecipeMetaData':
updatable = [ "homepage", "summary", "description" ]
res = RecipeMetaData()
for attr_name in res.encode():
if attr_name in updatable:
setattr(res, attr_name, getattr(new, attr_name))
else:
setattr(res, attr_name, getattr(old, attr_name))
res.depends_provides = DependsProvidesContainer.merge(
old.depends_provides,
new.depends_provides
)
return res
class CveProduct(BaseModel):
def __init__(
self,
vendor: Optional[str] = None,
product: Optional[str] = None
):
self.vendor = vendor
self.product = product
class RecipeCveMetaData(BaseModel):
def __init__(
self,
cve_version: Optional[str] = None,
cve_version_suffix: Optional[str] = None,
cve_check_whitelist: Optional[List[str]] = None,
cve_product: Optional[List[CveProduct]] = None
):
self.cve_version = cve_version
self.cve_version_suffix = cve_version_suffix
self.cve_check_whitelist = cve_check_whitelist
self.cve_product = CveProduct.drilldown(cve_product)
@staticmethod
def merge(old: 'RecipeCveMetaData', new: 'RecipeCveMetaData') -> 'RecipeCveMetaData':
res = RecipeCveMetaData()
must_be_equal = [ 'cve_version', 'cve_version_suffix' ]
for attr_name in old.encode():
old_attr = getattr(old, attr_name)
new_attr = getattr(new, attr_name)
if old_attr == new_attr:
setattr(res, attr_name, old_attr)
elif attr_name in must_be_equal:
raise ModelError(
f"can't merge cve metadata for {old.cve_product[0].product}"
f": '{attr_name}' mismatch"
)
else:
setattr(res, attr_name, new_attr)
return res
class Recipe(BaseModel):
def __init__(
self,
metadata: Optional[RecipeMetaData] = None,
cve_metadata: Optional[RecipeCveMetaData] = None,
source_files: Optional[List[SourceFile]] = None,
chk_sum: Optional[str] = None
) -> None:
self.metadata = RecipeMetaData.decode(metadata)
self.cve_metadata = RecipeCveMetaData.decode(cve_metadata)
self.source_files = SourceFile.drilldown(source_files)
self.chk_sum = chk_sum
_TContainer = TypeVar('_TContainer', bound='Container')
class Container(BaseModel):
def __init__(
self,
recipe: Optional[Recipe] = None,
tags: Optional[List[str]] = None,
packages: Optional[Dict[str, PackageWithTags]] = None
) -> None:
self.recipe = Recipe.decode(recipe)
self.tags = tags
self.packages = PackageContainer.decode(packages)
@staticmethod
def merge(
old: Dict[str, _TContainer],
new: Dict[str, _TContainer],
) -> Dict[str, _TContainer]:
"""merge tags, packages and depends_provides of two tinfoilhat dicts in
a new tinfoilhat dict; all other attributes of the two tinfoilhat dict -
except for bitbake-specific paths - must be the same, otherwise a
ModelError exception is raised
"""
res = {}
ids = set(list(old) + list(new))
for id in ids:
if id in new and id in old:
logger.debug(f"{id} found in new and old, merging")
diff = DeepDiff(
old[id],
new[id],
ignore_order=True,
# legend for paths excluded from diff:
# (M): expected diffs that we want to merge
# (I): expected diffs that we can safely ignore (we keep the newer value)
# (U): undesirable diffs that however "happen", even if the recipe version and revision stay the same;
# we ignore them to avoid complications (we keep the newer value)
exclude_paths=[
"root.tags", # (M)
"root.packages", # (M)
"root.recipe.metadata.description", # (U)
"root.recipe.metadata.homepage", # (U)
"root.recipe.metadata.summary", # (U)
"root.recipe.metadata.depends_provides", # (I)
"root.recipe.cve_metadata", # (M)
],
exclude_regex_paths=[
r"root.recipe.source_files\[\d+\].tags", # (M)
r"root.recipe.source_files\[\d+\].src_uri", # (U)
r"root.recipe.source_files\[\d+\].rootpath", # (I)
r"root.recipe.source_files\[\d+\].relpath", # (U) # FIXME workaround, handlye filename changes instead
]
)
if diff:
raise ModelError(
f"can't merge tags and packages for recipe {id}, "
f"because some fields mismatch, diff is: {diff}"
)
res[id] = deepcopy(new[id])
res[id].tags = list(set(old[id].tags + new[id].tags))
res[id].packages = PackageContainer.merge(
old[id].packages,
new[id].packages
)
res[id].recipe.metadata = RecipeMetaData.merge(
old[id].recipe.metadata,
new[id].recipe.metadata
)
res[id].recipe.cve_metadata = RecipeCveMetaData.merge(
old[id].recipe.cve_metadata,
new[id].recipe.cve_metadata
)
old_files = {
f'{s.relpath}-{s.git_sha1 or s.sha1_cksum}': s
for s in old[id].recipe.source_files
}
new_files = {
f'{s.relpath}-{s.git_sha1 or s.sha1_cksum}': s
for s in res[id].recipe.source_files
# res[id] here is on purpose, we need to modify
# its contents by reference;
# it has been deepcopied from new[id]
}
for file_id in new_files:
if old_files.get(file_id): # FIMXE workaround (see above)
new_files[file_id].tags = list(set(
old_files[file_id].tags + new_files[file_id].tags
))
elif id in new:
logger.debug(f"{id} found in new")
res[id] = new[id]
elif id in old:
logger.debug(f"{id} found in old")
res[id] = old[id]
return res
_TTinfoilHatModel = TypeVar('_TTinfoilHatModel', bound='TinfoilHatModel')
class TinfoilHatModel(DictModel):
subclass = Container
@staticmethod
def merge(
old: _TTinfoilHatModel,
new: _TTinfoilHatModel
) -> _TTinfoilHatModel:
"""merge tags, packages and depends_provides of two tinfoilhat objects
in a new tinfoilhat object; all other attributes of the two tinfoilhat
objs - except for bitbake-specific paths - must be the same, otherwise a
ModelError exception is raised
"""
res = TinfoilHatModel({})
res._container = Container.merge(old._container, new._container)
return res
# FIXME: All merge methods here are based on one assumption:
# that the "new" tinfoilhat file is really newer than the "old"
# one, and that it containes more updated info than the "old" one.
# We should add some field ('project manifest commit date'?)
# tinfoilhat.json in order to check this
| 30.28125 | 108 | 0.688656 | 11,592 | 0.920219 | 0 | 0 | 6,517 | 0.517345 | 0 | 0 | 3,451 | 0.273954 |
2642eef0ddc241add30d3eac4bb4b4cb887bc80f | 276 | py | Python | teachers_sample_codes/spotkanie_3/01b_wheater_json.py | programujemy-python/programuj-w-zespole-test | 865f96e5be6ab4e3a7f15b9e446a1c0cbae06472 | [
"MIT"
] | 2 | 2022-01-31T20:21:18.000Z | 2022-02-22T10:54:41.000Z | teachers_materials/spotkanie_3/01b_wheater_json.py | abixadamj/Popojutrze-Progr-mujemy | d6f5a4de799a486024f799c4c392fdc1419654b8 | [
"MIT"
] | null | null | null | teachers_materials/spotkanie_3/01b_wheater_json.py | abixadamj/Popojutrze-Progr-mujemy | d6f5a4de799a486024f799c4c392fdc1419654b8 | [
"MIT"
] | 1 | 2022-03-07T11:23:58.000Z | 2022-03-07T11:23:58.000Z | # przykład wykorzystania biblioteki requests
import requests
params = {
'format': 'j1',
}
api_result = requests.get('https://wttr.in/Varsavia', params)
api_response = api_result.json()
for elem in api_response:
print(f"Klucz: {elem} ma wartość {api_response[elem]}")
| 25.090909 | 61 | 0.724638 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 133 | 0.476703 |
264442fc8af628ec3988bcd2a6d680b881abb966 | 1,327 | py | Python | Ejercicio1.py | Rauulito/EjercicioPOO | 400ebbe4395548541b5023d8a410ddfa283f88f7 | [
"Apache-2.0"
] | null | null | null | Ejercicio1.py | Rauulito/EjercicioPOO | 400ebbe4395548541b5023d8a410ddfa283f88f7 | [
"Apache-2.0"
] | null | null | null | Ejercicio1.py | Rauulito/EjercicioPOO | 400ebbe4395548541b5023d8a410ddfa283f88f7 | [
"Apache-2.0"
] | null | null | null | class Libro():
#Creamos el constructor
def __init__(self, titulo,autor,editorial,precioBase, genero, nPaginas):
self.titulo = titulo
self.autor= autor
self.editorial= editorial
self.precioBase= precioBase
self.genero= genero
self.nPaginas= nPaginas
#Metodos get y set
def setTitulo(self,titulo):
self.titulo= titulo
def setAutor(self,autor):
self.autor= autor
def setEditorial(self,editorial):
self.editorial= editorial
def setPrecioBase(self,precioBase):
self.precioBase= precioBase
def setGenero(self,genero):
self.genero= genero
def setNPaginas(self,nPaginas):
self.nPaginas= nPaginas
def getTitulo(self):
return self.titulo
def getAutor(self):
return self.autor
def getEditorial(self,editorial):
return self.editorial
def getPrecioBase(self,precioBase):
return self.precioBase
def getGenero(self):
return self.genero
def getNPaginas(self):
return self.nPaginas
libro = Libro("El Palomo","Carlos Rodriguez","Edelvives","180","Aventuras","330")
print("Titulo:"+libro.titulo,"Autor:"+libro.autor, "Editorial:"+libro.editorial,"Precio base:"+libro.precioBase,"Género:"+libro.genero,"Número de páginas:"+libro.nPaginas) | 33.175 | 171 | 0.669932 | 1,071 | 0.805263 | 0 | 0 | 0 | 0 | 0 | 0 | 177 | 0.133083 |
26445917b8f6b4bc76b5e11b529d19936fabc446 | 12,938 | py | Python | dataPrepScripts/CreateTensor.py | strixy16/Clairvoyante | 2bf60f9fc54d51518730d94cb05ffdf3a51f0176 | [
"BSD-3-Clause"
] | 171 | 2017-07-24T00:35:48.000Z | 2022-03-24T08:28:59.000Z | dataPrepScripts/CreateTensor.py | strixy16/Clairvoyante | 2bf60f9fc54d51518730d94cb05ffdf3a51f0176 | [
"BSD-3-Clause"
] | 45 | 2018-10-30T07:37:42.000Z | 2021-12-30T07:53:24.000Z | dataPrepScripts/CreateTensor.py | strixy16/Clairvoyante | 2bf60f9fc54d51518730d94cb05ffdf3a51f0176 | [
"BSD-3-Clause"
] | 27 | 2017-07-23T21:43:50.000Z | 2021-02-27T01:07:29.000Z | import os
import sys
import argparse
import os
import re
import shlex
import subprocess
import signal
import gc
import param
is_pypy = '__pypy__' in sys.builtin_module_names
def PypyGCCollect(signum, frame):
gc.collect()
signal.alarm(60)
cigarRe = r"(\d+)([MIDNSHP=X])"
base2num = dict(zip("ACGT", (0,1,2,3)))
stripe2 = 4 * param.matrixNum
stripe1 = param.matrixNum
def GenerateTensor(args, ctgName, alns, center, refSeq):
alnCode = [0] * ( (2*param.flankingBaseNum+1) * 4 * param.matrixNum )
depth = [0] * ((2 * param.flankingBaseNum + 1))
for aln in alns:
for refPos, queryAdv, refBase, queryBase in aln:
if str(refBase) not in "ACGT-":
continue
if str(queryBase) not in "ACGT-":
continue
if refPos - center >= -(param.flankingBaseNum+1) and refPos - center < param.flankingBaseNum:
offset = refPos - center + (param.flankingBaseNum+1)
if queryBase != "-":
if refBase != "-":
depth[offset] = depth[offset] + 1
alnCode[stripe2*offset + stripe1*base2num[refBase] + 0] += 1.0
alnCode[stripe2*offset + stripe1*base2num[queryBase] + 1] += 1.0
alnCode[stripe2*offset + stripe1*base2num[refBase] + 2] += 1.0
alnCode[stripe2*offset + stripe1*base2num[queryBase] + 3] += 1.0
elif refBase == "-":
idx = min(offset+queryAdv, 2*param.flankingBaseNum+1-1)
alnCode[stripe2*idx + stripe1*base2num[queryBase] + 1] += 1.0
else:
print >> sys.stderr, "Should not reach here: %s, %s" % (refBase, queryBase)
elif queryBase == "-":
if refBase != "-":
alnCode[stripe2*offset + stripe1*base2num[refBase] + 2] += 1.0
else:
print >> sys.stderr, "Should not reach here: %s, %s" % (refBase, queryBase)
else:
print >> sys.stderr, "Should not reach here: %s, %s" % (refBase, queryBase)
newRefPos = center - (0 if args.refStart == None else (args.refStart - 1))
if (newRefPos - (param.flankingBaseNum+1) >= 0) and depth[param.flankingBaseNum] >= args.minCoverage:
outputLine = "%s %d %s %s" % (ctgName, center, refSeq[newRefPos-(param.flankingBaseNum+1):newRefPos+param.flankingBaseNum], " ".join("%0.1f" % x for x in alnCode))
return outputLine
else:
return None
def GetCandidate(args, beginToEnd):
if args.can_fn != "PIPE":
f = subprocess.Popen(shlex.split("gzip -fdc %s" % (args.can_fn) ), stdout=subprocess.PIPE, bufsize=8388608)
fo = f.stdout
else:
fo = sys.stdin
for row in fo:
row = row.split()
if args.ctgName != row[0]: continue
pos = int(row[1])
if args.ctgStart != None and pos < args.ctgStart: continue
if args.ctgEnd != None and pos > args.ctgEnd: continue
if args.considerleftedge == False:
beginToEnd[ pos - (param.flankingBaseNum+1) ] = [(pos + (param.flankingBaseNum+1), pos)]
elif args.considerleftedge == True:
for i in range(pos - (param.flankingBaseNum+1), pos + (param.flankingBaseNum+1)):
if i not in beginToEnd:
beginToEnd[ i ] = [(pos + (param.flankingBaseNum+1), pos)]
else:
beginToEnd[ i ].append((pos + (param.flankingBaseNum+1), pos))
yield pos
if args.can_fn != "PIPE":
fo.close()
f.wait()
yield -1
class TensorStdout(object):
def __init__(self, handle):
self.stdin = handle
def __del__(self):
self.stdin.close()
def OutputAlnTensor(args):
availableSlots = 10000000
dcov = args.dcov
args.refStart = None; args.refEnd = None; refSeq = []; refName = None; rowCount = 0
if args.ctgStart != None and args.ctgEnd != None:
args.ctgStart += 1 # Change 0-based (BED) to 1-based (VCF and samtools faidx)
args.refStart = args.ctgStart; args.refEnd = args.ctgEnd
args.refStart -= param.expandReferenceRegion
args.refStart = 1 if args.refStart < 1 else args.refStart
args.refEnd += param.expandReferenceRegion
p1 = subprocess.Popen(shlex.split("%s faidx %s %s:%d-%d" % (args.samtools, args.ref_fn, args.ctgName, args.refStart, args.refEnd) ), stdout=subprocess.PIPE, bufsize=8388608)
else:
args.ctgStart = args.ctgEnd = None
p1 = subprocess.Popen(shlex.split("%s faidx %s %s" % (args.samtools, args.ref_fn, args.ctgName) ), stdout=subprocess.PIPE, bufsize=8388608)
for row in p1.stdout:
if rowCount == 0:
refName = row.rstrip().lstrip(">")
else:
refSeq.append(row.rstrip())
rowCount += 1
refSeq = "".join(refSeq)
p1.stdout.close()
p1.wait()
if p1.returncode != 0 or len(refSeq) == 0:
print >> sys.stderr, "Failed to load reference seqeunce. Please check if the provided reference fasta %s and the ctgName %s are correct." % (args.ref_fn, args.ctgName)
sys.exit(1)
beginToEnd = {}
canPos = 0
canGen = GetCandidate(args, beginToEnd)
p2 = subprocess.Popen(shlex.split("%s view -F 2308 %s %s:%d-%d" % (args.samtools, args.bam_fn, args.ctgName, args.ctgStart, args.ctgEnd) ), stdout=subprocess.PIPE, bufsize=8388608)\
if args.ctgStart != None and args.ctgEnd != None\
else subprocess.Popen(shlex.split("%s view -F 2308 %s %s" % (args.samtools, args.bam_fn, args.ctgName) ), stdout=subprocess.PIPE, bufsize=8388608)
centerToAln = {}
if args.tensor_fn != "PIPE":
tensor_fpo = open(args.tensor_fn, "wb")
tensor_fp = subprocess.Popen(shlex.split("gzip -c"), stdin=subprocess.PIPE, stdout=tensor_fpo, stderr=sys.stderr, bufsize=8388608)
else:
tensor_fp = TensorStdout(sys.stdout)
#if is_pypy:
# signal.signal(signal.SIGALRM, PypyGCCollect)
# signal.alarm(60)
previousPos = 0; depthCap = 0
for l in p2.stdout:
l = l.split()
if l[0][0] == "@":
continue
QNAME = l[0]
FLAG = int(l[1])
RNAME = l[2]
POS = int(l[3]) - 1 # switch from 1-base to 0-base to match sequence index
MQ = int(l[4])
CIGAR = l[5]
SEQ = l[9]
refPos = POS
queryPos = 0
if MQ < args.minMQ:
continue
endToCenter = {}
activeSet = set()
while canPos != -1 and canPos < (POS + len(SEQ) + 100000):
canPos = next(canGen)
if previousPos != POS:
previousPos = POS
depthCap = 0
else:
depthCap += 1
if depthCap >= dcov:
#print >> sys.stderr, "Bypassing POS %d at depth %d\n" % (POS, depthCap)
continue
for m in re.finditer(cigarRe, CIGAR):
if availableSlots == 0:
break
advance = int(m.group(1))
if m.group(2) == "S":
queryPos += advance
if m.group(2) in ("M", "=", "X"):
for i in xrange(advance):
if refPos in beginToEnd:
for rEnd, rCenter in beginToEnd[refPos]:
if rCenter in activeSet:
continue
endToCenter[rEnd] = rCenter
activeSet.add(rCenter)
centerToAln.setdefault(rCenter, [])
centerToAln[rCenter].append([])
for center in list(activeSet):
if availableSlots != 0:
availableSlots -= 1
centerToAln[center][-1].append( (refPos, 0, refSeq[refPos - (0 if args.refStart == None else (args.refStart - 1))], SEQ[queryPos] ) )
if refPos in endToCenter:
center = endToCenter[refPos]
activeSet.remove(center)
refPos += 1
queryPos += 1
elif m.group(2) == "I":
queryAdv = 0
for i in range(advance):
for center in list(activeSet):
if availableSlots != 0:
availableSlots -= 1
centerToAln[center][-1].append( (refPos, queryAdv, "-", SEQ[queryPos] ))
queryPos += 1
queryAdv += 1
elif m.group(2) == "D":
for i in xrange(advance):
for center in list(activeSet):
if availableSlots != 0:
availableSlots -= 1
centerToAln[center][-1].append( (refPos, 0, refSeq[refPos - (0 if args.refStart == None else (args.refStart - 1))], "-" ))
if refPos in beginToEnd:
for rEnd, rCenter in beginToEnd[refPos]:
if rCenter in activeSet:
continue
endToCenter[rEnd] = rCenter
activeSet.add(rCenter)
centerToAln.setdefault(rCenter, [])
centerToAln[rCenter].append([])
if refPos in endToCenter:
center = endToCenter[refPos]
activeSet.remove(center)
refPos += 1
if depthCap == 0:
for center in centerToAln.keys():
if center + (param.flankingBaseNum+1) < POS:
l = GenerateTensor(args, args.ctgName, centerToAln[center], center, refSeq)
if l != None:
tensor_fp.stdin.write(l)
tensor_fp.stdin.write("\n")
availableSlots += sum(len(i) for i in centerToAln[center])
#print >> sys.stderr, "POS %d: remaining slots %d" % (center, availableSlots)
del centerToAln[center]
for center in centerToAln.keys():
l = GenerateTensor(args, args.ctgName, centerToAln[center], center, refSeq)
if l != None:
tensor_fp.stdin.write(l)
tensor_fp.stdin.write("\n")
p2.stdout.close()
p2.wait()
if args.tensor_fn != "PIPE":
tensor_fp.stdin.close()
tensor_fp.wait()
tensor_fpo.close()
def main():
parser = argparse.ArgumentParser(
description="Generate tensors summarizing local alignments from a BAM file and a list of candidate locations" )
parser.add_argument('--bam_fn', type=str, default="input.bam",
help="Sorted bam file input, default: %(default)s")
parser.add_argument('--ref_fn', type=str, default="ref.fa",
help="Reference fasta file input, default: %(default)s")
parser.add_argument('--can_fn', type=str, default="PIPE",
help="Variant candidate list generated by ExtractVariantCandidates.py or true variant list generated by GetTruth.py, use PIPE for standard input, default: %(default)s")
parser.add_argument('--tensor_fn', type=str, default="PIPE",
help="Tensor output, use PIPE for standard output, default: %(default)s")
parser.add_argument('--minMQ', type=int, default=0,
help="Minimum Mapping Quality. Mapping quality lower than the setting will be filtered, default: %(default)d")
parser.add_argument('--ctgName', type=str, default="chr17",
help="The name of sequence to be processed, default: %(default)s")
parser.add_argument('--ctgStart', type=int, default=None,
help="The 1-bsae starting position of the sequence to be processed")
parser.add_argument('--ctgEnd', type=int, default=None,
help="The inclusive ending position of the sequence to be processed")
parser.add_argument('--samtools', type=str, default="samtools",
help="Path to the 'samtools', default: %(default)s")
parser.add_argument('--considerleftedge', type=param.str2bool, nargs='?', const=True, default=True,
help="Count the left-most base-pairs of a read for coverage even if the starting position of a read is after the starting position of a tensor, default: %(default)s")
parser.add_argument('--dcov', type=int, default=250,
help="Cap depth per position at %(default)d")
parser.add_argument('--minCoverage', type=int, default=0,
help="Minimum coverage required to generate a tensor, default: %(default)d")
args = parser.parse_args()
if len(sys.argv[1:]) == 0:
parser.print_help()
sys.exit(1)
OutputAlnTensor(args)
if __name__ == "__main__":
main()
| 41.335463 | 185 | 0.552713 | 138 | 0.010666 | 1,085 | 0.083861 | 0 | 0 | 0 | 0 | 2,048 | 0.158293 |
26461c895574afc6d2e5c0139208bf8be78b66bf | 2,405 | py | Python | setup.py | ssjunnebo/MultiQC_NGI | 1ca18747256324f1ddcb9ecd68159b2114718e71 | [
"MIT"
] | 3 | 2017-02-03T14:18:30.000Z | 2019-10-24T14:57:57.000Z | setup.py | ssjunnebo/MultiQC_NGI | 1ca18747256324f1ddcb9ecd68159b2114718e71 | [
"MIT"
] | 27 | 2015-10-16T16:20:10.000Z | 2017-07-03T14:28:40.000Z | setup.py | ssjunnebo/MultiQC_NGI | 1ca18747256324f1ddcb9ecd68159b2114718e71 | [
"MIT"
] | 8 | 2016-04-20T10:33:29.000Z | 2021-03-25T09:01:58.000Z | #!/usr/bin/env python
"""
MultiQC_NGI is a plugin for MultiQC, providing additional tools which are
specific to the National Genomics Infrastructure at the Science for Life
Laboratory in Stockholm, Sweden.
For more information about NGI, see http://www.scilifelab.se/platforms/ngi/
For more information about MultiQC, see http://multiqc.info
"""
from setuptools import setup, find_packages
version = '0.6.3'
setup(
name = 'multiqc_ngi',
version = version,
author = 'Phil Ewels',
author_email = '[email protected]',
description = "MultiQC plugin for the National Genomics Infrastructure @ SciLifeLab Sweden",
long_description = __doc__,
keywords = 'bioinformatics',
url = 'https://github.com/ewels/MultiQC_NGI',
download_url = 'https://github.com/ewels/MultiQC_NGI/releases',
license = 'MIT',
packages = find_packages(),
include_package_data = True,
install_requires = [
'couchdb',
'simplejson',
'pyyaml',
'requests',
'multiqc'
],
entry_points = {
'multiqc.templates.v1': [
'ngi = multiqc_ngi.templates.ngi',
'genstat = multiqc_ngi.templates.genstat',
],
'multiqc.cli_options.v1': [
'disable = multiqc_ngi.cli:disable_ngi',
'project = multiqc_ngi.cli:pid_option',
'push_statusdb = multiqc_ngi.cli:push_flag',
'test_db = multiqc_ngi.cli:test_db'
],
'multiqc.hooks.v1': [
'before_config = multiqc_ngi.multiqc_ngi:multiqc_ngi_config',
'before_report_generation = multiqc_ngi.multiqc_ngi:ngi_metadata',
'execution_finish = multiqc_ngi.multiqc_ngi:ngi_after_execution_finish'
]
},
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Environment :: Web Environment',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX',
'Operating System :: Unix',
'Programming Language :: Python',
'Programming Language :: JavaScript',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Visualization',
],
)
| 34.855072 | 96 | 0.63368 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,613 | 0.670686 |
2648b74d5b48d2d6ff54adeaeb4a4c006edab254 | 3,106 | py | Python | utils/emails.py | rajattomar1301/HomeWorks-Initial | be7e6b6db2f7cf414a1f488e2efc473a95d9338a | [
"MIT"
] | null | null | null | utils/emails.py | rajattomar1301/HomeWorks-Initial | be7e6b6db2f7cf414a1f488e2efc473a95d9338a | [
"MIT"
] | 6 | 2021-03-18T22:07:14.000Z | 2022-03-11T23:39:30.000Z | utils/emails.py | rajattomar1301/HomeWorks-Initial | be7e6b6db2f7cf414a1f488e2efc473a95d9338a | [
"MIT"
] | null | null | null | import re
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
domain = "127.0.0.1"
def send_email(to, subject, text):
fromaddr = "[email protected]"
toaddr = to
msg = MIMEMultipart()
msg['From'] = fromaddr
msg['To'] = toaddr
msg['Subject'] = subject
body = text
msg.attach(MIMEText(body, 'plain'))
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login(fromaddr, "mithereicome@91")
text = msg.as_string()
server.sendmail(fromaddr, toaddr, text)
server.quit()
def send_confirmation_email(user_email,user_name, confirmation_key):
send_email(user_email, "Welcome to HomeWorks by Dewan!",
"""Hello {}!, and thanks for registering with {}!
We are really happy that you choose to be a part of our site
Please click the below link to confirm your email with us:
{}/confirm_email_link/{}/
Once you've done that, your account will be enabled, and you will be able to access everything that is available with us
If you didn't register an account, then you can disregard this email.
Regards
Rajat Tomar
Founder & Creator
([email protected])""".format(user_name,"HomeWorks By Dewan",domain , confirmation_key))
def send_new_homework_email(user_email, user_name, teacher_name, subject, deadline):
send_email(user_email, "New HomeWork By {}".format(teacher_name),
"""Hey {}
I know this is probably bad news for ya but your {} teacher gave you a new homework to do.
It's due by {} so you better hurry fella!
It was awesome talking to you!
Happy Homeworking!
Regards
Rajat Tomar
System Admin and Creator
([email protected])""".format(user_name, subject, deadline))
def send_welcome_email(user_email, user_name, provider):
send_email(user_email, "Welcome To HomeWorks By Dewan",
"""Hey {}
I would like to take the opportunity of thanking you for signing up on our platform using your {} credentials.
There are a lot of things for you to explore so I suggest you get right on them :)
Once again welcome aboard sailor!
It was awesome talking to you!
Happy Homeworking!
Regards
Rajat Tomar
System Admin and Creator
([email protected])""".format(user_name, provider))
def send_query_email(name, email, phone, regard, query):
send_email("[email protected]", "New query from {}".format(name),"""Hey Rajat,
You have a new query from {} their email id is: {} and phone number is: {}
It's reagarding {} and they say:
{}
Thanks!
""".format(name, email, phone, regard, query))
def send_reset_email(email, name, conf_key):
send_email(email, "You requested for a new password!","""
Hey {}!
We see that you requested for your password to be changed!
Please click the below link for changing your password:
{}/reset-password-page/{}/{}/
Please note that the above link is valid only for one time use""".format(name,domain,email, conf_key))
def is_valid_email(email):
if len(email) > 7:
if re.match("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$", email) != None:
return 1
return 0
| 31.06 | 120 | 0.716355 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,805 | 0.581133 |
264a808d413bbf67e35dd4e04d0a267eaeacb3ac | 200 | py | Python | thinkpython_allen_downey/exercise_12_1.py | alirkaya/programming-textbook-solutions | 7362dce474b8a881d654f95604e09d1d0e76aec2 | [
"MIT"
] | null | null | null | thinkpython_allen_downey/exercise_12_1.py | alirkaya/programming-textbook-solutions | 7362dce474b8a881d654f95604e09d1d0e76aec2 | [
"MIT"
] | null | null | null | thinkpython_allen_downey/exercise_12_1.py | alirkaya/programming-textbook-solutions | 7362dce474b8a881d654f95604e09d1d0e76aec2 | [
"MIT"
] | null | null | null | def sumall(*args):
count = 0
for arg in args:
count += arg
return count
print(sumall(1,2,3,4,4,5,6,7))
print(sumall(1,2,34))
numbers = 1,2,3,4,5,6,6,7,8,9
print(sumall(*numbers))
| 18.181818 | 30 | 0.595 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
264bbde1a1bee4dd16c481cd8e4f5f7b7eedcd79 | 2,369 | py | Python | casino/src/bet.py | gauravvazirani/ooad | f00abd7fee54de8599a96254d9cffac20a3bb3aa | [
"MIT"
] | null | null | null | casino/src/bet.py | gauravvazirani/ooad | f00abd7fee54de8599a96254d9cffac20a3bb3aa | [
"MIT"
] | null | null | null | casino/src/bet.py | gauravvazirani/ooad | f00abd7fee54de8599a96254d9cffac20a3bb3aa | [
"MIT"
] | null | null | null | class Bet():
def __init__(self, amount, outcome, player=None):
self.amount = amount
self.outcome = outcome
self.player = player
def setOutcome(self, outcome):
"""
Sets the Outcome for this bet.
This has the effect of moving the bet to another Outcome.
"""
self.outcome = outcome
def price(self):
"""
Computes the price for this bet.
For most bets, the price is the amount.
Subclasses can override this to handle special cases.
"""
return self.amount
def winAmount(self):
"""
Calculates the Amount won in a bet
in case the Outcome of the Game is favourable.
"""
return self.outcome.winAmount(self.amount) + self.amount
def loseAmount(self):
"""
Calculates the Amount lost in a bet.
"""
return self.amount
def __str__(self):
"""
Returns a minimal description of the Bet made.
"""
return f"{self.amount} on {self.outcome.name}"
def __repr__(self):
"""
Returns the string representation of the Bet.
"""
return f"Bet({self.amount}, {self.outcome.name})"
class CommissionBet(Bet):
def __init__(self, amount, outcome, player):
super().__init__(amount, outcome, player)
self.vig = 0.05
def price(self):
"""
There are two variations of commission bets : Buy bets and Lay bets.
A Buy bet is a right bet; it has a numerator greater than or equal to the denominator,
the price is 5% of the amount bet. A $20 Buy bet has a price of $21.
A Lay bet is a wrong bet; it has a denominator greater than the numerator,
the price is 5% of num/den of the amount.
A $30 bet Layed at 2:3 odds has a price of $31,
the $30 bet, plus the vig of 5% of $20 payout.
"""
if self.outcome.odds.numerator >= self.outcome.odds.denominator:
commission = self.vig * self.amount
else:
commission = (self.vig
* self.amount
* self.outcome.odds.numerator
/ self.outcome.odds.denominator)
return self.amount + round(commission,2)
| 32.013514 | 95 | 0.557197 | 2,337 | 0.986492 | 0 | 0 | 0 | 0 | 0 | 0 | 1,214 | 0.512453 |
264d60d6576e248900b90821956e258de5d4ec82 | 866 | py | Python | core/admin.py | isGroba/petLost | 582851481a80c2e4645425d6b27830e2b7d44376 | [
"MIT"
] | 4 | 2017-06-16T11:19:56.000Z | 2018-12-20T10:06:51.000Z | core/admin.py | isGroba/petLost | 582851481a80c2e4645425d6b27830e2b7d44376 | [
"MIT"
] | 4 | 2017-06-06T10:36:32.000Z | 2017-06-11T20:26:47.000Z | core/admin.py | isGroba/petLost | 582851481a80c2e4645425d6b27830e2b7d44376 | [
"MIT"
] | 3 | 2017-06-06T06:54:48.000Z | 2018-10-11T22:32:27.000Z | from django.contrib import admin
from .models import Color, Pet, Publication
class PublicationAdmin(admin.ModelAdmin):
fields = ['title', 'description', 'pet', 'member']
search_fields = ['title', 'breed']
list_display = ('title', 'description', 'pet', 'date')
list_filter = ['date']
class PetAdmin(admin.ModelAdmin):
fields = ['name', 'type_animal', 'breed', 'description', 'color', 'picture', 'location']
search_fields = ['name', 'breed']
list_display = ('name', 'type_animal', 'breed', 'description', 'location')
list_filter = ['type_animal', 'breed']
class ColorAdmin(admin.ModelAdmin):
fields = ['name', 'code_color']
search_fields = ['name']
list_display = ('name', 'code_color')
admin.site.register(Pet, PetAdmin)
admin.site.register(Publication, PublicationAdmin)
admin.site.register(Color, ColorAdmin)
| 27.0625 | 92 | 0.67552 | 652 | 0.752887 | 0 | 0 | 0 | 0 | 0 | 0 | 273 | 0.315242 |
264fec7de161d7ec6768ac23aa7065cdd2a16bae | 1,781 | py | Python | newsplease/pipeline/extractor/extractors/beautifulsoup_extractor.py | JamilHossain/news-please | 6c7fb001a24f0db80dd4f2cd7f3957a7fe284dcf | [
"Apache-2.0"
] | null | null | null | newsplease/pipeline/extractor/extractors/beautifulsoup_extractor.py | JamilHossain/news-please | 6c7fb001a24f0db80dd4f2cd7f3957a7fe284dcf | [
"Apache-2.0"
] | null | null | null | newsplease/pipeline/extractor/extractors/beautifulsoup_extractor.py | JamilHossain/news-please | 6c7fb001a24f0db80dd4f2cd7f3957a7fe284dcf | [
"Apache-2.0"
] | null | null | null | from copy import deepcopy
from bs4 import BeautifulSoup
from .abstract_extractor import AbstractExtractor
from ..article_candidate import ArticleCandidate
class ReadabilityExtractor(AbstractExtractor):
"""This class implements Readability as an article extractor. Readability is
a subclass of Extractors and newspaper.Article.
"""
def __init__(self):
self.name = "beautifulsoup"
def extract(self, item):
"""Creates an readability document and returns an ArticleCandidate containing article title and text.
:param item: A NewscrawlerItem to parse.
:return: ArticleCandidate containing the recovered article data.
"""
description = None
doc = BeautifulSoup(item['spider_response'].body,'html.parser')
article = doc.find_all('article')
if article:
description = article[0].get_text()
f = open("log.log","a")
f.write("BeautifulSoup: \r\n")
if description is not None:
f.write(description)
f.write("\r\n")
if self._text(item) is not None:
f.write("TEXT: " + self._text(item))
f.close()
text = self._text(item)
if text is None:
text = description
article_candidate = ArticleCandidate()
article_candidate.extractor = self._name
#article_candidate.title = doc.short_title()
article_candidate.description = description
article_candidate.text = text
article_candidate.topimage = self._topimage(item)
article_candidate.author = self._author(item)
article_candidate.publish_date = self._publish_date(item)
article_candidate.language = self._language(item)
return article_candidate
| 32.381818 | 109 | 0.658057 | 1,621 | 0.910163 | 0 | 0 | 0 | 0 | 0 | 0 | 518 | 0.290848 |
26501096fb0d6e0fc4401d923fa758cce0b9b091 | 853 | py | Python | entity/cards/LETL_017H/LETL_306.py | x014/lushi_script | edab2b88e3f0de8139de2541ab2daa331f777c0e | [
"MIT"
] | 102 | 2021-10-20T09:06:39.000Z | 2022-03-28T13:35:11.000Z | entity/cards/LETL_017H/LETL_306.py | x014/lushi_script | edab2b88e3f0de8139de2541ab2daa331f777c0e | [
"MIT"
] | 98 | 2021-10-19T16:13:27.000Z | 2022-03-27T13:27:49.000Z | entity/cards/LETL_017H/LETL_306.py | x014/lushi_script | edab2b88e3f0de8139de2541ab2daa331f777c0e | [
"MIT"
] | 55 | 2021-10-19T03:56:50.000Z | 2022-03-25T08:25:26.000Z | # -*- coding: utf-8 -*-
from hearthstone.entities import Entity
from entity.spell_entity import SpellEntity
class LETL_306(SpellEntity):
"""
冰风暴5
随机对3个敌方佣兵造成$6点伤害,并使其下回合的速度值减慢(2)点。0随机对3个敌方佣兵造成$7点伤害,并使其下回合的速度值减慢(2)点。0随机对3个敌方佣兵造成$8点伤害,并使其下回合的速度值减慢(2)点。0随机对3个敌方佣兵造成$9点伤害,并使其下回合的速度值减慢(2)点。0随机对3个敌方佣兵造成$10点伤害,并使其下回合的速度值减慢(2)点。
"""
def __init__(self, entity: Entity):
super().__init__(entity)
self.damage = 6
self.range = 3
def play(self, game, hero, target):
power = game.get_spell_power(self.spell_school, hero.own)
hero_list = game.get_hero_list(not hero.own())
for i, h in enumerate(hero_list):
if i >= 3:
break
h.got_damage(game, (self.damage + power) * self.damage_advantage[self.lettuce_role][
h.lettuce_role])
| 32.807692 | 183 | 0.644783 | 1,047 | 0.903365 | 0 | 0 | 0 | 0 | 0 | 0 | 537 | 0.46333 |
2650e879784fe541700fd39b00cc82a607be51e1 | 2,546 | py | Python | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/12_features/numtrees_20/rule_16.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/12_features/numtrees_20/rule_16.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/12_features/numtrees_20/rule_16.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Gender, obj[4]: Age, obj[5]: Education, obj[6]: Occupation, obj[7]: Bar, obj[8]: Coffeehouse, obj[9]: Restaurant20to50, obj[10]: Direction_same, obj[11]: Distance
# {"feature": "Restaurant20to50", "instances": 51, "metric_value": 0.9526, "depth": 1}
if obj[9]<=1.0:
# {"feature": "Coupon", "instances": 32, "metric_value": 0.7579, "depth": 2}
if obj[2]<=3:
# {"feature": "Bar", "instances": 25, "metric_value": 0.5294, "depth": 3}
if obj[7]<=0.0:
# {"feature": "Occupation", "instances": 13, "metric_value": 0.7793, "depth": 4}
if obj[6]>5:
# {"feature": "Coffeehouse", "instances": 7, "metric_value": 0.9852, "depth": 5}
if obj[8]>0.0:
# {"feature": "Time", "instances": 5, "metric_value": 0.7219, "depth": 6}
if obj[1]>0:
return 'True'
elif obj[1]<=0:
# {"feature": "Gender", "instances": 2, "metric_value": 1.0, "depth": 7}
if obj[3]<=0:
return 'True'
elif obj[3]>0:
return 'False'
else: return 'False'
else: return 'True'
elif obj[8]<=0.0:
return 'False'
else: return 'False'
elif obj[6]<=5:
return 'True'
else: return 'True'
elif obj[7]>0.0:
return 'True'
else: return 'True'
elif obj[2]>3:
# {"feature": "Time", "instances": 7, "metric_value": 0.9852, "depth": 3}
if obj[1]>0:
# {"feature": "Occupation", "instances": 4, "metric_value": 0.8113, "depth": 4}
if obj[6]<=20:
return 'True'
elif obj[6]>20:
return 'False'
else: return 'False'
elif obj[1]<=0:
return 'False'
else: return 'False'
else: return 'False'
elif obj[9]>1.0:
# {"feature": "Time", "instances": 19, "metric_value": 0.9495, "depth": 2}
if obj[1]<=3:
# {"feature": "Coupon", "instances": 16, "metric_value": 0.8113, "depth": 3}
if obj[2]<=2:
# {"feature": "Occupation", "instances": 10, "metric_value": 0.469, "depth": 4}
if obj[6]>4:
return 'False'
elif obj[6]<=4:
# {"feature": "Age", "instances": 3, "metric_value": 0.9183, "depth": 5}
if obj[4]>2:
return 'False'
elif obj[4]<=2:
return 'True'
else: return 'True'
else: return 'False'
elif obj[2]>2:
# {"feature": "Distance", "instances": 6, "metric_value": 1.0, "depth": 4}
if obj[11]<=2:
return 'False'
elif obj[11]>2:
return 'True'
else: return 'True'
else: return 'False'
elif obj[1]>3:
return 'True'
else: return 'True'
else: return 'False'
| 34.876712 | 243 | 0.558916 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,476 | 0.579733 |
26532987010eba65d4709e37e7fe8bdb8b2276d8 | 346 | py | Python | gravityinfraredco2sensor/__init__.py | osoken/py-gravity-infrared-co2-sensor | 242885e16d2bb0c43d8abbb9807f9932c8209427 | [
"MIT"
] | 1 | 2020-12-28T06:25:25.000Z | 2020-12-28T06:25:25.000Z | gravityinfraredco2sensor/__init__.py | osoken/py-gravity-infrared-co2-sensor | 242885e16d2bb0c43d8abbb9807f9932c8209427 | [
"MIT"
] | null | null | null | gravityinfraredco2sensor/__init__.py | osoken/py-gravity-infrared-co2-sensor | 242885e16d2bb0c43d8abbb9807f9932c8209427 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__description__ = 'Python driver and logging app ' +\
'for Gravity infrared CO2 sensor'
__long_description__ = 'Python driver and logging app ' +\
'for Gravity infrared CO2 sensor'
__author__ = 'osoken'
__email__ = '[email protected]'
__version__ = '0.0.0'
__package_name__ = 'gravityinfraredco2sensor'
| 23.066667 | 58 | 0.716763 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 219 | 0.632948 |
2653fcf693b549d95fda5d96dd6ca0e935afb6e0 | 1,414 | py | Python | src/main.py | fortytw0/vizwiz | 36563806d9bf13c8924577141b02bd2552aa48d6 | [
"MIT"
] | null | null | null | src/main.py | fortytw0/vizwiz | 36563806d9bf13c8924577141b02bd2552aa48d6 | [
"MIT"
] | null | null | null | src/main.py | fortytw0/vizwiz | 36563806d9bf13c8924577141b02bd2552aa48d6 | [
"MIT"
] | null | null | null | import os
import time
from src.models.model1 import CBD
from src.utils.train_utils import TrainGenerator
from tensorflow.keras import losses, optimizers, callbacks
train_data = TrainGenerator('train')
val_data = TrainGenerator('val')
epochs = 10
model_dir = 'models/'
log_dir = 'logs/'
cbd = CBD('models/', 'logs/')
cbd.model.summary()
print('Compiling model : ')
cbd.model.compile(loss=losses.BinaryCrossentropy(), optimizer=optimizers.Adam())
print('Succesfully compiled model')
model_ckpt = callbacks.ModelCheckpoint(os.path.join(model_dir, '{epoch:02d}-{val_loss:.2f}.hdf5'))
csv_logging = callbacks.CSVLogger(os.path.join(log_dir, 'train_{}.log'.format(time.time())))
[print(i.shape, i.dtype) for i in cbd.model.inputs]
[print(o.shape, o.dtype) for o in cbd.model.outputs]
generator = train_data.generator()
X, Y = next(generator)
print(X[0].shape)
print(X[1].shape)
print(Y.shape)
cbd.model.predict(X, batch_size=32)
# cbd.model.fit(x=train_data.generator())
# history = cbd.model.fit(x=train_data.generator(),
# batch_size=train_data.batch_size,
# steps_per_epoch=train_data.steps_per_epoch,
# callbacks= [model_ckpt, csv_logging],
# epochs=epochs,
# validation_data=val_data.generator(),
# validation_batch_size=val_data.batch_size,
# validation_steps=val_data.steps_per_epoch)
# print(type(history)) | 26.185185 | 98 | 0.710042 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 602 | 0.425743 |
265421a849a89a636ad43bddadaa5357b6a066c0 | 1,142 | py | Python | models/PSim_net.py | PoChunChen1012/synthesizing_human_like_sketches | ec2ba76cda3f658c21b5484bd478e0d4cee52fc6 | [
"MIT"
] | 46 | 2020-03-13T14:30:35.000Z | 2021-12-19T11:55:31.000Z | models/PSim_net.py | PoChunChen1012/synthesizing_human_like_sketches | ec2ba76cda3f658c21b5484bd478e0d4cee52fc6 | [
"MIT"
] | 2 | 2020-07-17T07:48:35.000Z | 2020-10-16T15:35:30.000Z | models/PSim_net.py | PoChunChen1012/synthesizing_human_like_sketches | ec2ba76cda3f658c21b5484bd478e0d4cee52fc6 | [
"MIT"
] | 2 | 2020-03-20T18:50:52.000Z | 2021-12-06T04:03:01.000Z | import torch.nn as nn
from models.PSim_alexnet import PSim_Alexnet
import torch
from utils import utils
class PSimNet(nn.Module):
"""Pre-trained network with all channels equally weighted by default (cosine similarity)"""
def __init__(self, device=torch.device("cuda:0")):
super(PSimNet, self).__init__()
checkpoint_path = 'pretrained_models/PSim_alexnet.pt'
self.net = PSim_Alexnet(train=False)
checkpoint = torch.load(checkpoint_path, map_location=torch.device("cpu"))
self.net.load_weights(checkpoint['state_dict'])
self.net.to(device)
# freeze network
for param in self.net.parameters():
param.requires_grad = False
self.net.eval()
def forward(self, generated, target):
outs0 = self.net.forward(generated)
outs1 = self.net.forward(target)
for (kk, out0) in enumerate(outs0):
cur_score = torch.mean((1. - utils.cos_sim(outs0[kk], outs1[kk]))) # mean is over batch
if kk == 0:
val = 1. * cur_score
else:
val = val + cur_score
return val
| 33.588235 | 100 | 0.627846 | 1,035 | 0.906305 | 0 | 0 | 0 | 0 | 0 | 0 | 187 | 0.163748 |
26551b53033df1ef4c846dd69a18ee414d9ea7ce | 26 | py | Python | lib/__init__.py | mswilkhu1/ssense | 59987a3c492591c8217811e79a63f25652f0295c | [
"MIT"
] | null | null | null | lib/__init__.py | mswilkhu1/ssense | 59987a3c492591c8217811e79a63f25652f0295c | [
"MIT"
] | null | null | null | lib/__init__.py | mswilkhu1/ssense | 59987a3c492591c8217811e79a63f25652f0295c | [
"MIT"
] | null | null | null | from . import conf_reader
| 13 | 25 | 0.807692 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2655d6c7fb66b3c5d656b8a6666cd3a7c01d406b | 271 | py | Python | plus-minus.py | saketsuman07/hacker-rank-solutions | 9055acf2e710b1a9caefe542b2b5e39b050e59fb | [
"MIT"
] | null | null | null | plus-minus.py | saketsuman07/hacker-rank-solutions | 9055acf2e710b1a9caefe542b2b5e39b050e59fb | [
"MIT"
] | null | null | null | plus-minus.py | saketsuman07/hacker-rank-solutions | 9055acf2e710b1a9caefe542b2b5e39b050e59fb | [
"MIT"
] | null | null | null | n = float(raw_input())
v = map(int, raw_input().strip().split())
pos = float(len(filter(lambda x: x > 0, v))) / n
neg = float(len(filter(lambda x: x < 0, v))) /n
zer = float(len(filter(lambda x: x == 0, v))) / n
print "%.3f" % pos
print "%.3f" % neg
print "%.3f" % zer
| 24.636364 | 49 | 0.571956 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 0.066421 |
2657fe93d76911db915b716f3764d580739be1b3 | 297 | py | Python | api/config.py | libamen/libamen | bcf5c07ec6af25c0e5bd5703075638b46965412d | [
"Apache-2.0"
] | null | null | null | api/config.py | libamen/libamen | bcf5c07ec6af25c0e5bd5703075638b46965412d | [
"Apache-2.0"
] | null | null | null | api/config.py | libamen/libamen | bcf5c07ec6af25c0e5bd5703075638b46965412d | [
"Apache-2.0"
] | null | null | null | import os
from dotenv import load_dotenv
load_dotenv()
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
DEBUG = False
TESTING = False
UPLOAD_FOLDER = f'{basedir}/uploads'
class DevConfig(Config):
DEBUG = True
class TestConfig(Config):
TESTING = True
| 13.5 | 52 | 0.703704 | 177 | 0.59596 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 0.06734 |
2658babc747f1ce1026574efd7275014f53e2fd0 | 2,219 | py | Python | sustainableCityManagement/main_project/Bus_API/process_bus_delays.py | Josh-repository/Dashboard-CityManager- | 6287881be9fb2c6274a755ce5d75ad355346468a | [
"RSA-MD"
] | null | null | null | sustainableCityManagement/main_project/Bus_API/process_bus_delays.py | Josh-repository/Dashboard-CityManager- | 6287881be9fb2c6274a755ce5d75ad355346468a | [
"RSA-MD"
] | null | null | null | sustainableCityManagement/main_project/Bus_API/process_bus_delays.py | Josh-repository/Dashboard-CityManager- | 6287881be9fb2c6274a755ce5d75ad355346468a | [
"RSA-MD"
] | 1 | 2021-05-13T16:33:18.000Z | 2021-05-13T16:33:18.000Z | import requests
import json
from ..Config.config_handler import read_config
class ProcessBusDelays:
def __init__(self):
self.config_vals = read_config("Bus_API")
# Get the live data of Buses(Arrival Time, Departure Time, Delay) from API and returns.
def get_data_from_bus_api(self):
url = self.config_vals["api_url"]
headers = {self.config_vals["api_key_name"]:self.config_vals["api_key_value"]}
response = requests.get(url, headers=headers)
bus_data = json.loads(response.text)
bus_trip_delays = bus_data["entity"]
return bus_trip_delays
# Structure the live data (Delays, Arrival Time, Departure Time) in required format to send the recent stop details to frontend.
def get_delay_for_trip_live(self):
bus_trip_delays=self.get_data_from_bus_api()
result_response={}
for trip in bus_trip_delays:
temp = trip["trip_update"]
if temp["trip"]["schedule_relationship"]!="CANCELED":
delay_details = temp["stop_time_update"][-1]
if "departure" not in delay_details:
temp_delay = delay_details["arrival"]
if "delay" not in temp_delay:
delay = "Not Available"
else:
delay = temp_delay["delay"]
result_response[trip["id"]] = {
"STOP_ID": delay_details["stop_id"],
"STOP_SEQUENCE": delay_details["stop_sequence"],
"DELAY": delay
}
else:
temp_delay = delay_details["departure"]
if "delay" not in temp_delay:
delay = "Not Available"
else:
delay = temp_delay["delay"]
result_response[trip["id"]] = {
"STOP_ID": delay_details["stop_id"],
"STOP_SEQUENCE": delay_details["stop_sequence"],
"DELAY": delay
}
else:
result_response[trip["id"]] = {"STATUS":"CANCELED"}
return result_response
| 42.673077 | 133 | 0.54484 | 2,141 | 0.964849 | 0 | 0 | 0 | 0 | 0 | 0 | 570 | 0.256872 |
26599d13bfb32c3212e18f860f5d6d06e7a58aef | 3,576 | py | Python | generate/julia/ffi.py | Luthaf/Chemharp-bindgen | 7d25556773fb5fe22dd1dbb0bd0d34fb2e6dccb8 | [
"MIT"
] | null | null | null | generate/julia/ffi.py | Luthaf/Chemharp-bindgen | 7d25556773fb5fe22dd1dbb0bd0d34fb2e6dccb8 | [
"MIT"
] | 2 | 2018-02-25T21:46:45.000Z | 2018-11-19T22:39:54.000Z | generate/julia/ffi.py | chemfiles/bindgen | 7d25556773fb5fe22dd1dbb0bd0d34fb2e6dccb8 | [
"MIT"
] | null | null | null | # -* coding: utf-8 -*
"""
This module generate the Julia interface declaration for the functions it
finds in a C header. It only handle edge cases for the chemfiles.h header.
"""
from generate.julia.constants import BEGINING
from generate.julia.convert import type_to_julia
from generate import CHFL_TYPES
TYPE_TEMPLATE = """
struct {name} end
"""
ENUM_TEMPLATE = """# enum {name}
const {name} = UInt32
{values}
"""
FUNCTION_TEMPLATE = """
# Function '{name}' at {coord}
function {name}({argdecl})
ccall((:{name}, libchemfiles), {restype}, {argtypes}, {args})
end
"""
MANUAL_TYPES = """
# === Manually translated from the header
const Cbool = Cuchar
const chfl_vector3d = Array{Cdouble, 1}
struct chfl_match
size ::UInt64
atoms_1 ::UInt64
atoms_2 ::UInt64
atoms_3 ::UInt64
atoms_4 ::UInt64
end
struct chfl_format_metadata
name :: Ptr{Cchar}
extension :: Ptr{Cchar}
description :: Ptr{Cchar}
reference :: Ptr{Cchar}
read :: Cbool
write :: Cbool
memory :: Cbool
positions :: Cbool
velocities :: Cbool
unit_cell :: Cbool
atoms :: Cbool
bonds :: Cbool
residues :: Cbool
end
# === End of manual type defintion
"""
MANUAL_FUNCTIONS = """
# === Manually translated from the header
# Function 'chfl_trajectory_memory_buffer'
function chfl_trajectory_memory_buffer(trajectory::Ptr{CHFL_TRAJECTORY}, data::Ref{Ptr{UInt8}}, size::Ref{UInt64})
ccall((:chfl_trajectory_memory_buffer, libchemfiles), chfl_status, (Ptr{CHFL_TRAJECTORY}, Ref{Ptr{UInt8}}, Ref{UInt64}), trajectory, data, size)
end
# === End of manual function defintion
"""
def wrap_enum(enum):
"""Wrap an enum"""
typename = enum.name
values = ""
for enumerator in enum.enumerators:
values += "const " + str(enumerator.name) + " = "
values += typename + "(" + str(enumerator.value.value) + ")\n"
return ENUM_TEMPLATE.format(name=typename, values=values[:-1])
def write_types(filename, enums):
with open(filename, "w") as fd:
fd.write(BEGINING)
fd.write(MANUAL_TYPES)
for name in CHFL_TYPES:
fd.write(TYPE_TEMPLATE.format(name=name))
for enum in enums:
fd.write("\n")
fd.write(wrap_enum(enum))
def write_functions(filename, functions):
with open(filename, "w") as fd:
fd.write(BEGINING)
fd.write(MANUAL_FUNCTIONS)
for function in functions:
if function.name == "chfl_trajectory_memory_buffer":
continue
fd.write(interface(function))
def interface(function):
"""Convert a function interface to Julia"""
names = [arg.name for arg in function.args]
types = [type_to_julia(arg.type) for arg in function.args]
args = ", ".join(names)
argdecl = ", ".join(n + "::" + t for (n, t) in zip(names, types))
# Filter arguments for ccall
types = [t if t != "chfl_vector3d" else "Ptr{Float64}" for t in types]
if len(types) == 0:
argtypes = "()" # Empty tuple
elif len(types) == 1:
argtypes = "(" + types[0] + ",)"
else:
argtypes = "(" + ", ".join(types) + ")"
restype = type_to_julia(function.rettype)
if restype == "c_int":
errcheck = " c_lib." + function.name
errcheck += ".errcheck = _check_return_code\n"
else:
errcheck = ""
return FUNCTION_TEMPLATE.format(
name=function.name,
coord=function.coord,
argtypes=argtypes,
args=args,
argdecl=argdecl,
restype=restype,
errcheck=errcheck,
)
| 26.10219 | 148 | 0.631991 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,672 | 0.467562 |
265aad51cd825c5cd3fa7bde6bb29b6e88376717 | 648 | py | Python | op_interface/xgemm.py | LukasSlouka/TF_XNN | 152698a5da5ed6fff9ec4337e8dca4a1a396b458 | [
"MIT"
] | 3 | 2018-05-19T19:41:28.000Z | 2019-03-04T12:40:32.000Z | op_interface/xgemm.py | LukasSlouka/TF_XNN | 152698a5da5ed6fff9ec4337e8dca4a1a396b458 | [
"MIT"
] | null | null | null | op_interface/xgemm.py | LukasSlouka/TF_XNN | 152698a5da5ed6fff9ec4337e8dca4a1a396b458 | [
"MIT"
] | null | null | null | from tensorflow.python.framework import ops
from tensorflow.python.ops import math_ops
from .utils import get_xmodule
xmodule = get_xmodule()
xgemm = xmodule.xgemm
@ops.RegisterGradient("XGEMM")
def _xgemm_grad(op, grad):
"""
Gradient computation for the XGEMM
:param op: XGEMM operation that is differentiated
:param grad: gradient with respect to the output of XGEMM
:return: gradients with respect to the input matrices of the XGEMM
"""
a = op.inputs[0]
b = op.inputs[1]
grad_a = math_ops.matmul(grad, b, transpose_b=True)
grad_b = math_ops.matmul(a, grad, transpose_a=True)
return grad_a, grad_b
| 28.173913 | 70 | 0.723765 | 0 | 0 | 0 | 0 | 479 | 0.739198 | 0 | 0 | 244 | 0.376543 |
265ab7b03cf9ea1a66d9ea39dcb79842ad35aa0c | 1,004 | py | Python | Chapter05/nlp40.py | gushwell/PythonNLP100 | c67148232fc942b1f8a72e69a2a5e7a3b76e99bd | [
"MIT"
] | 2 | 2020-01-09T14:48:41.000Z | 2021-11-20T20:33:46.000Z | Chapter05/nlp40.py | CLRafaelR/PythonNLP100 | c67148232fc942b1f8a72e69a2a5e7a3b76e99bd | [
"MIT"
] | null | null | null | Chapter05/nlp40.py | CLRafaelR/PythonNLP100 | c67148232fc942b1f8a72e69a2a5e7a3b76e99bd | [
"MIT"
] | 2 | 2020-01-09T14:48:40.000Z | 2021-11-20T20:33:59.000Z | # 第5章: 係り受け解析
import re
class Morph:
def __init__(self, surface, base, pos, pos1):
self.surface = surface
self.base = base
self.pos = pos
self.pos1 = pos1
def print(self):
print([self.surface, self.base, self.pos, self.pos1])
def analyze():
article = []
sentence = []
with open('neko.txt.cabocha', 'r', encoding='utf8') as fin:
for line in fin:
words = re.split(r'\t|,|\n| ', line)
if words[0] == '*':
continue
elif words[0] == 'EOS':
if sentence:
article.append(sentence)
sentence = []
else:
sentence.append(Morph(
words[0],
words[7],
words[1],
words[2],
))
return article
def main():
article = analyze()
for morph in article[3]:
morph.print()
if __name__ == '__main__':
main()
| 23.904762 | 63 | 0.456175 | 250 | 0.245098 | 0 | 0 | 0 | 0 | 0 | 0 | 86 | 0.084314 |
265bf6359ab14ac666621994354747be0e20755e | 1,096 | py | Python | test/TestUtils.py | priscillaboyd/SPaT_Prediction | 4309819e1f8d8e49f2e7fc132750102322e1504a | [
"Apache-2.0"
] | 7 | 2017-07-10T09:18:19.000Z | 2022-03-22T02:47:12.000Z | test/TestUtils.py | priscillaboyd/SPaT_Prediction | 4309819e1f8d8e49f2e7fc132750102322e1504a | [
"Apache-2.0"
] | 36 | 2017-06-27T15:04:27.000Z | 2017-10-21T12:39:12.000Z | test/TestUtils.py | priscillaboyd/SPaT_Prediction | 4309819e1f8d8e49f2e7fc132750102322e1504a | [
"Apache-2.0"
] | 2 | 2017-11-01T03:26:55.000Z | 2019-06-01T20:20:31.000Z | import os
import shutil
import unittest
from tools.Utils import root_path, output_fields, create_folder_if_not_exists, results_folder
class TestUtils(unittest.TestCase):
def test_output_fields(self):
output_fields_needed = ['Date', 'Time', 'Result', 'Phase']
self.assertEqual(output_fields_needed, output_fields)
def test_folder_is_created_if_not_exists(self):
folder = root_path + "/temp/"
# folder does not exist
self.assertEqual(os.path.exists(folder), False)
# folder created
create_folder_if_not_exists(folder)
self.assertEqual(os.path.exists(folder), True)
# remove after test
os.rmdir(folder)
self.assertEqual(os.path.exists(folder), False)
def test_results_folder_exists(self):
create_folder_if_not_exists(results_folder)
self.assertEqual(os.path.exists(results_folder), True)
# remove folder after test
shutil.rmtree(results_folder)
self.assertEqual(os.path.exists(results_folder), False)
if __name__ == "__main__":
unittest.main()
| 28.842105 | 93 | 0.70073 | 909 | 0.82938 | 0 | 0 | 0 | 0 | 0 | 0 | 129 | 0.117701 |
265f8fd62d80164aa1cff86121914b68ce2ea3c8 | 650 | py | Python | pwned/searchpass.py | nverhaaren/code-samples | 2b7fd9c1098d66089fe1ba18c0e4f1ac891dd673 | [
"MIT"
] | null | null | null | pwned/searchpass.py | nverhaaren/code-samples | 2b7fd9c1098d66089fe1ba18c0e4f1ac891dd673 | [
"MIT"
] | 2 | 2017-08-10T02:40:57.000Z | 2017-08-12T00:56:48.000Z | pwned/searchpass.py | nverhaaren/code-samples | 2b7fd9c1098d66089fe1ba18c0e4f1ac891dd673 | [
"MIT"
] | null | null | null | #! /usr/bin/python
import hashlib, getpass
import sys
if len(sys.argv) > 1 and sys.argv[1] == '-s':
sha = True
else:
sha = False
while True:
try:
passhash = hashlib.sha1(getpass.getpass()).hexdigest().upper()
if sha:
print passhash
except EOFError:
print
break
filename = passhash[:2]
comp = passhash[2:]
with open(filename, 'r') as f:
while True:
a = f.readline()
if a.strip() == comp:
print "Found"
break
elif not a:
print "Not found"
break
print
| 19.69697 | 70 | 0.481538 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 43 | 0.066154 |
2661899145bc08ac1035d9320ae8710c8aceeb71 | 14,728 | py | Python | electricpy/conversions.py | engineerjoe440/electricpy | 03155a34ea024b61a9a6c41241cd664d0df0fb6b | [
"MIT"
] | null | null | null | electricpy/conversions.py | engineerjoe440/electricpy | 03155a34ea024b61a9a6c41241cd664d0df0fb6b | [
"MIT"
] | null | null | null | electricpy/conversions.py | engineerjoe440/electricpy | 03155a34ea024b61a9a6c41241cd664d0df0fb6b | [
"MIT"
] | null | null | null | ################################################################################
"""
`electricpy` Package - `conversions` Module.
>>> from electricpy import conversions
Filled with simple conversion functions to help manage unit conversions and the
like, this module is very helpful to electrical engineers.
Built to support operations similar to Numpy and Scipy, this package is designed
to aid in scientific calculations.
"""
################################################################################
# Import Local Requirements
from electricpy.constants import WATTS_PER_HP, Aabc, A012, KWH_PER_BTU
# Import Required Packages
import numpy as _np
# Define HP to Watts Calculation
def hp_to_watts(hp):
r"""
Horsepower to Watts Formula.
Calculates the power (in watts) given the
horsepower.
.. math:: P_{\text{watts}}=P_{\text{horsepower}}\cdot745.699872
Same as `watts`.
Parameters
----------
hp: float
The horsepower to compute.
Returns
-------
watts: float
The power in watts.
"""
return hp * WATTS_PER_HP
watts = hp_to_watts # Make Duplicate Name
# Define Watts to HP Calculation
def watts_to_hp(watt):
r"""
Watts to Horsepower Function.
Calculates the power (in horsepower) given
the power in watts.
.. math:: P_{\text{horsepower}}=\frac{P_{\text{watts}}}{745.699872}
Same as `horsepower`.
Parameters
----------
watt: float
The wattage to compute.
Returns
-------
hp: float
The power in horsepower.
"""
return watt / WATTS_PER_HP
horsepower = watts_to_hp # Make Duplicate Name
# Define kWh to BTU function and vice-versa
def kwh_to_btu(kWh):
r"""
Killo-Watt-Hours to BTU Function.
Converts kWh (killo-Watt-hours) to BTU (British Thermal Units).
.. math:: \text{BTU} = \text{kWh}\cdot3412.14
Same as `btu`.
Parameters
----------
kWh: float
The number of killo-Watt-hours
Returns
-------
BTU: float
The number of British Thermal Units
"""
return kWh * KWH_PER_BTU
btu = kwh_to_btu # Make Duplicate Name
def btu_to_kwh(BTU):
r"""
BTU to Kilo-Watt-Hours Function.
Converts BTU (British Thermal Units) to kWh (kilo-Watt-hours).
.. math:: \text{kWh} = \frac{\text{BTU}}{3412.14}
Same as `kwh`.
Parameters
----------
BTU: float
The number of British Thermal Units
Returns
-------
kWh: float
The number of kilo-Watt-hours
"""
return BTU / KWH_PER_BTU
kwh = btu_to_kwh # Make Duplicate Name
# Define Simple Radians to Hertz Converter
def rad_to_hz(radians):
r"""
Radians to Hertz Converter.
Accepts a frequency in radians/sec and calculates
the hertz frequency (in Hz).
.. math:: f_{\text{Hz}} = \frac{f_{\text{rad/sec}}}{2\cdot\pi}
Same as `hertz`.
Parameters
----------
radians: float
The frequency (represented in radians/sec)
Returns
-------
hertz: float
The frequency (represented in Hertz)
"""
return radians / (2 * _np.pi) # Evaluate and Return
hertz = rad_to_hz # Make Duplicate Name
# Define Simple Hertz to Radians Converter
def hz_to_rad(hz):
r"""
Hertz to Radians Converter.
Accepts a frequency in Hertz and calculates
the frequency in radians/sec.
.. math:: f_{\text{rad/sec}} = f_{\text{Hz}}\cdot2\cdot\pi
Same as `radsec`.
Parameters
----------
hz: float
The frequency (represented in Hertz)
Returns
-------
radians: float
The frequency (represented in radians/sec)
"""
return hz * (2 * _np.pi) # Evaluate and Return
radsec = hz_to_rad # Make Duplicate Name
# Define Sequence Component Conversion Function
def abc_to_seq(Mabc, reference='A'):
r"""
Phase-System to Sequence-System Conversion.
Converts phase-based values to sequence
components.
.. math:: M_{\text{012}}=A_{\text{012}}\cdot M_{\text{ABC}}
Same as phs_to_seq.
Parameters
----------
Mabc: list of complex
Phase-based values to be converted.
reference: {'A', 'B', 'C'}
Single character denoting the reference,
default='A'
Returns
-------
M012: numpy.array
Sequence-based values in order of 0-1-2
See Also
--------
seq_to_abc: Sequence to Phase Conversion
sequence: Phase Impedance to Sequence Converter
"""
# Condition Reference:
reference = reference.upper()
if reference == 'A':
M = Aabc
elif reference == 'B':
M = _np.roll(Aabc, 1, 0)
elif reference == 'C':
M = _np.roll(Aabc, 2, 0)
else:
raise ValueError("Invalid Phase Reference.")
return M.dot(Mabc)
# Define Second Name for abc_to_seq
phs_to_seq = abc_to_seq
# Define Phase Component Conversion Function
def seq_to_abc(M012, reference='A'):
r"""
Sequence-System to Phase-System Conversion.
Converts sequence-based values to phase
components.
.. math:: M_{\text{ABC}}=A_{\text{012}}^{-1}\cdot M_{\text{012}}
Same as seq_to_phs.
Parameters
----------
M012: list of complex
Sequence-based values to convert.
reference: {'A', 'B', 'C'}
Single character denoting the reference,
default='A'
Returns
-------
Mabc: numpy.array
Phase-based values in order of A-B-C
See Also
--------
abc_to_seq: Phase to Sequence Conversion
sequence: Phase Impedance to Sequence Converter
"""
# Compute Dot Product
M = A012.dot(M012)
# Condition Reference:
reference = reference.upper()
if reference == 'A':
pass
elif reference == 'B':
M = _np.roll(M, 1, 0)
elif reference == 'C':
M = _np.roll(M, 2, 0)
else:
raise ValueError("Invalid Phase Reference.")
return M
# Define Second Name for seq_to_abc
seq_to_phs = seq_to_abc
# Define Sequence Impedance Calculator
def sequencez(Zabc, reference='A', resolve=False, diag=False, rounds=3):
r"""
Sequence Impedance Calculator.
Accepts the phase (ABC-domain) impedances for a
system and calculates the sequence (012-domain)
impedances for the same system. If the argument
`resolve` is set to true, the function will
combine terms into the set of [Z0, Z1, Z2].
When resolve is False:
.. math:: Z_{\text{012-M}}=A_{\text{012}}^{-1}Z_{\text{ABC}}A_{\text{012}}
When resolve is True:
.. math:: Z_{\text{012}}=A_{\text{012}}Z_{\text{ABC}}A_{\text{012}}^{-1}
Parameters
----------
Zabc: numpy.array of complex
2-D (3x3) matrix of complex values
representing the pharo impedance
in the ABC-domain.
reference: {'A', 'B', 'C'}
Single character denoting the reference,
default='A'
resolve: bool, optional
Control argument to force the function to
evaluate the individual sequence impedance
[Z0, Z1, Z2], default=False
diag: bool, optional
Control argument to force the function to
reduce the matrix to its diagonal terms.
rounds: int, optional
Integer denoting number of decimal places
resulting matrix should be rounded to.
default=3
Returns
-------
Z012: numpy.array of complex
2-D (3x3) matrix of complex values
representing the sequence impedance
in the 012-domain
See Also
--------
seq_to_abc: Sequence to Phase Conversion
abc_to_seq: Phase to Sequence Conversion
"""
# Condition Reference
reference = reference.upper()
roll_rate = {'A': 0, 'B': 1, 'C': 2}
# Test Validity
if reference not in roll_rate:
raise ValueError("Invalad Phase Reference")
# Determine Roll Factor
roll = roll_rate[reference]
# Evaluate Matrices
M012 = _np.roll(A012, roll, 0)
min_v = _np.linalg.inv(M012)
# Compute Sequence Impedance
if resolve:
Z012 = M012.dot(Zabc.dot(min_v))
else:
Z012 = min_v.dot(Zabc.dot(M012))
# Reduce to Diagonal Terms if Needed
if diag:
Z012 = [Z012[0][0], Z012[1][1], Z012[2][2]]
return _np.around(Z012, rounds)
# Define Angular Velocity Conversion Functions
def rad_to_rpm(rad):
"""
Radians-per-Second to RPM Converter.
Given the angular velocity in rad/sec, this function will evaluate the
velocity in RPM (Revolutions-Per-Minute).
Parameters
----------
rad: float
The angular velocity in radians-per-second
Returns
-------
rpm: float
The angular velocity in revolutions-per-minute (RPM)
"""
rpm = 60 / (2 * _np.pi) * rad
return rpm
# Define Angular Velocity Conversion Functions
def rpm_to_rad(rpm):
"""
RPM to Radians-per-Second Converter.
Given the angular velocity in RPM (Revolutions-Per-Minute), this function
will evaluate the velocity in rad/sec.
Parameters
----------
rpm: float
The angular velocity in revolutions-per-minute (RPM)
Returns
-------
rad: float
The angular velocity in radians-per-second
"""
rad = 2 * _np.pi / 60 * rpm
return rad
# Define Angular Velocity Conversion Functions
def hz_to_rpm(hz):
"""
Hertz to RPM Converter.
Given the angular velocity in Hertz, this function will evaluate the
velocity in RPM (Revolutions-Per-Minute).
Parameters
----------
hz: float
The angular velocity in Hertz
Returns
-------
rpm: float
The angular velocity in revolutions-per-minute (RPM)
"""
return hz * 60
# Define Angular Velocity Conversion Functions
def rpm_to_hz(rpm):
"""
RPM to Hertz Converter.
Given the angular velocity in RPM (Revolutions-Per-Minute), this function
will evaluate the velocity in Hertz.
Parameters
----------
rpm: float
The angular velocity in revolutions-per-minute (RPM)
Returns
-------
hz: float
The angular velocity in Hertz
"""
return rpm / 60
# Define dBW to Watts converter
def dbw_to_watts(dbw):
"""
Convert dBW to Watts.
Given the power in the decibel scale, this function will evaluate the
power in Watts.
Parameters
----------
dbw: float
Power in the decibel scale (dBW)
Returns
-------
watts float
Power in Watts
"""
return 10 ** (dbw / 10)
# Define Watts to dBW converter
def watts_to_dbw(watt):
"""
Watt to dBW converter.
Given the power in watts, this function will evaluate the power in the
decibel scale.
Parameters
----------
watt: float
Power in Watts
Return
------
dbw: Power in the decibel scale (dBW)
"""
return 10 * _np.log10(watt)
# Define dbW to dBmW converter
def dbw_to_dbmw(dbw):
"""
Convert dBW to dBmW.
Given the power in the decibel scale, this function will evaluate the power
in the decibel-milli-watts scale.
Parameters
----------
dbw: float
Power in the decibel scale (dBW)
Return
------
dbmw: float
Power in the decibel-milli-watts scale (dBmW)
"""
return dbw + 30
# Define dBmW to dBW converter
def dbmw_to_dbw(dbmw):
"""
Convert dBmW to dBW.
Given the power in the decibel milli-watts-scale, this function will evaluate
the power in the decibel scale.
Parameters
----------
dbmw: float
Power in the decibel-milli-watts scale (dBmW)
Return
------
dbw: float
Power in the decibel scale (dBW)
"""
return dbmw - 30
# Define dBmW to Watts converter
def dbmw_to_watts(dbmw):
"""
Convert dbmW to Watts.
Given the power in the decibel milli-watts-scale, this function will evaluate
the power in watts.
Parameters
----------
dbmw: float
Power in the decibel-milli-watts scale (dBmW)
Return
------
watt: float
Power in Watts
"""
dbw = dbmw_to_dbw(dbmw)
return dbw_to_watts(dbw)
# Define Watts to dBmW converter
def watts_to_dbmw(watt):
"""
Watts to dBmW.
Given the power in watts, this function will evaluate
the power in the decibel milli-watt scale.
Parameters
----------
watt: float
Power in Watts
Return
------
dbmw: float
Power in the decibel-milli-watts scale (dBmW)
"""
dbw = watts_to_dbw(watt)
return dbw_to_dbmw(dbw)
# Define Voltage to decibel converter
def voltage_to_db(voltage, ref_voltage):
"""
Voltage to Decibel.
Given the voltage and reference voltage, this function will evaluate
the voltage in the decibel scale.
Parameters
----------
voltage: float
voltage
ref_voltage: float
Reference voltage
Return
------
decibel: float
voltage in the decibel scale
"""
return 20 * _np.log10(voltage / ref_voltage)
# Define Decibel to reference Voltage
def db_to_vref(db, voltage):
"""
Decibel to Reference Voltage.
Given decibel and voltage, this function will evaluate
the power of reference voltage.
Parameters
----------
db: float
voltage in Decibel
voltage: float
Voltage
Return
------
ref_voltage: float
reference voltage
"""
return voltage * _np.power(10, -(db / 20))
# Define Decibel to reference Voltage
def db_to_voltage(db, ref_voltage):
"""
Decibel to Reference Voltage.
Given decibel and voltage, this function will evaluate
the power of reference voltage.
Parameters
----------
db: float
voltage in Decibel
ref_voltage: float
Ref Voltage
Return
------
voltage: float
Voltage
"""
return ref_voltage * _np.power(10, -(db / 20))
# END
| 23.266983 | 81 | 0.577404 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12,003 | 0.814978 |
2661e35125a9440b7263e4c2e760872c0ae79dad | 1,713 | py | Python | app/pages.py | mvasilkov/terrible-mistake | 4f40a9719786ad3df0aea521dfeda234e3329714 | [
"MIT"
] | null | null | null | app/pages.py | mvasilkov/terrible-mistake | 4f40a9719786ad3df0aea521dfeda234e3329714 | [
"MIT"
] | null | null | null | app/pages.py | mvasilkov/terrible-mistake | 4f40a9719786ad3df0aea521dfeda234e3329714 | [
"MIT"
] | null | null | null | import html
from .models import Post, Session
TEMPLATE_BASE = '''<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>noname</title>
<link rel="stylesheet" href="/static/app.css">
</head>
<body>
%s
</body>
</html>
'''
TEMPLATE_FORM = '''
<form action="/publish" method="post" enctype="multipart/form-data">
<label for="title">Title</label>
<input type="text" name="title" id="title" placeholder=""><br>
<label for="picture">Picture</label>
<input type="file" name="picture" id="picture"><br>
<button type="submit">Publish</button>
</form>
'''
TEMPLATE_POST = '''
<div class="post">
<img src="/static/uploads/%s" title="%s"><br>
<span class="title">%s</span>
</div>
'''
TEMPLATE_POST_SUPERUSER = '''
<div class="post">
<img src="/static/uploads/%s" title="%s"><br>
<span class="title">%s</span><br>
<a href="/delete/%d" class="delete">Delete</a>
</div>
'''
def render_start_page(is_superuser: bool):
session = Session()
posts = session.query(Post).order_by(Post.id.desc()).all()
if is_superuser:
rendered_posts = ''.join(
TEMPLATE_POST_SUPERUSER
% (
post.picture,
post.title,
html.escape(post.title),
post.id,
)
for post in posts
)
else:
rendered_posts = ''.join(
TEMPLATE_POST
% (
post.picture,
post.title,
html.escape(post.title),
)
for post in posts
)
session.close()
return TEMPLATE_BASE % ''.join([TEMPLATE_FORM, rendered_posts])
| 23.465753 | 68 | 0.54174 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 843 | 0.492119 |
266247aa06f4461cb7db5adf2fdddc88aebe5a2f | 761 | py | Python | seqauto/management/commands/reload_illumina_flowcell_qc.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 5 | 2021-01-14T03:34:42.000Z | 2022-03-07T15:34:18.000Z | seqauto/management/commands/reload_illumina_flowcell_qc.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 551 | 2020-10-19T00:02:38.000Z | 2022-03-30T02:18:22.000Z | seqauto/management/commands/reload_illumina_flowcell_qc.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | null | null | null | """
https://github.com/SACGF/variantgrid/issues/1601
Need to trigger reloads of bad metrics, so we die properly
"""
import logging
from django.core.management.base import BaseCommand
from seqauto.models import IlluminaFlowcellQC
from snpdb.models import DataState
class Command(BaseCommand):
def handle(self, *args, **options):
qs = IlluminaFlowcellQC.objects.exclude(data_state=DataState.ERROR)
qs = qs.filter(mean_cluster_density__isnull=True)
if not qs.exists():
logging.info("No potentially bad IlluminaFlowcellQC records")
for iqc in qs:
logging.info(f"Reloading: {iqc}")
iqc.load_from_file(None)
logging.info(f"{iqc}: {iqc.get_data_state_display()}")
| 24.548387 | 75 | 0.687254 | 481 | 0.632063 | 0 | 0 | 0 | 0 | 0 | 0 | 231 | 0.303548 |
26649d1e4db6d0705a327b9183a318d36350f178 | 446 | py | Python | ssig_site/auth/migrations/0003_user_interest_events.py | LeoMcA/103P_2018_team51 | cca9e022456b1e2653f0b69420ea914661c39b27 | [
"MIT"
] | null | null | null | ssig_site/auth/migrations/0003_user_interest_events.py | LeoMcA/103P_2018_team51 | cca9e022456b1e2653f0b69420ea914661c39b27 | [
"MIT"
] | 61 | 2018-02-22T11:10:48.000Z | 2022-03-11T23:20:25.000Z | ssig_site/auth/migrations/0003_user_interest_events.py | LeoMcA/103P_2018_team51 | cca9e022456b1e2653f0b69420ea914661c39b27 | [
"MIT"
] | 2 | 2018-02-10T11:26:52.000Z | 2018-02-21T12:14:36.000Z | # Generated by Django 2.0.2 on 2018-03-08 12:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0004_event_group'),
('ssig_site_auth', '0002_user_interest_groups'),
]
operations = [
migrations.AddField(
model_name='user',
name='interest_events',
field=models.ManyToManyField(to='base.Event'),
),
]
| 22.3 | 58 | 0.605381 | 353 | 0.79148 | 0 | 0 | 0 | 0 | 0 | 0 | 149 | 0.334081 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.