blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 2 616 | content_id stringlengths 40 40 | detected_licenses listlengths 0 69 | license_type stringclasses 2
values | repo_name stringlengths 5 118 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 63 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 2.91k 686M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 23
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 220
values | src_encoding stringclasses 30
values | language stringclasses 1
value | is_vendor bool 2
classes | is_generated bool 2
classes | length_bytes int64 2 10.3M | extension stringclasses 257
values | content stringlengths 2 10.3M | authors listlengths 1 1 | author_id stringlengths 0 212 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e7ce1b59ac16070ee7d9834a295ee8a281b0d0e5 | 6e91ad505da417a6345b84ea02534deb3ec0427a | /src/data/transforms/transforms.py | 611cea6c83cf24bbc8941fb3b2fd25d481c13973 | [] | no_license | cocoaaa/Tenenbaum2000 | 257a7a0376b670a0896ecd09ace848cb276d5813 | 6f6e8ee74bc9f597def9559f74a6841c37c0a214 | refs/heads/master | 2023-04-25T23:36:13.566521 | 2021-06-06T00:49:20 | 2021-06-06T00:49:20 | 312,381,690 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,594 | py | # encoding: utf-8
"""
@author: sherlock
@contact: sherlockliao01@gmail.com
"""
import math
import random
import torch
from torchvision import transforms as T
import numpy as np
from sklearn.preprocessing import minmax_scale
from typing import List, Set, Dict, Tuple, Optional, Iterable, Mapping, Union, Callable
from .functional import unnormalize, to_monochrome
def to_3dim(X: torch.Tensor, target_size: Tuple[int, int, int], dtype=torch.float32) -> torch.Tensor:
"""
Rearragne data matrix X of size (n_styles*dim_x, n_contents)
to (n_styles, n_contents, dim_x)
Args:
- X: torch.Tensor of 2dim data matrix
- target_size: tuple of n_style, n_contents, dim_x
"""
assert X.ndim == 2
n_styles, n_contents, dim_x = target_size
assert X.shape[0] == n_styles * dim_x
assert X.shape[1] == n_contents
target = torch.zeros(target_size, dtype=X.dtype)
for s in range(n_styles):
for c in range(n_contents):
img = X[s * dim_x: (s + 1) * dim_x, c]
target[s, c] = img
return target.to(dtype)
class Identity: # used for skipping transforms
def __call__(self, x):
return x
class Unnormalizer:
"""
Inverse operation of the channelwise normalization via transforms.Normalizer
See https://github.com/pytorch/vision/issues/528
"""
def __init__(self,
used_mean: Union[torch.Tensor, np.ndarray],
used_std: Union[torch.Tensor, np.ndarray]
):
self.used_mean = used_mean
self.used_std = used_std
def __call__(self, x: Union[torch.Tensor, np.ndarray]):
return unnormalize(self.used_mean, self.used_std)(x)
class LinearRescaler:
"""
CAUTION: Breaks the computational graph by returning a new numpy array
Normalize the input tensor by scaling its values via a linear mapping
f: [x.min(), x.max()] -> target_range (default: [0,1])
"""
def __init__(self, target_range:Optional[Tuple[float,float]]=None):
self.target_range = target_range or [0., 1.]
def __call__(self, x: Union[np.ndarray, torch.Tensor]):
shape = x.shape
out = minmax_scale(x.flatten(), feature_range=self.target_range).reshape(shape)
if isinstance(x, torch.Tensor):
out = torch.tensor(out, dtype=x.dtype, device=x.device)
return out
class Monochromizer:
"""
Converts a single channel image tensor to a 3-channel mono-chrome image tensor
- Supports red, green,blue and gray
"""
def __init__(self, color:str):
self.color = color.lower()
assert self.color in ["red", "green", "blue", "gray"]
@property
def color2dim(self) ->Dict[str, int]:
return {"red": 0, "green": 1, "blue": 2}
def __call__(self, x):
return to_monochrome(x, self.color)
class RandomErasing:
""" Randomly selects a rectangle region in an image and erases its pixels.
'Random Erasing Data Augmentation' by Zhong et al.
See https://arxiv.org/pdf/1708.04896.pdf
Args:
probability: The probability that the Random Erasing operation will be performed.
sl: Minimum proportion of erased area against input image.
sh: Maximum proportion of erased area against input image.
r1: Minimum aspect ratio of erased area.
mean: Erasing value.
"""
def __init__(self, probability=0.5, sl=0.02, sh=0.4, r1=0.3, mean=(0.4914, 0.4822, 0.4465)):
self.probability = probability
self.mean = mean
self.sl = sl
self.sh = sh
self.r1 = r1
def __call__(self, img):
if random.uniform(0, 1) > self.probability:
return img
for attempt in range(100):
area = img.size()[1] * img.size()[2]
target_area = random.uniform(self.sl, self.sh) * area
aspect_ratio = random.uniform(self.r1, 1 / self.r1)
h = int(round(math.sqrt(target_area * aspect_ratio)))
w = int(round(math.sqrt(target_area / aspect_ratio)))
if w < img.size()[2] and h < img.size()[1]:
x1 = random.randint(0, img.size()[1] - h)
y1 = random.randint(0, img.size()[2] - w)
if img.size()[0] == 3:
img[0, x1:x1 + h, y1:y1 + w] = self.mean[0]
img[1, x1:x1 + h, y1:y1 + w] = self.mean[1]
img[2, x1:x1 + h, y1:y1 + w] = self.mean[2]
else:
img[0, x1:x1 + h, y1:y1 + w] = self.mean[0]
return img
return img
| [
"haejinso@usc.edu"
] | haejinso@usc.edu |
80954ebe7830dd8dfab25e0a013922bc01815edb | 160ff0dbe7f9e5d740faa3ce13302190e1e5f1f0 | /Calc.py | db893a216b2d9cc553077be5697b83b7af2224fd | [] | no_license | sivatoms/PyReddy | 9a84e1568e9ee6c16c2b51ba6044059d31ae62dd | fcc0ab8705d409c6b609f9b5f5cffb8900dd8eb7 | refs/heads/master | 2021-06-26T17:42:43.104598 | 2021-01-20T21:40:06 | 2021-01-20T21:40:06 | 197,511,789 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 187 | py |
from Demo import wish
def add(a,b):
print(a+b)
def sub(a,b):
print(a-b)
def mul(a,b):
print(a*b)
def div(a,b):
print(a/b)
wish()
print("This is second modules") | [
"sivatoms@gmail.com"
] | sivatoms@gmail.com |
77b485b69080e2bcdc5c77e82f78060389522740 | 91428afe2325ec377e19284ebcbd15036e9e3bf3 | /blog/models.py | fd3d852bbd2ecf147b9b46a86a0cf9ac308c5e3b | [] | no_license | jtwray/blogApp-djangoheroku | 152bb5004d5cf8ac115cf9fbdce40f7f45d0eb24 | dcd166d6ab3c8a962ebac3df50669758fd827194 | refs/heads/master | 2022-08-02T10:01:23.758776 | 2021-01-11T16:56:36 | 2021-01-11T16:56:36 | 165,558,412 | 1 | 0 | null | 2022-07-29T22:49:28 | 2019-01-13T21:50:57 | Python | UTF-8 | Python | false | false | 1,085 | py | from django.db import models
from django.utils import timezone
# Create your models here.
class Post(models.Model):
author = models.ForeignKey('auth.User', on_delete=models.CASCADE)
title = models.CharField(max_length=200)
text = models.TextField()
created_date = models.DateTimeField(default=timezone.now)
published_date = models.DateTimeField(blank=True, null=True)
def publish(self):
self.published_date = timezone.now()
self.save()
def __str__(self):
return str(self.title) + ' by ' + str(self.author)
def approved_comments(self):
return self.comments.filter(approved=True)
class Comment(models.Model):
post = models.ForeignKey('blog.Post', on_delete=models.CASCADE, related_name='comments')
author = models.CharField(max_length=200)
text= models.TextField()
created_date = models.DateTimeField(default=timezone.now)
approved = models.BooleanField(default=False)
def approve(self):
self.approve = True
self.save()
def __str__(self):
return self.text
| [
"tuckerwray84@gmail.com"
] | tuckerwray84@gmail.com |
729438ce7d9dfa18db5b7b8dc7d0af0b4fe9937b | 64895f4b8a15f875344d7232aaad54739aca9747 | /app/bestsongs.py | 428e67f73e5f88f5f6ecafc2a5593e44504c71cb | [] | no_license | skipluck/bestsongs-docker | 1e2b61d6a82d0d9a8b20776da06a5071757d8f55 | 0cefbaa3ed5383a2f3a77c62553f4b122ffed1eb | refs/heads/master | 2020-03-18T07:10:41.006138 | 2018-05-22T17:12:20 | 2018-05-22T17:12:20 | 134,437,512 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 927 | py | # BestSongs
from flask import Flask
from flaskext.mysql import MySQL
import os
mysql = MySQL()
app = Flask(__name__)
app.config['MYSQL_DATABASE_USER'] = os.environ['MYSQL_USER']
app.config['MYSQL_DATABASE_PASSWORD'] = os.environ['MYSQL_PASSWORD']
app.config['MYSQL_DATABASE_DB'] = os.environ['MYSQL_DATABASE']
app.config['MYSQL_DATABASE_HOST'] = os.environ['MYSQL_HOST']
mysql.init_app(app)
@app.route('/')
def hello():
cursor = mysql.connect().cursor()
cursor.execute("SELECT song, artist FROM songs ORDER BY RAND() LIMIT 1")
data = cursor.fetchone()
if data is None:
return '<html><head><title>Error</title><body><h1>Database not available!</h1></body></html>'
else:
return '<html><head><title>Best Songs of the Rock Era</title><body><h1>Best Songs of the Rock Era</h1><h2>{}</h2>-- {}</body></html>'.format(data[0], data[1])
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True) | [
"skipluck@outlook.com"
] | skipluck@outlook.com |
731b982ded55e2663dc0e0d29bc2c91250cff82b | 31ec3ca684f466c8ae8bc78d9584bda7b25661c3 | /src/app.py | 9beea55508741a0903bb009e9f803162029ff931 | [] | no_license | jlott-wtw/flask-tutorial | 69e7d5fbee0dc1b7f7cdf368193d549f93b8a828 | 4f2950fafb9f57b4c7cc35f58c65c579223be1a3 | refs/heads/main | 2023-02-25T03:25:10.709075 | 2021-02-03T17:58:16 | 2021-02-03T17:58:16 | 335,717,079 | 0 | 0 | null | 2021-02-03T18:25:06 | 2021-02-03T18:25:05 | null | UTF-8 | Python | false | false | 205 | py | from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def index():
return render_template("index.html")
if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0")
| [
"joe@uicraftsman.com"
] | joe@uicraftsman.com |
cea016516d64349e75bb25cc022212e25872017d | da3e0757e222b4351f86ce629507674cda11bc5b | /35-Pizza-Order-RafaelaOsawe/main.py | 600fdf2b384baf7cd0a48052212e7af83335f146 | [] | no_license | RafaelaOsawe/pizza_anyone | f7dcab0d6c6b230abba1fe27c7e9f84aab190597 | e6ba9d0066da3f7aca9add46a0e2b5fac4dd8b74 | refs/heads/main | 2023-09-05T05:50:09.895472 | 2021-11-16T13:40:06 | 2021-11-16T13:40:06 | 428,239,979 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,342 | py | # A pizza restaurant would like you to create a program that works out the total cost for each pizza that they sell.
# Create a series of print statements and inputs that will allow the customer to type in their pizza requirements
#Make sure that a total_cost variable has been created for the total cost of the pizza
#Create an if statement that will apply £10 if their pizza is thin and £8 if it is thick
#Use a print statement to print the total_cost at the end of the code block so that you can test that the code is working
#There are just two different costs for the size options. If the pizza is larger than 10 inches, then an additional charge of £2 is applied. Create an if statement that will apply this charge based on this condition.
#Use a print statement to print the total cost and test your code.
#If the cheese is not equal to yes, then a discount of 50 pence is applied to the total cost. Create an if statement that will perform this calculation based on the condition.
#There are three different pricing options for the pizza. The margherita pizza doesn't have an additional charge, so decide if this needs to be part of one of your conditions.
#If the pizza is vegetable or vegan, then there is an additional charge of £1.
#If the pizza is Hawaiian or meat feast, then there is an additional charge of £2.
#Decide what if statements and conditions you will need to apply these costs.
#Test your code by using a print statement to print the total cost. Remember to test all possible inputs.
#The voucher code can be applied when the customer purchases an 18-inch pizza and has typed in the correct code which is FunFriday. Create an if statement that checks that both conditions are true and then applies the £2 discount.
#Repeat the order back to the customer and reveal the total cost of the pizza
#Test your code by entering all of the different possible scenarios for ordering a pizza
#Fix any errors that might occur
#Remember to use .lower() or .upper() where required
pizzaPrice = 0.00
print("Thin or thick crust: ")
crust = input()
print("8, 10, 12, 14 or 18")
size = int(input())
print("Cheese or None: ")
cheese = input()
print("Margharita, Vegtable, Vegan, Hawaiian or Meatfeast ")
typeOfPizza = input()
print("Do you have a voucher? (This is only reedemable for 18inch pizzas)")
voucherCode = input()
if crust == "thin":
pizzaPrice = pizzaPrice + 10.00
else:
pizzaPrice = pizzaPrice + 8.00
if size == 8 or 10:
pizzaPrice = pizzaPrice + 0.00
else:
pizzaPrice = pizzaPrice + 2.00
if cheese == "none":
pizzaPrice = pizzaPrice - 0.50
else:
pizzaPrice = pizzaPrice + 1.00
if typeOfPizza == "margharita":
pizzaPrice = pizzaPrice + 0.0
elif typeOfPizza == "vegatable" or "vegan":
pizzaPrice = pizzaPrice + 1.00
else:
pizzaPrice = pizzaPrice + 2.00
if voucherCode == "FunFriday" + size == 18:
pizzaPrice = pizzaPrice - 2.00
else:
print("Sorry your voucher is invalid. ")
print()
print("The total price ypur pizza is £" + pizzaPrice)
#I have completed everything else but, I do not know how to do the voucher section of the code for it ot recognise that its a 18 inch pizza. I just get: Traceback (most recent call last):
#File "main.py", line 59, in <module>
#if voucherCode == "FunFriday" + size == 18:
#TypeError: can only concatenate str (not "int") to str
| [
"noreply@github.com"
] | RafaelaOsawe.noreply@github.com |
1969a00c60b0629cd71bfe27503f2079ef24c039 | c6462a5daf37d630ea7d21db9d74a8ead1f8ecba | /feature_output/isDisease.py | 1331d41641423b864b7d4a2b8ddbef0aa29021fa | [] | no_license | GumpCode/Disease | d96581a27cb5c2dd02eed74508c7d66533d0701b | 6d6452aa8069329c9a0f5bd40dbf37bc285e6e7e | refs/heads/master | 2021-01-10T17:46:42.454246 | 2016-02-26T03:58:13 | 2016-02-26T03:58:13 | 52,574,879 | 2 | 2 | null | null | null | null | UTF-8 | Python | false | false | 1,915 | py | #coding: utf-8
import theano
import cv2
import numpy as np
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolution2D, MaxPooling2D, AveragePooling2D
from keras.optimizers import SGD, Adadelta, Adagrad
from keras.utils import np_utils, generic_utils
from Load_data import load_data
data, label=load_data()
label = np_utils.to_categorical(label, 2)
print ('finish loading data')
batch_size = 111
nb_classes = 2
nb_epoch = 2
data_augmentation = True
img_rows, img_cols = 64, 64
img_channels = 3
#init a model
model = Sequential()
#conv1
model.add(Convolution2D(32, 3, 3, border_mode='same', input_shape=(img_channels, img_rows, img_cols)))
model.add(Activation('relu'))
model.compile(loss='categorical_crossentropy', optimizer='adamax')
a1 = model.predict(data, batch_size=batch_size)
for i in range(793):
for j in range(32):
cv2.imwrite('/home/ganlinhao/image/' + str(i) + '_' + str(j) + '.jpg', a1[i][j])
#conv2
model.add(Convolution2D(32, 3, 3))
model.add(Activation('relu'))
#pool1
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.25))
#conv3
model.add(Convolution2D(64, 3, 3, border_mode='same'))
model.add(Activation('relu'))
#conv4
model.add(Convolution2D(64, 3, 3))
model.add(Activation('relu'))
#pool2
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.25))
model.add(Flatten())
#connect1
model.add(Dense(512))
model.add(Activation('relu'))
model.add(Dropout(0.5))
#softmax
model.add(Dense(nb_classes))
model.add(Activation('softmax'))
#sgd = SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True)
#model.compile(loss='categorical_crossentropy', optimizer=sgd)
model.compile(loss='categorical_crossentropy', optimizer='adamax')
result = model.fit(data, label, batch_size=batch_size,nb_epoch=nb_epoch,shuffle=True,verbose=1,show_accuracy=True,validation_split=0.3)
| [
"gumpglh@qq.com"
] | gumpglh@qq.com |
cc7b665c83f8543103917e758110a0740728df5d | 3fca2d6716aeb04c85f91c92b3c1f2ecdfc3675d | /my_django/wsgi.py | 246127533ab664282da402571810e7f27c9f1d4a | [] | no_license | kimhs1876/new_django | a9c18bf2176eb125b3f7c6c3de25ae834678f599 | 0741a30f0541f5061f91a243f33d021110afe8db | refs/heads/master | 2023-05-04T22:20:07.862367 | 2021-06-01T14:33:25 | 2021-06-01T14:33:25 | 371,668,173 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 395 | py | """
WSGI config for my_django project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'my_django.settings')
application = get_wsgi_application()
| [
"kimhs1876@naver.com"
] | kimhs1876@naver.com |
323f70b3f8204547a3ec94e5bf783ea3f8c6bd48 | bd3945643f5dcc3e844f7104b9de45a0670d3322 | /Exercises/lecture_14_16/02_dialog.py | f05e00f5148f1a22bb797e1d3f3e5670c99b82e4 | [] | no_license | anatshk/SheCodes | 219d036af0cf88ee047728487f87ea782c4588ce | 427d10b056144900e7158e9ac5cf9aa116592cc3 | refs/heads/master | 2021-01-19T01:16:06.008378 | 2019-08-24T09:39:57 | 2019-08-24T09:39:57 | 87,235,551 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 898 | py | from tkinter import *
from tkinter import messagebox
root = Tk()
# *********** Functions ***********
def about():
messagebox.showinfo(title='About', message='blah blah') # show info icon
# messagebox.showwarning(title='About', message='blah blah') # show warning icon
# messagebox.showerror(title='About', message='blah blah') # show error icon
def quit():
exit = messagebox.askyesno(title='quit', message='are you sure?')
if exit > 0:
root.destroy()
return
# *********** Main Menu ***********
menu = Menu(root) # define a Menu object, put in in root window
root.config(menu=menu) # configure the menu object
submenu = Menu(menu) # create a submenu - this will drop down from main menu
menu.add_cascade(label='file', menu=submenu)
submenu.add_command(label='about', command=about)
submenu.add_command(label='exit', command=quit)
root.mainloop()
| [
"as@consumerphysics.com"
] | as@consumerphysics.com |
920c7b795dcb7736a6d1c57d8726c3042a054608 | 8ecc4094237b63a897a27bd368b4d9842e8ae9d2 | /experiment-directory-tools/__init__.py | 5f6e44ccab5372c91bd849e734e4345dd63404a2 | [] | no_license | RedLeader962/experiment-directory-tools | 6ee66f0ffef219a0e8712afd632a35984427acad | c209b8fb4be86251cd68c590007816d3f7de09a3 | refs/heads/master | 2020-03-27T16:27:47.630396 | 2018-09-07T12:49:01 | 2018-09-07T12:49:01 | 146,784,558 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 168 | py | #!/usr/bin/env python
from experiment_directory_tools import clean_result_directory, create_run_directory
__all__ = ["create_run_directory", "clean_result_directory"] | [
"luc.coupal.1@ulaval.ca"
] | luc.coupal.1@ulaval.ca |
e3d5e92a76b6f3a211aabefe26a206f2c8ebe0e8 | a25edcafff4c890210c39bed91d1647bffb3fcee | /Machine Learning/SVM's/SVM.py | 3312dff1bd6e0cdd714045b0d0c2d495fb1abbe4 | [] | no_license | Oregand/4THYEARPROJECT | 68b4f81bfaa8aa39da141312a2697dcf36aa0719 | cbd3b8228e8247129cffb80225ffc6fc1fe75ee7 | refs/heads/master | 2021-01-13T01:59:33.906624 | 2014-06-05T18:14:05 | 2014-06-05T18:14:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,264 | py | """ Example script for SVM classification using PyBrain and LIBSVM
CAVEAT: Needs the libsvm Python file svm.py and the corresponding (compiled) library to reside in the Python path! """
__author__ = "Martin Felder"
__version__ = '$Id$'
import pylab as p
import logging
from os.path import join
from sklearn import *
# load the necessary components
from pybrain.datasets import ClassificationDataSet
from pybrain.utilities import percentError
from pybrain.structure.modules.svmunit import SVMUnit
from pybrain.supervised.trainers.svmtrainer import SVMTrainer
# import some local stuff
from datasets import generateClassificationData, plotData, generateGridData
logging.basicConfig(level=logging.INFO, filename=join('.','testrun.log'),
format='%(asctime)s %(levelname)s %(message)s')
logging.getLogger('').addHandler(logging.StreamHandler())
# load the training and test data sets
trndata = generateClassificationData(20, nClasses=2)
tstdata = generateClassificationData(100, nClasses=2)
# initialize the SVM module and a corresponding trainer
svm = SVMUnit()
trainer = SVMTrainer( svm, trndata )
# train the with fixed meta-parameters
log2C=0. # degree of slack
log2g=1.1 # width of RBF kernels
trainer.train( log2C=log2C, log2g=log2g )
# alternatively, could train the SVM using design-of-experiments grid search
##trainer.train( search="GridSearchDOE" )
# pass data sets through the SVM to get performance
trnresult = percentError( svm.activateOnDataset(trndata), trndata['target'] )
tstresult = percentError( svm.activateOnDataset(tstdata), tstdata['target'] )
print "sigma: %7g, C: %7g, train error: %5.2f%%, test error: %5.2f%%" % (2.0**log2g, 2.0**log2C, trnresult, tstresult)
# generate a grid dataset
griddat, X, Y = generateGridData(x=[-4,8,0.1],y=[-2,3,0.1])
# pass the grid through the SVM, but this time get the raw distance
# from the boundary, not the class
Z = svm.activateOnDataset(griddat, values=True)
# the output format is a bit weird... make it into a decent array
Z = p.array([z.values()[0] for z in Z]).reshape(X.shape)
# make a 2d plot of training data with an decision value contour overlay
fig = p.figure()
plotData(trndata)
p.contourf(X, Y, Z)
p.show() | [
"davidoregan91@gmail.com"
] | davidoregan91@gmail.com |
03ff54224dfdb710b2127f90b62adc825688daf5 | 419637376e445ec9faf04c877d5fb6c09d15903f | /steam/admin/activity/productAuditService.py | ec92efa0a2a88750d9fbbdda4e0b8a68c42dbce8 | [] | no_license | litaojun/steamOmTest | e4203df30acafaa5e282631d77429c0e4483fb88 | 86f84dbd802d947198823e02c2f1ba2695418a76 | refs/heads/master | 2020-04-02T21:48:55.115389 | 2019-07-11T06:08:27 | 2019-07-11T06:08:27 | 154,812,217 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 442 | py | from steam.util.httpUopService import HttpUopService
from opg.bak.uopService import decorator
class ProductAuditService(HttpUopService):
'''
审核活动
'''
def __init__(self, kwargs):
super(ProductAuditService, self).__init__(module = "",
filename = "",
sqlvaluedict = kwargs )
@decorator(["setupAuditActivity"])
def optAuditActivity(self):
self.sendHttpReq() | [
"li.taojun@opg.cn"
] | li.taojun@opg.cn |
a0b916ba59d2287f975c8dd6cacb536734ae2464 | 02a39e3492b37e612a7076fe35bc2c2a08e3426e | /ml/rl/test/preprocessing/test_feature_extractor.py | aa4c899cec483d6904b1c6ba26e6301559e6b45d | [
"BSD-3-Clause"
] | permissive | xuegangwu2016/Horizon | a0fd11c3bd3c763a07d113fbc6fd51d50a15252d | a7633d8375240b757b34645a1fbebb809d2eabf2 | refs/heads/master | 2020-04-10T08:11:56.004183 | 2018-12-07T06:40:34 | 2018-12-07T06:43:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 27,018 | py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import unittest
import numpy as np
import numpy.testing as npt
from caffe2.python import schema, workspace
from ml.rl import types as rlt
from ml.rl.preprocessing.feature_extractor import (
PredictorFeatureExtractor,
TrainingFeatureExtractor,
map_schema,
)
from ml.rl.preprocessing.identify_types import CONTINUOUS, PROBABILITY
from ml.rl.preprocessing.normalization import MISSING_VALUE, NormalizationParameters
from ml.rl.test.utils import NumpyFeatureProcessor
class FeatureExtractorTestBase(unittest.TestCase):
def get_state_normalization_parameters(self):
return {
i: NormalizationParameters(
feature_type=PROBABILITY if i % 2 else CONTINUOUS, mean=0, stddev=1
)
for i in range(1, 5)
}
def get_action_normalization_parameters(self):
# Sorted order: 12, 11, 13
return {
i: NormalizationParameters(
feature_type=CONTINUOUS if i % 2 else PROBABILITY, mean=0, stddev=1
)
for i in range(11, 14)
}
def setup_state_features(self, ws, field):
lengths = np.array([3, 0, 5], dtype=np.int32)
keys = np.array([2, 1, 9, 1, 2, 3, 4, 5], dtype=np.int64)
values = np.arange(8).astype(np.float32)
ws.feed_blob(str(field.lengths()), lengths)
ws.feed_blob(str(field.keys()), keys)
ws.feed_blob(str(field.values()), values)
return lengths, keys, values
def expected_state_features(self, normalize):
# Feature order: 1, 3, 2, 4
dense = np.array(
[
[1, MISSING_VALUE, 0, MISSING_VALUE],
[MISSING_VALUE, MISSING_VALUE, MISSING_VALUE, MISSING_VALUE],
[3, 5, 4, 6],
],
dtype=np.float32,
)
if normalize:
dense = NumpyFeatureProcessor.preprocess_array(
dense, [1, 3, 2, 4], self.get_state_normalization_parameters()
)
return dense
def setup_next_state_features(self, ws, field):
lengths = np.array([2, 2, 4], dtype=np.int32)
keys = np.array([2, 1, 9, 1, 2, 3, 4, 5], dtype=np.int64)
values = np.arange(10, 18).astype(np.float32)
ws.feed_blob(str(field.lengths()), lengths)
ws.feed_blob(str(field.keys()), keys)
ws.feed_blob(str(field.values()), values)
return lengths, keys, values
def expected_next_state_features(self, normalize):
# Feature order: 1, 3, 2, 4
dense = np.array(
[
[11, MISSING_VALUE, 10, MISSING_VALUE],
[13, MISSING_VALUE, MISSING_VALUE, MISSING_VALUE],
[MISSING_VALUE, 15, 14, 16],
],
dtype=np.float32,
)
if normalize:
dense = NumpyFeatureProcessor.preprocess_array(
dense, [1, 3, 2, 4], self.get_state_normalization_parameters()
)
return dense
def expected_tiled_next_state_features(self, normalize):
# NOTE: this depends on lengths of possible next action
# Feature order: 1, 3, 2, 4
dense = np.array(
[
[11, MISSING_VALUE, 10, MISSING_VALUE],
[13, MISSING_VALUE, MISSING_VALUE, MISSING_VALUE],
[13, MISSING_VALUE, MISSING_VALUE, MISSING_VALUE],
],
dtype=np.float32,
)
if normalize:
dense = NumpyFeatureProcessor.preprocess_array(
dense, [1, 3, 2, 4], self.get_state_normalization_parameters()
)
return dense
def setup_action(self, ws, field):
action = np.array([3, 2, 1], dtype=np.int64)
ws.feed_blob(str(field()), action)
return action
def setup_next_action(self, ws, field):
action = np.array([1, 2, 3], dtype=np.int64)
ws.feed_blob(str(field()), action)
return action
def setup_possible_next_actions(self, ws, field):
lengths = np.array([1, 2, 0], dtype=np.int32)
actions = np.array([3, 2, 1], dtype=np.int64)
ws.feed_blob(str(field["lengths"]()), lengths)
ws.feed_blob(str(field["values"]()), actions)
return lengths, actions
def setup_action_features(self, ws, field):
lengths = np.array([2, 4, 2], dtype=np.int32)
keys = np.array([11, 12, 14, 11, 12, 13, 13, 12], dtype=np.int64)
values = np.arange(20, 28).astype(np.float32)
ws.feed_blob(str(field.lengths()), lengths)
ws.feed_blob(str(field.keys()), keys)
ws.feed_blob(str(field.values()), values)
return lengths, keys, values
def expected_action_features(self, normalize):
# Feature order: 12, 11, 13
dense = np.array(
[[21, 20, MISSING_VALUE], [24, 23, 25], [27, MISSING_VALUE, 26]],
dtype=np.float32,
)
if normalize:
dense = NumpyFeatureProcessor.preprocess_array(
dense, [12, 11, 13], self.get_action_normalization_parameters()
)
return dense
def setup_next_action_features(self, ws, field):
lengths = np.array([4, 2, 2], dtype=np.int32)
keys = np.array([11, 12, 14, 13, 12, 13, 11, 13], dtype=np.int64)
values = np.arange(30, 38).astype(np.float32)
ws.feed_blob(str(field.lengths()), lengths)
ws.feed_blob(str(field.keys()), keys)
ws.feed_blob(str(field.values()), values)
return lengths, keys, values
def expected_next_action_features(self, normalize):
# Feature order: 12, 11, 13
dense = np.array(
[[31, 30, 33], [34, MISSING_VALUE, 35], [MISSING_VALUE, 36, 37]],
dtype=np.float32,
)
if normalize:
dense = NumpyFeatureProcessor.preprocess_array(
dense, [12, 11, 13], self.get_action_normalization_parameters()
)
return dense
def setup_possible_next_actions_features(self, ws, field):
lengths = np.array([1, 2, 0], dtype=np.int32)
values_lengths = np.array([1, 2, 3], dtype=np.int32)
keys = np.array([11, 12, 14, 11, 13, 12], dtype=np.int64)
values = np.arange(40, 46).astype(np.float32)
ws.feed_blob(str(field["lengths"]()), lengths)
ws.feed_blob(str(field["values"].lengths()), values_lengths)
ws.feed_blob(str(field["values"].keys()), keys)
ws.feed_blob(str(field["values"].values()), values)
return lengths, values_lengths, keys, values
def expected_possible_next_actions_features(self, normalize):
# Feature order: 12, 11, 13
dense = np.array(
[
[MISSING_VALUE, 40, MISSING_VALUE],
[41, MISSING_VALUE, MISSING_VALUE],
[45, 43, 44],
],
dtype=np.float32,
)
if normalize:
dense = NumpyFeatureProcessor.preprocess_array(
dense, [12, 11, 13], self.get_action_normalization_parameters()
)
return dense
def setup_reward(self, ws, field):
reward = np.array([0.5, 0.6, 0.7], dtype=np.float32)
ws.feed_blob(str(field()), reward)
return reward
def create_ws_and_net(self, extractor):
net, init_net = extractor.create_net()
ws = workspace.Workspace()
ws.create_net(init_net)
ws.run(init_net)
for b in net.input_record().field_blobs():
ws.create_blob(str(b))
ws.create_net(net)
return ws, net
def check_create_net_spec(
self, extractor, expected_input_record, expected_output_record
):
net, init_net = extractor.create_net()
# First, check that all outputs of init_net are used in net
for b in init_net.external_outputs:
self.assertTrue(net.is_external_input(b))
# Second, check that input and output records are set
input_record = net.input_record()
output_record = net.output_record()
self.assertIsNotNone(input_record)
self.assertIsNotNone(output_record)
# Third, check that the fields match what is expected
self.assertEqual(
set(expected_input_record.field_names()), set(input_record.field_names())
)
self.assertEqual(
set(expected_output_record.field_names()), set(output_record.field_names())
)
class TestTrainingFeatureExtractor(FeatureExtractorTestBase):
def create_extra_input_record(self, net):
return net.input_record() + schema.NewRecord(
net,
schema.Struct(
("reward", schema.Scalar()), ("action_probability", schema.Scalar())
),
)
def setup_extra_data(self, ws, input_record):
extra_data = rlt.ExtraData(
action_probability=np.array([0.11, 0.21, 0.13], dtype=np.float32)
)
ws.feed_blob(
str(input_record.action_probability()), extra_data.action_probability
)
return extra_data
def test_extract_max_q_discrete_action(self):
self._test_extract_max_q_discrete_action(normalize=False)
def test_extract_max_q_discrete_action_normalize(self):
self._test_extract_max_q_discrete_action(normalize=True)
def _test_extract_max_q_discrete_action(self, normalize):
extractor = TrainingFeatureExtractor(
state_normalization_parameters=self.get_state_normalization_parameters(),
max_q_learning=True,
normalize=normalize,
)
# Setup
ws, net = self.create_ws_and_net(extractor)
input_record = self.create_extra_input_record(net)
self.setup_state_features(ws, input_record.state_features)
self.setup_next_state_features(ws, input_record.next_state_features)
action = self.setup_action(ws, input_record.action)
possible_next_actions = self.setup_possible_next_actions(
ws, input_record.possible_next_actions
)
reward = self.setup_reward(ws, input_record.reward)
extra_data = self.setup_extra_data(ws, input_record)
# Run
ws.run(net)
res = extractor.extract(ws, input_record, net.output_record())
o = res.training_input
npt.assert_array_equal(reward.reshape(-1, 1), o.reward.numpy())
npt.assert_array_equal(
extra_data.action_probability.reshape(-1, 1),
res.extras.action_probability.numpy(),
)
npt.assert_array_equal(action, o.action.numpy())
npt.assert_array_equal(
possible_next_actions[0], o.possible_next_actions.lengths.numpy()
)
npt.assert_array_equal(
possible_next_actions[1], o.possible_next_actions.actions.numpy()
)
npt.assert_allclose(
self.expected_state_features(normalize),
o.state.float_features.numpy(),
rtol=1e-6,
)
npt.assert_allclose(
self.expected_next_state_features(normalize),
o.next_state.float_features.numpy(),
rtol=1e-6,
)
def test_extract_sarsa_discrete_action(self):
self._test_extract_sarsa_discrete_action(normalize=False)
def test_extract_sarsa_discrete_action_normalize(self):
self._test_extract_sarsa_discrete_action(normalize=True)
def _test_extract_sarsa_discrete_action(self, normalize):
extractor = TrainingFeatureExtractor(
state_normalization_parameters=self.get_state_normalization_parameters(),
max_q_learning=False,
normalize=normalize,
)
# Setup
ws, net = self.create_ws_and_net(extractor)
input_record = self.create_extra_input_record(net)
self.setup_state_features(ws, input_record.state_features)
self.setup_next_state_features(ws, input_record.next_state_features)
action = self.setup_action(ws, input_record.action)
next_action = self.setup_next_action(ws, input_record.next_action)
reward = self.setup_reward(ws, input_record.reward)
extra_data = self.setup_extra_data(ws, input_record)
# Run
ws.run(net)
res = extractor.extract(ws, input_record, net.output_record())
o = res.training_input
npt.assert_array_equal(reward.reshape(-1, 1), o.reward.numpy())
npt.assert_array_equal(
extra_data.action_probability.reshape(-1, 1),
res.extras.action_probability.numpy(),
)
npt.assert_array_equal(action, o.action.numpy())
npt.assert_array_equal(next_action, o.next_action.numpy())
npt.assert_allclose(
self.expected_state_features(normalize),
o.state.float_features.numpy(),
rtol=1e-6,
)
npt.assert_allclose(
self.expected_next_state_features(normalize),
o.next_state.float_features.numpy(),
rtol=1e-6,
)
def test_extract_max_q_parametric_action(self):
self._test_extract_max_q_parametric_action(normalize=False)
def test_extract_max_q_parametric_action_normalize(self):
self._test_extract_max_q_parametric_action(normalize=True)
def _test_extract_max_q_parametric_action(self, normalize):
extractor = TrainingFeatureExtractor(
state_normalization_parameters=self.get_state_normalization_parameters(),
action_normalization_parameters=self.get_action_normalization_parameters(),
max_q_learning=True,
normalize=normalize,
)
# Setup
ws, net = self.create_ws_and_net(extractor)
input_record = self.create_extra_input_record(net)
self.setup_state_features(ws, input_record.state_features)
self.setup_next_state_features(ws, input_record.next_state_features)
self.setup_action_features(ws, input_record.action)
possible_next_actions = self.setup_possible_next_actions_features(
ws, input_record.possible_next_actions
)
reward = self.setup_reward(ws, input_record.reward)
extra_data = self.setup_extra_data(ws, input_record)
# Run
ws.run(net)
res = extractor.extract(ws, input_record, net.output_record())
o = res.training_input
npt.assert_array_equal(reward.reshape(-1, 1), o.reward.numpy())
npt.assert_array_equal(
extra_data.action_probability.reshape(-1, 1),
res.extras.action_probability.numpy(),
)
npt.assert_allclose(
self.expected_action_features(normalize),
o.action.float_features.numpy(),
rtol=1e-6,
)
npt.assert_array_equal(
possible_next_actions[0], o.possible_next_actions.lengths.numpy()
)
npt.assert_allclose(
self.expected_possible_next_actions_features(normalize),
o.possible_next_actions.actions.float_features.numpy(),
rtol=1e-6,
)
npt.assert_allclose(
self.expected_state_features(normalize),
o.state.float_features.numpy(),
rtol=1e-6,
)
npt.assert_allclose(
self.expected_tiled_next_state_features(normalize),
o.tiled_next_state.float_features.numpy(),
rtol=1e-6,
)
def test_extract_sarsa_parametric_action(self):
self._test_extract_sarsa_parametric_action(normalize=False)
def test_extract_sarsa_parametric_action_normalize(self):
self._test_extract_sarsa_parametric_action(normalize=True)
def _test_extract_sarsa_parametric_action(self, normalize):
extractor = TrainingFeatureExtractor(
state_normalization_parameters=self.get_state_normalization_parameters(),
action_normalization_parameters=self.get_action_normalization_parameters(),
max_q_learning=False,
normalize=normalize,
)
# Setup
ws, net = self.create_ws_and_net(extractor)
input_record = self.create_extra_input_record(net)
self.setup_state_features(ws, input_record.state_features)
self.setup_next_state_features(ws, input_record.next_state_features)
self.setup_action_features(ws, input_record.action)
self.setup_next_action_features(ws, input_record.next_action)
reward = self.setup_reward(ws, input_record.reward)
extra_data = self.setup_extra_data(ws, input_record)
# Run
ws.run(net)
res = extractor.extract(ws, input_record, net.output_record())
o = res.training_input
npt.assert_array_equal(reward.reshape(-1, 1), o.reward.numpy())
npt.assert_array_equal(
extra_data.action_probability.reshape(-1, 1),
res.extras.action_probability.numpy(),
)
npt.assert_allclose(
self.expected_action_features(normalize),
o.action.float_features.numpy(),
rtol=1e-6,
)
npt.assert_allclose(
self.expected_next_action_features(normalize),
o.next_action.float_features.numpy(),
rtol=1e-6,
)
npt.assert_allclose(
self.expected_state_features(normalize),
o.state.float_features.numpy(),
rtol=1e-6,
)
npt.assert_allclose(
self.expected_next_state_features(normalize),
o.next_state.float_features.numpy(),
rtol=1e-6,
)
def test_create_net_max_q_discrete_action(self):
extractor = TrainingFeatureExtractor(
state_normalization_parameters=self.get_state_normalization_parameters(),
max_q_learning=True,
)
expected_input_record = schema.Struct(
("state_features", map_schema()),
("next_state_features", map_schema()),
("action", schema.Scalar()),
("possible_next_actions", schema.List(schema.Scalar())),
)
expected_output_record = schema.Struct(
("state", schema.Scalar()),
("next_state", schema.Scalar()),
("action", schema.Scalar()),
("possible_next_actions", schema.List(schema.Scalar())),
)
self.check_create_net_spec(
extractor, expected_input_record, expected_output_record
)
def test_create_net_sarsa_discrete_action(self):
extractor = TrainingFeatureExtractor(
state_normalization_parameters=self.get_state_normalization_parameters(),
max_q_learning=False,
)
expected_input_record = schema.Struct(
("state_features", map_schema()),
("next_state_features", map_schema()),
("action", schema.Scalar()),
("next_action", schema.Scalar()),
)
expected_output_record = schema.Struct(
("state", schema.Scalar()),
("next_state", schema.Scalar()),
("action", schema.Scalar()),
("next_action", schema.Scalar()),
)
self.check_create_net_spec(
extractor, expected_input_record, expected_output_record
)
def test_create_net_max_q_parametric_action(self):
self._test_create_net_max_q_parametric_action(normalize=False)
def test_create_net_max_q_parametric_action_normalize(self):
self._test_create_net_max_q_parametric_action(normalize=True)
def _test_create_net_max_q_parametric_action(self, normalize):
extractor = TrainingFeatureExtractor(
state_normalization_parameters=self.get_state_normalization_parameters(),
action_normalization_parameters=self.get_action_normalization_parameters(),
max_q_learning=True,
normalize=normalize,
)
expected_input_record = schema.Struct(
("state_features", map_schema()),
("next_state_features", map_schema()),
("action", map_schema()),
("possible_next_actions", schema.List(map_schema())),
)
expected_output_record = schema.Struct(
("state", schema.Scalar()),
("tiled_next_state", schema.Scalar()),
("action", schema.Scalar()),
("possible_next_actions", schema.List(schema.Scalar())),
)
self.check_create_net_spec(
extractor, expected_input_record, expected_output_record
)
def test_create_net_sarsa_parametric_action(self):
self._test_create_net_sarsa_parametric_action(normalize=False)
def test_create_net_sarsa_parametric_action_normalize(self):
self._test_create_net_sarsa_parametric_action(normalize=True)
def _test_create_net_sarsa_parametric_action(self, normalize):
extractor = TrainingFeatureExtractor(
state_normalization_parameters=self.get_state_normalization_parameters(),
action_normalization_parameters=self.get_action_normalization_parameters(),
max_q_learning=False,
normalize=normalize,
)
expected_input_record = schema.Struct(
("state_features", map_schema()),
("next_state_features", map_schema()),
("action", map_schema()),
("next_action", map_schema()),
)
expected_output_record = schema.Struct(
("state", schema.Scalar()),
("next_state", schema.Scalar()),
("action", schema.Scalar()),
("next_action", schema.Scalar()),
)
self.check_create_net_spec(
extractor, expected_input_record, expected_output_record
)
class TestPredictorFeatureExtractor(FeatureExtractorTestBase):
def setup_float_features(self, ws, field):
lengths = np.array([3 + 2, 0 + 4, 5 + 2], dtype=np.int32)
keys = np.array(
[2, 11, 12, 1, 14, 11, 12, 13, 9, 1, 13, 12, 2, 3, 4, 5], dtype=np.int64
)
values = np.array(
[0, 20, 21, 1, 22, 23, 24, 25, 2, 3, 26, 27, 4, 5, 6, 7], dtype=np.float32
)
# values = np.arange(8).astype(np.float32)
ws.feed_blob(str(field.lengths()), lengths)
ws.feed_blob(str(field.keys()), keys)
ws.feed_blob(str(field.values()), values)
return lengths, keys, values
def expected_state_features(self, normalize):
# Feature order: 1, 3, 2, 4
dense = np.array(
[
[1, MISSING_VALUE, 0, MISSING_VALUE],
[MISSING_VALUE, MISSING_VALUE, MISSING_VALUE, MISSING_VALUE],
[3, 5, 4, 6],
],
dtype=np.float32,
)
if normalize:
dense = NumpyFeatureProcessor.preprocess_array(
dense, [1, 3, 2, 4], self.get_state_normalization_parameters()
)
return dense
def expected_action_features(self, normalize):
# Feature order: 12, 11, 13
dense = np.array(
[[21, 20, MISSING_VALUE], [24, 23, 25], [27, MISSING_VALUE, 26]],
dtype=np.float32,
)
if normalize:
dense = NumpyFeatureProcessor.preprocess_array(
dense, [12, 11, 13], self.get_action_normalization_parameters()
)
return dense
def test_extract_no_action(self):
self._test_extract_no_action(normalize=False)
def test_extract_no_action_normalize(self):
self._test_extract_no_action(normalize=True)
def _test_extract_no_action(self, normalize):
extractor = PredictorFeatureExtractor(
state_normalization_parameters=self.get_state_normalization_parameters(),
normalize=normalize,
)
# Setup
ws, net = self.create_ws_and_net(extractor)
input_record = net.input_record()
self.setup_float_features(ws, input_record.float_features)
# Run
ws.run(net)
res = extractor.extract(ws, input_record, net.output_record())
npt.assert_allclose(
self.expected_state_features(normalize),
res.state.float_features.numpy(),
rtol=1e-6,
)
def test_extract_parametric_action(self):
self._test_extract_parametric_action(normalize=False)
def test_extract_parametric_action_normalize(self):
self._test_extract_parametric_action(normalize=True)
def _test_extract_parametric_action(self, normalize):
extractor = PredictorFeatureExtractor(
state_normalization_parameters=self.get_state_normalization_parameters(),
action_normalization_parameters=self.get_action_normalization_parameters(),
normalize=normalize,
)
# Setup
ws, net = self.create_ws_and_net(extractor)
input_record = net.input_record()
self.setup_float_features(ws, input_record.float_features)
# Run
ws.run(net)
res = extractor.extract(ws, input_record, net.output_record())
npt.assert_allclose(
self.expected_action_features(normalize),
res.action.float_features.numpy(),
rtol=1e-6,
)
npt.assert_allclose(
self.expected_state_features(normalize),
res.state.float_features.numpy(),
rtol=1e-6,
)
def test_create_net_sarsa_no_action(self):
self._test_create_net_sarsa_no_action(normalize=False)
def test_create_net_sarsa_no_action_normalize(self):
self._test_create_net_sarsa_no_action(normalize=True)
def _test_create_net_sarsa_no_action(self, normalize):
extractor = PredictorFeatureExtractor(
state_normalization_parameters=self.get_state_normalization_parameters(),
normalize=normalize,
)
expected_input_record = schema.Struct(("float_features", map_schema()))
expected_output_record = schema.Struct(("state", schema.Scalar()))
self.check_create_net_spec(
extractor, expected_input_record, expected_output_record
)
def test_create_net_parametric_action(self):
self._test_create_net_parametric_action(normalize=False)
def test_create_net_parametric_action_normalize(self):
self._test_create_net_parametric_action(normalize=True)
def _test_create_net_parametric_action(self, normalize):
extractor = PredictorFeatureExtractor(
state_normalization_parameters=self.get_state_normalization_parameters(),
action_normalization_parameters=self.get_action_normalization_parameters(),
normalize=normalize,
)
expected_input_record = schema.Struct(("float_features", map_schema()))
expected_output_record = schema.Struct(
("state", schema.Scalar()), ("action", schema.Scalar())
)
self.check_create_net_spec(
extractor, expected_input_record, expected_output_record
)
| [
"facebook-github-bot@users.noreply.github.com"
] | facebook-github-bot@users.noreply.github.com |
043726843b64f7026111458e53c6551599ad3e12 | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p03328/s713805169.py | 9bf51a8dd2d62f9ce6c096b400cb84417951bd79 | [] | no_license | Aasthaengg/IBMdataset | 7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901 | f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8 | refs/heads/main | 2023-04-22T10:22:44.763102 | 2021-05-13T17:27:22 | 2021-05-13T17:27:22 | 367,112,348 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 454 | py | import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce
rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7
a, b = rm()
c = b - a
c = c*(c+1)//2
print(c-b)
| [
"66529651+Aastha2104@users.noreply.github.com"
] | 66529651+Aastha2104@users.noreply.github.com |
2f33717119e1037f6daa632209ccc67ce2da79ba | 7a92877018d91ca697d3af9c4a7dfe64710d9417 | /algorithm/python/MachineLearning/Apriori.py | 45f2c91abbe8f7d837f9b122a83996586b2bbf9e | [] | no_license | TonyMou/Algorithm | c39cc896ee44af56562d807bb158ce88d0b9760b | 8f58eebc863c2eca158c351425cc7d89c839102f | refs/heads/master | 2020-12-02T03:04:00.329602 | 2016-08-30T03:04:48 | 2016-08-30T03:04:48 | 66,848,110 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,540 | py | # -*- coding: utf-8 -*-
def loadDataSet():
return [[1, 3, 4], [2, 3, 5], [1, 2, 3, 5], [2, 5]]
def createC1(dataSet):
C1 = []
for transaction in dataSet:
for item in transaction:
if not [item] in C1:
C1.append([item])
C1.sort()
return map(frozenset, C1)
def scanD(D, Ck, minSupport):
ssCnt = {}
for tid in D:
for can in Ck:
if can.issubset(tid):
if can not in ssCnt:
ssCnt[can] = 1
else:
ssCnt[can] += 1
numItems = float(len(D))
retList = []
supportData = {}
for key in ssCnt:
support = ssCnt[key] / numItems
if support >= minSupport:
retList.insert(0, key)
supportData[key] = support
return retList, supportData
def aprioriGen(Lk, k):
retList = []
lenLk = len(Lk)
for i in xrange(lenLk):
for j in xrange(i + 1, lenLk):
L1 = list(Lk[i])[: k - 2]
L2 = list(Lk[j])[: k - 2]
L1.sort()
L2.sort()
if L1 == L2:
retList.append(Lk[i] | Lk[j])
return retList
def apriori(dataSet, minSupport=0.5):
C1 = createC1(dataSet)
D = map(set, dataSet)
L1, supportData = scanD(D, C1, minSupport)
L = [L1]
k = 2
while (len(L[k - 2]) > 0):
Ck = aprioriGen(L[k - 2], k)
Lk, supK = scanD(D, Ck, minSupport)
supportData.update(supK)
L.append(Lk)
k += 1
return L, supportData
| [
"liutuo@outlook.com"
] | liutuo@outlook.com |
f021bd45d6ee149fbd6949dd30fa1aaf4fe1e125 | 8198dd21a5fb2ca0717c013b52b29f8c82ba23b6 | /companies/migrations/0006_auto_20171116_1705.py | 5937564ff10c8abf34b86447e0fad03f1aa7c698 | [] | no_license | Code-Institute-Submissions/Project3GI | 3f3ecdaeb3ceaca1addf9e2a5739d0bbf870b554 | 841d94b45bf12c5ef709b5283218e261cecbdfa3 | refs/heads/master | 2021-05-06T11:31:12.896386 | 2017-12-14T16:24:04 | 2017-12-14T16:24:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 480 | py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-11-16 17:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('companies', '0005_companytrade_date_created'),
]
operations = [
migrations.AlterField(
model_name='companytrade',
name='date_created',
field=models.DateTimeField(auto_now_add=True),
),
]
| [
"kaiforward123@gmail.com"
] | kaiforward123@gmail.com |
01fbcb3a3e835adf648c78a175cf15859e65174b | 6ee130a0990cc49d1f5aff5ddc7ed734e3e21162 | /index/context_processors.py | 105de95eabaf332e6bab75b31202affd50c21e3f | [] | no_license | Juggernaut-98/Drug-store | c504d582a335fd55ff924b71c48d79bdef6da3fe | 5d902c8878ebc6a4da13b36ad10bde3220c2dfc6 | refs/heads/master | 2022-02-17T22:59:54.525759 | 2022-02-01T21:24:47 | 2022-02-01T21:24:47 | 165,412,977 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 190 | py | from products.models import category
def categories(request):
categories=[]
for key in category.objects.all():
categories.append(key)
return {'categories': categories}
| [
"tayyab.athar.saleem@gmail.com"
] | tayyab.athar.saleem@gmail.com |
20a8d63f94bd59917256072940521595da8b1352 | 796c8bd841d529afcc093f2b3e1ffc03a948b440 | /deep_learning/network/Connection.py | 431fbfc626cd219b161c0ae9b10500b1d75cedc3 | [] | no_license | QcQcM/visualComputingCourse | e24fa17c80091ef1d674597a8ee64e017f49a211 | 422ad3b3bf1b5f21d6b2a8179ef22fd33fa04e23 | refs/heads/master | 2020-09-14T07:41:20.893861 | 2020-02-12T05:45:39 | 2020-02-12T05:45:39 | 223,067,759 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 363 | py | class Connection(object):
def __init__(self, input_node, output_node, weight, learn_rate):
self.input_node = input_node
self.output_node = output_node
self.weight = weight
self.learn_rate = learn_rate
def update_weight(self):
self.weight += self.learn_rate * self.output_node.error * self.output_node.output_data
| [
"708805642@qq.com"
] | 708805642@qq.com |
37ed3ba6d3cc4f00202b0465713769024a60819c | a9bde343d9c23fb0b2a3e9b8e87305d8daedc6ef | /blog/migrations/0004_auto_20190805_2340.py | c27025e3093cd0372064d8281b0d572b9b02970f | [] | no_license | Donghwa96/sixproject | cc9a37aa91edaceaba8eb62bed669aefa828f50f | 3c9e79d01b5e77be27c9542955d377af5a82bcc8 | refs/heads/master | 2022-12-06T21:12:40.955191 | 2019-08-15T16:28:48 | 2019-08-15T16:28:48 | 202,531,508 | 0 | 0 | null | 2022-11-22T04:11:34 | 2019-08-15T11:46:52 | JavaScript | UTF-8 | Python | false | false | 698 | py | # Generated by Django 2.2.4 on 2019-08-05 14:40
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('blog', '0003_auto_20190805_2336'),
]
operations = [
migrations.RemoveField(
model_name='comment',
name='author',
),
migrations.AddField(
model_name='comment',
name='comment_writer',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
]
| [
"ensk960405@gmail.com"
] | ensk960405@gmail.com |
f049b38dd78617eb496ff0fcb6c2524c5dd784dc | 9191ab3307791847f15083f2884b5c30cce6dc24 | /produtor/urls.py | 05ccd8d2f50663d81ca0717a1faf31e145260629 | [] | no_license | Nelzio/hialitics | 7f1769dc5e3d4c167d10402df125a8f824f62ae6 | 616ef6deb9f60f6c66ba55544c79fc8b7b279e0a | refs/heads/master | 2022-12-10T10:47:27.304383 | 2019-03-17T06:34:16 | 2019-03-17T06:34:16 | 175,998,064 | 0 | 0 | null | 2022-12-08T04:52:34 | 2019-03-16T16:45:12 | HTML | UTF-8 | Python | false | false | 702 | py | from django.urls import path, include
from . import views
from rest_framework import routers
router = routers.DefaultRouter()
router.register('endereco', views.EnderecoAPI)
router.register('contacto', views.ContactoAPI)
router.register('produtor', views.ProdutorAPI)
router.register('pavilhao', views.PavilhaoAPI)
router.register('ciclo', views.CicloAPI)
router.register('vacinacao', views.VacinacaoAPI)
router.register('req-medicamento', views.RequisicaoRacaoAPI)
router.register('consumo-racao', views.ConsumoRacaoAPI)
router.register('mortalidade', views.MortalidadeAPI)
router.register('peso', views.PesoAPI),
urlpatterns = [
path('api/', include(router.urls), name='url_produtor_api'),
]
| [
"nelziositoe@gmail.com"
] | nelziositoe@gmail.com |
f096553bf112edde9a685cccede57835e9c15dd8 | 392a35174450d1151d276481be4bb4c1ed1fc841 | /chapter-05/Q06_conversion.py | d280bd750de009a1f698bee7dc71814d7822e90f | [] | no_license | jcockbain/ctci-solutions | 8f96a87532a7581cdfc55c29c8684fcdfab77a62 | 6854e9f6c7074ae22e01c3e5f6c03f641e507cd7 | refs/heads/master | 2023-01-15T16:59:58.038900 | 2020-11-28T09:14:36 | 2020-11-28T09:14:36 | 202,898,842 | 6 | 0 | null | 2020-11-28T09:14:37 | 2019-08-17T15:33:25 | Python | UTF-8 | Python | false | false | 254 | py | import unittest
def conversion(n1, n2):
c = n1 ^ n2
count = 0
while c:
c &= c - 1
count += 1
return count
class Test(unittest.TestCase):
def test_conversion(self):
self.assertEqual(2, conversion(29, 15))
| [
"james.cockbain@ibm.com"
] | james.cockbain@ibm.com |
d3c04239cbf82fb6c83edd7f0d839a76a25a1fb7 | c19ca6779f247572ac46c6f95327af2374135600 | /backtrack/leetcode 784 Letter Case Permutation.py | 7145ae98631ee4d97b9ba49b7d4cfe96f90f5f24 | [] | no_license | clhchtcjj/Algorithm | aae9c90d945030707791d9a98d1312e4c07705f8 | aec68ce90a9fbceaeb855efc2c83c047acbd53b5 | refs/heads/master | 2021-01-25T14:24:08.037204 | 2018-06-11T14:31:38 | 2018-06-11T14:31:38 | 123,695,313 | 5 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,006 | py | __author__ = 'CLH'
'''
Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible strings we could create.
'''
class Solution(object):
def __init__(self):
self.S = []
self.answer = []
self.total_answer = []
def is_a_solution(self,k):
return k == len(self.S)
def process_solution(self):
self.total_answer.append(''.join(self.answer))
def constact_candiates(self, k):
if self.S[k].isalpha():
if ord(self.S[k]) > 96:
return [self.S[k],chr(ord(self.S[k])-32)]
else:
return [chr(ord(self.S[k])+32),self.S[k]]
else:
return [self.S[k]]
def backtrack(self,k):
if self.is_a_solution(k):
self.process_solution()
else:
k = k + 1
candidates = self.constact_candiates(k-1)
for ch in candidates:
self.answer.append(ch)
self.backtrack(k)
self.answer.pop()
if k == len(self.answer):
return
def letterCasePermutation(self, S):
"""
:type S: str
:rtype: List[str]
"""
self.S = S
self.backtrack(0)
return self.total_answer
# 简单解法
# def letterCasePermutation(self, S):
# ans = [[]]
#
# for char in S:
# n = len(ans)
# if char.isalpha():
# for i in range(n):
# ans.append(ans[i][:])
# ans[i].append(char.lower())
# ans[n+i].append(char.upper())
# else:
# for i in range(n):
# ans[i].append(char)
# # temp = list(map("".join, ans))
# # print(temp)
# return list(map("".join, ans))
if __name__ == "__main__":
S = Solution()
print(S.letterCasePermutation("a1b2")) | [
"15720622991@163.com"
] | 15720622991@163.com |
ed040008ab01ccae838c6f31a4b81b04effa632f | 9159464e4ee0112d4b73f948919d99addafe9b1c | /veggie411/admin.py | 5f3c1be5c0aaad8b37e103df99e86b93c86dc581 | [] | no_license | josefsresearch/veggie411 | dbb8434a36461c23922525fc90fa20cfd5de5279 | b843bd8906b14927573f4ffe5c27c87151545623 | refs/heads/master | 2020-03-29T13:31:05.022528 | 2013-08-03T12:40:59 | 2013-08-03T12:40:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 96 | py | from django.contrib import admin
from veggie411.models import Email
admin.site.register(Email)
| [
"josefsresearch@gmail.com"
] | josefsresearch@gmail.com |
cf64f9a87f6ef63aa7b54b05ab9a7e7bdcb36c00 | 1f70857ff5425aa5f65afb7fce6c172a65a70338 | /mvsrvd/db.py | adc402807c029e36661c1aa04aedd9670da0e323 | [] | no_license | SpComb/myottd2 | da0d87304f50349667a8faae59dc903e4d5ef68f | 599c3720ec92a711bb91f99c7d4b129a96a2aa0a | refs/heads/master | 2021-07-18T21:16:00.399021 | 2017-10-25T09:35:19 | 2017-10-25T09:35:19 | 108,247,168 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,859 | py | from twisted.internet.defer import returnValue, inlineCallbacks, maybeDeferred
from secrets import db_password
import settings, errors
from lib.db import DB, callFromTransaction
db = DB(settings, db_password)
@db.wrapAsTransaction
def initialize_server (trans, server_id, backend_create_cb) :
# fetch an unused server_location for use with the new server
res = db._queryOne(trans, """
SELECT
id, ip, context
FROM
v_server_locations_unused
ORDER BY
id ASC
LIMIT 1
"""
)
if not res :
raise errors.InitServer_NoMoreSlots()
loc_id, loc_ip, loc_ctx = res
# update the server to use this location
mod = db._modifyForRowcount(trans, """
UPDATE servers SET
location = %s
WHERE id = %s
""",
loc_id, server_id
)
assert mod, "server went away (servers-update had zero rowcount)"
# fetch the resource limit information
res = db._queryOne(trans, """
SELECT
rc.hdd_size
FROM
resource_classes rc INNER JOIN servers s
ON s.res_class = rc.name
WHERE
s.id = %s
""",
server_id
)
assert res, "invalid res_class"
res_disk, = res
# call the given cb that does the actual backend creation
cb_ret = callFromTransaction(backend_create_cb, loc_ip, loc_ctx, res_disk)
# nothing to return
return None
@inlineCallbacks
def server_info (server_id) :
res = yield db.queryOne("""
SELECT
vu.username,
s.name
FROM
servers s LEFT JOIN v_usernames vu
ON s.owner = vu.id
WHERE
s.id = %s
""",
server_id
)
if not res :
raise errors.Common_NoSuchServer()
returnValue( res )
@inlineCallbacks
def server_details (server_id) :
res = yield db.queryOne("""
SELECT
vu.username,
s.name,
s.version,
sl.port
FROM
servers s INNER JOIN v_usernames vu
ON s.owner = vu.id
INNER JOIN server_locations sl
ON s.location = sl.id
WHERE
s.id = %s
""",
server_id
)
if not res :
raise errors.Common_NoSuchServer()
returnValue( res )
@inlineCallbacks
def server_context_id (server_id) :
res = yield db.queryOne("""
SELECT
sl.context
FROM
servers s INNER JOIN server_locations sl
ON s.location = sl.id
WHERE
s.id = %s
""",
server_id
)
if not res :
raise errors.Common_NoSuchServer()
returnValue( res )
| [
"terom@fixme.fi"
] | terom@fixme.fi |
99dd30f23ee4e20084f957c62cc8b8ebfd897604 | 2b2b5fe4d7684a79443a8fc798786accc99b8179 | /template_store/models.py | e620213b676c9e3737cb67850e007074cae8a7be | [] | no_license | ewanlockwood/django-fullstack-project | 07701a7447f4fbcee3060750862a5b673a2a972f | 456537d56f074baf3c59a62957aa32eed8f7c410 | refs/heads/master | 2020-08-01T18:23:56.934968 | 2019-10-04T10:50:32 | 2019-10-04T10:50:32 | 211,075,638 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,184 | py | from django.db import models
# Create your models here.
class Template(models.Model):
title = models.CharField('Template Title', max_length =30)
description = models.TextField()
image_url = models.CharField('Template Image Url', max_length = 300)
color = models.CharField('Template Color', max_length = 10, default=None, null=True)
price = models.DecimalField(max_digits=6, decimal_places=2, default=None, null=True)
def mean_rating(self):
self.reviews.all() # get all ratings
def __str__(self):
return self.title
# then compute mean rating and return it
class User(models.Model):
name = models.CharField("User's Name", max_length=30)
def __str__(self):
return self.name
class Review(models.Model):
review_title = models.CharField('Review Title', max_length=30, default=None)
template = models.ForeignKey(Template, on_delete=models.CASCADE, default=None)
user = models.ForeignKey(User, on_delete=models.CASCADE)
score = models.FloatField('Score')
comment = models.CharField('Review Comment', max_length=300)
def __str__(self):
return self.review_title
| [
"ubuntu@ip-172-31-27-44.ec2.internal"
] | ubuntu@ip-172-31-27-44.ec2.internal |
56a2b628001cbc8b80e9af74b4972644b513bd67 | 81407be1385564308db7193634a2bb050b4f822e | /library/lib_study/138_mm_imghdr.py | b2e25a38bf54fb2a4859d179ee87719fc5ae4348 | [
"MIT"
] | permissive | gottaegbert/penter | 6db4f7d82c143af1209b4259ba32145aba7d6bd3 | 8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d | refs/heads/master | 2022-12-30T14:51:45.132819 | 2020-10-09T05:33:23 | 2020-10-09T05:33:23 | 305,266,398 | 0 | 0 | MIT | 2020-10-19T04:56:02 | 2020-10-19T04:53:05 | null | UTF-8 | Python | false | false | 210 | py | # imghdr模块 推测文件或字节流中的图像的类型
import imghdr
print(imghdr.what('bass.gif'))
# gif
# 可以识别的图像类型 https://docs.python.org/zh-cn/3/library/imghdr.html#imghdr.what
| [
"350840291@qq.com"
] | 350840291@qq.com |
9a728c8b4a66cbb3a7552cd72d430484fca35238 | 5b4c6872c32cc82a2e0b18bee8a74bdff93241c3 | /dumpsters/management/commands/importfallingfruit.py | 50b69fda65fc8d3e9d24dd8fa49ad57f371fcb3b | [] | no_license | Debakel/Dumpstermap | a078b0837758d47fb357f94ea194052eda0f6097 | 69c91a696ceabb4143dafbf26f4327a03ef11932 | refs/heads/main | 2023-08-31T11:32:41.329508 | 2023-08-29T11:34:16 | 2023-08-29T11:34:16 | 41,272,591 | 12 | 3 | null | 2023-09-13T17:04:16 | 2015-08-24T00:02:21 | Python | UTF-8 | Python | false | false | 584 | py | from django.core.management.base import BaseCommand
from dumpsters.models import Dumpster
from dumpsters.serializers import DumpsterSerializer
class Command(BaseCommand):
help = "Exports dumpsters as geojson"
def add_arguments(self, parser):
parser.add_argument("file", nargs="+", type=str)
def handle(self, *args, **options):
filename = options["file"][1]
dumpsters = Dumpster.objects.all()
serializer = DumpsterSerializer(dumpsters, many=True)
out = open(filename, "w")
out.write(serializer.data)
out.close()
| [
"2857237+Debakel@users.noreply.github.com"
] | 2857237+Debakel@users.noreply.github.com |
7ee392f14cf76cf17f113034c49cf15a30acbeb4 | d14e2ba3c2ef1d732e4d5be1fcf9839679021fd9 | /ruta_camionera/models/__init__.py | c36e653dd615035fdc1e28739c8fdc746e80ff38 | [] | no_license | alien010101/ruta_final | 62caf5013f8034eb0b28849a35ca421b06dea66c | acf62a3e8852509d275cf22a64ff47654b8d3f9e | refs/heads/master | 2020-06-06T02:53:09.429437 | 2019-06-18T22:03:18 | 2019-06-18T22:03:18 | 192,618,245 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 182 | py | # -*- coding: utf-8 -*-
from . import models
from . import ruta_reporte_wizard
from . import ruta_reporte_duenio
from . import enrutamiento
from . import enrutamiento_reporte_wizard | [
"noreply@github.com"
] | alien010101.noreply@github.com |
e418f29f6324cbfb10915736c410ec13dc788ee7 | b10338838e375530f1ff54de5ea62a5f48fe9e9e | /class/leebyeongcheol/1015 전체복습/lec01~lec03 복습/move_character_with_mouse.py | 62eb423d9492527c770d28a4fbedd3316ed85b51 | [] | no_license | leebyeongcheol/2D_TeamProject | aee8a9606db7944b1becd10d8a5cb5c7a374711c | 14d300e45cf30b134dea160e06142233a7658576 | refs/heads/master | 2021-05-15T04:52:47.002962 | 2017-12-15T00:44:39 | 2017-12-15T00:44:39 | 104,991,694 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 762 | py | from pico2d import *
def handle_events():
global running
global x, y
events = get_events()
for event in events:
if event.type == SDL_QUIT:
running = False
elif event.type == SDL_MOUSEMOTION:
x, y = event.x, 600 - event.y
elif event.type == SDL_KEYDOWN and event.key == SDLK_ESCAPE:
running = False
open_canvas()
grass = load_image('grass.png')
character = load_image('run_animation.png')
running = True
x, y = 100, 100
frame = 0
hide_cursor()
while (running):
clear_canvas_now()
grass.draw(400, 30)
character.clip_draw(frame * 100, 0, 100, 100, x, 90)
update_canvas()
frame = (frame + 1) % 8
delay(0.05)
handle_events()
get_events()
close_canvas() | [
"32187933+leebyeongcheol@users.noreply.github.com"
] | 32187933+leebyeongcheol@users.noreply.github.com |
d8507728b84bfbe09580345d419ab4e41b827e76 | 14f1563556f29a1da60f8a2a9827ef9fc1097ee9 | /min_eigvec.py | 0bbd9161c6da46364b5a2a166aa69c369262f7ba | [] | no_license | AndrewTNaber/memeffpsd | 7f98106f8add3766a18eecc18796003589171de6 | 5b267035c6b5dba7c9d0e00cbc79320c72300a07 | refs/heads/master | 2023-01-01T21:45:01.435235 | 2020-10-05T06:36:24 | 2020-10-05T06:36:24 | 301,314,541 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 6,701 | py | # NAME: min_eigvec.py
# AUTHOR: ANONYMOUS
# AFFILIATION: ANONYMOUS
# DATE MODIFIED: 10 June 2020
# DESCRIPTION: Functions for computing the minimum eigenvalue/vector using
# ARPACK, Lanczos, shift invert, or power iteration.
# Implementations of the power iteration and Lanczos methods
# are motivated by those in the code for "Scalable Semidefinite
# Programming" by Yurtsever et al. Tests for all functions can
# be run from running as script.
# TO DO:
# 1. Set the default tolerances more intelligently
# Standard imports
import numpy as np
import scipy.linalg as la
from scipy.sparse import linalg as spla
def _twonormest(A, max_iters=100, tol=1.0e-6):
"""Estimates the 2-norm of linear operator A using power method."""
cnt = 0
n = A.shape[1]
x = np.random.randn(n)
x /= la.norm(x)
g_new = 1.0
g_old = 0.0
# Main iteration
for _ in range(max_iters):
g_old = g_new
Ax = A @ x
x = A @ Ax
g_new = la.norm(x) / la.norm(Ax)
x /= la.norm(x)
cnt += 2
if (g_new - g_old) <= g_new * tol:
return g_new, cnt
return g_new, cnt
def min_eigvec_power(A, max_iters=30, tol=1.0e-6, shift=None):
"""Finds approximate minimum eigenvalue/vector using power method."""
n = A.shape[1]
# Estimate spectral norm of A
shift, matmultcnt = _twonormest(A, tol=0.1)
shift *= 2.0
# Main iteration
q = np.random.randn(n) # Random initialization
q /= la.norm(q)
Aq = A @ q
matmultcnt += 1
d = np.vdot(q, Aq)
for _ in range(max_iters):
q = shift * q - Aq
q /= la.norm(q)
Aq = A @ q
matmultcnt += 1
d = np.vdot(q, Aq)
if la.norm(Aq - d * q) <= abs(d) * tol:
break
return q.reshape((-1, 1)), d, matmultcnt
def min_eigvec_Lanczos(A, max_iters=30, tol=1.0e-6, shift=None):
"""Finds approximate minimum eigenvalue/vector using Lanczos method."""
n = A.shape[1]
max_iters = min(max_iters, n - 1)
# Random initialization
Q = np.zeros((n, max_iters + 1))
Q[:, 0] = np.random.randn(n)
Q[:, 0] /= la.norm(Q[:, 0])
# Diagonal and off-diagonal elements
alpha = np.zeros(max_iters)
beta = np.zeros(max_iters)
# Lanczos iteration
matmultcnt = 0
for ii in range(max_iters):
Q[:, ii + 1] = A @ Q[:, ii]
matmultcnt += 1
alpha[ii] = np.vdot(Q[:, ii], Q[:, ii + 1])
if ii == 0:
Q[:, 1] -= alpha[0] * Q[:, 0]
else:
Q[:, ii + 1] -= alpha[ii] * Q[:, ii] + beta[ii - 1] * Q[:, ii - 1]
beta[ii] = la.norm(Q[:, ii + 1])
if abs(beta[ii]) < np.sqrt(n) * np.spacing(1.0):
break
Q[:, ii + 1] /= beta[ii]
# Compute approximate eigenvalues
if ii == 0:
return Q[:, :1], alpha[0], matmultcnt
else:
d, q = la.eigh_tridiagonal(alpha[:ii + 1], beta[:ii], select='i', select_range=(0, 0))
return Q[:, :ii + 1] @ q, d[0], matmultcnt
def min_eigvec_shift_invert(A, max_iters=100, tol=1.0e-6, shift=None):
"""Finds approximate eigenvalue/vector using shift and invert method."""
n = A.shape[1]
matmultcnt = 0
if shift is None:
rho, matmultcnt = _twonormest(A)
shift = -rho
# Set up shifted linear operator (with added count of matrix multiplications)
def mult_shift_with_cnt(v):
nonlocal matmultcnt
matmultcnt += 1
return A @ v - shift * v
slo = spla.LinearOperator(A.shape, matvec=mult_shift_with_cnt, dtype=np.float_)
# Random initialization
u = np.random.randn(n, 1)
# Main iteration
for ii in range(max_iters):
v = u / la.norm(u)
Av = A @ v
matmultcnt += 1
lambda_ = np.vdot(v, Av)
if la.norm(Av - lambda_ * v) <= abs(lambda_) * tol:
return v, lambda_, matmultcnt
u = spla.cg(slo, v, tol=tol / 2)[0]
d = np.vdot(u, v)
if la.norm(u - d * v) <= abs(d) * np.spacing(1.0):
break
v = u / la.norm(u)
lambda_ = np.vdot(v, A @ v)
matmultcnt += 1
return v, lambda_, matmultcnt
def min_eigvec_ARPACK(A, max_iters=100, tol=1.0e-6, shift=None):
"""Convenience wrapper for spla.eigsh which calls ARPACK."""
# Hack to get the number of matrix-vector multiplications used by ARPACK
count = 0
def mult_with_count(v):
nonlocal count
count += 1
return A @ v
A_with_count = spla.LinearOperator(A.shape, matvec=mult_with_count, dtype=np.float_)
# Call ARPACK
d, q = spla.eigsh(A_with_count, k=1, which='SA', maxiter=max_iters, tol=tol)
return q, d[0], count
def _test__twonormest():
print('Checking _twonormest... ', end='')
flag = True
A = np.random.randn(10, 10)
A = 0.5 * (A + A.T)
est, _ = _twonormest(A)
if abs(est - la.svdvals(A)[0]) / abs(la.svdvals(A)[0]) > 1.0e-3:
flag &= False
print('PASS') if flag else print('FAIL')
def _test_min_eigvec_power():
print('Checking min_eigvec_power... ', end='')
flag = True
A = np.random.randn(10, 10)
A = 0.5 * (A + A.T)
q, d, _ = min_eigvec_power(A, max_iters=1000, tol=1.0e-3)
if abs(d - la.eigvalsh(A)[0]) / abs(la.eigvalsh(A)[0]) > 1.0e-3:
flag &= False
print('PASS') if flag else print('FAIL')
def _test_min_eigvec_Lanczos():
print('Checking min_eigvec_Lanczos... ', end='')
flag = True
A = np.random.randn(10, 10)
A = 0.5 * (A + A.T)
q, d, _ = min_eigvec_Lanczos(A, max_iters=1000, tol=1.0e-3)
if abs(d - la.eigvalsh(A)[0]) / abs(la.eigvalsh(A)[0]) > 1.0e-3:
flag &= False
print('PASS') if flag else print('FAIL')
def _test_min_eigvec_shift_invert():
print('Checking min_eigvec_shift_invert... ', end='')
flag = True
A = np.random.randn(10, 10)
A = 0.5 * (A + A.T)
q, d, _ = min_eigvec_shift_invert(A, max_iters=1000, tol=1.0e-3)
if abs(d - la.eigvalsh(A)[0]) / abs(la.eigvalsh(A)[0]) > 1.0e-3:
flag &= False
print('PASS') if flag else print('FAIL')
def _test_min_eigvec_ARPACK():
print('Checking min_eigvec_ARPACK... ', end='')
flag = True
A = np.random.randn(10, 10)
A = 0.5 * (A + A.T)
q, d, count = min_eigvec_ARPACK(A, max_iters=1000, tol=1.0e-3)
if abs(d - la.eigvalsh(A)[0]) / abs(la.eigvalsh(A)[0]) > 1.0e-3:
flag &= False
print('PASS') if flag else print('FAIL')
def _run_all_tests():
_test__twonormest()
_test_min_eigvec_power()
_test_min_eigvec_Lanczos()
_test_min_eigvec_shift_invert()
_test_min_eigvec_ARPACK()
if __name__ == '__main__':
_run_all_tests()
| [
"naber@stanford.edu"
] | naber@stanford.edu |
84a87e224279a2026d32243673dfe8d0e77bc3c7 | dfc745ea5c8c9f8034e9c03913256c7016268545 | /code/Comments_word_cloud.py | 2ece44b85d936cc07032c5e96e6f2ac74d3da6e4 | [] | no_license | chawucirencc/Crawl-comment-generation-word-cloud | 3a746b4ae0c98bf2634ac7999d1aa60fc923a5ea | 7de94fcd5652c731ffd334006c8b6526d4934bee | refs/heads/master | 2020-03-27T04:38:29.799487 | 2018-08-24T07:21:56 | 2018-08-24T07:21:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,821 | py | #!/usr/bin/env.python
# -*- coding: utf-8 -*-
import requests
import re
import random
import jieba
import wordcloud
import matplotlib.pyplot as plt
from bs4 import BeautifulSoup
from requests import RequestException
def get_url_list():
"""得到URL列表"""
url_list = []
for i in range(0, 50, 2):
url = 'https://movie.douban.com/subject/1292052/comments?start=' \
+ str(i*10) + '&limit=20&sort=new_score&status=P'
url_list.append(url)
return url_list
def get_text(url_list, headers):
"""通过正则表达式提取出评论信息"""
res = ''
for i in url_list:
try:
r = requests.get(i, headers=headers)
if r.status_code == 200:
r.encoding = 'utf-8'
text_list = re.findall(r'<span class="short">(.*?)</span>', r.text)
for text in text_list:
res += text + '。'
except RequestException:
print(RequestException)
return res
def save_result(res):
"""将结果保存到txt文件"""
path = r'C:\Users\Talent\Desktop\res.txt'
with open(path, 'w', encoding='utf-8') as f:
f.write(res)
f.close()
return path
def draw_wordcloud(path):
"""通过传入路径参数,读取之前保存的txt文件,画出词云图"""
file = open(path, encoding='utf-8').readlines()
word = ''
for line in file:
cut = jieba.cut(line)
for i in cut:
if i not in ',。“”?【】《》:!—().、':
if len(i) > 1:
word += i + '/'
font_path='C:\\Windows\\Fonts\\Deng.ttf'
# 设置WordCloud参数
wc = wordcloud.WordCloud(font_path=font_path, background_color='white', width=700, height=400, max_words=1000)
wc.generate(word)
wc.to_file('word3.png')
plt.imshow(wc)
plt.axis('off')
plt.show()
def main():
"""主函数"""
my_headers = [
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14",
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)"
]
user_agent = random.choice(my_headers)
headers = {
'User_Agent': user_agent,
'Cookie': 'll="108231"; bid=lp6WDrc5nKc; _vwo_uuid_v2=D2003811F9920EDDB4CE4497C487751D9|a954d86b21a4eb3b3ccea6b2fe090eac; ap_6_0_1=1; ps=y; ue="1960595754@qq.com"; push_doumail_num=0; __utmz=30149280.1534871147.6.3.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; __utmz=223695111.1534871152.6.3.utmcsr=douban.com|utmccn=(referral)|utmcmd=referral|utmcct=/; _pk_ref.100001.4cf6=%5B%22%22%2C%22%22%2C1535027767%2C%22https%3A%2F%2Fwww.douban.com%2F%22%5D; _pk_ses.100001.4cf6=*; __utma=30149280.804054632.1534244658.1534944165.1535027767.10; __utmc=30149280; __utma=223695111.1126706729.1534244658.1534944168.1535027767.10; __utmb=223695111.0.10.1535027767; __utmc=223695111; ap_v=1,6.0; as="https://movie.douban.com/subject/26752088/comments?start=40&limit=20&sort=new_score&status=P"; dbcl2="160936860:paffOo90ZWA"; ck=PQeC; push_noty_num=0; __utmv=30149280.16093; __utmb=30149280.2.10.1535027767; _pk_id.100001.4cf6=b7df88e2b11c58f8.1534244658.11.1535031771.1534944266.'
}
url_list = get_url_list()
res = get_text(url_list, headers)
path = save_result(res)
draw_wordcloud(path)
main() # 调用主函数
| [
"noreply@github.com"
] | chawucirencc.noreply@github.com |
6c4e60d8e9cc45ef7e1a5dcd992fa8c88ac7d723 | a0071459ad6ddd84b12603ef8bb375787ee7090b | /amazon/amazon/spiders/amazon_spider.py | 0d6e04d23ea0fa35f723d4189a20d78c131b9558 | [] | no_license | diprish/Crawler | 2ac7ffea0b6477a83b182b11e2e911ec028c18a9 | 524d7f13cf64a4a614656d4fe64dc8ee6026140f | refs/heads/master | 2016-09-01T23:57:16.364576 | 2015-07-02T13:12:33 | 2015-07-02T13:12:33 | 27,781,370 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,069 | py | # -*- coding: utf-8 -*-
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.lxmlhtml import LxmlLinkExtractor
from scrapy.selector import HtmlXPathSelector
from amazon.items import AmazonItem
class AmazonSpiderSpider(CrawlSpider):
name = "amazon_spider"
allowed_domains = ["www.amazon.in"]
start_urls = ['http://www.amazon.in/mobiles-accessories/b/ref=sv_e_1?ie=UTF8&node=1389401031']
rules = (Rule (LxmlLinkExtractor(restrict_xpaths=('//div[@class="asinTextBlock"]/ul/li/a',))
, callback="parse_items", follow= True),)
def parse_items(self, response):
print ('*** response:', response.url)
hxs = HtmlXPathSelector(response)
specifications = hxs.select('//h3[@class="newaps"]/a')
items = []
for spec in specifications:
item = AmazonItem()
item ["title"] = spec.select('//span[@class="lrg bold"]/text()').extract()
print ('**parse_items:', item["title"])
items.append(item)
return(items) | [
"diprish@gmail.com"
] | diprish@gmail.com |
001be2189228e14ea6f87b0daeaacc16a3873cd0 | 4f5ff0a478aa3d33c287bbd678c558dfa2c4c5c4 | /RNN_Embedding.py | 3e20c8462c59f64878c524fa5b534afe23c90c87 | [] | no_license | ishmukul/SentimentAnalysis | 0e07ed4587ffad656195e95f3b10b9ed30fcea42 | af51e70b9556ecee9bfa4aadf80c3562b307446a | refs/heads/master | 2022-11-07T19:41:19.056026 | 2020-06-24T19:18:21 | 2020-06-24T19:18:21 | 274,742,953 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,785 | py | """
A Recurrent Neural Network model using Word embedding training for sentiment analysis.
Embedding layer is trained on full set of 1.6M tweets and 10k word vocabulary.
Model uses two LSTM layers-> Dense layer
Accuracies are pretty good.
Training ~ 81.5%
Validation ~ 81.62%
Test ~ 81.49%
Achievement: Model was able to classify 'not bad' as 'good'.
"""
# Import libraries
import os # Some OS operations
from time import perf_counter as timer
import pandas as pd # Manipulating data
from sklearn.utils import shuffle # Shuffle data, in case we need sample of data
# Keras libraries for Neural Networks
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.models import Sequential
from keras.layers import Input, Dense, LSTM, GRU, Embedding, Dropout, Flatten, Bidirectional
from keras.callbacks import EarlyStopping
from keras.optimizers import Adam, Adadelta, RMSprop
import h5py
import pickle
from utilities import *
# ===============================================
# Load files
data_training = pd.read_csv('data/training/training_tweets_clean.csv')
data_training = data_training.replace(np.nan, '', regex=True) # Some values were blank. Pandas read them as nan.
data_validation = pd.read_csv('data/validation/validation_tweets_clean.csv')
# data_validation = data_validation.replace(np.nan, '', regex=True) # Some values were blank. Pandas read them as nan.
data_test = pd.read_csv("data/test/test_tweets_clean.csv")
data_test = data_test.replace(np.nan, '', regex=True) # Some values were blank. Pandas read them as nan.
# Further slicing data for selective tweets. Shuffle data if taking a slice of data.
# It is important because data contains tweets sorting based on Polarity
# data_training = shuffle(data_training) # Shuffle the data
# data_training.reset_index(inplace=True, drop=True)
# data_training = data_training[:20000]
print("All files loaded")
print("Working with %d tweets", len(data_training))
# Drop indices for neutral reviews
to_drop = [2]
data_validation = data_validation[~data_validation['Polarity'].isin(to_drop)]
data_test = data_test[~data_test['airline_sentiment'].isin(to_drop)]
# Tweets corresponding to training, validation and test set
tweets_training = data_training['Tweet']
tweets_validation = data_validation['Tweet']
tweets_test = data_test['text']
# ===============================
# Preparing for inputs for embedding model
# Some Constants
VocLen = 10000 # Number of words to keep in dictionary in dictionary
MaxLen = 24
time_step = 50 # Same as vector dimension of GloVe Embedding
t_start = timer() # Clock start
tokenizer = Tokenizer(num_words=VocLen)
tokenizer.fit_on_texts(tweets_training)
# Save token for future use
with open('models/tokenizer_10k.pickle', 'wb') as handle:
pickle.dump(tokenizer, handle, protocol=pickle.HIGHEST_PROTOCOL)
# # Load tokenizer
# # Will be used in fast loading this routine.
# with open('models/tokenizer_10k.pickle', 'rb') as handle:
# tokenizer = pickle.load(handle)
# Converting sequences of tweets
X_train_seq = tokenizer.texts_to_sequences(tweets_training)
X_valid_seq = tokenizer.texts_to_sequences(tweets_validation)
X_test_seq = tokenizer.texts_to_sequences(tweets_test)
# Check sequence lengths of all tweets, i.e. length of Tweets' words.
seq_lengths = tweets_training.apply(lambda x: len(x.split(' ')))
# print(seq_lengths.value_counts())
# Every run is random due to shuffling of dataset and selecting 100K tweets. In this run, we have only 3 tweets more
# than 24 length. Ignoringing them and truncating tweets at 24 max length.
# Out of 1.6M tweets nearly 40 reduced tweets have more than 24 length.
X_train = pad_sequences(X_train_seq, maxlen=MaxLen)
X_valid = pad_sequences(X_valid_seq, maxlen=MaxLen)
X_test = pad_sequences(X_test_seq, maxlen=MaxLen)
# print(X_train_seq_trunc[10]) # Example of padded sequence
y_train = data_training['Polarity']
y_valid = data_validation['Polarity']
y_test = data_test['airline_sentiment']
t_stop = timer()
print("Time to pre-process model of %d words vocabulary for %d Tweets is %0.5f s" % (
VocLen, len(data_training), (t_stop - t_start)))
# =================================
# Create Embedding model
t_start = timer()
# Function to define model
def define_model(data):
modl = Sequential()
modl.add(Embedding(VocLen, time_step, input_length=data.shape[1]))
modl.add(Bidirectional(LSTM(64, return_sequences=True))),
modl.add(Bidirectional(LSTM(32, return_sequences=False))),
# modl.add(Flatten())
modl.add(Dense(64, activation='relu'))
modl.add(Dropout(0.5))
modl.add(Dense(1, activation='sigmoid'))
return modl
# Create a model
rnn_emb_model = define_model(X_train)
print(rnn_emb_model.summary())
# Optimizer algorithms
# opt = SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True) # Stochastic Gradient Descent
# opt = RMSprop(lr=0.001, rho=0.9)
# opt = Adagrad(learning_rate=0.01)
opt = Adadelta(learning_rate=1.0, rho=0.95)
# opt = Adam(learning_rate=0.001, beta_1=0.9, beta_2=0.999, amsgrad=False)
# Loss functions, several options available
# loss = 'mean_squared_error'
# loss = 'mean_absolute_error'
loss = 'binary_crossentropy'
# loss = 'categorical_crossentropy'
rnn_emb_model.compile(loss=loss, optimizer=opt, metrics=['accuracy'])
rnn_emb_history = rnn_emb_model.fit(X_train, y_train, epochs=10, batch_size=512, validation_data=[X_valid, y_valid],
verbose=2)
# emb_history = emb_model.fit(X_train, y_train, epochs=20, batch_size=512, validation_split=0.01, verbose=2)
print(rnn_emb_history.history['accuracy'][-1])
score_valid = rnn_emb_model.evaluate(X_valid, y_valid, batch_size=512, verbose=2)
score_test = rnn_emb_model.evaluate(X_test, y_test, batch_size=512, verbose=2)
t_stop = timer()
print("Time to process model of %d words vocabulary for %d Tweets is %0.5f s" % (
VocLen, len(data_training), (t_stop - t_start)))
print("Accuracy of NeuralNet on validation set is %0.2f" % (100 * score_valid[1]))
print("Accuracy of NeuralNet on test set is %0.2f" % (100 * score_test[1]))
# Save model
rnn_emb_model.save("models/rnn_emb_model.h5")
rnn_emb_model.save_weights("models/rnn_emb_weights.h5")
# ====================================
# Plot history
plt.close('all')
AxisLabel = ["Epochs", "Accuracy"]
FName = 'figures/RNN_Embedding_accuracy.png'
# FName = None
plot_metric(rnn_emb_history, metric_name='accuracy', axis_label=AxisLabel, graph_title="Accuracy plot", file_name=FName)
AxisLabel = ["Epochs", "Loss"]
FName = 'figures/RNN_Embedding_Loss.png'
# FName = None
plot_metric(rnn_emb_history, metric_name='loss', axis_label=AxisLabel, graph_title="Loss plot", file_name=FName)
# ===================================
# Function for predicting sentiment of sentence
def predict(input_text, thresh=0.5):
text = text_clean(input_text)
test_seq = tokenizer.texts_to_sequences(text)
test = pad_sequences(test_seq, maxlen=MaxLen)
s = rnn_emb_model.predict(test)
if s > thresh:
print("Positive")
else:
print("Negative")
return s
print(predict("You have written a fantastic review about movie but things have changed."))
print(predict("I have to say your review is nt good."))
print(predict("I have to say your review is not bad."))
# Train on 1600000 samples, validate on 359 samples
# Epoch 1/10
# 2020-05-27 07:46:53.169677: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10
# - 155s - loss: 0.4967 - accuracy: 0.7541 - val_loss: 0.3822 - val_accuracy: 0.8189
# Epoch 2/10
# - 156s - loss: 0.4456 - accuracy: 0.7938 - val_loss: 0.3783 - val_accuracy: 0.8245
# Epoch 3/10
# - 157s - loss: 0.4346 - accuracy: 0.8003 - val_loss: 0.3781 - val_accuracy: 0.8329
# Epoch 4/10
# - 158s - loss: 0.4279 - accuracy: 0.8042 - val_loss: 0.3820 - val_accuracy: 0.8134
# Epoch 5/10
# - 158s - loss: 0.4233 - accuracy: 0.8070 - val_loss: 0.3731 - val_accuracy: 0.8189
# Epoch 6/10
# - 158s - loss: 0.4196 - accuracy: 0.8089 - val_loss: 0.3650 - val_accuracy: 0.8134
# Epoch 7/10
# - 156s - loss: 0.4167 - accuracy: 0.8106 - val_loss: 0.3732 - val_accuracy: 0.8189
# Epoch 8/10
# - 159s - loss: 0.4139 - accuracy: 0.8122 - val_loss: 0.3748 - val_accuracy: 0.8050
# Epoch 9/10
# - 160s - loss: 0.4114 - accuracy: 0.8139 - val_loss: 0.3801 - val_accuracy: 0.8162
# Epoch 10/10
# - 157s - loss: 0.4089 - accuracy: 0.8151 - val_loss: 0.3731 - val_accuracy: 0.8162
# 0.81509
# Time to process model of 10000 words vocabulary for 1600000 Tweets is 1575.41285 s
# Accuracy of NeuralNet on validation set is 81.62
# Accuracy of NeuralNet on test set is 80.92
# Positive
# [[0.8607207]]
# Negative
# [[0.36957595]]
# Positive
# [[0.75851214]]
| [
"ishmukul@gmail.com"
] | ishmukul@gmail.com |
ee9ade01e55751cb4ad59fad7e8007aa52bf3c2d | d5b339d5b71c2d103b186ed98167b0c9488cff09 | /marvin/cloudstackAPI/createCounter.py | a4ed8386ce48bc5d359fb2c7235ada34f89378f4 | [
"Apache-2.0"
] | permissive | maduhu/marvin | 3e5f9b6f797004bcb8ad1d16c7d9c9e26a5e63cc | 211205ae1da4e3f18f9a1763f0f8f4a16093ddb0 | refs/heads/master | 2020-12-02T17:45:35.685447 | 2017-04-03T11:32:11 | 2017-04-03T11:32:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,275 | py | """Adds metric counter"""
from baseCmd import *
from baseResponse import *
class createCounterCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""Name of the counter."""
"""Required"""
self.name = None
self.typeInfo['name'] = 'string'
"""Source of the counter."""
"""Required"""
self.source = None
self.typeInfo['source'] = 'string'
"""Value of the counter e.g. oid in case of snmp."""
"""Required"""
self.value = None
self.typeInfo['value'] = 'string'
self.required = ["name", "source", "value", ]
class createCounterResponse (baseResponse):
typeInfo = {}
def __init__(self):
"""the id of the Counter"""
self.id = None
self.typeInfo['id'] = 'string'
"""Name of the counter."""
self.name = None
self.typeInfo['name'] = 'string'
"""Source of the counter."""
self.source = None
self.typeInfo['source'] = 'string'
"""Value in case of snmp or other specific counters."""
self.value = None
self.typeInfo['value'] = 'string'
"""zone id of counter"""
self.zoneid = None
self.typeInfo['zoneid'] = 'string'
| [
"int-mccd_jenkins@schubergphilis.com"
] | int-mccd_jenkins@schubergphilis.com |
45f9f2259b59d7ce3aafb5602ae87abaff307a61 | 742d4c904fcf0a5a0aadfd074b9823ef313d66b4 | /swagger_spec_compatibility/rules/common.py | 7ef32af182b0f9da6fb1199a672ce9d8b3108cb2 | [
"Apache-2.0"
] | permissive | sptaylor/swagger-spec-compatibility | 8f86090165b84d2480c0d93daebd3e26f168a55f | d9a72a15bc7664d8c99062f4d6ec0f66c0be6a00 | refs/heads/master | 2023-01-02T22:05:00.033544 | 2020-10-26T18:19:39 | 2020-10-26T18:19:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,305 | py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import typing
from abc import ABCMeta
from abc import abstractmethod
from enum import IntEnum
import typing_extensions
from bravado_core.spec import Spec
from six import iterkeys
from six import itervalues
from six import with_metaclass
from termcolor import colored
from swagger_spec_compatibility.util import wrap
def _read_the_docs_link(rule):
# type: (typing.Type['RuleProtocol']) -> typing.Text
return 'https://swagger-spec-compatibility.readthedocs.io/en/latest/rules/{code}.html'.format(
code=rule.error_code,
)
def get_rule_documentation_link(rule):
# type: (typing.Type['RuleProtocol']) -> typing.Optional[typing.Text]
"""
Helper method that allows to extract documentation link related to a given rule.
If the rule is implemented within swagger-spec-compatibility library then the documentation
link will fall back to the "default" read-the-docs link
"""
if rule.documentation_link:
return rule.documentation_link
elif rule.__module__.startswith('swagger_spec_compatibility.rules'):
return _read_the_docs_link(rule)
else:
return None
class RuleRegistry(ABCMeta):
_REGISTRY = {} # type: typing.MutableMapping[typing.Text, typing.Type['BaseRule']]
@classmethod
def _validate_class_attributes(mcs, cls):
# type: (typing.Type['BaseRule']) -> None
assert getattr(cls, 'error_code', None) is not None, 'error_code is a required class attribute for {}'.format(cls)
assert getattr(cls, 'short_name', None) is not None, 'short_name is a required class attribute for {}'.format(cls)
assert getattr(cls, 'description', None) is not None, 'description is a required class attribute for {}'.format(cls)
assert getattr(cls, 'error_level', None) is not None, 'error_level is a required class attribute for {}'.format(cls)
assert getattr(cls, 'rule_type', None) is not None, 'rule_type is a required class attribute for {}'.format(cls)
@classmethod
def _prevent_rule_duplication(mcs, cls):
# type: (typing.Type['BaseRule']) -> None
assert cls.error_code not in RuleRegistry._REGISTRY, \
'Rule {} is already defined. Already existing: {} Trying to add: {}'.format(
cls.error_code,
RuleRegistry._REGISTRY[cls.error_code],
cls,
)
@classmethod
def _prevent_metaclass_usage_from_not_BaseRule_extensions(mcs, cls):
# type: (typing.Type) -> None
cls_fully_qualified_name = '{}.{}'.format(cls.__module__, cls.__name__)
base_rule_fully_qualified_name = '{}.BaseRule'.format(mcs.__module__)
assert ( # pragma: no branch
cls_fully_qualified_name == base_rule_fully_qualified_name
or any(base_rule_fully_qualified_name == '{}.{}'.format(c.__module__, c.__name__) for c in cls.__bases__)
), '{} metaclass should be used only by {}.BaseRule'.format(mcs, mcs.__module__)
def __new__(mcs, name, bases, namespace):
# type: (typing.Type['RuleRegistry'], str, typing.Tuple[type, ...], typing.Dict[str, typing.Any]) -> type
new_cls = ABCMeta.__new__(mcs, name, bases, namespace) # type: typing.Type['BaseRule']
mcs._prevent_metaclass_usage_from_not_BaseRule_extensions(new_cls)
if name != 'BaseRule':
mcs._validate_class_attributes(new_cls)
mcs._prevent_rule_duplication(new_cls)
RuleRegistry._REGISTRY[new_cls.error_code] = new_cls
return new_cls
@staticmethod
def rule_names():
# type: () -> typing.Iterable[typing.Text]
return sorted(iterkeys(RuleRegistry._REGISTRY))
@staticmethod
def rules():
# type: () -> typing.Iterable[typing.Type['BaseRule']]
return sorted(itervalues(RuleRegistry._REGISTRY), key=lambda rule: rule.error_code)
@staticmethod
def has_rule(rule_name):
# type: (typing.Text) -> bool
return rule_name in RuleRegistry._REGISTRY
@staticmethod
def rule(rule_name):
# type: (typing.Text) -> typing.Type['BaseRule']
return RuleRegistry._REGISTRY[rule_name]
class RuleType(IntEnum):
REQUEST_CONTRACT = 0
RESPONSE_CONTRACT = 1
MISCELLANEOUS = 2
class Level(IntEnum):
INFO = 0
WARNING = 1
ERROR = 2
class RuleProtocol(typing_extensions.Protocol):
# Unique identifier of the rule
error_code = None # type: typing_extensions.ClassVar[typing.Text]
# Short name of the rule. This will be visible on CLI in case the rule is triggered
short_name = None # type: typing_extensions.ClassVar[typing.Text]
# Short description of the rationale of the rule. This will be visible on CLI only.
description = None # type: typing_extensions.ClassVar[typing.Text]
# Error level associated to the rule
error_level = None # type: typing_extensions.ClassVar[Level]
# Type of the rule associated
rule_type = None # type: typing_extensions.ClassVar[RuleType]
# Documentation link
documentation_link = None # type: typing_extensions.ClassVar[typing.Optional[typing.Text]]
@classmethod
def validate(cls, left_spec, right_spec):
# type: (Spec, Spec) -> typing.Iterable['ValidationMessage']
pass
class ValidationMessage(typing.NamedTuple(
'_ValidationMessage', (
('level', Level),
('rule', typing.Type[RuleProtocol]),
('reference', typing.Text),
),
)):
def string_representation(self):
# type: () -> typing.Text
documentation_link = get_rule_documentation_link(self.rule)
return '[{error_code}] {short_name}: {reference}{more_info}'.format(
error_code=self.rule.error_code,
reference=self.reference,
short_name=self.rule.short_name,
more_info=' (documentation: {})'.format(documentation_link) if documentation_link else '',
)
def json_representation(self):
# type: () -> typing.Mapping[typing.Text, typing.Any]
return {
'error_code': self.rule.error_code,
'reference': self.reference,
'short_name': self.rule.short_name,
'documentation': get_rule_documentation_link(self.rule),
}
class BaseRule(with_metaclass(RuleRegistry)):
# Unique identifier of the rule
error_code = None # type: typing_extensions.ClassVar[typing.Text]
# Short name of the rule. This will be visible on CLI in case the rule is triggered
short_name = None # type: typing_extensions.ClassVar[typing.Text]
# Short description of the rationale of the rule. This will be visible on CLI only
description = None # type: typing_extensions.ClassVar[typing.Text]
# Error level associated to the rule
error_level = None # type: typing_extensions.ClassVar[Level]
# Type of the rule associated
rule_type = None # type: typing_extensions.ClassVar[RuleType]
# Documentation link
documentation_link = None # type: typing_extensions.ClassVar[typing.Optional[typing.Text]]
def __init__(self):
# type: () -> None
raise RuntimeError('This class should not be initialized. The assumed usage is via class methods.')
@classmethod
@abstractmethod
def validate(cls, left_spec, right_spec):
# type: (Spec, Spec) -> typing.Iterable[ValidationMessage]
pass
@classmethod
def explain(cls):
# type: () -> typing.Text
documentation_link = get_rule_documentation_link(cls)
return '[{error_code}] {short_name}:\n{rule_description}{more_info}'.format(
error_code=colored(cls.error_code, attrs=['bold']),
short_name=colored(cls.short_name, color='cyan', attrs=['bold']),
rule_description=wrap(cls.description, indent='\t'),
more_info='\n\nMore info on {}'.format(documentation_link) if documentation_link else '',
)
@classmethod
def validation_message(cls, reference):
# type: (typing.Text) -> ValidationMessage
return ValidationMessage(
level=cls.error_level,
rule=cls,
reference=reference,
)
| [
"macisamuele@gmail.com"
] | macisamuele@gmail.com |
52266f9293e6ca5502f42fc135f99a86e9c27e53 | 6088859303f409a44768de29f1ac4a7437bb39ed | /polls/polls/settings.py | d70881229e64d86ac5be85c00b98a4baade0b146 | [] | no_license | dynajosh/election | defeb1ffc1f631f2beb3740bd02c55a152f20f12 | f50e968235fdeeefbf439c9042c881a60cd064a8 | refs/heads/master | 2022-12-28T15:21:24.754978 | 2019-12-18T04:48:20 | 2019-12-18T04:48:20 | 228,758,987 | 0 | 0 | null | 2022-11-22T04:19:15 | 2019-12-18T04:38:25 | HTML | UTF-8 | Python | false | false | 3,452 | py | """
Django settings for polls project.
Generated by 'django-admin startproject' using Django 2.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '9p)(2s*$4f2hz_(mlq8978pg(*grn(c%5%g5#5=epfs8-2s1y&'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ["localhost", "192.168.43.94"]
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'contestant',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'polls.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'polls.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Password validation
# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/2.1/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/
STATIC_URL = '/static/'
LOCAL_STATIC_CDN_PATH = os.path.join(os.path.dirname(BASE_DIR), 'static_cdn')
STATIC_ROOT = os.path.join(LOCAL_STATIC_CDN_PATH, 'static')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'staticfiles')
]
MEDIA_ROOT = os.path.join(LOCAL_STATIC_CDN_PATH, 'media')
MEDIA_URL = '/media/'
| [
"47697810+dynajosh@users.noreply.github.com"
] | 47697810+dynajosh@users.noreply.github.com |
d21e0535aa4bdb86ba1c102bc3807548e71afa07 | 0002c86d8473bd7a67fdb15fa576f7b2d76090c5 | /Prelab03/basicOps.py | ee1a83e0606384c003e2da746b3da61c942ff06d | [] | no_license | AnthonyKang/ece364 | ef0eac6c10846fc743a2296c04b9c2e3a6fedbae | df00bc59adcc4ae14cd4383e494d3ee6d2430e7a | refs/heads/master | 2016-09-15T21:47:19.157088 | 2015-09-11T23:29:04 | 2015-09-11T23:29:04 | 33,378,227 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 2,584 | py |
# Add all numbers between 1 and 1000 inclusive
def addNumbers():
nsum = 0
for i in range(1001):
nsum = nsum + i
return nsum
# calculates and return the sum of all multiples of input that are between 0 and 1000
def addMultiplesOf(n):
multiples = range(0,1001,n)
total = sum(multiples)
return total
# Find occurence of a number in a string
def getNumberFrequency(n):
s = "The value of Pi is 3 . 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0 2 8 8 4 1 9 7 1 6 9 3 9 9 3 7 5 1 0 5 8 2 0 9 7 4 9 4 4 5 9 2 3 0 7 8 1 6 4 0 6 2 8 6 2 0 8 9 9 8 6 2 8 0 3 4 8 2 5 3 4 2 1 1 7 0 6 7 9 8 2 1 4 8 0 8 6 5 1 3 2 8 2 3 0 6 6 4 7 0 9 3 8 4 4 6 0 9 5 5 0 5 8 2 2 3 1 7 2 5 3 5 9 4 0 8 1 2 8 4 8 1"
occurences = s.count(str(n))
return occurences
# Get Digital Sum of a number
def getDigitalSum(n):
n = str(n)
total = 0
for i in range(0,len(n)):
total = int(n[i]) + total
s = n[0]
for i in range(1,len(n)):
s = s + " + " + n[i]
s = s + " = " + str(total)
return s
# Takes a single digit, returns a string containing the longest streak of numbers that does not contain digit
def getSequenceWithoutDigit(n):
strList = ["736925233695599303035509581762617623184956190649483967300203776387436934399982","943020914707361894793269276244518656023955905370512897816345542332011497599489","627842432748378803270141867695262118097500640514975588965029300486760520801049","153788541390942453169171998762894127722112946456829486028149318156024967788794","981377721622935943781100444806079767242927624951078415344642915084276452000204","276947069804177583220909702029165734725158290463091035903784297757265172087724","474095226716630600546971638794317119687348468873818665675127929857501636341131"]
s = ''
for i in range(0,len(strList)):
s = strList[i] + s
split = []
split = max(s.split(str(n)),key=len)
return split
# Capitalizes first and last letter of each word in a string
def capitalizeMe(s):
s = s.title()
result = ''
for word in s.split():
result = result + word[:-1] + word[-1].upper() + " "
return result[:-1]
def main():
total = addNumbers()
print total
total = addMultiplesOf(1)
print total
occurences = getNumberFrequency(3)
print occurences
digisum = getDigitalSum(12341234)
print digisum
sequence = getSequenceWithoutDigit(9)
print sequence
capit = capitalizeMe("lorem ipsum dolor a sit amet, vocent civibus has eu")
print capit
if __name__ == "__main__":
main()
| [
"akang3894@gmail.com"
] | akang3894@gmail.com |
9b2b69d5c6e79a87bddb7e6771896d87e5eb2662 | 447d399cabd8f0a576e948323db160e378005867 | /app/env/bin/flask | 940464141427c00d7c975e1aecd88e0e1717a68e | [] | no_license | kodiak74/whatweather | 4de7b1a3fea733017ac75a3bc71fc83072d5d9fd | 3a8fd48745b487dc3ed63aa7190c3cc562dc5243 | refs/heads/master | 2023-02-24T08:12:17.777104 | 2023-01-16T23:27:18 | 2023-01-16T23:27:18 | 245,575,407 | 0 | 1 | null | 2023-02-16T00:41:37 | 2020-03-07T05:39:42 | JavaScript | UTF-8 | Python | false | false | 259 | #!/Users/chris/projects/CodeChallenges/weather/app/env/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from flask.cli import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
| [
"chris@binarycube.com"
] | chris@binarycube.com | |
c0d404e57750dcb40b7a15f49a6d3f01312c3b4c | afd54ae699c4a9800099f9492433968c3850b048 | /write_screen.py | 3d550d2d55d82f0f16b4f627004e2ab20df512ce | [] | no_license | keyvin/ili9341workshop | d6ff883d9641335c6d7c4b1b8f01f3db822ac476 | 29bdaefa7a78d20a7f1617863e106d3f7f56f2ac | refs/heads/master | 2023-07-18T03:16:07.364186 | 2021-08-27T02:45:33 | 2021-08-27T02:45:33 | 397,848,393 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,996 | py | import board
import digitalio
import busio
import time
import init_screen
import struct
write = init_screen.write
_CASET = init_screen._CASET
_PASET = init_screen._PASET
_RAMWR = init_screen._RAMWR
spi = init_screen.spi
#pack RGB
def color565(r, g, b):
return (r & 0xf8) << 8 | (g & 0xfc) << 3 | b >> 3
#two 16 bit ints, big endian
def four_bytes(num1, num2):
return struct.pack(">HH", num1, num2)
#one 16 bit int, big endian
def two_bytes(num1):
return struct.pack(">H", num1)
#This function creates a buffer the same size as a rectangle
def make_rect(x,y, r, g,b):
c_encoded = color565(r, g, b)
c_ordered = two_bytes(c_encoded)
print([c_encoded])
print(bytearray(c_ordered))
b_array = b""
print(c_ordered)
for i in range(x*y):
b_array+=c_ordered
return b_array
#writes a buffe the length of the screen to fill
def solid_fill(buffer):
write(_CASET, four_bytes(0,319))
write(_PASET, four_bytes(0,239))
write(_RAMWR)
init_screen.dc_pin.value = 1
init_screen.cs_pin.value = 0
for i in range(240):
spi.write(buffer)
init_screen.cs_pin.value = 1
#very slow, shows the importance of sending as much data in one tx as possible
def solid_fill_bad():
write(_CASET, four_bytes(0,319))
write(_PASET, four_bytes(0,239))
write(_RAMWR)
init_screen.dc_pin.value = 1
init_screen.cs_pin.value = 0
for i in range(320*240):
spi.write(b"\x00\x00")
init_screen.cs_pin.value = 1
#writes a buffer at screen address - determined by _MADCTL
#zero indexing
def write_at(start_x, start_y, end_x, end_y, buffer):
write(_CASET, four_bytes(start_x, end_x-1))
write(_PASET, four_bytes(start_y, end_y-1))
write(_RAMWR)
init_screen.dc_pin.value = 1
init_screen.cs_pin.value = 0
spi.write(buffer)
init_screen.cs_pin.value = 1
#columns = X
# rows = y
#screen coordinate linearly is y*x+x
if __name__ == "__main__":
init_screen.init_screen()
solid_fill_bad()
LINE = make_rect(1,320,0,200,200)
solid_fill(LINE)
rect = make_rect(30,30,2,20,0)
write_at(10,10,39,39,rect)
| [
"keyvin@gmail.com"
] | keyvin@gmail.com |
291dd5df72f43880f627f673249c3503847e4d8a | 16b93b6782685abf78b4551d4df6631c349f8bd8 | /worldmap OOPs paul.py | 9c58217a5a571e1932ad80629eb932e99d39cab2 | [] | no_license | 69xp/cse-notes | d88833962a14e4d2ac25b870359e2d66f788e291 | 964aa8b8d0a761e2b51ee668308f85937fbe4498 | refs/heads/master | 2021-09-15T03:02:01.185597 | 2018-05-24T16:41:10 | 2018-05-24T16:41:10 | 111,137,128 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,680 | py | class Room(object):
def __init__(self, name, description, north, northeast, northwest, south, southeast, southwest, east, west):
self.north = north
self.south = south
self.east = east
self.west = west
self.northeast = northeast
self.northwest = northwest
self.southeast = southeast
self.southwest = southwest
self.name = name
self.description = description
def move(self, direction):
global current_node
current_node = globals()[getattr(self, direction)]
bland_room = Room("Bland Room", 'There are three portals, one to the north, east, and west. Each is a different color.',
'frontgate1', None, None, None, None, None, 'frontgate2', 'frontgate3')
frontgate1 = Room('Frontgate1', 'You are in front of a rusted iron gate which appears to be the entrance to a castle, '
'which could also be the mysterious yet famed, ACADEMY.',
None, None, None, 'parkinglot1', None, 'gym', 'frontgate2', None)
frontgate2 = Room('Frontgate2', 'You are standing in front of a slightly burnished silver gate which appears to be the '
'entrance to a castle, which could also be the mysterious yet famed, ACADEMY.', None,
None, None, 'parklot2', None, None, 'frontgate3', 'frontgate1')
frontgate3 = Room('Frontgate3', 'You are standing in front of an engraved golden gate,which appears to be the entrance'
' to a castle, which could also be the mysterious yet famed, ACADEMY.', None, None, None, 'parklot3',
None, None, None, 'frontgate2')
parklot1 = Room('Abandoned Lot1',
'There are several rusted metal objects around you. One of the objects doors is opened'
'with a strange pale-green light coming through the windshield '
'that disappears as you walk forward', 'frontgate1', None, None, 'hallway1', None, 'gym', None,
None,)
parklot2 = Room('Abandoned Lot 2', 'the ground is dry and cracked, yet the sky looks dark and stormy. '
'There are paths to the north, east, west, and south.', 'frontgate2', None, None, 'library', None, None,
'parkinglot3', 'parkinglot1')
parklot3 = Room('Abandoned Lot 3', 'There are about 16 trees in the apparent orchard, and the grass is way overgrown. '
'There are paths to the north, south, and west', 'frontgate3', None, None, 'abandoned_classroom1', None,
None, None, 'parklot2')
gym = Room('Gymnasium', 'you are looking at a large, dimly lit room. it is ahrd to see anything here',
None, 'parklot1', 'janitorcloset', None, 'lockerroom', 'lockerroom', None, None)
hallway1 = Room('Hallway', 'A hallway that has a passageway to the east and west. '
'It appears to continue further south.', 'parklot1', None, None, 'hallway1', None, None,
"room 23", "gym")
current_node = bland_room
directions = ['north', 'northwest', 'west', 'southwest', 'south', 'southeast', 'east', 'northeast']
short_directions = ['n', 'nw', 'w', 'sw', 's', 'se', 'e', 'ne']
while True:
print(current_node.name)
print(current_node.description)
command = input('>_').lower().strip()
if command == 'quit':
quit(0)
elif command in short_directions:
pos = short_directions.index(command)
command = directions[pos]
if command in directions:
try:
current_node.move(command)
except KeyError:
print('Your pants will fall off if you go this way!')
else:
print('Command not recognized')
| [
"33761423+69xp@users.noreply.github.com"
] | 33761423+69xp@users.noreply.github.com |
86189fab76c8d396364008e82e47ea8f317a1382 | 6041d0f99f2457bc3e021f35c989c0a1a34f5a4e | /automation/sele/trainNum.py | 5175cfb5f662ddfcbbd12dd54de1597619b54c4e | [] | no_license | hanqingxiao/songqin | 05b0d9a4e8e88b51d8df6302dc12dfdb8496a937 | 7247f8438ee60fb1826f4d5dda6105712eaa7544 | refs/heads/master | 2020-09-16T09:57:11.955392 | 2019-12-31T14:00:28 | 2019-12-31T14:00:28 | 223,735,639 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,464 | py | from selenium import webdriver
import time
from selenium.webdriver.support.ui import Select
driver=webdriver.Chrome('D:\chromedriver_win32\chromedriver.exe')
driver.get('https://kyfw.12306.cn/otn/leftTicket/init')
#出发城市 南京南
leave=driver.find_element_by_id('fromStationText')
leave.click()#一定要先点击一下输入框
leave.send_keys('南京南\n')#要包含一个回车符,否则输入框里面会自动清除
#到达城市 填写 ‘杭州东
arrive=driver.find_element_by_id('toStationText')
arrive.click()#一定要先点击一下输入框
arrive.send_keys('杭州东\n')#要包含一个回车符,否则输入框里面会自动清除
#发车时间 选 06:00--12:00
timeSelect = Select(driver.find_element_by_id('cc_start_time'))#select
timeSelect.select_by_value('06001200')
#发车日期选当前时间的下一天,也就是日期标签栏的,第二个标签
tomorrow = driver.find_element_by_css_selector('#date_range li:nth-child(2)')
tomorrow.click()
#我们要查找的是所有 二等座还有票的车次,打印出这些有票的车次的信息(这里可以用xpath),结果如下:
xpath ='//*[@id="queryLeftTable"]//td[4][@class]/../td[1]//a' #[@class]有车票是才有class属性。 ../ 回第一列下的tb[1]下节点的a
time.sleep(1)#需要等待一秒才能get元素
theTrains = driver.find_elements_by_xpath('//*[@id="queryLeftTable"]//td[4][@class]/../td[1]//a')
for one in theTrains:
print (one.text) | [
"2036244560@qq.com"
] | 2036244560@qq.com |
2c980956d589e4751618f4c687685c843d88f1bb | 341696164dd12703c7703d83993c705f776aaee7 | /features.py | d1fdb41f4d1a9d5d3dab333869c6e35ca86bc805 | [] | no_license | 17683995446/voice_recognition_mfcc_and_gmm | 012a252f34362ce1137285bacbbded3e19fe9c61 | 14e933748af7a8b5536d416515ce80c361cb0bfb | refs/heads/master | 2022-09-30T03:30:01.695410 | 2020-06-06T02:16:51 | 2020-06-06T02:16:51 | 269,838,931 | 4 | 0 | null | null | null | null | UTF-8 | Python | false | false | 255 | py | from python_speech_features import mfcc
import sys
def get_feature(fs, signal):
mfcc_feature = mfcc(signal, fs)
if len(mfcc_feature) == 0:
print >> sys.stderr, "ERROR.. failed to extract mfcc feature:", len(signal)
return mfcc_feature
| [
"noreply@github.com"
] | 17683995446.noreply@github.com |
748fc1027540e935d449fb88db4601a7b3347b56 | 41bbb9e0a04c84c17ef4fae931a4ecb4ca6bc6c4 | /Homework9ready.py | d87cdf5eb0d1cd7540fb1122a040a01a9ef8eed2 | [] | no_license | Riasanow/Homework10 | 9852e2cb157ae908bcdf2b6eb7e69e2b08760826 | 7cb2d0d365479b244a358b4a1e73367538a8a881 | refs/heads/master | 2023-01-06T16:50:53.578331 | 2020-11-03T10:29:27 | 2020-11-03T10:29:27 | 303,849,259 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,311 | py | import requests
#1
import requests
intellegence_values = []
response_hulk = requests.get('https://superheroapi.com/api.php/1430014010524830/search/hulk')
hulk = response_hulk.json()['results'][0]['powerstats']['intelligence']
intellegence_values.append(int(hulk))
response_captain_america = requests.get('https://superheroapi.com/api.php/1430014010524830/search/capt.. america')
captain_america = response_captain_america.json()['results'][0]['powerstats']['intelligence']
intellegence_values.append(int(captain_america))
response_thanos = requests.get('https://superheroapi.com/api.php/1430014010524830/search/thanos')
thanos = response_thanos.json()['results'][0]['powerstats']['intelligence']
intellegence_values.append(int(thanos))
biggest = max(intellegence_values)
print(biggest)
if biggest == int(hulk):
print(response_hulk.json()['results'][0]['name'],',', biggest)
if biggest == int(captain_america):
print(response_captain_america.json()['results'][0]['name'],',', biggest)
else:
print(response_thanos.json()['results'][0]['name'],',', biggest)
#2
import requests
import os
class YaUploader:
def __init__(self, file_path: str):
self.file_path = file_path
def upload(self):
user_input = input('Введите токен: ')
header = {'Authorization': None}
header['Authorization'] = user_input
with open(self.file_path, 'r+b') as f:
test_file = f.read() # читаем/записываем данные из файла
_, fname = os.path.split(self.file_path)
response = requests.get(f'https://cloud-api.yandex.net/v1/disk/resources/upload?path=/{fname}',
headers=header) # в ссылку вставляем название переменной file_name
href = response.json()['href'] # ссылку для загрузки добавляем в переменную
r = requests.put(href,
data=test_file) # загружаем файл на YD, в поле data передаем нашу переменную, где считывали данные из файла
print('Загрузка успешно завершена!')
if __name__ == '__main__':
uploader = YaUploader('')
result = uploader.upload()
| [
"n.riasanow@gmail.com"
] | n.riasanow@gmail.com |
874717db3cbe769a46cafd9896b68ede6504f722 | c28b984731b51aee2ac93471a033b8c513bda11d | /cifonauta/wsgi.py | 6d574daa2d1b08bbe6aea00d5cc8cb9a6204a02b | [] | no_license | pablovaldes/cifonauta | 01e3ba01fc5e0ea26a3d5af7c7231879fa0fcfaa | 4ba8ce1089ee6e974d1d58aed62cde5acc07398a | refs/heads/master | 2020-07-26T18:11:02.537379 | 2016-10-30T19:30:47 | 2016-10-30T19:30:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 393 | py | """
WSGI config for cifonauta project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cifonauta.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| [
"organelas@gmail.com"
] | organelas@gmail.com |
028a6300e1254800df156281c88a4be2c8cd0b93 | 22cc3cf2ba4c11e0f59b6db44ae8ed715519600c | /app/bank_account/admin.py | c248bbde74e8c670501c933d7f663f11ff44f2a4 | [] | no_license | piotrrybinski88/bank_account | c0cd8ea2bb4b156dee085f4a6d15be536dbbd0d1 | 50631dcad004cd0906fffd58cbb991eb1a2ddc23 | refs/heads/main | 2023-03-11T20:47:27.918576 | 2021-02-26T06:04:24 | 2021-02-26T06:04:24 | 341,609,338 | 0 | 0 | null | 2021-02-26T05:54:14 | 2021-02-23T16:00:56 | Python | UTF-8 | Python | false | false | 669 | py | from django.contrib import admin
from .models import Account, Transaction
class AccountAdmin(admin.ModelAdmin):
list_display = (
'id', 'account_number', 'currency', 'date_created', 'account_owner', 'balance'
)
readonly_fields = ('account_number', 'currency', 'date_created', 'balance')
class TransactionAdmin(admin.ModelAdmin):
list_display = ('amount', 'date_of_transaction', 'account')
def has_change_permission(self, request, obj=None):
return False
def has_delete_permission(self, request, obj=None):
return False
admin.site.register(Account, AccountAdmin)
admin.site.register(Transaction, TransactionAdmin)
| [
"piotr.rybinski@polcode.net"
] | piotr.rybinski@polcode.net |
087a67e5405e3ada78f98dc48c3379436a96b3a2 | 6ac723c541e410f737be68f0af634c738e881d74 | /probes.py | abd27d07112f5ce2f0c88bd8935838e6c005df25 | [] | no_license | cxrodgers/Adapters | d478616372ca9fbfc55a886d5b384a15b01a7b91 | da68169c4bb8d8f3c4df13205df2626635632cb8 | refs/heads/master | 2022-12-22T07:46:25.588285 | 2022-12-09T15:21:54 | 2022-12-09T15:21:54 | 4,681,174 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 3,830 | py | """Pinout for each probe, from channel numbers to Samtec numbers."""
from builtins import range
import Adapters
## This is for Adrian's 1x8 shank array
# This one goes from "electrode #" (depth?) to "interposer PCB #"
adrian_8shank2interposer = Adapters.Adapter(
[27, 25, 21, 20, 9],
[41, 45, 53, 55, 52],
)
# This one goes from interposer PCB # to Samtec numbers
# This uses the little handbuild adapter I made that is an ON1 (I think)
# superglued to a breadboard PCB and hand-wired.
# Here I will use 41-80 as Samtec numbers, with 1 in the upper left when
# looking into the next adapter (out of the probe).
# The reason to use 41-80 is because this will be used with the bottom
# connector on ON4.
interposer2samtec = Adapters.Adapter([
33, 34, 35, 36, 37, 38, 39, 40, # first column (shank side to top side)
41, 42, 43, 44, 45, 46, 47, 48, # second column (top side to shank side)
49, 50, 51, #52, 53, 54, 55, # third column (shank side to top side)
], [
53, 57, 58, 61, 62, 65, 73, 77,
49, 45, 41, 80, 76, 72, 68, 63,
64, 60, 56,
]
)
# Hack the above
# The inner column of interposer doesn't have any useful sites, according
# to Adrian. And the outer column of my adapter isn't wired up fully.
# So, shift the interposer such that its inner column is floating.
# Same as above, except
interposer2samtec_shifted = Adapters.Adapter([
#33, 34, 35, 36, 37, 38, 39, 40, # first (innermost) column (shank side to top side)
48, 47, 46, 45, 44, 43, 42, 41, # second column (shank side to top side)
#41, 42, 43, 44, 45, 46, 47, 48, # second column (top side to shank side)
49, 50, 51, 52, 53, 54, 55, # third column (shank side to top side)
], [
53, 57, 58, 61, 62, 65, 73, 77,
49, 45, 41, 80, 76, 72, 68, #63,
#64, 60, 56,
]
)
## End Adrian's array
# This is the A32 connector pinout from neuronexus.
# Takes us from "Samtec numbers" to Neuronexus channel numbers.
# Samtec numbers go from 1-40, with 1 in the upper right when looking at
# the probe, or 1 in the upper left when looking at the adapter.
samtec2nn = Adapters.Adapter(list(range(1, 41)), [
11, 'GND', 'GND', 32,
9, 'REF', 'NC', 30,
7, 'NC', 'NC', 31,
5, 'NC', 'NC', 28,
3, 1, 26, 29,
2, 4, 24, 27,
6, 13, 20, 25,
8, 14, 19, 22,
10, 15, 18, 23,
12, 16, 17, 21,
])
# This is for the Janelia pinout
# As before, Samtec numbers go from 1-40, with 1 in the upper right when
# looking at the probe. The source doc from Tim Harris shows the back side
# of the probe, so 1 is in the upper left (as it is for the adapter).
samtec2janelia_top = Adapters.Adapter(list(range(1, 41)), [
1, 'NC', 'NC', 64,
2, 'NC', 'NC', 63,
3, 'NC', 'NC', 62,
4, 'NC', 'NC', 61,
5, 6, 59, 60,
7, 8, 57, 58,
9, 10, 55, 56,
11, 12, 53, 54,
13, 14, 51, 52,
15, 16, 49, 50,
])
samtec2janelia_bottom = Adapters.Adapter(list(range(1, 41)), [
17, 'NC', 'NC', 48,
18, 'NC', 'NC', 47,
19, 'NC', 'NC', 46,
20, 'NC', 'NC', 45,
21, 22, 43, 44,
23, 28, 37, 42,
24, 32, 33, 41,
25, 29, 36, 40,
26, 30, 35, 39,
27, 31, 34, 38,
])
# A 64-channel version with two samtecs, 1-40 on the top and 41-80 on the bottom
samtec2janelia_64ch = Adapters.Adapter(list(range(1, 81)),
[
1, 'NC', 'NC', 64,
2, 'NC', 'NC', 63,
3, 'NC', 'NC', 62,
4, 'NC', 'NC', 61,
5, 6, 59, 60,
7, 8, 57, 58,
9, 10, 55, 56,
11, 12, 53, 54,
13, 14, 51, 52,
15, 16, 49, 50,
17, 'NC', 'NC', 48,
18, 'NC', 'NC', 47,
19, 'NC', 'NC', 46,
20, 'NC', 'NC', 45,
21, 22, 43, 44,
23, 28, 37, 42,
24, 32, 33, 41,
25, 29, 36, 40,
26, 30, 35, 39,
27, 31, 34, 38,
]) | [
"xrodgers@gmail.com"
] | xrodgers@gmail.com |
abfc935cd1caa0772fb3edadd90108205f8c3b5e | 681cbcbfea344cbfe1d9b3c8f06a5052abdb74c6 | /codeup/100제/1062.py | 0b00720efa2ab52d800e120ab21bf96ed9b87419 | [] | no_license | leesk212/Daily_Practice_Coding | 02bdf1fcb279367e2321fa899b137b652420265c | fcf68dab87a8b561063e96ff033d89d448fae354 | refs/heads/master | 2023-08-25T19:25:17.141355 | 2021-09-25T18:31:08 | 2021-09-25T18:31:08 | 287,914,804 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 78 | py | first,second = map(int,input().split())
a=bin(first^second)
print(int(a,2))
| [
"leesk212@gmail.com"
] | leesk212@gmail.com |
a1859e065c1578bd66e9b48fdf00cdfddebabd81 | c30a798cf67aba777174c15802bb51f642741e00 | /LoginSystem.py | 4947ac80a6a7cd43fe48a11b6dd3f0ef952cec6b | [] | no_license | Luke-thompson705/Student-Event-Planner- | f0d2160e4f5f26f06f4a53021625f8f2996c5712 | 940c783ddad47c97599acf78e30d75833a890bc7 | refs/heads/master | 2021-04-26T14:38:36.932393 | 2016-04-25T10:08:13 | 2016-04-25T10:08:13 | 51,303,292 | 0 | 1 | null | 2016-04-25T08:54:05 | 2016-02-08T14:41:47 | Python | UTF-8 | Python | false | false | 3,597 | py | __author__ = 'Harry'
from tkinter import *
def tryLogin(username, password):
myfile = open("PasswordDatabase.txt")
data = []
for eachline in myfile:
eachline = eachline.strip("\n")
data = eachline.split(" ")
if not eachline.isspace():
if 2==len(data):
if username == data[0]:
if data[1] == password:
return True
else:
return False
myfile.close()
return False
def addUser(username, password):
myfile = open("PasswordDatabase.txt", "a")
myfile.write("\n" + username + " " + password)
myfile.close()
def removeUser(username):
data = []
myfile = open("PasswordDatabase.txt", "r+")
contents = myfile.readlines()
myfile.seek(0)
for eachline in contents:
thisline = eachline.strip("\n")
data = thisline.split(" ")
if data[0] != username:
myfile.write(eachline)
myfile.truncate()
myfile.close()
def setPassword(username, newPassword):
data = []
myfile = open("PasswordDatabase.txt", "r+")
contents = myfile.readlines()
myfile.seek(0)
for eachline in contents:
thisline = eachline.strip("\n")
data = thisline.split(" ")
if data[0] == username:
removeUser(username)
addUser(username, newPassword)
myfile.close()
def isUser(username):
data = []
myfile = open("PasswordDatabase.txt")
contents = myfile.readlines()
myfile.seek(0)
for eachline in contents:
thisline = eachline.strip("\n")
data = thisline.split(" ")
if data[0] == username:
return True
myfile.close()
return False
def noSpaces(string):
for letter in string:
if letter.isspace():
return False
if not string:
return False
return True
# This function "center(win)"and "centerDoNotUse(win) are modified versions of the function found at:
# http://stackoverflow.com/questions/3352918/how-to-center-a-window-on-the-screen-in-tkinter
def center(win):
"""
centers a tkinter window
:param win: the root or Toplevel window to center
"""
win.update_idletasks()
width = win.winfo_reqwidth()
frm_width = win.winfo_rootx() - win.winfo_x()
win_width = width + 2 * frm_width
height = win.winfo_reqheight()
titlebar_height = win.winfo_rooty() - win.winfo_y()
win_height = height + titlebar_height + frm_width
x = win.winfo_screenwidth() // 2 - win_width // 2
y = win.winfo_screenheight() // 2 - win_height // 2
win.geometry('{}x{}+{}+{}'.format(width , height , x, y))
win.deiconify()
def centerDoNotUse(win):
"""
centers a tkinter window
:param win: the root or Toplevel window to center
"""
win.update_idletasks()
width = win.winfo_reqwidth()
frm_width = win.winfo_rootx() - win.winfo_x()
win_width = width + 2 * frm_width
height = win.winfo_reqheight()
titlebar_height = win.winfo_rooty() - win.winfo_y()
win_height = height + titlebar_height + frm_width
x = win.winfo_screenwidth() // 2 - win_width // 2
y = win.winfo_screenheight() // 2 - win_height // 2
win.geometry('{}x{}+{}+{}'.format(width-20 , height-100 , x, y))
win.deiconify()
'''name= "h"
password="k"
if tryLogin(name,password):
print("yay")
#addUser("jamie12","j23amieisdaboss16")
removeUser("jamie3")'''
| [
"naahbo@hotmail.com"
] | naahbo@hotmail.com |
161ef121e5f50f8ab2a32b0600ab9a65c050b69b | 01b49cefcb2e1aae896a444e525c4cd09aff68be | /nyankobiyori.py | 5e84f044fb388d972b61ccd0aeeb3abbcb0436e1 | [
"MIT"
] | permissive | ikeikeikeike/scrapy-2ch-summary-spiders | 308eccbe83bfc03064ec4b7a9b3952985bf58a15 | 7142693f25025a09390377649a727cfd33d15af3 | refs/heads/master | 2020-04-01T18:04:38.319532 | 2015-01-08T08:30:16 | 2015-01-08T08:30:16 | 28,956,442 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,625 | py | # -*- coding: utf-8 -*-
import re
import itertools
from scrapy import log
from scrapy.selector import Selector
from summaries.items import SummariesItem
from thread_float_bbs import (
SequenceAppend,
ThreadFloatBbsSpider
)
class NyankobiyoriSpider(ThreadFloatBbsSpider):
""" for nyankobiyori.com
"""
name = 'nyankobiyori'
allowed_domains = ['nyankobiyori.com']
start_urls = ['http://nyankobiyori.com/index.rdf']
def spider_page(self, response):
""" scraping page
"""
sel = Selector(response)
image_urls = []
contents = SequenceAppend({
"index": int,
"subject": '',
"body": ''
})
# Main
main = sel.css('div.body')
generator = itertools.izip(main.css('.t_h'), main.css('.t_b'))
for sub, body in generator:
image_urls.extend(sub.css('img').xpath('@src').extract())
image_urls.extend(body.css('img').xpath('@src').extract())
contents.append({
"subject": sub.extract(),
"body": body.extract()
})
# body more
main = sel.css('div.bodymore')
generator = itertools.izip(main.css('.t_h'), main.css('.t_b'))
for sub, body in generator:
image_urls.extend(sub.css('img').xpath('@src').extract())
image_urls.extend(body.css('img').xpath('@src').extract())
contents.append({
"subject": sub.extract(),
"body": body.extract()
})
item = dict(
posted=False,
source=self.extract_source(sel),
url=response.url,
title=self.get_text(sel.css('h1 span')),
tags=self.extract_tags(sel, response),
contents=contents.result(),
image_urls=image_urls
)
# set title from source.
return self.request_title(item['source'], SummariesItem(**item))
def extract_source(self, selector):
""" Sourceを抽出
"""
try:
url = [
text for
text in selector.css('div.bodymore span').xpath('text()').extract()
if text.find('2ch.net') != -1
or text.find('2ch.sc') != -1
or text.find('www.logsoku.com') != -1
][0]
return re.search(u"(?P<url>https?://[^\s][^」]+)", url).group("url").strip()
except Exception as exc:
log.msg(
format=("Extract source (error): "
"Error selector %(selector)s "
"url `%(url)s`: %(errormsg)s"),
level=log.WARNING,
spider=self,
selector=selector,
url=selector.response.url,
errormsg=str(exc))
return None
def extract_tags(self, selector, response):
""" tagsを抽出
"""
try:
feed = self.get_feed(response.url)
tags = [
self.get_text(tag)
for tag in selector.css('p[class^=category_] a,p.tag a')
]
return list(set([feed['tags'][0]['term']] + tags))
except Exception as exc:
log.msg(
format=("Extract tags (error): "
"Error selector %(selector)s "
"url `%(url)s`: %(errormsg)s"),
level=log.WARNING,
spider=self,
selector=selector,
url=response.url,
errormsg=str(exc))
return []
| [
"jp.ne.co.jp@gmail.com"
] | jp.ne.co.jp@gmail.com |
10bb84772bc2259f096c95680535c73be6e92a02 | f6793d3af7d0fb77a8f97d1407cab683d0d70f39 | /src/dash_tutorial.py | d086b8fe0d8e6249f1ab9bd5a6f8acd9d65d2e55 | [] | no_license | leopold-franz/swiss-healthcare-datavisualization-test | 0df5dd6db9e33521a5531827dd65a2fffded0382 | 0c7f881050ff6f6f5da38b07e874237c67557773 | refs/heads/master | 2023-01-21T20:14:07.434688 | 2023-01-12T11:45:31 | 2023-01-12T11:45:31 | 286,707,391 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,317 | py | import dash
from dash import dcc
from dash import html
from dash.dependencies import Input, Output
import plotly.express as px
import pandas as pd
from pathlib import Path
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
# The data comes from:
# https://www.bfs.admin.ch/bfs/en/home/statistics/catalogues-databases/tables.assetdetail.10767996.html
# I extracted some data from the 'je-d-14.04.01.02.04.xlsx' file into the 'data.csv' file
print(Path.cwd())
df = pd.read_csv('data/data.csv', index_col=0)
print(df.head())
print(list(df.columns))
# 3. b) The plotly express line graph built using data
static_fig = px.line(df, x=df.index, y='2015')
app.layout = html.Div(children=[
html.H1(children='Dash Demo'),
# 1. Simplest Dash App
html.Div(children="Building a simple Dash app. Hello World of Dash Apps! "
"Have a look at the code of this app and unblock more features by uncommenting code blocks!"),
# 2. Adding a Dash Component to our App
html.Label('Year'),
dcc.Dropdown(
id='measurement_types-dropdown',
options=[{'label': str(y), 'value': y} for y in df.columns],
value=2015,
),
# 3. a) Adding a static graph
# dcc.Graph(id='line_graph-1', figure=static_fig),
# Recomment Part 3
# 4. a) Adding a graph dependent of a dash callback
html.Label('Plotly Graph'),
# Recomment Part 4.a)
# 5. Adding a loading icon to graph while it loads
dcc.Loading(children=[dcc.Graph(id='line_graph')]),
])
# 4. b) The corresponding callback function that makes use of python function decorators
@app.callback(
Output('line_graph', 'figure'),
[Input('measurement_types-dropdown', 'value')])
def update_figure(year):
fig1 = px.line(df,
x=df.index,
y=df[str(year)],
title='Number of Hospitalized Patients in Switzerland '
'divided by Age Group in the year {}'.format(year),
labels={
"age_group": "Age Group",
str(year): "Number of Patients"
})
return fig1
if __name__ == '__main__':
app.run_server(host='0.0.0.0', port=80, debug=True)
| [
"leopold.franz@gmx.ch"
] | leopold.franz@gmx.ch |
e88faa6e524a01a987338390bf5e01efd5009456 | 8f117ba7a1087a57c2a0fd41b902108e0bee490e | /cal.py | cda3ce00a6d9f6d460f0660b40894c47e534edc2 | [] | no_license | 1304740908/ACCM | dbb51e5f9827d7ce3babafe89af7c7d643967afa | 1eadfbf869015c10cafc3115766e09f84a071563 | refs/heads/master | 2022-01-04T23:04:49.669424 | 2019-05-12T22:21:09 | 2019-05-12T22:21:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,323 | py | # -*- coding: UTF-8 -*-
from numpy import *
import operator
import sys
import re
from os import listdir
def loadGraphDict(fileName):
dataDict = {}
fx = open(fileName)
for line in fx.readlines():
lineArr = re.split(' |,|\t',line.strip())
lenth=len(lineArr)
if(lenth<2):
break;
if(lineArr[0] not in dataDict.keys()):
dataDict[str(lineArr[0])]=[str(lineArr[1])]
if(lineArr[1] not in dataDict[str(lineArr[0])]):
dataDict[str(lineArr[0])].append(str(lineArr[1]))
if(lineArr[1] not in dataDict.keys()):
dataDict[str(lineArr[1])]=[str(lineArr[0])]
if(lineArr[0] not in dataDict[str(lineArr[1])]):
dataDict[str(lineArr[1])].append(str(lineArr[0]))
return dataDict
def start(filename):
xDict=loadGraphDict(filename)
i=0
sumdu=0.0
for node in xDict.keys():
sumdu+=len(xDict[node])
i+=1
print("items="),i
print("average degree="),float(sumdu/i)
fp=open('data/xDict.txt','w')
for li,lis in xDict.items():
fp.write('%s '%str(li))
for h in lis:
fp.write('%s '%str(h))
fp.write('\n')
fp.close()
return i,float(sumdu/i),xDict
if __name__=="__main__":
filename=sys.argv[1]
start(filename)
| [
"noreply@github.com"
] | 1304740908.noreply@github.com |
1e23e7a0136d045d6b3707215f193b71e0e7ee8c | 62420e35e497f3026a980f1ab6dd07756eeeae7f | /oparlsync/generate_thumbnails/GenerateThumbnails.py | 804a53c257d97dd0ebb4f2b689dcd0deabb6991d | [] | no_license | curiousleo/daemon | b530f528449579ecbb0bd52dee94cbc954bd9b96 | d47a5b49ac144b9992ab35ff09f113a94f16bd60 | refs/heads/master | 2020-04-14T01:56:52.316211 | 2018-12-30T09:20:18 | 2018-12-30T09:42:53 | 163,573,533 | 0 | 0 | null | 2018-12-30T08:38:41 | 2018-12-30T08:38:41 | null | UTF-8 | Python | false | false | 9,206 | py | # encoding: utf-8
"""
Copyright (c) 2012 - 2016, Ernesto Ruge
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
import os
import shutil
import datetime
from PIL import Image
from ..base_task import BaseTask
from ..models import Body, File
from minio.error import ResponseError, NoSuchKey
from pymongo.errors import CursorNotFound
class GenerateThumbnails(BaseTask):
name = 'GenerateThumbnails'
services = [
'mongodb',
's3'
]
def __init__(self, body_id):
self.body_id = body_id
super().__init__()
self.statistics = {
'wrong-mimetype': 0,
'file-missing': 0,
'successful': 0
}
def run(self, body_id, *args):
if not self.config.ENABLE_PROCESSING:
return
self.body = Body.objects(uid=body_id).no_cache().first()
if not self.body:
return
files = File.objects(thumbnailStatus__exists=False, body=self.body.id).no_cache().all()
while True:
try:
file = next(files)
except CursorNotFound:
files = File.objects(thumbnailStatus__exists=False, body=self.body.id).no_cache().all()
file = next(files)
continue
except StopIteration:
break
if not file:
break
self.datalog.info('processing file %s' % file.id)
file.modified = datetime.datetime.now()
file.thumbnailGenerated = datetime.datetime.now()
# get file
file_path = os.path.join(self.config.TMP_THUMBNAIL_DIR, str(file.id))
if not self.get_file(file, file_path):
self.datalog.warn('file not found: %s' % file.id)
self.statistics['file-missing'] += 1
file.thumbnailStatus = 'file-missing'
file.thumbnailsGenerated = datetime.datetime.now()
file.modified = datetime.datetime.now()
file.save()
continue
if file.mimeType not in ['application/msword', 'application/pdf']:
self.datalog.warn('wrong mimetype: %s' % file.id)
self.statistics['wrong-mimetype'] += 1
file.thumbnailStatus = 'wrong-mimetype'
file.thumbnailsGenerated = datetime.datetime.now()
file.modified = datetime.datetime.now()
file.save()
os.unlink(file_path)
continue
file_path_old = False
if file.mimeType == 'application/msword':
file_path_old = file_path
file_path = file_path + '-old'
cmd = ('%s --to=PDF -o %s %s' % (self.config.ABIWORD_COMMAND, file_path, file_path_old))
self.execute(cmd, self.body.id)
# create folders
max_folder = os.path.join(self.config.TMP_THUMBNAIL_DIR, str(file.id) + '-max')
if not os.path.exists(max_folder):
os.makedirs(max_folder)
out_folder = os.path.join(self.config.TMP_THUMBNAIL_DIR, str(file.id) + '-out')
if not os.path.exists(out_folder):
os.makedirs(out_folder)
for size in self.config.THUMBNAIL_SIZES:
if not os.path.exists(os.path.join(out_folder, str(size))):
os.makedirs(os.path.join(out_folder, str(size)))
file.thumbnail = {}
pages = 0
# generate max images
max_path = max_folder + os.sep + '%d.png'
cmd = '%s -dQUIET -dSAFER -dBATCH -dNOPAUSE -sDisplayHandle=0 -sDEVICE=png16m -r100 -dTextAlphaBits=4 -sOutputFile=%s -f %s' % (
self.config.GHOSTSCRIPT_COMMAND, max_path, file_path)
self.execute(cmd, self.body.id)
# generate thumbnails based on max images
for max_file in os.listdir(max_folder):
pages += 1
file_path_max = os.path.join(max_folder, max_file)
num = max_file.split('.')[0]
im = Image.open(file_path_max)
im = self.conditional_to_greyscale(im)
(owidth, oheight) = im.size
file.thumbnail[str(num)] = {
'page': int(num),
'pages': {}
}
for size in self.config.THUMBNAIL_SIZES:
(width, height) = self.scale_width_height(size, owidth, oheight)
# Two-way resizing
resizedim = im
if oheight > (height * 2.5):
# generate intermediate image with double size
resizedim = resizedim.resize((width * 2, height * 2), Image.NEAREST)
resizedim = resizedim.resize((width, height), Image.ANTIALIAS)
out_path = os.path.join(out_folder, str(size), str(num) + '.jpg')
resizedim.save(out_path, subsampling=0, quality=80)
# optimize image
cmd = '%s --preserve-perms %s' % (self.config.JPEGOPTIM_PATH, out_path)
self.execute(cmd, self.body.id)
# create mongodb object and append it to file
file.thumbnail[str(num)]['pages'][str(size)] = {
'width': width,
'height': height,
'filesize': os.path.getsize(out_path)
}
# save all generated files in minio
for size in self.config.THUMBNAIL_SIZES:
for out_file in os.listdir(os.path.join(out_folder, str(size))):
try:
self.s3.fput_object(
self.config.S3_BUCKET,
"file-thumbnails/%s/%s/%s/%s" % (self.body.id, str(file.id), str(size), out_file),
os.path.join(out_folder, str(size), out_file),
'image/jpeg'
)
except ResponseError as err:
self.datalog.error(
'Critical error saving file from File %s from Body %s' % (file.id, self.body.id))
# save in mongodb
file.thumbnailStatus = 'successful'
file.thumbnailsGenerated = datetime.datetime.now()
file.modified = datetime.datetime.now()
file.pages = pages
file.save()
# tidy up
try:
os.unlink(file_path)
except FileNotFoundError:
pass
try:
if file_path_old:
os.unlink(file_path)
except FileNotFoundError:
pass
shutil.rmtree(max_folder)
shutil.rmtree(out_folder)
def conditional_to_greyscale(self, image):
"""
Convert the image to greyscale if the image information
is greyscale only
"""
bands = image.getbands()
if len(bands) >= 3:
# histogram for all bands concatenated
hist = image.histogram()
if len(hist) >= 768:
hist1 = hist[0:256]
hist2 = hist[256:512]
hist3 = hist[512:768]
# print "length of histograms: %d %d %d" % (len(hist1), len(hist2), len(hist3))
if hist1 == hist2 == hist3:
# print "All histograms are the same!"
return image.convert('L')
return image
def scale_width_height(self, height, original_width, original_height):
factor = float(height) / float(original_height)
width = int(round(factor * original_width))
return (width, height)
| [
"mail@ernestoruge.de"
] | mail@ernestoruge.de |
c79d5564e78d20d17cb770d41df75384c39e4317 | 057891dfaee63691cd03502a78849c7d44416eac | /py/climber.py | 4ea0656fa5f59fcc363634bff1b81d9e3269c5ec | [] | no_license | VictorGhercoias/LPD8806_PI | ba36ef3872ce2af82f9f6bc4606450e3c30f1ef9 | 0b67d674aa8e3aef671f8171d87a21a5f765f4bc | refs/heads/master | 2021-05-10T07:43:36.549599 | 2018-01-24T22:15:03 | 2018-01-24T22:15:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 608 | py | # !/usr/bin/python
from bootstrap import *
from raspledstrip.animation import *
#setup colors to loop through for fade
colors = [
(255.0, 0.0, 200.0), # red
# (0.0, 255.0, 0.0), # blue
# (0.0, 0.0, 255.0), # green
# (255.0, 255.0, 255.0), # white
]
n = 2 # how many colors to lit up
step = 0.01
for c in range(n):
r, g, b = colors[c]
level = 0.01
dir = step
while level >= 0.0:
led.fill(Color(r, g, b, level))
led.update()
if (level >= 0.99):
dir = -step
level += dir
| [
"catalin.ghercoias@gmail.com"
] | catalin.ghercoias@gmail.com |
c597e4a2e219ff461d0a9195d8c6499ce1384248 | 0acc2e1fafb6eb74832ad40c12dc7c6daf12df3e | /problem-sets/melon-raffle/solution/customer_info.py | 736c8d379dbe9f6bf2f26a50f557eb40f09d1633 | [] | no_license | jttyeung/hackbright | 692911705dfbf3aa3f59bd897b9f12b2a7f1abca | 4d9650e4b88def4d8765a6680450d81f08d5b5a1 | refs/heads/master | 2021-01-12T00:53:39.314166 | 2018-02-01T07:13:41 | 2018-02-01T07:13:41 | 78,312,681 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 807 | py | from customer import Customer
def organize_customer_data(customer_file_path):
"""Read customer file and return list of customer objects.
Read file at customer_file_path and create a customer
object containingcustomer information.
"""
customers = []
customer_file = open(customer_file_path)
# Process a file like:
#
# customer-name | email | street | city | zipcode
for line in customer_file:
customer_data = line.strip().split("|")
name, email, street, city, zipcode = customer_data
new_customer = Customer(name,
email,
street,
city,
zipcode)
customers.append(new_customer)
return customers
| [
"jttyeung@gmail.com"
] | jttyeung@gmail.com |
7fd7a0d7b7067957a3e68dee68983705f5d47407 | 6265991d742eaf72331d845f03b7b98e11029486 | /Queue.py | 973a0d96b0207195b373ef51973ec80caab9187a | [] | no_license | Khamies/Data_Structures-and-Algorithms | 6a63cea297b5379684394f3ed9f630f3743695a5 | 75169c4be7684df64fbe2b4d652c43026ed1ab4a | refs/heads/master | 2020-04-21T09:42:09.572719 | 2019-02-09T14:04:11 | 2019-02-09T14:04:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,290 | py |
class Queue:
def __init__(self, capacity):
self.capacity=capacity
self.array=[]
self.write=-1
self.read=-1
def enqueue(self,element):
if self.read == -1 and self.write >= self.capacity:
print(" Queue is empty")
return -1
else:
self.array.append(element)
self.write+=1
print("{} has been pushed".format(element))
return 0
def dequeue(self):
if self.read == self.write:
print("Queue is empty")
return -1
else:
self.read+=1
print("{} has been removed".format(self.array[self.read-1]))
return 0
def top(self):
if self.read == self.write:
print(" Queue is empty")
return -1
else:
print("++++++++++++++++++",self.array[self.write])
return 0
def empty(self):
if self.read == self.write:
print(True)
return -1
else:
print(False)
return 0
mqueue=Queue(5)
mqueue.enqueue(32)
mqueue.enqueue(43)
mqueue.enqueue(77)
mqueue.top()
mqueue.dequeue()
mqueue.dequeue()
mqueue.top()
mqueue.dequeue()
mqueue.top()
mqueue.dequeue()
mqueue.top()
| [
"waleed.daud@outlook.com"
] | waleed.daud@outlook.com |
0b8ba97f179806b4636613b056bfd9ef384ad098 | 8d7b88d41be387552922992f8600ee65ead1c467 | /parsefec.py | 912ca6f73207fc30440da910cf30381839252a03 | [] | no_license | electionr/parsefec | 6e4a80420e0258a106a48cce9ffa7fb57a80449e | 5d68646b574a35cc3d61fa6d110c77d9c475a332 | refs/heads/master | 2021-01-16T20:05:30.741433 | 2014-06-03T23:04:03 | 2014-06-03T23:04:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 10,928 | py | '''
parsefec is a command line tool and python library for downloading, parsing FEC Electronic filings.
Usage: parsefec.py [-h] [--outdir OUTDIR] [--inputdir INPUTDIR] [--mode MODE]
[--delimiter DELIMITER]
Parser for FEC Electronic Filing data from OpenSecrets.org
optional arguments:
-h, --help show this help message and exit
--inputdir INPUTDIR, -i INPUTDIR
Directory of zip files from
ftp://ftp.fec.gov/FEC/electronic/
--mode MODE, -m MODE Mode of output: db, inserts (insert statements), text
--delimiter DELIMITER, -d DELIMITER
Delimiter for text output. Use python escapes:
--delimiter='\t'
As a library (in development):
import parsefec
parsefec.parseFile()
parsefec.downloadRange()
'''
import zipfile
import os
import csv
import sqlite3
import datetime
import sys
from getpass import getpass
import argparse
from collections import OrderedDict
from settings import *
FS = '\x1C' # File separator character, used for delimiter in input[
# modes
DB = 'db'
INSERTS = 'inserts'
TEXT = 'text'
# Not Processed
NOT_PROCESSED = 'NotProcessed'
today = datetime.date.today().strftime("%m/%d/%Y")
def writeOut(statement, dbcursor=None, filename=None):
if args.mode == DB:
try:
dbcursor.execute(statement)
dbcursor.commit()
except Exception, e:
log.write('-- Insert Error:\n%s\n\n--%s%s' % (statement, e, errSep))
elif args.mode == TEXT and filename is not None:
out = open(os.path.join(output_dirname, filename + '.txt'), 'a')
out.write(statement + '\n')
out.close()
else:
print statement
def adaptAndWriteOutput(line, clause=None, filename=None, dbcursor=None):
if args.mode == INSERTS or args.mode == DB:
# Database or inserts
insert = 'INSERT INTO {}.{}.[{}] VALUES ({});'.format(database, schema, filename, clause)
else:
# text or no mode
textout = [s if s is not None else '' for s in line]
output = args.delimiter.join(textout)
if args.mode == INSERTS:
writeOut(insert)
elif args.mode == TEXT:
writeOut(output, filename=filename)
elif args.mode == DB:
writeOut(output, dbcursor=dbcursor)
else:
writeOut(output)
def parseFile(fname):
f = open(os.path.join(input_dirname, fname), 'r')
dbcursor = None
if args.mode == DB:
dbconnection = pyodbc.connect(DBCONNECTION)
dbcursor = dbconnection.cursor()
insertClause = '\'{}\', \'{}\''.format(fname, today)
adaptAndWriteOutput([fname, today], clause=insertClause, filename='FilesProcessed', dbcursor=dbcursor)
textmode = False
for line in f:
if line.strip() == '[ENDTEXT]':
clog.write('%s\n\n%s' % (line, errSep))
textmode = False
continue
elif line.strip() == '[BEGINTEXT]':
clog.write('-- Filename: %s\n%s\n' %(fname, line))
clog.write('http://docquery.fec.gov/dcdev/fectxt/' + fname + '\n')
textmode = True
continue
elif textmode:
clog.write(line)
continue
if line[-1] == FS:
line = line[:-1]
# la (line array): Array of the current fields
la = line.strip().split(FS)
# Remove double quotes from double quote enclosed fields
# TODO: Remove only first and last quotes.
la = [x.replace('"', '') if len(x) > 0 and (x[0] == '"' and x[-1] == '"') else x for x in la]
# Check first to see if no match will be found.
matchFound = False
for matchLine in orderedFormCodes.keys():
if la[0][:len(matchLine)] == matchLine:
matchFound = True
if matchFound is False:
if la != ['']:
log.write('-- No Form Match Error: %s\n' % la)
continue
for matchLine, formName in orderedFormCodes.iteritems():
# Use lines that match a form name.
if la[0][:len(matchLine)] == matchLine:
la.insert(0, fname.upper())
# Insert row into table based on form_name
if formName != NOT_PROCESSED:
insertClause = ''
schemaInfo = schemas[formName]
if len(schemaInfo) + 1 < len(la):
log.write('-- Schema does not match input line: %s\n%\n--%s%s' % (formName, la, schemaInfo, errSep))
break
# If columns are missing from end of input add
# same number of None elements to end of Array.
# These will be replaced by Null in insert statement.
elif len(schemaInfo) > len(la):
la = la + [None] * (len(schemaInfo) - len(la))
# TODO: Log exception
try:
for order, coltype in enumerate(schemaInfo):
# None is Null, 'NULL' is Null
if la[order] is None or la[order].strip().lower() == 'null':
insertClause += ', Null'
continue
# Truncate varchar and chars to length
if coltype[0] in ['varchar', 'char'] and len(la[order]) > coltype[1]:
la[order] = la[order][:coltype[1]]
insertClause += ', \'' + la[order].replace('\'', '\'\'') + '\''
log.write('-- Truncation: %s Value: %s Truncated to: %s\n\n--%s%s' % (formName, la[order], coltype[1], la, errSep))
# If type is numerical and empty, use Null
elif coltype[0] == 'decimal' and la[order].strip() == '':
insertClause += ', Null'
else:
insertClause += ', \'' + la[order].replace('\'', '\'\'') + '\''
except Exception, e:
log.write('-- Error: %s\n\n--%s\n--%s\n--%s\n\n--%s%s' % (formName, la, schemaInfo, insertClause, e, errSep))
insertClause = insertClause[2:]
tableName = 'EF_Sch' + formName
adaptAndWriteOutput(la, clause=insertClause, filename=tableName, dbcursor=dbcursor)
else:
insertClause = '\'{}\', \'{}\',\'{}\''.format(la[0], '\t'.join(la), today)
adaptAndWriteOutput(la, clause=insertClause, filename='EF_NotProcessed', dbcursor=dbcursor)
break
if args.mode == DB:
dbconnection.close()
f.close()
def processFile(f):
zfile = zipfile.ZipFile(os.path.join(input_dirname, f))
filesprocessed = []
for name in zfile.namelist():
fd = open(os.path.join(input_dirname, name),"w")
fd.write(zfile.read(name))
fd.close()
parseFile(name)
filesprocessed.append(name)
os.remove(os.path.join(input_dirname, name))
if args.mode == DB:
print 'First file processed: ' + min(filesprocessed) + '\n'
print 'Last file processed: ' + max(filesprocessed) + '\n'
print 'Number of files processed: ' + str(len(filesprocessed)) + '\n\n'
def processDir(dir):
for zipname in os.listdir(input_dirname):
if zipname[-3:] == 'zip':
processFile(zipname)
parser = argparse.ArgumentParser(description='Parser for FEC Electronic Filing data from OpenSecrets.org')
parser.add_argument('--outdir', '-o', dest='outputdir', default=None, help='Output directory')
parser.add_argument("--inputdir", '-i', dest='inputdir', default=None, help='Directory of zip files from ftp://ftp.fec.gov/FEC/electronic/')
parser.add_argument("--logdir", '-l', dest='logdir', default=None, help='Directory to write error logs and correspondence logs')
parser.add_argument("--schema", '-s', dest='fecschema', default=None, help='Directory of zip files from ftp://ftp.fec.gov/FEC/electronic/')
parser.add_argument("--mode", '-m', dest='mode', default=TEXT, help='Mode of output: db, inserts (insert statements), text')
parser.add_argument("--delimiter", '-d', dest='delimiter', default='\t', help='Delimiter for text output. Use python escapes: --delimiter=\'\\t\' ')
args = parser.parse_args()
args.delimiter = args.delimiter.decode('string_escape')
# Overwrite defaults
if args.outputdir is not None:
output_dirname = args.outputdir
if args.inputdir is not None:
input_dirname = args.inputdir
if args.logdir is not None:
log_dirname = args.logdir
if args.fecschema is not None:
fec_schema = args.fecschema
# Order by length so short matches don't take precidence.
orderedFormCodes = OrderedDict(sorted(formCodes.items(), key=lambda t: -len(t[0])))
# Import schema information
conn = sqlite3.connect(":memory:")
c = conn.cursor()
c.execute("CREATE TABLE schemas (TABLE_NAME text, COLUMN_NAME text, TYPE_NAME text, LENGTH integer, ORDINAL_POSITION integer);")
dr = csv.DictReader(open(fec_schema), delimiter='\t')
to_db = [(i['TABLE_NAME'], i['COLUMN_NAME'], i['TYPE_NAME'], i['LENGTH'], i['ORDINAL_POSITION']) for i in dr]
c.executemany("INSERT INTO schemas (TABLE_NAME, COLUMN_NAME, TYPE_NAME, LENGTH, ORDINAL_POSITION) values (?, ?, ?, ?, ?);", to_db)
schemas = {}
for formName in formCodes.values():
c.execute('SELECT TYPE_NAME, LENGTH FROM schemas where TABLE_NAME = "EF_Sch' + formName + '_Processed" ORDER BY ORDINAL_POSITION ASC')
schemas[formName] = c.fetchall()
if args.mode == 'db':
import pyodbc
# Some settings in settings.py
DBCONNECTION = 'DRIVER={};SERVER={};DATABASE={};UID=datauser;PWD={}'.format(driver, server, database, getpass())
if __name__ == '__main__':
# Open error log
log = open(os.path.join(log_dirname, 'Electronic_Filing_Log_' + str(datetime.date.today()) + '.log'), 'a')
clog = open(os.path.join(log_dirname, 'Electronic_Filing_Log_Correspondence_' + str(datetime.date.today()) + '.log'), 'a')
processDir(args.inputdir)
log.close()
clog.close()
| [
"alexbyrnes@gmail.com"
] | alexbyrnes@gmail.com |
0335920b85313fe41a0cc25191d8d8d1039dc145 | e1071cd8065ed01b8bc42f5f47f964837ec723b8 | /bin/python/ripple/util/test_ConfigFile.py | 0d7efc896e484fafd0bd7e810380c9b115228788 | [
"MIT-Wu",
"MIT",
"ISC",
"BSL-1.0"
] | permissive | SAN-CHAIN/sand | 07355acf0ba4607a5cb1408a1d86d87f03e3a317 | 1c51a7d1b215a7a2e1e06bd3b87a7e1da7239664 | refs/heads/master | 2020-06-22T01:27:21.168067 | 2016-10-15T11:22:18 | 2016-10-15T11:22:18 | 94,208,495 | 0 | 3 | null | null | null | null | UTF-8 | Python | false | false | 4,271 | py | from __future__ import absolute_import, division, print_function, unicode_literals
from ripple.util import ConfigFile
from unittest import TestCase
class test_ConfigFile(TestCase):
def test_trivial(self):
self.assertEquals(ConfigFile.read(''), {})
def test_full(self):
self.assertEquals(ConfigFile.read(FULL.splitlines()), RESULT)
RESULT = {
'websocket_port': '6206',
'database_path': '/development/alpha/db',
'sntp_servers':
['time.windows.com', 'time.apple.com', 'time.nist.gov', 'pool.ntp.org'],
'validation_seed': 'sh1T8T9yGuV7Jb6DPhqSzdU2s5LcV',
'node_size': 'medium',
'rpc_startup': {
'command': 'log_level',
'severity': 'debug'},
'ips': ['r.ripple.com', '51235'],
'node_db': {
'file_size_mult': '2',
'file_size_mb': '8',
'cache_mb': '256',
'path': '/development/alpha/db/rocksdb',
'open_files': '2000',
'type': 'RocksDB',
'filter_bits': '12'},
'peer_port': '53235',
'ledger_history': 'full',
'rpc_ip': '127.0.0.1',
'websocket_public_ip': '0.0.0.0',
'rpc_allow_remote': '0',
'validators':
[['n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7', 'RL1'],
['n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj', 'RL2'],
['n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C', 'RL3'],
['n9KiYM9CgngLvtRCQHZwgC2gjpdaZcCcbt3VboxiNFcKuwFVujzS', 'RL4'],
['n9LdgEtkmGB9E2h3K4Vp7iGUaKuq23Zr32ehxiU8FWY7xoxbWTSA', 'RL5']],
'debug_logfile': '/development/alpha/debug.log',
'websocket_public_port': '5206',
'peer_ip': '0.0.0.0',
'rpc_port': '5205',
'validation_quorum': '3',
'websocket_ip': '127.0.0.1'}
FULL = """
[ledger_history]
full
# Allow other peers to connect to this server.
#
[peer_ip]
0.0.0.0
[peer_port]
53235
# Allow untrusted clients to connect to this server.
#
[websocket_public_ip]
0.0.0.0
[websocket_public_port]
5206
# Provide trusted websocket ADMIN access to the localhost.
#
[websocket_ip]
127.0.0.1
[websocket_port]
6206
# Provide trusted json-rpc ADMIN access to the localhost.
#
[rpc_ip]
127.0.0.1
[rpc_port]
5205
[rpc_allow_remote]
0
[node_size]
medium
# This is primary persistent datastore for rippled. This includes transaction
# metadata, account states, and ledger headers. Helpful information can be
# found here: https://ripple.com/wiki/NodeBackEnd
[node_db]
type=RocksDB
path=/development/alpha/db/rocksdb
open_files=2000
filter_bits=12
cache_mb=256
file_size_mb=8
file_size_mult=2
[database_path]
/development/alpha/db
# This needs to be an absolute directory reference, not a relative one.
# Modify this value as required.
[debug_logfile]
/development/alpha/debug.log
[sntp_servers]
time.windows.com
time.apple.com
time.nist.gov
pool.ntp.org
# Where to find some other servers speaking the Ripple protocol.
#
[ips]
r.ripple.com 51235
# The latest validators can be obtained from
# https://ripple.com/ripple.txt
#
[validators]
n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7 RL1
n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj RL2
n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C RL3
n9KiYM9CgngLvtRCQHZwgC2gjpdaZcCcbt3VboxiNFcKuwFVujzS RL4
n9LdgEtkmGB9E2h3K4Vp7iGUaKuq23Zr32ehxiU8FWY7xoxbWTSA RL5
# Ditto.
[validation_quorum]
3
[validation_seed]
sh1T8T9yGuV7Jb6DPhqSzdU2s5LcV
# Turn down default logging to save disk space in the long run.
# Valid values here are trace, debug, info, warning, error, and fatal
[rpc_startup]
{ "command": "log_level", "severity": "debug" }
# Configure SSL for WebSockets. Not enabled by default because not everybody
# has an SSL cert on their server, but if you uncomment the following lines and
# set the path to the SSL certificate and private key the WebSockets protocol
# will be protected by SSL/TLS.
#[websocket_secure]
#1
#[websocket_ssl_cert]
#/etc/ssl/certs/server.crt
#[websocket_ssl_key]
#/etc/ssl/private/server.key
# Defaults to 0 ("no") so that you can use self-signed SSL certificates for
# development, or internally.
#[ssl_verify]
#0
""".strip()
| [
"nemox1024@hotmail.com"
] | nemox1024@hotmail.com |
248b8e5a606abc28c5345081f3e44a98c551c887 | 6450234cc5339e9d05102b25b25ba38e2bd9e4cb | /MonoJetAnalysis/python/defaultMETSamples_mc.py | 7e30898207a90d75e9d21b8ec7eea5427d251ec5 | [] | no_license | wa01/Workspace | 57b87481005c441ab91a8180ddf6ea00b520aca7 | 47759c6a20473f7a694ca9e3fd4e0e8343c8018c | refs/heads/master | 2021-01-15T10:36:55.429420 | 2014-09-20T17:44:54 | 2014-09-20T17:44:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 18,897 | py | import copy, os, sys
allSamples = []
from Workspace.HEPHYPythonTools.createPUReweightingHisto import getPUReweightingUncertainty
S10rwHisto = getPUReweightingUncertainty("S10", dataFile = "/data/schoef/tools/PU/MyDataPileupHistogram_Run2012ABCD_60max_true_pixelcorr_Sys0.root")
S10rwPlusHisto = getPUReweightingUncertainty("S10", dataFile = "/data/schoef/tools/PU/MyDataPileupHistogram_Run2012ABCD_60max_true_pixelcorr_SysPlus5.root")
S10rwMinusHisto = getPUReweightingUncertainty("S10", dataFile = "/data/schoef/tools/PU/MyDataPileupHistogram_Run2012ABCD_60max_true_pixelcorr_SysMinus5.root")
data={}
data["name"] = "data";
data["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614/"
data['newMETCollection'] = True
data["bins"] = ["MET-Run2012A-22Jan2013-3", "MET-Run2012B-22Jan2013", "MET-Run2012C-22Jan2013", "MET-Run2012D-22Jan2013"]
data["Chain"] = "Events"
data["Counter"] = "bool_EventCounter_passed_PAT.obj"
allSamples.append(data)
dataSingleMu={}
dataSingleMu["name"] = "data";
dataSingleMu['newMETCollection'] = True
dataSingleMu["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614/"
dataSingleMu["bins"] = ["SingleMu-Run2012A-22Jan2013", "SingleMu-Run2012B-22Jan2013", "SingleMu-Run2012C-22Jan2013", "SingleMu-Run2012D-22Jan2013"]
dataSingleMu["Chain"] = "Events"
dataSingleMu["Counter"] = "bool_EventCounter_passed_PAT.obj"
allSamples.append(dataSingleMu)
mc={}
mc["name"] = "mc";
mc["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614"
mc['newMETCollection'] = True
mc["Chain"] = "Events"
#mc["reweightingHistoFile"] = "/data/schoef/tools/PU/reweightingHisto_Summer2012-S10-Run2012ABCD_60max_true_pixelcorr_Sys0.root"
#mc["reweightingHistoFileSysPlus"] = "/data/schoef/tools/PU/reweightingHisto_Summer2012-S10-Run2012ABCD_60max_true_pixelcorr_SysPlus5.root"
#mc["reweightingHistoFileSysMinus"] = "/data/schoef/tools/PU/reweightingHisto_Summer2012-S10-Run2012ABCD_60max_true_pixelcorr_SysMinus5.root"
QCD_Bins = \
["8TeV-QCD-Pt1000-MuEnrichedPt5", "8TeV-QCD-Pt120to170-MuEnrichedPt5", "8TeV-QCD-Pt170to300-MuEnrichedPt5",\
"8TeV-QCD-Pt20to30-MuEnrichedPt5", "8TeV-QCD-Pt300to470-MuEnrichedPt5", "8TeV-QCD-Pt30to50-MuEnrichedPt5",\
"8TeV-QCD-Pt470to600-MuEnrichedPt5", "8TeV-QCD-Pt50to80-MuEnrichedPt5",\
"8TeV-QCD-Pt600to800-MuEnrichedPt5", "8TeV-QCD-Pt800to1000-MuEnrichedPt5", "8TeV-QCD-Pt80to120-MuEnrichedPt5"]
#WJets_Bins = ["8TeV-WJets-HT250to300", "8TeV-WJets-HT300to400", "8TeV-WJets-HT400"]
#
DY_Bins = ["8TeV-DYJetsToLL-M10to50", "8TeV-DYJetsToLL-M50"]
#ZJets_Bins = DY_Bins
ZJetsInv_Bins = ["8TeV-ZJetsToNuNu-HT100to200", "8TeV-ZJetsToNuNu-HT200-400",\
"8TeV-ZJetsToNuNu-HT400", "8TeV-ZJetsToNuNu-HT50to100"]
#
singleTop_Bins = ["8TeV-T-t", "8TeV-T-s", "8TeV-T-tW", "8TeV-Tbar-t", "8TeV-Tbar-s", "8TeV-Tbar-tW"]
#ttbar = copy.deepcopy(mc)
#ttbar['reweightingHistoFile'] = S10rwHisto
#ttbar['reweightingHistoFileSysPlus'] = S10rwPlusHisto
#ttbar['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#ttbar["bins"] = ["8TeV-TTJets"]
#ttbar["name"] = "TTJets"
#ttbar['reweightingHistoFile'] = S10rwHisto
#ttbar['reweightingHistoFileSysPlus'] = S10rwPlusHisto
#ttbar['reweightingHistoFileSysMinus'] = S10rwMinusHisto
ttbarPowHeg = copy.deepcopy(mc)
ttbarPowHeg['reweightingHistoFile'] = S10rwHisto
ttbarPowHeg['reweightingHistoFileSysPlus'] = S10rwPlusHisto
ttbarPowHeg['reweightingHistoFileSysMinus'] = S10rwMinusHisto
ttbarPowHeg["bins"] = [["8TeV-TTJets-powheg-v1+2", ["8TeV-TTJets-powheg-v1", "8TeV-TTJets-powheg-v2"]]]
ttbarPowHeg["name"] = "TTJetsPowHeg"
ttbarPowHeg['reweightingHistoFile'] = S10rwHisto
ttbarPowHeg['reweightingHistoFileSysPlus'] = S10rwPlusHisto
ttbarPowHeg['reweightingHistoFileSysMinus'] = S10rwMinusHisto
wjetsInc = copy.deepcopy(mc)
wjetsInc["bins"] = ["8TeV-WJetsToLNu"]
wjetsInc["name"] = "WJetsToLNu"
wjetsInc['reweightingHistoFile'] = S10rwHisto
wjetsInc['reweightingHistoFileSysPlus'] = S10rwPlusHisto
wjetsInc['reweightingHistoFileSysMinus'] = S10rwMinusHisto
w1jets = copy.deepcopy(mc)
w1jets["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614/"
w1jets['newMETCollection'] = True
w1jets["bins"] = ["8TeV-W1JetsToLNu"]
w1jets["name"] = "W1JetsToLNu"
w1jets['reweightingHistoFile'] = S10rwHisto
w1jets['reweightingHistoFileSysPlus'] = S10rwPlusHisto
w1jets['reweightingHistoFileSysMinus'] = S10rwMinusHisto
w2jets = copy.deepcopy(w1jets)
w2jets["bins"] = ["8TeV-W2JetsToLNu"]
w2jets['newMETCollection'] = True
w2jets["name"] = "W2JetsToLNu"
w2jets['reweightingHistoFile'] = S10rwHisto
w2jets['reweightingHistoFileSysPlus'] = S10rwPlusHisto
w2jets['reweightingHistoFileSysMinus'] = S10rwMinusHisto
w3jets = copy.deepcopy(w1jets)
w3jets["bins"] = ["8TeV-W3JetsToLNu"]
w3jets['newMETCollection'] = True
w3jets["name"] = "W3JetsToLNu"
w3jets['reweightingHistoFile'] = S10rwHisto
w3jets['reweightingHistoFileSysPlus'] = S10rwPlusHisto
w3jets['reweightingHistoFileSysMinus'] = S10rwMinusHisto
w4jets = copy.deepcopy(w1jets)
w4jets["bins"] = ["8TeV-W4JetsToLNu"]
w4jets['newMETCollection'] = True
w4jets["name"] = "W4JetsToLNu"
w4jets['reweightingHistoFile'] = S10rwHisto
w4jets['reweightingHistoFileSysPlus'] = S10rwPlusHisto
w4jets['reweightingHistoFileSysMinus'] = S10rwMinusHisto
wbbjets = copy.deepcopy(w1jets)
wbbjets["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_140212"
wbbjets['newMETCollection'] = True
wbbjets["bins"]=["8TeV-WbbJetsToLNu"]
wbbjets["name"] = "WbbJets"
wbbjets['reweightingHistoFile'] = S10rwHisto
wbbjets['reweightingHistoFileSysPlus'] = S10rwPlusHisto
wbbjets['reweightingHistoFileSysMinus'] = S10rwMinusHisto
wjetsHT150v2 = copy.deepcopy(mc)
wjetsHT150v2["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614"
wjetsHT150v2['newMETCollection'] = True
wjetsHT150v2["bins"] = ["8TeV-WJetsToLNu_HT-150To200", "8TeV-WJetsToLNu_HT-200To250", "8TeV-WJetsToLNu_HT-250To300", "8TeV-WJetsToLNu_HT-300To400", "8TeV-WJetsToLNu_HT-400ToInf"]
wjetsHT150v2["name"] = "WJetsHT150v2"
wjetsHT150v2['reweightingHistoFile'] = S10rwHisto
wjetsHT150v2['reweightingHistoFileSysPlus'] = S10rwPlusHisto
wjetsHT150v2['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#wjetsToLNuPtW100 = copy.deepcopy(mc)
#wjetsToLNuPtW100["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614"
#wjetsToLNuPtW100['newMETCollection'] = True
#wjetsToLNuPtW100["bins"] = ["8TeV-WJetsToLNu_PtW-100_TuneZ2star_8TeV_ext-madgraph-tarball"]
#wjetsToLNuPtW100["name"] = "WJetsToLNu_PtW-100_TuneZ2star_8TeV_ext-madgraph-tarball"
#wjetsToLNuPtW100['reweightingHistoFile'] = S10rwHisto
#wjetsToLNuPtW100['reweightingHistoFileSysPlus'] = S10rwPlusHisto
#wjetsToLNuPtW100['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#
#wjetsToLNuPtW180 = copy.deepcopy(mc)
#wjetsToLNuPtW180["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614"
#wjetsToLNuPtW180['newMETCollection'] = True
#wjetsToLNuPtW180["bins"] = ["8TeV-WJetsToLNu_PtW-180_TuneZ2star_8TeV-madgraph-tarball"]
#wjetsToLNuPtW180["name"] = "WJetsToLNu_PtW-180_TuneZ2star_8TeV-madgraph-tarball"
#wjetsToLNuPtW180['reweightingHistoFile'] = S10rwHisto
#wjetsToLNuPtW180['reweightingHistoFileSysPlus'] = S10rwPlusHisto
#wjetsToLNuPtW180['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#
#wjetsToLNuPtW50 = copy.deepcopy(mc)
#wjetsToLNuPtW50["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614"
#wjetsToLNuPtW50['newMETCollection'] = True
#wjetsToLNuPtW50["bins"] = ["8TeV-WJetsToLNu_PtW-50To70_TuneZ2star_8TeV-madgraph", "8TeV-WJetsToLNu_PtW-70To100_TuneZ2star_8TeV-madgraph", "8TeV-WJetsToLNu_PtW-100_TuneZ2star_8TeV-madgraph"]
#wjetsToLNuPtW50["name"] = "WJetsToLNu_PtW-50_TuneZ2star_8TeV-madgraph"
#wjetsToLNuPtW50['reweightingHistoFile'] = S10rwHisto
#wjetsToLNuPtW50['reweightingHistoFileSysPlus'] = S10rwPlusHisto
#wjetsToLNuPtW50['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#
#
#wMinusToLNu = copy.deepcopy(mc)
#wMinusToLNu["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614"
#wMinusToLNu['newMETCollection'] = True
#wMinusToLNu["bins"] = ["8TeV-WminusToENu", "8TeV-WminusToMuNu", "8TeV-WminusToTauNu-tauola"]
#wMinusToLNu["name"] = "WminusToLNu"
#wMinusToLNu['reweightingHistoFile'] = S10rwHisto
#wMinusToLNu['reweightingHistoFileSysPlus'] = S10rwPlusHisto
#wMinusToLNu['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#
#wPlusToLNu = copy.deepcopy(mc)
#wPlusToLNu["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614"
#wPlusToLNu['newMETCollection'] = True
#wPlusToLNu["bins"] = ["8TeV-WplusToENu", "8TeV-WplusToMuNu", "8TeV-WplusToTauNu-tauola"]
#wPlusToLNu["name"] = "WplusToLNu"
#wPlusToLNu['reweightingHistoFile'] = S10rwHisto
#wPlusToLNu['reweightingHistoFileSysPlus'] = S10rwPlusHisto
#wPlusToLNu['reweightingHistoFileSysPlus'] = S10rwPlusHisto
#
dy = copy.deepcopy(mc)
dy["bins"] = DY_Bins
dy["name"] = "DY"
dy['reweightingHistoFile'] = S10rwHisto
dy['reweightingHistoFileSysPlus'] = S10rwPlusHisto
dy['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#dyJetsToLLPtZ180 = copy.deepcopy(mc)
#dyJetsToLLPtZ180["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614"
#dyJetsToLLPtZ180['newMETCollection'] = True
#dyJetsToLLPtZ180["bins"] = ["8TeV-DYJetsToLL_PtZ-180_TuneZ2star_8TeV-madgraph-tarball"]
#dyJetsToLLPtZ180["name"] = "DYJetsToLL_PtZ-180_TuneZ2star_8TeV-madgraph-tarball"
#dyJetsToLLPtZ180['reweightingHistoFile'] = S10rwHisto
#dyJetsToLLPtZ180['reweightingHistoFileSysPlus'] = S10rwPlusHisto
#dyJetsToLLPtZ180['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#
#dyJetsToLLPtZ50 = copy.deepcopy(mc)
#dyJetsToLLPtZ50["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614"
#dyJetsToLLPtZ50['newMETCollection'] = True
#dyJetsToLLPtZ50["bins"] = ["8TeV-DYJetsToLL_PtZ-50To70_TuneZ2star_8TeV-madgraph-tarball", "8TeV-DYJetsToLL_PtZ-70To100_TuneZ2star_8TeV-madgraph-tarball", "8TeV-DYJetsToLL_PtZ-100_TuneZ2star_8TeV-madgraph"]
#dyJetsToLLPtZ50["name"] = "DYJetsToLL_PtZ-50_TuneZ2star_8TeV-madgraph-tarball"
#dyJetsToLLPtZ50['reweightingHistoFile'] = S10rwHisto
#dyJetsToLLPtZ50['reweightingHistoFileSysPlus'] = S10rwPlusHisto
#dyJetsToLLPtZ50['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#
dyJetsToLLPtZ50Ext = copy.deepcopy(mc)
dyJetsToLLPtZ50Ext['newMETCollection'] = True
dyJetsToLLPtZ50Ext["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614"
dyJetsToLLPtZ50Ext["bins"] = ["8TeV-DYJetsToLL_PtZ-50To70_TuneZ2star_8TeV_ext-madgraph-tarball", "8TeV-DYJetsToLL_PtZ-70To100_TuneZ2star_8TeV_ext-madgraph-tarball", "8TeV-DYJetsToLL_PtZ-100_TuneZ2star_8TeV_ext-madgraph-tarball"]
dyJetsToLLPtZ50Ext["name"] = "8TeV-DYJetsToLL_PtZ-50_TuneZ2star_8TeV_ext-madgraph-tarball"
dyJetsToLLPtZ50Ext['reweightingHistoFile'] = S10rwHisto
dyJetsToLLPtZ50Ext['reweightingHistoFileSysPlus'] = S10rwPlusHisto
dyJetsToLLPtZ50Ext['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#
zinv = copy.deepcopy(mc)
zinv["bins"] = ZJetsInv_Bins
zinv["name"] = "ZJetsInv"
zinv['reweightingHistoFile'] = S10rwHisto
zinv['reweightingHistoFileSysPlus'] = S10rwPlusHisto
zinv['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#zJetsToNuNuHT50 = copy.deepcopy(mc)
#zJetsToNuNuHT50["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614"
#zJetsToNuNuHT50['newMETCollection'] = True
#zJetsToNuNuHT50["bins"] = ["8TeV-ZJetsToNuNu_50_HT_100_TuneZ2Star_8TeV_madgraph", "8TeV-ZJetsToNuNu_100_HT_200_TuneZ2Star_8TeV_madgraph", "8TeV-ZJetsToNuNu_200_HT_400_TuneZ2Star_8TeV_madgraph", "8TeV-ZJetsToNuNu_400_HT_inf_TuneZ2Star_8TeV_madgraph"]
#zJetsToNuNuHT50["name"] = "8TeV-ZJetsToNuNu_50_TuneZ2Star_8TeV_madgraph"
#zJetsToNuNuHT50['reweightingHistoFile'] = S10rwHisto
#zJetsToNuNuHT50['reweightingHistoFileSysPlus'] = S10rwPlusHisto
#zJetsToNuNuHT50['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#
#zJetsToNuNuHT50Ext = copy.deepcopy(mc)
#zJetsToNuNuHT50Ext["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614"
#zJetsToNuNuHT50Ext['newMETCollection'] = True
#zJetsToNuNuHT50Ext["bins"] = ["8TeV-ZJetsToNuNu_50_HT_100_TuneZ2Star_8TeV_madgraph_ext", "8TeV-ZJetsToNuNu_100_HT_200_TuneZ2Star_8TeV_madgraph_ext", "8TeV-ZJetsToNuNu_200_HT_400_TuneZ2Star_8TeV_madgraph_ext", "8TeV-ZJetsToNuNu_400_HT_inf_TuneZ2Star_8TeV_madgraph_ext"]
#zJetsToNuNuHT50Ext["name"] = "8TeV-ZJetsToNuNu_50_TuneZ2Star_8TeV_madgraph_ext"
#zJetsToNuNuHT50Ext['reweightingHistoFile'] = S10rwHisto
#zJetsToNuNuHT50Ext['reweightingHistoFileSysPlus'] = S10rwPlusHisto
#zJetsToNuNuHT50Ext['reweightingHistoFileSysMinus'] = S10rwMinusHisto
singleTop = copy.deepcopy(mc)
singleTop["bins"] = singleTop_Bins
singleTop["name"] = "singleTop"
singleTop['reweightingHistoFile'] = S10rwHisto
singleTop['reweightingHistoFileSysPlus'] = S10rwPlusHisto
singleTop['reweightingHistoFileSysMinus'] = S10rwMinusHisto
qcd = copy.deepcopy(mc)
qcd["bins"] = QCD_Bins
qcd["name"] = "QCD"
qcd['reweightingHistoFile'] = S10rwHisto
qcd['reweightingHistoFileSysPlus'] = S10rwPlusHisto
qcd['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#
qcd1 = copy.deepcopy(mc)
qcd1["bins"] = ["8TeV-QCD-Pt20to30-MuEnrichedPt5", "8TeV-QCD-Pt30to50-MuEnrichedPt5",\
"8TeV-QCD-Pt50to80-MuEnrichedPt5", "8TeV-QCD-Pt80to120-MuEnrichedPt5",\
"8TeV-QCD-Pt120to170-MuEnrichedPt5", "8TeV-QCD-Pt170to300-MuEnrichedPt5",\
"8TeV-QCD-Pt300to470-MuEnrichedPt5", "8TeV-QCD-Pt470to600-MuEnrichedPt5"]
qcd1["name"] = "QCD20to600"
qcd1['reweightingHistoFile'] = S10rwHisto
qcd1['reweightingHistoFileSysPlus'] = S10rwPlusHisto
qcd1['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#
qcd1a = copy.deepcopy(mc)
qcd1a["bins"] = ["8TeV-QCD-Pt20to30-MuEnrichedPt5", "8TeV-QCD-Pt30to50-MuEnrichedPt5",\
"8TeV-QCD-Pt50to80-MuEnrichedPt5", "8TeV-QCD-Pt80to120-MuEnrichedPt5",\
"8TeV-QCD-Pt120to170-MuEnrichedPt5", "8TeV-QCD-Pt170to300-MuEnrichedPt5"]
qcd1a["name"] = "QCD20to300"
qcd1a['reweightingHistoFile'] = S10rwHisto
qcd1a['reweightingHistoFileSysPlus'] = S10rwPlusHisto
qcd1a['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#
qcd1b = copy.deepcopy(mc)
qcd1b["bins"] = ["8TeV-QCD-Pt300to470-MuEnrichedPt5", "8TeV-QCD-Pt470to600-MuEnrichedPt5"]
qcd1b["name"] = "QCD300to600"
qcd1b['reweightingHistoFile'] = S10rwHisto
qcd1b['reweightingHistoFileSysPlus'] = S10rwPlusHisto
qcd1b['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#
qcd2 = copy.deepcopy(mc)
qcd2["bins"] = ["8TeV-QCD-Pt600to800-MuEnrichedPt5", "8TeV-QCD-Pt800to1000-MuEnrichedPt5"]
qcd2["name"] = "QCD600to1000"
qcd2['reweightingHistoFile'] = S10rwHisto
qcd2['reweightingHistoFileSysPlus'] = S10rwPlusHisto
qcd2['reweightingHistoFileSysMinus'] = S10rwMinusHisto
#
qcd3 = copy.deepcopy(mc)
qcd3["bins"] = ["8TeV-QCD-Pt1000-MuEnrichedPt5"]
qcd3["name"] = "QCD1000"
qcd3['reweightingHistoFile'] = S10rwHisto
qcd3['reweightingHistoFileSysPlus'] = S10rwPlusHisto
qcd3['reweightingHistoFileSysMinus'] = S10rwMinusHisto
####
ww = copy.deepcopy(mc)
ww["bins"] = ["8TeV-WW"]
ww["name"] = "WW"
ww['reweightingHistoFile'] = S10rwHisto
ww['reweightingHistoFileSysPlus'] = S10rwPlusHisto
ww['reweightingHistoFileSysMinus'] = S10rwMinusHisto
wz = copy.deepcopy(mc)
wz["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614/"
wz['newMETCollection'] = True
wz["bins"] = ["8TeV-WZ"]
wz["name"] = "WZ"
wz['reweightingHistoFile'] = S10rwHisto
wz['reweightingHistoFileSysPlus'] = S10rwPlusHisto
wz['reweightingHistoFileSysMinus'] = S10rwMinusHisto
zz = copy.deepcopy(mc)
zz["bins"] = ["8TeV-ZZ"]
zz['newMETCollection'] = True
zz["dirname"] = "/dpm/oeaw.ac.at/home/cms/store/user/schoef/pat_240614/"
zz["name"] = "ZZ"
zz['reweightingHistoFile'] = S10rwHisto
zz['reweightingHistoFileSysPlus'] = S10rwPlusHisto
zz['reweightingHistoFileSysMinus'] = S10rwMinusHisto
ttw = copy.deepcopy(mc)
ttw["bins"] = ["8TeV-TTWJets"]
ttw["name"] = "TTWJets"
ttw['reweightingHistoFile'] = S10rwHisto
ttw['reweightingHistoFileSysPlus'] = S10rwPlusHisto
ttw['reweightingHistoFileSysMinus'] = S10rwMinusHisto
stop200lsp170g100FastSim = copy.deepcopy(mc)
stop200lsp170g100FastSim["dirname"] = "/data/schoef/monoJetSignals/SUSYTupelizer/FastSim"
stop200lsp170g100FastSim["bins"] = ["8TeV-stop200lsp170g100"]
stop200lsp170g100FastSim["name"] = "stop200lsp170g100FastSim"
stop300lsp240g150FastSim = copy.deepcopy(mc)
stop300lsp240g150FastSim["dirname"] = "/data/schoef/monoJetSignals/SUSYTupelizer/FastSim"
stop300lsp240g150FastSim["bins"] = ["8TeV-stop300lsp240g150"]
stop300lsp240g150FastSim["name"] = "stop300lsp240g150FastSim"
stop300lsp270g175FastSim = copy.deepcopy(mc)
stop300lsp270g175FastSim["dirname"] = "/data/schoef/monoJetSignals/SUSYTupelizer/FastSim"
stop300lsp270g175FastSim["bins"] = ["8TeV-stop300lsp270g175"]
stop300lsp270g175FastSim["name"] = "stop300lsp270g175FastSim"
stop300lsp270FastSim = copy.deepcopy(mc)
stop300lsp270FastSim["dirname"] = "/data/schoef/monoJetSignals/SUSYTupelizer/FastSim"
stop300lsp270FastSim["bins"] = ["8TeV-stop300lsp270"]
stop300lsp270FastSim["name"] = "stop300lsp270FastSim"
stop300lsp270g200FastSim = copy.deepcopy(mc)
stop300lsp270g200FastSim["dirname"] = "/data/schoef/monoJetSignals/SUSYTupelizer/FastSim"
stop300lsp270g200FastSim["bins"] = ["8TeV-stop300lsp270g200"]
stop300lsp270g200FastSim["name"] = "stop300lsp270g200FastSim"
stop200lsp170g100FullSim = copy.deepcopy(mc)
stop200lsp170g100FullSim["dirname"] = "/data/schoef/monoJetSignals/SUSYTupelizer/FullSim"
stop200lsp170g100FullSim["bins"] = ["8TeV-stop200lsp170g100"]
stop200lsp170g100FullSim["name"] = "stop200lsp170g100FullSim"
stop300lsp240g150FullSim = copy.deepcopy(mc)
stop300lsp240g150FullSim["dirname"] = "/data/schoef/monoJetSignals/SUSYTupelizer/FullSim"
stop300lsp240g150FullSim["bins"] = ["8TeV-stop300lsp240g150"]
stop300lsp240g150FullSim["name"] = "stop300lsp240g150FullSim"
stop300lsp270g175FullSim = copy.deepcopy(mc)
stop300lsp270g175FullSim["dirname"] = "/data/schoef/monoJetSignals/SUSYTupelizer/FullSim"
stop300lsp270g175FullSim["bins"] = ["8TeV-stop300lsp270g175"]
stop300lsp270g175FullSim["name"] = "stop300lsp270g175FullSim"
stop300lsp270FullSim = copy.deepcopy(mc)
stop300lsp270FullSim["dirname"] = "/data/schoef/monoJetSignals/SUSYTupelizer/FullSim"
stop300lsp270FullSim["bins"] = ["8TeV-stop300lsp270"]
stop300lsp270FullSim["name"] = "stop300lsp270FullSim"
stop300lsp270g200FullSim = copy.deepcopy(mc)
stop300lsp270g200FullSim["dirname"] = "/data/schoef/monoJetSignals/SUSYTupelizer/FullSim"
stop300lsp270g200FullSim["bins"] = ["8TeV-stop300lsp270g200"]
stop300lsp270g200FullSim["name"] = "stop300lsp270g200FullSim"
for s in [stop200lsp170g100FastSim, stop300lsp240g150FastSim, stop300lsp270g175FastSim, stop300lsp270FastSim, stop300lsp270g200FastSim, stop200lsp170g100FullSim, stop300lsp240g150FullSim, stop300lsp270g175FullSim, stop300lsp270FullSim, stop300lsp270g200FullSim]:
s['reweightingHistoFile'] = S10rwHisto
s['reweightingHistoFileSysPlus'] = S10rwPlusHisto
s['reweightingHistoFileSysMinus'] = S10rwMinusHisto
| [
"robert.schoefbeck@cern.ch"
] | robert.schoefbeck@cern.ch |
1485f5c74c536b2b92e1bb01b55283d6afe8f884 | d243d2313dbcafaed3ce119610dcac846a76c119 | /进程、线程、协程/多线程/线程隔离对象Local.py | c50d4fae732d7e3d74c9fd246a8d0a9a5bdd7628 | [] | no_license | H-tao/Python | 8c9751a8678b755b88ecb3a1610ef842aaf13ec2 | 80276ce15272369a4577b4067766d784969dc02d | refs/heads/master | 2023-04-19T18:31:04.828689 | 2021-05-12T08:58:29 | 2021-05-12T08:58:29 | 283,165,278 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 61 | py | from werkzeug.local import Local
from threading import local
| [
"noreply@github.com"
] | H-tao.noreply@github.com |
09efa3e2cc46a870ee131e9c706297c18b8b44e4 | 2db5bf5832ddb99e93bb949ace1fad1fde847319 | /beginLearn/googleclass/class4/pdtest.py | 3b933a6cef80f4c7bb2ba24fc99b874212470863 | [] | no_license | RoderickAdriance/PythonDemo | 2d92b9aa66fcd77b6f797e865df77fbc8c2bcd14 | 98b124fecd3a972d7bc46661c6a7de8787b8e761 | refs/heads/master | 2020-04-06T17:36:46.000133 | 2018-11-15T07:07:03 | 2018-11-15T07:07:03 | 157,666,809 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 711 | py | import pandas as pd
import numpy as np
city_names=pd.Series(['San Francisco', 'San Jose', 'Sacramento'])
population = pd.Series([852469, 1015785, 485199])
cities = pd.DataFrame({'City name': city_names, 'Population': population})
california_housing_dataframe=pd.read_csv('data.csv')
california_housing_dataframe.hist('housing_median_age')
# population=population/1000
#log 实际上不是以10为底,而是以 e 为底
log_population = np.log(population)
apply = population.apply(lambda val: val > 500000)
cities['Area square miles']=pd.Series([46.87, 176.53, 97.92])
cities['Population density']=cities['Population']/cities['Area square miles']
reindex = cities.reindex([0, 5, 2, 8])
print(reindex)
| [
"1371553306@qq.com"
] | 1371553306@qq.com |
060f6f2f5d9c68e50ff34698805854ed563dfdc5 | a74ebe21cc1bbc50fc58ea619ba3348a4160e19d | /setup.py | 707011151a232fd112400ba2f2917e33f0088110 | [
"MIT"
] | permissive | sharebears/pulsar-messages | 61e47a373fcd6ea6d9d51a1ea21cb6020603fa9d | 723faa7be560f97f9a349e23b395239ccc10161f | refs/heads/master | 2020-07-06T00:15:03.036290 | 2019-08-17T03:53:44 | 2019-08-17T03:53:44 | 202,827,329 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,063 | py | #!/usr/bin/env python3
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
setup(
name='pulsar-messages',
version='0.0.1',
description='Messages plugin for the pulsar project',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
license='MIT',
author='sharebears',
author_email='sharebears@tutanota.de',
url='https://github.com/sharebears',
packages=['messages'],
python_requires='>=3.7, <3.8',
tests_require=['pytest', 'mock'],
cmdclass={'test': PyTest},
)
| [
"lights@tutanota.de"
] | lights@tutanota.de |
8c6f22eb0df54d68816c89fd47124609cdda6a8b | e3365bc8fa7da2753c248c2b8a5c5e16aef84d9f | /indices/rhinocero.py | 73c56188877d4091cd9bac140d2c91b768e60ab7 | [] | no_license | psdh/WhatsintheVector | e8aabacc054a88b4cb25303548980af9a10c12a8 | a24168d068d9c69dc7a0fd13f606c080ae82e2a6 | refs/heads/master | 2021-01-25T10:34:22.651619 | 2015-09-23T11:54:06 | 2015-09-23T11:54:06 | 42,749,205 | 2 | 3 | null | 2015-09-23T11:54:07 | 2015-09-18T22:06:38 | Python | UTF-8 | Python | false | false | 397 | py | ii = [('LyelCPG2.py', 3), ('RogePAV2.py', 6), ('RogePAV.py', 4), ('RennJIT.py', 3), ('ProuWCM.py', 2), ('PettTHE.py', 1), ('ClarGE2.py', 1), ('CoolWHM.py', 5), ('BuckWGM.py', 22), ('LyelCPG.py', 9), ('WestJIT2.py', 4), ('CrocDNL.py', 1), ('KirbWPW2.py', 11), ('BuckWGM2.py', 3), ('FitzRNS4.py', 10), ('CoolWHM3.py', 1), ('FitzRNS.py', 1), ('FerrSDO.py', 1), ('BellCHM.py', 3), ('LyelCPG3.py', 11)] | [
"prabhjyotsingh95@gmail.com"
] | prabhjyotsingh95@gmail.com |
f3cbd2827b909b1a99c7b0e29d97be9be7d47f52 | 731a47d4d489bc8c052c03d1ff5d125ec2efe41f | /rosalind_scripts/rear_rosalind.py | 99fe90307ee73db09b4ccf1dce052af1bf67d9bf | [] | no_license | mRotten/rosalind_scripts | 76d800773a026fd10ad3e55fed874d873252ceaa | ecb4a5dde72c5a3f8f1761f9d6cf395717a4e542 | refs/heads/master | 2023-06-27T06:36:15.853240 | 2021-07-25T20:01:47 | 2021-07-25T20:01:47 | 389,404,913 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,601 | py | import argparse
import time
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input_path')
args = parser.parse_args()
seq_pairs = __get_input(args.input_path)
result = list()
for i, sp in enumerate(seq_pairs):
print(f'Starting pair {i}...')
rpl = __get_relative_position_list(sp[0], sp[1])
result.append(get_reversal_distance(rpl))
print(" ".join([str(x) for x in result]))
def test():
begin = time.perf_counter()
seq_pairs = __get_input("../rosalind_test_files/rear_example.txt")
seq_pairs.extend(__get_input("/Users/mlalonde/Downloads/rosalind_rear.txt"))
seq_pairs.extend(__get_input("/Users/mlalonde/Downloads/rosalind_rear_1.txt"))
result = list()
for sp in seq_pairs:
rpl = __get_relative_position_list(sp[0], sp[1])
result.append(get_reversal_distance(rpl))
print(" ".join([str(x) for x in result[:5]]))
print(" ".join([str(x) for x in result[5:10]]))
print(" ".join([str(x) for x in result[10:]]))
print(f'{len(seq_pairs)} reversal distances calculated in {round(time.perf_counter() - begin, 1)} seconds.')
def get_reversal_distance(relative_position_list):
rpl = relative_position_list
best_revs = [(__get_breaks(rpl), rpl), ]
rev_count, new_revs = 0, list()
bp_cutoff = 11
while not any([len(x[0]) == 0 for x in best_revs]):
for rev in best_revs:
new_revs.extend(get_single_reversals(rev[0], rev[1], bp_cutoff))
rev_count += 1
best_revs += new_revs
new_revs = list()
min_bps = min([len(x[0]) for x in best_revs]) + 1
print(f'Filtering breakpoints >{min_bps}')
filt_revs = list(filter(lambda x: len(x[0]) <= min_bps, best_revs))
best_revs = list()
for br in filt_revs:
if br not in best_revs:
best_revs.append(br)
bp_cutoff = min_bps - 1
print(f'...now storing {len(best_revs)} reversals.')
return rev_count
def get_single_reversals(break_list, rel_pos_list, bp_cutoff):
reversals, rpl = list(), rel_pos_list
for i, bp1 in enumerate(break_list):
for bp2 in break_list[i+1:]:
rev_subseq = rpl[bp1:bp2]
rev_subseq.reverse()
seq = rpl[:bp1] + rev_subseq + rpl[bp2:]
bpl = __get_breaks(seq)
if len(bpl) <= bp_cutoff:
reversals.append((bpl, seq))
return reversals
# ================ UTILITIES ======================================
def __get_relative_position_list(list1: list, list2: list) -> list:
"""
Returns the order of list1 relative to list2.
:param list1: A rearrangement of list2.
:param list2: A rearrangement of list1.
:return: The position of each element of list1 in list2.
"""
return [list2.index(x) for x in list1]
def __get_breaks(pos_list):
bps = list()
if pos_list[0] != 0:
bps.append(0)
if pos_list[-1] != max(pos_list):
bps.append(len(pos_list))
for i, p in enumerate(zip(pos_list[:-1], pos_list[1:]), 1): # i is the index of the list element after p
diff = p[1] - p[0]
if abs(diff) != 1: # if still increasing or decreasing by 1
bps.append(i)
bps.sort()
return bps
def __get_input(path):
seq_pairs = list()
with open(path, 'r') as infile:
raw = infile.read().strip().split("\n\n")
for txt in raw:
seq_pairs.append(tuple([[int(xi) for xi in x.split(" ")] for x in txt.split("\n")]))
return seq_pairs
if __name__ == '__main__':
main()
| [
"lalondematthew@hotmail.com"
] | lalondematthew@hotmail.com |
c9c9bb8d059a003ddb370ae07f11e838d25e6baa | 64e6bec993e89c884332d479b5fddf91cda44a8f | /.c9/metadata/environment/guitar_shed/guitar_shed/urls.py | f17f225e75d9b78470e2acd2d75a4dd0da70ef0f | [] | no_license | richdevelopments/guitar-shed | d8379eb75a06d2d9f14de49d870588821e9385f9 | c730a4c47b218b80214ce7e4cc27cb3f039ec9ad | refs/heads/master | 2022-12-01T11:58:09.514294 | 2019-11-11T22:18:39 | 2019-11-11T22:18:39 | 202,613,070 | 1 | 1 | null | 2022-11-22T02:40:09 | 2019-08-15T21:21:15 | Python | UTF-8 | Python | false | false | 1,062 | py | {"filter":false,"title":"urls.py","tooltip":"/guitar_shed/guitar_shed/urls.py","undoManager":{"mark":3,"position":3,"stack":[[{"start":{"row":20,"column":38},"end":{"row":21,"column":0},"action":"insert","lines":["",""],"id":2}],[{"start":{"row":21,"column":0},"end":{"row":21,"column":42},"action":"insert","lines":["from checkout import urls as urls_checkout"],"id":3}],[{"start":{"row":31,"column":39},"end":{"row":32,"column":0},"action":"insert","lines":["",""],"id":4},{"start":{"row":32,"column":0},"end":{"row":32,"column":4},"action":"insert","lines":[" "]}],[{"start":{"row":32,"column":4},"end":{"row":32,"column":47},"action":"insert","lines":["url(r'^checkout/', include(urls_checkout)),"],"id":5}]]},"ace":{"folds":[],"scrolltop":333.5,"scrollleft":0,"selection":{"start":{"row":32,"column":47},"end":{"row":32,"column":47},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":37,"mode":"ace/mode/python"}},"timestamp":1566203048667,"hash":"4a5753e0468dd747dd54ed60afce9cce7d42f4ee"} | [
"ubuntu@ip-172-31-39-232.ec2.internal"
] | ubuntu@ip-172-31-39-232.ec2.internal |
0a06a2b02ea2ebe7e1e750ff6fcf6079526a4e8e | 53dd5d2cfb79edc87f6c606bbfb7d0bedcf6da61 | /.history/EMR/zhzd_add_20190618132817.py | d0748388e5fbee29a405014068576007a52ae777 | [] | no_license | cyc19950621/python | 4add54894dc81187211aa8d45e5115903b69a182 | d184b83e73334a37d413306d3694e14a19580cb0 | refs/heads/master | 2020-04-11T20:39:34.641303 | 2019-07-02T12:54:49 | 2019-07-02T12:54:49 | 162,078,640 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 766 | py | import time
import math
import os
import sys
import os, os.path,shutil
import codecs
import EMRdef
import re
import pandas as pd
emrtxts = EMRdef.txttq(u'D:\DeepLearning ER\EHRzhzd5')#txt目录提取
emrtxt2s = EMRdef.txttq(u'D:\DeepLearning ER\EHRsex')
ryzd = []
for emrtxt in emrtxts:
f = open(emrtxt,'r',errors="ignore")#中文加入errors
emrpath = os.path.basename(emrtxt)
emrpath = os.path.splitext(emrpath)[0]#提取目录
lines=f.readlines()
for emrtxt2 in emrtxt2s:
f2 = open(emrtxt2,'r',errors="ignore")#中文加入errors
emrpath2 = os.path.basename(emrtxt2)
emrpath2 = os.path.splitext(emrpat2)[0]#提取目录
lines2 = f2.readlines()
if emrpath == emrpath2:
lines.append(lines2) | [
"1044801968@qq.com"
] | 1044801968@qq.com |
e0f360d9759ebff847437f85252bd34c60c36381 | 9c31ebe65e81c67c572bf8b95990d99e61834c63 | /Python_tutorial/Multiprocessing/process-images.py | 1edbd5a8a8741845a8b0428dc566ca9ac27597a2 | [] | no_license | kissbill/Corey_tutorials | 0ebb79bb4242902874f1d0b3daeeb2734b170a7b | b3bd110bba415f2ded989f08bf9250d1c1f2d711 | refs/heads/master | 2022-12-08T14:51:47.602361 | 2020-08-23T14:06:57 | 2020-08-23T14:06:57 | 260,650,811 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,210 | py |
import time
import concurrent.futures
from PIL import Image, ImageFilter
img_names = [
'photo-1516117172878-fd2c41f4a759.jpg',
'photo-1532009324734-20a7a5813719.jpg',
'photo-1524429656589-6633a470097c.jpg',
'photo-1530224264768-7ff8c1789d79.jpg',
'photo-1564135624576-c5c88640f235.jpg',
'photo-1541698444083-023c97d3f4b6.jpg',
'photo-1522364723953-452d3431c267.jpg',
'photo-1513938709626-033611b8cc03.jpg',
'photo-1507143550189-fed454f93097.jpg',
'photo-1493976040374-85c8e12f0c0e.jpg',
'photo-1504198453319-5ce911bafcde.jpg',
'photo-1530122037265-a5f1f91d3b99.jpg',
'photo-1516972810927-80185027ca84.jpg',
'photo-1550439062-609e1531270e.jpg',
'photo-1549692520-acc6669e2f0c.jpg'
]
t1 = time.perf_counter()
size = (1200, 1200)
def process_image(img_name):
img = Image.open(img_name)
img = img.filter(ImageFilter.GaussianBlur(15))
img.thumbnail(size)
img.save(f'processed/{img_name}')
print(f'{img_name} was processed...')
if __name__ == "__main__":
with concurrent.futures.ProcessPoolExecutor() as executor:
executor.map(process_image, img_names)
t2 = time.perf_counter()
print(f'Finished in {t2-t1} seconds')
| [
"milerik@hotmail.com"
] | milerik@hotmail.com |
01e69620a852049ef9660d3dcad0b98553eff7e6 | 83330fd1c3ca40757494ca44f590a9a91ba5cb8e | /scripts/slope_vs_bunches.py | 5532dd4884905b430eb61249b1c380434addd548 | [] | no_license | alexandertuna/MuonRawAnalysis | 4878d4729cbc0ccbe046326611e8a1f76272e003 | 11426e28191fed1ff35e8119b720355bdbb0179b | refs/heads/master | 2021-01-10T14:27:27.257909 | 2016-10-18T11:42:40 | 2016-10-18T11:42:40 | 45,977,223 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 6,370 | py | import argparse
import array
import sys
import ROOT
ROOT.gROOT.SetBatch(True)
ROOT.gStyle.SetPadTickX(1)
ROOT.gStyle.SetPadTickY(1)
ROOT.gStyle.SetPadTopMargin(0.06)
ROOT.gStyle.SetPadBottomMargin(0.12)
ROOT.gStyle.SetPadLeftMargin(0.18)
ROOT.gStyle.SetPadRightMargin(0.06)
def options():
parser = argparse.ArgumentParser()
parser.add_argument("--hits", help="Type of hits to use: raw or adc", default=None)
return parser.parse_args()
ops = options()
if ops.hits not in ["raw", "adc"]:
sys.exit("Error: please give --hits to be raw or adc")
logy = True
bunches_run3 = 2808
bunches_hllhc = 3564
lumi_run3 = 10
lumi_hllhc = 70
bunches = {}
slope = {}
graph = {}
fit = {}
regions = ["CSS1", "CSL1",
"EIS1", "EIL1",
"EMS1", "EML1",
]
for region in regions:
bunches[region] = []
slope[ region] = []
for line in open("slope_vs_bunches_%s.txt" % ops.hits).readlines():
line = line.strip()
if not line: continue
if line.startswith("#"): continue
_name, _run, _bunches, _slope, _offset = line.split()
for region in slope:
if region in _name:
slope[ region].append(float(_slope))
bunches[region].append(float(_bunches))
break
else:
sys.exit("Cant find relevant region for line:\n %s" % line)
expression = "[0] + [1]/x"
for region in regions:
fit[region] = ROOT.TF1("fit_"+region, expression, 0, 3800)
graph[region] = ROOT.TGraph(len(bunches[region]), array.array("d", bunches[region]), array.array("d", slope[region]))
graph[region].Fit(fit[region], "RWQN")
def color(region):
if region == "CSS1": return ROOT.kBlue
if region == "CSL1": return ROOT.kBlack
if region == "EIS1": return ROOT.kRed
if region == "EIL1": return 210
if region == "EMS1": return ROOT.kViolet
if region == "EML1": return ROOT.kOrange-3
def style(gr, region):
gr.SetMarkerColor(color(region))
gr.SetMarkerStyle(20)
gr.SetMarkerSize(1.0)
multi = ROOT.TMultiGraph()
multi.SetTitle(";%s;%s" % ("colliding bunches", "fitted slope [ Hz / cm^{2} / e^{33} cm^{-2} s^{-1} ]"))
for region in graph:
style(graph[region], region)
multi.Add(graph[region], "PZ")
name = "slope_vs_bunches_%s" % (ops.hits)
canvas = ROOT.TCanvas(name, name, 800, 800)
canvas.Draw()
multi.SetMinimum(0.00 if not logy else 3.5)
multi.SetMaximum(300 if not logy else 500)
multi.Draw("Asame")
multi.GetXaxis().SetLimits(0, 3800)
multi.GetXaxis().SetNdivisions(505)
multi.GetXaxis().SetTitleSize(0.05)
multi.GetYaxis().SetTitleSize(0.05)
multi.GetXaxis().SetLabelSize(0.05)
multi.GetYaxis().SetLabelSize(0.05)
multi.GetXaxis().SetTitleOffset(1.2)
multi.GetYaxis().SetTitleOffset(1.6)
multi.Draw("Asame")
line_run3 = ROOT.TLine(bunches_run3, 0, bunches_run3, 150)
line_hllhc = ROOT.TLine(bunches_hllhc, 0, bunches_hllhc, 150)
for line in [line_run3, line_hllhc]:
line.SetLineColor(ROOT.kBlack)
line.SetLineWidth(1)
line.SetLineStyle(1)
line.Draw()
print
print " %7s %7s +/- %7s | %10s +/- %10s | %10s %10s | %10s %10s" % ("region", "[0]", " ", "[1]", " ",
"slope@2808", "slope@3564",
"Hz@2808", "Hz@3564",
)
for region in sorted(regions):
fit[region].SetLineColor(color(region))
fit[region].SetLineWidth(2)
fit[region].SetLineStyle(7)
fit[region].Draw("same")
slope_run3 = fit[region].GetParameter(0) + fit[region].GetParameter(1)/bunches_run3
slope_hllhc = fit[region].GetParameter(0) + fit[region].GetParameter(1)/bunches_hllhc
slope_run3_up = fit[region].GetParameter(0) + fit[region].GetParError(0) + (fit[region].GetParameter(1) + fit[region].GetParError(1))/bunches_run3
slope_hllhc_up = fit[region].GetParameter(0) + fit[region].GetParError(0) + (fit[region].GetParameter(1) + fit[region].GetParError(1))/bunches_hllhc
print " %7s %7.3f +/- %7.3f | %10.2f +/- %10.2f | %10.3f %10.3f | %10.2f %10.2f" % (region,
fit[region].GetParameter(0),
fit[region].GetParError(0),
fit[region].GetParameter(1),
fit[region].GetParError(1),
slope_run3,
slope_hllhc,
lumi_run3 * slope_run3, # / 1000,
lumi_hllhc * slope_hllhc, # / 1000,
)
print
xcoord, ycoord = 0.77, 0.81 if not logy else 0.85
atlas = ROOT.TLatex(xcoord, ycoord, "ATLAS Internal")
data = ROOT.TLatex(xcoord, ycoord-0.06, "Data, 13 TeV")
logos = [atlas, data]
for logo in logos:
logo.SetTextSize(0.040)
logo.SetTextFont(42)
logo.SetTextAlign(22)
logo.SetNDC()
logo.Draw()
legend = {}
xcoord = 0.45 if not logy else 0.49
ycoord = 0.80
xdelta, ydelta = 0.05, 0.05
legend["CSL1"] = ROOT.TLatex(xcoord, ycoord-0*ydelta, "CSC L")
legend["CSS1"] = ROOT.TLatex(xcoord, ycoord-1*ydelta, "CSC S")
legend["EIL1"] = ROOT.TLatex(xcoord, ycoord-(2 if not logy else 4.8)*ydelta, "MDT EIL1")
legend["EIS1"] = ROOT.TLatex(xcoord, ycoord-(3 if not logy else 5.8)*ydelta, "MDT EIS1")
legend["EML1"] = ROOT.TLatex(xcoord, ycoord-(4 if not logy else 10.1)*ydelta, "MDT EML1")
legend["EMS1"] = ROOT.TLatex(xcoord, ycoord-(5 if not logy else 9.1)*ydelta, "MDT EMS1")
for reg in regions:
legend[reg].SetTextColor(color(reg))
legend[reg].SetTextSize(0.038)
legend[reg].SetTextFont(42)
legend[reg].SetNDC()
legend[reg].Draw()
if logy:
ROOT.gPad.SetLogy()
canvas.SaveAs("output/%s_%s.%s" % (canvas.GetName(), "log" if logy else "lin", "pdf"))
| [
"alexander.tuna@gmail.com"
] | alexander.tuna@gmail.com |
0bba2f23d7e8f8a26a516f6f9179ce1e7e8e8fb1 | c2b62ff80572d2bd91a02013171910374af02707 | /sendText.py | 8e8c8adee60ab456e3101d5905cf0ffc625644d1 | [] | no_license | hotpepper/pyFoundationCoruseWork | 0328c8ec5f9e7103dc32b3bf1dae99a65b8c0ffb | aa9d54ff3c904f1c975abf790154d2c8b39364ec | refs/heads/master | 2021-01-21T17:45:46.901297 | 2014-09-02T14:51:27 | 2014-09-02T14:51:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 480 | py | from twilio import rest
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "AC60bd7b39268433022559ebe2a30edb6e"
auth_token = "53e210bd6d8361e0d3c629767362587f"
client = rest.TwilioRestClient(account_sid, auth_token)
message = client.messages.create(
body="Seth's first code generated TXT",
to="+19172021095", # Replace with your phone number
from_="+12014845286") # Replace with your Twilio number
print message.sid
#(201) 484-5286
| [
"heyseth@hotmail.com"
] | heyseth@hotmail.com |
8ad137287df44bbff4ee4ba45d2dac576f3fd04b | 061d476d23bcd9f6bf68acdde971c0477be476c5 | /app.py | 1c7cb3accadfb8d6abdd03e3025b13bbf7e566d0 | [
"OGL-UK-3.0"
] | permissive | antarctica/flask-request-id-header | e86e06a71b61648514858d7211e444a37b38215c | 01131ef2f116b6db13b72cd08b2c0aca1d997203 | refs/heads/master | 2023-01-08T22:20:25.351175 | 2019-03-04T16:50:29 | 2019-03-04T16:50:29 | 173,466,292 | 8 | 3 | NOASSERTION | 2022-12-27T15:35:54 | 2019-03-02T15:43:04 | Python | UTF-8 | Python | false | false | 389 | py | from http import HTTPStatus
from flask import Flask
from flask_request_id_header.middleware import RequestID
def create_app_with_middleware():
app = Flask(__name__)
# Configure and load Middleware
app.config['REQUEST_ID_UNIQUE_VALUE_PREFIX'] = 'TEST-'
RequestID(app)
@app.route("/sample")
def sample():
return '', HTTPStatus.NO_CONTENT
return app
| [
"felix@felixfennell.co.uk"
] | felix@felixfennell.co.uk |
5ea79c1daa9825dbd9a6bd0aa2da84e9baf9c673 | ab95f02a096723df64eeee6636cb567187cc974c | /venv/Lib/site-packages/pylint/test/functional/invalid_slice_index.py | f2bc1d7cd719a9509511df35c8d6d12f0d669f34 | [
"MIT"
] | permissive | mcappleman/rotogrinders-projections | 62485bbe43f3e2cc974b54a2cddd16babf4ed343 | dd51c2d954c46b3ebb452bcd7546c03bf034b0b6 | refs/heads/master | 2020-03-28T16:20:22.837326 | 2018-10-05T15:03:26 | 2018-10-05T15:03:26 | 148,684,049 | 2 | 2 | MIT | 2018-09-13T19:56:32 | 2018-09-13T18:58:44 | Python | UTF-8 | Python | false | false | 2,002 | py | """Errors for invalid slice indices"""
# pylint: disable=too-few-public-methods, no-self-use,missing-docstring,expression-not-assigned, useless-object-inheritance
TESTLIST = [1, 2, 3]
# Invalid indices
def function1():
"""functions used as indices"""
return TESTLIST[id:id:] # [invalid-slice-index,invalid-slice-index]
def function2():
"""strings used as indices"""
return TESTLIST['0':'1':] # [invalid-slice-index,invalid-slice-index]
def function3():
"""class without __index__ used as index"""
class NoIndexTest(object):
"""Class with no __index__ method"""
pass
return TESTLIST[NoIndexTest()::] # [invalid-slice-index]
# Valid indices
def function4():
"""integers used as indices"""
return TESTLIST[0:0:0] # no error
def function5():
"""None used as indices"""
return TESTLIST[None:None:None] # no error
def function6():
"""class with __index__ used as index"""
class IndexTest(object):
"""Class with __index__ method"""
def __index__(self):
"""Allow objects of this class to be used as slice indices"""
return 0
return TESTLIST[IndexTest():None:None] # no error
def function7():
"""class with __index__ in superclass used as index"""
class IndexType(object):
"""Class with __index__ method"""
def __index__(self):
"""Allow objects of this class to be used as slice indices"""
return 0
class IndexSubType(IndexType):
"""Class with __index__ in parent"""
pass
return TESTLIST[IndexSubType():None:None] # no error
def function8():
"""slice object used as index"""
return TESTLIST[slice(1, 2, 3)] # no error
def function9():
"""Use a custom class that knows how to handle string slices"""
class StringSlice:
def __getitem__(self, item):
return item
StringSlice()["a":"b":"c"]
StringSlice()["a":"b":"c", "a":"b"]
StringSlice()[slice("a", "b", "c")]
| [
"matt.cappleman@gmail.com"
] | matt.cappleman@gmail.com |
953d8bc38856a27f6a9df03d5819e05e01559c06 | 646b0a41238b96748c7d879dd1bf81858651eb66 | /src/mdt/orm/GulpOpt.py | 177f7a316baa5b0cda918805763bfe60e8fcfac3 | [] | no_license | danse-inelastic/molDynamics | ded0298f8219064e086472299e1383d3dff2dac3 | c8e0bfd9cb65bcfc238e7993b6e7550289d2b219 | refs/heads/master | 2021-01-01T19:42:29.904390 | 2015-05-03T17:27:38 | 2015-05-03T17:27:38 | 34,993,746 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,749 | py | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# J Brandon Keith, Jiao Lin
# California Institute of Technology
# (C) 2006-2011 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
from ..GulpOpt import GulpOpt
from Gulp import Gulp
class Inventory(Gulp.Inventory):
optimize_coordinates = Gulp.Inventory.d.bool(name = 'optimize_coordinates', default = True)
optimize_coordinates.label = 'Optimize coordinates?'
optimize_cell = Gulp.Inventory.d.bool(name = 'optimize_cell', default = False)
optimize_cell.label = 'Optimize the cell?'
constraint = Gulp.Inventory.d.str(name = 'constraint', default = 'constant volume')
constraint.label = 'Constraint'
constraint.validator = Gulp.Inventory.v.choice(['None', 'constant volume', 'constant pressure'])
# XXX: see Gulp.py
# trajectoryfile = Gulp.Inventory.d.str(name = 'trajectoryfile', default = 'gulp.his')
# trajectoryfile.label = 'Trajectory Filename'
# restartfile = Gulp.Inventory.d.str(name = 'restartfile', default = 'gulp.res')
# restartfile.label = 'Restart Filename'
GulpOpt.Inventory = Inventory
def customizeLubanObjectDrawer(self, drawer):
drawer.sequence = ['properties', 'forcefield']
drawer.mold.sequence = [
'optimize_coordinates',
'optimize_cell',
'constraint',
'temperature', 'pressure',
'identify_molecules',
'assign_bonds_from_initial_geometry',
'calc_dispersion_in_recip_space',
]
return
GulpOpt.customizeLubanObjectDrawer = customizeLubanObjectDrawer
| [
"linjiao@caltech.edu"
] | linjiao@caltech.edu |
be907003cd2e91f3dadaba00cc17706508463cb3 | 0967f58ec8c75b63f1ff0241f155816571b11076 | /PycharmProjects/projectEuler/p8.py | 30560511c53513a8e25d4447ea2e76f991d2a798 | [] | no_license | prudhvirajboddu/IDE_VScode_projects | d1c80b78fb1aa9740a7f3935ea646770c1cfc347 | 183c213a190b8c52f1db6e727fea47603a9216de | refs/heads/master | 2022-04-15T18:32:06.342657 | 2020-04-11T09:25:15 | 2020-04-11T09:25:15 | 254,832,596 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,008 | py | num="7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450"
| [
"prudhvirajboddu@gmail.com"
] | prudhvirajboddu@gmail.com |
4b33c1024af7b1abc75d91256f45ce1f66a61096 | 2da4731b79fc3d45ea4b58fb22ff16b1f764bdf9 | /blog/migrations/0001_initial.py | 239259f48d9dc582b514f8cbbddfc5ad372402f8 | [] | no_license | ashmika-26/django3-personal-portfolio | a1c47e60829e163d295c9c1d120281914daaaa90 | 78c67b80e7f06c31e569ec37c8e6f52b97da2033 | refs/heads/master | 2022-11-09T10:14:24.129053 | 2020-06-27T03:21:31 | 2020-06-27T03:21:31 | 272,818,456 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 576 | py | # Generated by Django 3.0.7 on 2020-06-14 22:04
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Blog',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=200)),
('des', models.TextField()),
('date', models.DateField()),
],
),
]
| [
"ashmika.b26@gmail.com"
] | ashmika.b26@gmail.com |
e7b090e0ec000dd32b8931875c1690ddb8321725 | bf55f0047e462da6b61271df05796805efd691b2 | /2. Add Two Numbers.py | 8b26677ce7a6ff637f1c3162aa1081b5ff8d1c24 | [] | no_license | xuwang278/leetcode-python | e4230e41533beb048acd82ae2fb9b0d973fec243 | d9782e8861e88cad27d34ce4cb7884fe690208fb | refs/heads/master | 2020-12-11T01:30:21.059370 | 2020-03-18T23:09:18 | 2020-03-18T23:09:18 | 233,766,002 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 702 | py | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode:
leading = 0
dummy = cur = ListNode(0)
while l1 or l2:
a = l1.val if l1 else 0
b = l2.val if l2 else 0
sum = (a + b + leading) % 10
leading = (a + b + leading) // 10
cur.next = ListNode(sum)
cur = cur.next
if l1: l1 = l1.next
if l2: l2 = l2.next
if carry != 0:
cur.next = ListNode(carry)
return dummy.next | [
"noreply@github.com"
] | xuwang278.noreply@github.com |
aa3aeffa957b719ab62bb90a685325b0a5425ceb | 023f7adf81be5aa89fcef5064091320354329d96 | /ex10.py | 391c5d274db8a87b6ef0b2745abd8ddef6c66622 | [] | no_license | andrewmbales/Beginnings | d545eb7fda236fd79b037a56a2f5be3966760fef | 33411fa6fe931cbb654aac82d81c5ebc260319c4 | refs/heads/master | 2021-01-19T11:54:40.732237 | 2017-04-12T04:08:42 | 2017-04-12T04:08:42 | 88,008,671 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 256 | py | tabby_cat = "\tI'm tabbed in."
persian_cat = "I'm split\non a line."
backslash_cat = "I'm \\ a \\ cat."
fat_cat = """
I'll do a list:
\t* Cat food
\t* Fishies
\t* Catnip\n \t* Grass
"""
print tabby_cat
print persian_cat
print backslash_cat
print fat_cat
| [
"andrewmbales@gmail.com"
] | andrewmbales@gmail.com |
a12d1b1730da6dd35de1d0d79e7fca73682bbff0 | 6cd3060abd6c7467715f73f276d2f4d5f9f5175c | /backend/apps/api/offers/v1/views.py | 7bc226eb523d9c78f5660a44aa247d84b2f363e4 | [] | no_license | Digitize-me/gpb-corporate-application | 3e2ef645d34802621badc630ab445d15428aeb5e | d59d146e131b49a670e3ac4752ea91aa7e148e51 | refs/heads/master | 2022-11-07T16:39:39.876126 | 2020-06-20T22:53:22 | 2020-06-20T22:53:22 | 273,590,113 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,518 | py | from rest_framework import generics
from .serializers import (
OfferSerializer,
TagOfferSerializer,
CategoryOfferSerializer,
)
from ..models import Offer, TagOffer, CategoryOffer
class OfferListCreate(generics.ListCreateAPIView):
"""
Предложения
"""
queryset = Offer.objects.all()
serializer_class = OfferSerializer
def perform_create(self, serializer):
return serializer.save()
# class OfferRetrieveUpdateAPIView(generics.RetrieveUpdateAPIView):
# """
# Предложения
# """
# queryset = Offer.objects.all()
# serializer_class = OfferSerializer
class CategoryOfferListCreate(generics.ListCreateAPIView):
"""
Категории
"""
queryset = CategoryOffer.objects.all()
serializer_class = CategoryOfferSerializer
def perform_create(self, serializer):
return serializer.save()
class CategoryOfferRetrieveUpdate(generics.RetrieveUpdateAPIView):
"""
Категории
"""
queryset = CategoryOffer.objects.all()
serializer_class = CategoryOfferSerializer
class TagOfferListCreate(generics.ListCreateAPIView):
"""
Теги
"""
queryset = TagOffer.objects.all()
serializer_class = TagOfferSerializer
def perform_create(self, serializer):
return serializer.save()
class TagOfferRetrieveUpdate(generics.RetrieveUpdateAPIView):
"""
Теги
"""
queryset = TagOffer.objects.all()
serializer_class = TagOfferSerializer
| [
"wsxxx2016@yandex.ru"
] | wsxxx2016@yandex.ru |
9658641287de4f3a4b4c49ee83dd9335aa114fb1 | df7bdf5b45d53ba7b6fa63efc2383633da12976a | /static/sql_.py | 432b69c7dc997c809470b8c00af55e474d076d33 | [] | no_license | P79N6A/myauth | 0ed78bdef9599d9a755098cea14103a7da7604f9 | 65006007010ee8b0506d6f91a139d752420a6903 | refs/heads/master | 2020-04-26T04:01:05.214564 | 2019-03-01T10:56:29 | 2019-03-01T10:56:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 29,702 | py | # coding: utf-8
#!/usr/bin/env python
# coding: utf-8
#import pyodbc #sqlserver
import MySQLdb #mysql
import redis #redis
#import cx_Oracle
import os,copy,datetime,time,sys,re
import settings
#os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8'
#reload(sys)
#sys.setdefaultencoding('utf-8')
class sqlbase():
def getResult(self):
rows = [];
columns=[]
return rows,columns,{};
def sqlsplit(self,sqlstr,splitstr='go',defaultdatabase=''):
sqlstr=sqlstr.replace("\r","").decode('utf8')
sqlstr += "\n"+splitstr;
sqlstrlist=sqlstr.split('\n')
sqldbi=0
sqlbuilderlist=[[defaultdatabase,[]]]
regex_use = re.compile(r'^\s*use\s+\[*(\w+)\]*\s*;*$',re.I)
for sqlline in sqlstrlist:
sqllowerline=sqlline.lower()
m_use = regex_use.search(sqlline)
if m_use:
defaultdatabase=m_use.group(1)
sqlbuilderlist.append([defaultdatabase,[]])
sqldbi=sqldbi+1
elif sqllowerline==splitstr:
sqlbuilderlist.append([defaultdatabase,[]])
sqldbi=sqldbi+1
elif sqllowerline.find(splitstr)==len(sqllowerline)-1:
sqlbuilderlist[sqldbi][1].append(sqlline[0:-len(splitstr)])
sqlbuilderlist.append([defaultdatabase,[]])
sqldbi=sqldbi+1
else:
sqlbuilderlist[sqldbi][1].append(sqlline)
return sqlbuilderlist
class TableFormart_():
def TableFormart(self,rows,columns,formatstr):
for formatdict_tmp in formatstr.split('|'):
formatdict=formatdict_tmp.split(' ')
formartaction=formatdict[0]
if 'rowconvert' ==formartaction:
if len(formatdict)<3:
MaxN=9999
else:
MaxN=int(formatdict[2])
rows,columns=self.TableFormartRowConvert(rows,columns,int(formatdict[1]),MaxN)
elif 'rowgroup'==formartaction:
if len(formatdict)<3:
sumavg=""
else:
sumavg=formatdict[2]
rows=self.TableGroup(rows,int(formatdict[1]),sumavg)
elif 'rowdecreasing'==formartaction:
if len(formatdict)>=3 and formatdict[2]=='true':
isCheckGrowth=True
else:
isCheckGrowth=False
rows=self.TableFormartRowDecreasing(rows,int(formatdict[1]),isCheckGrowth)
return rows,columns
def TableGroup(self,rows,groupi,sumavg):
newrows=[]
if groupi==0:
rowcount=len(rows)
if rowcount>0:
newrow=rows[0];
columncount=len(newrow);
#print (rows)
#print(rowcount)
#print(columncount)
for i in range(1,rowcount):
for j in range(0,columncount):
newrow[j]=newrow[j]+rows[i][j]
return [newrow]
else:
return rows;
#这是个坑,为了实现一种很特殊的行列转换.按groupi提供的列行列转换,并分组合并.暂时只需要sum.另count已经算好了,用sum/count可得avg
def TableFormartRowConvert(self,rows,columns,groupi,MaxN=9999):
dic_columns={}
dic_columns_result={}
list_columns_result=[]
row_blank=[] #default blank row
i_columnleft=groupi
if groupi>0:
list_columns_result.extend(columns[0:groupi])
#row_blank.extend(rows[0][0:groupi]) #time
i_valuecolunmn=len(columns)-(groupi+2) #muti value columns
extend_valuecolumn=[]
if i_valuecolunmn>0:
list_columns_result.append('_value_')
dic_columns_result['_value_']=groupi
extend_valuecolumn.extend(columns[groupi+1])
#row_blank.append('')#value1,value2
i_columnleft+=1
for row in rows:
columntype=row[groupi]
if dic_columns.has_key(columntype):
dic_columns[columntype]+=row[groupi+1]
else:
dic_columns[columntype]=row[groupi+1]
column_sort=sorted(dic_columns.iteritems(),key=lambda dic_columns:dic_columns[1],reverse=True)
#print column_sort
if len(column_sort)>MaxN:
column_sortlist=list(column_sort[0:MaxN-1])
column_sortlist.append(('_other_',0))
else:
column_sortlist=list(column_sort)
for columni,(columnname,columnvalue) in enumerate(column_sortlist):
dic_columns_result[columnname]=i_columnleft+columni
list_columns_result.append(columnname)
row_blank = [0]*len(dic_columns_result);
#ok:
# dic_columns_result,list_columns_result
rows_values=[] #sum
rows_count=[] #count
lastrowheader=['_none_']
rowi=-1
for row in rows:
now_rowheader=list(row[0:groupi])
if i_valuecolunmn>0:
now_rowheader.append('_none_')
for p_i in range(0,i_valuecolunmn+1):
now_rowheader[-1]= (columns[i_columnleft+p_i])
#print now_rowheader
if now_rowheader!=lastrowheader:
rowblank_tmp=[]
rowblank_tmp.extend(now_rowheader)
rowblank_tmp.extend(row_blank)
rows_values.append(copy.deepcopy(rowblank_tmp))
rows_count.append(copy.deepcopy(rowblank_tmp))
rowi+=1
lastrowheader=copy.deepcopy(now_rowheader)
clumnname_tmp=row[groupi]
if dic_columns_result.has_key(clumnname_tmp):
columnindex=dic_columns_result[clumnname_tmp]
else:
columnindex=dic_columns_result['_other_']
columnvalue=row[p_i+1+groupi]
rows_values[rowi][columnindex]+=columnvalue
rows_count[rowi][columnindex]+=1
else:
if now_rowheader!=lastrowheader:
rowblank_tmp=[]
rowblank_tmp.extend(now_rowheader)
rowblank_tmp.extend(row_blank)
rows_values.append(copy.deepcopy(rowblank_tmp))
rows_count.append(copy.deepcopy(rowblank_tmp))
rowi+=1
lastrowheader=copy.deepcopy(now_rowheader)
clumnname_tmp=row[groupi]
#print clumnname_tmp
if dic_columns_result.has_key(clumnname_tmp):
columnindex=dic_columns_result[clumnname_tmp]
else:
columnindex=dic_columns_result['_other_']
#print rowi,columnindex
columnvalue=row[groupi+1]
rows_values[rowi][columnindex]+=columnvalue
rows_count[rowi][columnindex]+=1
return rows_values,list_columns_result
#printflist(rows_values)
#print '!'*50
#printflist(rows_count)
#得到递减list
def TableFormartRowDecreasing(self,row,ValueColumnIndex,isCheckGrowth=False):
len_rows=len(row)
if len_rows<1:
return row
columnValueList=range(ValueColumnIndex,len(row[0]))
#print columnValueList
new_list=[]
for i in range(1,len_rows):
new_row=list(row[i][0:ValueColumnIndex])
for j in columnValueList:
lastvalue=row[i-1][j]
nowvalue=row[i][j]
thisvalue=nowvalue-lastvalue
if isCheckGrowth and thisvalue<0:
thisvalue=0
new_row.append(thisvalue)
if i==1:
lastlist=copy.deepcopy(new_row)
for lindex_last in range(0,ValueColumnIndex):
lastlist[lindex_last]=row[0][lindex_last]
new_list.append(lastlist)
new_list.append(new_row)
#print new_list
#print '*'*50
#print row
return new_list
class sqlserver(sqlbase):
def __init__(self, connlist,sqlstr,isadmin=0):
if isadmin==1:
connlist[2]=settings.sqlserver_admin_user;
connlist[3]=settings.sqlserver_admin_password;
if isadmin==-1:
connlist[2]=settings.sqlserver_staff_user;
connlist[3]=settings.sqlserver_staff_password;
#sqlconnstr="DRIVER=FreeTDS;SERVER=%s;PORT=%s;UID=%s;PWD=%s;DATABASE=%s;TDS_Version=8.0;client charset = UTF-8;connect timeout=10;"%(connlist[0],connlist[1],connlist[2],connlist[3],connlist[4])
self.connstrlist=connlist
sqlconnstr=settings.sqlserverdriver%(connlist[0],connlist[1],connlist[2],connlist[3],connlist[4])
self.conn=pyodbc.connect(sqlconnstr,autocommit=True,ansi=False,unicode_results=True)
#self.conn=pyodbc.connect(sqlconnstr,ansi=False,unicode_results=True)
self.sqlstr=sqlstr
def getResultSqlFormat(self,sqlstr,formatstr=""):
if "maxrow:" in formatstr:
maxrows=int(formatstr.replace("maxrow:",""))
rows,columns,select_times=self.getResultSQL(sqlstr,True,maxrows)
else:
rows,columns,select_times=self.getResultSQL(sqlstr)
if(" " in formatstr):
rows,columns=TableFormart_().TableFormart(rows,columns,formatstr)
return rows,columns,select_times
def getResultSqlmuti(self,sqlstr,formatstr=""):
resultlist=[]
sqlstrlist=self.sqlsplit(sqlstr.replace("\ngo","\n;"),";","")
lastdbname=''
if "maxrow:" in formatstr:
maxrows=int(formatstr.replace("maxrow:",""))
else:
maxrows=9999
for defaultdbname,sqlstrlist in sqlstrlist:
if lastdbname!=defaultdbname:
lastdbname=defaultdbname
sqlconnstr=settings.sqlserverdriver%(self.connstrlist[0],self.connstrlist[1],self.connstrlist[2],self.connstrlist[3],defaultdbname)
self.conn=pyodbc.connect(sqlconnstr,autocommit=True,ansi=False,unicode_results=True)
if len(sqlstrlist)==0:
continue
sqlnewstr="\n".join(sqlstrlist)
if len(sqlnewstr.replace("\n","").replace(" ",""))<3:
continue
resultlist.append(self.getResultSQL(sqlnewstr,False,maxrows))
self.close()
return resultlist
def getResultSQL(self,sqlstr,isautoclose=True,maxrows=9999):
cursor = self.conn.cursor()
#sqlstr=sqlstr.decode('GBK')
step_starttime =time.time()
cursor.execute(sqlstr)
#rows = cursor.fetchall()
rows = cursor.fetchmany(maxrows)
columns = [t[0].decode('utf8') for t in cursor.description]
#if len(rows)>9999:
# rows=rows[0:9999]
cursor.close()
if isautoclose:
self.conn.close()
select_times={'runtimes':int((time.time()-step_starttime)*1000)}
return rows,columns,select_times;
def getResult(self):
return self.getResultSQL(self.sqlstr)
def exe_sql(self,sqlstr,iswait=False):
cursor = self.conn.cursor()
step_starttime =time.time()
cursor.execute(sqlstr.decode('utf8'))
if iswait:
while cursor.nextset():
pass
#self.conn.commit()
cursor.close()
select_times={'runtimes':int((time.time()-step_starttime)*1000)}
return True,select_times
def exe_sql_para(self,sqlstr,paras,iswait=False):
cursor = self.conn.cursor()
step_starttime =time.time()
cursor.execute(sqlstr.decode('utf8'),paras)
if iswait:
while cursor.nextset():
pass
#self.conn.commit()
cursor.close()
select_times={'runtimes':int((time.time()-step_starttime)*1000)}
return True,select_times
def exe_sql_para_format(self,sqlstr,paras,formatstr=""):
dic_return={'formatstr':formatstr}
cursor = self.conn.cursor()
step_starttime =time.time()
cursor.execute(sqlstr.decode('utf8'),paras)
#if("insertid" in formatstr):
# dic_return['insertid']=conn.insert_id()
if("iswait" in formatstr):
while cursor.nextset():
pass
#self.conn.commit()
cursor.close()
#print("*****>sql_.py> sqlserver.format")
#print(dic_return)
dic_return['runtimes']=int((time.time()-step_starttime)*1000)
return True,dic_return
def close(self):
try:
self.conn.close()
except:
pass
class mysql(sqlbase):
def __init__(self, connlist,sqlstr,isadmin=0):
if isadmin==1:
connlist[2]=settings.mysql_admin_user;
connlist[3]=settings.mysql_admin_password;
if isadmin==-1:
connlist[2]=settings.mysql_staff_user;
connlist[3]=settings.mysql_staff_password;
if isadmin==0:
if connlist[2] in ("dba_auto","","auto"):
connlist[2]=settings.mysql_normal_user;
connlist[3]=settings.mysql_normal_password;
self.conn= MySQLdb.connect(connlist[0],port=int(connlist[1]),user=connlist[2], passwd=connlist[3],db=connlist[4],charset="utf8",connect_timeout=5,read_timeout=18000,autocommit =1)
else:
self.conn= MySQLdb.connect(connlist[0],port=int(connlist[1]),user=connlist[2], passwd=connlist[3],db=connlist[4],charset="utf8",connect_timeout=5,read_timeout=100,autocommit =1)
self.sqlstr=sqlstr
def getResultSqlFormat(self,sqlstr,formatstr=""):
if "maxrow:" in formatstr:
maxrows=int(formatstr.replace("maxrow:",""))
rows,columns,select_times=self.getResultSQL(sqlstr,True,maxrows)
else:
rows,columns,select_times=self.getResultSQL(sqlstr)
if(" " in formatstr):
rows,columns=TableFormart_().TableFormart(rows,columns,formatstr)
return list(rows),columns,select_times
def getResultSqlmuti(self,sqlstr,formatstr=""):
resultlist=[]
sqlstrlist=self.sqlsplit(sqlstr,";","")
lastdbname=''
if "maxrow:" in formatstr:
maxrows=int(formatstr.replace("maxrow:",""))
else:
maxrows=9999
for defaultdbname,sqlstrlist in sqlstrlist:
if lastdbname!=defaultdbname:
lastdbname=defaultdbname
self.conn.select_db(defaultdbname)
if len(sqlstrlist)==0:
continue
sqlnewstr="\n".join(sqlstrlist)
if len(sqlnewstr.replace("\n","").replace(" ",""))<3:
continue
resultlist.append(self.getResultSQL(sqlnewstr,False,maxrows))
self.close()
return resultlist
def getResultSQL(self,sqlstr,isautoclose=True,maxrows=9999):
cursor = self.conn.cursor()
step_starttime =time.time()
cursor.execute(sqlstr)
#rows = cursor.fetchall()
rows = cursor.fetchmany(maxrows)
columns = [t[0] for t in cursor.description]
cursor.close()
if isautoclose:
self.conn.close()
select_times={'runtimes':int((time.time()-step_starttime)*1000)}
return rows,columns,select_times
def getResultSQL_para(self,sqlstr,para,maxrows=9999):
cursor = self.conn.cursor()
step_starttime =time.time()
cursor.execute(sqlstr,para)
#rows = cursor.fetchall()
rows = cursor.fetchmany(maxrows)
columns = [t[0] for t in cursor.description]
cursor.close()
self.conn.close()
select_times={'runtimes':int((time.time()-step_starttime)*1000)}
return rows,columns,select_times
def getResult(self):
return self.getResultSQL(self.sqlstr)
def exe_sql(self,sqlstr,iswait=False):
cursor = self.conn.cursor()
step_starttime =time.time()
sqlstrlist= sqlstr.split(";")
for sqlstr_real in sqlstrlist:
if len(sqlstr_real)>5:
cursor.execute(sqlstr_real)
if iswait:
while cursor.nextset():
pass
self.conn.commit()
cursor.close()
select_times={'select_times':int((time.time()-step_starttime)*1000)}
#self.conn.close()
return True,select_times
def exe_sql_para(self,sqlstr,paras,iswait=False):
cursor = self.conn.cursor()
step_starttime =time.time()
sqlstrlist= sqlstr.split(";")
for sqlstr_real in sqlstrlist:
if len(sqlstr_real)>5:
cursor.execute(sqlstr_real,paras)
if iswait:
while cursor.nextset():
pass
self.conn.commit()
cursor.close()
select_times={'runtimes':int((time.time()-step_starttime)*1000)}
return True,select_times
def exe_sql_para_format(self,sqlstr,paras,formatstr=""):
#print("*****>sql_.py")
dic_return={'formatstr':formatstr}
cursor = self.conn.cursor()
step_starttime =time.time()
cursor.execute(sqlstr,paras)
#print(paras)
#print(formatstr)
if("insertid" in formatstr):
#print("*****>")
dic_return['insertid']=self.conn.insert_id()
self.conn.commit()
cursor.close()
dic_return['runtimes']=int((time.time()-step_starttime)*1000)
#print("*****>sql_.py")
#print(dic_return)
return True,dic_return
#cursor.execute("insert into colors(color, abbr) values(%s, %s)", ('blue', 'bl'))
def close(self):
try:
self.conn.close()
except:
pass
class redis_Redis(sqlbase):
def __init__(self, connlist,sqlstr,isadmin=False):
if connlist[4]=="":
self.conn = redis.Redis(host=connlist[0], port=connlist[1], password=connlist[3], db=connlist[4])
else:
self.conn = redis.Redis(host=connlist[0], port=connlist[1], db=connlist[4])
self.sqlstr=sqlstr
def getResultSqlFormat(self,sqlstr,formatstr):
if "maxrow:" in formatstr:
maxrows=int(formatstr.replace("maxrow:",""))
rows,columns,select_times=self.getResultSQL(sqlstr)
else:
rows,columns,select_times=self.getResultSQL(sqlstr)
if(" " in formatstr):
rows,columns=TableFormart_().TableFormart(rows,columns,formatstr)
return rows,columns,select_times
#region
#redis BEGIN
def redis_keys(self,keys):
values=self.conn.mget(keys)
rows=map(list,zip(*[keys,values]))
columns=['keys','values']
return rows,columns
def redis_info(self,keys):
#print('dd')
values=self.conn.info()
rows=[]
if len(keys)==1 and keys[0] in("*",'info'):
columns=[]
for key, value in values.items():
#if '_human' in key:
# continue
rows.append(value)
columns.append(key)
else:
columns=keys
for key in keys:
if key in ('keys','expires','avg_ttl'):
if values.has_key('db0'):
rows.append(values['db0'].get(key,'0'))
continue
rows.append(values.get(key,'0'))
#print(rows)
#print(rows)
return [rows],columns
def redis_hash(self,keys):
rows=[self.conn.hmget(keys[0],keys[1:])]
columns=keys[1:]
return rows,columns
def redis_zrange(self,keys):
dic_para={}
for keyi,key in enumerate(keys):
dic_para[keyi]=key
rows=self.conn.zrange(dic_para[0],dic_para.get(1,0),dic_para.get(1,9999),False,True)
columns=['zsortname','zsortvalue']
return rows,columns
def redis_smembers(self,keys):
rows=zip(tuple(self.conn.smembers(keys[0])))
#print(rows)
columns=['smembers']
return rows,columns
def redis_empty(self,keys):
rows=[(keys[0])]
columns=[""]
return rows,columns
def redis_w_del(self,keys):
return self.conn.delete(*keys)
def redis_w_hset(self,keys):
if len(keys)>=3:
#print(keys[0],keys[1],keys[2])
return self.conn.hset(keys[0],keys[1],keys[2])
return -1
def redis_w_hsetnx(self,keys):
if len(keys)>=3:
return self.conn.hsetnx(keys[0],keys[1],keys[2])
return -1
def redis_w_sadd(self,keys):
if len(keys)>=2:
return self.conn.sadd(keys[0],*keys[1:])
return -1
def redis_w_srem(self,keys):
if len(keys)>=2:
return self.conn.srem(keys[0],*keys[1:])
return -1
def redis_w_zadd(self,keys):
if len(keys)>=3:
return self.conn.zadd(keys[0],*keys[1:]) #name1,score1,name2,score2
return -1
def redis_w_zrem(self,keys):
if len(keys)>=2:
return self.conn.zrem(keys[0],*keys[1:])
return -1
#end region
def getResultSQL(self,sqlstr,isautoclose=True,maxrows=9999):
indexi=sqlstr.index(':')
#print(indexi)
if(indexi<2):
return [],[],{'runtimes':0}
sqlaction=sqlstr[0:indexi].replace(" ","").replace("\r","").replace("\n","")
sqlstr=sqlstr[indexi+1:]
step_starttime =time.time()
keys=sqlstr.split(',')
#print(keys)
#print("*"*10)
if keys.count==0:
return [],[],{'runtimes':0}
redislist = {
'keys':self.redis_keys,
'info':self.redis_info,
'hash':self.redis_hash,
'zrange':self.redis_zrange,
'smembers':self.redis_smembers
}
rows,columns = redislist.get(sqlaction,self.redis_empty)(keys);
select_times={'runtimes':int((time.time()-step_starttime)*1000)}
return rows,columns,select_times
def getResult(self):
return self.getResultSQL(self.sqlstr)
def exe_sql(self,sqlstr_c,iswait=False):
sqlstrlist= sqlstr_c.replace("\r","").split("\n")
step_starttime =time.time()
for sqlstr in sqlstrlist:
if len(sqlstr)>5:
indexi=sqlstr.index(':')
if(indexi<2):
continue
sqlaction=sqlstr[0:indexi].replace(" ","").replace("|n|","\n")
sqlstr=sqlstr[indexi+1:]
keys=sqlstr.split(',')
if keys.count==0:
return False,{'runtimes':99}
redislist = {
'del':self.redis_w_del,
'hset':self.redis_w_hset,
'hsetnx':self.redis_w_hsetnx,
'sadd':self.redis_w_sadd,
'srem':self.redis_w_srem,
'zadd':self.redis_w_zadd,
'zrem':self.redis_w_zrem
}
result = redislist.get(sqlaction,self.redis_empty)(keys);
select_times={'runtimes':int((time.time()-step_starttime)*1000)}
return True,select_times
def close(self):
pass
def exe_sql_para_format(self,sqlstr,paras,formatstr=""):
return True,{}
#class oracle(sqlbase):
# def __init__(self, connlist,sqlstr,isadmin=0):
# #
# if isadmin==1:
# dsn_tns = cx_Oracle.makedsn(connlist[0],connlist[1], connlist[4])
# self.conn = cx_Oracle.connect(connlist[2], connlist[3], dsn=dsn_tns,mode=cx_Oracle.SYSDBA)
# else:
# connstr="%s/%s@%s:%s/%s"%(connlist[2],connlist[3],connlist[0],connlist[1],connlist[4])
# self.conn=cx_Oracle.connect(connstr)
# self.sqlstr=sqlstr
# def getResultSqlFormat(self,sqlstr,formatstr=""):
# if "maxrow:" in formatstr:
# maxrows=int(formatstr.replace("maxrow:",""))
# rows,columns,select_times=self.getResultSQL(sqlstr,True,maxrows)
# else:
# rows,columns,select_times=self.getResultSQL(sqlstr)
# if(" " in formatstr):
# rows,columns=TableFormart_().TableFormart(rows,columns,formatstr)
# return list(rows),columns,select_times
# def getResultSQL(self,sqlstr,isautoclose=True,maxrows=9999):
# cursor = self.conn.cursor()
# step_starttime =time.time()
# cursor.execute(sqlstr)
# rows = cursor.fetchall()
# select_times={'runtimes':int((time.time()-step_starttime)*1000)}
# columns = [t[0] for t in cursor.description]
# cursor.close()
# if isautoclose:
# self.conn.close()
# return rows,columns,select_times
# def getResultSqlmuti(self,sqlstr,formatstr=""):
# resultlist=[]
# sqlstrlist=self.sqlsplit(sqlstr,";","")
# lastdbname=''
# for defaultdbname,sqlstrlist in sqlstrlist:
# if sqlstrlist!=defaultdbname:
# lastdbname=defaultdbname
# if len(sqlstrlist)==0:
# continue
# sqlnewstr="\n".join(sqlstrlist)
# if len(sqlnewstr.replace("\n","").replace(" ",""))<3:
# continue
# resultlist.append(self.getResultSQL(sqlnewstr))
# return resultlist
# def getResultSQL_para(self,sqlstr,para,maxrows=9999):
# cursor = self.conn.cursor()
# step_starttime =time.time()
# cursor.execute(sqlstr,para)
# rows = cursor.fetchmany(maxrows)
# columns = [t[0] for t in cursor.description]
# cursor.close()
# self.conn.close()
# select_times={'runtimes':int((time.time()-step_starttime)*1000)}
# return rows,columns,select_times
# def getResult(self):
# return self.getResultSQL(self.sqlstr)
# def exe_sql(self,sqlstr,iswait=False):
# return True
# def exe_sql_para(self,sqlstr,paras,iswait=False):
# return True
# def exe_sql_para_format(self,sqlstr,paras,formatstr=""):
# return True
# def close(self):
# try:
# self.conn.close()
# except:
# pass
class url(sqlbase):
def __init__(self, connlist,sqlstr,isadmin=0):
self.url=connlist[0]
self.postdata=connlist[1]
self.dataset=connlist[2]
self.cookieid=connlist[3]
self.regs=sqlstr
def getResultSqlFormat(self,sqlstr,formatstr):
rows,columns,select_times=self.getResultSQL(sqlstr)
if(" " in formatstr):
rows,columns=TableFormart_().TableFormart(rows,columns,formatstr)
return rows,columns,select_times
def getResultSQL(self,regs):
#if len(self.dataset)>0:
#得到dataset结果循环
step_starttime =time.time()
str= fx.get(self.url)
select_times={'runtimes':int((time.time()-step_starttime)*1000)}
rows,columns=fx.getRegTable(regs,str,iscolumns)
return rows,columns,select_times
def getResult(self):
return self.getResultSQL(self.regs)
def exe_sql(self,sqlstr,iswait=False):
step_starttime =time.time()
fx.get(self.url)
select_times={'runtimes':int((time.time()-step_starttime)*1000)}
return True
def close(self):
pass
#fx=net_.net_()
# str= fx.post("sag/Site/Login", "username={0}&password={1}")
# #str= fx.get("/sag/Aos/Index#")
# tplData={"html":str}
# render=web.template.frender('templates/top-test.htm')
class sql():
@staticmethod
def createFacsql(sqltype,connstr,sqlstr=" ",isadmin=0):
#connstr= connstr.replace("@f",';').replace("@d",'=');
#print connstr
#print '!'*50
connlist=connstr.split(';')
if sqltype<>"url":
assert(len(connlist)>=5)
optList = {
'sqlserver':sqlserver,
'mysql':mysql,
'redis':redis_Redis
#'oracle':oracle
}
ooo = sqlbase()
if(optList.has_key(sqltype)):
ooo = optList[sqltype](connlist,sqlstr,isadmin);
return ooo
if __name__ == "__main__":
l1=[(1,'a'),(2,'b'),(3,'c')]
l2=[(1,0,0),(2,0,0),(3,0,0)]
#print(zip(l1, l2))
#step_starttime =time.time()
#for i in range(5000):
#l3=map(lambda x: x[0]+x[1], zip(l1, l2))
l3=[(1,'a')+x for x in l2]
#l3=[]
#for i,t in enumerate(l2):
# l3.append(l1[i]+t)
#print (time.time()-step_starttime)
#print(l3)
#print(l3)
#host=connlist[0], port=connlist[1], password=connlist[3], db=connlist[4]
#r=redis_Redis(("172.21.28.105",1738,"","","0"),"")
#str=r.getResultSQL("hash:admin_report:dcfq7wtkujyoxgear023b4in5z,title")
#print(str[0][0][0].decode('utf8'))
pass
| [
"noreply@github.com"
] | P79N6A.noreply@github.com |
54b1480d0cb6c34e1e93a325650f3e7c1faebf22 | 2ec951c4a56071d351e70539b74ef8cf445e82b7 | /4-3.2_telnet_CMTS_IPv6_python2.py | b929643b31baa6eb9749cbfb728b945c3026e837 | [] | no_license | chenchih/python-full_script | 370730d256ce6592f3ee03b8953f79480d135fe0 | 9d9952145e222cef9c20bfbbd9448c969ac23cbd | refs/heads/master | 2023-03-21T10:34:52.316489 | 2021-03-11T08:55:55 | 2021-03-11T08:55:55 | 295,582,990 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,045 | py | # -*- coding: utf-8 -*-
import telnetlib
import subprocess
import time
import re
def Telnet_Check_reachability(ip):
ping_count=3
process = subprocess.Popen(['ping', ip, '-n', str(ping_count)],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
process.wait()
stdout = process.stdout.read()
#print stdout
if "TTL=" in stdout:
#print "Server reachable"
successful = 1
else:
#print "Server unreachable"
successful = 0
return successful
def Login_Telnet(HOST,username,password):
try:
tn=""
reachability=Telnet_Check_reachability(HOST)
if (reachability==1):
tn = telnetlib.Telnet(HOST,23)
tn.read_until("Username:")
tn.write(username + "\n")
if password:
tn.read_until("Password:")
tn.write(password + "\n")
time.sleep(3)
return tn
except IOError:
print "Telnet " + HOST + " failed. Please check the server connection"
def telnet_To_CMTS(Client_IP, Client_Name, Client_Pwd, MAC):
tn =Login_Telnet(Client_IP, Client_Name, Client_Pwd)
if "telnetlib" in str(tn):
time.sleep(1)
value = tn.read_until("Router#")
command = "scm " + MAC + " ipv6\n"
tn.write(command)
value = tn.read_until("Router#")
#print value
tn.close()
time.sleep(1)
info = "2001"
matchObj = re.match(r'.*'+ info + '(.*)\n',value, re.M|re.DOTALL)
if matchObj:
Ipv6_address = info + matchObj.group(1)
Ipv6 = Ipv6_address.replace("\n", "")
return Ipv6
else:
print "No match!!"
else:
print "Telnet failed"
ip ="192.168.1.252"
username = "guest"
password = "guest"
mac = "840b.7cac.85e4"
new_IPv6 = telnet_To_CMTS(ip, username, password, mac)
print new_IPv6
| [
"noreply@github.com"
] | chenchih.noreply@github.com |
3b154d71ba814d6f7437af78cd78b12ff781411c | 3ccf552a92dc78da06bcd7242ab62b3adf0c9019 | /demos/mybin.py | e4cce305053fdce3e2e9eac5126500d3e377cd69 | [] | no_license | linkcheng/python_demo | a3437bd56083f04d440ae3b4d44f6bffe806dee2 | 332b75948745d66d1a74253033444a2c63fb8e51 | refs/heads/master | 2022-07-08T10:45:53.587317 | 2020-08-07T10:23:49 | 2020-08-07T10:23:49 | 52,152,418 | 2 | 1 | null | 2021-03-25T21:43:04 | 2016-02-20T12:33:20 | Python | UTF-8 | Python | false | false | 694 | py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import random
def get_nums():
return [random.randint(0, 255) for x in range(0,32)]
def show_nums(nums):
bin_num = []
for index, num in enumerate(nums):
b_num = str(bin(num))[2:]
list_num = ['*'] * 8
for i, b in enumerate(b_num):
if b == '1':
list_num[i] = '.'
bin_num.append(''.join(list_num))
# list_bin_num[k] = '.' for k,v in enumerate(bin_num) if v == '1'
# print('%s %s' % (''.join(list_bin_num),num))
z = zip(nums, bin_num)
for i in range(len(z)//2):
print('%02d %s %s %s %s' % (i, z[i*2][1], z[i*2+1][1], z[i*2][0], z[i*2+1][0]))
if __name__ == '__main__':
num_list = get_nums()
show_nums(num_list) | [
"zhenglong1992@126.com"
] | zhenglong1992@126.com |
3e3069a97bc070a69231339f733c72cb4dedbf54 | 049b1d0733cb22b4d5c2a1084aa6dbe209a5d7e2 | /arrays/quicksort_list_comprehension.py | c5dd2bc54453c1e5ae45d36bf295da3f9194cde4 | [] | no_license | prashant4nov/codesamples | 440108b33892f73d737d4d9bbd52a2e3674d4739 | daf452bd5881e379f9d1351635f75e29447186d2 | refs/heads/master | 2021-01-16T19:30:56.426100 | 2018-09-19T19:55:22 | 2018-09-19T19:55:22 | 31,382,928 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 377 | py | '''
quick sort using list comprehension.
http://en.literateprograms.org/Quicksort_%28Python%29
'''
def quicksort(arr):
if arr == []:
return []
else:
pivot = arr[0]
lesser = quicksort([x for x in arr[1:] if x < pivot])
greater = quicksort([x for x in arr[1:] if x >= pivot])
return lesser + [pivot] + greater
arr = [4,243,56,1,435,84,23,67]
print quicksort(arr)
| [
"prashant.talkin@gmail.com"
] | prashant.talkin@gmail.com |
c044fa3e113645f0e469386305cab1a5df54e5c7 | 1b340699e4c6e03d669552eea22c81e34b5b70f2 | /keras/2.1-a-first-look-at-a-neural-network_data.py | 0f0d4e07be9a117dc0e8d5b2a8f47b794fd52e54 | [] | no_license | codelifehoon/ml_training | 8ba45588aff14ade865f0d47172ceb9a20a40d81 | 6dd5fbc02cac52ffb1913fc34052e5cad8f44c78 | refs/heads/master | 2020-04-14T18:53:34.918496 | 2019-01-04T01:24:34 | 2019-01-04T01:24:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,271 | py | import tensorflow as tf
import keras
import numpy as np
import pandas as pd
from keras.datasets import mnist
from keras import models,layers
from keras.utils import to_categorical
import datetime
import matplotlib.pyplot as plt
from sklearn.preprocessing import OneHotEncoder
(x_train, y_train), (x_test, y_test) = mnist.load_data()
digit = x_train[4]
fig, axes = plt.subplots(1, 4, figsize=(3, 3),
subplot_kw={'xticks': [], 'yticks': []})
axes[0].set_title("plt.cm.Blues")
axes[0].imshow(digit, interpolation='nearest', cmap=plt.cm.Blues)
axes[1].set_title("plt.cm.Blues_r")
axes[1].imshow(digit, interpolation='nearest', cmap=plt.cm.Blues_r)
axes[2].set_title("plt.BrBG")
axes[2].imshow(digit, interpolation='nearest', cmap='BrBG')
axes[3].set_title("plt.BrBG_r")
axes[3].imshow(digit, interpolation='nearest', cmap='BrBG_r')
plt.show()
# onehot encoding with keras.to_categorical
numbers = np.asarray([1, 2, 3, 4])
print(numbers)
print(to_categorical(numbers)) # <- the zero index is start from 0
# onehot encoding with sklearn OneHotEncoder
one_hot_number = numbers.reshape(4,1)
one = OneHotEncoder()
one.fit(one_hot_number)
print(one.transform(one_hot_number).toarray()) # <- a zero index starts at the first element
| [
"codelife@11st.co.kr"
] | codelife@11st.co.kr |
832262a934a5356ef52afd88cf511932e2f28cfe | 4a9ef609da356706c524e3465204ccde9365ea2f | /plotter.py | 8a4ac1f1592b089d11b60547c7351d97334dea86 | [] | no_license | 12102man/DEProgAssignment | 432281d4a24ab4282649b6fc19acbed18e98e5af | b5aa31e4473dbbb244ca1ce8f270a0161a2dee41 | refs/heads/master | 2020-04-02T09:18:48.297475 | 2018-10-23T19:42:38 | 2018-10-23T19:42:38 | 154,286,862 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,926 | py | from matplotlib.figure import Figure
from methods import *
class Plotter:
def __init__(self, title):
self.figure = Figure(dpi=70)
self.figure.suptitle(title)
def add_graph(self, method):
"""
Method that adds the graph onto a Plotter
:param method: name of method used
:return:
"""
a = self.figure.add_subplot(111)
a.set_xlabel('x values')
a.set_ylabel('y values')
a.plot(method.x_array, method.y_array, label=method.name)
a.legend(loc='upper left')
def add_error_graph(self, errors, method):
"""
Method that adds the error graph onto a Plotter
:param errors: ErrorAnalysis
:param method: name of method used
:return
"""
a = self.figure.add_subplot(111)
a.set_xlabel('N')
a.set_ylabel('Maximum error')
a.plot(errors.x_array, errors.y_array[method], label=method)
a.legend(loc='upper left')
def add_local_error_graph(self, x, y, method):
"""
Method that adds the error graph onto a Plotter
:param x: x-values of graph
:param y: y-values of graph
:param method: name of method used
:return:
"""
a = self.figure.add_subplot(111)
a.set_xlabel('x values')
a.set_ylabel('cError')
a.plot(x, y, label=method)
a.legend(loc='upper left')
class MagicSolver:
"""
This class is used for checking all solutions
for each of methods:
- exact
- Runge-Kutta
- Euler
- Improved Euler
"""
def __init__(self, x0, y0, X, N):
"""
Initializer
:param x0: x0
:param y0: y0
:param X: X
:param N: N
"""
self.x0 = x0
self.y0 = y0
self.X = X
self.N = N
self.solutions = {}
self.find_solution()
def find_solution(self):
"""
Calculate solutions of each of methods and save to solutions dictionary
:return:
"""
euler = Euler(int(self.x0), int(self.y0), int(self.X),
int(self.N))
improved_euler = ImprovedEuler(int(self.x0), int(self.y0), int(self.X),
int(self.N))
exact = Exact(int(self.x0), int(self.y0), int(self.X),
int(self.N))
runge_kutta = RungeKutta(int(self.x0), int(self.y0), int(self.X),
int(self.N))
self.solutions['euler'] = euler
self.solutions['improved_euler'] = improved_euler
self.solutions['exact'] = exact
self.solutions['runge_kutta'] = runge_kutta
def generate_plot(self):
"""
Method that generates a plot of solutions calculated
:return: Plotter
"""
plotter_methods = Plotter('Graphs')
# Plotting methods
plotter_methods.add_graph(self.solutions['euler'])
plotter_methods.add_graph(self.solutions['improved_euler'])
plotter_methods.add_graph(self.solutions['exact'])
plotter_methods.add_graph(self.solutions['runge_kutta'])
return plotter_methods
def generate_error_array(self, method):
"""
Method that generates an array of y-values for error
:param method: name of specific method used
:return: list of y-values
"""
x_array = self.solutions[method].x_array
result_list = []
for i in range(len(x_array)):
result_list.append(abs(self.solutions['exact'].y_array[i] - self.solutions[method].y_array[i]))
return result_list
def find_max_error(self, method):
"""
Method that finds the highest error in the current method
:param method: name of specific method used
:return: max value
"""
return max(self.generate_error_array(method))
def create_local_error_graph(self):
"""
Method that generates a plot of local errors calculated
:return: Plotter
"""
plot = Plotter('Local errors')
for method in ('euler', 'improved_euler', 'runge_kutta'):
x_array = self.solutions['euler'].x_array
result_list = []
for i in range(len(x_array)):
result_list.append(abs(self.solutions['exact'].y_array[i] - self.solutions[method].y_array[i]))
plot.add_local_error_graph(x_array, result_list, method)
return plot
class ErrorAnalysis:
"""
ErrorAnalysis is a class used for plotting
a graph of changing error in comparison with N.
"""
def __init__(self, x0, y0, X, start, end):
"""
Initializer
:param x0: x0
:param y0: y0
:param X: X
:param N: X
"""
if start == 0:
raise ValueError("You can't create a graph with zero intervals!")
self.x_array = [] # Array of x-values
self.y_array = {} # Dictionary of different y-values, depending on a method
self.x0 = x0
self.y0 = y0
self.X = X
self.start = start
for i in range(start, end+1): # Fill x_array with values from 1 to N
self.x_array.append(i)
def find_error(self, method):
self.y_array[method] = [] # Initialize empty array
for i in self.x_array: # Fill it with values
solution = MagicSolver(self.x0, self.y0, self.X, i)
self.y_array[method].append(solution.find_max_error(method))
def generate_plot(self):
"""
Method that generates a plot of errors
:return: Plotter
"""
plotter_errors = Plotter('Errors from N')
plotter_errors.add_error_graph(self, 'euler')
plotter_errors.add_error_graph(self, 'improved_euler')
plotter_errors.add_error_graph(self, 'runge_kutta')
return plotter_errors
| [
"12102man@gmail.com"
] | 12102man@gmail.com |
ab7a612016a318c2c025a2be9ed8315101fc1ea2 | 3f8f165b3a0deab912e98f291640530f9e7b4f9d | /encoder_decoder_helpers.py | f463eaa390754ce58efca83f13a1c8ae78bc2199 | [
"MIT"
] | permissive | chris522229197/iTalk | 9170ad9ce49510e293c08a7b154c41787d7b3f94 | d377e8e5bd8bc1fbad180e5305d794fb8981bd4c | refs/heads/master | 2021-05-07T01:41:34.303455 | 2017-12-15T22:08:35 | 2017-12-15T22:08:35 | 110,385,440 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 5,716 | py | # -*- coding: utf-8 -*-
# Code adopted from lstm_seq2seq.py in the keras examples, with MIT license
# (https://github.com/fchollet/keras/blob/master/examples/lstm_seq2seq.py)
import numpy as np
from keras.models import Model
from keras.layers import Input, LSTM, Dense
from keras.models import model_from_json
# Convert lists of input tokens and target tokens to one-hot format of encoder input,
# decoder input, and decoder target
def convert_onehot(input_list, target_list, input_lookup, target_lookup,
input_len, target_len):
encoder_input = np.zeros((len(input_list), input_len, len(input_lookup)),
dtype='float32')
decoder_input = np.zeros((len(input_list), target_len, len(target_lookup)),
dtype='float32')
decoder_target = np.zeros((len(target_list), target_len, len(target_lookup)),
dtype='float32')
for r, (input_token, target_token) in enumerate(zip(input_list, target_list)):
for t, char in enumerate(input_token):
if char in input_lookup:
encoder_input[r, t, input_lookup[char]] = 1.
for t, char in enumerate(target_token):
if char in target_lookup:
decoder_input[r, t, target_lookup[char]] = 1.
if t > 0:
if char in target_lookup:
decoder_target[r, t - 1, target_lookup[char]] = 1.
return encoder_input, decoder_input, decoder_target
# Construct encoder-decoder model and the inference models (encoder and decoder)
def encoder_decoder(input_vocab_size, target_vocab_size, hidden_dim):
# Define the encoder model and keep the states
encoder_inputs = Input(shape = (None, input_vocab_size))
encoder = LSTM(hidden_dim, return_state=True)
encoder_outputs, state_h, state_c = encoder(encoder_inputs)
encoder_states = [state_h, state_c]
# Set up the decoder with the encoder states as initial states
decoder_inputs = Input(shape = (None, target_vocab_size))
decoder_lstm = LSTM(hidden_dim, return_sequences=True, return_state=True)
decoder_outputs, _, _ = decoder_lstm(decoder_inputs, initial_state=encoder_states)
decoder_dense = Dense(target_vocab_size, activation='softmax')
decoder_outputs = decoder_dense(decoder_outputs)
# Construct the encoder decoder model
encoder_decoder_model = Model([encoder_inputs, decoder_inputs], decoder_outputs)
# Define the inference models
encoder_model = Model(encoder_inputs, encoder_states)
decoder_state_input_h = Input(shape=(hidden_dim, ))
decoder_state_input_c = Input(shape=(hidden_dim, ))
decoder_states_inputs = [decoder_state_input_h, decoder_state_input_c]
decoder_outputs, state_h, state_c = decoder_lstm(decoder_inputs,
initial_state=decoder_states_inputs)
decoder_states = [state_h, state_c]
decoder_outputs = decoder_dense(decoder_outputs)
decoder_model = Model([decoder_inputs] + decoder_states_inputs,
[decoder_outputs] + decoder_states)
return encoder_decoder_model, encoder_model, decoder_model
# Decode a one-hot presentation of a token to its corresponding string
def decode_token(token, target_idx_lookup, target_char_lookup, decoder, encoder,
max_length):
# Encode the token as state vectors
state_values = encoder.predict(token)
# Initialize target sequence of length 1
target_seq = np.zeros((1, 1, len(target_idx_lookup)))
target_seq[0, 0, target_idx_lookup['\t']] = 1.
stop = False
decoded_token = ''
while not stop:
output_tokens, h, c = decoder.predict([target_seq] + state_values)
# Pick the character with the highest logit value
char_idx = np.argmax(output_tokens[0, -1, :])
char = target_char_lookup[char_idx]
# Exit when the max length is reached or the stop character is reached
if (char == '\n') or (len(decoded_token) > max_length):
stop = True
else:
# If not reaching the end, append the character to the decoded token
decoded_token += char
# Update the target sequence
target_seq = np.zeros((1, 1, len(target_idx_lookup)))
target_seq[0, 0, char_idx] = 1.
# Update the states
state_values = [h, c]
return decoded_token
# Decode a 3D np array of one-hot presentations into a list of strings
def batch_decode(encoder_input, target_idx_lookup, target_char_lookup, decoder, encoder,
max_length):
prediction = []
for i in range(encoder_input.shape[0]):
print('{}/{}'.format(i + 1, encoder_input.shape[0]))
str_token = decode_token(encoder_input[i:(i+1)], target_idx_lookup, target_char_lookup,
decoder, encoder, max_length)
prediction.append(str_token)
return prediction
# Save a dictionary of Keras models
def save_models(models_dict, directory):
for name, model in models_dict.items():
with open(directory + '/' + name + '.json', 'w') as file:
file.write(model.to_json())
model.save_weights(directory + '/' + name + '.h5')
# Load a list of Keras models
def load_models(model_names, directory):
models = {}
for model_name in model_names:
with open(directory + '/' + model_name + '.json', 'r') as file:
json_str = file.read()
model = model_from_json(json_str)
model.load_weights(directory + '/' + model_name + '.h5')
models[model_name] = model
return models | [
"chris522229197@gmail.com"
] | chris522229197@gmail.com |
828864a623c3ec272203eaf78ed0ab7b7c4c67a1 | 49a58915bbdfa00216ef541dbeab84cb0f02efe5 | /DataStructures/LinkedList/11_delete_duplicates.py | 84577228a576b14d5c5a929c00c2e0ec99cc7efe | [] | no_license | Victor-Foscarini/HackerRank_Solutions | 5846e3e4277c32d8a319358a5fe5522a6ff1661e | c3c52c2c31554cbfd8b2a1e0634a9f73ee995588 | refs/heads/master | 2023-08-26T20:41:28.162231 | 2021-10-29T11:50:50 | 2021-10-29T11:50:50 | 284,184,735 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,736 | py | #!/bin/python3
import math
import os
import random
import re
import sys
class SinglyLinkedListNode:
def __init__(self, node_data):
self.data = node_data
self.next = None
class SinglyLinkedList:
def __init__(self):
self.head = None
self.tail = None
def insert_node(self, node_data):
node = SinglyLinkedListNode(node_data)
if not self.head:
self.head = node
else:
self.tail.next = node
self.tail = node
def print_singly_linked_list(node, sep, fptr):
while node:
fptr.write(str(node.data))
node = node.next
if node:
fptr.write(sep)
------------------------------------------------------------------------------------------------------------------------------------------------------------------
def removeDuplicates(head):
if not head:
return
if head.next:
if head.data == head.next.data:
head.next = head.next.next
removeDuplicates(head)
else:
removeDuplicates(head.next)
return head
------------------------------------------------------------------------------------------------------------------------------------------------------------------
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
t = int(input())
for t_itr in range(t):
llist_count = int(input())
llist = SinglyLinkedList()
for _ in range(llist_count):
llist_item = int(input())
llist.insert_node(llist_item)
llist1 = removeDuplicates(llist.head)
print_singly_linked_list(llist1, ' ', fptr)
fptr.write('\n')
fptr.close()
| [
"noreply@github.com"
] | Victor-Foscarini.noreply@github.com |
52bcf7e23fe4b37bfd523de9844d5c7ea80383b4 | 5e061edad95393788944c0e85ef53bde7f5f933c | /lecture/migrations/0001_initial.py | 5987d136689e85cd1b194466fb790f4b95c92be7 | [] | no_license | nkucs/server | 1901d82ec13d6761516474751fad2183961e4236 | 6e5b306b061866be3367a30f4df372d4895c684a | refs/heads/master | 2020-05-22T03:05:16.641234 | 2019-06-07T13:18:35 | 2019-06-07T13:18:35 | 186,206,488 | 5 | 7 | null | 2019-06-07T15:57:33 | 2019-05-12T03:27:24 | Python | UTF-8 | Python | false | false | 1,134 | py | # Generated by Django 2.2.1 on 2019-05-15 15:49
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Lecture',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=128)),
('description', models.TextField(blank=True, null=True)),
('created_at', models.DateTimeField(auto_now=True)),
('modified_at', models.DateTimeField(auto_now_add=True)),
],
),
migrations.CreateModel(
name='LectureProblem',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('language', models.IntegerField()),
('lecture', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='lecture.Lecture')),
],
),
]
| [
"tdingquan@gmail.com"
] | tdingquan@gmail.com |
534b4bb885f6c94bdebbcb061517b030ad0879ed | 5e0440df22432129ca2c01bb695c397667004bfe | /aoc11_1.py | b19b5ccaadaba99200c18800b765c3357dbd2805 | [] | no_license | Nadkine/AdventOfCode2020 | 6dc4d056e14905934958fb3f6956b865818d1781 | 392fbeef42361fac3a2924043bf2634566ec0124 | refs/heads/master | 2023-02-16T05:29:57.340982 | 2021-01-14T20:35:37 | 2021-01-14T20:35:37 | 320,621,321 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,639 | py | board = []
board_copy = []
with open('data11.txt','r') as f:
for line in f.readlines():
row = []
for seat in line:
if seat != '\n':
row.append(seat)
board.append(row)
different = True
counter = 0
def getSeats(row_i, seat_i,board,row_counter,seat_counter):
k = 0
l = 0
while True:
k += row_counter
l += seat_counter
if row_i-k == 0:
return 1
elif board[row_i + k][seat_i -1] == ".":
pass:
elif board[row_i + k][seat_i-1] == "L":
return 1
elif board[row_i + k][seat_i-1] == "#":
return 0
while different:
counter += 1
print(counter)
board_copy = []
for row in board:
board_copy.append(row.copy())
for row_i,row in enumerate(board):
for seat_i,seat in enumerate(row):
available = 0
if (row_i == 0 or board_copy[row_i - 1][seat_i] != '#'):
available += getSeats(row_i,seat_i,board_copy,-1,0)
if ((row_i == 0 or seat_i == len(board_copy[row_i])-1) or board_copy[row_i - 1][seat_i + 1] != '#'):
available += 1
if (seat_i == len(board_copy[row_i])-1 or board_copy[row_i][seat_i + 1] != '#'):
available += 1
if ((row_i == len(board_copy)-1 or seat_i == len(board_copy[row_i])-1) or board_copy[row_i+1][seat_i + 1] != '#'):
available += 1
if (row_i == len(board_copy)-1 or board_copy[row_i + 1][seat_i] != '#'):
available += 1
if ((row_i == len(board_copy)-1 or seat_i == 0) or board_copy[row_i + 1][seat_i - 1] != '#'):
available += 1
if (seat_i == 0 or board_copy[row_i][seat_i - 1] != '#'):
available += 1
if ((row_i == 0 or seat_i == 0) or board_copy[row_i-1][seat_i - 1] != '#'):
available += 1
if available == 8 and seat == "L":
board[row_i][seat_i] = "#"
if available < 5 and seat == "#":
board[row_i][seat_i] = "L"
pass
board_count = 0
board_copy_count = 0
for row in board:
board_count += row.count('#')
for row in board_copy:
board_copy_count += row.count('#')
print(board_count)
if board_copy_count == board_count:
different = False
print("FINIISHED")
| [
"fullredmacbook07-2020@fullreds-MacBook-Pro.local"
] | fullredmacbook07-2020@fullreds-MacBook-Pro.local |
30bc00a04df933035bcd8c90e1f79f7c31ca345a | c4832442c41aa546e1279a6f9036e3fddd00ffa4 | /result/DataWrite.py | 2ee9400baf8bece0ae471490e4702d683ff1c937 | [] | no_license | chengmingchun/af_algo | 880fc5a4164fd9be261fbaa522693d971481ff01 | 16c32e928dba104cc10e5c1fc6a54797a1d8f8be | refs/heads/master | 2022-12-06T03:25:11.174962 | 2020-08-26T14:32:39 | 2020-08-26T14:32:39 | 290,493,807 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,379 | py | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 22 04:23:54 2020
@author: 13052
"""
import openpyxl
import numpy as np
import pandas as pd
re = pd.read_table('temdata.txt',header = None, delimiter='\t')
re2= pd.read_table('result_t.txt',header = None, delimiter='\t')
dis = pd.read_table('distance.txt',header = None, delimiter='\t')
res = re.values
res2 = re2.values
distance = dis.values
data = openpyxl.open('res.xlsx')
sheet = data['Sheet1']
points = ["I",
"E",
"L",
"K",
"A",
"J",
"O",
"F",
"P",
"N",
"M",
"B",
"D",
"G",
"C",
"H"];
length = [0]*134
for i in range(0,134):
for j in range(3,0,-1):
if res2[i,j] != 0:
length[i]=j
break
kk = 1;
for i in range(0,134):
for j in range(0,4):
if res2[i,j] != 0 :
sheet.cell(row=kk,column=1,value= i+1)
if j!=0 and res[res2[i,j]-1,0] != res[res2[i,j-1]-1,1]:
sheet.cell(row=kk,column=2,value= '空驶')
sheet.cell(row=kk,column=3,value= points[res[res2[i,j-1]-1,1]-1])
sheet.cell(row=kk,column=4,value= points[res[res2[i,j]-1,0]-1])
sheet.cell(row=kk,column=5,value= res[res2[i,j-1]-1,3])
sheet.cell(row=kk,column=6,value= res[res2[i,j-1]-1,3]+distance[res[res2[i,j-1]-1,1]-1,res[res2[i,j]-1,0]-1])
kk=kk+1
sheet.cell(row=kk,column=1,value= i+1)
sheet.cell(row=kk,column=2,value= res2[i,j])
for w in range(3,5):
sheet.cell(row=kk,column=w,value= points[res[res2[i,j]-1,w-3]-1])
for w in range(5,7):
sheet.cell(row=kk,column=w,value= res[res2[i,j]-1,w-3])
kk=kk+1
if j == length[i] and res[res2[i,j]-1,1] != res[res2[i,0]-1,0]:
sheet.cell(row=kk,column=1,value= i+1)
sheet.cell(row=kk,column=2,value='空驶')
sheet.cell(row=kk,column=3,value= points[res[res2[i,j]-1,1]-1])
sheet.cell(row=kk,column=4,value= points[res[res2[i,0]-1,0]-1])
sheet.cell(row=kk,column=5,value= res[res2[i,j]-1,3])
sheet.cell(row=kk,column=6,value= res[res2[i,j]-1,3]+distance[res[res2[i,j]-1,1]-1,res[res2[i,0]-1,0]-1])
kk+=1
data.save('res.xlsx')
print('----Finish writing----') | [
"1305232381@qq.com"
] | 1305232381@qq.com |
01b65fa62f033ee2bb173040766119fcba0b4fe2 | 91d1a6968b90d9d461e9a2ece12b465486e3ccc2 | /pinpoint_write_2/endpoint_delete.py | cf53331aefddda4f6a700adcbf0325709acdb957 | [] | no_license | lxtxl/aws_cli | c31fc994c9a4296d6bac851e680d5adbf7e93481 | aaf35df1b7509abf5601d3f09ff1fece482facda | refs/heads/master | 2023-02-06T09:00:33.088379 | 2020-12-27T13:38:45 | 2020-12-27T13:38:45 | 318,686,394 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,101 | py | #!/usr/bin/python
# -*- codding: utf-8 -*-
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from common.execute_command import write_two_parameter
# url : https://awscli.amazonaws.com/v2/documentation/api/latest/reference/pinpoint/delete-endpoint.html
if __name__ == '__main__':
"""
get-endpoint : https://awscli.amazonaws.com/v2/documentation/api/latest/reference/pinpoint/get-endpoint.html
update-endpoint : https://awscli.amazonaws.com/v2/documentation/api/latest/reference/pinpoint/update-endpoint.html
"""
parameter_display_string = """
# application-id : The unique identifier for the application. This identifier is displayed as the Project ID on the Amazon Pinpoint console.
# endpoint-id : The unique identifier for the endpoint.
"""
add_option_dict = {}
add_option_dict["parameter_display_string"] = parameter_display_string
# ex: add_option_dict["no_value_parameter_list"] = "--single-parameter"
write_two_parameter("pinpoint", "delete-endpoint", "application-id", "endpoint-id", add_option_dict)
| [
"hcseo77@gmail.com"
] | hcseo77@gmail.com |
437b3c5985b0414df473e0f59608a289953b502d | 114178ce0d34c3c44f1dbe11e412739deded9137 | /todolist/migrations/__pycache__/0003_auto_20190516_0922.py | e52dc2edde2a2e5c3dabaf35cd6a6fc867fb6388 | [] | no_license | Boxtell/Task_Manager | 142bbc03f44ff820611903a6b95367974b806d73 | b8990eee44918c2003483aee8621a3d67379eaf1 | refs/heads/master | 2023-01-11T18:29:40.089960 | 2020-11-13T15:23:22 | 2020-11-13T15:23:22 | 187,052,562 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,081 | py | # Generated by Django 2.1.8 on 2019-05-16 09:22
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('todolist', '0002_auto_20190514_1344'),
]
operations = [
migrations.CreateModel(
name='TaskList',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('list_title', models.CharField(max_length=100, verbose_name='List Title')),
('list_users', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='lists', to=settings.AUTH_USER_MODEL)),
],
),
migrations.AddField(
model_name='task',
name='task_list',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tasks', to='todolist.TaskList'),
),
]
| [
"noreply@github.com"
] | Boxtell.noreply@github.com |
9acf4483983d71100bbeaa09d24842d025152055 | 70325313f66b5a2e31aee098597ab143fab952be | /scrapers/scrape_vs_districts.py | bf476e8d5df7e6eb00afc70c69f2a8392a1c8dfd | [
"CC-BY-4.0"
] | permissive | honsa/covid_19 | dde2d3960f3775d7e02ae9cf4d6e014395239059 | f195925dadc51e1734c2d21433907dc2dd7022f4 | refs/heads/master | 2023-01-28T22:24:22.315239 | 2020-12-09T20:36:35 | 2020-12-09T20:36:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,543 | py | #!/usr/bin/env python
import re
import scrape_common as sc
import scrape_vs_common as svc
# get the latest weekly PDF
url = svc.get_vs_latest_weekly_pdf_url()
# fetch the PDF
pdf = sc.download_content(url, silent=True)
week, year = svc.get_vs_weekly_general_data(pdf)
# last page contains the district data
page = int(sc.pdfinfo(pdf))
content = sc.pdftotext(pdf, page=page, layout=True, rect=[0, 403, 420, 50], fixed=2)
# strip everything including the "Anzahl Faelle" column + values
def strip_left_number(content):
lines = content.split('\n')
pos = None
for line in lines:
res = re.search(r'\s+(\d+) ', line)
if res is not None:
if pos is None:
pos = res.end()
else:
pos = min(pos, res.end())
new_content = []
for line in lines:
new_content.append(line[pos:])
return '\n'.join(new_content)
# strip from the right the "Inzidenz pro 100k Einwohner" column / description
def strip_right_items(content):
lines = content.split('\n')
pos = None
for line in lines:
res = re.search(r'(\d+|\d+\.\d+)\s?$', line)
if res is not None:
if pos is None:
pos = res.start()
else:
pos = max(pos, res.start())
new_content = []
for line in lines:
new_content.append(line[:pos])
return '\n'.join(new_content)
# kill the left and right axis
content = strip_left_number(content)
content = strip_right_items(content)
# remove strange characters at the end of the string
#content = content.rstrip()
"""
this results in something like this (13 columns expected for the districts)
6.6
9 6 7 2 5 8 15 1 6 16
"""
# approximate the width of each "column" in the table
# get the maxima and divide it by the 13 expected districts
length=None
for line in content.split('\n'):
llenght = len(line)
if length is None:
length = llenght
else:
length = max(llenght, length)
length = round(length / 13.5)
# split up all lines by the length and use the "lowest line" value
district_values = []
for i in range(0, 13):
value = ''
for line in content.split('\n'):
val = line[i * length:(i + 1) * length].strip()
if val != '':
value = val
if value == '':
value = 0
district_values.append(int(value))
# this is the order in the PDF
districts = [
'Goms',
'Raron',
'Brig',
'Visp',
'Leuk',
'Sierre',
'Herens',
'Sion',
'Conthey',
'Martigny',
'Entremont',
'St-Maurice',
'Monthey',
]
district_ids = [
2304,
2309,
2301,
2313,
2306,
2311,
2305,
2312,
2302,
2307,
2303,
2310,
2308,
]
population = [
4440,
10930,
26910,
28650,
12360,
49230,
10860,
47750,
28910,
47980,
15260,
13830,
46840,
]
assert len(district_values) == 13, f'expected 13 district values, but got {len(district_values)} for {url}'
i = 0
for value in district_values:
dd = sc.DistrictData(canton='VS', district=districts[i])
dd.url = url
dd.district_id = district_ids[i]
dd.population = population[i]
dd.week = week
dd.year = year
dd.new_cases = value
print(dd)
i += 1
| [
"maekke@gentoo.org"
] | maekke@gentoo.org |
4cc8e4b8d9e1acdd387171b059190f073f8caa77 | 9a425f153816cd206451876b8da570a9446d76c4 | /reviews/forms.py | 302a57a8a772568d6f52fece684e3fd6c26fd46b | [] | no_license | salhi100/airbnb-clone-2 | cea837f8dd24ab4e634ff7e2f0ce474581313642 | 685477bedc6fed18e40fb53febf22e4393796f4f | refs/heads/master | 2023-01-31T11:31:37.190244 | 2020-01-09T04:53:35 | 2020-01-09T04:53:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 799 | py | from django import forms
from . import models
class CreateReviewForm(forms.ModelForm):
accuracy = forms.IntegerField(max_value=5, min_value=1)
communication = forms.IntegerField(max_value=5, min_value=1)
cleanliness = forms.IntegerField(max_value=5, min_value=1)
location = forms.IntegerField(max_value=5, min_value=1)
check_in = forms.IntegerField(max_value=5, min_value=1)
value = forms.IntegerField(max_value=5, min_value=1)
class Meta:
model = models.Review
fields = (
"review",
"accuracy",
"communication",
"cleanliness",
"location",
"check_in",
"value",
)
def save(self, commit=True):
review = super().save(commit=False)
return review | [
"53186618+hanulbom@users.noreply.github.com"
] | 53186618+hanulbom@users.noreply.github.com |
001c98bc6f6b8dc1802f1a8b694696f7b87583a8 | beeb062b7b46a34321e3eed94bde8bfc32968c6e | /user_profiles/urls.py | d1cc2e29c6ae019d05f56dcf282e4d71ae8327c0 | [] | no_license | Meepit/Exercise-Routine-Recommender | 54c1226db6bfa06a6dec326fdf06bc3ef3a2ffc0 | 3948ef9fe125581e7f77afeac45974829c73dcac | refs/heads/master | 2021-01-19T12:51:25.879391 | 2017-08-31T19:30:35 | 2017-08-31T19:30:35 | 100,799,249 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 912 | py | from django.conf.urls import url, include
from rest_framework.urlpatterns import format_suffix_patterns
from progress.views import ProgressList
from user_profiles import views
urlpatterns = format_suffix_patterns([
url(r'^users/(?P<pk>[0-9]+)/$', views.UserDetail.as_view(), name='user-detail'),
url(r'^users/(?P<user__username>[\w.@+-]+)/$', views.UserDetail.as_view(), name='username-detail'),
url(r'^users/(?P<user__username>[\w.@+-]+)/progress/$', ProgressList.as_view(), name='username-progress'),
url(r'^users/(?P<user__username>[\w.@+-]+)/changepassword/$', views.ChangePassword.as_view(), name='change-password'),
url(r'users/$', views.UserCreate.as_view(), name='user-create'),
])
# Login and logout views for the browsable API
urlpatterns += [
url(r'^api-auth/', include('rest_framework.urls',
namespace='rest_framework')),
] | [
"James-L"
] | James-L |
832bfc52535b87c19a4763e4a866f7fc434ddaff | 0bf51dd24f87ebd30f8e95d9aa7dd85be3940237 | /tests/console_test.py | b79b6bce697e1e5688aaafdf63c45702005810f1 | [] | no_license | AFDudley/btpy | e7cd01d106f8ae38814cad42a833c45592460da4 | 3287a82491388ffe3d804b8c6bfb063ac8106214 | refs/heads/master | 2020-04-20T09:00:05.138992 | 2013-07-07T19:06:34 | 2013-07-07T19:08:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,743 | py | import pygame
from pygame.locals import *
import pyconsole
class UpDownBox(pygame.sprite.Sprite):
def __init__(self, color, initial_position):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.Surface([15, 15])
self.image.fill(color)
self.rect = self.image.get_rect()
self.rect.topleft = initial_position
self.going_down = True
self.next_update_time = 0
def update(self, current_time, bottom):
if self.next_update_time < current_time:
if self.rect.bottom == bottom - 1: self.going_down = False
elif self.rect.top == 0: self.going_down = True
if self.going_down: self.rect.top += 1
else: self.rect.top -= 1
self.next_update_time = current_time + 10
pygame.init()
boxes = pygame.sprite.Group()
for color, location in [([255, 0, 0], [0, 0]), ([0, 255, 0], [60, 60]),
([0, 0, 255], [120, 120])]:
boxes.add(UpDownBox(color, location))
screen = pygame.display.set_mode([800, 600])
console = pyconsole.Console(screen, (2,0,796,596),)
pygame.mouse.set_pos(300,240)
console.set_interpreter()
while pygame.key.get_pressed()[K_ESCAPE] == False:
pygame.event.pump()
screen.fill([0, 0, 0])
console.process_input()
boxes.update(pygame.time.get_ticks(), 150)
for b in boxes: screen.blit(b.image, b.rect)
console.draw()
if console.active == 0:
for event in pygame.event.get():
if event.type == KEYDOWN:
if event.key == K_w:
if pygame.key.get_mods() & KMOD_CTRL:
console.set_active()
pygame.display.update()
pygame.event.pump()
pygame.quit()
| [
"a.frederick.dudley@gmail.com"
] | a.frederick.dudley@gmail.com |
d0c9244a2108dc33f849a3554243a934611a27da | 6ac1398727395b0444439c149ada5a82815f168e | /python/solutions/lab13.py | 57efb2e14109677954def2451e6b919e761f2999 | [] | no_license | xvanausloos/DevSpark_Labs | 7e438736de688b5a101e9a6411d051a85c78e3ba | 36086122769dabb58fc475459d85dd8279100767 | refs/heads/master | 2021-08-16T13:30:06.515435 | 2020-12-04T06:19:26 | 2020-12-04T06:19:26 | 229,521,089 | 1 | 0 | null | 2019-12-22T05:09:48 | 2019-12-22T05:09:48 | null | UTF-8 | Python | false | false | 460 | py | ##Developer should start REPL using:
#pyspark --master local[2]
#3a
from pyspark.streaming import StreamingContext
#3b
ssc = StreamingContext(sc, 2)
#3c
inputDS = ssc.socketTextStream("sandbox",9999)
#3d
ssc.checkpoint("hdfs:///user/root/checkpointDir")
#3e
windowDS = inputDS.window(10,2).flatMap(lambda line:line.split(" ")) \
.map(lambda word: (word,1)).reduceByKey(lambda a,b: a+b)
#3f
windowDS.pprint()
#3g
sc.setLogLevel("ERROR")
#3h
ssc.start()
| [
"joe.widen@gmail.com"
] | joe.widen@gmail.com |
8ec17c05887a213edf3782ea63b6ce597f90925b | 0b46dbe589c5ca134ceadce5281b9890f7ae2eff | /Merlin/Main/Languages/IronPython/IronPython/Lib/iptest/test_env.py | ec4af26d00620b8f8b612fd053fb2dd1ae33961b | [] | no_license | tnachen/ironruby | bcde4a1121bb3d3b4c2e0d93e5a3d105d08b2f9c | 1323df51a7abf6394f27468a1bda788f4bba9aa9 | refs/heads/master | 2020-12-30T19:22:37.411261 | 2009-09-05T00:26:33 | 2009-09-05T00:26:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,762 | py | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Microsoft Public License. A
# copy of the license can be found in the License.html file at the root of this distribution. If
# you cannot locate the Microsoft Public License, please send an email to
# ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
# by the terms of the Microsoft Public License.
#
# You must not remove this notice, or any other, from this software.
#
#
#####################################################################################
import sys
from iptest.util import get_env_var, get_temp_dir
#------------------------------------------------------------------------------
#--IronPython or something else?
is_silverlight = sys.platform == 'silverlight'
is_cli = sys.platform == 'cli'
is_ironpython = is_silverlight or is_cli
is_cpython = sys.platform == 'win32'
if is_ironpython:
#We'll use System, if available, to figure out more info on the test
#environment later
import System
import clr
#--The bittedness of the Python implementation
is_cli32, is_cli64 = False, False
if is_ironpython:
is_cli32, is_cli64 = (System.IntPtr.Size == 4), (System.IntPtr.Size == 8)
is_32, is_64 = is_cli32, is_cli64
if not is_ironpython:
cpu = get_env_var("PROCESSOR_ARCHITECTURE")
if cpu.lower()=="x86":
is_32 = True
elif cpu.lower()=="amd64":
is_64 = True
#--CLR version we're running on (if any)
is_orcas = False
if is_cli:
is_orcas = len(clr.GetClrType(System.Reflection.Emit.DynamicMethod).GetConstructors()) == 8
#--Newlines
if is_ironpython:
newline = System.Environment.NewLine
else:
import os
newline = os.linesep
#--Build flavor of Python being tested
is_debug = False
if is_cli:
is_debug = sys.exec_prefix.lower().endswith("debug")
#--Are we using peverify to check that all IL generated is valid?
is_peverify_run = False
if is_cli:
is_peverify_run = is_debug and "-X:SaveAssemblies" in System.Environment.CommandLine
#--Internal checkin system used for IronPython
is_snap = False
if not is_silverlight and get_env_var("THISISSNAP")!=None:
is_snap = True
#--We only run certain time consuming test cases in the stress lab
is_stress = False
if not is_silverlight and get_env_var("THISISSTRESS")!=None:
is_stress = True
#--Are we running tests under the Vista operating system?
is_vista = False
if not is_silverlight and get_env_var("IS_VISTA")=="1":
is_vista = True
#------------------------------------------------------------------------------
| [
"jdeville@microsoft.com"
] | jdeville@microsoft.com |
03c975d57422ec32427a7a548e0e6544d7025109 | 7d7db95d45c9fec591fa9d94157d194d91d6b413 | /D3/d3p1.py | 397a58e7be5d3a3317b7ba6a229e00bd4d9255da | [] | no_license | snoobism/advent-of-code-2019 | 228c5e4b736fea6ad56de123808b82ca4a428787 | 1ed9d6315f6c01639b0d35fd47652f85c94d33ad | refs/heads/master | 2020-11-25T02:07:17.893005 | 2019-12-27T18:35:54 | 2019-12-27T18:35:54 | 228,444,199 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,574 | py | fileInput = open("d3input.txt", "r")
fileOutput = open("d3p1output.txt", "w")
class Coord(object):
def __init__(self, x, y):
self.x = x
self.y = y
self.d = 0
def __str__(self):
return "(" + str(self.x) + "," + str(self.y) + ")"
lineOne = [x.rstrip() for x in fileInput.readline().split(",")]
lineTwo = [x.rstrip() for x in fileInput.readline().split(",")]
wireOne = []
wireTwo = []
start = Coord(0, 0)
wireOne.append(start)
wireTwo.append(start)
currentDistance = 0
for i in range(0, len(lineOne)):
if(lineOne[i][0] == "R"):
wireOne.append(Coord(wireOne[i].x + int(lineOne[i][1:]), wireOne[i].y))
currentDistance += int(lineOne[i][1:])
wireOne[len(wireOne) - 1].d = currentDistance
if(lineOne[i][0] == "L"):
wireOne.append(Coord(wireOne[i].x - int(lineOne[i][1:]), wireOne[i].y))
currentDistance += int(lineOne[i][1:])
wireOne[len(wireOne) - 1].d = currentDistance
if(lineOne[i][0] == "U"):
wireOne.append(Coord(wireOne[i].x, wireOne[i].y + int(lineOne[i][1:])))
currentDistance += int(lineOne[i][1:])
wireOne[len(wireOne) - 1].d = currentDistance
if(lineOne[i][0] == "D"):
wireOne.append(Coord(wireOne[i].x, wireOne[i].y - int(lineOne[i][1:])))
currentDistance += int(lineOne[i][1:])
wireOne[len(wireOne) - 1].d = currentDistance
currentDistance = 0
for i in range(0, len(lineTwo)):
if(lineTwo[i][0] == "R"):
wireTwo.append(Coord(wireTwo[i].x + int(lineTwo[i][1:]), wireTwo[i].y))
currentDistance += int(lineTwo[i][1:])
wireTwo[len(wireTwo) - 1].d = currentDistance
if(lineTwo[i][0] == "L"):
wireTwo.append(Coord(wireTwo[i].x - int(lineTwo[i][1:]), wireTwo[i].y))
currentDistance += int(lineTwo[i][1:])
wireTwo[len(wireTwo) - 1].d = currentDistance
if(lineTwo[i][0] == "U"):
wireTwo.append(Coord(wireTwo[i].x, wireTwo[i].y + int(lineTwo[i][1:])))
currentDistance += int(lineTwo[i][1:])
wireTwo[len(wireTwo) - 1].d = currentDistance
if(lineTwo[i][0] == "D"):
wireTwo.append(Coord(wireTwo[i].x, wireTwo[i].y - int(lineTwo[i][1:])))
currentDistance += int(lineTwo[i][1:])
wireTwo[len(wireTwo) - 1].d = currentDistance
results = []
def checkIntersection(s1, e1, s2, e2): #start, end
if s1.x == e1.x:
if(s1.x > s2.x and s1.x < e2.x) or (s1.x < s2.x and s1.x > e2.x):
return True
elif s1.y == e1.y:
if(s1.y > s2.y and s1.y < e2.y) or (s1.y < s2.y and s1.y > e2.y):
return True
for i in range(0, len(wireTwo) - 1):
for j in range(0, len(wireOne) - 1):
if checkIntersection(wireTwo[i], wireTwo[i + 1], wireOne[j], wireOne[j + 1]) and checkIntersection(wireOne[j], wireOne[j + 1], wireTwo[i], wireTwo[i + 1]):
if wireTwo[i].x == wireTwo[i + 1].x: # vertical
results.append(Coord(wireTwo[i].x, wireOne[j].y))
results[len(results) - 1].d = wireTwo[i].d + wireOne[j].d + abs(abs(results[len(results) - 1].y) - abs(wireTwo[i].y)) + abs(abs(results[len(results) - 1].x) - abs(wireOne[j].x))
else: # orizontal
results.append(Coord(wireOne[j].x, wireTwo[i].y))
results[len(results) - 1].d = wireOne[i].d + wireTwo[j].d + abs(abs(results[len(results) - 1].y) - abs(wireOne[j].y)) + abs(abs(results[len(results) - 1].x) - abs(wireTwo[i].x))
minimumValue = 9999
minimumDist = float('inf')
for elem in results:
if(abs(elem.x) + abs(elem.y) < minimumValue):
minimumValue = abs(elem.x) + abs(elem.y)
for elem in results:
if(elem.d < minimumDist):
minimumDist = elem.d
for x in wireOne:
print(x)
print(' ')
for x in wireTwo:
print(x)
print(' ')
for x in results:
print(x)
fileOutput.write(str(minimumValue))
fileOutput.write("\n")
fileOutput.write(str(minimumDist))
| [
"30446392+snoobism@users.noreply.github.com"
] | 30446392+snoobism@users.noreply.github.com |
5284fc7236d9820d8e60caa79c49221f224a7753 | bfd75153048a243b763614cf01f29f5c43f7e8c9 | /1906101019-贾佳/Day0225/1.py | 0bdbc889f558fa53c61ce7609f0bf8290a0cdb2a | [] | no_license | gschen/sctu-ds-2020 | d2c75c78f620c9246d35df262529aa4258ef5787 | e1fd0226b856537ec653c468c0fbfc46f43980bf | refs/heads/master | 2021-01-01T11:06:06.170475 | 2020-07-16T03:12:13 | 2020-07-16T03:12:13 | 239,245,834 | 17 | 10 | null | 2020-04-18T13:46:24 | 2020-02-09T04:22:05 | Python | UTF-8 | Python | false | false | 1,757 | py | #构建集合
#两种方法
A = {"a","b","c","c",1} #然后每个元素用逗号隔开,字符串类型的数据需要加定界符。
B = set("aabbcce")#注意使用的是小括号,所有元素放在一起,
#print(A,b)
#集合的并集
#print(A|B)
#集合的交集&
#print(A&B)
#集合的补集
#print(A-B)#A当作全集,B当作补集
#不同时包含
#print(A^B)
#集合的增删
#两种方法
#A.add('d')#元素存在时不操作
#print(A)
#B.update({1,3},[4,2],"e")#元素可以多种多样
#print(B)
#删除元素的方法
#A.remove("a")#删除不存在的元素会报错
#A.discard("f")#元素不存在也不会报错
#A.pop()#随机的删除一个元素
#print(A)
#字典
dic = {"name":"张三","age":19,"school":"sctu"}
#修改数据
dic["name"] = "李四"
#print(dic)
#查找数据
#print(dic.get("name"))#返回指定键的值,不存在则返回default值
#dic.setdefault("address","成都")#返回一个值,不存在则新建
#dic.setdefault("name")
#增加数据
#dic["class"] = "1班"
#print(dic)
#删除数据
#del dic["name"] 删除指定键
#dic.pop("age") #必须给定键值,并返回键值
#dic.popitem()#直接删除最后一个值并返回
#python函数
#def
# def AplusB(a,b):
# return a+b
# result=AplusB(1,2)
# print(result)
# def mj(r,pi):
# area = r**2*pi
# return area
# print(mj(6,3.14))
# print(mj(pi = 3.14,r = 6))
# a = 2
# def main():
# b=3
# print(a)
# main()
# print(b)
#lambda匿名函数
# circle = lambda r,pi:r**2*pi
# print(circle(3,3.14))
# def change(a):
# a = 10
# b = 2
# change(b)#2 > a,a = 2 > a=10
# print(b)
# c = [1,2,3]
# def change2(x):
# x.append([1,2,3])
# change2(c)
# print(c).
def main(x,*y):
print(x)
print(y)
main(1,11,12,13,14) | [
"541554971@qq.com"
] | 541554971@qq.com |
1046654f65640caa5908eda3fde1c22753d1c106 | 3155c495bdc224ea2a99db4ed73d162ad004f1b8 | /hangman.py | df2a58a15b4af3abc64c8fcda144ab0be26cd8ff | [] | no_license | santiagokazlauskas12/hangman | 1795d9b04696d58713302331bbfba6c813e7dc9e | 4d932da4b8e423afe089177f6dcd0b1e205c7f35 | refs/heads/master | 2022-11-13T00:18:32.151195 | 2020-06-30T22:24:42 | 2020-06-30T22:24:42 | 276,221,888 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,024 | py | import random
# seleccionador de palabra ---------------------------------------
def select_word (words):
random.shuffle(words)
word=[c for c in words[0]]
return(word)
# seleccionador de palabra ---------------------------------------
# creador de blanks ------------------------------------
def underscores (word):
blanks= "_"*len(word)
blanks=[i for i in blanks]
return blanks
# creador de blanks ------------------------------------
# va haciendo el blank con letras -----------------------------
def show (word,blanks,correct_letters):
for i in range(len(word)):
if word[i] in correct_letters:
blanks[i]=word[i]
x=" ".join(blanks)
print(x)
# va haciendo el blank con letras -----------------------------
pictures =[ ( """
___________
| |
|
|
|
/\\
"""),
( """
___________
| |
| O
|
|
/\\
"""),( """
___________
| |
| O
| |
|
/\\
""") , ( """
___________
| |
| O
| /|
|
/\\
"""), ( """
___________
| |
| O
| /|\
|
/\\
""") , ( """
___________
| |
| O
| /|\
| /
/\\
""") , ( """
___________
| |
| O
| /|\
| / \\
/\\
""") ]
| [
"63759091+santiagokazlauskas12@users.noreply.github.com"
] | 63759091+santiagokazlauskas12@users.noreply.github.com |
702d222428773d4309d41c11af3522790b2d2bc0 | 59166105545cdd87626d15bf42e60a9ee1ef2413 | /dbpedia/models/mayor.py | 6526d40de4f17f276f8ee52b9b8af54cfc7af7e8 | [] | no_license | mosoriob/dbpedia_api_client | 8c594fc115ce75235315e890d55fbf6bd555fa85 | 8d6f0d04a3a30a82ce0e9277e4c9ce00ecd0c0cc | refs/heads/master | 2022-11-20T01:42:33.481024 | 2020-05-12T23:22:54 | 2020-05-12T23:22:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 233,338 | py | # coding: utf-8
"""
DBpedia
This is the API of the DBpedia Ontology # noqa: E501
The version of the OpenAPI document: v0.0.1
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from dbpedia.configuration import Configuration
class Mayor(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
openapi_types = {
'parent': 'list[object]',
'viaf_id': 'list[str]',
'competition_title': 'list[object]',
'art_patron': 'list[object]',
'hair_colour': 'list[str]',
'tv_show': 'list[object]',
'expedition': 'list[str]',
'main_domain': 'list[object]',
'nndb_id': 'list[str]',
'discipline': 'list[object]',
'consecration': 'list[str]',
'salary': 'list[float]',
'birth_name': 'list[str]',
'spouse': 'list[object]',
'scene': 'list[str]',
'best_lap': 'list[str]',
'shoe_number': 'list[int]',
'mayor_mandate': 'list[str]',
'friend': 'list[object]',
'full_score': 'list[str]',
'diploma': 'list[object]',
'active_years_end_year_mgr': 'list[str]',
'abbeychurch_blessing': 'list[str]',
'height': 'list[object]',
'usopen_wins': 'list[object]',
'bust_size': 'list[float]',
'cloth_size': 'list[str]',
'handedness': 'list[object]',
'philosophical_school': 'list[object]',
'parliamentary_group': 'list[str]',
'date_of_burial': 'list[str]',
'mount': 'list[str]',
'olympic_games_silver': 'list[int]',
'nationality': 'list[object]',
'junior_years_start_year': 'list[str]',
'relative': 'list[object]',
'newspaper': 'list[object]',
'announced_from': 'list[object]',
'military_branch': 'list[object]',
'activity': 'list[object]',
'ethnicity': 'list[object]',
'state_of_origin': 'list[object]',
'pole_position': 'list[int]',
'season_manager': 'list[str]',
'killed_by': 'list[str]',
'blood_type': 'list[object]',
'continental_tournament': 'list[object]',
'junior_years_end_year': 'list[str]',
'political_function': 'list[str]',
'honours': 'list[object]',
'olympic_games': 'list[object]',
'hair_color': 'list[object]',
'foot': 'list[str]',
'measurements': 'list[str]',
'hand': 'list[object]',
'federation': 'list[object]',
'circumcised': 'list[str]',
'penis_length': 'list[str]',
'coemperor': 'list[object]',
'detractor': 'list[object]',
'selibr_id': 'list[str]',
'danse_competition': 'list[str]',
'sex': 'list[str]',
'sexual_orientation': 'list[object]',
'partner': 'list[object]',
'birth_year': 'list[str]',
'sports_function': 'list[str]',
'orcid_id': 'list[str]',
'election_date': 'list[str]',
'sport_discipline': 'list[object]',
'collaboration': 'list[object]',
'national_team_year': 'list[str]',
'number_of_run': 'list[int]',
'spouse_name': 'list[str]',
'lah_hof': 'list[str]',
'derived_word': 'list[str]',
'current_team_manager': 'list[object]',
'little_pool_record': 'list[str]',
'bpn_id': 'list[str]',
'free_danse_score': 'list[str]',
'project': 'list[object]',
'active_years': 'list[object]',
'title_date': 'list[str]',
'blood_group': 'list[str]',
'school': 'list[object]',
'death_place': 'list[object]',
'victory_percentage_as_mgr': 'list[float]',
'imposed_danse_competition': 'list[str]',
'shoot': 'list[str]',
'education_place': 'list[object]',
'match_point': 'list[str]',
'reign_name': 'list[str]',
'pro_period': 'list[str]',
'influenced_by': 'list[object]',
'nla_id': 'list[str]',
'cousurper': 'list[object]',
'race_wins': 'list[int]',
'world_tournament_bronze': 'list[int]',
'jutsu': 'list[str]',
'weight': 'list[object]',
'other_media': 'list[object]',
'alma_mater': 'list[object]',
'imposed_danse_score': 'list[str]',
'known_for': 'list[object]',
'big_pool_record': 'list[str]',
'olympic_games_wins': 'list[str]',
'eye_colour': 'list[str]',
'world_tournament_silver': 'list[int]',
'architectural_movement': 'list[str]',
'mood': 'list[str]',
'bibsys_id': 'list[str]',
'iihf_hof': 'list[str]',
'free_prog_score': 'list[str]',
'description': 'list[str]',
'particular_sign': 'list[str]',
'league_manager': 'list[object]',
'junior_season': 'list[object]',
'free_prog_competition': 'list[str]',
'weapon': 'list[object]',
'kind_of_criminal': 'list[str]',
'notable_idea': 'list[object]',
'player_status': 'list[str]',
'other_function': 'list[object]',
'continental_tournament_silver': 'list[int]',
'career_station': 'list[object]',
'resting_place_position': 'list[object]',
'original_danse_competition': 'list[str]',
'status_manager': 'list[str]',
'national_tournament': 'list[object]',
'hometown': 'list[object]',
'dead_in_fight_place': 'list[str]',
'continental_tournament_bronze': 'list[int]',
'victory': 'list[int]',
'complexion': 'list[object]',
'citizenship': 'list[object]',
'start': 'list[int]',
'tessitura': 'list[str]',
'start_career': 'list[str]',
'label': 'list[str]',
'birth_date': 'list[str]',
'national_tournament_silver': 'list[int]',
'other_activity': 'list[str]',
'linguistics_tradition': 'list[object]',
'national_tournament_bronze': 'list[int]',
'escalafon': 'list[str]',
'sibling': 'list[object]',
'waist_size': 'list[float]',
'olympic_games_gold': 'list[int]',
'general_council': 'list[object]',
'arrest_date': 'list[str]',
'team_manager': 'list[object]',
'birth_sign': 'list[object]',
'artistic_function': 'list[str]',
'age': 'list[int]',
'college': 'list[object]',
'education': 'list[object]',
'movie': 'list[object]',
'achievement': 'list[object]',
'death_age': 'list[int]',
'type': 'list[str]',
'approach': 'list[object]',
'relation': 'list[object]',
'victory_as_mgr': 'list[int]',
'living_place': 'list[object]',
'copilote': 'list[object]',
'season': 'list[object]',
'start_wct': 'list[str]',
'catch': 'list[str]',
'id': 'str',
'feat': 'list[str]',
'decoration': 'list[object]',
'case': 'list[str]',
'sentence': 'list[str]',
'profession': 'list[object]',
'retirement_date': 'list[str]',
'world_tournament': 'list[object]',
'wife': 'list[object]',
'allegiance': 'list[str]',
'active_years_start_date_mgr': 'list[str]',
'lccn_id': 'list[str]',
'tattoo': 'list[str]',
'british_wins': 'list[object]',
'hip_size': 'list[float]',
'podium': 'list[int]',
'seiyu': 'list[object]',
'player_season': 'list[object]',
'short_prog_score': 'list[str]',
'regional_council': 'list[object]',
'homage': 'list[str]',
'shoe_size': 'list[str]',
'signature': 'list[str]',
'olympic_games_bronze': 'list[int]',
'danse_score': 'list[str]',
'id_number': 'list[int]',
'short_prog_competition': 'list[str]',
'active_years_start_year_mgr': 'list[str]',
'wedding_parents_date': 'list[str]',
'birth_place': 'list[object]',
'world': 'list[object]',
'astrological_sign': 'list[object]',
'eye_color': 'list[object]',
'networth': 'list[float]',
'coalition': 'list[str]',
'national_team_match_point': 'list[str]',
'national_selection': 'list[object]',
'agency': 'list[object]',
'start_wqs': 'list[str]',
'defeat_as_mgr': 'list[int]',
'death_year': 'list[str]',
'world_tournament_gold': 'list[int]',
'pga_wins': 'list[object]',
'board': 'list[object]',
'rid_id': 'list[str]',
'dead_in_fight_date': 'list[str]',
'related_functions': 'list[object]',
'manager_season': 'list[object]',
'reign': 'list[str]',
'second': 'list[int]',
'radio': 'list[object]',
'full_competition': 'list[str]',
'free_score_competition': 'list[str]',
'prefect': 'list[object]',
'publication': 'list[str]',
'opponent': 'list[object]',
'employer': 'list[object]',
'affair': 'list[str]',
'body_discovered': 'list[object]',
'buried_place': 'list[object]',
'residence': 'list[object]',
'usurper': 'list[object]',
'other_occupation': 'list[object]',
'contest': 'list[object]',
'active_years_end_date_mgr': 'list[str]',
'created': 'list[object]',
'original_danse_score': 'list[str]',
'end_career': 'list[str]',
'note_on_resting_place': 'list[str]',
'army': 'list[str]',
'active_year': 'list[str]',
'person_function': 'list[object]',
'pro_since': 'list[str]',
'cause_of_death': 'list[str]',
'dubber': 'list[object]',
'non_professional_career': 'list[str]',
'military_function': 'list[str]',
'patent': 'list[object]',
'creation_christian_bishop': 'list[str]',
'piercing': 'list[str]',
'student': 'list[object]',
'bad_guy': 'list[str]',
'influenced': 'list[object]',
'start_reign': 'list[object]',
'university': 'list[object]',
'gym_apparatus': 'list[object]',
'ideology': 'list[object]',
'conviction_date': 'list[str]',
'media': 'list[object]',
'bnf_id': 'list[str]',
'pseudonym': 'list[str]',
'temple_year': 'list[str]',
'clothing_size': 'list[str]',
'speciality': 'list[str]',
'award': 'list[object]',
'kind_of_criminal_action': 'list[str]',
'isni_id': 'list[str]',
'significant_project': 'list[object]',
'leadership': 'list[str]',
'death_date': 'list[str]',
'special_trial': 'list[int]',
'resting_date': 'list[str]',
'victim': 'list[str]',
'has_natural_bust': 'list[str]',
'masters_wins': 'list[object]',
'individualised_pnd': 'list[int]',
'continental_tournament_gold': 'list[int]',
'orientation': 'list[str]',
'grave': 'list[str]',
'resting_place': 'list[object]',
'abbeychurch_blessing_charge': 'list[str]',
'handisport': 'list[str]',
'external_ornament': 'list[str]',
'third': 'list[int]',
'film_number': 'list[int]',
'temple': 'list[str]',
'end_reign': 'list[object]',
'national_tournament_gold': 'list[int]',
'death_cause': 'list[object]'
}
attribute_map = {
'parent': 'parent',
'viaf_id': 'viafId',
'competition_title': 'competitionTitle',
'art_patron': 'artPatron',
'hair_colour': 'hairColour',
'tv_show': 'tvShow',
'expedition': 'expedition',
'main_domain': 'mainDomain',
'nndb_id': 'nndbId',
'discipline': 'discipline',
'consecration': 'consecration',
'salary': 'salary',
'birth_name': 'birthName',
'spouse': 'spouse',
'scene': 'scene',
'best_lap': 'bestLap',
'shoe_number': 'shoeNumber',
'mayor_mandate': 'mayorMandate',
'friend': 'friend',
'full_score': 'fullScore',
'diploma': 'diploma',
'active_years_end_year_mgr': 'activeYearsEndYearMgr',
'abbeychurch_blessing': 'abbeychurchBlessing',
'height': 'height',
'usopen_wins': 'usopenWins',
'bust_size': 'bustSize',
'cloth_size': 'clothSize',
'handedness': 'handedness',
'philosophical_school': 'philosophicalSchool',
'parliamentary_group': 'parliamentaryGroup',
'date_of_burial': 'dateOfBurial',
'mount': 'mount',
'olympic_games_silver': 'olympicGamesSilver',
'nationality': 'nationality',
'junior_years_start_year': 'juniorYearsStartYear',
'relative': 'relative',
'newspaper': 'newspaper',
'announced_from': 'announcedFrom',
'military_branch': 'militaryBranch',
'activity': 'activity',
'ethnicity': 'ethnicity',
'state_of_origin': 'stateOfOrigin',
'pole_position': 'polePosition',
'season_manager': 'seasonManager',
'killed_by': 'killedBy',
'blood_type': 'bloodType',
'continental_tournament': 'continentalTournament',
'junior_years_end_year': 'juniorYearsEndYear',
'political_function': 'politicalFunction',
'honours': 'honours',
'olympic_games': 'olympicGames',
'hair_color': 'hairColor',
'foot': 'foot',
'measurements': 'measurements',
'hand': 'hand',
'federation': 'federation',
'circumcised': 'circumcised',
'penis_length': 'penisLength',
'coemperor': 'coemperor',
'detractor': 'detractor',
'selibr_id': 'selibrId',
'danse_competition': 'danseCompetition',
'sex': 'sex',
'sexual_orientation': 'sexualOrientation',
'partner': 'partner',
'birth_year': 'birthYear',
'sports_function': 'sportsFunction',
'orcid_id': 'orcidId',
'election_date': 'electionDate',
'sport_discipline': 'sportDiscipline',
'collaboration': 'collaboration',
'national_team_year': 'nationalTeamYear',
'number_of_run': 'numberOfRun',
'spouse_name': 'spouseName',
'lah_hof': 'lahHof',
'derived_word': 'derivedWord',
'current_team_manager': 'currentTeamManager',
'little_pool_record': 'littlePoolRecord',
'bpn_id': 'bpnId',
'free_danse_score': 'freeDanseScore',
'project': 'project',
'active_years': 'activeYears',
'title_date': 'titleDate',
'blood_group': 'bloodGroup',
'school': 'school',
'death_place': 'deathPlace',
'victory_percentage_as_mgr': 'victoryPercentageAsMgr',
'imposed_danse_competition': 'imposedDanseCompetition',
'shoot': 'shoot',
'education_place': 'educationPlace',
'match_point': 'matchPoint',
'reign_name': 'reignName',
'pro_period': 'proPeriod',
'influenced_by': 'influencedBy',
'nla_id': 'nlaId',
'cousurper': 'cousurper',
'race_wins': 'raceWins',
'world_tournament_bronze': 'worldTournamentBronze',
'jutsu': 'jutsu',
'weight': 'weight',
'other_media': 'otherMedia',
'alma_mater': 'almaMater',
'imposed_danse_score': 'imposedDanseScore',
'known_for': 'knownFor',
'big_pool_record': 'bigPoolRecord',
'olympic_games_wins': 'olympicGamesWins',
'eye_colour': 'eyeColour',
'world_tournament_silver': 'worldTournamentSilver',
'architectural_movement': 'architecturalMovement',
'mood': 'mood',
'bibsys_id': 'bibsysId',
'iihf_hof': 'iihfHof',
'free_prog_score': 'freeProgScore',
'description': 'description',
'particular_sign': 'particularSign',
'league_manager': 'leagueManager',
'junior_season': 'juniorSeason',
'free_prog_competition': 'freeProgCompetition',
'weapon': 'weapon',
'kind_of_criminal': 'kindOfCriminal',
'notable_idea': 'notableIdea',
'player_status': 'playerStatus',
'other_function': 'otherFunction',
'continental_tournament_silver': 'continentalTournamentSilver',
'career_station': 'careerStation',
'resting_place_position': 'restingPlacePosition',
'original_danse_competition': 'originalDanseCompetition',
'status_manager': 'statusManager',
'national_tournament': 'nationalTournament',
'hometown': 'hometown',
'dead_in_fight_place': 'deadInFightPlace',
'continental_tournament_bronze': 'continentalTournamentBronze',
'victory': 'victory',
'complexion': 'complexion',
'citizenship': 'citizenship',
'start': 'start',
'tessitura': 'tessitura',
'start_career': 'startCareer',
'label': 'label',
'birth_date': 'birthDate',
'national_tournament_silver': 'nationalTournamentSilver',
'other_activity': 'otherActivity',
'linguistics_tradition': 'linguisticsTradition',
'national_tournament_bronze': 'nationalTournamentBronze',
'escalafon': 'escalafon',
'sibling': 'sibling',
'waist_size': 'waistSize',
'olympic_games_gold': 'olympicGamesGold',
'general_council': 'generalCouncil',
'arrest_date': 'arrestDate',
'team_manager': 'teamManager',
'birth_sign': 'birthSign',
'artistic_function': 'artisticFunction',
'age': 'age',
'college': 'college',
'education': 'education',
'movie': 'movie',
'achievement': 'achievement',
'death_age': 'deathAge',
'type': 'type',
'approach': 'approach',
'relation': 'relation',
'victory_as_mgr': 'victoryAsMgr',
'living_place': 'livingPlace',
'copilote': 'copilote',
'season': 'season',
'start_wct': 'startWct',
'catch': 'catch',
'id': 'id',
'feat': 'feat',
'decoration': 'decoration',
'case': 'case',
'sentence': 'sentence',
'profession': 'profession',
'retirement_date': 'retirementDate',
'world_tournament': 'worldTournament',
'wife': 'wife',
'allegiance': 'allegiance',
'active_years_start_date_mgr': 'activeYearsStartDateMgr',
'lccn_id': 'lccnId',
'tattoo': 'tattoo',
'british_wins': 'britishWins',
'hip_size': 'hipSize',
'podium': 'podium',
'seiyu': 'seiyu',
'player_season': 'playerSeason',
'short_prog_score': 'shortProgScore',
'regional_council': 'regionalCouncil',
'homage': 'homage',
'shoe_size': 'shoeSize',
'signature': 'signature',
'olympic_games_bronze': 'olympicGamesBronze',
'danse_score': 'danseScore',
'id_number': 'idNumber',
'short_prog_competition': 'shortProgCompetition',
'active_years_start_year_mgr': 'activeYearsStartYearMgr',
'wedding_parents_date': 'weddingParentsDate',
'birth_place': 'birthPlace',
'world': 'world',
'astrological_sign': 'astrologicalSign',
'eye_color': 'eyeColor',
'networth': 'networth',
'coalition': 'coalition',
'national_team_match_point': 'nationalTeamMatchPoint',
'national_selection': 'nationalSelection',
'agency': 'agency',
'start_wqs': 'startWqs',
'defeat_as_mgr': 'defeatAsMgr',
'death_year': 'deathYear',
'world_tournament_gold': 'worldTournamentGold',
'pga_wins': 'pgaWins',
'board': 'board',
'rid_id': 'ridId',
'dead_in_fight_date': 'deadInFightDate',
'related_functions': 'relatedFunctions',
'manager_season': 'managerSeason',
'reign': 'reign',
'second': 'second',
'radio': 'radio',
'full_competition': 'fullCompetition',
'free_score_competition': 'freeScoreCompetition',
'prefect': 'prefect',
'publication': 'publication',
'opponent': 'opponent',
'employer': 'employer',
'affair': 'affair',
'body_discovered': 'bodyDiscovered',
'buried_place': 'buriedPlace',
'residence': 'residence',
'usurper': 'usurper',
'other_occupation': 'otherOccupation',
'contest': 'contest',
'active_years_end_date_mgr': 'activeYearsEndDateMgr',
'created': 'created',
'original_danse_score': 'originalDanseScore',
'end_career': 'endCareer',
'note_on_resting_place': 'noteOnRestingPlace',
'army': 'army',
'active_year': 'activeYear',
'person_function': 'personFunction',
'pro_since': 'proSince',
'cause_of_death': 'causeOfDeath',
'dubber': 'dubber',
'non_professional_career': 'nonProfessionalCareer',
'military_function': 'militaryFunction',
'patent': 'patent',
'creation_christian_bishop': 'creationChristianBishop',
'piercing': 'piercing',
'student': 'student',
'bad_guy': 'badGuy',
'influenced': 'influenced',
'start_reign': 'startReign',
'university': 'university',
'gym_apparatus': 'gymApparatus',
'ideology': 'ideology',
'conviction_date': 'convictionDate',
'media': 'media',
'bnf_id': 'bnfId',
'pseudonym': 'pseudonym',
'temple_year': 'templeYear',
'clothing_size': 'clothingSize',
'speciality': 'speciality',
'award': 'award',
'kind_of_criminal_action': 'kindOfCriminalAction',
'isni_id': 'isniId',
'significant_project': 'significantProject',
'leadership': 'leadership',
'death_date': 'deathDate',
'special_trial': 'specialTrial',
'resting_date': 'restingDate',
'victim': 'victim',
'has_natural_bust': 'hasNaturalBust',
'masters_wins': 'mastersWins',
'individualised_pnd': 'individualisedPnd',
'continental_tournament_gold': 'continentalTournamentGold',
'orientation': 'orientation',
'grave': 'grave',
'resting_place': 'restingPlace',
'abbeychurch_blessing_charge': 'abbeychurchBlessingCharge',
'handisport': 'handisport',
'external_ornament': 'externalOrnament',
'third': 'third',
'film_number': 'filmNumber',
'temple': 'temple',
'end_reign': 'endReign',
'national_tournament_gold': 'nationalTournamentGold',
'death_cause': 'deathCause'
}
def __init__(self, parent=None, viaf_id=None, competition_title=None, art_patron=None, hair_colour=None, tv_show=None, expedition=None, main_domain=None, nndb_id=None, discipline=None, consecration=None, salary=None, birth_name=None, spouse=None, scene=None, best_lap=None, shoe_number=None, mayor_mandate=None, friend=None, full_score=None, diploma=None, active_years_end_year_mgr=None, abbeychurch_blessing=None, height=None, usopen_wins=None, bust_size=None, cloth_size=None, handedness=None, philosophical_school=None, parliamentary_group=None, date_of_burial=None, mount=None, olympic_games_silver=None, nationality=None, junior_years_start_year=None, relative=None, newspaper=None, announced_from=None, military_branch=None, activity=None, ethnicity=None, state_of_origin=None, pole_position=None, season_manager=None, killed_by=None, blood_type=None, continental_tournament=None, junior_years_end_year=None, political_function=None, honours=None, olympic_games=None, hair_color=None, foot=None, measurements=None, hand=None, federation=None, circumcised=None, penis_length=None, coemperor=None, detractor=None, selibr_id=None, danse_competition=None, sex=None, sexual_orientation=None, partner=None, birth_year=None, sports_function=None, orcid_id=None, election_date=None, sport_discipline=None, collaboration=None, national_team_year=None, number_of_run=None, spouse_name=None, lah_hof=None, derived_word=None, current_team_manager=None, little_pool_record=None, bpn_id=None, free_danse_score=None, project=None, active_years=None, title_date=None, blood_group=None, school=None, death_place=None, victory_percentage_as_mgr=None, imposed_danse_competition=None, shoot=None, education_place=None, match_point=None, reign_name=None, pro_period=None, influenced_by=None, nla_id=None, cousurper=None, race_wins=None, world_tournament_bronze=None, jutsu=None, weight=None, other_media=None, alma_mater=None, imposed_danse_score=None, known_for=None, big_pool_record=None, olympic_games_wins=None, eye_colour=None, world_tournament_silver=None, architectural_movement=None, mood=None, bibsys_id=None, iihf_hof=None, free_prog_score=None, description=None, particular_sign=None, league_manager=None, junior_season=None, free_prog_competition=None, weapon=None, kind_of_criminal=None, notable_idea=None, player_status=None, other_function=None, continental_tournament_silver=None, career_station=None, resting_place_position=None, original_danse_competition=None, status_manager=None, national_tournament=None, hometown=None, dead_in_fight_place=None, continental_tournament_bronze=None, victory=None, complexion=None, citizenship=None, start=None, tessitura=None, start_career=None, label=None, birth_date=None, national_tournament_silver=None, other_activity=None, linguistics_tradition=None, national_tournament_bronze=None, escalafon=None, sibling=None, waist_size=None, olympic_games_gold=None, general_council=None, arrest_date=None, team_manager=None, birth_sign=None, artistic_function=None, age=None, college=None, education=None, movie=None, achievement=None, death_age=None, type=None, approach=None, relation=None, victory_as_mgr=None, living_place=None, copilote=None, season=None, start_wct=None, catch=None, id=None, feat=None, decoration=None, case=None, sentence=None, profession=None, retirement_date=None, world_tournament=None, wife=None, allegiance=None, active_years_start_date_mgr=None, lccn_id=None, tattoo=None, british_wins=None, hip_size=None, podium=None, seiyu=None, player_season=None, short_prog_score=None, regional_council=None, homage=None, shoe_size=None, signature=None, olympic_games_bronze=None, danse_score=None, id_number=None, short_prog_competition=None, active_years_start_year_mgr=None, wedding_parents_date=None, birth_place=None, world=None, astrological_sign=None, eye_color=None, networth=None, coalition=None, national_team_match_point=None, national_selection=None, agency=None, start_wqs=None, defeat_as_mgr=None, death_year=None, world_tournament_gold=None, pga_wins=None, board=None, rid_id=None, dead_in_fight_date=None, related_functions=None, manager_season=None, reign=None, second=None, radio=None, full_competition=None, free_score_competition=None, prefect=None, publication=None, opponent=None, employer=None, affair=None, body_discovered=None, buried_place=None, residence=None, usurper=None, other_occupation=None, contest=None, active_years_end_date_mgr=None, created=None, original_danse_score=None, end_career=None, note_on_resting_place=None, army=None, active_year=None, person_function=None, pro_since=None, cause_of_death=None, dubber=None, non_professional_career=None, military_function=None, patent=None, creation_christian_bishop=None, piercing=None, student=None, bad_guy=None, influenced=None, start_reign=None, university=None, gym_apparatus=None, ideology=None, conviction_date=None, media=None, bnf_id=None, pseudonym=None, temple_year=None, clothing_size=None, speciality=None, award=None, kind_of_criminal_action=None, isni_id=None, significant_project=None, leadership=None, death_date=None, special_trial=None, resting_date=None, victim=None, has_natural_bust=None, masters_wins=None, individualised_pnd=None, continental_tournament_gold=None, orientation=None, grave=None, resting_place=None, abbeychurch_blessing_charge=None, handisport=None, external_ornament=None, third=None, film_number=None, temple=None, end_reign=None, national_tournament_gold=None, death_cause=None, local_vars_configuration=None): # noqa: E501
"""Mayor - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration
self._parent = None
self._viaf_id = None
self._competition_title = None
self._art_patron = None
self._hair_colour = None
self._tv_show = None
self._expedition = None
self._main_domain = None
self._nndb_id = None
self._discipline = None
self._consecration = None
self._salary = None
self._birth_name = None
self._spouse = None
self._scene = None
self._best_lap = None
self._shoe_number = None
self._mayor_mandate = None
self._friend = None
self._full_score = None
self._diploma = None
self._active_years_end_year_mgr = None
self._abbeychurch_blessing = None
self._height = None
self._usopen_wins = None
self._bust_size = None
self._cloth_size = None
self._handedness = None
self._philosophical_school = None
self._parliamentary_group = None
self._date_of_burial = None
self._mount = None
self._olympic_games_silver = None
self._nationality = None
self._junior_years_start_year = None
self._relative = None
self._newspaper = None
self._announced_from = None
self._military_branch = None
self._activity = None
self._ethnicity = None
self._state_of_origin = None
self._pole_position = None
self._season_manager = None
self._killed_by = None
self._blood_type = None
self._continental_tournament = None
self._junior_years_end_year = None
self._political_function = None
self._honours = None
self._olympic_games = None
self._hair_color = None
self._foot = None
self._measurements = None
self._hand = None
self._federation = None
self._circumcised = None
self._penis_length = None
self._coemperor = None
self._detractor = None
self._selibr_id = None
self._danse_competition = None
self._sex = None
self._sexual_orientation = None
self._partner = None
self._birth_year = None
self._sports_function = None
self._orcid_id = None
self._election_date = None
self._sport_discipline = None
self._collaboration = None
self._national_team_year = None
self._number_of_run = None
self._spouse_name = None
self._lah_hof = None
self._derived_word = None
self._current_team_manager = None
self._little_pool_record = None
self._bpn_id = None
self._free_danse_score = None
self._project = None
self._active_years = None
self._title_date = None
self._blood_group = None
self._school = None
self._death_place = None
self._victory_percentage_as_mgr = None
self._imposed_danse_competition = None
self._shoot = None
self._education_place = None
self._match_point = None
self._reign_name = None
self._pro_period = None
self._influenced_by = None
self._nla_id = None
self._cousurper = None
self._race_wins = None
self._world_tournament_bronze = None
self._jutsu = None
self._weight = None
self._other_media = None
self._alma_mater = None
self._imposed_danse_score = None
self._known_for = None
self._big_pool_record = None
self._olympic_games_wins = None
self._eye_colour = None
self._world_tournament_silver = None
self._architectural_movement = None
self._mood = None
self._bibsys_id = None
self._iihf_hof = None
self._free_prog_score = None
self._description = None
self._particular_sign = None
self._league_manager = None
self._junior_season = None
self._free_prog_competition = None
self._weapon = None
self._kind_of_criminal = None
self._notable_idea = None
self._player_status = None
self._other_function = None
self._continental_tournament_silver = None
self._career_station = None
self._resting_place_position = None
self._original_danse_competition = None
self._status_manager = None
self._national_tournament = None
self._hometown = None
self._dead_in_fight_place = None
self._continental_tournament_bronze = None
self._victory = None
self._complexion = None
self._citizenship = None
self._start = None
self._tessitura = None
self._start_career = None
self._label = None
self._birth_date = None
self._national_tournament_silver = None
self._other_activity = None
self._linguistics_tradition = None
self._national_tournament_bronze = None
self._escalafon = None
self._sibling = None
self._waist_size = None
self._olympic_games_gold = None
self._general_council = None
self._arrest_date = None
self._team_manager = None
self._birth_sign = None
self._artistic_function = None
self._age = None
self._college = None
self._education = None
self._movie = None
self._achievement = None
self._death_age = None
self._type = None
self._approach = None
self._relation = None
self._victory_as_mgr = None
self._living_place = None
self._copilote = None
self._season = None
self._start_wct = None
self._catch = None
self._id = None
self._feat = None
self._decoration = None
self._case = None
self._sentence = None
self._profession = None
self._retirement_date = None
self._world_tournament = None
self._wife = None
self._allegiance = None
self._active_years_start_date_mgr = None
self._lccn_id = None
self._tattoo = None
self._british_wins = None
self._hip_size = None
self._podium = None
self._seiyu = None
self._player_season = None
self._short_prog_score = None
self._regional_council = None
self._homage = None
self._shoe_size = None
self._signature = None
self._olympic_games_bronze = None
self._danse_score = None
self._id_number = None
self._short_prog_competition = None
self._active_years_start_year_mgr = None
self._wedding_parents_date = None
self._birth_place = None
self._world = None
self._astrological_sign = None
self._eye_color = None
self._networth = None
self._coalition = None
self._national_team_match_point = None
self._national_selection = None
self._agency = None
self._start_wqs = None
self._defeat_as_mgr = None
self._death_year = None
self._world_tournament_gold = None
self._pga_wins = None
self._board = None
self._rid_id = None
self._dead_in_fight_date = None
self._related_functions = None
self._manager_season = None
self._reign = None
self._second = None
self._radio = None
self._full_competition = None
self._free_score_competition = None
self._prefect = None
self._publication = None
self._opponent = None
self._employer = None
self._affair = None
self._body_discovered = None
self._buried_place = None
self._residence = None
self._usurper = None
self._other_occupation = None
self._contest = None
self._active_years_end_date_mgr = None
self._created = None
self._original_danse_score = None
self._end_career = None
self._note_on_resting_place = None
self._army = None
self._active_year = None
self._person_function = None
self._pro_since = None
self._cause_of_death = None
self._dubber = None
self._non_professional_career = None
self._military_function = None
self._patent = None
self._creation_christian_bishop = None
self._piercing = None
self._student = None
self._bad_guy = None
self._influenced = None
self._start_reign = None
self._university = None
self._gym_apparatus = None
self._ideology = None
self._conviction_date = None
self._media = None
self._bnf_id = None
self._pseudonym = None
self._temple_year = None
self._clothing_size = None
self._speciality = None
self._award = None
self._kind_of_criminal_action = None
self._isni_id = None
self._significant_project = None
self._leadership = None
self._death_date = None
self._special_trial = None
self._resting_date = None
self._victim = None
self._has_natural_bust = None
self._masters_wins = None
self._individualised_pnd = None
self._continental_tournament_gold = None
self._orientation = None
self._grave = None
self._resting_place = None
self._abbeychurch_blessing_charge = None
self._handisport = None
self._external_ornament = None
self._third = None
self._film_number = None
self._temple = None
self._end_reign = None
self._national_tournament_gold = None
self._death_cause = None
self.discriminator = None
self.parent = parent
self.viaf_id = viaf_id
self.competition_title = competition_title
self.art_patron = art_patron
self.hair_colour = hair_colour
self.tv_show = tv_show
self.expedition = expedition
self.main_domain = main_domain
self.nndb_id = nndb_id
self.discipline = discipline
self.consecration = consecration
self.salary = salary
self.birth_name = birth_name
self.spouse = spouse
self.scene = scene
self.best_lap = best_lap
self.shoe_number = shoe_number
self.mayor_mandate = mayor_mandate
self.friend = friend
self.full_score = full_score
self.diploma = diploma
self.active_years_end_year_mgr = active_years_end_year_mgr
self.abbeychurch_blessing = abbeychurch_blessing
self.height = height
self.usopen_wins = usopen_wins
self.bust_size = bust_size
self.cloth_size = cloth_size
self.handedness = handedness
self.philosophical_school = philosophical_school
self.parliamentary_group = parliamentary_group
self.date_of_burial = date_of_burial
self.mount = mount
self.olympic_games_silver = olympic_games_silver
self.nationality = nationality
self.junior_years_start_year = junior_years_start_year
self.relative = relative
self.newspaper = newspaper
self.announced_from = announced_from
self.military_branch = military_branch
self.activity = activity
self.ethnicity = ethnicity
self.state_of_origin = state_of_origin
self.pole_position = pole_position
self.season_manager = season_manager
self.killed_by = killed_by
self.blood_type = blood_type
self.continental_tournament = continental_tournament
self.junior_years_end_year = junior_years_end_year
self.political_function = political_function
self.honours = honours
self.olympic_games = olympic_games
self.hair_color = hair_color
self.foot = foot
self.measurements = measurements
self.hand = hand
self.federation = federation
self.circumcised = circumcised
self.penis_length = penis_length
self.coemperor = coemperor
self.detractor = detractor
self.selibr_id = selibr_id
self.danse_competition = danse_competition
self.sex = sex
self.sexual_orientation = sexual_orientation
self.partner = partner
self.birth_year = birth_year
self.sports_function = sports_function
self.orcid_id = orcid_id
self.election_date = election_date
self.sport_discipline = sport_discipline
self.collaboration = collaboration
self.national_team_year = national_team_year
self.number_of_run = number_of_run
self.spouse_name = spouse_name
self.lah_hof = lah_hof
self.derived_word = derived_word
self.current_team_manager = current_team_manager
self.little_pool_record = little_pool_record
self.bpn_id = bpn_id
self.free_danse_score = free_danse_score
self.project = project
self.active_years = active_years
self.title_date = title_date
self.blood_group = blood_group
self.school = school
self.death_place = death_place
self.victory_percentage_as_mgr = victory_percentage_as_mgr
self.imposed_danse_competition = imposed_danse_competition
self.shoot = shoot
self.education_place = education_place
self.match_point = match_point
self.reign_name = reign_name
self.pro_period = pro_period
self.influenced_by = influenced_by
self.nla_id = nla_id
self.cousurper = cousurper
self.race_wins = race_wins
self.world_tournament_bronze = world_tournament_bronze
self.jutsu = jutsu
self.weight = weight
self.other_media = other_media
self.alma_mater = alma_mater
self.imposed_danse_score = imposed_danse_score
self.known_for = known_for
self.big_pool_record = big_pool_record
self.olympic_games_wins = olympic_games_wins
self.eye_colour = eye_colour
self.world_tournament_silver = world_tournament_silver
self.architectural_movement = architectural_movement
self.mood = mood
self.bibsys_id = bibsys_id
self.iihf_hof = iihf_hof
self.free_prog_score = free_prog_score
self.description = description
self.particular_sign = particular_sign
self.league_manager = league_manager
self.junior_season = junior_season
self.free_prog_competition = free_prog_competition
self.weapon = weapon
self.kind_of_criminal = kind_of_criminal
self.notable_idea = notable_idea
self.player_status = player_status
self.other_function = other_function
self.continental_tournament_silver = continental_tournament_silver
self.career_station = career_station
self.resting_place_position = resting_place_position
self.original_danse_competition = original_danse_competition
self.status_manager = status_manager
self.national_tournament = national_tournament
self.hometown = hometown
self.dead_in_fight_place = dead_in_fight_place
self.continental_tournament_bronze = continental_tournament_bronze
self.victory = victory
self.complexion = complexion
self.citizenship = citizenship
self.start = start
self.tessitura = tessitura
self.start_career = start_career
self.label = label
self.birth_date = birth_date
self.national_tournament_silver = national_tournament_silver
self.other_activity = other_activity
self.linguistics_tradition = linguistics_tradition
self.national_tournament_bronze = national_tournament_bronze
self.escalafon = escalafon
self.sibling = sibling
self.waist_size = waist_size
self.olympic_games_gold = olympic_games_gold
self.general_council = general_council
self.arrest_date = arrest_date
self.team_manager = team_manager
self.birth_sign = birth_sign
self.artistic_function = artistic_function
self.age = age
self.college = college
self.education = education
self.movie = movie
self.achievement = achievement
self.death_age = death_age
self.type = type
self.approach = approach
self.relation = relation
self.victory_as_mgr = victory_as_mgr
self.living_place = living_place
self.copilote = copilote
self.season = season
self.start_wct = start_wct
self.catch = catch
if id is not None:
self.id = id
self.feat = feat
self.decoration = decoration
self.case = case
self.sentence = sentence
self.profession = profession
self.retirement_date = retirement_date
self.world_tournament = world_tournament
self.wife = wife
self.allegiance = allegiance
self.active_years_start_date_mgr = active_years_start_date_mgr
self.lccn_id = lccn_id
self.tattoo = tattoo
self.british_wins = british_wins
self.hip_size = hip_size
self.podium = podium
self.seiyu = seiyu
self.player_season = player_season
self.short_prog_score = short_prog_score
self.regional_council = regional_council
self.homage = homage
self.shoe_size = shoe_size
self.signature = signature
self.olympic_games_bronze = olympic_games_bronze
self.danse_score = danse_score
self.id_number = id_number
self.short_prog_competition = short_prog_competition
self.active_years_start_year_mgr = active_years_start_year_mgr
self.wedding_parents_date = wedding_parents_date
self.birth_place = birth_place
self.world = world
self.astrological_sign = astrological_sign
self.eye_color = eye_color
self.networth = networth
self.coalition = coalition
self.national_team_match_point = national_team_match_point
self.national_selection = national_selection
self.agency = agency
self.start_wqs = start_wqs
self.defeat_as_mgr = defeat_as_mgr
self.death_year = death_year
self.world_tournament_gold = world_tournament_gold
self.pga_wins = pga_wins
self.board = board
self.rid_id = rid_id
self.dead_in_fight_date = dead_in_fight_date
self.related_functions = related_functions
self.manager_season = manager_season
self.reign = reign
self.second = second
self.radio = radio
self.full_competition = full_competition
self.free_score_competition = free_score_competition
self.prefect = prefect
self.publication = publication
self.opponent = opponent
self.employer = employer
self.affair = affair
self.body_discovered = body_discovered
self.buried_place = buried_place
self.residence = residence
self.usurper = usurper
self.other_occupation = other_occupation
self.contest = contest
self.active_years_end_date_mgr = active_years_end_date_mgr
self.created = created
self.original_danse_score = original_danse_score
self.end_career = end_career
self.note_on_resting_place = note_on_resting_place
self.army = army
self.active_year = active_year
self.person_function = person_function
self.pro_since = pro_since
self.cause_of_death = cause_of_death
self.dubber = dubber
self.non_professional_career = non_professional_career
self.military_function = military_function
self.patent = patent
self.creation_christian_bishop = creation_christian_bishop
self.piercing = piercing
self.student = student
self.bad_guy = bad_guy
self.influenced = influenced
self.start_reign = start_reign
self.university = university
self.gym_apparatus = gym_apparatus
self.ideology = ideology
self.conviction_date = conviction_date
self.media = media
self.bnf_id = bnf_id
self.pseudonym = pseudonym
self.temple_year = temple_year
self.clothing_size = clothing_size
self.speciality = speciality
self.award = award
self.kind_of_criminal_action = kind_of_criminal_action
self.isni_id = isni_id
self.significant_project = significant_project
self.leadership = leadership
self.death_date = death_date
self.special_trial = special_trial
self.resting_date = resting_date
self.victim = victim
self.has_natural_bust = has_natural_bust
self.masters_wins = masters_wins
self.individualised_pnd = individualised_pnd
self.continental_tournament_gold = continental_tournament_gold
self.orientation = orientation
self.grave = grave
self.resting_place = resting_place
self.abbeychurch_blessing_charge = abbeychurch_blessing_charge
self.handisport = handisport
self.external_ornament = external_ornament
self.third = third
self.film_number = film_number
self.temple = temple
self.end_reign = end_reign
self.national_tournament_gold = national_tournament_gold
self.death_cause = death_cause
@property
def parent(self):
"""Gets the parent of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The parent of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._parent
@parent.setter
def parent(self, parent):
"""Sets the parent of this Mayor.
Description not available # noqa: E501
:param parent: The parent of this Mayor. # noqa: E501
:type: list[object]
"""
self._parent = parent
@property
def viaf_id(self):
"""Gets the viaf_id of this Mayor. # noqa: E501
International authority data from the Online Computer Library Center (OCLC) # noqa: E501
:return: The viaf_id of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._viaf_id
@viaf_id.setter
def viaf_id(self, viaf_id):
"""Sets the viaf_id of this Mayor.
International authority data from the Online Computer Library Center (OCLC) # noqa: E501
:param viaf_id: The viaf_id of this Mayor. # noqa: E501
:type: list[str]
"""
self._viaf_id = viaf_id
@property
def competition_title(self):
"""Gets the competition_title of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The competition_title of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._competition_title
@competition_title.setter
def competition_title(self, competition_title):
"""Sets the competition_title of this Mayor.
Description not available # noqa: E501
:param competition_title: The competition_title of this Mayor. # noqa: E501
:type: list[object]
"""
self._competition_title = competition_title
@property
def art_patron(self):
"""Gets the art_patron of this Mayor. # noqa: E501
An influential, wealthy person who supported an artist, craftsman, a scholar or a noble.. See also # noqa: E501
:return: The art_patron of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._art_patron
@art_patron.setter
def art_patron(self, art_patron):
"""Sets the art_patron of this Mayor.
An influential, wealthy person who supported an artist, craftsman, a scholar or a noble.. See also # noqa: E501
:param art_patron: The art_patron of this Mayor. # noqa: E501
:type: list[object]
"""
self._art_patron = art_patron
@property
def hair_colour(self):
"""Gets the hair_colour of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The hair_colour of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._hair_colour
@hair_colour.setter
def hair_colour(self, hair_colour):
"""Sets the hair_colour of this Mayor.
Description not available # noqa: E501
:param hair_colour: The hair_colour of this Mayor. # noqa: E501
:type: list[str]
"""
self._hair_colour = hair_colour
@property
def tv_show(self):
"""Gets the tv_show of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The tv_show of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._tv_show
@tv_show.setter
def tv_show(self, tv_show):
"""Sets the tv_show of this Mayor.
Description not available # noqa: E501
:param tv_show: The tv_show of this Mayor. # noqa: E501
:type: list[object]
"""
self._tv_show = tv_show
@property
def expedition(self):
"""Gets the expedition of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The expedition of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._expedition
@expedition.setter
def expedition(self, expedition):
"""Sets the expedition of this Mayor.
Description not available # noqa: E501
:param expedition: The expedition of this Mayor. # noqa: E501
:type: list[str]
"""
self._expedition = expedition
@property
def main_domain(self):
"""Gets the main_domain of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The main_domain of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._main_domain
@main_domain.setter
def main_domain(self, main_domain):
"""Sets the main_domain of this Mayor.
Description not available # noqa: E501
:param main_domain: The main_domain of this Mayor. # noqa: E501
:type: list[object]
"""
self._main_domain = main_domain
@property
def nndb_id(self):
"""Gets the nndb_id of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The nndb_id of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._nndb_id
@nndb_id.setter
def nndb_id(self, nndb_id):
"""Sets the nndb_id of this Mayor.
Description not available # noqa: E501
:param nndb_id: The nndb_id of this Mayor. # noqa: E501
:type: list[str]
"""
self._nndb_id = nndb_id
@property
def discipline(self):
"""Gets the discipline of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The discipline of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._discipline
@discipline.setter
def discipline(self, discipline):
"""Sets the discipline of this Mayor.
Description not available # noqa: E501
:param discipline: The discipline of this Mayor. # noqa: E501
:type: list[object]
"""
self._discipline = discipline
@property
def consecration(self):
"""Gets the consecration of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The consecration of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._consecration
@consecration.setter
def consecration(self, consecration):
"""Sets the consecration of this Mayor.
Description not available # noqa: E501
:param consecration: The consecration of this Mayor. # noqa: E501
:type: list[str]
"""
self._consecration = consecration
@property
def salary(self):
"""Gets the salary of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The salary of this Mayor. # noqa: E501
:rtype: list[float]
"""
return self._salary
@salary.setter
def salary(self, salary):
"""Sets the salary of this Mayor.
Description not available # noqa: E501
:param salary: The salary of this Mayor. # noqa: E501
:type: list[float]
"""
self._salary = salary
@property
def birth_name(self):
"""Gets the birth_name of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The birth_name of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._birth_name
@birth_name.setter
def birth_name(self, birth_name):
"""Sets the birth_name of this Mayor.
Description not available # noqa: E501
:param birth_name: The birth_name of this Mayor. # noqa: E501
:type: list[str]
"""
self._birth_name = birth_name
@property
def spouse(self):
"""Gets the spouse of this Mayor. # noqa: E501
the person they are married to # noqa: E501
:return: The spouse of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._spouse
@spouse.setter
def spouse(self, spouse):
"""Sets the spouse of this Mayor.
the person they are married to # noqa: E501
:param spouse: The spouse of this Mayor. # noqa: E501
:type: list[object]
"""
self._spouse = spouse
@property
def scene(self):
"""Gets the scene of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The scene of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._scene
@scene.setter
def scene(self, scene):
"""Sets the scene of this Mayor.
Description not available # noqa: E501
:param scene: The scene of this Mayor. # noqa: E501
:type: list[str]
"""
self._scene = scene
@property
def best_lap(self):
"""Gets the best_lap of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The best_lap of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._best_lap
@best_lap.setter
def best_lap(self, best_lap):
"""Sets the best_lap of this Mayor.
Description not available # noqa: E501
:param best_lap: The best_lap of this Mayor. # noqa: E501
:type: list[str]
"""
self._best_lap = best_lap
@property
def shoe_number(self):
"""Gets the shoe_number of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The shoe_number of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._shoe_number
@shoe_number.setter
def shoe_number(self, shoe_number):
"""Sets the shoe_number of this Mayor.
Description not available # noqa: E501
:param shoe_number: The shoe_number of this Mayor. # noqa: E501
:type: list[int]
"""
self._shoe_number = shoe_number
@property
def mayor_mandate(self):
"""Gets the mayor_mandate of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The mayor_mandate of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._mayor_mandate
@mayor_mandate.setter
def mayor_mandate(self, mayor_mandate):
"""Sets the mayor_mandate of this Mayor.
Description not available # noqa: E501
:param mayor_mandate: The mayor_mandate of this Mayor. # noqa: E501
:type: list[str]
"""
self._mayor_mandate = mayor_mandate
@property
def friend(self):
"""Gets the friend of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The friend of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._friend
@friend.setter
def friend(self, friend):
"""Sets the friend of this Mayor.
Description not available # noqa: E501
:param friend: The friend of this Mayor. # noqa: E501
:type: list[object]
"""
self._friend = friend
@property
def full_score(self):
"""Gets the full_score of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The full_score of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._full_score
@full_score.setter
def full_score(self, full_score):
"""Sets the full_score of this Mayor.
Description not available # noqa: E501
:param full_score: The full_score of this Mayor. # noqa: E501
:type: list[str]
"""
self._full_score = full_score
@property
def diploma(self):
"""Gets the diploma of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The diploma of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._diploma
@diploma.setter
def diploma(self, diploma):
"""Sets the diploma of this Mayor.
Description not available # noqa: E501
:param diploma: The diploma of this Mayor. # noqa: E501
:type: list[object]
"""
self._diploma = diploma
@property
def active_years_end_year_mgr(self):
"""Gets the active_years_end_year_mgr of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The active_years_end_year_mgr of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._active_years_end_year_mgr
@active_years_end_year_mgr.setter
def active_years_end_year_mgr(self, active_years_end_year_mgr):
"""Sets the active_years_end_year_mgr of this Mayor.
Description not available # noqa: E501
:param active_years_end_year_mgr: The active_years_end_year_mgr of this Mayor. # noqa: E501
:type: list[str]
"""
self._active_years_end_year_mgr = active_years_end_year_mgr
@property
def abbeychurch_blessing(self):
"""Gets the abbeychurch_blessing of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The abbeychurch_blessing of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._abbeychurch_blessing
@abbeychurch_blessing.setter
def abbeychurch_blessing(self, abbeychurch_blessing):
"""Sets the abbeychurch_blessing of this Mayor.
Description not available # noqa: E501
:param abbeychurch_blessing: The abbeychurch_blessing of this Mayor. # noqa: E501
:type: list[str]
"""
self._abbeychurch_blessing = abbeychurch_blessing
@property
def height(self):
"""Gets the height of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The height of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._height
@height.setter
def height(self, height):
"""Sets the height of this Mayor.
Description not available # noqa: E501
:param height: The height of this Mayor. # noqa: E501
:type: list[object]
"""
self._height = height
@property
def usopen_wins(self):
"""Gets the usopen_wins of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The usopen_wins of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._usopen_wins
@usopen_wins.setter
def usopen_wins(self, usopen_wins):
"""Sets the usopen_wins of this Mayor.
Description not available # noqa: E501
:param usopen_wins: The usopen_wins of this Mayor. # noqa: E501
:type: list[object]
"""
self._usopen_wins = usopen_wins
@property
def bust_size(self):
"""Gets the bust_size of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The bust_size of this Mayor. # noqa: E501
:rtype: list[float]
"""
return self._bust_size
@bust_size.setter
def bust_size(self, bust_size):
"""Sets the bust_size of this Mayor.
Description not available # noqa: E501
:param bust_size: The bust_size of this Mayor. # noqa: E501
:type: list[float]
"""
self._bust_size = bust_size
@property
def cloth_size(self):
"""Gets the cloth_size of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The cloth_size of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._cloth_size
@cloth_size.setter
def cloth_size(self, cloth_size):
"""Sets the cloth_size of this Mayor.
Description not available # noqa: E501
:param cloth_size: The cloth_size of this Mayor. # noqa: E501
:type: list[str]
"""
self._cloth_size = cloth_size
@property
def handedness(self):
"""Gets the handedness of this Mayor. # noqa: E501
an attribute of humans defined by their unequal distribution of fine motor skill between the left and right hands. # noqa: E501
:return: The handedness of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._handedness
@handedness.setter
def handedness(self, handedness):
"""Sets the handedness of this Mayor.
an attribute of humans defined by their unequal distribution of fine motor skill between the left and right hands. # noqa: E501
:param handedness: The handedness of this Mayor. # noqa: E501
:type: list[object]
"""
self._handedness = handedness
@property
def philosophical_school(self):
"""Gets the philosophical_school of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The philosophical_school of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._philosophical_school
@philosophical_school.setter
def philosophical_school(self, philosophical_school):
"""Sets the philosophical_school of this Mayor.
Description not available # noqa: E501
:param philosophical_school: The philosophical_school of this Mayor. # noqa: E501
:type: list[object]
"""
self._philosophical_school = philosophical_school
@property
def parliamentary_group(self):
"""Gets the parliamentary_group of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The parliamentary_group of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._parliamentary_group
@parliamentary_group.setter
def parliamentary_group(self, parliamentary_group):
"""Sets the parliamentary_group of this Mayor.
Description not available # noqa: E501
:param parliamentary_group: The parliamentary_group of this Mayor. # noqa: E501
:type: list[str]
"""
self._parliamentary_group = parliamentary_group
@property
def date_of_burial(self):
"""Gets the date_of_burial of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The date_of_burial of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._date_of_burial
@date_of_burial.setter
def date_of_burial(self, date_of_burial):
"""Sets the date_of_burial of this Mayor.
Description not available # noqa: E501
:param date_of_burial: The date_of_burial of this Mayor. # noqa: E501
:type: list[str]
"""
self._date_of_burial = date_of_burial
@property
def mount(self):
"""Gets the mount of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The mount of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._mount
@mount.setter
def mount(self, mount):
"""Sets the mount of this Mayor.
Description not available # noqa: E501
:param mount: The mount of this Mayor. # noqa: E501
:type: list[str]
"""
self._mount = mount
@property
def olympic_games_silver(self):
"""Gets the olympic_games_silver of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The olympic_games_silver of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._olympic_games_silver
@olympic_games_silver.setter
def olympic_games_silver(self, olympic_games_silver):
"""Sets the olympic_games_silver of this Mayor.
Description not available # noqa: E501
:param olympic_games_silver: The olympic_games_silver of this Mayor. # noqa: E501
:type: list[int]
"""
self._olympic_games_silver = olympic_games_silver
@property
def nationality(self):
"""Gets the nationality of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The nationality of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._nationality
@nationality.setter
def nationality(self, nationality):
"""Sets the nationality of this Mayor.
Description not available # noqa: E501
:param nationality: The nationality of this Mayor. # noqa: E501
:type: list[object]
"""
self._nationality = nationality
@property
def junior_years_start_year(self):
"""Gets the junior_years_start_year of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The junior_years_start_year of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._junior_years_start_year
@junior_years_start_year.setter
def junior_years_start_year(self, junior_years_start_year):
"""Sets the junior_years_start_year of this Mayor.
Description not available # noqa: E501
:param junior_years_start_year: The junior_years_start_year of this Mayor. # noqa: E501
:type: list[str]
"""
self._junior_years_start_year = junior_years_start_year
@property
def relative(self):
"""Gets the relative of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The relative of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._relative
@relative.setter
def relative(self, relative):
"""Sets the relative of this Mayor.
Description not available # noqa: E501
:param relative: The relative of this Mayor. # noqa: E501
:type: list[object]
"""
self._relative = relative
@property
def newspaper(self):
"""Gets the newspaper of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The newspaper of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._newspaper
@newspaper.setter
def newspaper(self, newspaper):
"""Sets the newspaper of this Mayor.
Description not available # noqa: E501
:param newspaper: The newspaper of this Mayor. # noqa: E501
:type: list[object]
"""
self._newspaper = newspaper
@property
def announced_from(self):
"""Gets the announced_from of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The announced_from of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._announced_from
@announced_from.setter
def announced_from(self, announced_from):
"""Sets the announced_from of this Mayor.
Description not available # noqa: E501
:param announced_from: The announced_from of this Mayor. # noqa: E501
:type: list[object]
"""
self._announced_from = announced_from
@property
def military_branch(self):
"""Gets the military_branch of this Mayor. # noqa: E501
The service branch (Army, Navy, etc.) a person is part of. # noqa: E501
:return: The military_branch of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._military_branch
@military_branch.setter
def military_branch(self, military_branch):
"""Sets the military_branch of this Mayor.
The service branch (Army, Navy, etc.) a person is part of. # noqa: E501
:param military_branch: The military_branch of this Mayor. # noqa: E501
:type: list[object]
"""
self._military_branch = military_branch
@property
def activity(self):
"""Gets the activity of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The activity of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._activity
@activity.setter
def activity(self, activity):
"""Sets the activity of this Mayor.
Description not available # noqa: E501
:param activity: The activity of this Mayor. # noqa: E501
:type: list[object]
"""
self._activity = activity
@property
def ethnicity(self):
"""Gets the ethnicity of this Mayor. # noqa: E501
Μία ορισμένη κοινωνική κατηγορία ανθρώπων που έχουν κοινή καταγωγή ή εμπειρίες. # noqa: E501
:return: The ethnicity of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._ethnicity
@ethnicity.setter
def ethnicity(self, ethnicity):
"""Sets the ethnicity of this Mayor.
Μία ορισμένη κοινωνική κατηγορία ανθρώπων που έχουν κοινή καταγωγή ή εμπειρίες. # noqa: E501
:param ethnicity: The ethnicity of this Mayor. # noqa: E501
:type: list[object]
"""
self._ethnicity = ethnicity
@property
def state_of_origin(self):
"""Gets the state_of_origin of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The state_of_origin of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._state_of_origin
@state_of_origin.setter
def state_of_origin(self, state_of_origin):
"""Sets the state_of_origin of this Mayor.
Description not available # noqa: E501
:param state_of_origin: The state_of_origin of this Mayor. # noqa: E501
:type: list[object]
"""
self._state_of_origin = state_of_origin
@property
def pole_position(self):
"""Gets the pole_position of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The pole_position of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._pole_position
@pole_position.setter
def pole_position(self, pole_position):
"""Sets the pole_position of this Mayor.
Description not available # noqa: E501
:param pole_position: The pole_position of this Mayor. # noqa: E501
:type: list[int]
"""
self._pole_position = pole_position
@property
def season_manager(self):
"""Gets the season_manager of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The season_manager of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._season_manager
@season_manager.setter
def season_manager(self, season_manager):
"""Sets the season_manager of this Mayor.
Description not available # noqa: E501
:param season_manager: The season_manager of this Mayor. # noqa: E501
:type: list[str]
"""
self._season_manager = season_manager
@property
def killed_by(self):
"""Gets the killed_by of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The killed_by of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._killed_by
@killed_by.setter
def killed_by(self, killed_by):
"""Sets the killed_by of this Mayor.
Description not available # noqa: E501
:param killed_by: The killed_by of this Mayor. # noqa: E501
:type: list[str]
"""
self._killed_by = killed_by
@property
def blood_type(self):
"""Gets the blood_type of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The blood_type of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._blood_type
@blood_type.setter
def blood_type(self, blood_type):
"""Sets the blood_type of this Mayor.
Description not available # noqa: E501
:param blood_type: The blood_type of this Mayor. # noqa: E501
:type: list[object]
"""
self._blood_type = blood_type
@property
def continental_tournament(self):
"""Gets the continental_tournament of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The continental_tournament of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._continental_tournament
@continental_tournament.setter
def continental_tournament(self, continental_tournament):
"""Sets the continental_tournament of this Mayor.
Description not available # noqa: E501
:param continental_tournament: The continental_tournament of this Mayor. # noqa: E501
:type: list[object]
"""
self._continental_tournament = continental_tournament
@property
def junior_years_end_year(self):
"""Gets the junior_years_end_year of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The junior_years_end_year of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._junior_years_end_year
@junior_years_end_year.setter
def junior_years_end_year(self, junior_years_end_year):
"""Sets the junior_years_end_year of this Mayor.
Description not available # noqa: E501
:param junior_years_end_year: The junior_years_end_year of this Mayor. # noqa: E501
:type: list[str]
"""
self._junior_years_end_year = junior_years_end_year
@property
def political_function(self):
"""Gets the political_function of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The political_function of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._political_function
@political_function.setter
def political_function(self, political_function):
"""Sets the political_function of this Mayor.
Description not available # noqa: E501
:param political_function: The political_function of this Mayor. # noqa: E501
:type: list[str]
"""
self._political_function = political_function
@property
def honours(self):
"""Gets the honours of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The honours of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._honours
@honours.setter
def honours(self, honours):
"""Sets the honours of this Mayor.
Description not available # noqa: E501
:param honours: The honours of this Mayor. # noqa: E501
:type: list[object]
"""
self._honours = honours
@property
def olympic_games(self):
"""Gets the olympic_games of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The olympic_games of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._olympic_games
@olympic_games.setter
def olympic_games(self, olympic_games):
"""Sets the olympic_games of this Mayor.
Description not available # noqa: E501
:param olympic_games: The olympic_games of this Mayor. # noqa: E501
:type: list[object]
"""
self._olympic_games = olympic_games
@property
def hair_color(self):
"""Gets the hair_color of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The hair_color of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._hair_color
@hair_color.setter
def hair_color(self, hair_color):
"""Sets the hair_color of this Mayor.
Description not available # noqa: E501
:param hair_color: The hair_color of this Mayor. # noqa: E501
:type: list[object]
"""
self._hair_color = hair_color
@property
def foot(self):
"""Gets the foot of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The foot of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._foot
@foot.setter
def foot(self, foot):
"""Sets the foot of this Mayor.
Description not available # noqa: E501
:param foot: The foot of this Mayor. # noqa: E501
:type: list[str]
"""
self._foot = foot
@property
def measurements(self):
"""Gets the measurements of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The measurements of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._measurements
@measurements.setter
def measurements(self, measurements):
"""Sets the measurements of this Mayor.
Description not available # noqa: E501
:param measurements: The measurements of this Mayor. # noqa: E501
:type: list[str]
"""
self._measurements = measurements
@property
def hand(self):
"""Gets the hand of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The hand of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._hand
@hand.setter
def hand(self, hand):
"""Sets the hand of this Mayor.
Description not available # noqa: E501
:param hand: The hand of this Mayor. # noqa: E501
:type: list[object]
"""
self._hand = hand
@property
def federation(self):
"""Gets the federation of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The federation of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._federation
@federation.setter
def federation(self, federation):
"""Sets the federation of this Mayor.
Description not available # noqa: E501
:param federation: The federation of this Mayor. # noqa: E501
:type: list[object]
"""
self._federation = federation
@property
def circumcised(self):
"""Gets the circumcised of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The circumcised of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._circumcised
@circumcised.setter
def circumcised(self, circumcised):
"""Sets the circumcised of this Mayor.
Description not available # noqa: E501
:param circumcised: The circumcised of this Mayor. # noqa: E501
:type: list[str]
"""
self._circumcised = circumcised
@property
def penis_length(self):
"""Gets the penis_length of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The penis_length of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._penis_length
@penis_length.setter
def penis_length(self, penis_length):
"""Sets the penis_length of this Mayor.
Description not available # noqa: E501
:param penis_length: The penis_length of this Mayor. # noqa: E501
:type: list[str]
"""
self._penis_length = penis_length
@property
def coemperor(self):
"""Gets the coemperor of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The coemperor of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._coemperor
@coemperor.setter
def coemperor(self, coemperor):
"""Sets the coemperor of this Mayor.
Description not available # noqa: E501
:param coemperor: The coemperor of this Mayor. # noqa: E501
:type: list[object]
"""
self._coemperor = coemperor
@property
def detractor(self):
"""Gets the detractor of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The detractor of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._detractor
@detractor.setter
def detractor(self, detractor):
"""Sets the detractor of this Mayor.
Description not available # noqa: E501
:param detractor: The detractor of this Mayor. # noqa: E501
:type: list[object]
"""
self._detractor = detractor
@property
def selibr_id(self):
"""Gets the selibr_id of this Mayor. # noqa: E501
Authority data from the National Library of Sweden # noqa: E501
:return: The selibr_id of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._selibr_id
@selibr_id.setter
def selibr_id(self, selibr_id):
"""Sets the selibr_id of this Mayor.
Authority data from the National Library of Sweden # noqa: E501
:param selibr_id: The selibr_id of this Mayor. # noqa: E501
:type: list[str]
"""
self._selibr_id = selibr_id
@property
def danse_competition(self):
"""Gets the danse_competition of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The danse_competition of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._danse_competition
@danse_competition.setter
def danse_competition(self, danse_competition):
"""Sets the danse_competition of this Mayor.
Description not available # noqa: E501
:param danse_competition: The danse_competition of this Mayor. # noqa: E501
:type: list[str]
"""
self._danse_competition = danse_competition
@property
def sex(self):
"""Gets the sex of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The sex of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._sex
@sex.setter
def sex(self, sex):
"""Sets the sex of this Mayor.
Description not available # noqa: E501
:param sex: The sex of this Mayor. # noqa: E501
:type: list[str]
"""
self._sex = sex
@property
def sexual_orientation(self):
"""Gets the sexual_orientation of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The sexual_orientation of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._sexual_orientation
@sexual_orientation.setter
def sexual_orientation(self, sexual_orientation):
"""Sets the sexual_orientation of this Mayor.
Description not available # noqa: E501
:param sexual_orientation: The sexual_orientation of this Mayor. # noqa: E501
:type: list[object]
"""
self._sexual_orientation = sexual_orientation
@property
def partner(self):
"""Gets the partner of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The partner of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._partner
@partner.setter
def partner(self, partner):
"""Sets the partner of this Mayor.
Description not available # noqa: E501
:param partner: The partner of this Mayor. # noqa: E501
:type: list[object]
"""
self._partner = partner
@property
def birth_year(self):
"""Gets the birth_year of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The birth_year of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._birth_year
@birth_year.setter
def birth_year(self, birth_year):
"""Sets the birth_year of this Mayor.
Description not available # noqa: E501
:param birth_year: The birth_year of this Mayor. # noqa: E501
:type: list[str]
"""
self._birth_year = birth_year
@property
def sports_function(self):
"""Gets the sports_function of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The sports_function of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._sports_function
@sports_function.setter
def sports_function(self, sports_function):
"""Sets the sports_function of this Mayor.
Description not available # noqa: E501
:param sports_function: The sports_function of this Mayor. # noqa: E501
:type: list[str]
"""
self._sports_function = sports_function
@property
def orcid_id(self):
"""Gets the orcid_id of this Mayor. # noqa: E501
Authority data on researchers, academics, etc. The ID range has been defined as a subset of the forthcoming ISNI range. # noqa: E501
:return: The orcid_id of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._orcid_id
@orcid_id.setter
def orcid_id(self, orcid_id):
"""Sets the orcid_id of this Mayor.
Authority data on researchers, academics, etc. The ID range has been defined as a subset of the forthcoming ISNI range. # noqa: E501
:param orcid_id: The orcid_id of this Mayor. # noqa: E501
:type: list[str]
"""
self._orcid_id = orcid_id
@property
def election_date(self):
"""Gets the election_date of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The election_date of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._election_date
@election_date.setter
def election_date(self, election_date):
"""Sets the election_date of this Mayor.
Description not available # noqa: E501
:param election_date: The election_date of this Mayor. # noqa: E501
:type: list[str]
"""
self._election_date = election_date
@property
def sport_discipline(self):
"""Gets the sport_discipline of this Mayor. # noqa: E501
the sport discipline the athlete practices, e.g. Diving, or that a board member of a sporting club is focussing at # noqa: E501
:return: The sport_discipline of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._sport_discipline
@sport_discipline.setter
def sport_discipline(self, sport_discipline):
"""Sets the sport_discipline of this Mayor.
the sport discipline the athlete practices, e.g. Diving, or that a board member of a sporting club is focussing at # noqa: E501
:param sport_discipline: The sport_discipline of this Mayor. # noqa: E501
:type: list[object]
"""
self._sport_discipline = sport_discipline
@property
def collaboration(self):
"""Gets the collaboration of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The collaboration of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._collaboration
@collaboration.setter
def collaboration(self, collaboration):
"""Sets the collaboration of this Mayor.
Description not available # noqa: E501
:param collaboration: The collaboration of this Mayor. # noqa: E501
:type: list[object]
"""
self._collaboration = collaboration
@property
def national_team_year(self):
"""Gets the national_team_year of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The national_team_year of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._national_team_year
@national_team_year.setter
def national_team_year(self, national_team_year):
"""Sets the national_team_year of this Mayor.
Description not available # noqa: E501
:param national_team_year: The national_team_year of this Mayor. # noqa: E501
:type: list[str]
"""
self._national_team_year = national_team_year
@property
def number_of_run(self):
"""Gets the number_of_run of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The number_of_run of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._number_of_run
@number_of_run.setter
def number_of_run(self, number_of_run):
"""Sets the number_of_run of this Mayor.
Description not available # noqa: E501
:param number_of_run: The number_of_run of this Mayor. # noqa: E501
:type: list[int]
"""
self._number_of_run = number_of_run
@property
def spouse_name(self):
"""Gets the spouse_name of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The spouse_name of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._spouse_name
@spouse_name.setter
def spouse_name(self, spouse_name):
"""Sets the spouse_name of this Mayor.
Description not available # noqa: E501
:param spouse_name: The spouse_name of this Mayor. # noqa: E501
:type: list[str]
"""
self._spouse_name = spouse_name
@property
def lah_hof(self):
"""Gets the lah_hof of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The lah_hof of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._lah_hof
@lah_hof.setter
def lah_hof(self, lah_hof):
"""Sets the lah_hof of this Mayor.
Description not available # noqa: E501
:param lah_hof: The lah_hof of this Mayor. # noqa: E501
:type: list[str]
"""
self._lah_hof = lah_hof
@property
def derived_word(self):
"""Gets the derived_word of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The derived_word of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._derived_word
@derived_word.setter
def derived_word(self, derived_word):
"""Sets the derived_word of this Mayor.
Description not available # noqa: E501
:param derived_word: The derived_word of this Mayor. # noqa: E501
:type: list[str]
"""
self._derived_word = derived_word
@property
def current_team_manager(self):
"""Gets the current_team_manager of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The current_team_manager of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._current_team_manager
@current_team_manager.setter
def current_team_manager(self, current_team_manager):
"""Sets the current_team_manager of this Mayor.
Description not available # noqa: E501
:param current_team_manager: The current_team_manager of this Mayor. # noqa: E501
:type: list[object]
"""
self._current_team_manager = current_team_manager
@property
def little_pool_record(self):
"""Gets the little_pool_record of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The little_pool_record of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._little_pool_record
@little_pool_record.setter
def little_pool_record(self, little_pool_record):
"""Sets the little_pool_record of this Mayor.
Description not available # noqa: E501
:param little_pool_record: The little_pool_record of this Mayor. # noqa: E501
:type: list[str]
"""
self._little_pool_record = little_pool_record
@property
def bpn_id(self):
"""Gets the bpn_id of this Mayor. # noqa: E501
Dutch project with material for 40,000 digitized biographies, including former colonies of the Netherlands. # noqa: E501
:return: The bpn_id of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._bpn_id
@bpn_id.setter
def bpn_id(self, bpn_id):
"""Sets the bpn_id of this Mayor.
Dutch project with material for 40,000 digitized biographies, including former colonies of the Netherlands. # noqa: E501
:param bpn_id: The bpn_id of this Mayor. # noqa: E501
:type: list[str]
"""
self._bpn_id = bpn_id
@property
def free_danse_score(self):
"""Gets the free_danse_score of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The free_danse_score of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._free_danse_score
@free_danse_score.setter
def free_danse_score(self, free_danse_score):
"""Sets the free_danse_score of this Mayor.
Description not available # noqa: E501
:param free_danse_score: The free_danse_score of this Mayor. # noqa: E501
:type: list[str]
"""
self._free_danse_score = free_danse_score
@property
def project(self):
"""Gets the project of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The project of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._project
@project.setter
def project(self, project):
"""Sets the project of this Mayor.
Description not available # noqa: E501
:param project: The project of this Mayor. # noqa: E501
:type: list[object]
"""
self._project = project
@property
def active_years(self):
"""Gets the active_years of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The active_years of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._active_years
@active_years.setter
def active_years(self, active_years):
"""Sets the active_years of this Mayor.
Description not available # noqa: E501
:param active_years: The active_years of this Mayor. # noqa: E501
:type: list[object]
"""
self._active_years = active_years
@property
def title_date(self):
"""Gets the title_date of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The title_date of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._title_date
@title_date.setter
def title_date(self, title_date):
"""Sets the title_date of this Mayor.
Description not available # noqa: E501
:param title_date: The title_date of this Mayor. # noqa: E501
:type: list[str]
"""
self._title_date = title_date
@property
def blood_group(self):
"""Gets the blood_group of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The blood_group of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._blood_group
@blood_group.setter
def blood_group(self, blood_group):
"""Sets the blood_group of this Mayor.
Description not available # noqa: E501
:param blood_group: The blood_group of this Mayor. # noqa: E501
:type: list[str]
"""
self._blood_group = blood_group
@property
def school(self):
"""Gets the school of this Mayor. # noqa: E501
school a person goes or went to # noqa: E501
:return: The school of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._school
@school.setter
def school(self, school):
"""Sets the school of this Mayor.
school a person goes or went to # noqa: E501
:param school: The school of this Mayor. # noqa: E501
:type: list[object]
"""
self._school = school
@property
def death_place(self):
"""Gets the death_place of this Mayor. # noqa: E501
the place where they died # noqa: E501
:return: The death_place of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._death_place
@death_place.setter
def death_place(self, death_place):
"""Sets the death_place of this Mayor.
the place where they died # noqa: E501
:param death_place: The death_place of this Mayor. # noqa: E501
:type: list[object]
"""
self._death_place = death_place
@property
def victory_percentage_as_mgr(self):
"""Gets the victory_percentage_as_mgr of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The victory_percentage_as_mgr of this Mayor. # noqa: E501
:rtype: list[float]
"""
return self._victory_percentage_as_mgr
@victory_percentage_as_mgr.setter
def victory_percentage_as_mgr(self, victory_percentage_as_mgr):
"""Sets the victory_percentage_as_mgr of this Mayor.
Description not available # noqa: E501
:param victory_percentage_as_mgr: The victory_percentage_as_mgr of this Mayor. # noqa: E501
:type: list[float]
"""
self._victory_percentage_as_mgr = victory_percentage_as_mgr
@property
def imposed_danse_competition(self):
"""Gets the imposed_danse_competition of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The imposed_danse_competition of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._imposed_danse_competition
@imposed_danse_competition.setter
def imposed_danse_competition(self, imposed_danse_competition):
"""Sets the imposed_danse_competition of this Mayor.
Description not available # noqa: E501
:param imposed_danse_competition: The imposed_danse_competition of this Mayor. # noqa: E501
:type: list[str]
"""
self._imposed_danse_competition = imposed_danse_competition
@property
def shoot(self):
"""Gets the shoot of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The shoot of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._shoot
@shoot.setter
def shoot(self, shoot):
"""Sets the shoot of this Mayor.
Description not available # noqa: E501
:param shoot: The shoot of this Mayor. # noqa: E501
:type: list[str]
"""
self._shoot = shoot
@property
def education_place(self):
"""Gets the education_place of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The education_place of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._education_place
@education_place.setter
def education_place(self, education_place):
"""Sets the education_place of this Mayor.
Description not available # noqa: E501
:param education_place: The education_place of this Mayor. # noqa: E501
:type: list[object]
"""
self._education_place = education_place
@property
def match_point(self):
"""Gets the match_point of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The match_point of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._match_point
@match_point.setter
def match_point(self, match_point):
"""Sets the match_point of this Mayor.
Description not available # noqa: E501
:param match_point: The match_point of this Mayor. # noqa: E501
:type: list[str]
"""
self._match_point = match_point
@property
def reign_name(self):
"""Gets the reign_name of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The reign_name of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._reign_name
@reign_name.setter
def reign_name(self, reign_name):
"""Sets the reign_name of this Mayor.
Description not available # noqa: E501
:param reign_name: The reign_name of this Mayor. # noqa: E501
:type: list[str]
"""
self._reign_name = reign_name
@property
def pro_period(self):
"""Gets the pro_period of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The pro_period of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._pro_period
@pro_period.setter
def pro_period(self, pro_period):
"""Sets the pro_period of this Mayor.
Description not available # noqa: E501
:param pro_period: The pro_period of this Mayor. # noqa: E501
:type: list[str]
"""
self._pro_period = pro_period
@property
def influenced_by(self):
"""Gets the influenced_by of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The influenced_by of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._influenced_by
@influenced_by.setter
def influenced_by(self, influenced_by):
"""Sets the influenced_by of this Mayor.
Description not available # noqa: E501
:param influenced_by: The influenced_by of this Mayor. # noqa: E501
:type: list[object]
"""
self._influenced_by = influenced_by
@property
def nla_id(self):
"""Gets the nla_id of this Mayor. # noqa: E501
NLA Trove’s People and Organisation view allows the discovery of biographical and other contextual information about people and organisations. Search also available via VIAF. # noqa: E501
:return: The nla_id of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._nla_id
@nla_id.setter
def nla_id(self, nla_id):
"""Sets the nla_id of this Mayor.
NLA Trove’s People and Organisation view allows the discovery of biographical and other contextual information about people and organisations. Search also available via VIAF. # noqa: E501
:param nla_id: The nla_id of this Mayor. # noqa: E501
:type: list[str]
"""
self._nla_id = nla_id
@property
def cousurper(self):
"""Gets the cousurper of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The cousurper of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._cousurper
@cousurper.setter
def cousurper(self, cousurper):
"""Sets the cousurper of this Mayor.
Description not available # noqa: E501
:param cousurper: The cousurper of this Mayor. # noqa: E501
:type: list[object]
"""
self._cousurper = cousurper
@property
def race_wins(self):
"""Gets the race_wins of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The race_wins of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._race_wins
@race_wins.setter
def race_wins(self, race_wins):
"""Sets the race_wins of this Mayor.
Description not available # noqa: E501
:param race_wins: The race_wins of this Mayor. # noqa: E501
:type: list[int]
"""
self._race_wins = race_wins
@property
def world_tournament_bronze(self):
"""Gets the world_tournament_bronze of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The world_tournament_bronze of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._world_tournament_bronze
@world_tournament_bronze.setter
def world_tournament_bronze(self, world_tournament_bronze):
"""Sets the world_tournament_bronze of this Mayor.
Description not available # noqa: E501
:param world_tournament_bronze: The world_tournament_bronze of this Mayor. # noqa: E501
:type: list[int]
"""
self._world_tournament_bronze = world_tournament_bronze
@property
def jutsu(self):
"""Gets the jutsu of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The jutsu of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._jutsu
@jutsu.setter
def jutsu(self, jutsu):
"""Sets the jutsu of this Mayor.
Description not available # noqa: E501
:param jutsu: The jutsu of this Mayor. # noqa: E501
:type: list[str]
"""
self._jutsu = jutsu
@property
def weight(self):
"""Gets the weight of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The weight of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._weight
@weight.setter
def weight(self, weight):
"""Sets the weight of this Mayor.
Description not available # noqa: E501
:param weight: The weight of this Mayor. # noqa: E501
:type: list[object]
"""
self._weight = weight
@property
def other_media(self):
"""Gets the other_media of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The other_media of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._other_media
@other_media.setter
def other_media(self, other_media):
"""Sets the other_media of this Mayor.
Description not available # noqa: E501
:param other_media: The other_media of this Mayor. # noqa: E501
:type: list[object]
"""
self._other_media = other_media
@property
def alma_mater(self):
"""Gets the alma_mater of this Mayor. # noqa: E501
schools that they attended # noqa: E501
:return: The alma_mater of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._alma_mater
@alma_mater.setter
def alma_mater(self, alma_mater):
"""Sets the alma_mater of this Mayor.
schools that they attended # noqa: E501
:param alma_mater: The alma_mater of this Mayor. # noqa: E501
:type: list[object]
"""
self._alma_mater = alma_mater
@property
def imposed_danse_score(self):
"""Gets the imposed_danse_score of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The imposed_danse_score of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._imposed_danse_score
@imposed_danse_score.setter
def imposed_danse_score(self, imposed_danse_score):
"""Sets the imposed_danse_score of this Mayor.
Description not available # noqa: E501
:param imposed_danse_score: The imposed_danse_score of this Mayor. # noqa: E501
:type: list[str]
"""
self._imposed_danse_score = imposed_danse_score
@property
def known_for(self):
"""Gets the known_for of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The known_for of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._known_for
@known_for.setter
def known_for(self, known_for):
"""Sets the known_for of this Mayor.
Description not available # noqa: E501
:param known_for: The known_for of this Mayor. # noqa: E501
:type: list[object]
"""
self._known_for = known_for
@property
def big_pool_record(self):
"""Gets the big_pool_record of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The big_pool_record of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._big_pool_record
@big_pool_record.setter
def big_pool_record(self, big_pool_record):
"""Sets the big_pool_record of this Mayor.
Description not available # noqa: E501
:param big_pool_record: The big_pool_record of this Mayor. # noqa: E501
:type: list[str]
"""
self._big_pool_record = big_pool_record
@property
def olympic_games_wins(self):
"""Gets the olympic_games_wins of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The olympic_games_wins of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._olympic_games_wins
@olympic_games_wins.setter
def olympic_games_wins(self, olympic_games_wins):
"""Sets the olympic_games_wins of this Mayor.
Description not available # noqa: E501
:param olympic_games_wins: The olympic_games_wins of this Mayor. # noqa: E501
:type: list[str]
"""
self._olympic_games_wins = olympic_games_wins
@property
def eye_colour(self):
"""Gets the eye_colour of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The eye_colour of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._eye_colour
@eye_colour.setter
def eye_colour(self, eye_colour):
"""Sets the eye_colour of this Mayor.
Description not available # noqa: E501
:param eye_colour: The eye_colour of this Mayor. # noqa: E501
:type: list[str]
"""
self._eye_colour = eye_colour
@property
def world_tournament_silver(self):
"""Gets the world_tournament_silver of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The world_tournament_silver of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._world_tournament_silver
@world_tournament_silver.setter
def world_tournament_silver(self, world_tournament_silver):
"""Sets the world_tournament_silver of this Mayor.
Description not available # noqa: E501
:param world_tournament_silver: The world_tournament_silver of this Mayor. # noqa: E501
:type: list[int]
"""
self._world_tournament_silver = world_tournament_silver
@property
def architectural_movement(self):
"""Gets the architectural_movement of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The architectural_movement of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._architectural_movement
@architectural_movement.setter
def architectural_movement(self, architectural_movement):
"""Sets the architectural_movement of this Mayor.
Description not available # noqa: E501
:param architectural_movement: The architectural_movement of this Mayor. # noqa: E501
:type: list[str]
"""
self._architectural_movement = architectural_movement
@property
def mood(self):
"""Gets the mood of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The mood of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._mood
@mood.setter
def mood(self, mood):
"""Sets the mood of this Mayor.
Description not available # noqa: E501
:param mood: The mood of this Mayor. # noqa: E501
:type: list[str]
"""
self._mood = mood
@property
def bibsys_id(self):
"""Gets the bibsys_id of this Mayor. # noqa: E501
BIBSYS is a supplier of library and information systems for all Norwegian university Libraries, the National Library of Norway, college libraries, and a number of research libraries and institutions. # noqa: E501
:return: The bibsys_id of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._bibsys_id
@bibsys_id.setter
def bibsys_id(self, bibsys_id):
"""Sets the bibsys_id of this Mayor.
BIBSYS is a supplier of library and information systems for all Norwegian university Libraries, the National Library of Norway, college libraries, and a number of research libraries and institutions. # noqa: E501
:param bibsys_id: The bibsys_id of this Mayor. # noqa: E501
:type: list[str]
"""
self._bibsys_id = bibsys_id
@property
def iihf_hof(self):
"""Gets the iihf_hof of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The iihf_hof of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._iihf_hof
@iihf_hof.setter
def iihf_hof(self, iihf_hof):
"""Sets the iihf_hof of this Mayor.
Description not available # noqa: E501
:param iihf_hof: The iihf_hof of this Mayor. # noqa: E501
:type: list[str]
"""
self._iihf_hof = iihf_hof
@property
def free_prog_score(self):
"""Gets the free_prog_score of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The free_prog_score of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._free_prog_score
@free_prog_score.setter
def free_prog_score(self, free_prog_score):
"""Sets the free_prog_score of this Mayor.
Description not available # noqa: E501
:param free_prog_score: The free_prog_score of this Mayor. # noqa: E501
:type: list[str]
"""
self._free_prog_score = free_prog_score
@property
def description(self):
"""Gets the description of this Mayor. # noqa: E501
small description # noqa: E501
:return: The description of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._description
@description.setter
def description(self, description):
"""Sets the description of this Mayor.
small description # noqa: E501
:param description: The description of this Mayor. # noqa: E501
:type: list[str]
"""
self._description = description
@property
def particular_sign(self):
"""Gets the particular_sign of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The particular_sign of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._particular_sign
@particular_sign.setter
def particular_sign(self, particular_sign):
"""Sets the particular_sign of this Mayor.
Description not available # noqa: E501
:param particular_sign: The particular_sign of this Mayor. # noqa: E501
:type: list[str]
"""
self._particular_sign = particular_sign
@property
def league_manager(self):
"""Gets the league_manager of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The league_manager of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._league_manager
@league_manager.setter
def league_manager(self, league_manager):
"""Sets the league_manager of this Mayor.
Description not available # noqa: E501
:param league_manager: The league_manager of this Mayor. # noqa: E501
:type: list[object]
"""
self._league_manager = league_manager
@property
def junior_season(self):
"""Gets the junior_season of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The junior_season of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._junior_season
@junior_season.setter
def junior_season(self, junior_season):
"""Sets the junior_season of this Mayor.
Description not available # noqa: E501
:param junior_season: The junior_season of this Mayor. # noqa: E501
:type: list[object]
"""
self._junior_season = junior_season
@property
def free_prog_competition(self):
"""Gets the free_prog_competition of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The free_prog_competition of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._free_prog_competition
@free_prog_competition.setter
def free_prog_competition(self, free_prog_competition):
"""Sets the free_prog_competition of this Mayor.
Description not available # noqa: E501
:param free_prog_competition: The free_prog_competition of this Mayor. # noqa: E501
:type: list[str]
"""
self._free_prog_competition = free_prog_competition
@property
def weapon(self):
"""Gets the weapon of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The weapon of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._weapon
@weapon.setter
def weapon(self, weapon):
"""Sets the weapon of this Mayor.
Description not available # noqa: E501
:param weapon: The weapon of this Mayor. # noqa: E501
:type: list[object]
"""
self._weapon = weapon
@property
def kind_of_criminal(self):
"""Gets the kind_of_criminal of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The kind_of_criminal of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._kind_of_criminal
@kind_of_criminal.setter
def kind_of_criminal(self, kind_of_criminal):
"""Sets the kind_of_criminal of this Mayor.
Description not available # noqa: E501
:param kind_of_criminal: The kind_of_criminal of this Mayor. # noqa: E501
:type: list[str]
"""
self._kind_of_criminal = kind_of_criminal
@property
def notable_idea(self):
"""Gets the notable_idea of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The notable_idea of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._notable_idea
@notable_idea.setter
def notable_idea(self, notable_idea):
"""Sets the notable_idea of this Mayor.
Description not available # noqa: E501
:param notable_idea: The notable_idea of this Mayor. # noqa: E501
:type: list[object]
"""
self._notable_idea = notable_idea
@property
def player_status(self):
"""Gets the player_status of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The player_status of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._player_status
@player_status.setter
def player_status(self, player_status):
"""Sets the player_status of this Mayor.
Description not available # noqa: E501
:param player_status: The player_status of this Mayor. # noqa: E501
:type: list[str]
"""
self._player_status = player_status
@property
def other_function(self):
"""Gets the other_function of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The other_function of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._other_function
@other_function.setter
def other_function(self, other_function):
"""Sets the other_function of this Mayor.
Description not available # noqa: E501
:param other_function: The other_function of this Mayor. # noqa: E501
:type: list[object]
"""
self._other_function = other_function
@property
def continental_tournament_silver(self):
"""Gets the continental_tournament_silver of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The continental_tournament_silver of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._continental_tournament_silver
@continental_tournament_silver.setter
def continental_tournament_silver(self, continental_tournament_silver):
"""Sets the continental_tournament_silver of this Mayor.
Description not available # noqa: E501
:param continental_tournament_silver: The continental_tournament_silver of this Mayor. # noqa: E501
:type: list[int]
"""
self._continental_tournament_silver = continental_tournament_silver
@property
def career_station(self):
"""Gets the career_station of this Mayor. # noqa: E501
this property links to a step in the career of a person, e.g. a soccer player, holding information on the time span, matches and goals he or she achieved at a club. # noqa: E501
:return: The career_station of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._career_station
@career_station.setter
def career_station(self, career_station):
"""Sets the career_station of this Mayor.
this property links to a step in the career of a person, e.g. a soccer player, holding information on the time span, matches and goals he or she achieved at a club. # noqa: E501
:param career_station: The career_station of this Mayor. # noqa: E501
:type: list[object]
"""
self._career_station = career_station
@property
def resting_place_position(self):
"""Gets the resting_place_position of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The resting_place_position of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._resting_place_position
@resting_place_position.setter
def resting_place_position(self, resting_place_position):
"""Sets the resting_place_position of this Mayor.
Description not available # noqa: E501
:param resting_place_position: The resting_place_position of this Mayor. # noqa: E501
:type: list[object]
"""
self._resting_place_position = resting_place_position
@property
def original_danse_competition(self):
"""Gets the original_danse_competition of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The original_danse_competition of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._original_danse_competition
@original_danse_competition.setter
def original_danse_competition(self, original_danse_competition):
"""Sets the original_danse_competition of this Mayor.
Description not available # noqa: E501
:param original_danse_competition: The original_danse_competition of this Mayor. # noqa: E501
:type: list[str]
"""
self._original_danse_competition = original_danse_competition
@property
def status_manager(self):
"""Gets the status_manager of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The status_manager of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._status_manager
@status_manager.setter
def status_manager(self, status_manager):
"""Sets the status_manager of this Mayor.
Description not available # noqa: E501
:param status_manager: The status_manager of this Mayor. # noqa: E501
:type: list[str]
"""
self._status_manager = status_manager
@property
def national_tournament(self):
"""Gets the national_tournament of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The national_tournament of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._national_tournament
@national_tournament.setter
def national_tournament(self, national_tournament):
"""Sets the national_tournament of this Mayor.
Description not available # noqa: E501
:param national_tournament: The national_tournament of this Mayor. # noqa: E501
:type: list[object]
"""
self._national_tournament = national_tournament
@property
def hometown(self):
"""Gets the hometown of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The hometown of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._hometown
@hometown.setter
def hometown(self, hometown):
"""Sets the hometown of this Mayor.
Description not available # noqa: E501
:param hometown: The hometown of this Mayor. # noqa: E501
:type: list[object]
"""
self._hometown = hometown
@property
def dead_in_fight_place(self):
"""Gets the dead_in_fight_place of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The dead_in_fight_place of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._dead_in_fight_place
@dead_in_fight_place.setter
def dead_in_fight_place(self, dead_in_fight_place):
"""Sets the dead_in_fight_place of this Mayor.
Description not available # noqa: E501
:param dead_in_fight_place: The dead_in_fight_place of this Mayor. # noqa: E501
:type: list[str]
"""
self._dead_in_fight_place = dead_in_fight_place
@property
def continental_tournament_bronze(self):
"""Gets the continental_tournament_bronze of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The continental_tournament_bronze of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._continental_tournament_bronze
@continental_tournament_bronze.setter
def continental_tournament_bronze(self, continental_tournament_bronze):
"""Sets the continental_tournament_bronze of this Mayor.
Description not available # noqa: E501
:param continental_tournament_bronze: The continental_tournament_bronze of this Mayor. # noqa: E501
:type: list[int]
"""
self._continental_tournament_bronze = continental_tournament_bronze
@property
def victory(self):
"""Gets the victory of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The victory of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._victory
@victory.setter
def victory(self, victory):
"""Sets the victory of this Mayor.
Description not available # noqa: E501
:param victory: The victory of this Mayor. # noqa: E501
:type: list[int]
"""
self._victory = victory
@property
def complexion(self):
"""Gets the complexion of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The complexion of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._complexion
@complexion.setter
def complexion(self, complexion):
"""Sets the complexion of this Mayor.
Description not available # noqa: E501
:param complexion: The complexion of this Mayor. # noqa: E501
:type: list[object]
"""
self._complexion = complexion
@property
def citizenship(self):
"""Gets the citizenship of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The citizenship of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._citizenship
@citizenship.setter
def citizenship(self, citizenship):
"""Sets the citizenship of this Mayor.
Description not available # noqa: E501
:param citizenship: The citizenship of this Mayor. # noqa: E501
:type: list[object]
"""
self._citizenship = citizenship
@property
def start(self):
"""Gets the start of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The start of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._start
@start.setter
def start(self, start):
"""Sets the start of this Mayor.
Description not available # noqa: E501
:param start: The start of this Mayor. # noqa: E501
:type: list[int]
"""
self._start = start
@property
def tessitura(self):
"""Gets the tessitura of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The tessitura of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._tessitura
@tessitura.setter
def tessitura(self, tessitura):
"""Sets the tessitura of this Mayor.
Description not available # noqa: E501
:param tessitura: The tessitura of this Mayor. # noqa: E501
:type: list[str]
"""
self._tessitura = tessitura
@property
def start_career(self):
"""Gets the start_career of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The start_career of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._start_career
@start_career.setter
def start_career(self, start_career):
"""Sets the start_career of this Mayor.
Description not available # noqa: E501
:param start_career: The start_career of this Mayor. # noqa: E501
:type: list[str]
"""
self._start_career = start_career
@property
def label(self):
"""Gets the label of this Mayor. # noqa: E501
short description of the resource # noqa: E501
:return: The label of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._label
@label.setter
def label(self, label):
"""Sets the label of this Mayor.
short description of the resource # noqa: E501
:param label: The label of this Mayor. # noqa: E501
:type: list[str]
"""
self._label = label
@property
def birth_date(self):
"""Gets the birth_date of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The birth_date of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._birth_date
@birth_date.setter
def birth_date(self, birth_date):
"""Sets the birth_date of this Mayor.
Description not available # noqa: E501
:param birth_date: The birth_date of this Mayor. # noqa: E501
:type: list[str]
"""
self._birth_date = birth_date
@property
def national_tournament_silver(self):
"""Gets the national_tournament_silver of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The national_tournament_silver of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._national_tournament_silver
@national_tournament_silver.setter
def national_tournament_silver(self, national_tournament_silver):
"""Sets the national_tournament_silver of this Mayor.
Description not available # noqa: E501
:param national_tournament_silver: The national_tournament_silver of this Mayor. # noqa: E501
:type: list[int]
"""
self._national_tournament_silver = national_tournament_silver
@property
def other_activity(self):
"""Gets the other_activity of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The other_activity of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._other_activity
@other_activity.setter
def other_activity(self, other_activity):
"""Sets the other_activity of this Mayor.
Description not available # noqa: E501
:param other_activity: The other_activity of this Mayor. # noqa: E501
:type: list[str]
"""
self._other_activity = other_activity
@property
def linguistics_tradition(self):
"""Gets the linguistics_tradition of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The linguistics_tradition of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._linguistics_tradition
@linguistics_tradition.setter
def linguistics_tradition(self, linguistics_tradition):
"""Sets the linguistics_tradition of this Mayor.
Description not available # noqa: E501
:param linguistics_tradition: The linguistics_tradition of this Mayor. # noqa: E501
:type: list[object]
"""
self._linguistics_tradition = linguistics_tradition
@property
def national_tournament_bronze(self):
"""Gets the national_tournament_bronze of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The national_tournament_bronze of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._national_tournament_bronze
@national_tournament_bronze.setter
def national_tournament_bronze(self, national_tournament_bronze):
"""Sets the national_tournament_bronze of this Mayor.
Description not available # noqa: E501
:param national_tournament_bronze: The national_tournament_bronze of this Mayor. # noqa: E501
:type: list[int]
"""
self._national_tournament_bronze = national_tournament_bronze
@property
def escalafon(self):
"""Gets the escalafon of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The escalafon of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._escalafon
@escalafon.setter
def escalafon(self, escalafon):
"""Sets the escalafon of this Mayor.
Description not available # noqa: E501
:param escalafon: The escalafon of this Mayor. # noqa: E501
:type: list[str]
"""
self._escalafon = escalafon
@property
def sibling(self):
"""Gets the sibling of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The sibling of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._sibling
@sibling.setter
def sibling(self, sibling):
"""Sets the sibling of this Mayor.
Description not available # noqa: E501
:param sibling: The sibling of this Mayor. # noqa: E501
:type: list[object]
"""
self._sibling = sibling
@property
def waist_size(self):
"""Gets the waist_size of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The waist_size of this Mayor. # noqa: E501
:rtype: list[float]
"""
return self._waist_size
@waist_size.setter
def waist_size(self, waist_size):
"""Sets the waist_size of this Mayor.
Description not available # noqa: E501
:param waist_size: The waist_size of this Mayor. # noqa: E501
:type: list[float]
"""
self._waist_size = waist_size
@property
def olympic_games_gold(self):
"""Gets the olympic_games_gold of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The olympic_games_gold of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._olympic_games_gold
@olympic_games_gold.setter
def olympic_games_gold(self, olympic_games_gold):
"""Sets the olympic_games_gold of this Mayor.
Description not available # noqa: E501
:param olympic_games_gold: The olympic_games_gold of this Mayor. # noqa: E501
:type: list[int]
"""
self._olympic_games_gold = olympic_games_gold
@property
def general_council(self):
"""Gets the general_council of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The general_council of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._general_council
@general_council.setter
def general_council(self, general_council):
"""Sets the general_council of this Mayor.
Description not available # noqa: E501
:param general_council: The general_council of this Mayor. # noqa: E501
:type: list[object]
"""
self._general_council = general_council
@property
def arrest_date(self):
"""Gets the arrest_date of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The arrest_date of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._arrest_date
@arrest_date.setter
def arrest_date(self, arrest_date):
"""Sets the arrest_date of this Mayor.
Description not available # noqa: E501
:param arrest_date: The arrest_date of this Mayor. # noqa: E501
:type: list[str]
"""
self._arrest_date = arrest_date
@property
def team_manager(self):
"""Gets the team_manager of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The team_manager of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._team_manager
@team_manager.setter
def team_manager(self, team_manager):
"""Sets the team_manager of this Mayor.
Description not available # noqa: E501
:param team_manager: The team_manager of this Mayor. # noqa: E501
:type: list[object]
"""
self._team_manager = team_manager
@property
def birth_sign(self):
"""Gets the birth_sign of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The birth_sign of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._birth_sign
@birth_sign.setter
def birth_sign(self, birth_sign):
"""Sets the birth_sign of this Mayor.
Description not available # noqa: E501
:param birth_sign: The birth_sign of this Mayor. # noqa: E501
:type: list[object]
"""
self._birth_sign = birth_sign
@property
def artistic_function(self):
"""Gets the artistic_function of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The artistic_function of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._artistic_function
@artistic_function.setter
def artistic_function(self, artistic_function):
"""Sets the artistic_function of this Mayor.
Description not available # noqa: E501
:param artistic_function: The artistic_function of this Mayor. # noqa: E501
:type: list[str]
"""
self._artistic_function = artistic_function
@property
def age(self):
"""Gets the age of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The age of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._age
@age.setter
def age(self, age):
"""Sets the age of this Mayor.
Description not available # noqa: E501
:param age: The age of this Mayor. # noqa: E501
:type: list[int]
"""
self._age = age
@property
def college(self):
"""Gets the college of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The college of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._college
@college.setter
def college(self, college):
"""Sets the college of this Mayor.
Description not available # noqa: E501
:param college: The college of this Mayor. # noqa: E501
:type: list[object]
"""
self._college = college
@property
def education(self):
"""Gets the education of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The education of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._education
@education.setter
def education(self, education):
"""Sets the education of this Mayor.
Description not available # noqa: E501
:param education: The education of this Mayor. # noqa: E501
:type: list[object]
"""
self._education = education
@property
def movie(self):
"""Gets the movie of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The movie of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._movie
@movie.setter
def movie(self, movie):
"""Sets the movie of this Mayor.
Description not available # noqa: E501
:param movie: The movie of this Mayor. # noqa: E501
:type: list[object]
"""
self._movie = movie
@property
def achievement(self):
"""Gets the achievement of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The achievement of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._achievement
@achievement.setter
def achievement(self, achievement):
"""Sets the achievement of this Mayor.
Description not available # noqa: E501
:param achievement: The achievement of this Mayor. # noqa: E501
:type: list[object]
"""
self._achievement = achievement
@property
def death_age(self):
"""Gets the death_age of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The death_age of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._death_age
@death_age.setter
def death_age(self, death_age):
"""Sets the death_age of this Mayor.
Description not available # noqa: E501
:param death_age: The death_age of this Mayor. # noqa: E501
:type: list[int]
"""
self._death_age = death_age
@property
def type(self):
"""Gets the type of this Mayor. # noqa: E501
type of the resource # noqa: E501
:return: The type of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._type
@type.setter
def type(self, type):
"""Sets the type of this Mayor.
type of the resource # noqa: E501
:param type: The type of this Mayor. # noqa: E501
:type: list[str]
"""
self._type = type
@property
def approach(self):
"""Gets the approach of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The approach of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._approach
@approach.setter
def approach(self, approach):
"""Sets the approach of this Mayor.
Description not available # noqa: E501
:param approach: The approach of this Mayor. # noqa: E501
:type: list[object]
"""
self._approach = approach
@property
def relation(self):
"""Gets the relation of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The relation of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._relation
@relation.setter
def relation(self, relation):
"""Sets the relation of this Mayor.
Description not available # noqa: E501
:param relation: The relation of this Mayor. # noqa: E501
:type: list[object]
"""
self._relation = relation
@property
def victory_as_mgr(self):
"""Gets the victory_as_mgr of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The victory_as_mgr of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._victory_as_mgr
@victory_as_mgr.setter
def victory_as_mgr(self, victory_as_mgr):
"""Sets the victory_as_mgr of this Mayor.
Description not available # noqa: E501
:param victory_as_mgr: The victory_as_mgr of this Mayor. # noqa: E501
:type: list[int]
"""
self._victory_as_mgr = victory_as_mgr
@property
def living_place(self):
"""Gets the living_place of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The living_place of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._living_place
@living_place.setter
def living_place(self, living_place):
"""Sets the living_place of this Mayor.
Description not available # noqa: E501
:param living_place: The living_place of this Mayor. # noqa: E501
:type: list[object]
"""
self._living_place = living_place
@property
def copilote(self):
"""Gets the copilote of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The copilote of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._copilote
@copilote.setter
def copilote(self, copilote):
"""Sets the copilote of this Mayor.
Description not available # noqa: E501
:param copilote: The copilote of this Mayor. # noqa: E501
:type: list[object]
"""
self._copilote = copilote
@property
def season(self):
"""Gets the season of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The season of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._season
@season.setter
def season(self, season):
"""Sets the season of this Mayor.
Description not available # noqa: E501
:param season: The season of this Mayor. # noqa: E501
:type: list[object]
"""
self._season = season
@property
def start_wct(self):
"""Gets the start_wct of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The start_wct of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._start_wct
@start_wct.setter
def start_wct(self, start_wct):
"""Sets the start_wct of this Mayor.
Description not available # noqa: E501
:param start_wct: The start_wct of this Mayor. # noqa: E501
:type: list[str]
"""
self._start_wct = start_wct
@property
def catch(self):
"""Gets the catch of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The catch of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._catch
@catch.setter
def catch(self, catch):
"""Sets the catch of this Mayor.
Description not available # noqa: E501
:param catch: The catch of this Mayor. # noqa: E501
:type: list[str]
"""
self._catch = catch
@property
def id(self):
"""Gets the id of this Mayor. # noqa: E501
identifier # noqa: E501
:return: The id of this Mayor. # noqa: E501
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this Mayor.
identifier # noqa: E501
:param id: The id of this Mayor. # noqa: E501
:type: str
"""
self._id = id
@property
def feat(self):
"""Gets the feat of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The feat of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._feat
@feat.setter
def feat(self, feat):
"""Sets the feat of this Mayor.
Description not available # noqa: E501
:param feat: The feat of this Mayor. # noqa: E501
:type: list[str]
"""
self._feat = feat
@property
def decoration(self):
"""Gets the decoration of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The decoration of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._decoration
@decoration.setter
def decoration(self, decoration):
"""Sets the decoration of this Mayor.
Description not available # noqa: E501
:param decoration: The decoration of this Mayor. # noqa: E501
:type: list[object]
"""
self._decoration = decoration
@property
def case(self):
"""Gets the case of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The case of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._case
@case.setter
def case(self, case):
"""Sets the case of this Mayor.
Description not available # noqa: E501
:param case: The case of this Mayor. # noqa: E501
:type: list[str]
"""
self._case = case
@property
def sentence(self):
"""Gets the sentence of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The sentence of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._sentence
@sentence.setter
def sentence(self, sentence):
"""Sets the sentence of this Mayor.
Description not available # noqa: E501
:param sentence: The sentence of this Mayor. # noqa: E501
:type: list[str]
"""
self._sentence = sentence
@property
def profession(self):
"""Gets the profession of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The profession of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._profession
@profession.setter
def profession(self, profession):
"""Sets the profession of this Mayor.
Description not available # noqa: E501
:param profession: The profession of this Mayor. # noqa: E501
:type: list[object]
"""
self._profession = profession
@property
def retirement_date(self):
"""Gets the retirement_date of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The retirement_date of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._retirement_date
@retirement_date.setter
def retirement_date(self, retirement_date):
"""Sets the retirement_date of this Mayor.
Description not available # noqa: E501
:param retirement_date: The retirement_date of this Mayor. # noqa: E501
:type: list[str]
"""
self._retirement_date = retirement_date
@property
def world_tournament(self):
"""Gets the world_tournament of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The world_tournament of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._world_tournament
@world_tournament.setter
def world_tournament(self, world_tournament):
"""Sets the world_tournament of this Mayor.
Description not available # noqa: E501
:param world_tournament: The world_tournament of this Mayor. # noqa: E501
:type: list[object]
"""
self._world_tournament = world_tournament
@property
def wife(self):
"""Gets the wife of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The wife of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._wife
@wife.setter
def wife(self, wife):
"""Sets the wife of this Mayor.
Description not available # noqa: E501
:param wife: The wife of this Mayor. # noqa: E501
:type: list[object]
"""
self._wife = wife
@property
def allegiance(self):
"""Gets the allegiance of this Mayor. # noqa: E501
The country or other power the person served. Multiple countries may be indicated together with the corresponding dates. This field should not be used to indicate a particular service branch, which is better indicated by the branch field. # noqa: E501
:return: The allegiance of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._allegiance
@allegiance.setter
def allegiance(self, allegiance):
"""Sets the allegiance of this Mayor.
The country or other power the person served. Multiple countries may be indicated together with the corresponding dates. This field should not be used to indicate a particular service branch, which is better indicated by the branch field. # noqa: E501
:param allegiance: The allegiance of this Mayor. # noqa: E501
:type: list[str]
"""
self._allegiance = allegiance
@property
def active_years_start_date_mgr(self):
"""Gets the active_years_start_date_mgr of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The active_years_start_date_mgr of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._active_years_start_date_mgr
@active_years_start_date_mgr.setter
def active_years_start_date_mgr(self, active_years_start_date_mgr):
"""Sets the active_years_start_date_mgr of this Mayor.
Description not available # noqa: E501
:param active_years_start_date_mgr: The active_years_start_date_mgr of this Mayor. # noqa: E501
:type: list[str]
"""
self._active_years_start_date_mgr = active_years_start_date_mgr
@property
def lccn_id(self):
"""Gets the lccn_id of this Mayor. # noqa: E501
Library of Congress Control Number # noqa: E501
:return: The lccn_id of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._lccn_id
@lccn_id.setter
def lccn_id(self, lccn_id):
"""Sets the lccn_id of this Mayor.
Library of Congress Control Number # noqa: E501
:param lccn_id: The lccn_id of this Mayor. # noqa: E501
:type: list[str]
"""
self._lccn_id = lccn_id
@property
def tattoo(self):
"""Gets the tattoo of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The tattoo of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._tattoo
@tattoo.setter
def tattoo(self, tattoo):
"""Sets the tattoo of this Mayor.
Description not available # noqa: E501
:param tattoo: The tattoo of this Mayor. # noqa: E501
:type: list[str]
"""
self._tattoo = tattoo
@property
def british_wins(self):
"""Gets the british_wins of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The british_wins of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._british_wins
@british_wins.setter
def british_wins(self, british_wins):
"""Sets the british_wins of this Mayor.
Description not available # noqa: E501
:param british_wins: The british_wins of this Mayor. # noqa: E501
:type: list[object]
"""
self._british_wins = british_wins
@property
def hip_size(self):
"""Gets the hip_size of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The hip_size of this Mayor. # noqa: E501
:rtype: list[float]
"""
return self._hip_size
@hip_size.setter
def hip_size(self, hip_size):
"""Sets the hip_size of this Mayor.
Description not available # noqa: E501
:param hip_size: The hip_size of this Mayor. # noqa: E501
:type: list[float]
"""
self._hip_size = hip_size
@property
def podium(self):
"""Gets the podium of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The podium of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._podium
@podium.setter
def podium(self, podium):
"""Sets the podium of this Mayor.
Description not available # noqa: E501
:param podium: The podium of this Mayor. # noqa: E501
:type: list[int]
"""
self._podium = podium
@property
def seiyu(self):
"""Gets the seiyu of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The seiyu of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._seiyu
@seiyu.setter
def seiyu(self, seiyu):
"""Sets the seiyu of this Mayor.
Description not available # noqa: E501
:param seiyu: The seiyu of this Mayor. # noqa: E501
:type: list[object]
"""
self._seiyu = seiyu
@property
def player_season(self):
"""Gets the player_season of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The player_season of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._player_season
@player_season.setter
def player_season(self, player_season):
"""Sets the player_season of this Mayor.
Description not available # noqa: E501
:param player_season: The player_season of this Mayor. # noqa: E501
:type: list[object]
"""
self._player_season = player_season
@property
def short_prog_score(self):
"""Gets the short_prog_score of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The short_prog_score of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._short_prog_score
@short_prog_score.setter
def short_prog_score(self, short_prog_score):
"""Sets the short_prog_score of this Mayor.
Description not available # noqa: E501
:param short_prog_score: The short_prog_score of this Mayor. # noqa: E501
:type: list[str]
"""
self._short_prog_score = short_prog_score
@property
def regional_council(self):
"""Gets the regional_council of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The regional_council of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._regional_council
@regional_council.setter
def regional_council(self, regional_council):
"""Sets the regional_council of this Mayor.
Description not available # noqa: E501
:param regional_council: The regional_council of this Mayor. # noqa: E501
:type: list[object]
"""
self._regional_council = regional_council
@property
def homage(self):
"""Gets the homage of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The homage of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._homage
@homage.setter
def homage(self, homage):
"""Sets the homage of this Mayor.
Description not available # noqa: E501
:param homage: The homage of this Mayor. # noqa: E501
:type: list[str]
"""
self._homage = homage
@property
def shoe_size(self):
"""Gets the shoe_size of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The shoe_size of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._shoe_size
@shoe_size.setter
def shoe_size(self, shoe_size):
"""Sets the shoe_size of this Mayor.
Description not available # noqa: E501
:param shoe_size: The shoe_size of this Mayor. # noqa: E501
:type: list[str]
"""
self._shoe_size = shoe_size
@property
def signature(self):
"""Gets the signature of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The signature of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._signature
@signature.setter
def signature(self, signature):
"""Sets the signature of this Mayor.
Description not available # noqa: E501
:param signature: The signature of this Mayor. # noqa: E501
:type: list[str]
"""
self._signature = signature
@property
def olympic_games_bronze(self):
"""Gets the olympic_games_bronze of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The olympic_games_bronze of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._olympic_games_bronze
@olympic_games_bronze.setter
def olympic_games_bronze(self, olympic_games_bronze):
"""Sets the olympic_games_bronze of this Mayor.
Description not available # noqa: E501
:param olympic_games_bronze: The olympic_games_bronze of this Mayor. # noqa: E501
:type: list[int]
"""
self._olympic_games_bronze = olympic_games_bronze
@property
def danse_score(self):
"""Gets the danse_score of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The danse_score of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._danse_score
@danse_score.setter
def danse_score(self, danse_score):
"""Sets the danse_score of this Mayor.
Description not available # noqa: E501
:param danse_score: The danse_score of this Mayor. # noqa: E501
:type: list[str]
"""
self._danse_score = danse_score
@property
def id_number(self):
"""Gets the id_number of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The id_number of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._id_number
@id_number.setter
def id_number(self, id_number):
"""Sets the id_number of this Mayor.
Description not available # noqa: E501
:param id_number: The id_number of this Mayor. # noqa: E501
:type: list[int]
"""
self._id_number = id_number
@property
def short_prog_competition(self):
"""Gets the short_prog_competition of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The short_prog_competition of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._short_prog_competition
@short_prog_competition.setter
def short_prog_competition(self, short_prog_competition):
"""Sets the short_prog_competition of this Mayor.
Description not available # noqa: E501
:param short_prog_competition: The short_prog_competition of this Mayor. # noqa: E501
:type: list[str]
"""
self._short_prog_competition = short_prog_competition
@property
def active_years_start_year_mgr(self):
"""Gets the active_years_start_year_mgr of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The active_years_start_year_mgr of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._active_years_start_year_mgr
@active_years_start_year_mgr.setter
def active_years_start_year_mgr(self, active_years_start_year_mgr):
"""Sets the active_years_start_year_mgr of this Mayor.
Description not available # noqa: E501
:param active_years_start_year_mgr: The active_years_start_year_mgr of this Mayor. # noqa: E501
:type: list[str]
"""
self._active_years_start_year_mgr = active_years_start_year_mgr
@property
def wedding_parents_date(self):
"""Gets the wedding_parents_date of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The wedding_parents_date of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._wedding_parents_date
@wedding_parents_date.setter
def wedding_parents_date(self, wedding_parents_date):
"""Sets the wedding_parents_date of this Mayor.
Description not available # noqa: E501
:param wedding_parents_date: The wedding_parents_date of this Mayor. # noqa: E501
:type: list[str]
"""
self._wedding_parents_date = wedding_parents_date
@property
def birth_place(self):
"""Gets the birth_place of this Mayor. # noqa: E501
where the person was born # noqa: E501
:return: The birth_place of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._birth_place
@birth_place.setter
def birth_place(self, birth_place):
"""Sets the birth_place of this Mayor.
where the person was born # noqa: E501
:param birth_place: The birth_place of this Mayor. # noqa: E501
:type: list[object]
"""
self._birth_place = birth_place
@property
def world(self):
"""Gets the world of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The world of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._world
@world.setter
def world(self, world):
"""Sets the world of this Mayor.
Description not available # noqa: E501
:param world: The world of this Mayor. # noqa: E501
:type: list[object]
"""
self._world = world
@property
def astrological_sign(self):
"""Gets the astrological_sign of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The astrological_sign of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._astrological_sign
@astrological_sign.setter
def astrological_sign(self, astrological_sign):
"""Sets the astrological_sign of this Mayor.
Description not available # noqa: E501
:param astrological_sign: The astrological_sign of this Mayor. # noqa: E501
:type: list[object]
"""
self._astrological_sign = astrological_sign
@property
def eye_color(self):
"""Gets the eye_color of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The eye_color of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._eye_color
@eye_color.setter
def eye_color(self, eye_color):
"""Sets the eye_color of this Mayor.
Description not available # noqa: E501
:param eye_color: The eye_color of this Mayor. # noqa: E501
:type: list[object]
"""
self._eye_color = eye_color
@property
def networth(self):
"""Gets the networth of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The networth of this Mayor. # noqa: E501
:rtype: list[float]
"""
return self._networth
@networth.setter
def networth(self, networth):
"""Sets the networth of this Mayor.
Description not available # noqa: E501
:param networth: The networth of this Mayor. # noqa: E501
:type: list[float]
"""
self._networth = networth
@property
def coalition(self):
"""Gets the coalition of this Mayor. # noqa: E501
Παλαιότερα ο συνασπισμός χρησιμοποιούνταν ως στρατιωτικός όρος που υποδήλωνε την όμορη παράταξη πολεμιστών κατά την οποία ο κάθε στρατιώτης προφύλασσε τον διπλανό του με την ασπίδα του. # noqa: E501
:return: The coalition of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._coalition
@coalition.setter
def coalition(self, coalition):
"""Sets the coalition of this Mayor.
Παλαιότερα ο συνασπισμός χρησιμοποιούνταν ως στρατιωτικός όρος που υποδήλωνε την όμορη παράταξη πολεμιστών κατά την οποία ο κάθε στρατιώτης προφύλασσε τον διπλανό του με την ασπίδα του. # noqa: E501
:param coalition: The coalition of this Mayor. # noqa: E501
:type: list[str]
"""
self._coalition = coalition
@property
def national_team_match_point(self):
"""Gets the national_team_match_point of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The national_team_match_point of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._national_team_match_point
@national_team_match_point.setter
def national_team_match_point(self, national_team_match_point):
"""Sets the national_team_match_point of this Mayor.
Description not available # noqa: E501
:param national_team_match_point: The national_team_match_point of this Mayor. # noqa: E501
:type: list[str]
"""
self._national_team_match_point = national_team_match_point
@property
def national_selection(self):
"""Gets the national_selection of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The national_selection of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._national_selection
@national_selection.setter
def national_selection(self, national_selection):
"""Sets the national_selection of this Mayor.
Description not available # noqa: E501
:param national_selection: The national_selection of this Mayor. # noqa: E501
:type: list[object]
"""
self._national_selection = national_selection
@property
def agency(self):
"""Gets the agency of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The agency of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._agency
@agency.setter
def agency(self, agency):
"""Sets the agency of this Mayor.
Description not available # noqa: E501
:param agency: The agency of this Mayor. # noqa: E501
:type: list[object]
"""
self._agency = agency
@property
def start_wqs(self):
"""Gets the start_wqs of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The start_wqs of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._start_wqs
@start_wqs.setter
def start_wqs(self, start_wqs):
"""Sets the start_wqs of this Mayor.
Description not available # noqa: E501
:param start_wqs: The start_wqs of this Mayor. # noqa: E501
:type: list[str]
"""
self._start_wqs = start_wqs
@property
def defeat_as_mgr(self):
"""Gets the defeat_as_mgr of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The defeat_as_mgr of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._defeat_as_mgr
@defeat_as_mgr.setter
def defeat_as_mgr(self, defeat_as_mgr):
"""Sets the defeat_as_mgr of this Mayor.
Description not available # noqa: E501
:param defeat_as_mgr: The defeat_as_mgr of this Mayor. # noqa: E501
:type: list[int]
"""
self._defeat_as_mgr = defeat_as_mgr
@property
def death_year(self):
"""Gets the death_year of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The death_year of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._death_year
@death_year.setter
def death_year(self, death_year):
"""Sets the death_year of this Mayor.
Description not available # noqa: E501
:param death_year: The death_year of this Mayor. # noqa: E501
:type: list[str]
"""
self._death_year = death_year
@property
def world_tournament_gold(self):
"""Gets the world_tournament_gold of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The world_tournament_gold of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._world_tournament_gold
@world_tournament_gold.setter
def world_tournament_gold(self, world_tournament_gold):
"""Sets the world_tournament_gold of this Mayor.
Description not available # noqa: E501
:param world_tournament_gold: The world_tournament_gold of this Mayor. # noqa: E501
:type: list[int]
"""
self._world_tournament_gold = world_tournament_gold
@property
def pga_wins(self):
"""Gets the pga_wins of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The pga_wins of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._pga_wins
@pga_wins.setter
def pga_wins(self, pga_wins):
"""Sets the pga_wins of this Mayor.
Description not available # noqa: E501
:param pga_wins: The pga_wins of this Mayor. # noqa: E501
:type: list[object]
"""
self._pga_wins = pga_wins
@property
def board(self):
"""Gets the board of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The board of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._board
@board.setter
def board(self, board):
"""Sets the board of this Mayor.
Description not available # noqa: E501
:param board: The board of this Mayor. # noqa: E501
:type: list[object]
"""
self._board = board
@property
def rid_id(self):
"""Gets the rid_id of this Mayor. # noqa: E501
An identifying system for scientific authors. The system was introduced in January 2008 by Thomson Reuters. The combined use of the Digital Object Identifier with the ResearcherID allows for a unique association of authors and scientific articles. # noqa: E501
:return: The rid_id of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._rid_id
@rid_id.setter
def rid_id(self, rid_id):
"""Sets the rid_id of this Mayor.
An identifying system for scientific authors. The system was introduced in January 2008 by Thomson Reuters. The combined use of the Digital Object Identifier with the ResearcherID allows for a unique association of authors and scientific articles. # noqa: E501
:param rid_id: The rid_id of this Mayor. # noqa: E501
:type: list[str]
"""
self._rid_id = rid_id
@property
def dead_in_fight_date(self):
"""Gets the dead_in_fight_date of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The dead_in_fight_date of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._dead_in_fight_date
@dead_in_fight_date.setter
def dead_in_fight_date(self, dead_in_fight_date):
"""Sets the dead_in_fight_date of this Mayor.
Description not available # noqa: E501
:param dead_in_fight_date: The dead_in_fight_date of this Mayor. # noqa: E501
:type: list[str]
"""
self._dead_in_fight_date = dead_in_fight_date
@property
def related_functions(self):
"""Gets the related_functions of this Mayor. # noqa: E501
This property is to accommodate the list field that contains a list of related personFunctions a person holds or has held # noqa: E501
:return: The related_functions of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._related_functions
@related_functions.setter
def related_functions(self, related_functions):
"""Sets the related_functions of this Mayor.
This property is to accommodate the list field that contains a list of related personFunctions a person holds or has held # noqa: E501
:param related_functions: The related_functions of this Mayor. # noqa: E501
:type: list[object]
"""
self._related_functions = related_functions
@property
def manager_season(self):
"""Gets the manager_season of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The manager_season of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._manager_season
@manager_season.setter
def manager_season(self, manager_season):
"""Sets the manager_season of this Mayor.
Description not available # noqa: E501
:param manager_season: The manager_season of this Mayor. # noqa: E501
:type: list[object]
"""
self._manager_season = manager_season
@property
def reign(self):
"""Gets the reign of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The reign of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._reign
@reign.setter
def reign(self, reign):
"""Sets the reign of this Mayor.
Description not available # noqa: E501
:param reign: The reign of this Mayor. # noqa: E501
:type: list[str]
"""
self._reign = reign
@property
def second(self):
"""Gets the second of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The second of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._second
@second.setter
def second(self, second):
"""Sets the second of this Mayor.
Description not available # noqa: E501
:param second: The second of this Mayor. # noqa: E501
:type: list[int]
"""
self._second = second
@property
def radio(self):
"""Gets the radio of this Mayor. # noqa: E501
To ραδιόφωνο είναι η συσκευή που λειτουργεί ως \"ραδιοδέκτης - μετατροπέας\" όπου λαμβάνοντας τις ραδιοφωνικές εκπομπές των ραδιοφωνικών σταθμών τις μετατρέπει σε ήχο. # noqa: E501
:return: The radio of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._radio
@radio.setter
def radio(self, radio):
"""Sets the radio of this Mayor.
To ραδιόφωνο είναι η συσκευή που λειτουργεί ως \"ραδιοδέκτης - μετατροπέας\" όπου λαμβάνοντας τις ραδιοφωνικές εκπομπές των ραδιοφωνικών σταθμών τις μετατρέπει σε ήχο. # noqa: E501
:param radio: The radio of this Mayor. # noqa: E501
:type: list[object]
"""
self._radio = radio
@property
def full_competition(self):
"""Gets the full_competition of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The full_competition of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._full_competition
@full_competition.setter
def full_competition(self, full_competition):
"""Sets the full_competition of this Mayor.
Description not available # noqa: E501
:param full_competition: The full_competition of this Mayor. # noqa: E501
:type: list[str]
"""
self._full_competition = full_competition
@property
def free_score_competition(self):
"""Gets the free_score_competition of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The free_score_competition of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._free_score_competition
@free_score_competition.setter
def free_score_competition(self, free_score_competition):
"""Sets the free_score_competition of this Mayor.
Description not available # noqa: E501
:param free_score_competition: The free_score_competition of this Mayor. # noqa: E501
:type: list[str]
"""
self._free_score_competition = free_score_competition
@property
def prefect(self):
"""Gets the prefect of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The prefect of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._prefect
@prefect.setter
def prefect(self, prefect):
"""Sets the prefect of this Mayor.
Description not available # noqa: E501
:param prefect: The prefect of this Mayor. # noqa: E501
:type: list[object]
"""
self._prefect = prefect
@property
def publication(self):
"""Gets the publication of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The publication of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._publication
@publication.setter
def publication(self, publication):
"""Sets the publication of this Mayor.
Description not available # noqa: E501
:param publication: The publication of this Mayor. # noqa: E501
:type: list[str]
"""
self._publication = publication
@property
def opponent(self):
"""Gets the opponent of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The opponent of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._opponent
@opponent.setter
def opponent(self, opponent):
"""Sets the opponent of this Mayor.
Description not available # noqa: E501
:param opponent: The opponent of this Mayor. # noqa: E501
:type: list[object]
"""
self._opponent = opponent
@property
def employer(self):
"""Gets the employer of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The employer of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._employer
@employer.setter
def employer(self, employer):
"""Sets the employer of this Mayor.
Description not available # noqa: E501
:param employer: The employer of this Mayor. # noqa: E501
:type: list[object]
"""
self._employer = employer
@property
def affair(self):
"""Gets the affair of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The affair of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._affair
@affair.setter
def affair(self, affair):
"""Sets the affair of this Mayor.
Description not available # noqa: E501
:param affair: The affair of this Mayor. # noqa: E501
:type: list[str]
"""
self._affair = affair
@property
def body_discovered(self):
"""Gets the body_discovered of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The body_discovered of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._body_discovered
@body_discovered.setter
def body_discovered(self, body_discovered):
"""Sets the body_discovered of this Mayor.
Description not available # noqa: E501
:param body_discovered: The body_discovered of this Mayor. # noqa: E501
:type: list[object]
"""
self._body_discovered = body_discovered
@property
def buried_place(self):
"""Gets the buried_place of this Mayor. # noqa: E501
The place where the person has been buried. # noqa: E501
:return: The buried_place of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._buried_place
@buried_place.setter
def buried_place(self, buried_place):
"""Sets the buried_place of this Mayor.
The place where the person has been buried. # noqa: E501
:param buried_place: The buried_place of this Mayor. # noqa: E501
:type: list[object]
"""
self._buried_place = buried_place
@property
def residence(self):
"""Gets the residence of this Mayor. # noqa: E501
Place of residence of a person. # noqa: E501
:return: The residence of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._residence
@residence.setter
def residence(self, residence):
"""Sets the residence of this Mayor.
Place of residence of a person. # noqa: E501
:param residence: The residence of this Mayor. # noqa: E501
:type: list[object]
"""
self._residence = residence
@property
def usurper(self):
"""Gets the usurper of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The usurper of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._usurper
@usurper.setter
def usurper(self, usurper):
"""Sets the usurper of this Mayor.
Description not available # noqa: E501
:param usurper: The usurper of this Mayor. # noqa: E501
:type: list[object]
"""
self._usurper = usurper
@property
def other_occupation(self):
"""Gets the other_occupation of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The other_occupation of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._other_occupation
@other_occupation.setter
def other_occupation(self, other_occupation):
"""Sets the other_occupation of this Mayor.
Description not available # noqa: E501
:param other_occupation: The other_occupation of this Mayor. # noqa: E501
:type: list[object]
"""
self._other_occupation = other_occupation
@property
def contest(self):
"""Gets the contest of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The contest of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._contest
@contest.setter
def contest(self, contest):
"""Sets the contest of this Mayor.
Description not available # noqa: E501
:param contest: The contest of this Mayor. # noqa: E501
:type: list[object]
"""
self._contest = contest
@property
def active_years_end_date_mgr(self):
"""Gets the active_years_end_date_mgr of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The active_years_end_date_mgr of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._active_years_end_date_mgr
@active_years_end_date_mgr.setter
def active_years_end_date_mgr(self, active_years_end_date_mgr):
"""Sets the active_years_end_date_mgr of this Mayor.
Description not available # noqa: E501
:param active_years_end_date_mgr: The active_years_end_date_mgr of this Mayor. # noqa: E501
:type: list[str]
"""
self._active_years_end_date_mgr = active_years_end_date_mgr
@property
def created(self):
"""Gets the created of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The created of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._created
@created.setter
def created(self, created):
"""Sets the created of this Mayor.
Description not available # noqa: E501
:param created: The created of this Mayor. # noqa: E501
:type: list[object]
"""
self._created = created
@property
def original_danse_score(self):
"""Gets the original_danse_score of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The original_danse_score of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._original_danse_score
@original_danse_score.setter
def original_danse_score(self, original_danse_score):
"""Sets the original_danse_score of this Mayor.
Description not available # noqa: E501
:param original_danse_score: The original_danse_score of this Mayor. # noqa: E501
:type: list[str]
"""
self._original_danse_score = original_danse_score
@property
def end_career(self):
"""Gets the end_career of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The end_career of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._end_career
@end_career.setter
def end_career(self, end_career):
"""Sets the end_career of this Mayor.
Description not available # noqa: E501
:param end_career: The end_career of this Mayor. # noqa: E501
:type: list[str]
"""
self._end_career = end_career
@property
def note_on_resting_place(self):
"""Gets the note_on_resting_place of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The note_on_resting_place of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._note_on_resting_place
@note_on_resting_place.setter
def note_on_resting_place(self, note_on_resting_place):
"""Sets the note_on_resting_place of this Mayor.
Description not available # noqa: E501
:param note_on_resting_place: The note_on_resting_place of this Mayor. # noqa: E501
:type: list[str]
"""
self._note_on_resting_place = note_on_resting_place
@property
def army(self):
"""Gets the army of this Mayor. # noqa: E501
Ένας στρατός αποτελεί τις επίγειες ένοπλες δυνάμεις ενός έθνους # noqa: E501
:return: The army of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._army
@army.setter
def army(self, army):
"""Sets the army of this Mayor.
Ένας στρατός αποτελεί τις επίγειες ένοπλες δυνάμεις ενός έθνους # noqa: E501
:param army: The army of this Mayor. # noqa: E501
:type: list[str]
"""
self._army = army
@property
def active_year(self):
"""Gets the active_year of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The active_year of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._active_year
@active_year.setter
def active_year(self, active_year):
"""Sets the active_year of this Mayor.
Description not available # noqa: E501
:param active_year: The active_year of this Mayor. # noqa: E501
:type: list[str]
"""
self._active_year = active_year
@property
def person_function(self):
"""Gets the person_function of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The person_function of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._person_function
@person_function.setter
def person_function(self, person_function):
"""Sets the person_function of this Mayor.
Description not available # noqa: E501
:param person_function: The person_function of this Mayor. # noqa: E501
:type: list[object]
"""
self._person_function = person_function
@property
def pro_since(self):
"""Gets the pro_since of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The pro_since of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._pro_since
@pro_since.setter
def pro_since(self, pro_since):
"""Sets the pro_since of this Mayor.
Description not available # noqa: E501
:param pro_since: The pro_since of this Mayor. # noqa: E501
:type: list[str]
"""
self._pro_since = pro_since
@property
def cause_of_death(self):
"""Gets the cause_of_death of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The cause_of_death of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._cause_of_death
@cause_of_death.setter
def cause_of_death(self, cause_of_death):
"""Sets the cause_of_death of this Mayor.
Description not available # noqa: E501
:param cause_of_death: The cause_of_death of this Mayor. # noqa: E501
:type: list[str]
"""
self._cause_of_death = cause_of_death
@property
def dubber(self):
"""Gets the dubber of this Mayor. # noqa: E501
the person who dubs another person e.g. an actor or a fictional character in movies # noqa: E501
:return: The dubber of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._dubber
@dubber.setter
def dubber(self, dubber):
"""Sets the dubber of this Mayor.
the person who dubs another person e.g. an actor or a fictional character in movies # noqa: E501
:param dubber: The dubber of this Mayor. # noqa: E501
:type: list[object]
"""
self._dubber = dubber
@property
def non_professional_career(self):
"""Gets the non_professional_career of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The non_professional_career of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._non_professional_career
@non_professional_career.setter
def non_professional_career(self, non_professional_career):
"""Sets the non_professional_career of this Mayor.
Description not available # noqa: E501
:param non_professional_career: The non_professional_career of this Mayor. # noqa: E501
:type: list[str]
"""
self._non_professional_career = non_professional_career
@property
def military_function(self):
"""Gets the military_function of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The military_function of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._military_function
@military_function.setter
def military_function(self, military_function):
"""Sets the military_function of this Mayor.
Description not available # noqa: E501
:param military_function: The military_function of this Mayor. # noqa: E501
:type: list[str]
"""
self._military_function = military_function
@property
def patent(self):
"""Gets the patent of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The patent of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._patent
@patent.setter
def patent(self, patent):
"""Sets the patent of this Mayor.
Description not available # noqa: E501
:param patent: The patent of this Mayor. # noqa: E501
:type: list[object]
"""
self._patent = patent
@property
def creation_christian_bishop(self):
"""Gets the creation_christian_bishop of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The creation_christian_bishop of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._creation_christian_bishop
@creation_christian_bishop.setter
def creation_christian_bishop(self, creation_christian_bishop):
"""Sets the creation_christian_bishop of this Mayor.
Description not available # noqa: E501
:param creation_christian_bishop: The creation_christian_bishop of this Mayor. # noqa: E501
:type: list[str]
"""
self._creation_christian_bishop = creation_christian_bishop
@property
def piercing(self):
"""Gets the piercing of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The piercing of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._piercing
@piercing.setter
def piercing(self, piercing):
"""Sets the piercing of this Mayor.
Description not available # noqa: E501
:param piercing: The piercing of this Mayor. # noqa: E501
:type: list[str]
"""
self._piercing = piercing
@property
def student(self):
"""Gets the student of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The student of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._student
@student.setter
def student(self, student):
"""Sets the student of this Mayor.
Description not available # noqa: E501
:param student: The student of this Mayor. # noqa: E501
:type: list[object]
"""
self._student = student
@property
def bad_guy(self):
"""Gets the bad_guy of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The bad_guy of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._bad_guy
@bad_guy.setter
def bad_guy(self, bad_guy):
"""Sets the bad_guy of this Mayor.
Description not available # noqa: E501
:param bad_guy: The bad_guy of this Mayor. # noqa: E501
:type: list[str]
"""
self._bad_guy = bad_guy
@property
def influenced(self):
"""Gets the influenced of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The influenced of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._influenced
@influenced.setter
def influenced(self, influenced):
"""Sets the influenced of this Mayor.
Description not available # noqa: E501
:param influenced: The influenced of this Mayor. # noqa: E501
:type: list[object]
"""
self._influenced = influenced
@property
def start_reign(self):
"""Gets the start_reign of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The start_reign of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._start_reign
@start_reign.setter
def start_reign(self, start_reign):
"""Sets the start_reign of this Mayor.
Description not available # noqa: E501
:param start_reign: The start_reign of this Mayor. # noqa: E501
:type: list[object]
"""
self._start_reign = start_reign
@property
def university(self):
"""Gets the university of this Mayor. # noqa: E501
university a person goes or went to. # noqa: E501
:return: The university of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._university
@university.setter
def university(self, university):
"""Sets the university of this Mayor.
university a person goes or went to. # noqa: E501
:param university: The university of this Mayor. # noqa: E501
:type: list[object]
"""
self._university = university
@property
def gym_apparatus(self):
"""Gets the gym_apparatus of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The gym_apparatus of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._gym_apparatus
@gym_apparatus.setter
def gym_apparatus(self, gym_apparatus):
"""Sets the gym_apparatus of this Mayor.
Description not available # noqa: E501
:param gym_apparatus: The gym_apparatus of this Mayor. # noqa: E501
:type: list[object]
"""
self._gym_apparatus = gym_apparatus
@property
def ideology(self):
"""Gets the ideology of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The ideology of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._ideology
@ideology.setter
def ideology(self, ideology):
"""Sets the ideology of this Mayor.
Description not available # noqa: E501
:param ideology: The ideology of this Mayor. # noqa: E501
:type: list[object]
"""
self._ideology = ideology
@property
def conviction_date(self):
"""Gets the conviction_date of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The conviction_date of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._conviction_date
@conviction_date.setter
def conviction_date(self, conviction_date):
"""Sets the conviction_date of this Mayor.
Description not available # noqa: E501
:param conviction_date: The conviction_date of this Mayor. # noqa: E501
:type: list[str]
"""
self._conviction_date = conviction_date
@property
def media(self):
"""Gets the media of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The media of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._media
@media.setter
def media(self, media):
"""Sets the media of this Mayor.
Description not available # noqa: E501
:param media: The media of this Mayor. # noqa: E501
:type: list[object]
"""
self._media = media
@property
def bnf_id(self):
"""Gets the bnf_id of this Mayor. # noqa: E501
Authority data of people listed in the general catalogue of the National Library of France # noqa: E501
:return: The bnf_id of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._bnf_id
@bnf_id.setter
def bnf_id(self, bnf_id):
"""Sets the bnf_id of this Mayor.
Authority data of people listed in the general catalogue of the National Library of France # noqa: E501
:param bnf_id: The bnf_id of this Mayor. # noqa: E501
:type: list[str]
"""
self._bnf_id = bnf_id
@property
def pseudonym(self):
"""Gets the pseudonym of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The pseudonym of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._pseudonym
@pseudonym.setter
def pseudonym(self, pseudonym):
"""Sets the pseudonym of this Mayor.
Description not available # noqa: E501
:param pseudonym: The pseudonym of this Mayor. # noqa: E501
:type: list[str]
"""
self._pseudonym = pseudonym
@property
def temple_year(self):
"""Gets the temple_year of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The temple_year of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._temple_year
@temple_year.setter
def temple_year(self, temple_year):
"""Sets the temple_year of this Mayor.
Description not available # noqa: E501
:param temple_year: The temple_year of this Mayor. # noqa: E501
:type: list[str]
"""
self._temple_year = temple_year
@property
def clothing_size(self):
"""Gets the clothing_size of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The clothing_size of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._clothing_size
@clothing_size.setter
def clothing_size(self, clothing_size):
"""Sets the clothing_size of this Mayor.
Description not available # noqa: E501
:param clothing_size: The clothing_size of this Mayor. # noqa: E501
:type: list[str]
"""
self._clothing_size = clothing_size
@property
def speciality(self):
"""Gets the speciality of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The speciality of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._speciality
@speciality.setter
def speciality(self, speciality):
"""Sets the speciality of this Mayor.
Description not available # noqa: E501
:param speciality: The speciality of this Mayor. # noqa: E501
:type: list[str]
"""
self._speciality = speciality
@property
def award(self):
"""Gets the award of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The award of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._award
@award.setter
def award(self, award):
"""Sets the award of this Mayor.
Description not available # noqa: E501
:param award: The award of this Mayor. # noqa: E501
:type: list[object]
"""
self._award = award
@property
def kind_of_criminal_action(self):
"""Gets the kind_of_criminal_action of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The kind_of_criminal_action of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._kind_of_criminal_action
@kind_of_criminal_action.setter
def kind_of_criminal_action(self, kind_of_criminal_action):
"""Sets the kind_of_criminal_action of this Mayor.
Description not available # noqa: E501
:param kind_of_criminal_action: The kind_of_criminal_action of this Mayor. # noqa: E501
:type: list[str]
"""
self._kind_of_criminal_action = kind_of_criminal_action
@property
def isni_id(self):
"""Gets the isni_id of this Mayor. # noqa: E501
ISNI is a method for uniquely identifying the public identities of contributors to media content such as books, TV programmes, and newspaper articles. # noqa: E501
:return: The isni_id of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._isni_id
@isni_id.setter
def isni_id(self, isni_id):
"""Sets the isni_id of this Mayor.
ISNI is a method for uniquely identifying the public identities of contributors to media content such as books, TV programmes, and newspaper articles. # noqa: E501
:param isni_id: The isni_id of this Mayor. # noqa: E501
:type: list[str]
"""
self._isni_id = isni_id
@property
def significant_project(self):
"""Gets the significant_project of this Mayor. # noqa: E501
A siginificant artifact constructed by the person. # noqa: E501
:return: The significant_project of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._significant_project
@significant_project.setter
def significant_project(self, significant_project):
"""Sets the significant_project of this Mayor.
A siginificant artifact constructed by the person. # noqa: E501
:param significant_project: The significant_project of this Mayor. # noqa: E501
:type: list[object]
"""
self._significant_project = significant_project
@property
def leadership(self):
"""Gets the leadership of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The leadership of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._leadership
@leadership.setter
def leadership(self, leadership):
"""Sets the leadership of this Mayor.
Description not available # noqa: E501
:param leadership: The leadership of this Mayor. # noqa: E501
:type: list[str]
"""
self._leadership = leadership
@property
def death_date(self):
"""Gets the death_date of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The death_date of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._death_date
@death_date.setter
def death_date(self, death_date):
"""Sets the death_date of this Mayor.
Description not available # noqa: E501
:param death_date: The death_date of this Mayor. # noqa: E501
:type: list[str]
"""
self._death_date = death_date
@property
def special_trial(self):
"""Gets the special_trial of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The special_trial of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._special_trial
@special_trial.setter
def special_trial(self, special_trial):
"""Sets the special_trial of this Mayor.
Description not available # noqa: E501
:param special_trial: The special_trial of this Mayor. # noqa: E501
:type: list[int]
"""
self._special_trial = special_trial
@property
def resting_date(self):
"""Gets the resting_date of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The resting_date of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._resting_date
@resting_date.setter
def resting_date(self, resting_date):
"""Sets the resting_date of this Mayor.
Description not available # noqa: E501
:param resting_date: The resting_date of this Mayor. # noqa: E501
:type: list[str]
"""
self._resting_date = resting_date
@property
def victim(self):
"""Gets the victim of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The victim of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._victim
@victim.setter
def victim(self, victim):
"""Sets the victim of this Mayor.
Description not available # noqa: E501
:param victim: The victim of this Mayor. # noqa: E501
:type: list[str]
"""
self._victim = victim
@property
def has_natural_bust(self):
"""Gets the has_natural_bust of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The has_natural_bust of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._has_natural_bust
@has_natural_bust.setter
def has_natural_bust(self, has_natural_bust):
"""Sets the has_natural_bust of this Mayor.
Description not available # noqa: E501
:param has_natural_bust: The has_natural_bust of this Mayor. # noqa: E501
:type: list[str]
"""
self._has_natural_bust = has_natural_bust
@property
def masters_wins(self):
"""Gets the masters_wins of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The masters_wins of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._masters_wins
@masters_wins.setter
def masters_wins(self, masters_wins):
"""Sets the masters_wins of this Mayor.
Description not available # noqa: E501
:param masters_wins: The masters_wins of this Mayor. # noqa: E501
:type: list[object]
"""
self._masters_wins = masters_wins
@property
def individualised_pnd(self):
"""Gets the individualised_pnd of this Mayor. # noqa: E501
PND (Personennamendatei) data about a person. PND is published by the German National Library. For each person there is a record with her/his name, birth and occupation connected with a unique identifier, the PND number. # noqa: E501
:return: The individualised_pnd of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._individualised_pnd
@individualised_pnd.setter
def individualised_pnd(self, individualised_pnd):
"""Sets the individualised_pnd of this Mayor.
PND (Personennamendatei) data about a person. PND is published by the German National Library. For each person there is a record with her/his name, birth and occupation connected with a unique identifier, the PND number. # noqa: E501
:param individualised_pnd: The individualised_pnd of this Mayor. # noqa: E501
:type: list[int]
"""
self._individualised_pnd = individualised_pnd
@property
def continental_tournament_gold(self):
"""Gets the continental_tournament_gold of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The continental_tournament_gold of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._continental_tournament_gold
@continental_tournament_gold.setter
def continental_tournament_gold(self, continental_tournament_gold):
"""Sets the continental_tournament_gold of this Mayor.
Description not available # noqa: E501
:param continental_tournament_gold: The continental_tournament_gold of this Mayor. # noqa: E501
:type: list[int]
"""
self._continental_tournament_gold = continental_tournament_gold
@property
def orientation(self):
"""Gets the orientation of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The orientation of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._orientation
@orientation.setter
def orientation(self, orientation):
"""Sets the orientation of this Mayor.
Description not available # noqa: E501
:param orientation: The orientation of this Mayor. # noqa: E501
:type: list[str]
"""
self._orientation = orientation
@property
def grave(self):
"""Gets the grave of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The grave of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._grave
@grave.setter
def grave(self, grave):
"""Sets the grave of this Mayor.
Description not available # noqa: E501
:param grave: The grave of this Mayor. # noqa: E501
:type: list[str]
"""
self._grave = grave
@property
def resting_place(self):
"""Gets the resting_place of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The resting_place of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._resting_place
@resting_place.setter
def resting_place(self, resting_place):
"""Sets the resting_place of this Mayor.
Description not available # noqa: E501
:param resting_place: The resting_place of this Mayor. # noqa: E501
:type: list[object]
"""
self._resting_place = resting_place
@property
def abbeychurch_blessing_charge(self):
"""Gets the abbeychurch_blessing_charge of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The abbeychurch_blessing_charge of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._abbeychurch_blessing_charge
@abbeychurch_blessing_charge.setter
def abbeychurch_blessing_charge(self, abbeychurch_blessing_charge):
"""Sets the abbeychurch_blessing_charge of this Mayor.
Description not available # noqa: E501
:param abbeychurch_blessing_charge: The abbeychurch_blessing_charge of this Mayor. # noqa: E501
:type: list[str]
"""
self._abbeychurch_blessing_charge = abbeychurch_blessing_charge
@property
def handisport(self):
"""Gets the handisport of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The handisport of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._handisport
@handisport.setter
def handisport(self, handisport):
"""Sets the handisport of this Mayor.
Description not available # noqa: E501
:param handisport: The handisport of this Mayor. # noqa: E501
:type: list[str]
"""
self._handisport = handisport
@property
def external_ornament(self):
"""Gets the external_ornament of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The external_ornament of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._external_ornament
@external_ornament.setter
def external_ornament(self, external_ornament):
"""Sets the external_ornament of this Mayor.
Description not available # noqa: E501
:param external_ornament: The external_ornament of this Mayor. # noqa: E501
:type: list[str]
"""
self._external_ornament = external_ornament
@property
def third(self):
"""Gets the third of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The third of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._third
@third.setter
def third(self, third):
"""Sets the third of this Mayor.
Description not available # noqa: E501
:param third: The third of this Mayor. # noqa: E501
:type: list[int]
"""
self._third = third
@property
def film_number(self):
"""Gets the film_number of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The film_number of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._film_number
@film_number.setter
def film_number(self, film_number):
"""Sets the film_number of this Mayor.
Description not available # noqa: E501
:param film_number: The film_number of this Mayor. # noqa: E501
:type: list[int]
"""
self._film_number = film_number
@property
def temple(self):
"""Gets the temple of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The temple of this Mayor. # noqa: E501
:rtype: list[str]
"""
return self._temple
@temple.setter
def temple(self, temple):
"""Sets the temple of this Mayor.
Description not available # noqa: E501
:param temple: The temple of this Mayor. # noqa: E501
:type: list[str]
"""
self._temple = temple
@property
def end_reign(self):
"""Gets the end_reign of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The end_reign of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._end_reign
@end_reign.setter
def end_reign(self, end_reign):
"""Sets the end_reign of this Mayor.
Description not available # noqa: E501
:param end_reign: The end_reign of this Mayor. # noqa: E501
:type: list[object]
"""
self._end_reign = end_reign
@property
def national_tournament_gold(self):
"""Gets the national_tournament_gold of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The national_tournament_gold of this Mayor. # noqa: E501
:rtype: list[int]
"""
return self._national_tournament_gold
@national_tournament_gold.setter
def national_tournament_gold(self, national_tournament_gold):
"""Sets the national_tournament_gold of this Mayor.
Description not available # noqa: E501
:param national_tournament_gold: The national_tournament_gold of this Mayor. # noqa: E501
:type: list[int]
"""
self._national_tournament_gold = national_tournament_gold
@property
def death_cause(self):
"""Gets the death_cause of this Mayor. # noqa: E501
Description not available # noqa: E501
:return: The death_cause of this Mayor. # noqa: E501
:rtype: list[object]
"""
return self._death_cause
@death_cause.setter
def death_cause(self, death_cause):
"""Sets the death_cause of this Mayor.
Description not available # noqa: E501
:param death_cause: The death_cause of this Mayor. # noqa: E501
:type: list[object]
"""
self._death_cause = death_cause
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, Mayor):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, Mayor):
return True
return self.to_dict() != other.to_dict()
| [
"maxiosorio@gmail.com"
] | maxiosorio@gmail.com |
7e5e77a073e739f388c40f80557022d7517deed8 | c3b14bad834e9d8ef054573566c769154d8da731 | /www/urls.py | 37b69ebbb382da4954a9cacd095ee2f129eaaf5e | [] | no_license | adufi/Resume_Django | d5109c12222d15973392e53b4b3ffcb89e532c89 | 23860acdd1b86b141f6cca6feb5a27edb4da9dc7 | refs/heads/master | 2022-04-29T01:37:04.566327 | 2019-07-27T17:41:00 | 2019-07-27T17:41:00 | 195,679,343 | 0 | 0 | null | 2022-04-22T21:41:54 | 2019-07-07T17:31:43 | CSS | UTF-8 | Python | false | false | 613 | py | from django.urls import path, re_path, include
from . import views
app_name = 'www'
urlpatterns = [
path('test', views.test, name='test'),
# path('api/skill', views.api_skill, name = 'api_skill'),
# path('api/projects', views.api_projects, name = 'api_projects'),
path('api/skill', views.SkillViewSet.as_view(), name = 'api_skill'),
path('api/target', views.TargetViewSet.as_view(), name = 'api_target'),
path('api/projects', views.ProjectViewSet.as_view(), name = 'api_projects'),
path('', views.index, name='index'),
re_path(r'^(?P<local>[\w-]{2})/$', views.index_local, name='index_local'),
]
| [
"sneelshneider@gmail.com"
] | sneelshneider@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.