blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
281
content_id
stringlengths
40
40
detected_licenses
listlengths
0
57
license_type
stringclasses
2 values
repo_name
stringlengths
6
116
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
313 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
18.2k
668M
star_events_count
int64
0
102k
fork_events_count
int64
0
38.2k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
107 values
src_encoding
stringclasses
20 values
language
stringclasses
1 value
is_vendor
bool
2 classes
is_generated
bool
2 classes
length_bytes
int64
4
6.02M
extension
stringclasses
78 values
content
stringlengths
2
6.02M
authors
listlengths
1
1
author
stringlengths
0
175
6ac47a2b80b00b8628a0e5edd7e2a578430cde8a
7d2442279b6dbaae617e2653ded92e63bb00f573
/neupy/layers/transformations.py
ee9240912d7a646656b8944c68acbf4b57ff406b
[ "MIT" ]
permissive
albertwy/neupy
c830526859b821472592f38033f8475828f2d389
a8a9a8b1c11b8039382c27bf8f826c57e90e8b30
refs/heads/master
2021-06-03T21:23:37.636005
2016-05-24T21:18:25
2016-05-24T21:18:25
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,522
py
import numpy as np import theano.tensor as T from neupy.core.properties import ProperFractionProperty, TypedListProperty from .base import BaseLayer __all__ = ('Dropout', 'Reshape') class Dropout(BaseLayer): """ Dropout layer Parameters ---------- proba : float Fraction of the input units to drop. Value needs to be between 0 and 1. """ proba = ProperFractionProperty(required=True) def __init__(self, proba, **options): options['proba'] = proba super(Dropout, self).__init__(**options) @property def size(self): return self.relate_to_layer.size def output(self, input_value): # Use NumPy seed to make Theano code easely reproducible max_possible_seed = 4e9 seed = np.random.randint(max_possible_seed) theano_random = T.shared_randomstreams.RandomStreams(seed) proba = (1.0 - self.proba) mask = theano_random.binomial(n=1, p=proba, size=input_value.shape, dtype=input_value.dtype) return (mask * input_value) / proba def __repr__(self): return "{name}(proba={proba})".format( name=self.__class__.__name__, proba=self.proba ) class Reshape(BaseLayer): """ Gives a new shape to an input value without changing its data. Parameters ---------- shape : tuple or list New feature shape. ``None`` value means that feature will be flatten in 1D vector. If you need to get the output feature with more that 2 dimensions then you can set up new feature shape using tuples. Defaults to ``None``. """ shape = TypedListProperty() def __init__(self, shape=None, **options): if shape is not None: options['shape'] = shape super(Reshape, self).__init__(**options) def output(self, input_value): """ Reshape the feature space for the input value. Parameters ---------- input_value : array-like or Theano variable """ new_feature_shape = self.shape input_shape = input_value.shape[0] if new_feature_shape is None: output_shape = input_value.shape[1:] new_feature_shape = T.prod(output_shape) output_shape = (input_shape, new_feature_shape) else: output_shape = (input_shape,) + new_feature_shape return T.reshape(input_value, output_shape)
[ "mail@itdxer.com" ]
mail@itdxer.com
4a6ef570763ca65f634debbf519c80ac27f6afee
227654cd915b560b14f49f388d4256a0ce968b16
/customer/migrations/0005_nominee_policy_holder_policy_payment.py
84e9504b4f962acb47e52527884347c3f3081e33
[]
no_license
chitharanjanpraveen/insurance_rdbms_project
cb7d976def7ce3b1a962c4703c53518bcacebb9a
7a41e9a688efdd216001bf100ae59ac2653a15eb
refs/heads/master
2020-03-09T15:37:40.403717
2018-04-25T05:06:05
2018-04-25T05:06:05
128,864,014
0
2
null
2018-04-25T05:06:06
2018-04-10T02:48:11
Python
UTF-8
Python
false
false
1,815
py
# Generated by Django 2.0.4 on 2018-04-10 18:35 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('customer', '0004_auto_20180410_2342'), ] operations = [ migrations.CreateModel( name='nominee', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=70)), ('relationship', models.CharField(max_length=50)), ('DOB', models.DateField()), ('sex', models.CharField(max_length=1)), ('customer_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='customer.customer')), ], ), migrations.CreateModel( name='policy_holder', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('customer_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='customer.customer')), ('pol_no', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='customer.policy')), ], ), migrations.CreateModel( name='policy_payment', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('payment_number', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='customer.policy')), ('policy_number', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='customer.payment')), ], ), ]
[ "chitharanjancharan@gmail.com" ]
chitharanjancharan@gmail.com
022ed9241624bcee603875cdcded80c7a3bd691d
26896dbde024d5e8a1216f9f6bbe215e641d085c
/colleges.py
c4139fb47a1b8ad5246d96f4a1abd458c261b25e
[]
no_license
Romyellenbogen/assn10
8c520cbd35500fd0ce0a21687621a6c4a99fe4f4
ceecc281dbc4e486a0c86218a4da516377fc2db0
refs/heads/master
2020-05-02T16:03:29.491808
2019-03-27T19:12:13
2019-03-27T19:12:13
178,059,035
0
0
null
null
null
null
UTF-8
Python
false
false
746
py
from flask import Flask, render_template from modules import convert_to_dict app = Flask(__name__) application = app collegeList = convert_to_dict("public3.csv") @app.route('/') def index(): ids = [] names = [] for college in collegeList: ids.append(college['Id']) names.append(college['Name']) pairs_list = zip(ids, names) return render_template('index.html', pairs=pairs_list, the_title="Colleges") @app.route('/college/<num>') def detail(num): for college in collegeList: if college['Id'] == num: collegeDict = college break return render_template('college.html', c=collegeDict, the_title=collegeDict['Name']) if __name__ == '__main__': app.run(debug=True)
[ "43319351+Romyellenbogen@users.noreply.github.com" ]
43319351+Romyellenbogen@users.noreply.github.com
dec11357af01c915a67ab8710067b1a3a55ad0ad
3f90f4f6876f77d6b43e4a5759b20e2e8d20e684
/ex10/ex10.py
89d4ec1d631136bdb021736fec2f1dbed4325af0
[]
no_license
kwangilahn/kwang
00d82d1bdca45000ee44fa2be55bdb8bff182c91
df2fa199648ae894cbcf18952f6924a9b897d639
refs/heads/master
2021-01-21T04:47:02.719819
2016-06-07T03:59:57
2016-06-07T03:59:57
54,316,240
0
0
null
null
null
null
UTF-8
Python
false
false
252
py
tabby_cat = "\t I'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* Fishes \t* catnip\n\t* Grass """ print tabby_cat print persian_cat print backslash_cat print fat_cat
[ "CAD Client" ]
CAD Client
e5aca0d6b7938b6734d193163f7dc5763682145e
c6d4fa98b739a64bb55a8750b4aecd0fc0b105fd
/ScanPi/QRbytes/66.py
a9eaa790c24644f8755bc148732af6e70b5c38f8
[]
no_license
NUSTEM-UK/Heart-of-Maker-Faire
de2c2f223c76f54a8b4c460530e56a5c74b65ca3
fa5a1661c63dac3ae982ed080d80d8da0480ed4e
refs/heads/master
2021-06-18T13:14:38.204811
2017-07-18T13:47:49
2017-07-18T13:47:49
73,701,984
2
0
null
null
null
null
UTF-8
Python
false
false
94,946
py
data = [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0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 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 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xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,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0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xF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xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 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, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0x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x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF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0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00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x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,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0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ]
[ "jonathan.sanderson@northumbria.ac.uk" ]
jonathan.sanderson@northumbria.ac.uk
9b6c14c6dd404b7c35140f53cc6de97b3d052e02
8afc8a165c66cd7bbdb56ad9704aa4afdb84ef01
/tirsat/TS.py
a5f0908db7d4649f218bdf6fb5fc15ff5519b634
[]
no_license
esw3/projects
7a5e0d7859ccb201c446b050cb55710af5ca875d
e08ac693a97849d532e4385a3d8b5d8b819222c5
refs/heads/master
2020-03-26T23:44:41.941786
2018-09-24T19:58:28
2018-09-24T19:58:28
145,563,766
0
0
null
null
null
null
UTF-8
Python
false
false
1,607
py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 10 14:50:22 2018 TS diagram @author: cake """ import numpy as np import seawater.g as gsw import matplotlib.pyplot as plt # Extract data from file ********************************* #f = open('CTD_profile.csv', 'r') #data = np.genfromtxt(f, delimiter=',') #f.close() # Create variables with user-friendly names #temp = data[1:,1] #salt = data[1:,2] #del(data) # delete "data"... to keep things clean temp = [0,1,2,3,4,5] salt = [10,15,20,30,32,35] # Figure out boudaries (mins and maxs) smin = salt.min() - (0.01 * salt.min()) smax = salt.max() + (0.01 * salt.max()) tmin = temp.min() - (0.1 * temp.max()) tmax = temp.max() + (0.1 * temp.max()) # Calculate how many gridcells we need in the x and y dimensions xdim = round((smax-smin)/0.1+1,0) ydim = round((tmax-tmin)+1,0) # Create empty grid of zeros dens = np.zeros((ydim,xdim)) # Create temp and salt vectors of appropiate dimensions ti = np.linspace(1,ydim-1,ydim)+tmin si = np.linspace(1,xdim-1,xdim)*0.1+smin # Loop to fill in grid with densities for j in range(0,int(ydim)): for i in range(0, int(xdim)): dens[j,i]=gsw.rho(si[i],ti[j],0) # Substract 1000 to convert to sigma-t dens = dens - 1000 # Plot data *********************************************** fig1 = plt.figure() ax1 = fig1.add_subplot(111) CS = plt.contour(si,ti,dens, linestyles='dashed', colors='k') plt.clabel(CS, fontsize=12, inline=1, fmt='%1.0f') # Label every second level ax1.plot(salt,temp,'or',markersize=9) ax1.set_xlabel('Salinity') ax1.set_ylabel('Temperature (C)')
[ "esw3@aber.ac.uk" ]
esw3@aber.ac.uk
ffaa34fb014396c3afe742df427df3b83801e470
0d4b793c587a6c7df42f4217860c66570fe587c5
/school_system/frontend/urls.py
6d1697dd44e07e562c2492e371e7dc4b5061f0c2
[]
no_license
AmbyMbayi/school_system
6d43b362298c8e5afe9e5b97a0f3b6a460ea6f8d
73bd0f93dd4195ff4a824637cda4fae93ac1d801
refs/heads/master
2022-12-21T14:16:37.917699
2020-09-23T11:08:50
2020-09-23T11:08:50
297,607,257
0
0
null
null
null
null
UTF-8
Python
false
false
94
py
from django.urls import path from . import views urlpatterns = [ path('', views.index) ]
[ "ambymbayi54@gmail.com" ]
ambymbayi54@gmail.com
4204c29e586d8de75e54050508bb7f55ffdc1a4e
941ea75df18b49840e81d21e2421b5c2158baebe
/basic_mail.py
94ce1412dfc8798db23c72dfb80c22de2f4ecf31
[]
no_license
ankitmodi31198/Mail-System-In-Python
1e44d2c16e445e48d9b908cb52f8a8c76a9cacbf
bb3be0fa0540457ed320d47a8ad0c6d7d208a4c2
refs/heads/master
2020-03-30T17:10:08.002896
2018-10-03T16:27:47
2018-10-03T16:27:47
151,444,066
0
0
null
null
null
null
UTF-8
Python
false
false
1,237
py
from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import smtplib host = 'smtp.gmail.com' port = 587 username = "ankitmodi31198@gmail.com" password = "*************" from_list = username to_list = ["modiankit.pal@gmail.com"] try: email_con = smtplib.SMTP(host, port) print(email_con.ehlo()) print(email_con.starttls()) print(email_con.login(username, password)) msg = MIMEMultipart("alternative") msg['subject'] = "Hello There Spartas!!" msg["From"] = from_list msg["To"] = to_list[0] plain_txt = "We are so glad to see you here!!" html_txt = """ <html> <head> <title>Testing</title> </head> <body> <p>Hey! <br>We are <b>testing</b> this email made by <a href=#>html tags</a>.</p> </body> </html>""" part_1 = MIMEText(plain_txt, 'plain') part_2 = MIMEText(html_txt, 'html') msg.attach(part_1) msg.attach(part_2) # print(msg.as_string()) print(email_con.sendmail(from_list, to_list, msg.as_string())) print(email_con.quit()) except smtplib.SMTPAuthenticationError: print("Error loading message") except smtplib.SMTPException: print("Error loading message")
[ "ankitmodi31198@gmail.com" ]
ankitmodi31198@gmail.com
88acccb902b41abe383e13691f0b5db91c5ab117
3904ab60b13ef96d042c4bfd81507072c9bbeb67
/usuarios/forms.py
a8e596d0e654f47a5ffc33600250e206aea73e11
[]
no_license
cristianacmc/RedeSocial
2a7abda499781eb1b9284d4ea89f9c516ef7962e
c87d5261e870cc40d47da59e8b641db2ff840542
refs/heads/master
2021-01-10T13:15:48.595554
2015-11-19T23:10:06
2015-11-19T23:10:06
45,417,724
0
0
null
null
null
null
UTF-8
Python
false
false
913
py
from django import forms from django.contrib.auth.models import User class RegistrarUsuarioForm(forms.Form): nome = forms.CharField(required=True) email = forms.CharField(required=True) senha = forms.CharField(required=True) telefone = forms.CharField(required=True) nome_empresa = forms.CharField(required=True) def is_valid(self): valid = True if not super(RegistrarUsuarioForm, self).is_valid(): self.adiciona_erro('Por favor, verifique os dados informados') valid = False user_exists = User.objects.filter(username=self.data['nome']).exists() if user_exists: self.adiciona_erro('Usuario ja existe') valid = False return valid def adiciona_erro(self, message): errors = self._errors.setdefault(forms.forms.NON_FIELD_ERRORS, forms.utils.ErrorList()) errors.append(message)
[ "cristianacmc@gmail.com" ]
cristianacmc@gmail.com
6e3b38316b66683d79827698517a0e51a9fd00de
7718278f093d900e630fe5f53aebe6bd5bdb40e7
/service/PrepareNodesLabel.py
3900b8ad2455e64a912d8df58c6a90528989259c
[]
no_license
sylvainSUPINTERNET/viz
2d8968c21d700f21ae7d8280a16c866e7a1d588e
4a08eb8b8acf8b0f76d21be01fdcfc52de9264d8
refs/heads/master
2023-08-14T06:54:56.425347
2021-09-25T21:49:26
2021-09-25T21:49:26
408,966,952
0
0
null
null
null
null
UTF-8
Python
false
false
1,101
py
import pprint ''' Create Nodes labels ''' def proccess_label(profiles_cursor, labels): response = {} build_relation = []; for label in labels: response[label] = set() # MATCH (a:age), (b:music) WHERE a.value = '<AGE>' AND b.value = 'PROFILE_MUSICIAN' CREATE (a)-[r:LISTEN]->(b) RETURN type(r); for profile in profiles_cursor: for i in response: if type(profile[i]) is list: if len(profile[i]) > 0: for obj in profile[i]: for key in obj: if key == "name": response[i].add(obj[key]) if key == "artistName": response[i].add(obj[key]) build_relation.append(f"MATCH (a:age), (b:musics) WHERE a.value ='"+ profile["age"] +"' AND b.value = '"+ obj["artistName"] +"' CREATE (a)-[r:LISTEN]->(b) RETURN type(r)") else: response[i].add(profile[i]) # pprint.pprint(response) return [response, build_relation]
[ "sylvain.joly@supinternet.fr" ]
sylvain.joly@supinternet.fr
4ab0aeb36367fb0df10d5a681a0fd858593a06fd
5d13e9565779b4123e1b72815396eee0051d4980
/parse_titles_with_dictionary.py
136868340d5c6c8b92b10d3a91f34b556fdbc104
[]
no_license
futuresystems-courses/475-Dictionary-Based-Analysis-of-PubMed-Article-Titles-for-Mental-Disorders-Kia
b455574908971e487b99a175d8fdbd48d13f8c60
1ab992b1859905ee57e51a258777192b2ec32339
refs/heads/master
2021-01-10T11:06:37.112800
2015-12-28T17:03:00
2015-12-28T17:03:00
48,702,480
0
0
null
null
null
null
UTF-8
Python
false
false
5,328
py
import sys import nltk import csv import ast from operator import itemgetter import random stopwords = nltk.corpus.stopwords.words('english') disorder_phrases = {} DICTIONARY_FILE = 'mental diseases dictionary.csv' try: TITLES_FILE = 'parsed_titles.txt' except IndexError: print "\nERROR: No file name given. Please add the filename of the titles file; e.g.,:\n\n" sys.exit(0) #parse target mental disorder phrases, but keep original version of phrase with open(DICTIONARY_FILE, 'rb') as csvfile: dictreader = csv.reader(csvfile, delimiter='\t') for row in dictreader: #print row term_words = [w.lower() for w in nltk.RegexpTokenizer(r'\w+').tokenize(row[0])] for word in term_words: #print word if word in stopwords: term_words.remove(word) disorder_phrases[row[0]] = term_words #print disorder_phrases with open(TITLES_FILE, 'rb') as csvfile: file_id = str(random.randint(1,99999)) # add a random number to filenames to make them unique with open('tagging_titles_' + file_id + '.txt', 'wb') as pubfile: titlesreader = csv.reader(csvfile, delimiter='|', escapechar='\\') recordwriter = csv.writer(pubfile, delimiter='|', quotechar='"', escapechar='\\') recordwriter.writerow(["pmid","pubyear","lang","title","match_found","best_full_match","best_window_match"]) ''' run through titles in file file format is "pmid|year|title|language" ''' for row in titlesreader: title = '' match_found = '' best_full_match = '' best_window_match = '' pmid = row[0] pubyear = row[1] title = row[2] #third column of original file lang = row[3] print title #split and tokenize the title title_words = [w.lower() for w in nltk.RegexpTokenizer(r'\w+').tokenize(title)] full_title_scores = {} small_window_scores = {} # test paper titles for each word of disorder phrase from dictionary # keep scores for all disorder phrases for phrase in disorder_phrases: word_matches = {} for word in disorder_phrases[phrase]: ''' for each word in disorder phrase, find the index of that word in the title ''' indexes = [i for i, j in enumerate(title_words) if j == word] ''' if word was found at least once, keep track of it and the indexes ''' if len(indexes) > 0: word_matches[word] = indexes ''' if found as many words in the title as started with in the disorder phrase, keep it as at least a "full title" match, and possibly also a "within window" match ''' if len(word_matches) == len(disorder_phrases[phrase]): print "potential match (all words found in title):", phrase full_title_scores[phrase] = len(disorder_phrases[phrase]) ''' if phrase is only one word long, it also counts as a small_window_match ''' if len(disorder_phrases[phrase]) == 1: small_window_scores[phrase] = len(disorder_phrases[phrase]) print "single word phrase; stored!" else: ''' if phrase is longer than one word, find min and max indexes by sorting the matched words by the indexes (in descending order), then taking the first and last elements ''' sorted_word_matches = sorted(word_matches.items(), key=itemgetter(1), reverse=True) max_index = sorted_word_matches[0][1][0] #first index value of first element min_index = sorted_word_matches[-1][1][0] #first index value of last element ''' if difference between max and min index is no more than 2 more than the length of the original phrase (that is, if there are no more than 2 additional words intermingled in the disorder phrase words), count it as a match ''' if (max_index - min_index) <= len(disorder_phrases[phrase]) + 2: small_window_scores[phrase] = len(disorder_phrases[phrase]) print "in window!" else: print "not in window!" ''' Take all of the potential "full title" and "small window" matches. If more than one match has been found in either category, sort the matches by the length of the phrase, and take the longest phrase as the best match. ''' if len(full_title_scores) > 0 and len(small_window_scores) > 0: match_found = 'Y' print "all phrases checked; testing for best one" if len(full_title_scores) == 1: best_full_match = full_title_scores.keys()[0] print "only one full match:", best_full_match else: sorted_full_scores = sorted(full_title_scores.items(), key=itemgetter(1), reverse=True) best_full_match = sorted_full_scores[0][0] print "found best full match:", best_full_match #but need to check if first and second are tied if len(small_window_scores) == 1: best_window_match = small_window_scores.keys()[0] print "only one window match:", best_window_match else: sorted_window_scores = sorted(small_window_scores.items(), key=itemgetter(1), reverse=True) best_window_match = sorted_window_scores[0][0] print "found best window match:", best_window_match #but need to check if first and second are tied else: print "no matches found." match_found = 'N' recordwriter.writerow([pmid,pubyear,lang,title,match_found,best_full_match,best_window_match])
[ "hroe.lee@gmail.com" ]
hroe.lee@gmail.com
52307f112381e2b552d0b1bd2f6ce1b90304bee6
2f6f7c056df8ed13273866cc4ed5bcc0e49c4d93
/catch_all/catch_gre
2a37cd9d4b2737c1a9ea9843797b081456d124bb
[]
no_license
ssem/honeypots
8e5eccc614536d05d977a2b5fa93839f06f5cec7
7f137f69e88f671d69f3de91b30e160b7ebb0419
refs/heads/master
2021-01-18T21:34:03.110770
2016-04-18T20:25:02
2016-04-18T20:25:02
31,721,862
0
0
null
null
null
null
UTF-8
Python
false
false
2,082
#!/usr/bin/env python import os import sys import struct import socket import select import argparse class Catch_All: def __init__(self): self.socket = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_GRE) def __del__(self): try:self.socket.close() except:pass def _unpack_ip_header(self, packet): header = struct.unpack('!BBHHHBBH4s4sHHLLBBHHH', packet[0:40]) return {'dsf': header[1], 'total_length': header[2], 'id': header[3], 'flags': header[4], 'ttl': header[5], 'protocol': header[6], 'checksum': header[7], 'src_ip': socket.inet_ntoa(header[8]), 'dst_ip': socket.inet_ntoa(header[9]), 'src_port': header[10], 'dst_port': header[11], 'seq': header[12], 'ack': header[13], 'length': header[14], 'flags': header[15], 'windows': header[16], 'checksum': header[17], 'urg_pnt': header[18]} def _pretty_print(self, ip_h): msg = '%s:%s -> %s:%s\n' % (ip_h['src_ip'], ip_h['src_port'], ip_h['dst_ip'], ip_h['dst_port']) sys.stdout.write(msg) def run(self): while True: try: inp, outp, exceptions = select.select([self.socket], [], []) for sock in inp: packet, source = sock.recvfrom(1024) ip_h = self._unpack_ip_header(packet) self._pretty_print(ip_h) except KeyboardInterrupt: exit('bye') except Exception as e: sys.stderr.write('[ERROR] %s\n' % e) if __name__ == "__main__": if os.geteuid() != 0: exit("must run as root") parser = argparse.ArgumentParser() args = parser.parse_args() CA = Catch_All() CA.run()
[ "ssem@tacnetsol.com" ]
ssem@tacnetsol.com
236513250e5f6109c7bb08ac5ebc16407d5afa5a
47367e719f84383136982a5c9bdb8fc3aa44037f
/backend/backend/api/migrations/0002_remove_tasks_preparing_time.py
0f70e10764d9defd16af4f37dfd527deef7f02d6
[]
no_license
mzoladki/sterowanie_produkcja
bd080c32dcddec7705761c0dfb93c38ce44e910f
d6dc7c6959a270fd28873784aeccd469d60be983
refs/heads/master
2020-04-11T04:25:25.028752
2018-12-15T00:17:55
2018-12-15T00:17:55
161,511,115
0
0
null
null
null
null
UTF-8
Python
false
false
320
py
# Generated by Django 2.1.4 on 2018-12-14 23:03 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('api', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='tasks', name='preparing_time', ), ]
[ "zoladkiewiczmarcin@gmail.com" ]
zoladkiewiczmarcin@gmail.com
6df8795ce5b75fe8c3f8c5df2849243b52446321
aa1972e6978d5f983c48578bdf3b51e311cb4396
/mas_nitro-python-1.0/massrc/com/citrix/mas/nitro/resource/config/ns/ns_vlan.py
d1c25cf0083cc9debb8d5c39b6a0cd53dac1af6d
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
MayankTahil/nitro-ide
3d7ddfd13ff6510d6709bdeaef37c187b9f22f38
50054929214a35a7bb19ed10c4905fffa37c3451
refs/heads/master
2020-12-03T02:27:03.672953
2017-07-05T18:09:09
2017-07-05T18:09:09
95,933,896
2
5
null
2017-07-05T16:51:29
2017-07-01T01:03:20
HTML
UTF-8
Python
false
false
8,561
py
''' Copyright (c) 2008-2015 Citrix Systems, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ''' from massrc.com.citrix.mas.nitro.resource.Base import * from massrc.com.citrix.mas.nitro.service.options import options from massrc.com.citrix.mas.nitro.exception.nitro_exception import nitro_exception from massrc.com.citrix.mas.nitro.util.filtervalue import filtervalue from massrc.com.citrix.mas.nitro.resource.Base.base_resource import base_resource from massrc.com.citrix.mas.nitro.resource.Base.base_response import base_response ''' Configuration for NS Vlan resource ''' class ns_vlan(base_resource): _bound_ifaces= "" _ns_vlan_ip_address= "" _tagged_ifaces= "" _if_ipv6_routing= "" _ns_vlan_id= "" __count="" ''' get the resource id ''' def get_resource_id(self) : try: if hasattr(self, 'id'): return self.id else: return None except Exception as e : raise e ''' get the resource type ''' def get_object_type(self) : try: return "ns_vlan" except Exception as e : raise e ''' Returns the value of object identifier argument. ''' def get_object_id(self) : try: return None except Exception as e : raise e ''' Returns the value of object file path argument. ''' @property def file_path_value(self) : try: return None except Exception as e : raise e ''' Returns the value of object file component name. ''' @property def file_component_value(self) : try : return "ns_vlans" except Exception as e : raise e ''' get Bounded Interfaces ''' @property def bound_ifaces(self) : try: return self._bound_ifaces except Exception as e : raise e ''' set Bounded Interfaces ''' @bound_ifaces.setter def bound_ifaces(self,bound_ifaces): try : if not isinstance(bound_ifaces,str): raise TypeError("bound_ifaces must be set to str value") self._bound_ifaces = bound_ifaces except Exception as e : raise e ''' get NetScaler IP Address ''' @property def ns_vlan_ip_address(self) : try: return self._ns_vlan_ip_address except Exception as e : raise e ''' set NetScaler IP Address ''' @ns_vlan_ip_address.setter def ns_vlan_ip_address(self,ns_vlan_ip_address): try : if not isinstance(ns_vlan_ip_address,str): raise TypeError("ns_vlan_ip_address must be set to str value") self._ns_vlan_ip_address = ns_vlan_ip_address except Exception as e : raise e ''' get Tagged Interfaces ''' @property def tagged_ifaces(self) : try: return self._tagged_ifaces except Exception as e : raise e ''' set Tagged Interfaces ''' @tagged_ifaces.setter def tagged_ifaces(self,tagged_ifaces): try : if not isinstance(tagged_ifaces,str): raise TypeError("tagged_ifaces must be set to str value") self._tagged_ifaces = tagged_ifaces except Exception as e : raise e ''' get VLAN for Network 1/8 on VM Instance ''' @property def if_ipv6_routing(self) : try: return self._if_ipv6_routing except Exception as e : raise e ''' set VLAN for Network 1/8 on VM Instance ''' @if_ipv6_routing.setter def if_ipv6_routing(self,if_ipv6_routing): try : if not isinstance(if_ipv6_routing,str): raise TypeError("if_ipv6_routing must be set to str value") self._if_ipv6_routing = if_ipv6_routing except Exception as e : raise e ''' get VLAN Id ''' @property def ns_vlan_id(self) : try: return self._ns_vlan_id except Exception as e : raise e ''' set VLAN Id ''' @ns_vlan_id.setter def ns_vlan_id(self,ns_vlan_id): try : if not isinstance(ns_vlan_id,int): raise TypeError("ns_vlan_id must be set to int value") self._ns_vlan_id = ns_vlan_id except Exception as e : raise e ''' Use this operation to delete configured vlans. ''' @classmethod def delete(cls,client=None,resource=None): try : if resource is None : raise Exception("Resource Object Not Found") if type(resource) is not list : return resource.delete_resource(client) else : ns_vlan_obj=ns_vlan() return cls.delete_bulk_request(client,resource,ns_vlan_obj) except Exception as e : raise e ''' Use this operation to get configured vlans. ''' @classmethod def get(cls,client = None,resource="",option_=""): try: response="" if not resource : ns_vlan_obj=ns_vlan() response = ns_vlan_obj.get_resources(client,option_) else: response = resource.get_resource(client, option_) return response except Exception as e : raise e ''' Use this API to fetch filtered set of ns_vlan resources. filter string should be in JSON format.eg: "vm_state:DOWN,name:[a-z]+" ''' @classmethod def get_filtered(cls,service,filter_) : try: ns_vlan_obj = ns_vlan() option_ = options() option_._filter=filter_ return ns_vlan_obj.getfiltered(service, option_) except Exception as e : raise e ''' * Use this API to count the ns_vlan resources. ''' @classmethod def count(cls,service) : try: ns_vlan_obj = ns_vlan() option_ = options() option_._count=True response = ns_vlan_obj.get_resources(service, option_) if response : return response[0].__dict__['___count'] return 0 except Exception as e : raise e ''' Use this API to count the filtered set of ns_vlan resources. filter string should be in JSON format.eg: "vm_state:DOWN,name:[a-z]+" ''' @classmethod def count_filtered(cls,service,filter_): try: ns_vlan_obj = ns_vlan() option_ = options() option_._count=True option_._filter=filter_ response = ns_vlan_obj.getfiltered(service, option_) if response : return response[0].__dict__['_count'] return 0; except Exception as e : raise e ''' Converts API response into object and returns the object array in case of get request. ''' def get_nitro_response(self,service ,response): try : result=service.payload_formatter.string_to_resource(ns_vlan_response, response, self.__class__.__name__) if(result.errorcode != 0) : if (result.errorcode == 444) : service.clear_session(self) if result.severity : if (result.severity == "ERROR") : raise nitro_exception(result.errorcode, str(result.message), str(result.severity)) else : raise nitro_exception(result.errorcode, str(result.message), str(result.severity)) return result.ns_vlan except Exception as e : raise e ''' Converts API response into object and returns the object array . ''' def get_nitro_bulk_response(self,service ,response): try : result=service.payload_formatter.string_to_resource(ns_vlan_responses, response, "ns_vlan_response_array") if(result.errorcode != 0) : if (result.errorcode == 444) : service.clear_session(self) response = result.ns_vlan_response_array i=0 error = [ns_vlan() for _ in range(len(response))] for obj in response : error[i]= obj._message i=i+1 raise nitro_exception(result.errorcode, str(result.message), error) response = result.ns_vlan_response_array i=0 ns_vlan_objs = [ns_vlan() for _ in range(len(response))] for obj in response : if hasattr(obj,'_ns_vlan'): for props in obj._ns_vlan: result = service.payload_formatter.string_to_bulk_resource(ns_vlan_response,self.__class__.__name__,props) ns_vlan_objs[i] = result.ns_vlan i=i+1 return ns_vlan_objs except Exception as e : raise e ''' Performs generic data validation for the operation to be performed ''' def validate(self,operationType): try: super(ns_vlan,self).validate() except Exception as e : raise e ''' Forms the proper response. ''' class ns_vlan_response(base_response): def __init__(self,length=1) : self.ns_vlan= [] self.errorcode = 0 self.message = "" self.severity = "" self.ns_vlan= [ ns_vlan() for _ in range(length)] ''' Forms the proper response for bulk operation. ''' class ns_vlan_responses(base_response): def __init__(self,length=1) : self.ns_vlan_response_array = [] self.errorcode = 0 self.message = "" self.ns_vlan_response_array = [ ns_vlan() for _ in range(length)]
[ "Mayank@Mandelbrot.local" ]
Mayank@Mandelbrot.local
1b0ae1343228ee6e8482deac60b3925eaa9cca88
4a61507d00b2ffff2d2dec367bd5869f11cd7569
/config/hooks/extra/microwebserver.py
5f86786d730c7309dbc33e6b8dbf0cd9ae99ad80
[]
no_license
ngsru/heaver
5bf1963e00dda94536ac5bcf7ab45ff6dc9d9b4c
8d5ddcf3f22be5cde1aa1dd55931da7afc71d251
refs/heads/master
2020-05-20T10:34:17.425832
2014-08-18T10:05:08
2014-08-18T10:05:08
22,941,898
1
0
null
null
null
null
UTF-8
Python
false
false
4,648
py
# -*- coding: utf-8 -*- from flask import Flask, redirect import sys import subprocess app = Flask(__name__) #pidfile = open("/tmp/heaver/microweb_" + str(sys.argv[2]) + "_heaver.pid", "w") #pidfile.write(str(os.getpid())) #pidfile.close() host = '0.0.0.0' port = int(sys.argv[1]) header = """ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Перегрузка!</title> <style> body { width: 1024px; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } table { border-collapse: collapse; } td { border: 1px solid grey; cellspacing: 0px; } </style> </head> <body> <h1>Сервер перегружен!</h1> <p>В контейнере закончилась оперативная память, поэтому процессы внутри него были приостановлены.</p> <p>Ниже отображен перечень процессов, которые были запущены на момент инцидента.</p> <p>Обратитесь к разработчику проекта для решения данной проблемы.</p> <p>Доступ по ssh заморожен не был, чтобы освободить ресурсы вы можете завершить избыточные процессы через ssh.</p> """ footer = """ </body> </html> """ def exec_cmd(cmd, stdin=""): "Execute given cmd and optionally stdin, return exit code, stdout, stderr" process = subprocess.Popen(cmd, stdout=subprocess.PIPE,stderr=subprocess.PIPE) stdout, stderr = process.communicate(stdin) exit_code = process.returncode return exit_code, stdout, stderr @app.route('/kill/<string:pid>') def kill(pid): exec_cmd(["/usr/bin/kill", pid]) return redirect("/") @app.route('/kill_force/<string:pid>') def kill_force(pid): exec_cmd(["/usr/bin/kill", "-9", pid]) return redirect("/") @app.route('/', defaults={'path': ''}) @app.route('/<path:path>') def index(path): output = header output += "<p><b>Дерево процессов:</b></p>" exit_code, stdout, stderr = exec_cmd(["/usr/bin/ps", "-o", "cgroup", "--no-headers", sys.argv[2]]) cgroup = stdout.strip() exit_code, stdout, stderr = exec_cmd(["/usr/bin/ps", "-o", "pid,cgroup", "--no-headers", "ax"]) stdout = stdout.split('\n') pidlist = [] for line in stdout: if cgroup in line: pidlist.append(line.split()[0]) exit_code, stdout, stderr = exec_cmd(["/usr/bin/ps", "f", "-o", "command", "--no-headers"] + pidlist) commands = stdout.split('\n') # execute ps for pidlist exit_code, stdout, stderr = exec_cmd(["/usr/bin/ps", "f", "-o", "pid,user,pcpu,size,vsize", "--no-headers"] + pidlist) ps = stdout.split('\n') table = "<table style=\"width:100%;\">" table += "<td style=\"text-align: center;\">Process ID</td>" table += "<td style=\"text-align: center;\">User</td>" table += "<td style=\"text-align: center;\">CPU Usage %</td>" table += "<td style=\"text-align: center;\">Memory usage</td>" table += "<td style=\"text-align: center;\">Virtual memory usage</td>" table += "<td style=\"text-align: center;\">Command</td>" table += "<td style=\"text-align: center;\">Действия</td>" i = 0 for line in ps: columns = line.split() if len(columns)==5: table += "<tr>" table += "<td style=\"text-align: center;\">%s</td>" % columns[0] table += "<td style=\"text-align: center;\">%s</td>" % columns[1] table += "<td style=\"text-align: center;\">%s</td>" % columns[2] table += "<td style=\"text-align: center;\">%4.2f Mb</td>" % (float(columns[3].strip())/1024.0) table += "<td style=\"text-align: center;\">%4.2f Mb</td>" % (float(columns[4].strip())/1024.0) table += "<td style=\"text-align: left; font-size: 16px;\"><xmp>%s</xmp></td>" % commands[i] table += "<td style=\"text-align: center; font-size: 11px;\">" table += "<a href=\"/kill/%s\" onclick=\"return confirm('Уверены, что хотите убить %s?');\">Убить</a><br/>" % (columns[0], commands[i]) table += "<a href=\"/kill_force/%s\" onclick=\"return confirm('Уверены, что хотите убить %s с особой жестокостью?');\">Убить с особой жестокостью</a></td>" % (columns[0], commands[i]) table += "</tr>" i += 1 table += "</table>" output += table output += footer return output if __name__ == "__main__": app.debug = False app.run(host=host, port=port)
[ "s.seletskiy@gmail.com" ]
s.seletskiy@gmail.com
b63a247f0dd508911578fa7843a6d083a5623821
ab79f8297105a7d412303a8b33eaa25038f38c0b
/mutif_all_vit_addons/vit_order_analysis/sale_order_analysis.py
c0ecfe10c045ce7610f50f2b9d062756034a7600
[]
no_license
adahra/addons
41a23cbea1e35079f7a9864ade3c32851ee2fb09
c5a5678379649ccdf57a9d55b09b30436428b430
refs/heads/master
2022-06-17T21:22:22.306787
2020-05-15T10:51:14
2020-05-15T10:51:14
264,167,002
1
0
null
2020-05-15T10:39:26
2020-05-15T10:39:26
null
UTF-8
Python
false
false
1,273
py
from openerp import tools from openerp.osv import fields,osv import openerp.addons.decimal_precision as dp import time import logging from openerp.tools.translate import _ _logger = logging.getLogger(__name__) class sale_order_analysis(osv.osv): _name = "vit_order_analysis.sale_order_analysis" _columns = { 'order_id' : fields.many2one('sale.order', 'Sale Order'), 'order_date' : fields.related('order_id', 'date_order' , type="char", relation="sale.order", string="Order Date", store=True), 'product_id' : fields.many2one('product.product', 'Product'), 'categ_id' : fields.related('product_id', 'categ_id' , type="many2one", relation="product.category", string="Category", store=True), 'name_template' : fields.char("Product Name"), 'real_order' : fields.float("Real Order"), 'qty_order' : fields.float("Qty Order"), 'delivered' : fields.float("Delivered"), 'back_order' : fields.float("Back Order"), 'unfilled' : fields.float("Un-Filled"), 'partner_id' : fields.many2one('res.partner','Partner',readonly=True), 'age' : fields.integer('Age (Days)'), 'status' : fields.related('order_id', 'state' , type="char", string="Status", store=True), 'qty_invoice' : fields.float("Qty in Invoice"), }
[ "prog1@381544ba-743e-41a5-bf0d-221725b9d5af" ]
prog1@381544ba-743e-41a5-bf0d-221725b9d5af
0d4217a71c1443b49fbe2b08c76d0a241f2633fd
c237dfae82e07e606ba9385b336af8173d01b251
/lib/python/Products/ZCTextIndex/tests/mailtest.py
e8852d178ca4296bb828459acad38e1cdfcd1f25
[ "ZPL-2.0" ]
permissive
OS2World/APP-SERVER-Zope
242e0eec294bfb1ac4e6fa715ed423dd2b3ea6ff
dedc799bd7eda913ffc45da43507abe2fa5113be
refs/heads/master
2020-05-09T18:29:47.818789
2014-11-07T01:48:29
2014-11-07T01:48:42
null
0
0
null
null
null
null
UTF-8
Python
false
false
7,988
py
"""Test an index with a Unix mailbox file. usage: python mailtest.py [options] <data.fs> options: -v -- verbose Index Generation -i mailbox -n NNN -- max number of messages to read from mailbox -t NNN -- commit a transaction every NNN messages (default: 1) -p NNN -- pack <data.fs> every NNN messages (default: 500), and at end -p 0 -- don't pack at all -x -- exclude the message text from the data.fs Queries -q query -b NNN -- return the NNN best matches (default: 10) -c NNN -- context; if -v, show the first NNN lines of results (default: 5) The script either indexes or queries depending on whether -q or -i is passed as an option. For -i mailbox, the script reads mail messages from the mailbox and indexes them. It indexes one message at a time, then commits the transaction. For -q query, it performs a query on an existing index. If both are specified, the index is performed first. You can also interact with the index after it is completed. Load the index from the database: import ZODB from ZODB.FileStorage import FileStorage fs = FileStorage(<data.fs> db = ZODB.DB(fs) index = cn.open().root()["index"] index.search("python AND unicode") """ import ZODB import ZODB.FileStorage from Products.ZCTextIndex.Lexicon import \ Lexicon, CaseNormalizer, Splitter, StopWordRemover from Products.ZCTextIndex.ZCTextIndex import ZCTextIndex from BTrees.IOBTree import IOBTree from Products.ZCTextIndex.QueryParser import QueryParser import sys import mailbox import time def usage(msg): print msg print __doc__ sys.exit(2) class Message: total_bytes = 0 def __init__(self, msg): subject = msg.getheader('subject', '') author = msg.getheader('from', '') if author: summary = "%s (%s)\n" % (subject, author) else: summary = "%s\n" % subject self.text = summary + msg.fp.read() Message.total_bytes += len(self.text) class Extra: pass def index(rt, mboxfile, db, profiler): global NUM idx_time = 0 pack_time = 0 start_time = time.time() lexicon = Lexicon(Splitter(), CaseNormalizer(), StopWordRemover()) extra = Extra() extra.lexicon_id = 'lexicon' extra.doc_attr = 'text' extra.index_type = 'Okapi BM25 Rank' caller = Extra() caller.lexicon = lexicon rt["index"] = idx = ZCTextIndex("index", extra, caller) if not EXCLUDE_TEXT: rt["documents"] = docs = IOBTree() else: docs = None get_transaction().commit() mbox = mailbox.UnixMailbox(open(mboxfile, 'rb')) if VERBOSE: print "opened", mboxfile if not NUM: NUM = sys.maxint if profiler: itime, ptime, i = profiler.runcall(indexmbox, mbox, idx, docs, db) else: itime, ptime, i = indexmbox(mbox, idx, docs, db) idx_time += itime pack_time += ptime get_transaction().commit() if PACK_INTERVAL and i % PACK_INTERVAL != 0: if VERBOSE >= 2: print "packing one last time..." p0 = time.clock() db.pack(time.time()) p1 = time.clock() if VERBOSE: print "pack took %s sec" % (p1 - p0) pack_time += p1 - p0 if VERBOSE: finish_time = time.time() print print "Index time", round(idx_time / 60, 3), "minutes" print "Pack time", round(pack_time / 60, 3), "minutes" print "Index bytes", Message.total_bytes rate = (Message.total_bytes / idx_time) / 1024 print "Index rate %.2f KB/sec" % rate print "Indexing began", time.ctime(start_time) print "Indexing ended", time.ctime(finish_time) print "Wall clock minutes", round((finish_time - start_time)/60, 3) def indexmbox(mbox, idx, docs, db): idx_time = 0 pack_time = 0 i = 0 while i < NUM: _msg = mbox.next() if _msg is None: break i += 1 msg = Message(_msg) if VERBOSE >= 2: print "indexing msg", i i0 = time.clock() idx.index_object(i, msg) if not EXCLUDE_TEXT: docs[i] = msg if i % TXN_SIZE == 0: get_transaction().commit() i1 = time.clock() idx_time += i1 - i0 if VERBOSE and i % 50 == 0: print i, "messages indexed" print "cache size", db.cacheSize() if PACK_INTERVAL and i % PACK_INTERVAL == 0: if VERBOSE >= 2: print "packing..." p0 = time.clock() db.pack(time.time()) p1 = time.clock() if VERBOSE: print "pack took %s sec" % (p1 - p0) pack_time += p1 - p0 return idx_time, pack_time, i def query(rt, query_str, profiler): idx = rt["index"] docs = rt["documents"] start = time.clock() if profiler is None: results, num_results = idx.query(query_str, BEST) else: if WARM_CACHE: print "Warming the cache..." idx.query(query_str, BEST) start = time.clock() results, num_results = profiler.runcall(idx.query, query_str, BEST) elapsed = time.clock() - start print "query:", query_str print "# results:", len(results), "of", num_results, \ "in %.2f ms" % (elapsed * 1000) tree = QueryParser(idx.lexicon).parseQuery(query_str) qw = idx.index.query_weight(tree.terms()) for docid, score in results: scaled = 100.0 * score / qw print "docid %7d score %6d scaled %5.2f%%" % (docid, score, scaled) if VERBOSE: msg = docs[docid] ctx = msg.text.split("\n", CONTEXT) del ctx[-1] print "-" * 60 print "message:" for l in ctx: print l print "-" * 60 def main(fs_path, mbox_path, query_str, profiler): f = ZODB.FileStorage.FileStorage(fs_path) db = ZODB.DB(f, cache_size=CACHE_SIZE) cn = db.open() rt = cn.root() if mbox_path is not None: index(rt, mbox_path, db, profiler) if query_str is not None: query(rt, query_str, profiler) cn.close() db.close() f.close() if __name__ == "__main__": import getopt NUM = 0 VERBOSE = 0 PACK_INTERVAL = 500 EXCLUDE_TEXT = 0 CACHE_SIZE = 10000 TXN_SIZE = 1 BEST = 10 CONTEXT = 5 WARM_CACHE = 0 query_str = None mbox_path = None profile = None old_profile = None try: opts, args = getopt.getopt(sys.argv[1:], 'vn:p:i:q:b:c:xt:w', ['profile=', 'old-profile=']) except getopt.error, msg: usage(msg) if len(args) != 1: usage("exactly 1 filename argument required") for o, v in opts: if o == '-n': NUM = int(v) elif o == '-v': VERBOSE += 1 elif o == '-p': PACK_INTERVAL = int(v) elif o == '-q': query_str = v elif o == '-i': mbox_path = v elif o == '-b': BEST = int(v) elif o == '-x': EXCLUDE_TEXT = 1 elif o == '-t': TXN_SIZE = int(v) elif o == '-c': CONTEXT = int(v) elif o == '-w': WARM_CACHE = 1 elif o == '--profile': profile = v elif o == '--old-profile': old_profile = v fs_path, = args if profile: import hotshot profiler = hotshot.Profile(profile, lineevents=1, linetimings=1) elif old_profile: import profile profiler = profile.Profile() else: profiler = None main(fs_path, mbox_path, query_str, profiler) if profile: profiler.close() elif old_profile: import pstats profiler.dump_stats(old_profile) stats = pstats.Stats(old_profile) stats.strip_dirs().sort_stats('time').print_stats(20)
[ "martin@os2world.com" ]
martin@os2world.com
dc50b4884c1629ba6b4d350901d42876f8c7f1e4
8ba4bc718c8a42dc2af1dfe24b41f288c8237f75
/Textutility/Textutility/asgi.py
0e63e17f7472be8ba410df3066b3b874196609ae
[]
no_license
sanwriyakeer/Textutility
307665ece77e3d969c601d7996161e4037221d00
9bc64d73d98fff9eb7c1e84e3eb34ace3370ec91
refs/heads/master
2021-02-16T05:21:11.177495
2020-03-04T18:41:40
2020-03-04T18:41:40
244,970,666
0
0
null
null
null
null
UTF-8
Python
false
false
399
py
""" ASGI config for Textutility project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Textutility.settings') application = get_asgi_application()
[ "61547397+sanwriyakeer@users.noreply.github.com" ]
61547397+sanwriyakeer@users.noreply.github.com
d7805aff49a2a5078e70a3179e7b0614572d91fa
12f7328fed4a03b0dd352ccba04374011b894a79
/test_with_viterbi_test.py
4a53e34a793ac55e5d670e3c98561a58040afa5e
[]
no_license
mikemccabe/code
b445a3e8ba1f38866d9d9e99bf4d2857d91e1c7c
e200ef94ea428f51ecff598e46d542f9094ac3f7
refs/heads/master
2021-01-10T20:17:39.143618
2012-05-01T23:18:08
2012-05-01T23:18:08
280,624
2
2
null
null
null
null
UTF-8
Python
false
false
1,925
py
def forward_viterbi(obs, states, start_p, trans_p, emit_p): T = {} for state in states: ## prob. V. path V. prob. T[state] = (start_p[state], [state], start_p[state]) for output in obs: U = {} for next_state in states: total = 0 argmax = None valmax = 0 for source_state in states: (prob, v_path, v_prob) = T[source_state] p = emit_p[source_state][output] * trans_p[source_state][next_state] prob *= p v_prob *= p total += prob if v_prob > valmax: argmax = v_path + [next_state] valmax = v_prob U[next_state] = (total, argmax, valmax) T = U ## apply sum/max to the final states: total = 0 argmax = None valmax = 0 #unnneeded comment here. for state in states: (prob, v_path, v_prob) = T[state] total += prob if v_prob > valmax: argmax = v_path valmax = v_prob return (total, argmax, valmax) def example(): states = ('Rainy', 'Sunny') observations = ('walk', 'shop', 'clean') observations = ('walk', 'shop', 'clean', 'shop', 'shop', 'shop', 'walk', 'walk', 'walk', 'walk') start_probability = {'Rainy': 0.6, 'Sunny': 0.4} transition_probability = { 'Rainy' : {'Rainy': 0.7, 'Sunny': 0.3}, 'Sunny' : {'Rainy': 0.4, 'Sunny': 0.6}, } emission_probability = { 'Rainy' : {'walk': 0.1, 'shop': 0.4, 'clean': 0.5}, 'Sunny' : {'walk': 0.6, 'shop': 0.3, 'clean': 0.1}, } unneeded_obj = { 'foo' } return forward_viterbi(observations, states, start_probability, transition_probability, emission_probability) print example()
[ "mccabe@archive.org" ]
mccabe@archive.org
5965a2be0b1e5c02e590927c9dd641c44f721d3e
64b765264ffbb44a42b38b5147fa737613426b5b
/example.py
23dfa9a745fd3856d07750085cbd26987f9c2cfb
[]
no_license
GitArtur97/mapreduce-python
aaaa216ed9dab9015a79f6327f75b5fbf9dd2001
ed64da61efd89dc41bc597baccccfd25d7277516
refs/heads/main
2023-05-13T10:00:47.389103
2021-06-12T14:20:04
2021-06-12T14:20:04
352,768,957
0
0
null
null
null
null
UTF-8
Python
false
false
457
py
import filehandler from mapreduce import MapReduce class CountCharacters(MapReduce): def mapper(self, key, value): results = [] for char in value: results.append((char.lower(), 1)) return results if __name__ == "__main__": num_mapper = 4 num_reducer = 2 map_reduce = CountCharacters('shakespeare.txt', num_mapper, num_reducer) map_reduce.run() filehandler.join_key_value_files(num_reducer)
[ "jawostreet97@gmail.com" ]
jawostreet97@gmail.com
7f8733749a99f31f5499d18f2776ef8c03dab943
6924a83b7c09d5f0b477fe60aeb4e4fccd397922
/hello.py
e6928e61ca2351d3d14fa66c9eb61a24c7e2f0fa
[]
no_license
Stevella/HNG-Internship
b9fec887915973ec8cd4cf36658831f7bd15ac90
454e61030bdd9fab5b6bb132b5bfff9a241bda48
refs/heads/main
2023-07-13T03:47:46.024383
2021-08-18T22:14:41
2021-08-18T22:14:41
397,705,305
0
0
null
null
null
null
UTF-8
Python
false
false
66
py
#! python3 print('Hi there, My name is Thaddyoparaocha Amarachi')
[ "stevellathaddy@gmail.com" ]
stevellathaddy@gmail.com
ab576f164970730ca586fdd9bc786ca0a35556c5
a98eab432108d65c8546c44cded7808463b844a4
/common/models/question/QuestionCat.py
7926de7e3168da660d91cb83b3b10651895de30b
[]
no_license
RocketWill/Qamar
287ec3d5ad2ec7b3435c93def2d85bbe7d94d928
63e41d333559baf52a9010850bc4c2713ac0b93d
refs/heads/master
2020-04-21T23:55:59.459620
2019-03-19T12:00:02
2019-03-19T12:00:02
169,962,064
1
1
null
null
null
null
UTF-8
Python
false
false
863
py
# coding: utf-8 from sqlalchemy import Column, DateTime, Integer, String from sqlalchemy.schema import FetchedValue from flask_sqlalchemy import SQLAlchemy from application import app, db class QuestionCat(db.Model): __tablename__ = 'question_cat' id = db.Column(db.Integer, primary_key=True, unique=True) name = db.Column(db.String(50), nullable=False, server_default=db.FetchedValue()) weight = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue()) status = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue()) updated_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue()) created_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue()) @property def status_desc(self): return app.config['STATUS_MAPPING'][str(self.status)]
[ "willcy1006@163.com" ]
willcy1006@163.com
747707c028e314a5eff983e4a9e35bede5aae0c0
fb133bb72cbc965f405e726796e02d01ef8905e2
/combinatorics/permutations.py
25809abf4e33cb533feaca93aa0fc997e499ce67
[ "Unlicense", "LicenseRef-scancode-public-domain" ]
permissive
eklitzke/algorithms
a90b470c6ea485b3b6227fe74b23f40109cfd1f5
170b49c7aaeb06f0a91142b1c04e47246ec52fd1
refs/heads/master
2021-01-22T11:15:52.029559
2017-05-28T19:39:32
2017-05-28T19:39:32
92,677,550
2
0
null
null
null
null
UTF-8
Python
false
false
621
py
"""Implementation of permutations. This uses the "interleaving" technique, which I find the most intuitive. It's not the most efficient algorithm. """ def interleave(x, xs): """Interleave x into xs.""" for pos in range(len(xs) + 1): yield xs[:pos] + [x] + xs[pos:] def permutations(xs): """Generate the permuations of xs.""" if len(xs) == 0: yield [] else: for subperm in permutations(xs[1:]): for inter in interleave(xs[0], subperm): yield inter def list_permutations(xs): """Permutations as a list.""" return list(permutations(xs))
[ "evan@eklitzke.org" ]
evan@eklitzke.org
670e43e474e95b27ada9db890dc778d007b11714
1be5d0fcedfefc6f30f56ba3c340ca5097be26d3
/Aulas/while.py
0edc82d6858b3187c55592a2959ac4ceabe1207a
[]
no_license
gkaustchr/Python
8262ec7e8977f18ddaeccb32aa7113678a99da7b
2a51f7f1ff1be0594a899fe96cbb4e032f084c95
refs/heads/master
2022-01-23T06:03:42.134490
2022-01-19T12:53:14
2022-01-19T12:53:14
235,815,188
0
0
null
null
null
null
UTF-8
Python
false
false
51
py
x = 0 while x <= 100: print(". . .") x+=1
[ "gabrielkaustchr@gmail.com" ]
gabrielkaustchr@gmail.com
97dd34b3acce5c12e2addd1d0a29713f76135553
f4b60f5e49baf60976987946c20a8ebca4880602
/lib64/python2.7/site-packages/acimodel-1.3_2j-py2.7.egg/cobra/modelimpl/eqptcapacity/bdentryhist1qtr.py
9064eba3f5f878d3153633d8be710cf51ec1d501
[]
no_license
cqbomb/qytang_aci
12e508d54d9f774b537c33563762e694783d6ba8
a7fab9d6cda7fadcc995672e55c0ef7e7187696e
refs/heads/master
2022-12-21T13:30:05.240231
2018-12-04T01:46:53
2018-12-04T01:46:53
159,911,666
0
0
null
2022-12-07T23:53:02
2018-12-01T05:17:50
Python
UTF-8
Python
false
false
11,049
py
# coding=UTF-8 # ********************************************************************** # Copyright (c) 2013-2016 Cisco Systems, Inc. All rights reserved # written by zen warriors, do not modify! # ********************************************************************** from cobra.mit.meta import ClassMeta from cobra.mit.meta import StatsClassMeta from cobra.mit.meta import CounterMeta from cobra.mit.meta import PropMeta from cobra.mit.meta import Category from cobra.mit.meta import SourceRelationMeta from cobra.mit.meta import NamedSourceRelationMeta from cobra.mit.meta import TargetRelationMeta from cobra.mit.meta import DeploymentPathMeta, DeploymentCategory from cobra.model.category import MoCategory, PropCategory, CounterCategory from cobra.mit.mo import Mo # ################################################## class BDEntryHist1qtr(Mo): """ A class that represents historical statistics for bridge domain entry in a 1 quarter sampling interval. This class updates every day. """ meta = StatsClassMeta("cobra.model.eqptcapacity.BDEntryHist1qtr", "bridge domain entry") counter = CounterMeta("normalized", CounterCategory.GAUGE, "percentage", "bridge domain entries usage") counter._propRefs[PropCategory.IMPLICIT_MIN] = "normalizedMin" counter._propRefs[PropCategory.IMPLICIT_MAX] = "normalizedMax" counter._propRefs[PropCategory.IMPLICIT_AVG] = "normalizedAvg" counter._propRefs[PropCategory.IMPLICIT_SUSPECT] = "normalizedSpct" counter._propRefs[PropCategory.IMPLICIT_THRESHOLDED] = "normalizedThr" counter._propRefs[PropCategory.IMPLICIT_TREND] = "normalizedTr" meta._counters.append(counter) meta.moClassName = "eqptcapacityBDEntryHist1qtr" meta.rnFormat = "HDeqptcapacityBDEntry1qtr-%(index)s" meta.category = MoCategory.STATS_HISTORY meta.label = "historical bridge domain entry stats in 1 quarter" meta.writeAccessMask = 0x1 meta.readAccessMask = 0x1 meta.isDomainable = False meta.isReadOnly = True meta.isConfigurable = False meta.isDeletable = False meta.isContextRoot = True meta.parentClasses.add("cobra.model.eqptcapacity.Entity") meta.superClasses.add("cobra.model.stats.Item") meta.superClasses.add("cobra.model.stats.Hist") meta.superClasses.add("cobra.model.eqptcapacity.BDEntryHist") meta.rnPrefixes = [ ('HDeqptcapacityBDEntry1qtr-', True), ] prop = PropMeta("str", "childAction", "childAction", 4, PropCategory.CHILD_ACTION) prop.label = "None" prop.isImplicit = True prop.isAdmin = True prop._addConstant("deleteAll", "deleteall", 16384) prop._addConstant("deleteNonPresent", "deletenonpresent", 8192) prop._addConstant("ignore", "ignore", 4096) meta.props.add("childAction", prop) prop = PropMeta("str", "cnt", "cnt", 16212, PropCategory.REGULAR) prop.label = "Number of Collections During this Interval" prop.isImplicit = True prop.isAdmin = True meta.props.add("cnt", prop) prop = PropMeta("str", "dn", "dn", 1, PropCategory.DN) prop.label = "None" prop.isDn = True prop.isImplicit = True prop.isAdmin = True prop.isCreateOnly = True meta.props.add("dn", prop) prop = PropMeta("str", "index", "index", 6346, PropCategory.REGULAR) prop.label = "History Index" prop.isConfig = True prop.isAdmin = True prop.isCreateOnly = True prop.isNaming = True meta.props.add("index", prop) prop = PropMeta("str", "lastCollOffset", "lastCollOffset", 111, PropCategory.REGULAR) prop.label = "Collection Length" prop.isImplicit = True prop.isAdmin = True meta.props.add("lastCollOffset", prop) prop = PropMeta("str", "modTs", "modTs", 7, PropCategory.REGULAR) prop.label = "None" prop.isImplicit = True prop.isAdmin = True prop.defaultValue = 0 prop.defaultValueStr = "never" prop._addConstant("never", "never", 0) meta.props.add("modTs", prop) prop = PropMeta("str", "normalizedAvg", "normalizedAvg", 8935, PropCategory.IMPLICIT_AVG) prop.label = "bridge domain entries usage average value" prop.isOper = True prop.isStats = True meta.props.add("normalizedAvg", prop) prop = PropMeta("str", "normalizedMax", "normalizedMax", 8934, PropCategory.IMPLICIT_MAX) prop.label = "bridge domain entries usage maximum value" prop.isOper = True prop.isStats = True meta.props.add("normalizedMax", prop) prop = PropMeta("str", "normalizedMin", "normalizedMin", 8933, PropCategory.IMPLICIT_MIN) prop.label = "bridge domain entries usage minimum value" prop.isOper = True prop.isStats = True meta.props.add("normalizedMin", prop) prop = PropMeta("str", "normalizedSpct", "normalizedSpct", 8936, PropCategory.IMPLICIT_SUSPECT) prop.label = "bridge domain entries usage suspect count" prop.isOper = True prop.isStats = True meta.props.add("normalizedSpct", prop) prop = PropMeta("str", "normalizedThr", "normalizedThr", 8937, PropCategory.IMPLICIT_THRESHOLDED) prop.label = "bridge domain entries usage thresholded flags" prop.isOper = True prop.isStats = True prop.defaultValue = 0 prop.defaultValueStr = "unspecified" prop._addConstant("avgCrit", "avg-severity-critical", 2199023255552) prop._addConstant("avgHigh", "avg-crossed-high-threshold", 68719476736) prop._addConstant("avgLow", "avg-crossed-low-threshold", 137438953472) prop._addConstant("avgMajor", "avg-severity-major", 1099511627776) prop._addConstant("avgMinor", "avg-severity-minor", 549755813888) prop._addConstant("avgRecovering", "avg-recovering", 34359738368) prop._addConstant("avgWarn", "avg-severity-warning", 274877906944) prop._addConstant("cumulativeCrit", "cumulative-severity-critical", 8192) prop._addConstant("cumulativeHigh", "cumulative-crossed-high-threshold", 256) prop._addConstant("cumulativeLow", "cumulative-crossed-low-threshold", 512) prop._addConstant("cumulativeMajor", "cumulative-severity-major", 4096) prop._addConstant("cumulativeMinor", "cumulative-severity-minor", 2048) prop._addConstant("cumulativeRecovering", "cumulative-recovering", 128) prop._addConstant("cumulativeWarn", "cumulative-severity-warning", 1024) prop._addConstant("lastReadingCrit", "lastreading-severity-critical", 64) prop._addConstant("lastReadingHigh", "lastreading-crossed-high-threshold", 2) prop._addConstant("lastReadingLow", "lastreading-crossed-low-threshold", 4) prop._addConstant("lastReadingMajor", "lastreading-severity-major", 32) prop._addConstant("lastReadingMinor", "lastreading-severity-minor", 16) prop._addConstant("lastReadingRecovering", "lastreading-recovering", 1) prop._addConstant("lastReadingWarn", "lastreading-severity-warning", 8) prop._addConstant("maxCrit", "max-severity-critical", 17179869184) prop._addConstant("maxHigh", "max-crossed-high-threshold", 536870912) prop._addConstant("maxLow", "max-crossed-low-threshold", 1073741824) prop._addConstant("maxMajor", "max-severity-major", 8589934592) prop._addConstant("maxMinor", "max-severity-minor", 4294967296) prop._addConstant("maxRecovering", "max-recovering", 268435456) prop._addConstant("maxWarn", "max-severity-warning", 2147483648) prop._addConstant("minCrit", "min-severity-critical", 134217728) prop._addConstant("minHigh", "min-crossed-high-threshold", 4194304) prop._addConstant("minLow", "min-crossed-low-threshold", 8388608) prop._addConstant("minMajor", "min-severity-major", 67108864) prop._addConstant("minMinor", "min-severity-minor", 33554432) prop._addConstant("minRecovering", "min-recovering", 2097152) prop._addConstant("minWarn", "min-severity-warning", 16777216) prop._addConstant("periodicCrit", "periodic-severity-critical", 1048576) prop._addConstant("periodicHigh", "periodic-crossed-high-threshold", 32768) prop._addConstant("periodicLow", "periodic-crossed-low-threshold", 65536) prop._addConstant("periodicMajor", "periodic-severity-major", 524288) prop._addConstant("periodicMinor", "periodic-severity-minor", 262144) prop._addConstant("periodicRecovering", "periodic-recovering", 16384) prop._addConstant("periodicWarn", "periodic-severity-warning", 131072) prop._addConstant("rateCrit", "rate-severity-critical", 36028797018963968) prop._addConstant("rateHigh", "rate-crossed-high-threshold", 1125899906842624) prop._addConstant("rateLow", "rate-crossed-low-threshold", 2251799813685248) prop._addConstant("rateMajor", "rate-severity-major", 18014398509481984) prop._addConstant("rateMinor", "rate-severity-minor", 9007199254740992) prop._addConstant("rateRecovering", "rate-recovering", 562949953421312) prop._addConstant("rateWarn", "rate-severity-warning", 4503599627370496) prop._addConstant("trendCrit", "trend-severity-critical", 281474976710656) prop._addConstant("trendHigh", "trend-crossed-high-threshold", 8796093022208) prop._addConstant("trendLow", "trend-crossed-low-threshold", 17592186044416) prop._addConstant("trendMajor", "trend-severity-major", 140737488355328) prop._addConstant("trendMinor", "trend-severity-minor", 70368744177664) prop._addConstant("trendRecovering", "trend-recovering", 4398046511104) prop._addConstant("trendWarn", "trend-severity-warning", 35184372088832) prop._addConstant("unspecified", None, 0) meta.props.add("normalizedThr", prop) prop = PropMeta("str", "normalizedTr", "normalizedTr", 8938, PropCategory.IMPLICIT_TREND) prop.label = "bridge domain entries usage trend" prop.isOper = True prop.isStats = True meta.props.add("normalizedTr", prop) prop = PropMeta("str", "repIntvEnd", "repIntvEnd", 110, PropCategory.REGULAR) prop.label = "Reporting End Time" prop.isImplicit = True prop.isAdmin = True meta.props.add("repIntvEnd", prop) prop = PropMeta("str", "repIntvStart", "repIntvStart", 109, PropCategory.REGULAR) prop.label = "Reporting Start Time" prop.isImplicit = True prop.isAdmin = True meta.props.add("repIntvStart", prop) prop = PropMeta("str", "rn", "rn", 2, PropCategory.RN) prop.label = "None" prop.isRn = True prop.isImplicit = True prop.isAdmin = True prop.isCreateOnly = True meta.props.add("rn", prop) prop = PropMeta("str", "status", "status", 3, PropCategory.STATUS) prop.label = "None" prop.isImplicit = True prop.isAdmin = True prop._addConstant("created", "created", 2) prop._addConstant("deleted", "deleted", 8) prop._addConstant("modified", "modified", 4) meta.props.add("status", prop) meta.namingProps.append(getattr(meta.props, "index")) def __init__(self, parentMoOrDn, index, markDirty=True, **creationProps): namingVals = [index] Mo.__init__(self, parentMoOrDn, markDirty, *namingVals, **creationProps) # End of package file # ##################################################
[ "collinsctk@qytang.com" ]
collinsctk@qytang.com
352979130d459d48e841cb29497f13d86c09b90d
3f4e1a6982ee7b24774327fc304898bd78681681
/utils/__init__.py
b9c8b085fa4c07b70b944bcbdb4e02cc4597a228
[]
no_license
JMSwag/qatesting
05a7292c9621bfced69adb1d6ca2f316ec55b45c
978c094fe8df014265787415fa22ec3afd712a69
refs/heads/main
2023-04-17T12:07:30.767301
2021-04-22T19:50:23
2021-04-22T19:50:23
359,590,236
0
0
null
2021-04-19T20:32:14
2021-04-19T20:32:13
null
UTF-8
Python
false
false
389
py
import requests from .poms.amazon import AmazonPOM from .poms.bookbyte import BookBytePOM class GoogleBooksAPIClient: def __init__(self): self.base_url = "https://www.googleapis.com/books/v1/volumes?q=" def authors_by_ibsn(self, ibsn): book = requests.get(self.base_url + "isbn:{}".format(ibsn)).json()['items'][0] return book['volumeInfo']['authors']
[ "git@jmswag.io" ]
git@jmswag.io
4f349f89eb2be66ea2a6218beb51cb31cef6cd36
8e62465c912ccbe41e322006a5c62b883e39143d
/src/boot/commands.py
91a37e3fd7c203c3e16b96d277ed893a5ada17b4
[ "BSD-3-Clause", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
JayHeng/NXP-MCUBootFlasher
b41dd2ffe0bf2cde61b9deacdb6353835e9e4538
a7643b2de6429481c3bf54bc2508d7e76c76562d
refs/heads/master
2022-05-27T06:26:49.532173
2022-03-21T07:23:01
2022-03-21T07:23:01
176,099,535
37
16
Apache-2.0
2022-03-14T06:28:23
2019-03-17T12:42:14
Python
UTF-8
Python
false
false
3,357
py
#! /usr/bin/env python # Copyright 2021 NXP # All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause from collections import namedtuple # Command constants. kCommandTag_FlashEraseAll = 0x01 kCommandTag_FlashEraseRegion = 0x02 kCommandTag_ReadMemory = 0x03 kCommandTag_WriteMemory = 0x04 kCommandTag_FillMemory = 0x05 kCommandTag_FlashSecurityDisable = 0x06 kCommandTag_GetProperty = 0x07 kCommandTag_ReceiveSBFile = 0x08 kCommandTag_Execute = 0x09 kCommandTag_Call = 0x0a kCommandTag_Reset = 0x0b kCommandTag_SetProperty = 0x0c kCommandTag_FlashEraseAllUnsecure = 0x0d kCommandTag_FlashProgramOnce = 0x0e, kCommandTag_FlashReadOnce = 0x0f, kCommandTag_FlashReadResource = 0x10, kCommandTag_ConfigureMemory = 0x11, kCommandTag_ReliableUpdate = 0x12, kCommandTag_GenerateKeyBlob = 0x13, kCommandTag_KeyProvisoning = 0x15, Command = namedtuple('Command', 'tag, propertyMask, name') Commands = { kCommandTag_FlashEraseAll : Command(kCommandTag_FlashEraseAll, 0x00000001, 'flash-erase-all'), kCommandTag_FlashEraseRegion : Command(kCommandTag_FlashEraseRegion, 0x00000002, 'flash-erase-region'), kCommandTag_ReadMemory : Command(kCommandTag_ReadMemory, 0x00000004, 'read-memory'), kCommandTag_WriteMemory : Command(kCommandTag_WriteMemory, 0x00000008, 'write-memory'), kCommandTag_FillMemory : Command(kCommandTag_FillMemory, 0x00000010, 'fill-memory'), kCommandTag_FlashSecurityDisable : Command(kCommandTag_FlashSecurityDisable, 0x00000020, 'flash-security-disable'), kCommandTag_GetProperty : Command(kCommandTag_GetProperty, 0x00000040, 'get-property'), kCommandTag_ReceiveSBFile : Command(kCommandTag_ReceiveSBFile, 0x00000080, 'receive-sb-file'), kCommandTag_Execute : Command(kCommandTag_Execute, 0x00000100, 'execute'), kCommandTag_Call : Command(kCommandTag_Call, 0x00000200, 'call'), kCommandTag_Reset : Command(kCommandTag_Reset, 0x00000400, 'reset'), kCommandTag_SetProperty : Command(kCommandTag_SetProperty, 0x00000800, 'set-property'), kCommandTag_FlashEraseAllUnsecure : Command(kCommandTag_FlashEraseAllUnsecure, 0x00001000, 'flash-erase-all-unsecure'), kCommandTag_FlashProgramOnce : Command(kCommandTag_FlashProgramOnce, 0x00002000, 'flash-program-once'), kCommandTag_FlashReadOnce : Command(kCommandTag_FlashReadOnce, 0x00004000, 'flash-read-once'), kCommandTag_FlashReadResource : Command(kCommandTag_FlashReadResource, 0x00008000, 'flash-read-resource'), kCommandTag_ConfigureMemory : Command(kCommandTag_ConfigureMemory, 0x00010000, 'configure-memory'), kCommandTag_ReliableUpdate : Command(kCommandTag_ReliableUpdate, 0x00100000, 'reliable-update'), kCommandTag_GenerateKeyBlob : Command(kCommandTag_GenerateKeyBlob, 0x00200000, 'generate-key-blob'), kCommandTag_KeyProvisoning : Command(kCommandTag_KeyProvisoning, 0x00400000, 'key-provisioning'), }
[ "jie.heng@nxp.com" ]
jie.heng@nxp.com
e0a4015cb0f64f5a9bd4f89f69288459f9e2a919
14076360ed82681bee9c21415b53bf572256729a
/accounts/admin.py
9477a177dbc0293e53f8203a137d4e0a462eb655
[]
no_license
dev-codflaw/django-poll-app
f566346314410f975fae064f0c35bc2f1697c539
830f3e67e0a053b64580893535fc7c4a02000c1d
refs/heads/master
2023-02-15T11:41:38.804797
2021-01-08T04:19:31
2021-01-08T04:19:31
311,088,142
1
0
null
null
null
null
UTF-8
Python
false
false
124
py
from django.contrib import admin # Register your models here. from accounts.models import User admin.site.register(User)
[ "dev.codflaw@gmail.com" ]
dev.codflaw@gmail.com
2c2fa098e17adbad9bfa97e6d4954a98aa9d34f8
590dbeb9f0df3454430182d8b2495a648ec3d119
/database.py
a9768afc97e1beb1d47f3ef0768cc2e6ce01f638
[]
no_license
suhanoves/telegram_bot_abb_stock
ec28d65c020c3718de7cf07edaadee96fb0ca49e
09c8860cee9f239851d21a515ba5efa75af9f601
refs/heads/master
2023-08-03T21:03:37.541016
2021-09-20T12:38:16
2021-09-20T12:38:16
314,072,230
0
0
null
null
null
null
UTF-8
Python
false
false
718
py
# хранение результатов поиска пользователей USER_SEARCH_RESULTS = {} USER_PRODUCT_INFO = {} def add_user_search_results(user_id: int, search_results: list): USER_SEARCH_RESULTS[user_id] = search_results def del_user_search_history(user_id: int): if user_id in USER_SEARCH_RESULTS: del USER_SEARCH_RESULTS[user_id] if user_id in USER_PRODUCT_INFO: del USER_PRODUCT_INFO[user_id] def get_user_search_results(user_id: int): return USER_SEARCH_RESULTS[user_id] def cash_product_info(user_id: int, product_info: dict): USER_PRODUCT_INFO[user_id] = product_info def get_product_info(user_id: int): return USER_PRODUCT_INFO.get(user_id)
[ "suhanoves@gmail.com" ]
suhanoves@gmail.com
96fd7941d77aa61220eefc52fc789617803291c0
eaba398a0ca5414c10dd1890e662fdcd87e157b6
/tests/steps/basic.py
1ca0ec3034bcc7987e7c7eee0bf0ef965a096c27
[ "MIT" ]
permissive
coddingtonbear/jirafs
a78f47e59836d9a6024bc287ea2a1247fb297e62
778cba9812f99eeaf726a77c1bca5ae2650a35e9
refs/heads/development
2023-06-16T00:06:33.262635
2022-09-20T04:06:26
2022-09-20T04:06:26
21,588,191
125
17
MIT
2023-06-02T05:48:53
2014-07-07T21:54:20
Python
UTF-8
Python
false
false
3,047
py
from __future__ import print_function import collections import json import os import shutil import subprocess from behave import * from jira.client import JIRA @given("jirafs is installed and configured") def installed_and_configured(context): pass @given("a cloned ticket with the following fields") def cloned_ticket_with_following_fields(context): jira_client = JIRA( { "server": context.integration_testing["url"], "verify": False, "check_update": False, }, basic_auth=( context.integration_testing["username"], context.integration_testing["password"], ), ) issue_data = { "project": {"key": context.integration_testing["project"]}, "issuetype": { "name": "Task", }, } for row in context.table: issue_data[row[0]] = json.loads(row[1]) issue = jira_client.create_issue(issue_data) if not "cleanup_steps" in context: context.cleanup_steps = [] context.cleanup_steps.append(lambda context: issue.delete()) context.execute_steps( u""" when the command "jirafs clone {url}" is executed and we enter the ticket folder for "{url}" """.format( url=issue.permalink() ) ) @when('the command "{command}" is executed') def execute_command(context, command): command = command.format(**context.integration_testing) env = os.environ.copy() env["JIRAFS_GLOBAL_CONFIG"] = context.integration_testing["config_path"] env["JIRAFS_ALLOW_USER_INPUT__BOOL"] = "0" proc = subprocess.Popen( command.encode("utf-8"), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env, ) stdout, stderr = proc.communicate() if not hasattr(context, "executions"): context.executions = collections.deque() context.executions.appendleft( { "command": command, "stdout": stdout.decode("utf-8"), "stderr": stderr.decode("utf-8"), "return_code": proc.returncode, } ) @when('we enter the ticket folder for "{url}"') def execute_command(context, url): url = url.format(**context.integration_testing) os.chdir(os.path.join(os.getcwd(), url.split("/")[-1])) @then('the directory will contain a file named "{filename}"') def directory_contains_file(context, filename): assert filename in os.listdir("."), "%s not in folder" % filename @then('the output will contain the text "{expected}"') def output_will_contain(context, expected): expected = expected.format(**context.integration_testing) assert expected in context.executions[0]["stdout"], "%s not in %s" % ( expected, context.executions[0]["stdout"], ) @step("print execution results") def print_stdout(context): print(json.dumps(context.executions[0], indent=4, sort_keys=True)) @step("debugger") def debugger(context): import ipdb ipdb.set_trace()
[ "me@adamcoddington.net" ]
me@adamcoddington.net
796e00eb1d56efcf0a57251345c0236b3a28f9da
16e69196886254bc0fe9d8dc919ebcfa844f326a
/edc/base/modeladmin/admin/base_model_admin.py
5b0f9d99161144063c25f8b56d2d0ac3ca00c756
[]
no_license
botswana-harvard/edc
b54edc305e7f4f6b193b4498c59080a902a6aeee
4f75336ff572babd39d431185677a65bece9e524
refs/heads/master
2021-01-23T19:15:08.070350
2015-12-07T09:36:41
2015-12-07T09:36:41
35,820,838
0
0
null
null
null
null
UTF-8
Python
false
false
20,157
py
import logging import re from datetime import datetime from django.contrib import admin from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import NoReverseMatch from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.utils.encoding import force_unicode from edc.entry_meta_data.helpers import ScheduledEntryMetaDataHelper from edc.subject.rule_groups.classes import site_rule_groups from edc.base.modeladmin import NextUrlError logger = logging.getLogger(__name__) class NullHandler(logging.Handler): def emit(self, record): pass nullhandler = logger.addHandler(NullHandler()) class BaseModelAdmin (admin.ModelAdmin): list_per_page = 15 instructions = ['Please complete the questions below.'] required_instructions = ('Required questions are in bold. ' 'When all required data has been entered click SAVE to return to the dashboard ' 'or SAVE NEXT to go to the next form (if available). Additional questions may be required or may need to be corrected when you attempt to save.') def __init__(self, *args): if not isinstance(self.instructions, list): raise ImproperlyConfigured('ModelAdmin {0} attribute \'instructions\' must be a list.'.format(self.__class__)) if not isinstance(self.required_instructions, basestring): raise ImproperlyConfigured('ModelAdmin {0} attribute \'required_instructions\' must be a list.'.format(self.__class__)) super(BaseModelAdmin, self).__init__(*args) def save_model(self, request, obj, form, change): self.update_modified_stamp(request, obj, change) super(BaseModelAdmin, self).save_model(request, obj, form, change) def contribute_to_extra_context(self, extra_context, object_id=None): return extra_context def add_view(self, request, form_url='', extra_context=None): extra_context = extra_context or dict() extra_context = self.contribute_to_extra_context(extra_context) extra_context.update(instructions=self.instructions) extra_context.update(required_instructions=self.required_instructions) extra_context.update(form_language_code=request.GET.get('form_language_code', '')) if request.GET.get('group_title'): extra_context.update(title=('{group_title}: Add {title}').format(group_title=request.GET.get('group_title'), title=force_unicode(self.model._meta.verbose_name))) extra_context.update(self.get_dashboard_context(request)) # model_help_text = '' #self.get_model_help_text(self.model._meta.app_label, self.model._meta.object_name) # extra_context.update(model_help_text_meta=model_help_text[META], model_help_text=model_help_text[DCT]) return super(BaseModelAdmin, self).add_view(request, form_url=form_url, extra_context=extra_context) def change_view(self, request, object_id, form_url='', extra_context=None): extra_context = extra_context or dict() extra_context = self.contribute_to_extra_context(extra_context, object_id) extra_context.update(instructions=self.instructions) extra_context.update(required_instructions=self.required_instructions) extra_context.update(form_language_code=request.GET.get('form_language_code', '')) if request.GET.get('group_title'): extra_context.update(title=('{group_title}: Add {title}').format(group_title=request.GET.get('group_title'), title=force_unicode(self.model._meta.verbose_name))) extra_context.update(self.get_dashboard_context(request)) result = super(BaseModelAdmin, self).change_view(request, object_id, form_url=form_url, extra_context=extra_context) # Look at the referer for a query string '^.*\?.*$' ref = request.META.get('HTTP_REFERER', '') if ref.find('?') != -1: # We've got a query string, set the session value request.session['filtered'] = ref return result def response_add(self, request, obj, post_url_continue=None): """Redirects as default unless keyword 'next' is in the GET and is a valid url_name (e.g. can be reversed using other GET values).""" http_response_redirect = super(BaseModelAdmin, self).response_add(request, obj, post_url_continue) custom_http_response_redirect = None if '_addanother' not in request.POST and '_continue' not in request.POST: if request.GET.get('next'): custom_http_response_redirect = self.response_add_redirect_on_next_url( request.GET.get('next'), request, obj, post_url_continue, post_save=request.POST.get('_save'), post_save_next=request.POST.get('_savenext'), post_cancel=request.POST.get('_cancel')) return custom_http_response_redirect or http_response_redirect def response_change(self, request, obj, post_url_continue=None): """Redirects as default unless keyword 'next' is in the GET and is a valid url_name (e.g. can be reversed using other GET values).""" http_response_redirect = super(BaseModelAdmin, self).response_add(request, obj, post_url_continue) custom_http_response_redirect = None if '_addanother' not in request.POST and '_continue' not in request.POST: # look for session variable "filtered" set in change_view if request.session.get('filtered', None): if 'next=' not in request.session.get('filtered'): # return to the changelist using the same changelist filter, e.g. ?q=Erik custom_http_response_redirect = HttpResponseRedirect(request.session['filtered']) request.session['filtered'] = None if request.GET.get('next'): # go back to the dashboard or something custom custom_http_response_redirect = self.reponse_change_redirect_on_next_url( request.GET.get('next'), request, obj, post_url_continue, post_save=request.POST.get('_save'), post_save_next=request.POST.get('_savenext'), post_cancel=request.POST.get('_cancel')) return custom_http_response_redirect or http_response_redirect def response_add_redirect_on_next_url(self, next_url_name, request, obj, post_url_continue, post_save=None, post_save_next=None, post_cancel=None): """Returns a http_response_redirect when called using the next_url_name. Users may override to to add special handling for a named url next_url_name.""" custom_http_response_redirect = None if not next_url_name: raise NextUrlError('Attribute \'next_url_name\' may not be none. Check the GET parameter \'next\' in your url.') else: url = None if next_url_name in ['changelist', 'add']: # reverse to a default admin url # next_url_name is "mode" and is being used to get to the default admin add or changelist mode = next_url_name app_label = request.GET.get('app_label') module_name = request.GET.get('module_name') if module_name: module_name = module_name.lower() if not app_label or not module_name: raise NextUrlError('next_url_name shortcut \'{0}\' (next={0}) requires GET attributes \'app_label\' and \'module_name\'. Got app_label={1}, module_name={2}.'.format(next_url_name, app_label, module_name)) url = reverse('admin:{app_label}_{module_name}_{mode}'.format(app_label=app_label, module_name=module_name, mode=mode)) else: try: # try to reverse using the next_url_name and the all values in the GET string # less ['next', 'dashboard_id', 'dashboard_model', 'dashboard_type', 'show']. # dashbord_xx values are excluded because we do not want to intercept a dashboard url here kwargs = dict() [kwargs.update({key: value}) for key, value in request.GET.iteritems() if key not in ['next', 'dashboard_id', 'dashboard_model', 'dashboard_type', 'show']] if kwargs: url = reverse(next_url_name, kwargs=kwargs) except NoReverseMatch: # ok, failed to reverse with exactly what was given dashboard_id = request.GET.get('dashboard_id') dashboard_model = request.GET.get('dashboard_model') dashboard_type = request.GET.get('dashboard_type') entry_order = request.GET.get('entry_order') visit_attr = request.GET.get('visit_attr') help_link = request.GET.get('help_link') # help link added to custom change form show = request.GET.get('show', 'any') # at this point we may have a url # 1. an admin url (default) # 2. a reversed url using next= and all other non-dashboard GET values # if we do not have a url, then we have set the dashboard values # and will treat the next url as a dashboard url if not url: if post_save: # will default to a url that takes us back to the subject dashoard below pass elif post_save_next: # post_save_next is only available to subject forms # try to reverse using method next_url_in_scheduled_entry_meta_data() # which jumps to the next form on the subject dashboard instead of going # back to the subject dashboard try: next_url, visit_model_instance, entry_order = self.next_url_in_scheduled_entry_meta_data(obj, visit_attr, entry_order) if next_url: url = ('{next_url}?next={next}&dashboard_type={dashboard_type}&dashboard_id={dashboard_id}' '&dashboard_model={dashboard_model}&show={show}{visit_attr}{visit_model_instance}{entry_order}{help_link}' ).format(next_url=next_url, next=next_url_name, dashboard_type=dashboard_type, dashboard_id=dashboard_id, dashboard_model=dashboard_model, show=show, visit_attr='&visit_attr={0}'.format(visit_attr), visit_model_instance='&{0}={1}'.format(visit_attr, visit_model_instance.pk), entry_order='&entry_order={0}'.format(entry_order), help_link='&help_link={0}'.format(help_link)) except NoReverseMatch: pass elif post_cancel: # cancel goes back to the dashboard # FIXME: i think the URL for the cancel button/link is calculated for by the dashboard # for the template or reversed on the template, so this might # be code that cannot be reached url = reverse( 'subject_dashboard_url', kwargs={ # TODO: this defaults to the value subject_dashboard_url, not the variable!!! 'dashboard_type': dashboard_type, 'dashboard_id': dashboard_id, 'dashboard_model': dashboard_model, 'show': show}) else: pass if not url: # default back to the dashboard url = self.reverse_next_to_dashboard(next_url_name, request, obj) custom_http_response_redirect = HttpResponseRedirect(url) return custom_http_response_redirect def reponse_change_redirect_on_next_url(self, next_url_name, request, obj, post_url_continue, post_save, post_save_next, post_cancel): """Returns an http_response_redirect if next_url_name can be reversed otherwise None. Users may override to to add special handling for a named url next_url_name. .. note:: currently this assumes the next_url_name is reversible using dashboard criteria or returns nothing.""" custom_http_response_redirect = None if 'dashboard' in next_url_name: # FIXME: find a better way to intercept dashboard urls and ignore others url = self.reverse_next_to_dashboard(next_url_name, request, obj) custom_http_response_redirect = HttpResponseRedirect(url) request.session['filtered'] = None else: change_list_q = '' kwargs = {} [kwargs.update({key: value}) for key, value in request.GET.iteritems() if key != 'next'] try: if '_add' in next_url_name: url = reverse(next_url_name) elif '_changelist' in next_url_name: url = reverse(next_url_name) if kwargs.get('q', None) and kwargs.get('q') != 'None': change_list_q = '?q={}'.format(kwargs.get('q')) else: url = reverse(next_url_name, kwargs=kwargs) except NoReverseMatch: try: # try reversing to the url from just section_name url = reverse(next_url_name, kwargs={'section_name': kwargs.get('section_name')}) except NoReverseMatch: raise NoReverseMatch('response_change failed to reverse url \'{0}\' with kwargs {1}. Is this a dashboard url?'.format(next_url_name, kwargs)) custom_http_response_redirect = HttpResponseRedirect('{}{}'.format(url, change_list_q)) request.session['filtered'] = None return custom_http_response_redirect def get_form_prep(self, request, obj=None, **kwargs): pass def get_form_post(self, form, request, obj=None, **kwargs): return form def get_form(self, request, obj=None, **kwargs): """Overrides to check if supplemental fields have been defined in the admin class. * get_form is called once to render and again to save, e.g. on GET and then on POST. * Need to be sure that the same supplemental choice is given on GET and POST for both add and change. """ self.get_form_prep(request, obj, **kwargs) form = super(BaseModelAdmin, self).get_form(request, obj, **kwargs) form = self.get_form_post(form, request, obj, **kwargs) form = self.auto_number(form) return form def update_modified_stamp(self, request, obj, change): """Forces username to be saved on add/change and other stuff, called from save_model""" if not change: obj.user_created = request.user.username if change: obj.user_modified = request.user.username obj.modified = datetime.today() def insert_translation_help_text(self, form): WIDGET = 1 for fld in form.base_fields.iteritems(): fld[WIDGET].translation_help_text = unicode('translation') return form def auto_number(self, form): WIDGET = 1 auto_number = True if 'auto_number' in dir(form._meta): auto_number = form._meta.auto_number if auto_number: for index, fld in enumerate(form.base_fields.iteritems()): if not re.match(r'^\d+\.', unicode(fld[WIDGET].label)): fld[WIDGET].label = '{0}. {1}'.format(unicode(index + 1), unicode(fld[WIDGET].label)) return form def get_dashboard_context(self, request): return {'subject_dashboard_url': request.GET.get('next', ''), 'dashboard_type': request.GET.get('dashboard_type', ''), 'dashboard_model': request.GET.get('dashboard_model', ''), 'dashboard_id': request.GET.get('dashboard_id', ''), 'show': request.GET.get('show', 'any')} def reverse_next_to_dashboard(self, next_url_name, request, obj, **kwargs): url = '' if next_url_name and request.GET.get('dashboard_id') and request.GET.get('dashboard_model') and request.GET.get('dashboard_type'): kwargs = {'dashboard_id': request.GET.get('dashboard_id'), 'dashboard_model': request.GET.get('dashboard_model'), 'dashboard_type': request.GET.get('dashboard_type')} # a subject dashboard url will also have "show" if request.GET.get('show'): # this may fail if a subject template does not set show kwargs.update({'show': request.GET.get('show', 'any')}) url = reverse(next_url_name, kwargs=kwargs) elif next_url_name in ['changelist', 'add']: app_label = request.GET.get('app_label') module_name = request.GET.get('module_name').lower() mode = next_url_name url = reverse('admin:{app_label}_{module_name}_{mode}'.format(app_label=app_label, module_name=module_name, mode=mode)) else: # normally you should not be here. try: kwargs = self.convert_get_to_kwargs(request, obj) url = reverse(next_url_name, kwargs=kwargs) except NoReverseMatch: try: # try reversing to the url from just section_name url = reverse(next_url_name, kwargs={'section_name': kwargs.get('section_name')}) except NoReverseMatch: raise NoReverseMatch('response_add failed to reverse url \'{0}\' with kwargs {1}. Is this a dashboard url?'.format(next_url_name, kwargs)) except: raise return url def convert_get_to_kwargs(self, request, obj): kwargs = dict() for k, v in request.GET.iteritems(): kwargs.update({str(k): ''.join(unicode(i) for i in request.GET.get(k))}) if not v: if k in dir(obj): try: kwargs.update({str(k): getattr(obj, k)}) except AttributeError: pass if 'next' in kwargs: del kwargs['next'] if 'csrfmiddlewaretoken' in kwargs: del kwargs['csrfmiddlewaretoken'] return kwargs def next_url_in_scheduled_entry_meta_data(self, obj, visit_attr, entry_order): """Returns a tuple with the reverse of the admin url for the next model listed in scheduled_entry_meta_data. If there is not a "next" model, returns an empty tuple (None, None, None). Called from response_add and response_change.""" next_url_tuple = (None, None, None) if visit_attr and entry_order: visit_instance = getattr(obj, visit_attr) # site_rule_groups.update_all(visit_instance) site_rule_groups.update_rules_for_source_model(obj, visit_instance) next_entry = ScheduledEntryMetaDataHelper(visit_instance.get_appointment(), visit_instance.__class__, visit_attr).get_next_entry_for(entry_order) if next_entry: next_url_tuple = ( reverse('admin:{0}_{1}_add'.format(next_entry.entry.content_type_map.app_label, next_entry.entry.content_type_map.module_name)), visit_instance, next_entry.entry.entry_order ) return next_url_tuple
[ "ew2789@gmail.com" ]
ew2789@gmail.com
7dca7bc5e4e3e45e9c6827e5becf8325cc03c1b0
1c0f6f9d322b5abde0a49dd811237f2dbc579928
/src/scpiparser/CommandInterpreter.py
c0498e193fb293fe2a4e0270638560f6f802c0e1
[ "MIT" ]
permissive
tom-biskupic/PythonSCPI
8f48c165fa52d7abe7ca2e8ec2e33fec50d9fdcf
46056c373298ffcb9d2f2a6a6a356f2c44a2991d
refs/heads/master
2022-03-20T00:16:13.478029
2022-02-11T15:04:30
2022-02-11T15:04:30
140,911,624
2
1
null
null
null
null
UTF-8
Python
false
false
9,988
py
from lark import Lark,Token from lark.exceptions import UnexpectedInput if __package__: from .QueryHandler import QueryHandler from .CommandHandler import PrintHandler from .QueryHandler import IDNHandler from .HandlerMap import HandlerMap else: from QueryHandler import QueryHandler from CommandHandler import PrintHandler from QueryHandler import IDNHandler from HandlerMap import HandlerMap class ParserContext: def __init__(self): self.is_first = True self.command_scope = "" def get_is_first(self): return self.is_first def set_is_first(self,value): self.is_first = value def get_command_scope(self): return self.command_scope def set_command_scope(self,value): self.command_scope = value class CommandInterpreter: SCPI_GRAMMAR = """ start: program_message_unit ( PROGRAM_MESSAGE_SEPARATOR WS_INLINE? program_message_unit )* program_message_unit: command_message_unit | query_message_unit command_message_unit: command_program_header [ WS_INLINE program_data ( PROGRAM_DATA_SEPARATOR program_data )*] query_message_unit: query_program_header ( WS_INLINE program_data (PROGRAM_DATA_SEPARATOR program_data )*)? program_data : character_program_data | DECIMAL_NUMERIC_PROGRAM_DATA suffix_program_data? | NON_DECIMAL_NUMERIC_DATA | STRING_PROGRAM_DATA | suffix_program_data // | arbitrary_block_program_data // | expression_program_data command_program_header: WS_INLINE? SIMPE_COMMAND_PROGRAM_HEADER | COMPOUND_COMMAND_PROGRAM_HEADER | COMMON_COMMAND_PROGRAM_HEADER SIMPE_COMMAND_PROGRAM_HEADER: PROGRAM_MNEMONIC COMPOUND_COMMAND_PROGRAM_HEADER: ":"? PROGRAM_MNEMONIC ( ":" PROGRAM_MNEMONIC )+ COMMON_COMMAND_PROGRAM_HEADER: "*" PROGRAM_MNEMONIC query_program_header: WS_INLINE? SIMPLE_QUERY_PROGRAM_HEADER | COMPOUND_QUERY_PROGRAM_HEADER | COMMON_QUERY_PROGRAM_HEADER SIMPLE_QUERY_PROGRAM_HEADER: PROGRAM_MNEMONIC "?" COMPOUND_QUERY_PROGRAM_HEADER: ":"? PROGRAM_MNEMONIC (":" PROGRAM_MNEMONIC)+ "?" COMMON_QUERY_PROGRAM_HEADER: "*" PROGRAM_MNEMONIC "?" character_program_data: PROGRAM_MNEMONIC suffix_program_data: WS_INLINE? "/"? (suffix_program_data_middle ( ("/"|".") suffix_program_data_middle )*)? suffix_program_data_middle: (suffix_prog_data_with_mult | suffix_prog_data_without_mult) suffix_prog_data_with_mult: SUFFIX_MULT (PROGRAM_MNEMONIC "-"? _DIGIT)? suffix_prog_data_without_mult: PROGRAM_MNEMONIC ("-"? _DIGIT)? SUFFIX_MULT: "EX"|"PE"|"T"|"G"|"MA"|"K"|"M"|"U"|"N"|"P"|"F"|"A" SUFFIX_UNIT: /[a-zA-Z]{1,4}/ NON_DECIMAL_NUMERIC_DATA: "#" (( "H"|"h" _HEX_DIGIT+ ) | ( "Q"|"q" _OCTAL_DIGIT+ ) | ( "B"|"b" _BINARY_DIGIT+ )) STRING_PROGRAM_DATA: ( SINGLE_QUOTED_STRING | DOUBLE_QUOTED_STRING ) SINGLE_QUOTED_STRING: "\'" ( "\'\'" | /[^']/ )* "\'" DOUBLE_QUOTED_STRING: "\\"" ( "\\"\\"" | /[^\\"]/ )* "\\"" DECIMAL_NUMERIC_PROGRAM_DATA: MANTISSA WS? EXPONENT? MANTISSA: ("+"|"-")? ( _DIGIT* "." _DIGIT+) | (_DIGIT+ ("." _DIGIT*)? ) EXPONENT: ("E"|"e") WS? ("+"|"-")? _DIGIT+ _DIGIT: "0".."9" _HEX_DIGIT: "a".."f"|"A".."F"|"0".."9" _BINARY_DIGIT: "0".."1" _OCTAL_DIGIT: "0".."7" PROGRAM_MESSAGE_SEPARATOR: WS_INLINE? ";" PROGRAM_DATA_SEPARATOR : WS_INLINE? "," WS_INLINE? PROGRAM_MNEMONIC : /[A-Za-z]+[A-Za-z0-9_]*/ %import common.WS_INLINE %import common.WS %import common.DECIMAL %import common.NEWLINE %ignore WS_INLINE %ignore WS """ # # The manufacturer, model, serial and firmware values are used to build the # response to the IDN command. This can be handled by the application by overridding # the IDN handler also # def __init__(self,manufacturer='Runcible Software Pty Ltd',model='Not Defined',serial='0',firmware_version='0'): # print(self.SCPI_GRAMMAR) # self.parser = Lark(self.SCPI_GRAMMAR, parser='earley', lexer="standard") self.parser = Lark(self.SCPI_GRAMMAR) self.command_handlers = HandlerMap() self.query_handlers = HandlerMap() self.register_query_handler("*IDN",IDNHandler(manufacturer,model,serial,firmware_version)) pass def register_command_handler(self,key,handler): self.command_handlers.register_handler(key,handler) def register_query_handler(self,key,handler): self.query_handlers.register_handler(key,handler) def process_line(self, command_string, call_context=None): if not command_string or command_string.isspace(): return "\n" try: parse_tree = self.parser.parse(command_string) except UnexpectedInput as err: return str(err) + err.get_context(text=command_string,span=200) results = "" context = ParserContext() for command in parse_tree.children: if not isinstance(command,Token): results += self._process(command.children[0],context,call_context) + "\n" context.set_is_first(False) return results def _process(self,command,context,call_context): if command.data == 'query_message_unit': return self._process_query(command.children[0].children[0],context,call_context) else: return self._process_command(command,context,call_context) def _process_query(self,query,context,call_context): # print("Query = "+str(command)) query_name = query.value[:-1] if context.get_is_first(): query_parts = query_name.split(":") context.set_command_scope(":".join(query_parts[:-1])) if not context.get_is_first() and context.get_command_scope() and query_name[0] != ":": query_name = context.get_command_scope() + ":" + query_name handler = self.query_handlers.find_handler(query_name) if handler: if call_context != None: return handler.query(query_name,call_context) else: return handler.query(query_name) else: # print("No handler for query "+query_name) return "Invalid query" def _process_command(self,command,context,call_context): # print("Command = "+str(command)) header_token = command.children[0].children[0] command_name = header_token.value if context.get_is_first(): query_parts = command_name.split(":") context.set_command_scope(":".join(query_parts[:-1])) if not context.get_is_first() and context.get_command_scope() and command_name[0] != ":": command_name = context.get_command_scope() + ":" + command_name if command_name[0] == ":": command_name = command_name[1:] handler = self.command_handlers.find_handler(command_name) if handler: if command.children[2].data == 'program_data': arg = self._parse_program_data(command.children[2]) else: arg = "no Idea" if call_context != None: return handler.set(command_name,arg,call_context) else: return handler.set(command_name,arg) else: #print("No handler for query "+command_name) return "Invalid command" def _parse_program_data(self,program_data): # print(program_data) arg_type = program_data.children[0].type arg_value = program_data.children[0].value if arg_type == 'DECIMAL_NUMERIC_PROGRAM_DATA': return float(arg_value) elif arg_type == 'NON_DECIMAL_NUMERIC_DATA': return self._parse_non_decimal(arg_value) elif arg_type == 'STRING_PROGRAM_DATA': string_body = arg_value[1:len(arg_value)-1] if arg_value[0] == '\'': string_body = string_body.replace('\'\'','\'') else: string_body = string_body.replace('\"\"','\"') return string_body else: return arg_value def _parse_non_decimal(self,arg_value): value_body = arg_value[2:len(arg_value)] type_char = arg_value[1].upper() if type_char == 'H': as_hex_string = "0x"+value_body return int(as_hex_string,16) elif type_char == 'B': as_binary_string = "0b"+value_body return int(as_binary_string,2) elif type_char == 'Q': as_octal_string = "0o"+value_body return int(as_octal_string,8) def _join_compound_name(self,names): # print("Names "+names) compound_name="" for name in names: if compound_name != '': compound_name += ":" compound_name += name return compound_name #ci = CommandInterpreter() # ci.register_command_handler("SOURCE:VOLTAGE",PrintHandler()) # print(ci.process_line("*IDN?")) # # print(ci.process_line("*RST")) # print(ci.process_line(":VOLT:MEAS?")) # # print(ci.process_line("*SRE 128")) # # print(ci.process_line(":SENSe:TINTerval:ARM:ESTOP:LAYer1:TIMer 10.0MHz")) # # print(ci.process_line(":STAT:OPER:PTR 0; NTR 16")) #print(ci.process_line("SOURCE:VOLTAGE 2.0e-2")) #print(ci.process_line("this is junk"))
[ "tom.biskupic@gmail.com" ]
tom.biskupic@gmail.com
86c3fa0419163a6f6c84f50c5591118e84995339
53fab060fa262e5d5026e0807d93c75fb81e67b9
/backup/user_233/ch29_2020_03_04_11_52_21_685286.py
86e106c02ae7810c6ae8a20278ff5d4c498791af
[]
no_license
gabriellaec/desoft-analise-exercicios
b77c6999424c5ce7e44086a12589a0ad43d6adca
01940ab0897aa6005764fc220b900e4d6161d36b
refs/heads/main
2023-01-31T17:19:42.050628
2020-12-16T05:21:31
2020-12-16T05:21:31
306,735,108
0
0
null
null
null
null
UTF-8
Python
false
false
497
py
inicial = float(input()) taxa = float(input()) aumento = 0 for i in range(24): valor = inicial * taxa ** i aumento += valor - inicial decimos = int(valor * 10 - int(valor)) centesimos = int(valor * 100 - decimos * 10 - int(valor) * 100) print('%d,%d%d' % (int(valor), decimos, centesimos)) decimos = int(aumento * 10 - int(aumento)) centesimos = int(aumento * 100 - decimos * 10 - int(aumento)) print('%d,%d%d' % (int(aumento), decimos, centesimos)
[ "you@example.com" ]
you@example.com
c49192e37cc60de56b0ffee281723aab1f74938b
8eaa84e38df19456b443a338f8780cee092cd93f
/src/utils.py
8b3be922bdc32f472675538a14acc4010f07cbec
[]
no_license
syamajala/ProjectileMotion
b4296c72fa0da58d9ad97a8d2d9649951eb2b077
f6417ea63fffe8b59754f70dd1e37547987a533a
refs/heads/master
2020-04-18T07:46:51.440820
2017-10-15T17:06:49
2017-10-15T17:06:49
66,796,583
0
2
null
2016-09-01T00:31:17
2016-08-28T23:46:40
JavaScript
UTF-8
Python
false
false
888
py
import pyproj import datetime import dateutil.parser ecef = pyproj.Proj(proj='geocent', ellps='WGS84', datum='WGS84') lla = pyproj.Proj(proj='latlong', ellps='WGS84', datum='WGS84') def rgb2rgba(rgb, alpha=255): c = map(int, rgb[4:-1].split(',')) return tuple(c) + (alpha, ) def ecef2lla(x, y, z): return pyproj.transform(ecef, lla, x, y, z, radians=True) def lla2ecef(lon, lat, alt): return pyproj.transform(lla, ecef, lon, lat, alt, radians=True) def build_start(start, seconds): begin = dateutil.parser.parse(start) delta = datetime.timedelta(seconds=seconds) new_start = (begin + delta).isoformat()[:-6] return new_start+'Z' def build_interval(start, seconds): begin = dateutil.parser.parse(start) delta = datetime.timedelta(seconds=seconds) end = (begin + delta).isoformat()[:-6] time = start+'/'+end+'Z' return time
[ "syamajala@gmail.com" ]
syamajala@gmail.com
3d0963f2422006664daf35f191af339431fd7d7f
4da6ba414d2657ba1b3dc6704dd910429155b059
/ex43.py
092b8d140e94419bcda7646340d0a40aa9b9a873
[]
no_license
hairuo/LPTHW
36ebfa8ee40f6eb9317919f49e403a3450c2c741
7923391b4f775b395dfbd7f9f8ce3150694881a3
refs/heads/master
2020-12-03T09:27:57.290214
2017-08-15T12:16:22
2017-08-15T12:16:22
95,622,714
2
0
null
null
null
null
UTF-8
Python
false
false
8,723
py
# Exercise 43: Basic Object-Oriented Analysis and Design from sys import exit from random import randint class Scene(object): def enter(self): print "This scene is not yet configured. Subclass it and implement enter()." exit(1) class Engine(object): def __init__(self, scene_map): self.scene_map = scene_map def play(self): current_scene = self.scene_map.opening_scene() while True: print "\n--------" next_scene_name = current_scene.enter() current_scene = self.scene_map.next_scene(next_scene_name) class Death(Scene): quips = [ "You died. You kinda suck at this.", "Your momo would be proud... if she were smarter.", "Such a luser.", "I have a small puppy that's better at this." ] def enter(self): print Death.quips[randint(0, len(self.quips)-1)] exit(1) class CentralCorridor(Scene): def enter(self): print "The Gothons of Planet Percal #25 have invaded your ship and destroyed" print "your entire crew. You are the last surviving member and your last" print "mission is to get the neutron destruct bomb from the Weapons Armory," print "put it in the bridge, and blow the ship up after getting into an" print "escape pod." print "\n" print "You're running down the central corridor to the Weapons Armory when" print "a Gothon jumps out, red scally skin, dark grimy teeth, and evil clown costume" print "flowing around his hate filled body. He's blocking the door to the" print "Armory and about to pull a weapon to blast you." action = raw_input("> ") if action == "shoot!": print "Quick on the draw you yank out your blaster and fire it at the Gothon." print "His clown costume is flowing and moving around his body, which throws" print "off your aim. Your laser hits his costume but misses him entirely. This" print "completely ruins his brand new costume his mother bought him, whcih" print "makes him fly into a rage and blast you repeatedly in the face until" print "you are dead. Then he eats you" print "death" elif action == "dodge!": print "Like a world class boxer you dodge, weave, slip and slide right" print "as the Gothon's blaster cranks a laser past your head." print "In the middle of your artful dodge your foot slips and you" print "bang your head on the metal wall and pass out." print "You wake up shortly after only to die as the Gothon stomps on" print "your head and eats you." return 'death' elif action == "tell a joke": print "Lucky for you they made you learn Gothon insults in the academy" print "You tell the one Gothon joke you know:" print "Lbhe zbgure vf fb sng, jura fur fvgf nebhaq gur ubhfr, fur fvgf nebhaq gur ubhfr." print "The Gothon stops, tries not to laugh, then busts out laughing and can't move." print "While he's laughing you runup and shoot him square in the head" print "putting him down, then jump through the Weapon Armory door." return 'laser_weapon_armory' else: print "DOES NOT COMPUTE!" return 'central_corridor' class LaserWeaponArmory(Scene): def enter(self): print "You do a dive roll into the Weapon Armory, crouch and scan the room" print "for more Gothons that might be hiding. It's dead quiet, too quiet." print "You stand up and run to the far side of the room and find the" print "neutron bomb in its container. There's a keypad lock on the box" print "and you need the code to get the bomb out. If you get the code" print "wrong 10 times then the lock closes forever and you can't " print "get the bomb. The code is 3 digits." code = "%d%d%d" % (randint(1,9), randint(1,9), randint(1,9)) guess = raw_input("[keypad]> ") guesses = 0 while guess != code and guesses < 10: #Error: guesses != code print "BZZZZEDDD!" guesses += 1 guess = raw_input("[keypad]> ") if guess == code: print "The container clicks open and the seal breaks, letting gas out." print "You grab the neutron bomb and run as fast as you can to the" print "bridge where you must place it in the right spot." return 'the_bridge' else: print "The lock buzzes one last time and then you hear a sickening" print "melting sound as the mechanism is fused together" print "You decide to sit there, and finally the Gothons blow up the" print "ship from their ship and you die." return 'death' class TheBridge(Scene): def enter(self): print "You burst onto the Bridge with the neutron destruct bomb" print "under your arm and surprise 5 Gothons who are trying to" print "take control of the ship. Each of them has an even uglier" print "clown costume than the last. They haven't pulled their" print "weapons out yet, as they see the active bomb under your" print "arm and don't want to see it off." action = raw_input("> ") if action == "throw the bomb": print "In a panic you throw the bomb at the group of Gothons" print "and make a leap for the door. Right as you drop it a" print "Gothon shoots you right in the back killing you." print "As you die you see another Gothon frantically try to disarm" print "the bomb. You die knowing they will probably blow up them" print "it goes off." return 'death' elif action == "slowly place the bomb": print "You point your blaster at the bomb under your arm" print "and the Gothons put their hands up and start to sweat." print "You inch backward to the door, open it, and then carefully" print "place the bomb on the floor, pointing your blaster at it." print "You then jump back through the door, punch the close button" print "and blast the lock so the Gothons can't get out." print "Now that the bomb is placed you run to the escape pod to" print "get off this tin can." return 'escape_pod' else: print "DOES NOT COMPUTE!" return "the_bridge" class EscapePod(Scene): def enter(self): print "You rush through the ship desperately trying to make it to" print "the escape pod before the whole ship explodes. It seems like" print "hardly any Gothons are on the ship, so your run is clear of" print "interference. You get to the chamber with the escape pods, and" print "now need to pick one to take. Some of them could be damaged" print "but you don't have time to look. There's 5 pods, which one" print "do you take?" good_pod = randint(1,5) guess = raw_input("[pod #]> ") if int(guess) != good_pod: print "You jump into pod %s and hit the eject button." % guess print "The pod escape out into the void of space, then" print "implodes as the hull ruptures, crushing your body" print "into jam jelly." return 'death' else: print "You jump into pod %s and hit the eject button." % guess print "The pod easily slides out into space heading to" print "the planet below. As it flies to the planet, you look" print "back and see your ship implode then explode like a" print "bright star, taking out the Gothon ship at the same" print "time. You won!" return 'finished' class Map(object): scenes = { 'central_corridor': CentralCorridor(), 'laser_weapon_armory': LaserWeaponArmory(), 'the_bridge': TheBridge(), 'escape_pod': EscapePod(), 'death': Death() } def __init__(self, start_scene): self.start_scene = start_scene def next_scene(self, scene_name): return Map.scenes.get(scene_name) # The method get() returns a value for the given key. # If key is not available then returns default value None. def opening_scene(self): return self.next_scene(self.start_scene) #Error: (self, start_scene) a_map = Map('central_corridor') a_game = Engine(a_map) a_game.play()
[ "hairuo@gmail.com" ]
hairuo@gmail.com
754e4cf87805acc755afe9ff9c895f1243f52c05
ef1860a6c1a46084d3fc58eb03b6941d3e3b8a89
/MiscroProject/random_game.py
84a8a74ec95942d51748e55a29050940d9c9e567
[]
no_license
YertAlan/Yert_Python
073729e7d5b68ddefd033891c4df6a205e2b3cf7
b54b31c631162f1f376fb402358c3e747dfb7e18
refs/heads/master
2021-07-08T22:00:39.770378
2020-10-19T04:21:15
2020-10-19T04:21:15
193,183,969
0
0
null
null
null
null
UTF-8
Python
false
false
1,544
py
#-*- coding:utf-8 -*- #创建一个摇色子的游戏 import random #生成一个色子的随机数 def ran_num(): list = [1,2,3,4,5,6] n = random.choice(list) return n #将三个色子的随机数进行总和 def ran_sum(): s = 0 list = [] for i in range(3): n = ran_num() list.append(n) s = sum(list) print(list," = ",s) return s #判断摇色子后的输赢 def ran_win(c): s = ran_sum() if s >= 11: if c == "Big": return True else: return False else: if c == "Small": return True else: return False #获取选择,并根据选择和结果对比输赢 def choice(): choi = ["Big","Small","Stop"] score = 1000 while True: your_choice = str(input("Please input your choice: Big or Small or Stop\n")) if your_choice not in choi: print("Your choice is error") else: if your_choice == "Stop": break else: n = ran_win(your_choice) if n == True: score += 100 print("You're win,your score is ",score) else: score -= 200 print("You're loose,your score is ",score) if score <= -1000: print("Your score is low -1000,game over.") break def main(): choice() if __name__ == '__main__': main()
[ "2226895290@qq.com" ]
2226895290@qq.com
bdd72be6fe900c43b8628faccbf524db82bd5c62
6e8d92b36e763d85e60e076d5552976d37f32218
/deploy_test/test_large1.py
1bfd20fd9a85facdf62921ad933bc5603556de36
[ "Apache-2.0" ]
permissive
additionsec/as_gateway
a258d52411a141dfcf6661404aecc5a51f2e65fe
62da2f842861d844fecbe8e659e676f52d4df8eb
refs/heads/master
2021-03-30T17:23:43.959959
2019-02-22T04:13:31
2019-02-22T04:13:31
58,244,529
0
0
null
null
null
null
UTF-8
Python
false
false
1,776
py
import addsec_cti_pb2 import common import time def test1(): report = addsec_cti_pb2.Report() common.test_populate( report ) ob = report.observations.add() ob.observationType = 2 ob.timestamp = int(time.time()) ob.testId = 50 dat = ob.datas.add() dat.dataType = 10 dat.data = "A" * 8192 payload = report.SerializeToString() r = common.test_send( payload ) if r != 200: raise Exception("test1 result") def test2(): report = addsec_cti_pb2.Report() common.test_populate( report ) ob = report.observations.add() ob.observationType = 2 ob.timestamp = int(time.time()) ob.testId = 50 dat = ob.datas.add() dat.dataType = 10 dat.data = "/dev/null" report.organizationId = "A" * 8192 payload = report.SerializeToString() r = common.test_send( payload ) if r != 200: raise Exception("test1 result") def test3(): report = addsec_cti_pb2.Report() common.test_populate( report ) ob = report.observations.add() ob.observationType = 2 ob.timestamp = int(time.time()) ob.testId = 50 dat = ob.datas.add() dat.dataType = 10 dat.data = "/dev/null" report.systemId = "A" * 8192 payload = report.SerializeToString() r = common.test_send( payload ) if r != 200: raise Exception("test1 result") def test4(): report = addsec_cti_pb2.Report() common.test_populate( report ) ob = report.observations.add() ob.observationType = 2 ob.timestamp = int(time.time()) ob.testId = 50 dat = ob.datas.add() dat.dataType = 10 dat.data = "/dev/null" report.applicationId = "A" * 8192 payload = report.SerializeToString() r = common.test_send( payload ) if r != 200: raise Exception("test1 result") if __name__ == "__main__": try: test1() except: pass try: test2() except: pass try: test3() except: pass try: test4() except: pass
[ "jeff@forristal.com" ]
jeff@forristal.com
75890dbe0a461be67cb79e65c3af9634256f307c
2b475334a5456d244325a0fda21de9483abed122
/CommentsMicroService/CommentsDatabase.py
9a50abfa581ee05992186e3db64c797fb952e525
[]
no_license
ThomasGalesloot/Seng-401-Project-Backend-2
aaac53445f958df1b80a7eb33870bdb73f5ecf83
3859a0a0dd1d09e80a11e96db1c5d8d6fef2a17a
refs/heads/master
2022-04-11T08:24:44.816381
2020-04-03T04:29:50
2020-04-03T04:29:50
243,092,260
0
0
null
null
null
null
UTF-8
Python
false
false
350
py
import pyodbc class CommentsDatabase: def __init__(self): self.conn = pyodbc.connect('Driver={SQL Server};' 'Server=DESKTOP-Q5ABK7U;' 'Database=CommentsDatabase;' 'Trusted_Connection=yes;') self.cursor = self.conn.cursor()
[ "ryanoakes686@gmail.com" ]
ryanoakes686@gmail.com
9da7ec52675ca523d85ea18df6fe32e84e5ae63b
5dfb170597ec46d6f66d8446c366c262da43a3ec
/python/oneflow/test/dataloader/test_numpy_dataset.py
995df2b0f459a6246428e490239faeb4bedf5625
[ "Apache-2.0" ]
permissive
dangkai4u/oneflow
c274abbd84a9043e4711f8320566eed27c748296
63ecd5e2c539c9a44011b2e80af1ebae48eb6a0a
refs/heads/master
2023-06-22T18:41:44.800378
2021-07-27T04:24:06
2021-07-27T04:24:06
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,554
py
""" Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ import unittest import numpy as np import oneflow as flow import oneflow.unittest import oneflow.utils.data as Data class ScpDataset(Data.Dataset): def __init__(self, chunksize=200, dim=81, length=2000): self.chunksize = chunksize self.dim = dim self.length = length def __getitem__(self, index): np.random.seed(index) return np.random.randn(self.chunksize, self.dim) def __len__(self): return self.length @flow.unittest.skip_unless_1n1d() @unittest.skipIf( not flow.unittest.env.eager_execution_enabled(), ".numpy() doesn't work in lazy mode", ) class TestNumpyDataset(flow.unittest.TestCase): def test_numpy_dataset(test_case): dataset = ScpDataset() dataloader = Data.DataLoader(dataset, batch_size=16, shuffle=True) for X in dataloader: test_case.assertEqual(X.shape, flow.Size([16, 200, 81])) if __name__ == "__main__": unittest.main()
[ "noreply@github.com" ]
noreply@github.com
1ae74b4fd7b9d4eff80f6b125bfcc8bbd696692e
bbd393495f55e2ea3841c0242d03499b6ae5c5f1
/game_tic.py
2cda744ac882b79e4c2ff73fa136e859898459a0
[]
no_license
Nitapol/game
70205809e66de66407ccdd53bf3e94e5f625f808
ef2d285958e4420f493263d915b77e7da723968e
refs/heads/master
2022-01-23T16:35:01.040394
2022-01-02T18:20:47
2022-01-02T18:20:47
188,763,538
0
0
null
null
null
null
UTF-8
Python
false
false
2,781
py
# BOF#######################################################################BOF from game import Game class GameTicTacToe(Game): # ################################################# # 0 1 2 # 3 4 5 # 6 7 8 winning_pairs = [[[1, 2], [4, 8], [3, 6]], # for 0 [[0, 2], [4, 7]], # for 1 [[0, 1], [4, 6], [5, 8]], # for 2 [[0, 6], [4, 5]], # for 3 [[0, 8], [1, 7], [2, 6], [3, 5]], # for 4 [[2, 8], [3, 4]], # for 5 [[0, 3], [4, 2], [7, 8]], # for 6 [[6, 8], [1, 4]], # for 7 [[6, 7], [0, 4], [2, 5]], # for 8 ] square_free = '.' square_X = 'X' square_O = 'O' def __init__(self, player=Game.player1): super().__init__() self._player_X = player self._board = [GameTicTacToe.square_free for _ in range(9)] def get_board(self): return self._board def get_possible_moves(self): if self._state is not Game.play: return [] return [ index for index, square in enumerate(self._board) if square == GameTicTacToe.square_free ] def make_move(self, index, player=None): # return True if can continue # can play out of order(future feature) if not isinstance(index, int) or 0 < index > 8: raise ValueError if player is not None: if not isinstance(player, int)\ or Game.player1 < player > Game.player2: raise ValueError self._player = player if self._board[index] != GameTicTacToe.square_free: raise ValueError if self._state != Game.play: raise ValueError if self._player_X == self._player: piece = GameTicTacToe.square_X else: piece = GameTicTacToe.square_O self._board[index] = piece for index1, index2 in GameTicTacToe.winning_pairs[index]: if piece == self._board[index1] == self._board[index2]: if self._player == Game.player1: self._state = Game.won else: self._state = Game.lost return False if len(self.get_possible_moves()) == 0: self._state = Game.draw return False self.next_player() return True def __str__(self): return ''.join(self._board) def print_game(self): print() s = str(self) for i in range(0, 9, 3): print(s[i] + " " + s[i + 1] + " " + s[i + 2]) # EOF#######################################################################EOF
[ "nitapol@hotmail.com" ]
nitapol@hotmail.com
2630e1b154db476190df6a0655a55e06d00502d5
4eb58a2c7d3d17af36b4e2c27d88f8a8e2beca32
/DCM_logit.py
708ea919905a325f1f7d3c7b544ef898b938e411
[]
no_license
Meghdad-DTU/Discrete-Choice-Model
fefec73e7c3d6613ea34ed151737c5910cd1b114
2b58969c52649024de423906f86e5fcbfb3a2269
refs/heads/main
2023-01-24T05:28:07.665537
2020-12-03T13:15:18
2020-12-03T13:15:18
312,388,987
1
0
null
null
null
null
UTF-8
Python
false
false
19,127
py
from scipy.optimize import minimize from scipy.stats import norm from numdifftools import Hessian, Gradient from datetime import datetime import halton as hl # Halton sequence import lhsmdu # Latin hypercube sampling import time class DCM_logit(object): def __init__(self, mixing=0, startingiterations=100, verbose=False, RUM=True): self.mixing = mixing # set to 1 for models that include random parameters self.startingiterations = startingiterations self.verbose = verbose self.RUM = RUM # Random Utility Maximization is true otherwise Random Regret Minimization self.df = None self.finalLL = None # final Log likelihood self.no_parameters = None # number of estimated parameters self.estimates = None # estimated parameters self.cov = None # variance-covariance matrix def Initialization(self, modelname:str, data, no_est:int, parnames=None, startvalues=None): self.modelname = modelname self.data = data self.no_est = no_est # Number of parametrs for estimation self.parnames = parnames # Parameter's name self.startvalues = startvalues # Set starting values if startvalues is None: self.startvalues = np.repeat(0,self.no_est) nrow, ncol = data.shape # Determine number of individuals in the data self.N = len(set(data.ID)) # Determine number of choice tasks in the data self.choicetasks = nrow # Set number of alternatives in model self.number_of_alts = len(set(self.data.choice)) # Calculate LL(0) - this basic calculation assumes that availabilities are all 1 self.LL0 = nrow*np.log(1/number_of_alts) # generate draws (using Halton, Latin or Uniform ) def _halton(self,dim,sample): return hl.halton(dim,sample) def _latin(self,dim,sample): return np.asarray(lhsmdu.sample(sample,dim)) def _uniform(self,dim,sample): return np.random.rand(sample*dim).reshape(sample,dim) def _draw_transform(self,draws,randPars,transformPars,transform): """function changes the generated draws based on starting values""" # transformation of draws into standard normal distribution N(mean=0,std=1) draws_0_1= norm.ppf(draws) for rp in randPars: ind_rp = randPars.index(rp) items = [s for s in parNames if rp in s] ind_startVal = np.where(np.isin(parNames,items))[0] if len(ind_startVal)<2: continue ################################### # par1,par2: # for normal family par1:mean, par2:std # for sym_triangular, par1:a, par2:b #################################### par1,par2 = self.startvalues[ind_startVal] print(items, par1,par2) if transform=="normal": draws[:,ind_rp] = par1 + draws_0_1[:,ind_rp]*par2 # positive lognormal elif transform=="pos_lognormal": draws[:,ind_rp] = np.exp(par1 + draws_0_1[:,ind_rp]*par2) # negative lognormal elif transform=="neg_lognormal": draws[:,ind_rp] = -1*np.exp(par1 + draws_0_1[:,ind_rp]*par2) # symmetrical triangular elif transform=="sym_triangular": U1 = self._uniform(1,self.Ndraws*self.N).flatten() U2 = self._uniform(1,self.Ndraws*self.N).flatten() draws[:,ind_rp] = par1 + (U1+U2)*par2 else: print("transform is unknown, use normal, pos_lognormal, neg_lognormal or sym_triangular") return draws def Random_Parameters(self, Ndraws, randPars:list, method="halton", transformPars=None, transform=None): """ # Ndraws: set number of draws to use per person and per parameter # randPars: string list including the names of random parameters # method: draw methods including "halton", "latin" (Latin hypercube) or "uniform" # transformPars: list of random parameters for draw transformation # transform: draws transformation: "normal","pos_lognormal","neg_lognormal","sym_triangular" """ # dimentions: define number of random terms in the model self.Ndraws=Ndraws dimentions=len(randPars) drawNameList=["halton","latin","uniform"] drawMethod=[self._halton,self._latin,self._uniform] if method not in drawNameList: raise Exception("There are only three methods to generate draws: halton, latin & uniform.") if transformPars is None: transformPars=randPars ind=drawNameList.index(method) draws=drawMethod[ind](dimentions,Ndraws*self.N) # assign names to individual sets of draws - need one entry per dimension drawNames=["draws"+"_"+par for par in randPars] transformed_draws = self._draw_transform(draws=draws, randPars=randPars, transformPars=transformPars, transform=transform) # working copies draws_internal = pd.DataFrame(transformed_draws,columns=drawNames) data_internal = self.data.copy() # combine draws with estimation data # turn into datatable and add indices for people and draws, for merging later on draws_internal["ID"] = np.repeat(self.data.ID.unique(),Ndraws) draws_internal["draws_index"] = np.tile(range(1,Ndraws+1),self.N) draws_internal["merge_index"] = draws_internal["ID"]+ draws_internal["draws_index"]/100000 # reformat data_internal to accommodate draws_internal, expands datatable to # replicate each row R times, where R=number of draws data_internal = pd.DataFrame(pd.np.repeat(data_internal.values,Ndraws,axis=0),columns=data_internal.columns) nrow,_ = data_internal.shape # add a column with index for draws_internal data_internal["draws_index"] = np.tile(range(1,Ndraws+1),int(nrow/Ndraws)) # add an index for merging data_internal["merge_index"] = data_internal["ID"]+data_internal["draws_index"]/100000 # merging data_internal and draws_internal merged_data_internal = pd.merge(data_internal,draws_internal,on=["merge_index","ID","draws_index"],how="inner") # global versions self.draws = draws_internal self.data = merged_data_internal def Define_Model_Parameters(self): # initial betas beta = self.startvalues # These will need fine tuning depending on the model, etc lowerlimits=self.startvalues-0.1 upperlimits=self.startvalues+0.1 return beta,lowerlimits,upperlimits ## Custom log-likelihood function def loglike(self, parameters, functionality=1, data=None): data = self.data if data is not None: data = data # R: Regret, U: Utility RU = ["RU%d"%x for x in range(1,self.number_of_alts+1)] ERU = ["eRU%d"%x for x in range(1,self.number_of_alts+1)] ##################################################################### # subsection required only in estimation # ##################################################################### if functionality == 1: nrow, ncol = data.shape BETA = parameters if self.mixing==0: df = data.loc[:,["ID","choice","running_task"]] else: df = data.loc[:,["ID","choice","running_task","draws_index"]] ########################################## # define utility functions ########################################## for i,ru in enumerate(RU): df[ru] = RegUti_function(df, data, BETA)[i] # create a term we subtract from all utilities for numerical reasons: # (middle value between max and min of utilities) df["RUmax"] = df[RU].values.max(1) df["RUmin"] = df[RU].values.min(1) df["RUcensor"] = df[["RUmax","RUmin"]].values.mean(1) for ru in RU: df[ru] = df[ru] - df["RUcensor"] # exponentiate utilities ## for Random Utility Maximization if self.RUM: for eru,ru in zip(ERU,RU): df[eru] = np.exp(df[ru]) ## for Random Regret Minimization else: for eru,ru in zip(ERU,RU): df[eru] = np.exp(-1*df[ru]) # calculate probability for chosen alternative for each observation # (remember to take availabilities into account here if needed) ## e.g. if choice = 1, p = eu1/(eu1+eu2) prob = np.repeat(0,df.shape[0]) df["sum"] = np.sum(df[ERU],axis=1) for alt,col in zip(range(1, number_of_alts+1),ERU): prob = prob + np.where(df["choice"] == alt, df[col]/(df["sum"]), 0) df["P"] = prob # compute log-likelihood, different approach with and without mixing if self.mixing==0: # take product across choices for the same person (likelihood) # then take the log for log-likelihood L = df[["ID","P"]].groupby("ID").prod() LL = np.log(L).values.flatten() else: # take product across choices for the same person and the same draw L = df[["ID","draws_index","P"]].groupby(["ID","draws_index"]).prod() # then average across draws and take the log for simulated log-likelihood LL = np.log(L.groupby("ID").mean()).values.flatten() self.df = df if self.verbose: print("Function value:", np.round(-1*sum(LL),3)) return np.round(-1*sum(LL),3) # important: a negative log-likelihood since there is no maximize function in scipy ##################################################################### # subsection required only if producing predictions # ##################################################################### if functionality==2: # for predictions, we need probabilities for all alternatives, not just the chosen one, again, remember availabilities if needed P = ["P%d"%x for x in range(1,self.number_of_alts+1)] for p,eru in zip(P,ERU): self.df[p] = self.df[eru]/self.df["sum"] # copy part of the overall data table into a new datatable - ID, task, chosen alternative, probs and prob of chosen selected_cols = ["ID","running_task","choice","P"] + P probs_out = self.df.loc[:,selected_cols] # take mean across draws (only applies with mixing when multiple copies of same ID-running_task rows exist) probs_out = probs_out.groupby(["ID","running_task"]).mean() return probs_out ##################################################################### # subsection required only for outlier # ##################################################################### if functionality==3: # compute log-likelihood, different approach with and without mixing if self.mixing==0: # take product across choices for the same person (likelihood) # then take the log for log-likelihood L = self.df[["ID","P"]].groupby("ID").prod() LL = np.log(L).values.flatten() else: # take product across choices for the same person and the same draw L = self.df[["ID","draws_index","P"]].groupby(["ID","draws_index"]).prod() # then average across draws and take the log for simulated log-likelihood LL = np.log(L.groupby("ID").mean()).values.flatten() return LL def initial_beta(self): beta,lowerlimits,upperlimits = self.Define_Model_Parameters() if self.verbose: print("Searching for starting values") current_LL=-1*(self.loglike(beta)) i=0 # Now iterate to try different values while(i<(self.startingiterations+1)): betaVal= lowerlimits + np.random.random(len(lowerlimits))*(upperlimits-lowerlimits) beta_test = betaVal LL_test=-1*self.loglike(beta_test) if(LL_test>current_LL): current_LL = LL_test beta = beta_test i=i+1 if self.verbose: print("Iteration %d: LL=%s (best LL so far: %s)"%(i,LL_test,current_LL)) if self.verbose: print("\nInitial model estimations:") for s,n in zip(self.parnames,np.round(beta,3)): print(s,":",n) return beta def correlation_from_covariance(self,covariance): v = np.sqrt(np.diag(covariance)) outer_v = np.outer(v, v) correlation = covariance / outer_v correlation[covariance == 0] = 0 return correlation def fit(self,method='Nelder-Mead'): """ other methods for optimization: 'Powell','CG','BFGS','Newton-CG', etc. look at: scipy.optimize.minimize """ self.start_time = time.time() self.initials = self.initial_beta() lik_model = minimize(self.loglike, self.initials, method=method) #self.message = lik_model["success"] self.message = lik_model["message"] self.finalLL = -1*lik_model["fun"] # Estimated betas self.est = lik_model['x'] np.warnings.filterwarnings('ignore') Hfun = Hessian(self.loglike) hessian_ndt = Hfun(self.est) self.hess_inv = np.linalg.inv(hessian_ndt) ######################### important ######################################################### ## If the diagonal of the inverse Hessian is negative, it is not possible to use square root. # In this case, you can calculate a pseudo-variance matrix. The pseudo-variance matrix is # LL' with L=cholesky(H-1) with H being the Hessian matrix. ############################################################################################## diag_elements = np.diag(self.hess_inv) if (diag_elements <0).any(): choleski_factorization = np.linalg.cholesky(self.hess_inv) se = np.sqrt(np.diag(choleski_factorization)) else: se = np.sqrt(np.diag(self.hess_inv)) self.estimates = pd.DataFrame({'est':self.est, 'std err':se, "trat_0":self.est/se, "trat_1":(self.est -1)/se}) self.estimates.index = self.parnames self.cov = self.hess_inv self.covMat = pd.DataFrame(self.cov,columns=self.parnames).set_index(self.parnames) corr = self.correlation_from_covariance(self.cov) self.corrMat = pd.DataFrame(corr,columns=self.parnames).set_index(self.parnames) return "Model estimation is completed" ## for outlier detection def outlier(self): unique_ID = np.unique(self.data["ID"].values) task_per_ID = self.data["ID"].value_counts().values if self.mixing==0: self.Ndraws=1 P_per_task = np.exp(self.loglike(self.est,3))**(1/task_per_ID*self.Ndraws) return unique_ID, P_per_task def predict(self,data): return self.loglike(parameters=self.est, functionality=2, data=data) def output_print(self): now = datetime.now() dt_string = now.strftime("%b-%d-%Y %H:%M:%S") print("Model run at:", dt_string ,"\n") print("Model name: ",self.modelname,"\n") print("Model diagnosis:",self.message,"\n") print("Number of decision makers:",self.N) print("Number of observations:",self.choicetasks,"\n") if(self.LL0<0): print("LL(0): ",np.round(self.LL0,2)) print("LL(final): ",np.round(self.finalLL,2)) self.no_parameters = len(self.parnames) print("Estimated parameters: ",self.no_parameters,"\n") if(self.LL0<0): print("Rho-sq: ",np.round(1-(self.finalLL/self.LL0),2)) if(self.LL0<0): print("Adj. rho-sq: ",np.round(1-((self.finalLL-len(self.parnames))/self.LL0),2)) print("AIC: ",np.round(-2*self.finalLL+2*(len(self.parnames)),2)) print("BIC: ",np.round(-2*self.finalLL+(len(self.parnames))*np.log(self.choicetasks),2),"\n") print("Time taken: ",time.strftime("%H:%M:%S", time.gmtime(np.round(time.time() - self.start_time,2))), "\n") print("Estimates:") print(self.estimates,"\n") print("Covariance matrix:") print(self.covMat,"\n") print("Correlation matrix:") print(self.corrMat,"\n") print("20 worst outliers in terms of lowest average per choice prediction:") print(pd.DataFrame(self.outlier()[1],self.outlier()[0], columns=["Av prob per choice"]).sort_values(by="Av prob per choice").iloc[:20,:],"\n") print("Changes in parameter estimates from starting values:") print(pd.DataFrame({"initials":self.initials, "est": self.est, "diff":self.est - self.initials}).set_index(self.parnames))
[ "noreply@github.com" ]
noreply@github.com
2ef514d2e1bf298d308ec96e740a2d85eb5148f9
d61de092d46d060eec83f9d361ad5d735301e3be
/module 2- Create a Cryptocurrency/hadcoin_node_5003.py
72d2ccd0d5b407aa9dd2f0facb6c4d5f738d87fb
[]
no_license
strawhatRick/Blockchain_practice
03cae4975ae727ac04f023f1240ba97339c96ef9
c52709c2b1ef46321c47e1b4a5fb0cf215f052ad
refs/heads/master
2021-08-07T08:50:33.536364
2020-06-25T06:23:09
2020-06-25T06:23:09
193,660,045
0
0
null
null
null
null
UTF-8
Python
false
false
6,492
py
# Module 2 - Create a Cryptocurrency #To be installed #Flask==0.12.2: pip install Flask==0.12.2 #Postman HTTP Client: https://www.getpostman.com/ #requests==2.18.4: pip install requests==2.18.4 #Importing the librarires import datetime import hashlib import json from flask import Flask, jsonify, request import requests from uuid import uuid4 from urllib.parse import urlparse #Part 1 - Building a Blockchain class Blockchain: def __init__(self): self.chain = [] self.transactions = [] self.create_block(proof = 1, previous_hash = '0') self.nodes = set() def create_block(self, proof, previous_hash): block = {'index': len(self.chain) + 1, 'timestamp': str(datetime.datetime.now()), 'proof': proof, 'previous_hash': previous_hash, 'transactions': self.transactions} self.transactions = [] self.chain.append(block) return block def get_previous_block(self): return self.chain[-1] def proof_of_work(self, previous_proof): new_proof = 1 check_proof = False while check_proof is False: hash_operation = hashlib.sha256(str((new_proof**2 - previous_proof**2)).encode()).hexdigest() if hash_operation[:4] == '0000': check_proof = True else: new_proof += 1 return new_proof def hash(self, block): encoded_block = json.dumps(block, sort_keys = True).encode() return hashlib.sha256(encoded_block).hexdigest() def is_chain_valid(self, chain): previous_block = chain[0] block_index = 1 while block_index < len(chain): block = chain[block_index] if block['previous_hash'] != self.hash(previous_block): return False previous_proof = previous_block['proof'] proof = block['proof'] hash_operation = hashlib.sha256(str((proof**2 - previous_proof**2)).encode()).hexdigest() if hash_operation[:4] != '0000': return False previous_block = block block_index += 1 return True def add_transaction(self, sender, receiver, amount): self.transactions.append({'sender': sender, 'receiver': receiver, 'amount': amount}) previous_block = self.get_previous_block() return previous_block['index'] + 1 def add_node(self, address): parsed_url = urlparse(address) self.nodes.add(parsed_url.netloc) def replace_chain(self): network = self.nodes longest_chain = None max_length = len(self.chain) for node in network: response = requests.get(f'http://{node}/get_chain') if response.status_code == 200: length = response.json()['length'] chain = response.json()['chain'] if length > max_length and self.is_chain_valid(chain): max_length = length longest_chain = chain if longest_chain: self.chain = longest_chain return True return False #Part 2 - Mining our Blockchain #Creating a Web App app = Flask(__name__) #Creating an address for the node on Port 5000 node_address = str(uuid4()).replace('-', '') #Creating a Blockchain object blockchain = Blockchain() #Mining a new block @app.route('/mine_block', methods = ['GET']) def mine_block(): previous_block = blockchain.get_previous_block() previous_proof = previous_block['proof'] proof = blockchain.proof_of_work(previous_proof) previous_hash = blockchain.hash(previous_block) blockchain.add_transaction(sender = node_address, receiver = 'You', amount = 1) block = blockchain.create_block(proof, previous_hash) response = {'message': 'Congratulations, you just mined a block!', 'index': block['index'], 'timestamp': block['timestamp'], 'proof': block['proof'], 'previous_hash': block['previous_hash'], 'transactions': block['transactions']} return jsonify(response), 200 #Getting the full Blockchain @app.route('/get_chain', methods = ['GET']) def get_chain(): response = {'chain': blockchain.chain, 'length': len(blockchain.chain)} return jsonify(response), 200 #Checking the Blockchain is valid @app.route('/is_valid', methods = ['GET']) def is_valid(): is_valid = blockchain.is_chain_valid(blockchain.chain) if is_valid: response = {'message': 'All good. The Blockchain is valid'} else: response = {'message': 'Mayukh, we have a problem. The blockchain is not valid.'} return jsonify(response), 200 #Adding a new transaction to the blockchain @app.route('/add_transaction', methods = ['POST']) def add_transaction(): json = request.get_json() transaction_keys = ['sender', 'receiver', 'amount'] if not all (key in json for key in transaction_keys): return 'Some elements of the transaction are missing', 400 index = blockchain.add_transaction(json['sender'], json['receiver'], json['amount']) response = {'message': f'This transaction will be added to Block {index}'} return jsonify(response), 201 #Part 3 - Decentralizing our Blockchain #Connecting new nodes @app.route('/connect_node', methods = ['POST']) def connect_node(): json = request.get_json() nodes = json.get('nodes') if nodes is None: return "No node", 400 for node in nodes: blockchain.add_node(node) response = {'message': 'All the nodes are now connected. The Hadcoin Blockchain now contains the following nodes:', 'total_nodes':list(blockchain.nodes)} return jsonify(response), 201 #Replacing the chain by the longest if needed @app.route('/replace_chain', methods = ['GET']) def replace_chain(): is_chain_replaced = blockchain.replace_chain() if is_chain_replaced: response = {'message': 'The nodes had different chains so the chain was replaced by the longest one.', 'new_chain': blockchain.chain} else: response = {'message': 'All good. The chain is the largest one.', 'actual_chain': blockchain.chain} return jsonify(response), 200 #Running the app app.run(host = '0.0.0.0', port = 5003)
[ "noreply@github.com" ]
noreply@github.com
4f3c73e27f6f55f81e9f77fb85fc19fbed7f387b
ca7aa979e7059467e158830b76673f5b77a0f5a3
/Python_codes/p02928/s256920562.py
c89b4ce6cab3fe975f18c176f86c82863230a7df
[]
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
797
py
#第一回日本最強プログラマー学生選手権-予選- -B Kleene Inversion """ リストをk回繰り返したものの、転倒数の個数を求めよ 先ず純粋に与えられたリスト内での転倒数を求めた後、 それを1~k倍したものを足し合わせる """ import sys readline = sys.stdin.buffer.readline def even(n): return 1 if n%2==0 else 0 mod = 10**9+7 n,k = map(int,readline().split()) lst1 = list(map(int,readline().split())) fall = 0 fall_al = 0 for i in range(n-1): for j in range(i+1,n): if lst1[i] > lst1[j]: fall += 1 lst1.sort(reverse=True) for i in range(n-1): for j in range(i+1,n): if lst1[i] > lst1[j]: fall_al += 1 def reydeoro(n): return n*(n+1)//2 print((fall*k+fall_al*reydeoro(k-1))%mod)
[ "66529651+Aastha2104@users.noreply.github.com" ]
66529651+Aastha2104@users.noreply.github.com
ca3562bb02d7bbdba2a3884a09cb3e1ef762c919
f76e11d4da15768bf8683380b1b1312f04060f9a
/sample_conlls_for_files_in_folder.py
a41592d79ee73224376e3b60857161c7a140304b
[]
no_license
rasoolims/scripts
0804a2e5f7f405846cb659f9f8199f6bd93c4af6
fd8110558fff1bb5a7527ff854eeea87b0b3c597
refs/heads/master
2021-07-07T03:53:20.507765
2021-04-13T14:53:00
2021-04-13T14:53:00
24,770,177
0
0
null
null
null
null
UTF-8
Python
false
false
364
py
import os,sys sampler = os.path.dirname(os.path.abspath(sys.argv[0]))+'/sample_conlls.py' folder = os.path.abspath(sys.argv[1])+'/' o_folder = os.path.abspath(sys.argv[2])+'/' max_num = int(sys.argv[3]) for f in sorted(os.listdir(folder)): command = 'python ' + sampler + ' '+folder+f +' '+o_folder+f + ' '+str(max_num) + '&' print command os.system(command)
[ "rasooli.ms@gmail.com" ]
rasooli.ms@gmail.com
f0700280d49a2739c73b10f197c611e50c1968f3
16ef2bd176b60a34660787323d0092e6b70c6dfa
/Component21/Wrapper_UserInput.py
5dc96bb02559194a97f519fc35468b47d699ac96
[]
no_license
saprem/OKBQA
abe78736d1b1d523e45136d90d7c4918f3ad9dcb
7433a10a7857e524aec1226f633bfb873f91135b
refs/heads/master
2020-03-22T00:44:18.627626
2018-06-30T19:03:44
2018-06-30T19:03:44
139,262,400
0
0
null
null
null
null
UTF-8
Python
false
false
2,882
py
import urllib2 import json import sys ''' first_arg is the question second_arg is the language of question ''' first_arg = sys.argv[1] second_arg = sys.argv[2] class OKBQA(object): ''' extracts the corresponding value "o", and display it as output For eg: (1) first_arg: "Which river flows through India?" second_arg: "en" OUTPUT: flows (2) first_arg: "Who is dancing in the hall?" second_arg: "en" NOTE: change x['s'] =="v1" (in this case) OUTPUT: dancing ''' def extract(self): data = {} data["string"] = first_arg data["language"] = second_arg #Return a String representing JSON object-Here Dict #ENCODING data = json.dumps(data) #http url url = 'http://ws.okbqa.org:1515/templategeneration/rocknrole' #POST request req = urllib2.Request(url, data, {'Content-Type': 'application/json'}) #fetching URL f = urllib2.urlopen(req) jsonX = f.read() #Uncomment below for testing purpose #print jsonX #return a JSON object from string representing JSON object #DECODING json_object = json.loads(jsonX) ''' iterating the output json to extract required ans. It is hard-coded. Change x['s'] below accordingly for different input query questions(i.e. first_arg) ''' for item in json_object: for x in item['slots']: if x['p']=="verbalization" and x['s']=="v9": print x['o'] f.close() ''' Wrapper class that wraps another class so that when a function is run through the wrapper class. A pre and post function is run as well.(For Testing or any other purpose) ''' class Wrapper(object): def __init__(self,wrapped_class): self.wrapped_class = wrapped_class() def __getattr__(self,attr): orig_attr = self.wrapped_class.__getattribute__(attr) #print orig_attr if callable(orig_attr): def hooked(*args, **kwargs): self.pre() result = orig_attr(*args, **kwargs) # prevent wrapped_class from becoming unwrapped if result == self.wrapped_class: return self self.post() return result return hooked else: return orig_attr # Runs Before the Wrapped class is called. def pre(self): #Uncomment below for testing. #print ">> pre" return #Runs After the Wrapped class is called. def post(self): #Uncomment below for testing #print "<< post" return #Execution begins from here if __name__ == '__main__': query = Wrapper(OKBQA) query.extract()
[ "noreply@github.com" ]
noreply@github.com
424e2ab6a0976834aa28e4a6d10363ee7c6f6d29
977c419361143f83e1adfc2a90b2fd88de66a875
/blog/migrations/0001_initial.py
9f256426c10f6a770a3db483f616f66cb0e825ad
[]
no_license
kokimaniac/myfirstblog
46b6ab207e45c4d13a38e5d39d6ea71133e70566
128f7f894dea36ef94803a05838552d68f0de1ba
refs/heads/master
2020-04-05T09:23:12.638850
2018-11-09T20:00:50
2018-11-09T20:00:50
156,753,694
0
0
null
null
null
null
UTF-8
Python
false
false
986
py
# Generated by Django 2.0.9 on 2018-11-08 15:00 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Post', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title', models.CharField(max_length=200)), ('text', models.TextField()), ('created_date', models.DateTimeField(default=django.utils.timezone.now)), ('published_date', models.DateTimeField(blank=True, null=True)), ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), ]
[ "cokimaniac@gmail.com" ]
cokimaniac@gmail.com
dc2589bc301a04c72b4135c28345d827ddd0a403
415c321f1c4ce1b00a7e731ab02ef532e48e6ba3
/__init__.py
2e586341762aa82f1df12e9dfc86c226abc702e4
[]
no_license
rajputji/Python-BlackJack-Game
7a4f0169decb7d00d2e64dcce3bdfe6c80b9e55d
fd85174a0cea84e4f7728bc27a0281f331b7ece1
refs/heads/master
2020-03-20T05:45:42.153292
2018-06-13T15:20:28
2018-06-13T15:20:28
137,225,549
1
0
null
null
null
null
UTF-8
Python
false
false
70
py
""" AUTHOR Abhishek Rajput <Abhishekrajput676@gmail.com> """
[ "abhishekrajput676@gmail.com" ]
abhishekrajput676@gmail.com
4186d6772b5b2efd4a9a95373b9d03ac300b08ef
154cee995010396b26eb00e3959e5e6781428134
/cernael-python/14b.py
a6524c45c7a9702a454ead2d9e832035841b451b
[]
no_license
Dyr-El/advent_of_code_2020
bbe237cd9bc61ee34305e7e838bb0aafc4b8d839
e6b5469e3191597ec5be479eb33feeab42c1280c
refs/heads/main
2023-02-07T09:34:45.981646
2020-12-25T07:13:26
2020-12-25T07:13:26
315,087,260
1
0
null
2020-12-25T07:13:27
2020-11-22T16:56:42
C++
UTF-8
Python
false
false
1,050
py
def solve(lines): mem = {} ones, nils = [0],[0] masks = [0] for l in range(len(lines)): line = lines[l].split(' = ') if line[0] == 'mask': ones, nils = [0],[0] masks = [[0,0]] for c in range(len(line[1])): if line[1][c] == '1': masks = [[x[0] + 2**(35-c), x[1]] for x in masks] elif line[1][c] == 'X': newones = [[x[0] + 2**(35-c), x[1]] for x in masks] newnils = [[x[0], x[1] + 2**(35-c)] for x in masks] masks = newones + newnils elif line[0][:3] == 'mem': for i in range(len(masks)): addr = int(line[0][4:-1]) addr = addr | masks[i][0] addr = addr & ~masks[i][1] mem[addr] = int(line[1]) return sum(mem.values()) if __name__ == '__main__': lines = [] with open('14.txt') as f: for line in f.readlines(): lines.append(line) print(solve(lines))
[ "tomas@cernael.com" ]
tomas@cernael.com
aa13a7c48f9fc43d0c59b997c7ea180ad60047b7
85ec7780babfabb574de66f1aa82cb6cd8729f8a
/sbcnab240/Retorno.py
c3a2f652da55ab83302fd2f0c14cfe4d81328982
[ "MIT" ]
permissive
Superbuy-Team/sbcnab240
e70bfaaab2dc47fb71958ecb53d273607443168c
fe32ffa1efc3f07f8e1be607d4bf110f5134720a
refs/heads/master
2021-08-31T08:52:10.174142
2017-12-20T20:48:06
2017-12-20T20:48:06
114,794,943
5
0
null
null
null
null
UTF-8
Python
false
false
2,670
py
from Lote import Lote from Boleto import Boleto, Cedente class Retorno(object): def __init__(self): self.codigo_banco = None self.lote_servico = None self.tipo_inscricao = None self.numero_inscricao = None self.nome_empresa = None self.nome_banco = None self.cod_remessa = None self.data_geracao = None self.num_sequencial = None self.lotes = [] def carrega_campos(self, specs, campos): lotes = [] lote_atual = None boletos = [] boleto_atual = None for secao, valores in campos: if secao == "HeaderArquivoRetorno": self.codigo_banco = valores['codigo_banco'] self.lote_servico = valores['lote_servico'] self.tipo_inscricao = valores['tipo_inscricao'] self.numero_inscricao = valores['numero_inscricao'] self.nome_empresa = valores['nome_empresa'] self.nome_banco = valores['nome_banco'] self.cod_remessa = valores['cod_remessa'] self.data_geracao = valores['data_geracao'] self.num_sequencial = valores['num_sequencial'] elif secao == "HeaderLoteRetorno": if not lote_atual: lote_atual = Lote() lote_atual.carrega_header(valores) lotes.append(lote_atual) elif secao[:8] == "Segmento": if secao == "SegmentoT": boleto_atual = Boleto() boleto_atual.dataProcessamento = self.data_geracao cedente = Cedente() cedente.tipoDocumento = lote_atual.tipo_inscricao cedente.documento = lote_atual.numero_inscricao cedente.nome = lote_atual.nome_beneficiario boleto_atual.cedente = cedente boletos.append(boleto_atual) if boleto_atual: boleto_atual.carrega_segmento(specs, secao[8:], valores) elif secao == "TrailerLoteRetorno": # adiciona boletos atuais ao lote lote_atual.adiciona_boletos(boletos) # reseta lista de boletos boletos = [] boleto_atual = None # checa lote # TODO # adiciona lote a remessa self.lotes.append(lote_atual) # reseta lote lote_atual = None elif secao == "TrailerArquivoRetorno": # reseta lotes lotes = []
[ "roberto.amorim@superbuy.com.br" ]
roberto.amorim@superbuy.com.br
78fc7d13d414f8d09ea510b3dde3116c43c2cbda
f6ab5cbe5bddf205b63afc2f88e5b54660b866d6
/3-lists/2-indexing-and-slicing.py
0535cf910d8a3f2852e7995cd0ce59d42612e8c5
[]
no_license
d3vkk/ibm-python-101
df5d220949032df0fded46925a8743c858489bf1
201943ed44e25d2c54544352d9debde9b9dfa7b6
refs/heads/master
2023-07-02T14:22:48.176934
2021-08-11T13:29:45
2021-08-11T13:29:45
392,346,554
0
0
null
null
null
null
UTF-8
Python
false
false
1,040
py
# POSITIVE INDEXING # First index string = "Hello World" first_char = string[0] print(first_char) # Last index string = "Alphabet" last_char = string[len(string)-1] print(last_char) # NEGATIVE INDEXING # First index string = "Hello World" first_char = string[-len(string)] print(first_char) # Last index string = "Alphabet" last_char = string[-1] print(last_char) # SLICING # For slicing, it is collection[start:end]. # By default, start is 0, and end is len(collection). # SLICING AT THE START string = "Alphabet" slice_start3 = string[3:] print(slice_start3) # SLICING AT THE END string = "Alphabet" slice_end3 = string[:3] print(slice_end3) # SLICING TO COPY A STRING slice_copy = string[:] print(slice_copy) string = "Alphabet" # SLICING AT THE START AND END string = "Alphabet" slice2_to_6 = string[2:6] print(slice2_to_6) # SLICING USING NEGATIVE INDICES string = "Alphabet" slice_end_negative_1 = string[:-1] print(slice_end_negative_1) string = "Alphabet" slice_start_negative_1 = string[-1:] print(slice_start_negative_1)
[ "donaldkk22@yahoo.com" ]
donaldkk22@yahoo.com
6deef4bde5aa9af28705d701a145d6b9b527e346
1a631af3472c869006bcebf00f3593cc2578ee41
/Prac05/colourCodesDict.py
af6eb6c1c2be6662803a23af178155953d54c0a2
[]
no_license
GriffinBarath/Practicals
beeff5dd57432871dd83f78e76687c2dcdead895
53be129294ad92d999a3599d53069232bcb46f45
refs/heads/master
2020-09-23T03:00:30.810772
2016-10-27T01:14:00
2016-10-27T01:14:00
65,951,818
0
0
null
2016-10-12T23:18:41
2016-08-18T00:30:38
Python
UTF-8
Python
false
false
875
py
def main(): HEXADECIMAL_COLOUR_CODES = {"AntiqueWhite": "#faebd7", "Black": "#000000", "CornflowerBlue": "#6495ed", "DarkGreen": "#006400", "NavyBlue": "#000080", "RosyBrown": "#bc8f8f", "WhiteSmoke": "#f5f5f5", "VioletRed": "#d02090", "SteelBlue": "#4682b4", "SlateGray": "#708090"} for colour in HEXADECIMAL_COLOUR_CODES: print("{:15} is {:15}".format(colour, HEXADECIMAL_COLOUR_CODES[colour])) colourRequest = input("Enter colour name:") while colourRequest != "": if colourRequest in HEXADECIMAL_COLOUR_CODES: print(colourRequest, "is", HEXADECIMAL_COLOUR_CODES[colourRequest]) else: print("Invalid colour entered!") colourRequest = input("Enter colour name:") main()
[ "griffinbarath@hotmail.com" ]
griffinbarath@hotmail.com
14ebd393b7eb8046d3b0633dd9cde072d9aa2afe
6061ebee9fbce8eb5b48ed7ccd2aecb196156598
/modulo02-basico/desafios/desafio04.py
6b061eeeb1901a297582e79d7c39ea815235dd66
[]
no_license
DarioCampagnaCoutinho/logica-programacao-python
fdc64871849bea5f5bbf2c342db5fda15778110b
b494bb6ef226c89f4bcfc66f964987046aba692d
refs/heads/master
2023-02-24T11:45:29.551278
2021-01-26T22:02:49
2021-01-26T22:02:49
271,899,650
0
0
null
null
null
null
UTF-8
Python
false
false
167
py
import random nome1 = 'Dario' nome2 = 'Maria' nome3 = 'Ana' nome4 = 'José' x = random.choice([nome1, nome2, nome3, nome4]) print('O escolhido foi = {} '.format(x))
[ "campagnacoutinho67@gmail.com" ]
campagnacoutinho67@gmail.com
dea33f85af7f66f7636b976164a57c513d9e0b8c
59166105545cdd87626d15bf42e60a9ee1ef2413
/test/test_gaelic_games_player_api.py
652e74921fb7bba2124a47a636a082cc9d1127cd
[]
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
1,057
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 """ from __future__ import absolute_import import unittest import dbpedia from dbpedia.api.gaelic_games_player_api import GaelicGamesPlayerApi # noqa: E501 from dbpedia.rest import ApiException class TestGaelicGamesPlayerApi(unittest.TestCase): """GaelicGamesPlayerApi unit test stubs""" def setUp(self): self.api = dbpedia.api.gaelic_games_player_api.GaelicGamesPlayerApi() # noqa: E501 def tearDown(self): pass def test_gaelicgamesplayers_get(self): """Test case for gaelicgamesplayers_get List all instances of GaelicGamesPlayer # noqa: E501 """ pass def test_gaelicgamesplayers_id_get(self): """Test case for gaelicgamesplayers_id_get Get a single GaelicGamesPlayer by its id # noqa: E501 """ pass if __name__ == '__main__': unittest.main()
[ "maxiosorio@gmail.com" ]
maxiosorio@gmail.com
e9e9ec19712e8057912fe726708c1343645fc61b
8f92558113aeeb1faf0a396d98170c9f3df948c1
/loginManagement/urls.py
d54abc027406b3a509bb8ef66954a222e87e5b04
[]
no_license
loenex/InformationManagementSystemForDentalClinic
415b26161c2d604a4d16dd1e5bdd944a3b2f9081
855af98fd251b2b17dfef1f51ab63c5d9e815d01
refs/heads/master
2023-02-16T00:51:35.087510
2019-12-21T09:19:51
2019-12-21T09:19:51
null
0
0
null
null
null
null
UTF-8
Python
false
false
349
py
from django.conf.urls import url, include from django.urls import path from . import views app_name = 'loginManagement' urlpatterns = [ path(r'', views.index,name="index"), path(r'login/', views.login,name="login"), path(r'register/', views.register, name="register"), path(r'logout/', views.logout, name="logout") ]
[ "noreply@github.com" ]
noreply@github.com
2a12122d9d5b99a129dc3fa2a52bf6b57a7b4e4d
a8b2ab984cf02660efce5a7696cd3218d7023883
/python/598.range-addition-ii.py
a16fc8861d35c55faac849acfad8d6b4554fd525
[ "MIT" ]
permissive
vermouth1992/Leetcode
b445f51de3540ef453fb594f04d5c9d9ad934c0c
386e794861f37c17cfea0c8baa3f544c8e5ca7a8
refs/heads/master
2022-11-07T13:04:00.393597
2022-10-28T02:59:22
2022-10-28T02:59:22
100,220,916
0
0
null
null
null
null
UTF-8
Python
false
false
1,460
py
# # @lc app=leetcode id=598 lang=python3 # # [598] Range Addition II # # https://leetcode.com/problems/range-addition-ii/description/ # # algorithms # Easy (50.41%) # Total Accepted: 47.5K # Total Submissions: 94.3K # Testcase Example: '3\n3\n[[2,2],[3,3]]' # # You are given an m x n matrix M initialized with all 0's and an array of # operations ops, where ops[i] = [ai, bi] means M[x][y] should be incremented # by one for all 0 <= x < ai and 0 <= y < bi. # # Count and return the number of maximum integers in the matrix after # performing all the operations. # # # Example 1: # # # Input: m = 3, n = 3, ops = [[2,2],[3,3]] # Output: 4 # Explanation: The maximum integer in M is 2, and there are four of it in M. So # return 4. # # # Example 2: # # # Input: m = 3, n = 3, ops = # [[2,2],[3,3],[3,3],[3,3],[2,2],[3,3],[3,3],[3,3],[2,2],[3,3],[3,3],[3,3]] # Output: 4 # # # Example 3: # # # Input: m = 3, n = 3, ops = [] # Output: 9 # # # # Constraints: # # # 1 <= m, n <= 4 * 10^4 # 1 <= ops.length <= 10^4 # ops[i].length == 2 # 1 <= ai <= m # 1 <= bi <= n # # # from typing import List class Solution: def maxCount(self, m: int, n: int, ops: List[List[int]]) -> int: # find min_x and min_y min_x = m min_y = n for position in ops: x, y = position if x < min_x: min_x = x if y < min_y: min_y = y return min_x * min_y
[ "czhangseu@gmail.com" ]
czhangseu@gmail.com
e9dd706d87b76237095f0c03ca7663bfadbdb98c
541b2ed1826af76a0d9d28aad96ef2f086e8ab6d
/climats/admin.py
6c6e8079b013ce02b2010f251325e0950dc74911
[]
no_license
boblicitra/tlucidity
067594daf22399b930f93347d8a68a5c81c05cb1
3a582b76515b177782e50dd59d92eabdb1b1c563
refs/heads/master
2020-04-16T02:10:59.299312
2019-02-05T21:33:39
2019-02-05T21:33:39
62,420,967
0
0
null
null
null
null
UTF-8
Python
false
false
1,273
py
from django.contrib import admin from .models import * class CompanyAdmin(admin.ModelAdmin): list_display = ('code','name',) class TimekeeperAdmin(admin.ModelAdmin): list_display = ('code','last_name','first_name','status',) list_display_link = ('code',) list_filter = ('status',) class ClientAdmin(admin.ModelAdmin): list_display = ('code','name','status',) list_display_link = ('code',) list_filter = ('status', 'company',) class CaseAdmin(admin.ModelAdmin): list_display = ('code','name','status',) list_display_link = ('code',) list_filter = ('status', 'company',) class ActivityAdmin(admin.ModelAdmin): list_display = ('code','description',) list_display_link = ('code',) class TaskAdmin(admin.ModelAdmin): list_display = ('code','description',) list_display_link = ('code',) class Import_LogAdmin(admin.ModelAdmin): list_display = ('date_time','ran_by',) list_display_link = ('date_time',) admin.site.register(Company,CompanyAdmin) admin.site.register(Timekeeper,TimekeeperAdmin) admin.site.register(Client,ClientAdmin) admin.site.register(Case,CaseAdmin) admin.site.register(Activity,ActivityAdmin) admin.site.register(Task,TaskAdmin) admin.site.register(Import_Log,Import_LogAdmin)
[ "ubuntu@ip-172-31-63-184.ec2.internal" ]
ubuntu@ip-172-31-63-184.ec2.internal
04b3d335d92c0e655b7cfa971605e0f513bb29d9
731427dec541637da733cf7ec515b35f8009e8c7
/src/server/client_direct.py
c81fa96a0d28840c8cef68fb1c8c0572a74a3c34
[]
no_license
oeitam/weekly
c8c0b66cd742e8c83e9060587b5b621da08a9269
1f63ac71b532c639f7f344d0cf6ded05943e710b
refs/heads/master
2021-01-22T04:05:35.320605
2018-11-29T21:51:25
2018-11-29T21:51:25
92,432,544
0
0
null
2018-01-21T18:33:21
2017-05-25T18:30:05
Python
UTF-8
Python
false
false
1,635
py
import sys import time from test import test_defs from src import defs import logging #cd_logger = logging.getLogger(__name__) logging.basicConfig(filename='client.log', filemode='w', level=logging.DEBUG) logging.info('Logging (client direct) Started') cd_logger = logging.getLogger(__name__) class client(object): def __init__(self, server): self.server = server self.f = open('clientlog.log','w') def operate(self): wait_for_user = 0 cnt = 1 for m in test_defs.test_commands: print(str(cnt).zfill(4) + ":" + m) cnt += 1 if (defs.die_word in m[0:5]): print('client: got a die command', file=sys.stdout) break if "turn on" in m[0:9]: wait_for_user = 1 else: l = str(len(m)+5) sl = "{:0>4}:".format(l) slm = sl + m if wait_for_user != 0: input('hit any key to send this message') message = slm cd_logger.debug('client script sending {}'.format(message)) recieved_data = self.server.command(message) self.f.write(str(cnt).zfill(4) + ":" + "\n" + message+"\n") self.f.write(recieved_data+"\n"+"\n") print("\nServer Said:") print(recieved_data+"\n") cd_logger.debug("ServerSaid: {}".format(recieved_data)) print('client: closing socket', file=sys.stdout) cd_logger.debug("Client closing socket") self.f.close() #input("OK?")
[ "oeitam@gmail.com" ]
oeitam@gmail.com
a5cc846200659b763619266162730ab3c3b4a9d6
f4f0c0fbe139d43b87effcdcbda2f61688d15726
/nowcoder/reverseNum.py
aec35113e87ce3986c695bd5cb3b22eeeb077ca5
[]
no_license
wan-si/pythonLearning
a49242c1eb752b0dccfe2b5219f857bc1732d7dd
5d17fbafbd977865e453ae3d1d31f6e9ee25d87d
refs/heads/main
2023-06-24T05:00:07.467289
2021-07-14T12:43:34
2021-07-14T12:43:34
null
0
0
null
null
null
null
UTF-8
Python
false
false
95
py
inp = str(input()) # res='' # for i in inp[::-1]: # res += i # print(res) print(inp[::-1])
[ "swan@swans-MacBook-Pro.local" ]
swan@swans-MacBook-Pro.local
7537600bafe78ac26d429c8c02a71a336bd9f55a
63ace5832d453e325681d02f6496a0999b72edcb
/bip_utils/addr/ergo_addr.py
3866b51985ebe93e5c043e028807fdc3bf08fece
[ "MIT" ]
permissive
ebellocchia/bip_utils
c9ec04c687f4247e57434319e36b2abab78f0b32
d15c75ddd74e4838c396a0d036ef6faf11b06a4b
refs/heads/master
2023-09-01T13:38:55.567370
2023-08-16T17:04:14
2023-08-16T17:04:14
251,130,186
244
88
MIT
2023-08-23T13:46:19
2020-03-29T20:42:48
Python
UTF-8
Python
false
false
6,215
py
# Copyright (c) 2022 Emanuele Bellocchia # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """Module for Ergo address encoding/decoding.""" # Imports from enum import IntEnum, unique from typing import Any, Union from bip_utils.addr.addr_dec_utils import AddrDecUtils from bip_utils.addr.addr_key_validator import AddrKeyValidator from bip_utils.addr.iaddr_decoder import IAddrDecoder from bip_utils.addr.iaddr_encoder import IAddrEncoder from bip_utils.base58 import Base58Decoder, Base58Encoder from bip_utils.ecc import IPublicKey, Secp256k1PublicKey from bip_utils.utils.crypto import Blake2b256 from bip_utils.utils.misc import IntegerUtils @unique class ErgoAddressTypes(IntEnum): """Enumerative for Ergo address types.""" P2PKH = 0x01 P2SH = 0x02 @unique class ErgoNetworkTypes(IntEnum): """Enumerative for Ergo network types.""" MAINNET = 0x00 TESTNET = 0x10 class ErgoAddrConst: """Class container for Ergo address constants.""" # Checksum length in bytes CHECKSUM_BYTE_LEN: int = 4 class _ErgoAddrUtils: """Ergo address utility class.""" @staticmethod def ComputeChecksum(pub_key_bytes: bytes) -> bytes: """ Compute checksum in Ergo format. Args: pub_key_bytes (bytes): Public key bytes Returns: bytes: Computed checksum """ return Blake2b256.QuickDigest(pub_key_bytes)[:ErgoAddrConst.CHECKSUM_BYTE_LEN] @staticmethod def EncodePrefix(addr_type: ErgoAddressTypes, net_type: ErgoNetworkTypes) -> bytes: """ Encode prefix. Args: addr_type (ErgoAddressTypes): Address type net_type (ErgoNetworkTypes) : Network type Returns: bytes: Prefix byte """ return IntegerUtils.ToBytes(addr_type + net_type) class ErgoP2PKHAddrDecoder(IAddrDecoder): """ Ergo P2PKH address decoder class. It allows the Ergo P2PKH address decoding. """ @staticmethod def DecodeAddr(addr: str, **kwargs: Any) -> bytes: """ Decode an Ergo P2PKH address to bytes. Args: addr (str): Address string Other Parameters: net_type (ErgoNetworkTypes): Expected network type (default: main net) Returns: bytes: Public key bytes Raises: ValueError: If the address encoding is not valid TypeError: If the network tag is not a ErgoNetworkTypes enum """ net_type = kwargs.get("net_type", ErgoNetworkTypes.MAINNET) if not isinstance(net_type, ErgoNetworkTypes): raise TypeError("Address type is not an enumerative of ErgoNetworkTypes") # Decode from base58 addr_dec_bytes = Base58Decoder.Decode(addr) # Validate length AddrDecUtils.ValidateLength(addr_dec_bytes, Secp256k1PublicKey.CompressedLength() + ErgoAddrConst.CHECKSUM_BYTE_LEN + 1) # Get back checksum and public key bytes addr_with_prefix, checksum_bytes = AddrDecUtils.SplitPartsByChecksum(addr_dec_bytes, ErgoAddrConst.CHECKSUM_BYTE_LEN) # Validate checksum AddrDecUtils.ValidateChecksum(addr_with_prefix, checksum_bytes, _ErgoAddrUtils.ComputeChecksum) # Validate and remove prefix pub_key_bytes = AddrDecUtils.ValidateAndRemovePrefix( addr_with_prefix, _ErgoAddrUtils.EncodePrefix(ErgoAddressTypes.P2PKH, net_type) ) # Validate public key AddrDecUtils.ValidatePubKey(pub_key_bytes, Secp256k1PublicKey) return pub_key_bytes class ErgoP2PKHAddrEncoder(IAddrEncoder): """ Ergo P2PKH address encoder class. It allows the Ergo P2PKH address encoding. """ @staticmethod def EncodeKey(pub_key: Union[bytes, IPublicKey], **kwargs: Any) -> str: """ Encode a public key to Ergo P2PKH address. Args: pub_key (bytes or IPublicKey): Public key bytes or object Other Parameters: net_type (ErgoNetworkTypes): Network type (default: main net) Returns: str: Address string Raised: ValueError: If the public key is not valid TypeError: If the public key is not secp256k1 or the network tag is not a ErgoNetworkTypes enum """ net_type = kwargs.get("net_type", ErgoNetworkTypes.MAINNET) if not isinstance(net_type, ErgoNetworkTypes): raise TypeError("Address type is not an enumerative of ErgoNetworkTypes") pub_key_obj = AddrKeyValidator.ValidateAndGetSecp256k1Key(pub_key) pub_key_bytes = pub_key_obj.RawCompressed().ToBytes() prefix_byte = _ErgoAddrUtils.EncodePrefix(ErgoAddressTypes.P2PKH, net_type) addr_payload_bytes = prefix_byte + pub_key_bytes return Base58Encoder.Encode(addr_payload_bytes + _ErgoAddrUtils.ComputeChecksum(addr_payload_bytes)) # Deprecated: only for compatibility, Encoder class shall be used instead ErgoP2PKHAddr = ErgoP2PKHAddrEncoder
[ "54482000+ebellocchia@users.noreply.github.com" ]
54482000+ebellocchia@users.noreply.github.com
3f44a961dc17d224810f89b2af9967c97b56e9cc
2eae961147a9627a2b9c8449fa61cb7292ad4f6a
/openapi_client/models/put_financial_settings_financial_settings.py
528befb129e62a58e2aa4a47305b7c13242a06cc
[]
no_license
kgr-eureka/SageOneSDK
5a57cc6f62ffc571620ec67c79757dcd4e6feca7
798e240eb8f4a5718013ab74ec9a0f9f9054399a
refs/heads/master
2021-02-10T04:04:19.202332
2020-03-02T11:11:04
2020-03-02T11:11:04
244,350,350
0
0
null
null
null
null
UTF-8
Python
false
false
22,975
py
# coding: utf-8 """ Sage Business Cloud Accounting - Accounts Documentation of the Sage Business Cloud Accounting API. # noqa: E501 The version of the OpenAPI document: 3.1 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from openapi_client.configuration import Configuration class PutFinancialSettingsFinancialSettings(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 = { 'year_end_date': 'date', 'year_end_lockdown_date': 'date', 'accounting_type': 'str', 'accounts_start_date': 'date', 'base_currency_id': 'str', 'multi_currency_enabled': 'bool', 'use_live_exchange_rates': 'bool', 'mtd_activation_status': 'str', 'mtd_connected': 'bool', 'mtd_authenticated_date': 'date', 'tax_return_frequency_id': 'str', 'tax_number': 'str', 'general_tax_number': 'str', 'tax_office_id': 'str', 'default_irpf_rate': 'float', 'flat_rate_tax_percentage': 'float', 'sales_tax_calculation': 'str', 'purchase_tax_calculation': 'str' } attribute_map = { 'year_end_date': 'year_end_date', 'year_end_lockdown_date': 'year_end_lockdown_date', 'accounting_type': 'accounting_type', 'accounts_start_date': 'accounts_start_date', 'base_currency_id': 'base_currency_id', 'multi_currency_enabled': 'multi_currency_enabled', 'use_live_exchange_rates': 'use_live_exchange_rates', 'mtd_activation_status': 'mtd_activation_status', 'mtd_connected': 'mtd_connected', 'mtd_authenticated_date': 'mtd_authenticated_date', 'tax_return_frequency_id': 'tax_return_frequency_id', 'tax_number': 'tax_number', 'general_tax_number': 'general_tax_number', 'tax_office_id': 'tax_office_id', 'default_irpf_rate': 'default_irpf_rate', 'flat_rate_tax_percentage': 'flat_rate_tax_percentage', 'sales_tax_calculation': 'sales_tax_calculation', 'purchase_tax_calculation': 'purchase_tax_calculation' } def __init__(self, year_end_date=None, year_end_lockdown_date=None, accounting_type=None, accounts_start_date=None, base_currency_id=None, multi_currency_enabled=None, use_live_exchange_rates=None, mtd_activation_status=None, mtd_connected=None, mtd_authenticated_date=None, tax_return_frequency_id=None, tax_number=None, general_tax_number=None, tax_office_id=None, default_irpf_rate=None, flat_rate_tax_percentage=None, sales_tax_calculation=None, purchase_tax_calculation=None, local_vars_configuration=None): # noqa: E501 """PutFinancialSettingsFinancialSettings - 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._year_end_date = None self._year_end_lockdown_date = None self._accounting_type = None self._accounts_start_date = None self._base_currency_id = None self._multi_currency_enabled = None self._use_live_exchange_rates = None self._mtd_activation_status = None self._mtd_connected = None self._mtd_authenticated_date = None self._tax_return_frequency_id = None self._tax_number = None self._general_tax_number = None self._tax_office_id = None self._default_irpf_rate = None self._flat_rate_tax_percentage = None self._sales_tax_calculation = None self._purchase_tax_calculation = None self.discriminator = None if year_end_date is not None: self.year_end_date = year_end_date if year_end_lockdown_date is not None: self.year_end_lockdown_date = year_end_lockdown_date if accounting_type is not None: self.accounting_type = accounting_type if accounts_start_date is not None: self.accounts_start_date = accounts_start_date if base_currency_id is not None: self.base_currency_id = base_currency_id if multi_currency_enabled is not None: self.multi_currency_enabled = multi_currency_enabled if use_live_exchange_rates is not None: self.use_live_exchange_rates = use_live_exchange_rates if mtd_activation_status is not None: self.mtd_activation_status = mtd_activation_status if mtd_connected is not None: self.mtd_connected = mtd_connected if mtd_authenticated_date is not None: self.mtd_authenticated_date = mtd_authenticated_date if tax_return_frequency_id is not None: self.tax_return_frequency_id = tax_return_frequency_id if tax_number is not None: self.tax_number = tax_number if general_tax_number is not None: self.general_tax_number = general_tax_number if tax_office_id is not None: self.tax_office_id = tax_office_id if default_irpf_rate is not None: self.default_irpf_rate = default_irpf_rate if flat_rate_tax_percentage is not None: self.flat_rate_tax_percentage = flat_rate_tax_percentage if sales_tax_calculation is not None: self.sales_tax_calculation = sales_tax_calculation if purchase_tax_calculation is not None: self.purchase_tax_calculation = purchase_tax_calculation @property def year_end_date(self): """Gets the year_end_date of this PutFinancialSettingsFinancialSettings. # noqa: E501 The financial year end date of the business # noqa: E501 :return: The year_end_date of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: date """ return self._year_end_date @year_end_date.setter def year_end_date(self, year_end_date): """Sets the year_end_date of this PutFinancialSettingsFinancialSettings. The financial year end date of the business # noqa: E501 :param year_end_date: The year_end_date of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: date """ self._year_end_date = year_end_date @property def year_end_lockdown_date(self): """Gets the year_end_lockdown_date of this PutFinancialSettingsFinancialSettings. # noqa: E501 The year end lockdown date of the business # noqa: E501 :return: The year_end_lockdown_date of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: date """ return self._year_end_lockdown_date @year_end_lockdown_date.setter def year_end_lockdown_date(self, year_end_lockdown_date): """Sets the year_end_lockdown_date of this PutFinancialSettingsFinancialSettings. The year end lockdown date of the business # noqa: E501 :param year_end_lockdown_date: The year_end_lockdown_date of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: date """ self._year_end_lockdown_date = year_end_lockdown_date @property def accounting_type(self): """Gets the accounting_type of this PutFinancialSettingsFinancialSettings. # noqa: E501 Indicates the accounting type of a business, it can be accrual or cash based # noqa: E501 :return: The accounting_type of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: str """ return self._accounting_type @accounting_type.setter def accounting_type(self, accounting_type): """Sets the accounting_type of this PutFinancialSettingsFinancialSettings. Indicates the accounting type of a business, it can be accrual or cash based # noqa: E501 :param accounting_type: The accounting_type of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: str """ self._accounting_type = accounting_type @property def accounts_start_date(self): """Gets the accounts_start_date of this PutFinancialSettingsFinancialSettings. # noqa: E501 The accounts start date of the business # noqa: E501 :return: The accounts_start_date of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: date """ return self._accounts_start_date @accounts_start_date.setter def accounts_start_date(self, accounts_start_date): """Sets the accounts_start_date of this PutFinancialSettingsFinancialSettings. The accounts start date of the business # noqa: E501 :param accounts_start_date: The accounts_start_date of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: date """ self._accounts_start_date = accounts_start_date @property def base_currency_id(self): """Gets the base_currency_id of this PutFinancialSettingsFinancialSettings. # noqa: E501 The ID of the Base Currency. # noqa: E501 :return: The base_currency_id of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: str """ return self._base_currency_id @base_currency_id.setter def base_currency_id(self, base_currency_id): """Sets the base_currency_id of this PutFinancialSettingsFinancialSettings. The ID of the Base Currency. # noqa: E501 :param base_currency_id: The base_currency_id of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: str """ self._base_currency_id = base_currency_id @property def multi_currency_enabled(self): """Gets the multi_currency_enabled of this PutFinancialSettingsFinancialSettings. # noqa: E501 Indicates whether multi-currency is enabled for the business # noqa: E501 :return: The multi_currency_enabled of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: bool """ return self._multi_currency_enabled @multi_currency_enabled.setter def multi_currency_enabled(self, multi_currency_enabled): """Sets the multi_currency_enabled of this PutFinancialSettingsFinancialSettings. Indicates whether multi-currency is enabled for the business # noqa: E501 :param multi_currency_enabled: The multi_currency_enabled of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: bool """ self._multi_currency_enabled = multi_currency_enabled @property def use_live_exchange_rates(self): """Gets the use_live_exchange_rates of this PutFinancialSettingsFinancialSettings. # noqa: E501 Indicates whether to use live or business defined exchange rates # noqa: E501 :return: The use_live_exchange_rates of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: bool """ return self._use_live_exchange_rates @use_live_exchange_rates.setter def use_live_exchange_rates(self, use_live_exchange_rates): """Sets the use_live_exchange_rates of this PutFinancialSettingsFinancialSettings. Indicates whether to use live or business defined exchange rates # noqa: E501 :param use_live_exchange_rates: The use_live_exchange_rates of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: bool """ self._use_live_exchange_rates = use_live_exchange_rates @property def mtd_activation_status(self): """Gets the mtd_activation_status of this PutFinancialSettingsFinancialSettings. # noqa: E501 Indicates the UK Making Tax Digital for VAT activation status # noqa: E501 :return: The mtd_activation_status of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: str """ return self._mtd_activation_status @mtd_activation_status.setter def mtd_activation_status(self, mtd_activation_status): """Sets the mtd_activation_status of this PutFinancialSettingsFinancialSettings. Indicates the UK Making Tax Digital for VAT activation status # noqa: E501 :param mtd_activation_status: The mtd_activation_status of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: str """ self._mtd_activation_status = mtd_activation_status @property def mtd_connected(self): """Gets the mtd_connected of this PutFinancialSettingsFinancialSettings. # noqa: E501 Indicates whether UK Making Tax Digital for VAT is currently connected # noqa: E501 :return: The mtd_connected of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: bool """ return self._mtd_connected @mtd_connected.setter def mtd_connected(self, mtd_connected): """Sets the mtd_connected of this PutFinancialSettingsFinancialSettings. Indicates whether UK Making Tax Digital for VAT is currently connected # noqa: E501 :param mtd_connected: The mtd_connected of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: bool """ self._mtd_connected = mtd_connected @property def mtd_authenticated_date(self): """Gets the mtd_authenticated_date of this PutFinancialSettingsFinancialSettings. # noqa: E501 Indicates when a UK business enabled UK Making Tax Digital for VAT, nil if not enabled or non-uk # noqa: E501 :return: The mtd_authenticated_date of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: date """ return self._mtd_authenticated_date @mtd_authenticated_date.setter def mtd_authenticated_date(self, mtd_authenticated_date): """Sets the mtd_authenticated_date of this PutFinancialSettingsFinancialSettings. Indicates when a UK business enabled UK Making Tax Digital for VAT, nil if not enabled or non-uk # noqa: E501 :param mtd_authenticated_date: The mtd_authenticated_date of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: date """ self._mtd_authenticated_date = mtd_authenticated_date @property def tax_return_frequency_id(self): """Gets the tax_return_frequency_id of this PutFinancialSettingsFinancialSettings. # noqa: E501 The ID of the Tax Return Frequency. # noqa: E501 :return: The tax_return_frequency_id of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: str """ return self._tax_return_frequency_id @tax_return_frequency_id.setter def tax_return_frequency_id(self, tax_return_frequency_id): """Sets the tax_return_frequency_id of this PutFinancialSettingsFinancialSettings. The ID of the Tax Return Frequency. # noqa: E501 :param tax_return_frequency_id: The tax_return_frequency_id of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: str """ self._tax_return_frequency_id = tax_return_frequency_id @property def tax_number(self): """Gets the tax_number of this PutFinancialSettingsFinancialSettings. # noqa: E501 The tax number # noqa: E501 :return: The tax_number of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: str """ return self._tax_number @tax_number.setter def tax_number(self, tax_number): """Sets the tax_number of this PutFinancialSettingsFinancialSettings. The tax number # noqa: E501 :param tax_number: The tax_number of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: str """ self._tax_number = tax_number @property def general_tax_number(self): """Gets the general_tax_number of this PutFinancialSettingsFinancialSettings. # noqa: E501 The number for various tax report submissions # noqa: E501 :return: The general_tax_number of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: str """ return self._general_tax_number @general_tax_number.setter def general_tax_number(self, general_tax_number): """Sets the general_tax_number of this PutFinancialSettingsFinancialSettings. The number for various tax report submissions # noqa: E501 :param general_tax_number: The general_tax_number of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: str """ self._general_tax_number = general_tax_number @property def tax_office_id(self): """Gets the tax_office_id of this PutFinancialSettingsFinancialSettings. # noqa: E501 The ID of the Tax Office. # noqa: E501 :return: The tax_office_id of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: str """ return self._tax_office_id @tax_office_id.setter def tax_office_id(self, tax_office_id): """Sets the tax_office_id of this PutFinancialSettingsFinancialSettings. The ID of the Tax Office. # noqa: E501 :param tax_office_id: The tax_office_id of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: str """ self._tax_office_id = tax_office_id @property def default_irpf_rate(self): """Gets the default_irpf_rate of this PutFinancialSettingsFinancialSettings. # noqa: E501 The default IRPF rate # noqa: E501 :return: The default_irpf_rate of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: float """ return self._default_irpf_rate @default_irpf_rate.setter def default_irpf_rate(self, default_irpf_rate): """Sets the default_irpf_rate of this PutFinancialSettingsFinancialSettings. The default IRPF rate # noqa: E501 :param default_irpf_rate: The default_irpf_rate of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: float """ self._default_irpf_rate = default_irpf_rate @property def flat_rate_tax_percentage(self): """Gets the flat_rate_tax_percentage of this PutFinancialSettingsFinancialSettings. # noqa: E501 The tax percentage that applies to flat rate tax schemes. # noqa: E501 :return: The flat_rate_tax_percentage of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: float """ return self._flat_rate_tax_percentage @flat_rate_tax_percentage.setter def flat_rate_tax_percentage(self, flat_rate_tax_percentage): """Sets the flat_rate_tax_percentage of this PutFinancialSettingsFinancialSettings. The tax percentage that applies to flat rate tax schemes. # noqa: E501 :param flat_rate_tax_percentage: The flat_rate_tax_percentage of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: float """ self._flat_rate_tax_percentage = flat_rate_tax_percentage @property def sales_tax_calculation(self): """Gets the sales_tax_calculation of this PutFinancialSettingsFinancialSettings. # noqa: E501 The method of collection for tax on sales. Allowed values - \"invoice\", \"cash\". # noqa: E501 :return: The sales_tax_calculation of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: str """ return self._sales_tax_calculation @sales_tax_calculation.setter def sales_tax_calculation(self, sales_tax_calculation): """Sets the sales_tax_calculation of this PutFinancialSettingsFinancialSettings. The method of collection for tax on sales. Allowed values - \"invoice\", \"cash\". # noqa: E501 :param sales_tax_calculation: The sales_tax_calculation of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: str """ self._sales_tax_calculation = sales_tax_calculation @property def purchase_tax_calculation(self): """Gets the purchase_tax_calculation of this PutFinancialSettingsFinancialSettings. # noqa: E501 The method of collection for tax on purchases. Allowed values - \"invoice\", \"cash\". # noqa: E501 :return: The purchase_tax_calculation of this PutFinancialSettingsFinancialSettings. # noqa: E501 :rtype: str """ return self._purchase_tax_calculation @purchase_tax_calculation.setter def purchase_tax_calculation(self, purchase_tax_calculation): """Sets the purchase_tax_calculation of this PutFinancialSettingsFinancialSettings. The method of collection for tax on purchases. Allowed values - \"invoice\", \"cash\". # noqa: E501 :param purchase_tax_calculation: The purchase_tax_calculation of this PutFinancialSettingsFinancialSettings. # noqa: E501 :type: str """ self._purchase_tax_calculation = purchase_tax_calculation 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, PutFinancialSettingsFinancialSettings): 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, PutFinancialSettingsFinancialSettings): return True return self.to_dict() != other.to_dict()
[ "kevin.gray@eurekasolutions.co.uk" ]
kevin.gray@eurekasolutions.co.uk
88a4847ffe7598445d9e4e79ec7ade7cf24f3ca7
29141b36357a466d72cff07f4f6a252f790947dd
/src/cnn_tf.py
22995b29408dd890e3f43d41c010011ec072a12c
[ "MIT" ]
permissive
liu3xing3long/nih-chest-xray
b232fce57e0df29d5245b8ceed37c4c10ca93c9f
84eec51c35bd6412fada04412842fe872f40a91e
refs/heads/master
2021-08-22T19:56:55.372945
2017-12-01T05:15:13
2017-12-01T05:15:13
null
0
0
null
null
null
null
UTF-8
Python
false
false
1,091
py
import tensorflow as tf import numpy as np import pandas as pd print("Importing Data") labels = pd.read_csv("../data/sample_labels.csv") X = np.load("../data/X_sample.npy") y = labels['Finding_Labels'] y = np.array(pd.get_dummies(y)) print("Splitting Data") X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) input_layer = tf.reshape(features["x"], [-1, 512, 512, 1]) conv1 = tf.layers.conv2d(inputs=input_layer, filters=32, kernel_size=[2, 2], padding="same", activation=tf.nn.relu) pool1 = tf.layers.max_pooling2d(inputs=conv1, pool_size=[2, 2], strides=2) conv2 = tf.layers.conv2d( inputs=pool1, filters=64, kernel_size=[2, 2], padding="same", activation=tf.nn.relu) pool2 = tf.layers.max_pooling2d(inputs=conv2, pool_size=[2, 2], strides=2) pool2_flat = tf.reshape(pool2, [-1, 7 * 7 * 64]) dense = tf.layers.dense(inputs=pool2_flat, units=1024, activation=tf.nn.relu) dropout = tf.layers.dropout(inputs=dense, rate=0.4, training=mode == tf.estimator.ModeKeys.TRAIN) logits = tf.layers.dense(inputs=dropout, units=15)
[ "gregory.chase@colorado.edu" ]
gregory.chase@colorado.edu
3a346913704674caee5c77cd75948fe136288495
375f29655b966e7dbac2297b3f79aadb5d03b737
/Image/Morphw.py
480c580be1281ed1523a76b52adc5b0beb2b5854
[ "MIT" ]
permissive
pection-zz/FindJointwithImageprocessing
33e0b47ca3629d85e739edcd88dcd1663af88631
3dd4563be88dfcf005c32f19ae97d03f9bf715ad
refs/heads/master
2022-12-23T11:09:04.391591
2020-10-05T16:35:21
2020-10-05T16:35:21
301,473,183
0
1
null
null
null
null
UTF-8
Python
false
false
2,051
py
import sys # import urllib2 import cv2 as cv src = 0 image = 0 dest = 0 element_shape = cv.CV_SHAPE_RECT def Opening(pos): element = cv.CreateStructuringElementEx(pos*2+1, pos*2+1, pos, pos, element_shape) cv.Erode(src, image, element, 1) cv.Dilate(image, dest, element, 1) cv.ShowImage("Opening & Closing", dest) def Closing(pos): element = cv.CreateStructuringElementEx(pos*2+1, pos*2+1, pos, pos, element_shape) cv.Dilate(src, image, element, 1) cv.Erode(image, dest, element, 1) cv.ShowImage("Opening & Closing", dest) def Erosion(pos): element = cv.CreateStructuringElementEx(pos*2+1, pos*2+1, pos, pos, element_shape) cv.Erode(src, dest, element, 1) cv.ShowImage("Erosion & Dilation", dest) def Dilation(pos): element = cv.CreateStructuringElementEx(pos*2+1, pos*2+1, pos, pos, element_shape) cv.Dilate(src, dest, element, 1) cv.ShowImage("Erosion & Dilation", dest) if __name__ == "__main__": if len(sys.argv) > 1: src = cv.LoadImage(sys.argv[1], cv.CV_LOAD_IMAGE_COLOR) else: url = 'https://code.ros.org/svn/opencv/trunk/opencv/samples/c/fruits.jpg' filedata = urllib2.urlopen(url).read() imagefiledata = cv.CreateMatHeader(1, len(filedata), cv.CV_8UC1) cv.SetData(imagefiledata, filedata, len(filedata)) src = cv.DecodeImage(imagefiledata, cv.CV_LOAD_IMAGE_COLOR) image = cv.CloneImage(src) dest = cv.CloneImage(src) cv.NamedWindow("Opening & Closing", 1) cv.NamedWindow("Erosion & Dilation", 1) cv.ShowImage("Opening & Closing", src) cv.ShowImage("Erosion & Dilation", src) cv.CreateTrackbar("Open", "Opening & Closing", 0, 10, Opening) cv.CreateTrackbar("Close", "Opening & Closing", 0, 10, Closing) cv.CreateTrackbar("Dilate", "Erosion & Dilation", 0, 10, Dilation) cv.CreateTrackbar("Erode", "Erosion & Dilation", 0, 10, Erosion) cv.WaitKey(0) cv.DestroyWindow("Opening & Closing") cv.DestroyWindow("Erosion & Dilation")
[ "pection.naphat@gmail.com" ]
pection.naphat@gmail.com
bbe80be9f9fff0ea613053c45361bc9ec7a96a24
abaa806550f6e6e7bcdf71b9ec23e09a85fe14fd
/data/global-configuration/packs/sshd/collectors/collector_sshd.py
c0b458e04e59a61fc4c9e68ec80c8eb193eddf40
[ "MIT" ]
permissive
naparuba/opsbro
02809ddfe22964cd5983c60c1325c965e8b02adf
98618a002cd47250d21e7b877a24448fc95fec80
refs/heads/master
2023-04-16T08:29:31.143781
2019-05-15T12:56:11
2019-05-15T12:56:11
31,333,676
34
7
null
null
null
null
UTF-8
Python
false
false
825
py
import os from opsbro.collector import Collector class Sshd(Collector): def launch(self): self.logger.debug('get_sshd: starting') if not os.path.exists('/etc/ssh'): self.set_not_eligible('There is no ssh server. Missing /etc/ssh directory.') return res = {} if os.path.exists('/etc/ssh/ssh_host_rsa_key.pub'): f = open('/etc/ssh/ssh_host_rsa_key.pub', 'r') buf = f.read().strip() f.close() res['host_rsa_key_pub'] = buf.replace('ssh-rsa ', '') if os.path.exists('/etc/ssh/ssh_host_dsa_key.pub'): f = open('/etc/ssh/ssh_host_dsa_key.pub', 'r') buf = f.read().strip() f.close() res['host_dsa_key_pub'] = buf.replace('ssh-dss ', '') return res
[ "naparuba@gmail.com" ]
naparuba@gmail.com
71f2f3f6ab8c82d999fdc5604d74c6ca35798e00
a4df0ee67d0d56fc8595877470318aed20dd4511
/vplexapi-6.2.0.3/vplexapi/api/system_config_api.py
0cf62487a151978bcac867ff393426037a25be5b
[ "Apache-2.0" ]
permissive
QD888/python-vplex
b5a7de6766840a205583165c88480d446778e529
e2c49faee3bfed343881c22e6595096c7f8d923d
refs/heads/main
2022-12-26T17:11:43.625308
2020-10-07T09:40:04
2020-10-07T09:40:04
null
0
0
null
null
null
null
UTF-8
Python
false
false
3,577
py
# coding: utf-8 """ VPlex REST API A defnition for the next-gen VPlex API # noqa: E501 OpenAPI spec version: 0.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from vplexapi.api_client import ApiClient class SystemConfigApi(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client def get_system_config(self, **kwargs): # noqa: E501 """Return the system configuration # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.get_system_config(async=True) >>> result = thread.get() :param async bool :return: SystemConfig If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): return self.get_system_config_with_http_info(**kwargs) # noqa: E501 else: (data) = self.get_system_config_with_http_info(**kwargs) # noqa: E501 return data def get_system_config_with_http_info(self, **kwargs): # noqa: E501 """Return the system configuration # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.get_system_config_with_http_info(async=True) >>> result = thread.get() :param async bool :return: SystemConfig If the method is called asynchronously, returns the request thread. """ all_params = [] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method get_system_config" % key ) params[key] = val del params['kwargs'] collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # Authentication setting auth_settings = ['basicAuth', 'jwtAuth'] # noqa: E501 return self.api_client.call_api( '/system_config', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='SystemConfig', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats)
[ "anil.degwekar@emc.com" ]
anil.degwekar@emc.com
2780a342fb5ef729f59762e3933525734204a25f
697f5d6857f3499cf12d78ce8468987fa1979a8f
/src/interface/Python/test/testParaMonte_testing_mpi.py
430a65b5bc864d0fb95cf353a65b43c3bc4df455
[ "MIT" ]
permissive
ekourkchi/paramonte
00ced91817e8a41b9b039da973912cbd0205e692
15f8ea27cb514078a94d9c4ee4b60e4f45826f17
refs/heads/master
2023-01-28T07:59:09.063054
2020-12-09T07:19:43
2020-12-09T07:19:43
309,625,327
0
0
MIT
2020-12-09T07:19:44
2020-11-03T08:46:19
Fortran
UTF-8
Python
false
false
2,881
py
#!/usr/bin/env python #!C:\ProgramData\Anaconda3\python.exe #################################################################################################################################### #################################################################################################################################### #### #### MIT License #### #### ParaMonte: plain powerful parallel Monte Carlo library. #### #### Copyright (C) 2012-present, The Computational Data Science Lab #### #### This file is part of the ParaMonte library. #### #### Permission is hereby granted, free of charge, to any person obtaining a #### copy of this software and associated documentation files (the "Software"), #### to deal in the Software without restriction, including without limitation #### the rights to use, copy, modify, merge, publish, distribute, sublicense, #### and/or sell copies of the Software, and to permit persons to whom the #### Software is furnished to do so, subject to the following conditions: #### #### The above copyright notice and this permission notice shall be #### included in all copies or substantial portions of the Software. #### #### THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, #### EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF #### MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. #### IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, #### DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR #### OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE #### OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #### #### ACKNOWLEDGMENT #### #### ParaMonte is an honor-ware and its currency is acknowledgment and citations. #### As per the ParaMonte library license agreement terms, if you use any parts of #### this library for any purposes, kindly acknowledge the use of ParaMonte in your #### work (education/research/industry/development/...) by citing the ParaMonte #### library as described on this page: #### #### https://github.com/cdslaborg/paramonte/blob/master/ACKNOWLEDGMENT.md #### #################################################################################################################################### #################################################################################################################################### import os import numpy as np import paramonte as pm import importlib importlib.reload(pm) from paramonte.mvn import NDIM, getLogFunc pd = pm.ParaDRAM() pd.runSampler( ndim = NDIM , getLogFunc = getLogFunc_pntr , inputFilePath = os.path.dirname(os.path.abspath(__file__)) + "/input/paramonte.nml" , mpiEnabled = True , buildMode = "testing" )
[ "a.shahmoradi@gmail.com" ]
a.shahmoradi@gmail.com
bf31c6a27ffc66a4a30b265b0d2e617071e387d7
dccc57a9320f3c8fd267728bd661a8de501acdad
/Scripts/CC_cal2.py
c32f71f997ec1d6e82ada10075847a6a07ce423a
[]
no_license
SiriusExplorer/G_project
361eb62d8a93239092a93de520dcc858d4b16063
99a7074cc03e4d94c698a60ef42ceeebf164b860
refs/heads/master
2021-01-25T10:35:49.301750
2018-05-03T01:34:01
2018-05-03T01:34:01
123,364,948
1
0
null
null
null
null
UTF-8
Python
false
false
2,236
py
# The script is used to calculate the pearsom and spearman correlation coefficient for specific file import numpy as np from scipy import stats def parse_xls_to_matrix(xls_filename): with open(xls_filename) as file: matrix = [] lines = file.readlines() matrix.append(lines[0].split()) for i in range(len(lines))[1:]: eachlist = lines[i].split() matrix.append([eachlist[0]] + [int(x) for x in eachlist[1:3]] + [float(x) for x in eachlist[3:]]) return matrix def findpeak(list): if sum(list) == 0: return [0] else: return [1] # m_H3K4me1_drm = parse_xls_to_matrix('..\data\LCLs_C2.C1Y12_ref_norm_signals\LCLs_C2.H3K4me1_drm_norm_signals.xls') # m_H3K4me3_drm = parse_xls_to_matrix('..\data\LCLs_C2.C1Y12_ref_norm_signals\LCLs_C2.H3K4me3_drm_norm_signals.xls') # m_H3K27ac_drm = parse_xls_to_matrix('..\data\LCLs_C2.C1Y12_ref_norm_signals\LCLs_C2.H3K27ac_drm_norm_signals.xls') m_H3K4me1_ndrm = parse_xls_to_matrix('..\data\LCLs_C2.C1Y12_ref_norm_signals\LCLs_C2.H3K4me1_ndrm_norm_signals.xls') m_H3K4me3_ndrm = parse_xls_to_matrix('..\data\LCLs_C2.C1Y12_ref_norm_signals\LCLs_C2.H3K4me3_ndrm_norm_signals.xls') m_H3K27ac_ndrm = parse_xls_to_matrix('..\data\LCLs_C2.C1Y12_ref_norm_signals\LCLs_C2.H3K27ac_ndrm_norm_signals.xls') with open('ndrm_scc.xls', 'w') as file: lines = ['chrom\tstart\tend\tH3K4me1_H3K4me3_SCC\tH3K4me1_H3K4me3_SCC_P_value\tH3K4me1_H3K27ac_SCC\tH3K4me1_H3K27ac_SCC_P_value\tH3K4me3_H3K27ac_SCC\tH3K4me3_H3K27ac_SCC_P_value\tH3K4me1_peak\tH3K4me3_peak\tH3K27ac_peak\n'] for i in range(len(m_H3K4me1_ndrm))[1:]: H3K4me1_peak = findpeak(m_H3K4me1_ndrm[i][50:97]) H3K4me3_peak = findpeak(m_H3K4me3_ndrm[i][50:97]) H3K27ac_peak = findpeak(m_H3K27ac_ndrm[i][50:97]) line = m_H3K4me1_ndrm[i][0:3] + list(stats.spearmanr(m_H3K4me1_ndrm[i][3:50], m_H3K4me3_ndrm[i][3:50])) + list(stats.spearmanr(m_H3K4me1_ndrm[i][3:50], m_H3K27ac_ndrm[i][3:50])) + list(stats.spearmanr(m_H3K4me3_ndrm[i][3:50], m_H3K27ac_ndrm[i][3:50])) + H3K4me1_peak + H3K4me3_peak + H3K27ac_peak lines.append('\t'.join([str(x) for x in line]) + '\n') file.writelines(lines)
[ "noreply@github.com" ]
noreply@github.com
27eda12c746e76aea622924f2ee8847073596125
5e371d3a3ce77e8d40eb8771946d80f8c70c94a3
/learning_templates/learning_templates/settings.py
654527665f7ffa984caabf5e7ce27f082f1f3659
[]
no_license
eimaru09/django-deployment-example
ef36eabba10e89137283c903643a99e6716e4ebb
23b75714e7c489d1d0f15de01852255986c9db17
refs/heads/master
2021-08-14T09:53:24.752096
2017-11-14T10:05:12
2017-11-14T10:05:12
110,670,169
0
0
null
null
null
null
UTF-8
Python
false
false
3,211
py
""" Django settings for learning_templates project. Generated by 'django-admin startproject' using Django 1.11.3. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/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__))) TEMPLATE_DIR = os.path.join(BASE_DIR,'templates') # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '*wavld_zak1ls(_gk^6f6-*ev@r4jp-tj03$hwl8@3k7tbu@c$' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'basic_app' ] 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 = 'learning_templates.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [TEMPLATE_DIR,], '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 = 'learning_templates.wsgi.application' # Database # https://docs.djangoproject.com/en/1.11/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/1.11/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/1.11/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/1.11/howto/static-files/ STATIC_URL = '/static/'
[ "goemon09@yahoo.co.jp" ]
goemon09@yahoo.co.jp
dfb205e756ab598a52d4784a867c0ab13b26da1a
2dd5bfdc0aebdec5b9693a7f38e4590ac48d99db
/tamrin.py
94020d17a9838f63d649f1ff482c482fce9efeaf
[]
no_license
Aliiinajafi20/adadkamel
a0a64cffcc7ca424ca8b9fddb7131c23018821dc
6617b578569813c04e6e994beb30c5b66df61980
refs/heads/master
2022-11-28T18:34:06.927551
2020-07-24T07:38:08
2020-07-24T07:38:08
280,908,831
0
0
null
null
null
null
UTF-8
Python
false
false
217
py
x=float(input("Enter the auto price:")) y=float(input("Enter the price of the paper:")) a=150 b=50 r=((float(input("Enter The inflation rate:")))/100) z=(a*x+y*b) f=(z*r)+z print("Increase the cost of the company:",f)
[ "shirin.alizadeh19@gmail.com" ]
shirin.alizadeh19@gmail.com
473d2013a90048edf4a5ef97ee271ce8e7771c08
4878b770577b82d216d8f04befed8a85d1cc06c7
/Model_define_pytorch.py
69f13d0f061457e3c82ca5df50d48dd699387259
[]
no_license
linjingmo/NAIC_baseline_pytorch
744065eb944f4da4aed79498b25cec093c4727b6
bd69fd50ab66ee7b3a82a4f25cd1607805be19fc
refs/heads/master
2023-03-10T10:06:23.780823
2021-02-27T09:16:35
2021-02-27T09:16:35
null
0
0
null
null
null
null
UTF-8
Python
false
false
9,590
py
#!/usr/bin/env python3 """An Implement of an autoencoder with pytorch. This is the template code for 2020 NIAC https://naic.pcl.ac.cn/. The code is based on the sample code with tensorflow for 2020 NIAC and it can only run with GPUS. If you have any questions, please contact me with https://github.com/xufana7/AutoEncoder-with-pytorch Author, Fan xu Aug 2020 changed by seefun Aug 2020 github.com/seefun | kaggle.com/seefun """ import numpy as np import torch.nn as nn import torch import torch.nn.functional as F from torch.utils.data import Dataset from collections import OrderedDict # This part implement the quantization and dequantization operations. # The output of the encoder must be the bitstream. def Num2Bit(Num, B): Num_ = Num.type(torch.uint8) def integer2bit(integer, num_bits=B * 2): dtype = integer.type() exponent_bits = -torch.arange(-(num_bits - 1), 1).type(dtype) exponent_bits = exponent_bits.repeat(integer.shape + (1,)) out = integer.unsqueeze(-1) // 2 ** exponent_bits return (out - (out % 1)) % 2 bit = integer2bit(Num_) bit = (bit[:, :, B:]).reshape(-1, Num_.shape[1] * B) return bit.type(torch.float32) def Bit2Num(Bit, B): Bit_ = Bit.type(torch.float32) Bit_ = torch.reshape(Bit_, [-1, int(Bit_.shape[1] / B), B]) num = torch.zeros(Bit_[:, :, 1].shape).cuda() for i in range(B): num = num + Bit_[:, :, i] * 2 ** (B - 1 - i) return num class Quantization(torch.autograd.Function): @staticmethod def forward(ctx, x, B): ctx.constant = B step = 2 ** B out = torch.round(x * step - 0.5) out = Num2Bit(out, B) return out @staticmethod def backward(ctx, grad_output): # return as many input gradients as there were arguments. # Gradients of constant arguments to forward must be None. # Gradient of a number is the sum of its four bits. b, _ = grad_output.shape grad_num = torch.sum(grad_output.reshape(b, -1, ctx.constant), dim=2) return grad_num, None class Dequantization(torch.autograd.Function): @staticmethod def forward(ctx, x, B): ctx.constant = B step = 2 ** B out = Bit2Num(x, B) out = (out + 0.5) / step return out @staticmethod def backward(ctx, grad_output): # return as many input gradients as there were arguments. # Gradients of non-Tensor arguments to forward must be None. # repeat the gradient of a Num for four time. #b, c = grad_output.shape #grad_bit = grad_output.repeat(1, 1, ctx.constant) #return torch.reshape(grad_bit, (-1, c * ctx.constant)), None grad_bit = grad_output.repeat_interleave(ctx.constant, dim=1) return grad_bit, None class QuantizationLayer(nn.Module): def __init__(self, B): super(QuantizationLayer, self).__init__() self.B = B def forward(self, x): out = Quantization.apply(x, self.B) return out class DequantizationLayer(nn.Module): def __init__(self, B): super(DequantizationLayer, self).__init__() self.B = B def forward(self, x): out = Dequantization.apply(x, self.B) return out def conv3x3(in_planes, out_planes, stride=1): """3x3 convolution with padding""" return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=True) class ConvBN(nn.Sequential): def __init__(self, in_planes, out_planes, kernel_size, stride=1, groups=1): if not isinstance(kernel_size, int): padding = [(i - 1) // 2 for i in kernel_size] else: padding = (kernel_size - 1) // 2 super(ConvBN, self).__init__(OrderedDict([ ('conv', nn.Conv2d(in_planes, out_planes, kernel_size, stride, padding=padding, groups=groups, bias=False)), ('bn', nn.BatchNorm2d(out_planes)) ])) class CRBlock(nn.Module): def __init__(self): super(CRBlock, self).__init__() self.path1 = nn.Sequential(OrderedDict([ ('conv3x3', ConvBN(32, 32, 3)), ('relu1', nn.LeakyReLU(negative_slope=0.3, inplace=True)), ('conv1x9', ConvBN(32, 32, [1, 9])), ('relu2', nn.LeakyReLU(negative_slope=0.3, inplace=True)), ('conv9x1', ConvBN(32, 32, [9, 1])), ])) self.path2 = nn.Sequential(OrderedDict([ ('conv1x5', ConvBN(32, 32, [1, 5])), ('relu', nn.LeakyReLU(negative_slope=0.3, inplace=True)), ('conv5x1', ConvBN(32, 32, [5, 1])), ])) self.conv1x1 = ConvBN(32 * 2, 32, 1) self.identity = nn.Identity() self.relu = nn.LeakyReLU(negative_slope=0.3, inplace=True) def forward(self, x): identity = self.identity(x) out1 = self.path1(x) out2 = self.path2(x) out = torch.cat((out1, out2), dim=1) out = self.relu(out) out = self.conv1x1(out) out = self.relu(out + identity) return out class Encoder(nn.Module): B = 4 def __init__(self, feedback_bits, quantization=True): super(Encoder, self).__init__() self.encoder1 = nn.Sequential(OrderedDict([ ("conv3x3_bn", ConvBN(2, 32, 3)), ("relu1", nn.LeakyReLU(negative_slope=0.3, inplace=True)), ("conv1x9_bn", ConvBN(32, 32, [1, 9])), ("relu2", nn.LeakyReLU(negative_slope=0.3, inplace=True)), ("conv9x1_bn", ConvBN(32, 32, [9, 1])), ])) self.encoder2 = ConvBN(2, 32, 3) self.encoder_conv = nn.Sequential(OrderedDict([ ("relu1", nn.LeakyReLU(negative_slope=0.3, inplace=True)), ("conv1x1_bn", ConvBN(32*2, 2, 1)), ("relu2", nn.LeakyReLU(negative_slope=0.3, inplace=True)), ])) self.fc = nn.Linear(1024, int(feedback_bits / self.B)) self.sig = nn.Sigmoid() self.quantize = QuantizationLayer(self.B) self.quantization = quantization def forward(self, x): encode1 = self.encoder1(x) encode2 = self.encoder2(x) out = torch.cat((encode1, encode2), dim=1) out = self.encoder_conv(out) out = out.view(-1, 1024) out = self.fc(out) out = self.sig(out) if self.quantization: out = self.quantize(out) else: out = out return out class Decoder(nn.Module): B = 4 def __init__(self, feedback_bits, quantization=True): super(Decoder, self).__init__() self.feedback_bits = feedback_bits self.dequantize = DequantizationLayer(self.B) self.fc = nn.Linear(int(feedback_bits / self.B), 1024) decoder = OrderedDict([ ("conv5x5_bn", ConvBN(2, 32, 5)), ("relu", nn.LeakyReLU(negative_slope=0.3, inplace=True)), ("CRBlock1", CRBlock()), ("CRBlock2", CRBlock()), ]) self.decoder_feature = nn.Sequential(decoder) self.out_cov = conv3x3(32, 2) self.sig = nn.Sigmoid() self.quantization = quantization def forward(self, x): if self.quantization: out = self.dequantize(x) else: out = x out = out.view(-1, int(self.feedback_bits / self.B)) out = self.fc(out) out = out.view(-1, 2, 16, 32) out = self.decoder_feature(out) out = self.out_cov(out) out = self.sig(out) return out # Note: Do not modify following class and keep it in your submission. # feedback_bits is 128 by default. class AutoEncoder(nn.Module): def __init__(self, feedback_bits): super(AutoEncoder, self).__init__() self.encoder = Encoder(feedback_bits) self.decoder = Decoder(feedback_bits) def forward(self, x): feature = self.encoder(x) out = self.decoder(feature) return out def NMSE(x, x_hat): x_real = np.reshape(x[:, :, :, 0], (len(x), -1)) x_imag = np.reshape(x[:, :, :, 1], (len(x), -1)) x_hat_real = np.reshape(x_hat[:, :, :, 0], (len(x_hat), -1)) x_hat_imag = np.reshape(x_hat[:, :, :, 1], (len(x_hat), -1)) x_C = x_real - 0.5 + 1j * (x_imag - 0.5) x_hat_C = x_hat_real - 0.5 + 1j * (x_hat_imag - 0.5) power = np.sum(abs(x_C) ** 2, axis=1) mse = np.sum(abs(x_C - x_hat_C) ** 2, axis=1) nmse = np.mean(mse / power) return nmse def NMSE_cuda(x, x_hat): x_real = x[:, 0, :, :].view(len(x),-1) - 0.5 x_imag = x[:, 1, :, :].view(len(x),-1) - 0.5 x_hat_real = x_hat[:, 0, :, :].view(len(x_hat), -1) - 0.5 x_hat_imag = x_hat[:, 1, :, :].view(len(x_hat), -1) - 0.5 power = torch.sum(x_real**2 + x_imag**2, axis=1) mse = torch.sum((x_real-x_hat_real)**2 + (x_imag-x_hat_imag)**2, axis=1) nmse = mse/power return nmse class NMSELoss(nn.Module): def __init__(self, reduction='sum'): super(NMSELoss, self).__init__() self.reduction = reduction def forward(self, x_hat, x): nmse = NMSE_cuda(x, x_hat) if self.reduction == 'mean': nmse = torch.mean(nmse) else: nmse = torch.sum(nmse) return nmse def Score(NMSE): score = 1 - NMSE return score # dataLoader class DatasetFolder(Dataset): def __init__(self, matData): self.matdata = matData def __len__(self): return self.matdata.shape[0] def __getitem__(self, index): return self.matdata[index] #, self.matdata[index]
[ "noreply@github.com" ]
noreply@github.com
9ee850f579c896ce0e8288b66817cca063a7a3d0
c67f2d0677f8870bc1d970891bbe31345ea55ce2
/zippy/lib-python/3/tkinter/font.py
5425b060132a7f3319d4038b8185c548b23e4efa
[ "BSD-3-Clause" ]
permissive
securesystemslab/zippy
a5a1ecf5c688504d8d16128ce901406ffd6f32c2
ff0e84ac99442c2c55fe1d285332cfd4e185e089
refs/heads/master
2022-07-05T23:45:36.330407
2018-07-10T22:17:32
2018-07-10T22:17:32
67,824,983
324
27
null
null
null
null
UTF-8
Python
false
false
6,135
py
# Tkinter font wrapper # # written by Fredrik Lundh, February 1998 # # FIXME: should add 'displayof' option where relevant (actual, families, # measure, and metrics) # __version__ = "0.9" import tkinter # weight/slant NORMAL = "normal" ROMAN = "roman" BOLD = "bold" ITALIC = "italic" def nametofont(name): """Given the name of a tk named font, returns a Font representation. """ return Font(name=name, exists=True) class Font: """Represents a named font. Constructor options are: font -- font specifier (name, system font, or (family, size, style)-tuple) name -- name to use for this font configuration (defaults to a unique name) exists -- does a named font by this name already exist? Creates a new named font if False, points to the existing font if True. Raises _tkinter.TclError if the assertion is false. the following are ignored if font is specified: family -- font 'family', e.g. Courier, Times, Helvetica size -- font size in points weight -- font thickness: NORMAL, BOLD slant -- font slant: ROMAN, ITALIC underline -- font underlining: false (0), true (1) overstrike -- font strikeout: false (0), true (1) """ def _set(self, kw): options = [] for k, v in kw.items(): options.append("-"+k) options.append(str(v)) return tuple(options) def _get(self, args): options = [] for k in args: options.append("-"+k) return tuple(options) def _mkdict(self, args): options = {} for i in range(0, len(args), 2): options[args[i][1:]] = args[i+1] return options def __init__(self, root=None, font=None, name=None, exists=False, **options): if not root: root = tkinter._default_root if font: # get actual settings corresponding to the given font font = root.tk.splitlist(root.tk.call("font", "actual", font)) else: font = self._set(options) if not name: name = "font" + str(id(self)) self.name = name if exists: self.delete_font = False # confirm font exists if self.name not in root.tk.call("font", "names"): raise tkinter._tkinter.TclError( "named font %s does not already exist" % (self.name,)) # if font config info supplied, apply it if font: root.tk.call("font", "configure", self.name, *font) else: # create new font (raises TclError if the font exists) root.tk.call("font", "create", self.name, *font) self.delete_font = True # backlinks! self._root = root self._split = root.tk.splitlist self._call = root.tk.call def __str__(self): return self.name def __eq__(self, other): return isinstance(other, Font) and self.name == other.name def __getitem__(self, key): return self.cget(key) def __setitem__(self, key, value): self.configure(**{key: value}) def __del__(self): try: if self.delete_font: self._call("font", "delete", self.name) except (KeyboardInterrupt, SystemExit): raise except Exception: pass def copy(self): "Return a distinct copy of the current font" return Font(self._root, **self.actual()) def actual(self, option=None): "Return actual font attributes" if option: return self._call("font", "actual", self.name, "-"+option) else: return self._mkdict( self._split(self._call("font", "actual", self.name)) ) def cget(self, option): "Get font attribute" return self._call("font", "config", self.name, "-"+option) def config(self, **options): "Modify font attributes" if options: self._call("font", "config", self.name, *self._set(options)) else: return self._mkdict( self._split(self._call("font", "config", self.name)) ) configure = config def measure(self, text): "Return text width" return int(self._call("font", "measure", self.name, text)) def metrics(self, *options): """Return font metrics. For best performance, create a dummy widget using this font before calling this method.""" if options: return int( self._call("font", "metrics", self.name, self._get(options)) ) else: res = self._split(self._call("font", "metrics", self.name)) options = {} for i in range(0, len(res), 2): options[res[i][1:]] = int(res[i+1]) return options def families(root=None): "Get font families (as a tuple)" if not root: root = tkinter._default_root return root.tk.splitlist(root.tk.call("font", "families")) def names(root=None): "Get names of defined fonts (as a tuple)" if not root: root = tkinter._default_root return root.tk.splitlist(root.tk.call("font", "names")) # -------------------------------------------------------------------- # test stuff if __name__ == "__main__": root = tkinter.Tk() # create a font f = Font(family="times", size=30, weight=NORMAL) print(f.actual()) print(f.actual("family")) print(f.actual("weight")) print(f.config()) print(f.cget("family")) print(f.cget("weight")) print(names()) print(f.measure("hello"), f.metrics("linespace")) print(f.metrics()) f = Font(font=("Courier", 20, "bold")) print(f.measure("hello"), f.metrics("linespace")) w = tkinter.Label(root, text="Hello, world", font=f) w.pack() w = tkinter.Button(root, text="Quit!", command=root.destroy) w.pack() fb = Font(font=w["font"]).copy() fb.config(weight=BOLD) w.config(font=fb) tkinter.mainloop()
[ "thezhangwei@gmail.com" ]
thezhangwei@gmail.com
754dc7267c49aacffd7d2656a8f1484056801d6f
139288e3ce07322333defbc5e44056c664f968c8
/connect.py
f05c59e3208300a785d947db118bee58f2dfc28a
[]
no_license
PNUIOTLAB/Air-Rasberry
22cf945b3c3dc9a11703d12dc3d1a0cad24e8a2e
e4c803117faa53e012b1ed4f3a046f5e653d6bd3
refs/heads/main
2023-07-15T02:31:22.492264
2021-08-29T06:33:51
2021-08-29T06:33:51
307,345,883
0
0
null
2021-08-29T06:33:51
2020-10-26T11:10:21
Python
UTF-8
Python
false
false
191
py
import bluetooth Target_device_addr = "20:20:1d:27:d1:17" port =1 sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM) sock.connect((Target_device_addr, port)) sock.send("hello") sock.close
[ "zungun2217@gmail.com" ]
zungun2217@gmail.com
ca7a001a542a3dedd8711e9dbb758503e4498ca4
49dfc23a2542996927efc734cdddc24d359ea474
/DoublyLinkedList.py
5db56aa12e7d2566351ab8e9b89365fd35adad3c
[]
no_license
harshadrai/DataStructures
7f9cf98a3765cd7525058ab8ef29b4752d455bed
31aacdf7aa03226c712d4e1370714ccfe3a83ad9
refs/heads/master
2022-02-27T18:45:47.986642
2019-11-03T21:28:26
2019-11-03T21:28:26
194,788,769
0
0
null
null
null
null
UTF-8
Python
false
false
5,069
py
class Element(object): def __init__(self,value,next=None,prev=None): self.value=value self.next=next self.prev=prev class DoublyLinkedList(object): def __init__(self): self.head=None def append(self,element): if self.head: next_element=self.head while next_element.next: next_element=next_element.next next_element.next=element element.next=None element.prev=next_element else: self.head=element element.next=None element.prev=None def push_front(self,element): next_element=self.head if next_element: next_element.prev=element self.head=element element.next=next_element element.prev=None def top_front(self): if self.head: return self.head.value else: return "Linked List is empty." def pop_front(self): if self.head: self.head=self.head.next self.head.prev=None else: return "Linked List is empty." def top_back(self): if self.head: next_element=self.head while next_element.next: next_element=next_element.next return next_element.value else: return "Empty Linked List" def pop_back(self): if self.head: next_element=self.head while next_element.next: next_element=next_element.next next_element.prev.next=None else: return "Linked List is empty." def find(self,key): if self.head: next_element=self.head while next_element and next_element.value!=key: next_element=next_element.next if next_element: return True else: return False else: return False def erase(self,key): if self.head: if self.head.value==key: self.head=self.head.next if self.head: self.head.prev=None else: next_element=self.head.next while next_element and next_element.value!=key: next_element=next_element.next if next_element: next_element.prev.next=next_element.next if next_element.next: next_element.next.prev=next_element.prev return else: return str(key)+" does not exist in Linked List" else: return "Linked List is empty" def is_empty(self): if self.head: return False else: return True def add_before(self,element,key): new_element=Element(key) next_element=self.head while next_element and next_element!=element: next_element=next_element.next if next_element: new_element.next=next_element if next_element.prev: next_element.prev.next=new_element new_element.prev=next_element.prev else: self.head=new_element new_element.prev=None next_element.prev=new_element else: return "Given element does not exist" def add_after(self,element,key): if self.head: new_element=Element(key) next_element=self.head while next_element and next_element!=element: next_element=next_element.next if next_element: if next_element.next: next_element.next.prev=new_element new_element.next=next_element.next next_element.next=new_element new_element.prev=next_element else: return "Given element does not exist" else: return "The Linked List is empty." my_list=DoublyLinkedList() e1 = Element(5) e2=Element(6) e3=Element(4) e4=Element(7) my_list.append(e1) my_list.append(e2) my_list.push_front(e3) my_list.top_front() my_list.pop_front() my_list.top_front() my_list.top_back() my_list.append(e4) my_list.top_back() my_list.pop_back() my_list.top_back() print(my_list.find(5)) print(my_list.find(9)) my_list.erase(5) print(my_list.find(5)) my_list.erase(9) my_list.append(Element(7)) my_list.top_back() my_list.erase(7) my_list.top_back() my_list.top_front() my_list.erase(6) my_list.is_empty() my_list.add_before(e4,7) my_list.append(e1) my_list.add_before(e1,4) my_list.top_front() my_list.add_before(e1,4.5) print(my_list.head.next.value) my_list.top_back() my_list.add_after(e1,6) my_list.top_back() e5=my_list.head my_list.add_after(e5,4.25) print(my_list.head.next.value) my_list.head=None my_list.is_empty() my_list.add_after(e1,7) my_list.push_front(e1) print(my_list.head.prev) print(my_list.head.next) print(my_list.head.value)
[ "hrrai2@illinois.edu" ]
hrrai2@illinois.edu
1406a3be22719918e6335cd07a499544d2bc7444
a3e4c101d1e11b3f265dc3bcafe3d21fd44a46c2
/api/apps.py
3518b6489910dc3b4b350108516d779fffa91520
[]
no_license
jie151/web_final
fdb5ad63c4fb9b38cda13b82a040f492dfdab4a6
a7b631ce5fc05cf467634fe5c116947cf83287c2
refs/heads/master
2023-06-03T07:32:28.640953
2021-06-12T16:23:46
2021-06-12T16:23:46
376,342,294
0
0
null
null
null
null
UTF-8
Python
false
false
140
py
from django.apps import AppConfig class ApiConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'api'
[ "61457751+jie151@users.noreply.github.com" ]
61457751+jie151@users.noreply.github.com
2d65cd7dc544057e31eb3f95ff6eb51998df2347
5e360abc04bd6b340452d8fb73d3b67c2fa2dad6
/carroya/spiders/carroya_spider.py
163263497e2533fc337b8d4b2222b16c86cf45d6
[]
no_license
guialante/carroya_crawler
f6cb8804b21c7b3ed2171c0c305f158592ccc8c6
a04e70f86f00be827f1dc9249d3d3c890b4d92e4
refs/heads/master
2020-12-23T10:23:37.780586
2017-10-09T20:31:23
2017-10-09T20:31:23
41,567,970
1
0
null
null
null
null
UTF-8
Python
false
false
2,052
py
# -*- coding: utf-8 -*- import scrapy from scrapy.http import Request from ..items import CarroyaItem class CarroyaSpider(scrapy.Spider): name = "carroya" allowed_domains = ["carroya.com"] start_urls = [ 'http://www.carroya.com/web/buscar/vehiculos/t4.do' ] def parse(self, response): links = response.xpath('//a[@class="detalleOrden3"]/@href').extract() for link in links: url = response.urljoin(link) yield Request(url, callback=self.parse_item, dont_filter=True) next_page_url = response.xpath( '//ul[@class="pagination"]//a[contains(text(), "»")]/@href' ).extract_first(default='') if next_page_url: next_page_url = response.urljoin(next_page_url) yield Request(next_page_url, callback=self.parse, dont_filter=True) def parse_item(self, response): item = CarroyaItem() item['brand'] = response.xpath('//main[@id="detailUsed"]//input[@id="marca"]/@value').extract_first(default='') item['price'] = response.xpath('//main[@id="detailUsed"]//input[@id="precio"]/@value').extract_first(default='') item['year'] = response.xpath('//main[@id="detailUsed"]//input[@id="modelo"]/@value').extract_first(default='') item['status'] = response.xpath( '//main[@id="detailUsed"]//input[@id="estadoDetalle"]/@value' ).extract_first(default='') item['trim'] = response.xpath('//main[@id="detailUsed"]//input[@id="linea"]/@value').extract_first(default='') item['url'] = response.request.url item['kilometers'] = response.xpath( '//main[@id="detailUsed"]//input[@id="kilometraje"]/@value' ).extract_first(default='') item['city'] = response.xpath('//main[@id="detailUsed"]//input[@id="ciudad"]/@value').extract_first(default='') item['type'] = response.xpath( '//main[@id="detailUsed"]//input[@id="s_prop40"]/@value' ).extract_first(default='') yield item
[ "guialante@gmail.com" ]
guialante@gmail.com
31c56b82a6dab0d5a6b46825e2bab18d4a4203f9
755d018599dc5a37083f1a46d5edde8926f369b9
/Спринт 12 Тема 2/P. Списочная очередь.py
e32c6993a8fb37a5a431d5405fb7fb96da70388e
[]
no_license
meat9/Algoritms
6d3c425449955c7618e5b73e6f2ec46f1acd58b0
1394ba0c046a215d722aa1901e88f27ff7972e23
refs/heads/master
2022-12-26T10:43:21.078047
2020-09-13T08:16:59
2020-09-13T08:16:59
286,240,143
0
0
null
null
null
null
UTF-8
Python
false
false
1,831
py
# Любимый вариант очереди Тимофея - очередь, написанная с использованием связного списка. # Помогите ему с реализацией. Очередь должна поддерживать методы get, put, size. # Формат ввода # В первой строке записано количество команд n - целое число, не превосходящее 1000. # В каждой из следующих n строк записана команда: get, put, или size. # Формат вывода # При вызове метода get напечатайте возвращаемое значение. # Если метод get вызывается у пустой очереди, нужно напечатать 'error'. # При вызове метода size - вывести размер очереди. # Пример 1 # Ввод # 10 # put -34 # put -23 # get # size # get # size # get # get # put 80 # size # Вывод # -34 # 1 # -23 # 0 # error # error # 1 class MyQueue: def __init__(self): self.items = [] def isEmpty(self): return self.items == [] def push(self, item): self.items.append(item) def pop(self): if self.isEmpty(): return 'error' return self.items.pop(0) def size(self): return len(self.items) def peek(self): if self.isEmpty(): return None else: return self.items[0] t = int(input()) stack = MyQueue() while t: l = input().split() if l[0] == 'put': stack.push(int(l[1])) if l[0] == 'get': print(stack.pop()) if l[0] == 'size': print(stack.size()) if l[0] == 'peek': print(stack.peek()) t -= 1
[ "meat9@yandex.ru" ]
meat9@yandex.ru
76208c6ef8c190bcf22aa633dd5f6575a94e625f
a97531d67fd705805fd384a3dc815402e99dde75
/for_rand.py
245710ec3c7cc0762a9c1166772b70059f6cba5d
[]
no_license
alicehexing/spider_for_experts
0918cff9326a7aba4bfbe659a568d3452aa1fcab
8131bab1003e6e361f0591f7ef5dcb156f5ce868
refs/heads/main
2023-08-17T03:57:14.708575
2021-04-15T10:56:53
2021-04-15T10:56:53
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,911
py
# -*- coding:utf-8 -*- # !/usr/bin/env python # the experts page of the RAND uses asynchronous transmission # from the response of the url: https://www.rand.org/about/people.html # F12 -> Network -> F5 -> XHR -> Header # then we can know that the information is stored here: # https://www.rand.org/content/rand/about/people/_jcr_content/par/stafflist.xml # so it's simply to get the datas and save them from utils import save_file, load_file import requests import time import os import xml.etree.ElementTree as ET import xml.dom.minidom def read_json(): rela = load_file() experts_list = rela.keys() for person in experts_list: print("expert: ", person) # str print("position: ", rela[person]['position']) # str print("search areas: ", rela[person]["area"]) # str split by ',' return rela def read_xml(): rela = {} dom = xml.dom.minidom.parse('./data/stafflist.xml') root = dom.documentElement itemlist_ = root.getElementsByTagName('staff') for item in itemlist_: name = item.getAttribute("name") position = item.getAttribute("title") search_tags = item.getAttribute("search-tags") pre_tag = search_tags.replace(" ", ",") area_tag = pre_tag.replace("-", " ") if name in list(rela.keys()): continue else: rela[name] = {'position': position, 'area': area_tag} return rela def get_xml(): url = 'https://www.rand.org/content/rand/about/people/_jcr_content/par/stafflist.xml' headers = {'Connection': 'close', 'User-Agent': "Mozilla/5.0 (Windows NT 6.1; WOW64) " "AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2 "} try: res = requests.get(url, headers=headers) print('url:', url) print('get response successfully! ', time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) # print(res.status_code) except requests.HTTPError as e: print('http error! status code: ', e.response.status_code) time.sleep(3) except requests.exceptions.RequestException as e: print('Connect error!') print(e) except Exception as e: print('other error:') print(e) res.encoding = 'utf-8' html = res.text root = ET.fromstring(html) tree = ET.ElementTree(root) filename = './data/stafflist.xml' tree.write(filename) print('original data has been saved here: ', filename) def main(): if not os.path.exists('./data/stafflist.xml'): print('ready to get data!') get_xml() else: print('data exists!') rela = read_xml() save_file(rela, './data/stafflist.json') print('see original data in :', './data/stafflist.xml') print('see selected data in : ', './data/stafflist.json') if __name__ == '__main__': main()
[ "76767579+CandyMonster37@users.noreply.github.com" ]
76767579+CandyMonster37@users.noreply.github.com
32091f1cede951837973c316f0ad0fd571643586
89b746c29f3bc0a4ecd507e0de7154403c572bad
/Assignment -2/layers.py
143e61f2091f8b8c5b3db467a7abaabe30dbd5ee
[]
no_license
MashNagesh/CS231N
ea05566359872ea3f9dd76daac7266d0210a6051
b27ab96e892334bcd870c6e9bf824050b2a01f0c
refs/heads/master
2020-03-18T09:14:18.432324
2018-08-24T07:06:24
2018-08-24T07:06:24
134,552,454
0
0
null
null
null
null
UTF-8
Python
false
false
47,690
py
from builtins import range import numpy as np def affine_forward(x, w, b): """ Computes the forward pass for an affine (fully-connected) layer. The input x has shape (N, d_1, ..., d_k) and contains a minibatch of N examples, where each example x[i] has shape (d_1, ..., d_k). We will reshape each input into a vector of dimension D = d_1 * ... * d_k, and then transform it to an output vector of dimension M. Inputs: - x: A numpy array containing input data, of shape (N, d_1, ..., d_k) - w: A numpy array of weights, of shape (D, M) - b: A numpy array of biases, of shape (M,) Returns a tuple of: - out: output, of shape (N, M) - cache: (x, w, b) """ N = x.shape[0] modx = np.reshape(x,(N,-1)) out = np.dot(modx,w)+b ########################################################################### # TODO: Implement the affine forward pass. Store the result in out. You # # will need to reshape the input into rows. # ########################################################################### pass ########################################################################### # END OF YOUR CODE # ########################################################################### cache = (x, w, b) return out, cache def affine_backward(dout, cache): """ Computes the backward pass for an affine layer. Inputs: - dout: Upstream derivative, of shape (N, M) - cache: Tuple of: - x: Input data, of shape (N, d_1, ... d_k) - w: Weights, of shape (D, M) - b: Biases, of shape (M,) Returns a tuple of: - dx: Gradient with respect to x, of shape (N, d1, ..., d_k) - dw: Gradient with respect to w, of shape (D, M) - db: Gradient with respect to b, of shape (M,) """ x, w, b = cache db = np.sum(dout,axis=0) dx = np.dot(dout,w.T) dx = dx.reshape(x.shape) dw = np.dot(x.T,dout) dw = dw.reshape(w.shape,order='F') #dx, dw, db = None, None, None ########################################################################### # TODO: Implement the affine backward pass. # ########################################################################### pass ########################################################################### # END OF YOUR CODE # ########################################################################### return dx, dw, db def relu_forward(x): """ Computes the forward pass for a layer of rectified linear units (ReLUs). Input: - x: Inputs, of any shape Returns a tuple of: - out: Output, of the same shape as x - cache: x """ out = np.maximum(0,x) ########################################################################### # TODO: Implement the ReLU forward pass. # ########################################################################### pass ########################################################################### # END OF YOUR CODE # ########################################################################### cache = x return out, cache def relu_backward(dout, cache): """ Computes the backward pass for a layer of rectified linear units (ReLUs). Input: - dout: Upstream derivatives, of any shape - cache: Input x, of same shape as dout Returns: - dx: Gradient with respect to x """ dx, x = None, cache dx = np.where(x>0,1,0)*dout ########################################################################### # TODO: Implement the ReLU backward pass. # ########################################################################### pass ########################################################################### # END OF YOUR CODE # ########################################################################### return dx def batchnorm_forward(x, gamma, beta, bn_param): """ Forward pass for batch normalization. During training the sample mean and (uncorrected) sample variance are computed from minibatch statistics and used to normalize the incoming data. During training we also keep an exponentially decaying running mean of the mean and variance of each feature, and these averages are used to normalize data at test-time. At each timestep we update the running averages for mean and variance using an exponential decay based on the momentum parameter: running_mean = momentum * running_mean + (1 - momentum) * sample_mean running_var = momentum * running_var + (1 - momentum) * sample_var Note that the batch normalization paper suggests a different test-time behavior: they compute sample mean and variance for each feature using a large number of training images rather than using a running average. For this implementation we have chosen to use running averages instead since they do not require an additional estimation step; the torch7 implementation of batch normalization also uses running averages. Input: - x: Data of shape (N, D) - gamma: Scale parameter of shape (D,) - beta: Shift paremeter of shape (D,) - bn_param: Dictionary with the following keys: - mode: 'train' or 'test'; required - eps: Constant for numeric stability - momentum: Constant for running mean / variance. - running_mean: Array of shape (D,) giving running mean of features - running_var Array of shape (D,) giving running variance of features Returns a tuple of: - out: of shape (N, D) - cache: A tuple of values needed in the backward pass """ mode = bn_param['mode'] eps = bn_param.get('eps', 1e-5) momentum = bn_param.get('momentum', 0.9) N, D = x.shape running_mean = bn_param.get('running_mean', np.zeros(D, dtype=x.dtype)) running_var = bn_param.get('running_var', np.zeros(D, dtype=x.dtype)) out, cache = None, None if mode == 'train': sample_mean = np.mean(x,axis = 0) xmu = x-sample_mean #Getting the variance sq = xmu ** 2 sample_var = 1./N * np.sum(sq, axis = 0) sqrtvar = np.sqrt(sample_var + eps) invsqrvar = 1/sqrtvar xhat = xmu *invsqrvar gammax = np.multiply(xhat,gamma) out = gammax+beta cache = (mode,xhat,gamma,xmu,invsqrvar,sqrtvar,sample_var,eps) running_mean = momentum * running_mean + (1 - momentum) * sample_mean running_var = momentum * running_var + (1 - momentum) * sample_var ####################################################################### # TODO: Implement the training-time forward pass for batch norm. # # Use minibatch statistics to compute the mean and variance, use # # these statistics to normalize the incoming data, and scale and # # shift the normalized data using gamma and beta. # # # # You should store the output in the variable out. Any intermediates # # that you need for the backward pass should be stored in the cache # # variable. # # # # You should also use your computed sample mean and variance together # # with the momentum variable to update the running mean and running # # variance, storing your result in the running_mean and running_var # # variables. # # # # Note that though you should be keeping track of the running # # variance, you should normalize the data based on the standard # # deviation (square root of variance) instead! # # Referencing the original paper (https://arxiv.org/abs/1502.03167) # # might prove to be helpful. # ####################################################################### pass ####################################################################### # END OF YOUR CODE # ####################################################################### elif mode == 'test': ####################################################################### # TODO: Implement the test-time forward pass for batch normalization. # # Use the running mean and variance to normalize the incoming data, # # then scale and shift the normalized data using gamma and beta. # # Store the result in the out variable. # ####################################################################### std = np.sqrt(running_var+eps) x_out_mod = (x-running_mean)/std out = np.multiply(x_out_mod,gamma)+beta cache = (mode, x, x_out_mod, gamma, beta, std) pass ####################################################################### # END OF YOUR CODE # ####################################################################### else: raise ValueError('Invalid forward batchnorm mode "%s"' % mode) # Store the updated running means back into bn_param bn_param['running_mean'] = running_mean bn_param['running_var'] = running_var return out, cache #https://kratzert.github.io/2016/02/12/understanding-the-gradient-flow-through-the-batch-normalization-layer.html def batchnorm_backward(dout, cache): """ Backward pass for batch normalization. For this implementation, you should write out a computation graph for batch normalization on paper and propagate gradients backward through intermediate nodes. Inputs: - dout: Upstream derivatives, of shape (N, D) - cache: Variable of intermediates from batchnorm_forward. Returns a tuple of: - dx: Gradient with respect to inputs x, of shape (N, D) - dgamma: Gradient with respect to scale parameter gamma, of shape (D,) - dbeta: Gradient with respect to shift parameter beta, of shape (D,) """ mode = cache[0] dx, dgamma, dbeta = None, None, None N,D = dout.shape if mode == 'train': mode,xhat,gamma,xmu,invsrqvar,sqrtvar,sample_var,eps = cache # multiply by 1 dbeta = np.sum(dout, axis=0) dgammax = dout dgamma = np.sum(dgammax*xhat, axis=0) dxhat = dgammax * gamma dxmu1 = dxhat*invsrqvar dinvsqrvar = np.sum(dxhat*xmu, axis=0) dsqrtvar = -1. /(sqrtvar**2) * dinvsqrvar dsample_var = 0.5 * (1/np.sqrt(sample_var+eps))*dsqrtvar dsq = 1/N *np.ones((N,D))*dsample_var dxmu2 = 2*xmu *dsq dxmu = np.sum(dxmu1+dxmu2,axis=0) dx1 = dxmu1+dxmu2 dmu = -1 * dxmu dx2 = 1. /N * np.ones((N,D)) * dmu dx = dx1+dx2 if mode == 'test': mode, x, xn, gamma, beta, std = cache dbeta = dout.sum(axis=0) dgamma = np.sum(xn * dout, axis=0) dxn = gamma * dout dx = dxn / std ########################################################################### # TODO: Implement the backward pass for batch normalization. Store the # # results in the dx, dgamma, and dbeta variables. # # Referencing the original paper (https://arxiv.org/abs/1502.03167) # # might prove to be helpful. # ########################################################################### pass ########################################################################### # END OF YOUR CODE # ########################################################################### return dx, dgamma, dbeta #https://kevinzakka.github.io/2016/09/14/batch_normalization/ def batchnorm_backward_alt(dout, cache): """ Alternative backward pass for batch normalization. For this implementation you should work out the derivatives for the batch normalizaton backward pass on paper and simplify as much as possible. You should be able to derive a simple expression for the backward pass. See the jupyter notebook for more hints. Note: This implementation should expect to receive the same cache variable as batchnorm_backward, but might not use all of the values in the cache. Inputs / outputs: Same as batchnorm_backward """ dx, dgamma, dbeta = None, None, None N,D = dout.shape mode = cache[0] if mode == 'train': mode,xhat,gamma,xmu,invsrqvar,sqrtvar,sample_var,eps = cache dbeta = np.sum(dout, axis=0) dgamma = np.sum(dout*xhat, axis=0) dxhat = dout * gamma dx = (1. / N) * invsrqvar * (N*dxhat - np.sum(dxhat, axis=0) - xhat*np.sum(dxhat*xhat, axis=0)) ########################################################################### # TODO: Implement the backward pass for batch normalization. Store the # # results in the dx, dgamma, and dbeta variables. # # # # After computing the gradient with respect to the centered inputs, you # # should be able to compute gradients with respect to the inputs in a # # single statement; our implementation fits on a single 80-character line.# ########################################################################### if mode == 'test': mode, x, xn, gamma, beta, std = cache dbeta = dout.sum(axis=0) dgamma = np.sum(xn * dout, axis=0) dx = gamma * dout/std pass ########################################################################### # END OF YOUR CODE # ########################################################################### return dx, dgamma, dbeta def layernorm_forward(x, gamma, beta, ln_param): """ Forward pass for layer normalization. During both training and test-time, the incoming data is normalized per data-point, before being scaled by gamma and beta parameters identical to that of batch normalization. Note that in contrast to batch normalization, the behavior during train and test-time for layer normalization are identical, and we do not need to keep track of running averages of any sort. Input: - x: Data of shape (N, D) - gamma: Scale parameter of shape (D,) - beta: Shift paremeter of shape (D,) - ln_param: Dictionary with the following keys: - eps: Constant for numeric stability Returns a tuple of: - out: of shape (N, D) - cache: A tuple of values needed in the backward pass """ out, cache = None, None eps = ln_param.get('eps', 1e-5) N, D = x.shape sample_mean = np.mean(x,axis = 1) xmu = x.T-sample_mean #Getting the variance sq = xmu ** 2 sample_var = 1./N * np.sum(sq, axis = 0) sqrtvar = np.sqrt(sample_var + eps) invsqrvar = 1/sqrtvar xhat = xmu *invsqrvar gammax = np.multiply(xhat.T,gamma) out = gammax+beta cache = (xhat,gamma,xmu,invsqrvar,sqrtvar,sample_var,eps) ########################################################################### # TODO: Implement the training-time forward pass for layer norm. # # Normalize the incoming data, and scale and shift the normalized data # # using gamma and beta. # # HINT: this can be done by slightly modifying your training-time # # implementation of batch normalization, and inserting a line or two of # # well-placed code. In particular, can you think of any matrix # # transformations you could perform, that would enable you to copy over # # the batch norm code and leave it almost unchanged? # ########################################################################### pass ########################################################################### # END OF YOUR CODE # ########################################################################### return out, cache def layernorm_backward(dout, cache): """ Backward pass for layer normalization. For this implementation, you can heavily rely on the work you've done already for batch normalization. Inputs: - dout: Upstream derivatives, of shape (N, D) - cache: Variable of intermediates from layernorm_forward. Returns a tuple of: - dx: Gradient with respect to inputs x, of shape (N, D) - dgamma: Gradient with respect to scale parameter gamma, of shape (D,) - dbeta: Gradient with respect to shift parameter beta, of shape (D,) """ dx, dgamma, dbeta = None, None, None N,D = dout.shape xhat,gamma,xmu,invsrqvar,sqrtvar,sample_var,eps = cache # multiply by 1 print (dout.shape) dbeta = np.sum(dout, axis=0) dgamma = np.sum(xhat.T*dout, axis=0) dxhat = (gamma*dout) dx = (1. / N) * invsrqvar * (N*dxhat.T - np.sum(dxhat.T, axis=0) - xhat*np.sum(dxhat.T*xhat, axis=0)) print (dx.shape) ########################################################################### # TODO: Implement the backward pass for layer norm. # # # # HINT: this can be done by slightly modifying your training-time # # implementation of batch normalization. The hints to the forward pass # # still apply! # ########################################################################### pass ########################################################################### # END OF YOUR CODE # ########################################################################### return dx, dgamma, dbeta def dropout_forward(x, dropout_param): """ Performs the forward pass for (inverted) dropout. Inputs: - x: Input data, of any shape - dropout_param: A dictionary with the following keys: - p: Dropout parameter. We keep each neuron output with probability p. - mode: 'test' or 'train'. If the mode is train, then perform dropout; if the mode is test, then just return the input. - seed: Seed for the random number generator. Passing seed makes this function deterministic, which is needed for gradient checking but not in real networks. Outputs: - out: Array of the same shape as x. - cache: tuple (dropout_param, mask). In training mode, mask is the dropout mask that was used to multiply the input; in test mode, mask is None. NOTE: Please implement **inverted** dropout, not the vanilla version of dropout. See http://cs231n.github.io/neural-networks-2/#reg for more details. NOTE 2: Keep in mind that p is the probability of **keep** a neuron output; this might be contrary to some sources, where it is referred to as the probability of dropping a neuron output. """ p, mode = dropout_param['p'], dropout_param['mode'] if 'seed' in dropout_param: np.random.seed(dropout_param['seed']) mask = None out = None if mode == 'train': mask = (np.random.rand(*x.shape) > p)/p out = x* mask ####################################################################### # TODO: Implement training phase forward pass for inverted dropout. # # Store the dropout mask in the mask variable. # ####################################################################### pass ####################################################################### # END OF YOUR CODE # ####################################################################### elif mode == 'test': out = x ####################################################################### # TODO: Implement the test phase forward pass for inverted dropout. # ####################################################################### pass ####################################################################### # END OF YOUR CODE # ####################################################################### cache = (dropout_param, mask) out = out.astype(x.dtype, copy=False) return out, cache def dropout_backward(dout, cache): """ Perform the backward pass for (inverted) dropout. Inputs: - dout: Upstream derivatives, of any shape - cache: (dropout_param, mask) from dropout_forward. """ dropout_param, mask = cache mode = dropout_param['mode'] dx = None if mode == 'train': dx = dout*mask ####################################################################### # TODO: Implement training phase backward pass for inverted dropout # ####################################################################### pass ####################################################################### # END OF YOUR CODE # ####################################################################### elif mode == 'test': dx = dout return dx def conv_forward_naive(x, w, b, conv_param): """ A naive implementation of the forward pass for a convolutional layer. The input consists of N data points, each with C channels, height H and width W. We convolve each input with F different filters, where each filter spans all C channels and has height HH and width WW. Input: - x: Input data of shape (N, C, H, W) - w: Filter weights of shape (F, C, HH, WW) - b: Biases, of shape (F,) - conv_param: A dictionary with the following keys: - 'stride': The number of pixels between adjacent receptive fields in the horizontal and vertical directions. - 'pad': The number of pixels that will be used to zero-pad the input. During padding, 'pad' zeros should be placed symmetrically (i.e equally on both sides) along the height and width axes of the input. Be careful not to modfiy the original input x directly. Returns a tuple of: - out: Output data, of shape (N, F, H', W') where H' and W' are given by H' = 1 + (H + 2 * pad - HH) / stride W' = 1 + (W + 2 * pad - WW) / stride - cache: (x, w, b, conv_param) """ out = None pad = conv_param['pad'] stride = conv_param['stride'] N,C,H,W =x.shape # N- number of records # c - channel # H - height and W- width npad = ((0, 0),(0,0), (pad,pad), (pad, pad)) padded_x = np.pad(x,pad_width = npad,mode ='constant', constant_values=0) F,C,HH,WW = w.shape H_out = 1 + (H + 2 * pad - HH) // stride W_out = 1 + (W + 2 * pad - WW) // stride N,C,H_new,W_new = padded_x.shape output = [] counter = 0 for i in range(N): for f in range(F): new_out = [] for k in range(0,H_new-HH+1,stride): for l in range(0,W_new-WW+1,stride): out1 = [] for j in range(C): working_x = padded_x[i][j][k:k+HH,l:l+WW] working_f = w[f][j][:][:] out1.append(np.sum(working_x*working_f)) counter +=1 new_out.append(sum(out1)+b[f]) inter_array = np.array(new_out) output.append(inter_array) # Stretching the vectors # F - number of filters /C- channel/HH- Height/WW- width ########################################################################### # TODO: Implement the convolutional forward pass. # # Hint: you can use the function np.pad for padding. # ########################################################################### ########################################################################### # END OF YOUR CODE # ########################################################################### cache = (x, w, b, conv_param) out1 = np.array(output) out1 =out1.ravel().reshape(N,F,H_out,W_out) out = out1 return out, cache def conv_forward_naive1(x, w, b, conv_param): """ A naive implementation of the forward pass for a convolutional layer. The input consists of N data points, each with C channels, height H and width W. We convolve each input with F different filters, where each filter spans all C channels and has height HH and width WW. Input: - x: Input data of shape (N, C, H, W) - w: Filter weights of shape (F, C, HH, WW) - b: Biases, of shape (F,) - conv_param: A dictionary with the following keys: - 'stride': The number of pixels between adjacent receptive fields in the horizontal and vertical directions. - 'pad': The number of pixels that will be used to zero-pad the input. During padding, 'pad' zeros should be placed symmetrically (i.e equally on both sides) along the height and width axes of the input. Be careful not to modfiy the original input x directly. Returns a tuple of: - out: Output data, of shape (N, F, H', W') where H' and W' are given by H' = 1 + (H + 2 * pad - HH) / stride W' = 1 + (W + 2 * pad - WW) / stride - cache: (x, w, b, conv_param) """ out = None pad = conv_param['pad'] stride = conv_param['stride'] N,C,H,W =x.shape #C,H,W = x.shape # N- number of records # c - channel # H - height and W- width npad = ((0, 0),(0,0), (pad,pad), (pad, pad)) #padded_x = np.pad(x,pad_width = npad,mode ='constant', constant_values=0) F,C,HH,WW = w.shape H_out = 1 + (H + 2 * pad - HH) / stride W_out = 1 + (W + 2 * pad - WW) / stride #N,C,H_new,W_new = padded_x.shape output = [] padded_x = x N,C,H_new,W_new = padded_x.shape print (b) for i in range(N): for f in range(F): new_out = [] for k in range(0,H_new-stride,stride): for l in range(0,W_new-stride,stride): out1 = [] for j in range(C): #working_x = padded_x[i][j][k:k+HH,l:l+WW] working_x = padded_x[j][k:k+HH,l:l+WW] working_f = w[f][j][:][:] out1.append(np.sum(working_x*working_f)) new_out.append(sum(out1)+b[f]) new_array =np.array(new_out) new_array = new_array.reshape(3,3) output.append(new_array) # Stretching the vectors # F - number of filters /C- channel/HH- Height/WW- width ########################################################################### # TODO: Implement the convolutional forward pass. # # Hint: you can use the function np.pad for padding. # ########################################################################### pass ########################################################################### # END OF YOUR CODE # ########################################################################### cache = (x, w, b, conv_param) out = np.array(output) print (out) return out, cache def conv_backward_naive1(dout, cache): """ A naive implementation of the backward pass for a convolutional layer. Inputs: - dout: Upstream derivatives. - cache: A tuple of (x, w, b, conv_param) as in conv_forward_naive Returns a tuple of: - dx: Gradient with respect to x - dw: Gradient with respect to w - db: Gradient with respect to b """ x, w, b, conv_param = cache pad = conv_param['pad'] stride = conv_param['stride'] F, C, HH, WW = w.shape N, C, H, W = x.shape Hp = 1 + (H + 2 * pad - HH) // stride Wp = 1 + (W + 2 * pad - WW) // stride npad = ((0, 0),(0,0), (pad,pad), (pad, pad)) padded_x = np.pad(x,pad_width = npad,mode ='constant', constant_values=0) dx = np.zeros_like(x) dx_working = np.zeros_like(padded_x) dw = np.zeros_like(w) db = np.zeros_like(b) npad = ((0, 0),(0,0), (HH-1,WW-1), (HH-1, WW-1)) padded_dout = np.pad(dout,pad_width = npad,mode ='constant', constant_values=0) N,C,H_new,W_new = padded_dout.shape #Calculation of dx for l in range(0,H_new-HH,stride): for k in range(0,W_new-WW,stride): working_dout = padded_dout[0][0][l:l+HH,k:k+WW] working_w = w[0][0][:][:] working_w = (np.rot90(working_w,2)) dx_working[0][0][l][k] = np.sum(working_w*working_dout) # Calculation of dw for l in range(0,H_new-H-1,stride): for k in range(0,W_new-W-1,stride): working_dout = dout[0][0][:][:] working_x = padded_x[0][0][l:l+H,k:k+W] dw[0][0][l][k] = np.sum(working_dout*working_x) db = np.sum(dout) ########################################################################### # TODO: Implement the convolutional backward pass. # ########################################################################### pass ########################################################################### # END OF YOUR CODE # ########################################################################### dx = dx_working[0][0][HH-(HH-1):HH-(HH-1)+H,WW-(WW-1):WW-(WW-1)+W] return dx, dw, db def conv_backward_naive2(dout, cache): """ A naive implementation of the backward pass for a convolutional layer. Inputs: - dout: Upstream derivatives. - cache: A tuple of (x, w, b, conv_param) as in conv_forward_naive Returns a tuple of: - dx: Gradient with respect to x - dw: Gradient with respect to w - db: Gradient with respect to b """ x, w, b, conv_param = cache pad = conv_param['pad'] stride = conv_param['stride'] F, C, HH, WW = w.shape N, C, H, W = x.shape Hp = 1 + (H + 2 * pad - HH) // stride Wp = 1 + (W + 2 * pad - WW) // stride npad = ((0, 0),(0,0), (pad,pad), (pad, pad)) padded_x = np.pad(x,pad_width = npad,mode ='constant', constant_values=0) dx = np.zeros_like(x) dx_working = np.zeros_like(padded_x) dw = np.zeros_like(w) db = np.zeros_like(b) npad = ((0, 0),(0,0), (HH-1,WW-1), (HH-1, WW-1)) padded_dout = np.pad(dout,pad_width = npad,mode ='constant', constant_values=0) N,F,H_new,W_new = padded_dout.shape N,F,Hout,Wout = dout.shape #Calculation of dx for i in range(N): for l in range(0,H_new-HH+1,stride): for k in range(0,W_new-WW+1,stride): for c in range(C): for f in range(F): working_dout = padded_dout[i][f][l:l+HH,k:k+WW] working_w = w[f][c][:][:] working_w = (np.rot90(working_w,2)) dx_working[i][c][l][k] = np.sum(working_w*working_dout) # Calculation of dw for l in range(0,H+(2*pad)-Hout+1,stride): for k in range(0,H+(2*pad)-Hout+1,stride): for c in range(C): for f in range(F): w_sum =0 for i in range(N): working_dout = dout[i][f][:][:] working_x = padded_x[i][c][l:l+H,k:k+W] w_sum +=np.sum(working_dout*working_x) dw[f][c][l][k] = w_sum db = np.sum(dout) ########################################################################### # TODO: Implement the convolutional backward pass. # ########################################################################### pass ########################################################################### # END OF YOUR CODE # ########################################################################### dx = dx_working[:,:,pad:-pad,pad:-pad] return dx, dw, db def conv_backward_naive(dout, cache): """ A naive implementation of the backward pass for a convolutional layer. Inputs: - dout: Upstream derivatives. - cache: A tuple of (x, w, b, conv_param) as in conv_forward_naive Returns a tuple of: - dx: Gradient with respect to x - dw: Gradient with respect to w - db: Gradient with respect to b """ x, w, b, conv_param = cache pad = conv_param['pad'] stride = conv_param['stride'] F, C, HH, WW = w.shape N, C, H, W = x.shape Hp = 1 + (H + 2 * pad - HH) // stride Wp = 1 + (W + 2 * pad - WW) // stride npad = ((0, 0),(0,0), (pad,pad), (pad, pad)) padded_x = np.pad(x,pad_width = npad,mode ='constant', constant_values=0) dx = np.zeros_like(x) dx_working = np.zeros_like(padded_x) dw = np.zeros_like(w) db = np.zeros_like(b) npad = ((0, 0),(0,0), (HH-1,WW-1), (HH-1, WW-1)) padded_dout = np.pad(dout,pad_width = npad,mode ='constant', constant_values=0) N,F,H_new,W_new = padded_dout.shape N,F,Hout,Wout = dout.shape #Calculation of dx for i in range(N): for l in range(0,H_new-HH+1,stride): for k in range(0,W_new-WW+1,stride): for c in range(C): x_sum=0 for f in range(F): working_dout = padded_dout[i][f][l:l+HH,k:k+WW] working_w = w[f][c][:][:] working_w = (np.rot90(working_w,2)) x_sum +=np.sum(working_w*working_dout) dx_working[i][c][l][k] = x_sum # Calculation of dw for l in range(0,H+(2*pad)-Hout+1,stride): for k in range(0,H+(2*pad)-Hout+1,stride): for c in range(C): for f in range(F): w_sum =0 for i in range(N): working_dout = dout[i][f][:][:] working_x = padded_x[i][c][l:l+H,k:k+W] w_sum +=np.sum(working_dout*working_x) dw[f][c][l][k] = w_sum ########################################################################### # TODO: Implement the convolutional backward pass. # ########################################################################### pass ########################################################################### # END OF YOUR CODE # ########################################################################### dx = dx_working[:,:,pad:-pad,pad:-pad] db = np.sum(np.sum(np.sum(dout,axis =0),axis = 1),axis = 1) return dx, dw, db def max_pool_forward_naive(x, pool_param): """ A naive implementation of the forward pass for a max-pooling layer. Inputs: - x: Input data, of shape (N, C, H, W) - pool_param: dictionary with the following keys: - 'pool_height': The height of each pooling region - 'pool_width': The width of each pooling region - 'stride': The distance between adjacent pooling regions No padding is necessary here. Output size is given by Returns a tuple of: - out: Output data, of shape (N, C, H', W') where H' and W' are given by H' = 1 + (H - pool_height) / stride W' = 1 + (W - pool_width) / stride - cache: (x, pool_param) """ pool_height = pool_param['pool_height'] pool_width = pool_param['pool_width'] N,C,H,W = x.shape stride = pool_param['stride'] H_out = 1 + (H - pool_height) // stride W_out = 1 + (W - pool_width) // stride outlist = [] index_list = [] out = None for n in range(N): for c in range(C): for i in range(0,H-pool_height+1,stride): for j in range(0,W-pool_width+1,stride): working_x = x[n][c][i:i+pool_height,j:j+pool_width] outlist.append(np.max(working_x)) index_list.append(np.unravel_index(working_x.argmax(), working_x.shape)) ########################################################################### # TODO: Implement the max-pooling forward pass # ########################################################################### out = np.reshape(outlist, (N,C,H_out,W_out)) ########################################################################### # END OF YOUR CODE # ########################################################################### cache = (x,index_list,pool_param) return out, cache def max_pool_backward_naive(dout, cache): """ A naive implementation of the backward pass for a max-pooling layer. Inputs: - dout: Upstream derivatives - cache: A tuple of (x, pool_param) as in the forward pass. Returns: - dx: Gradient with respect to x """ x,index_list,pool_param = cache N,C,H,W = x.shape dx = np.zeros_like(x) pool_height = pool_param['pool_height'] pool_width = pool_param['pool_width'] stride = pool_param['stride'] N,C,H_new,W_new = dout.shape index_list.reverse() dout_list =dout.flatten().tolist() dout_list.reverse() for n in range(N): for c in range(C): for k in range(0,W-pool_width+1,pool_width): for l in range(0,H-pool_height+1,pool_height): dout_to_be_mapped = dout_list.pop() index=index_list.pop() working_dx = dx[n,c,k:k+pool_height,l:l+pool_width] working_dx[index] = dout_to_be_mapped dx[n,c,k:k+pool_width,l:l+pool_height]=working_dx ########################################################################### # TODO: Implement the max-pooling backward pass # ########################################################################### ########################################################################### # END OF YOUR CODE # ########################################################################### return dx def spatial_batchnorm_forward(x, gamma, beta, bn_param): """ Computes the forward pass for spatial batch normalization. Inputs: - x: Input data of shape (N, C, H, W) - gamma: Scale parameter, of shape (C,) - beta: Shift parameter, of shape (C,) - bn_param: Dictionary with the following keys: - mode: 'train' or 'test'; required - eps: Constant for numeric stability - momentum: Constant for running mean / variance. momentum=0 means that old information is discarded completely at every time step, while momentum=1 means that new information is never incorporated. The default of momentum=0.9 should work well in most situations. - running_mean: Array of shape (D,) giving running mean of features - running_var Array of shape (D,) giving running variance of features Returns a tuple of: - out: Output data, of shape (N, C, H, W) - cache: Values needed for the backward pass """ out, cache = None, None ########################################################################### # TODO: Implement the forward pass for spatial batch normalization. # # # # HINT: You can implement spatial batch normalization by calling the # # vanilla version of batch normalization you implemented above. # # Your implementation should be very short; ours is less than five lines. # ########################################################################### pass ########################################################################### # END OF YOUR CODE # ########################################################################### return out, cache def spatial_batchnorm_backward(dout, cache): """ Computes the backward pass for spatial batch normalization. Inputs: - dout: Upstream derivatives, of shape (N, C, H, W) - cache: Values from the forward pass Returns a tuple of: - dx: Gradient with respect to inputs, of shape (N, C, H, W) - dgamma: Gradient with respect to scale parameter, of shape (C,) - dbeta: Gradient with respect to shift parameter, of shape (C,) """ dx, dgamma, dbeta = None, None, None ########################################################################### # TODO: Implement the backward pass for spatial batch normalization. # # # # HINT: You can implement spatial batch normalization by calling the # # vanilla version of batch normalization you implemented above. # # Your implementation should be very short; ours is less than five lines. # ########################################################################### pass ########################################################################### # END OF YOUR CODE # ########################################################################### return dx, dgamma, dbeta def spatial_groupnorm_forward(x, gamma, beta, G, gn_param): """ Computes the forward pass for spatial group normalization. In contrast to layer normalization, group normalization splits each entry in the data into G contiguous pieces, which it then normalizes independently. Per feature shifting and scaling are then applied to the data, in a manner identical to that of batch normalization and layer normalization. Inputs: - x: Input data of shape (N, C, H, W) - gamma: Scale parameter, of shape (C,) - beta: Shift parameter, of shape (C,) - G: Integer mumber of groups to split into, should be a divisor of C - gn_param: Dictionary with the following keys: - eps: Constant for numeric stability Returns a tuple of: - out: Output data, of shape (N, C, H, W) - cache: Values needed for the backward pass """ out, cache = None, None eps = gn_param.get('eps',1e-5) ########################################################################### # TODO: Implement the forward pass for spatial group normalization. # # This will be extremely similar to the layer norm implementation. # # In particular, think about how you could transform the matrix so that # # the bulk of the code is similar to both train-time batch normalization # # and layer normalization! # ########################################################################### pass ########################################################################### # END OF YOUR CODE # ########################################################################### return out, cache def spatial_groupnorm_backward(dout, cache): """ Computes the backward pass for spatial group normalization. Inputs: - dout: Upstream derivatives, of shape (N, C, H, W) - cache: Values from the forward pass Returns a tuple of: - dx: Gradient with respect to inputs, of shape (N, C, H, W) - dgamma: Gradient with respect to scale parameter, of shape (C,) - dbeta: Gradient with respect to shift parameter, of shape (C,) """ dx, dgamma, dbeta = None, None, None ########################################################################### # TODO: Implement the backward pass for spatial group normalization. # # This will be extremely similar to the layer norm implementation. # ########################################################################### pass ########################################################################### # END OF YOUR CODE # ########################################################################### return dx, dgamma, dbeta def svm_loss(x, y): """ Computes the loss and gradient using for multiclass SVM classification. Inputs: - x: Input data, of shape (N, C) where x[i, j] is the score for the jth class for the ith input. - y: Vector of labels, of shape (N,) where y[i] is the label for x[i] and 0 <= y[i] < C Returns a tuple of: - loss: Scalar giving the loss - dx: Gradient of the loss with respect to x """ N = x.shape[0] correct_class_scores = x[np.arange(N), y] margins = np.maximum(0, x - correct_class_scores[:, np.newaxis] + 1.0) margins[np.arange(N), y] = 0 loss = np.sum(margins) / N num_pos = np.sum(margins > 0, axis=1) dx = np.zeros_like(x) dx[margins > 0] = 1 dx[np.arange(N), y] -= num_pos dx /= N return loss, dx def softmax_loss(x, y): """ Computes the loss and gradient for softmax classification. Inputs: - x: Input data, of shape (N, C) where x[i, j] is the score for the jth class for the ith input. - y: Vector of labels, of shape (N,) where y[i] is the label for x[i] and 0 <= y[i] < C Returns a tuple of: - loss: Scalar giving the loss - dx: Gradient of the loss with respect to x """ shifted_logits = x - np.max(x, axis=1, keepdims=True) Z = np.sum(np.exp(shifted_logits), axis=1, keepdims=True) log_probs = shifted_logits - np.log(Z) probs = np.exp(log_probs) N = x.shape[0] loss = -np.sum(log_probs[np.arange(N), y]) / N dx = probs.copy() dx[np.arange(N), y] -= 1 dx /= N return loss, dx
[ "noreply@github.com" ]
noreply@github.com
ca631286d1ffb88dc8f3b064bc031926d161073a
eafc4ca450fcdd4b5967187920cf6c5774d2a493
/app/models.py
7ba328dbc96bd4c78984dd55ace82d2c71dc79ab
[]
no_license
nixamas/brewbud
286238cdee3bfa10fbbe49c01d5d23f159cd7ced
f215e6b3bef014d4eed828a80d812dcd823c8f77
refs/heads/master
2021-01-20T08:47:11.967946
2013-10-17T03:14:32
2013-10-17T03:14:32
null
0
0
null
null
null
null
UTF-8
Python
false
false
4,916
py
# -*- encoding: utf-8 -*- """ Python Aplication Template Licence: GPLv3 """ from app import db class ModelExample(db.Model): id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(250)) content = db.Column(db.Text) date = db.Column(db.DateTime) class BeerModel(db.Model): __tablename__ = 'beers' beer_id = db.Column(db.Integer, primary_key=True) beer_name = db.Column(db.Text) #beer_brewery = db.Column(db.Text, unique = True) fk_brewery_id = db.Column(db.Integer, db.ForeignKey('breweries.brewery_id')) brewery = db.relationship('BreweryModel', backref=db.backref('breweries',lazy='dynamic')) beer_style = db.Column(db.Text) beer_abv = db.Column(db.Text) beer_ibu = db.Column(db.Text) beer_srm = db.Column(db.Text) beer_og = db.Column(db.Text) beer_rating = db.Column(db.Text) def __init__(self,form=None,brewery_mod=None): if form != None: print("BeerModel :: BeerForm -- " + str(form)) self.beer_name = form.beer_name.data #self.beer_brewery = form.beer_brewery.data self.brewery = brewery_mod self.beer_style = form.beer_style.data self.beer_abv = form.beer_abv.data self.beer_ibu = form.beer_ibu.data self.beer_srm = form.beer_srm.data self.beer_og = form.beer_og.data self.beer_rating = form.beer_rating.data def __str__(self): return "<" + str(self.beer_id) + ", " + str(self.beer_name) + ", " + str(self.brewery) + ", " +">" class BrewModel(db.Model): __tablename__ = 'brews' brew_id = db.Column(db.Integer, primary_key=True) fk_beer_id = db.Column(db.Integer, db.ForeignKey('beers.beer_id')) beer = db.relationship('BeerModel', backref=db.backref('brews',lazy='dynamic')) #brew_name = db.Column(db.Text) #brew_brew_date = db.Column(db.DateTime) brew_brew_date = db.Column(db.Text) #brew_second_ferm_date = db.Column(db.DateTime) brew_second_ferm_date = db.Column(db.Text) #brew_bottle_date = db.Column(db.DateTime) brew_bottle_date = db.Column(db.Text) brew_volume = db.Column(db.Text) brew_abv = db.Column(db.Text) brew_ingredients = db.Column(db.Text) brew_notes = db.Column(db.Text) #brew_rating = db.Column(db.Text) def __init__(self,beer_mod=None,form=None): if form != None and beer_mod != None: self.beer = beer_mod #self.brew_name = form.brew_name.data self.brew_brew_date = form.brew_brew_date.data self.brew_second_ferm_date = form.brew_second_ferm_date.data self.brew_bottle_date = form.brew_bottle_date.data self.brew_volume = form.brew_volume.data self.brew_abv = form.brew_abv.data self.brew_ingredients = form.brew_ingredients.data self.brew_notes = form.brew_notes.data #self.brew_rating = form.brew_rating.data class BreweryModel(db.Model): __tablename__ = 'breweries' brewery_id = db.Column(db.Integer, primary_key=True) brewery_name = db.Column(db.Text) brewery_url = db.Column(db.Text) brewery_information = db.Column(db.Text) def __init__(self, form=None): if form != None: self.brewery_name = form.brewery_name.data self.brewery_url = form.brewery_url.data self.brewery_information = form.brewery_information.data def __str__(self): return "< " +str(self.brewery_id) + ", " + str(self.brewery_name) + "> " class GravityReadingModel(db.Model): __tablename__ = 'gravityreadings' gravity_reading_id = db.Column(db.Integer, primary_key=True) fk_brew_id = db.Column(db.Integer, db.ForeignKey('brews.brew_id')) gravity_reading_date = db.Column(db.DateTime) gravity_reading_value = db.Column(db.Text) class ReadingModels(db.Model): __tablename__ = 'readings' reading_id = db.Column(db.Integer, primary_key=True) fk_brew_id = db.Column(db.Integer, db.ForeignKey('brews.brew_id')) reading_time = db.Column(db.DateTime) reading_brew_temp = db.Column(db.Text) reading_amb_temp = db.Column(db.Text) class User(db.Model): id = db.Column(db.Integer, primary_key = True) user = db.Column(db.String(64), unique = True) password = db.Column(db.String(500)) name = db.Column(db.String(500)) email = db.Column(db.String(120), unique = True) # posts = db.relationship('Post', backref = 'author', lazy = 'dynamic') def is_authenticated(self): return True def is_active(self): return True def is_anonymous(self): return False def get_id(self): return unicode(self.id) def __repr__(self): return '<User %r>' % (self.nickname)
[ "nixamas@gmail.com" ]
nixamas@gmail.com
cbd6e68a9e21552b93a632d455222c655592eac1
bc6a65059105d024f5f21345e83d679034392863
/0x05-personal_data/filtered_logger.py
d1e1c8a13183069b6a6cc235c4c750b0347d3b48
[]
no_license
cedouiri/holbertonschool-web_back_end
037ebe2972507e614d9ed5e6b13ff5e5d93c81f3
122fd8577d7e5f781af1a0439cb2665d2397eaa3
refs/heads/main
2023-05-16T04:54:53.601936
2021-06-07T20:47:02
2021-06-07T20:47:02
348,110,420
0
0
null
null
null
null
UTF-8
Python
false
false
2,557
py
#!/usr/bin/env python3 ''' Regex-ing ''' import logging import re import mysql.connector import os from typing import List PII_FIELDS = ('name', 'email', 'phone', 'ssn', 'password') class RedactingFormatter(logging.Formatter): ''' class Redacting Formatter ''' REDACTION = "***" FORMAT = "[HOLBERTON] %(name)s %(levelname)s %(asctime)-15s: %(message)s" SEPARATOR = ";" def __init__(self, fields: List[str]): super(RedactingFormatter, self).__init__(self.FORMAT) self.fields = list(fields) def format(self, record: logging.LogRecord) -> str: ''' Returns a log msg ''' msg = logging.Formatter(self.FORMAT).format(record) return filter_datum(self.fields, self.REDACTION, msg, self.SEPARATOR) def filter_datum(fields: List[str], redaction: str, message: str, separator: str) -> str: ''' Returns a log msg ''' return (separator.join(x if x.split('=')[0] not in fields else re.sub( r'=.*', '=' + redaction, x) for x in message.split(separator))) def get_logger() -> logging.Logger: ''' get logger ''' logger = logging.getLogger('user_data') logger.setLevel(logging.INFO) logger.propagate = False stream_handler = logging.StreamHandler() stream_handler.setLevel(logging.INFO) formatter = RedactingFormatter(PII_FIELDS) stream_handler.setFormatter(formatter) logger.addHandler(stream_handler) return logger def get_db() -> mysql.connector.connection.MySQLConnection: """Returns a connector to my_db database.""" user = os.getenv("PERSONAL_DATA_DB_USERNAME", 'root') password = os.getenv("PERSONAL_DATA_DB_PASSWORD", '') host = os.getenv("PERSONAL_DATA_DB_HOST", 'localhost') db_name = os.getenv("PERSONAL_DATA_DB_NAME") cnx = mysql.connector.connect( host=host, database=db_name, user=user, password=password ) return cnx def main() -> None: ''' we using get_db to obtain a database connection ''' db = get_db() cursor = db.cursor() cursor.execute("SELECT * FROM users") records = cursor.fetchall() logger = get_logger() fields = [x[0] for x in cursor.description] for row in records: msg = '' for i in range(len(fields)): msg += fields[i] + '=' + str(row[i]) + ';' logger.info(msg) cursor.close() db.close() if __name__ == "__main__": main()
[ "cedouiri@gmail.com" ]
cedouiri@gmail.com
3262ca2157e7e55a7bc3b144133ddefce3b3e3a7
f07a42f652f46106dee4749277d41c302e2b7406
/Data Set/bug-fixing-5/44a9b167bda9654ce60588cf2dcee88e4bad831d-<test_apply_with_reduce_empty>-bug.py
2a11ec39a3f937351a774e71f7fba648b2061694
[]
no_license
wsgan001/PyFPattern
e0fe06341cc5d51b3ad0fe29b84098d140ed54d1
cc347e32745f99c0cd95e79a18ddacc4574d7faa
refs/heads/main
2023-08-25T23:48:26.112133
2021-10-23T14:11:22
2021-10-23T14:11:22
null
0
0
null
null
null
null
UTF-8
Python
false
false
665
py
def test_apply_with_reduce_empty(self): x = [] result = self.empty.apply(x.append, axis=1, result_type='expand') assert_frame_equal(result, self.empty) result = self.empty.apply(x.append, axis=1, result_type='reduce') assert_series_equal(result, Series([], index=pd.Index([], dtype=object))) empty_with_cols = DataFrame(columns=['a', 'b', 'c']) result = empty_with_cols.apply(x.append, axis=1, result_type='expand') assert_frame_equal(result, empty_with_cols) result = empty_with_cols.apply(x.append, axis=1, result_type='reduce') assert_series_equal(result, Series([], index=pd.Index([], dtype=object))) assert (x == [])
[ "dg1732004@smail.nju.edu.cn" ]
dg1732004@smail.nju.edu.cn
2572e48bdb52d7a084f54b18b1441b9669eedc10
eb2e34f130a114269ccb71ea80c22edef0eee516
/invoicely/invoicely/urls.py
b18f193a70a988ba21877b24e110247e579d3e69
[]
no_license
Ussr-eng/Invoice
54ee5958d601b57dec1dec0bd41668831103b87d
4afaa1527d7249924c9771779989aa080fdc1026
refs/heads/master
2023-04-23T16:29:27.908647
2021-05-12T18:37:48
2021-05-12T18:37:48
349,966,750
0
0
null
null
null
null
UTF-8
Python
false
false
426
py
from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('api/v1/', include('djoser.urls')), path('api/v1/', include('djoser.urls.authtoken')), path('api/v1/', include('apps.client.urls')), path('api/v1/', include('apps.team.urls')), path('api/v1/', include('apps.invoice.urls')), path('api/v1/', include('apps.order.urls')), ]
[ "lyi113@icloud.com" ]
lyi113@icloud.com
d0676c8bf7212cd46f2beb1288e21d745b2f5132
dd3ee2babd81d7d37399fd92f637c5600661b408
/latest_changes/wagtail_hooks.py
b9b2ac9588fa27f8e9aa842568a27b12208540e4
[]
no_license
andsimakov/wagtail-latest-changes
2dc65f6e8212f02be51e3da957ce8804b08054f7
055004fd1e8fa65558bf030e258b82ec7891999c
refs/heads/master
2022-06-17T22:01:05.821551
2020-05-08T10:47:39
2020-05-08T10:47:39
null
0
0
null
null
null
null
UTF-8
Python
false
false
810
py
from django.http import HttpResponse from django.conf.urls import url from django.urls import reverse from wagtail.admin.menu import MenuItem from wagtail.core import hooks from wagtail.core.models import UserPagePermissionsProxy from .views import LatestChangesView @hooks.register('register_admin_urls') def urlconf_time(): return [ url(r'^latest_changes/$', LatestChangesView.as_view(), name='latest_changes'), ] class LatestChangesPagesMenuItem(MenuItem): def is_shown(self, request): return UserPagePermissionsProxy(request.user).can_remove_locks() @hooks.register("register_reports_menu_item") def register_latest_changes_menu_item(): return LatestChangesPagesMenuItem( "Latest changes", reverse("latest_changes"), classnames="icon icon-date", order=100, )
[ "spapas@gmail.com" ]
spapas@gmail.com
27d89f0b545945f22470cab2bcd468a628445cf9
5758ce4043a08512300dd299c11f53678a92266b
/Odev2.py
a3a85e5767015321ec0e251fea273f74e5949d90
[]
no_license
zeydustaoglu/16.Hafta-Odevler
11e5d6e82dcbb38f4208ae188878bbaaeb307e7c
db61e45dba3988b1f05c16b43b68ea8a116adbeb
refs/heads/master
2020-08-06T09:07:23.658967
2019-10-04T23:30:53
2019-10-04T23:30:53
212,917,917
0
0
null
2019-10-04T23:28:49
2019-10-04T23:28:49
null
UTF-8
Python
false
false
1,294
py
# Soru: # İngilizce karakterlerden oluşan bir string var elimizde. # Bu stringe iki işlem uygulayabiliyoruz. # 1. Sonuna küçük harf ekleyebiliyoruz # 2. En sondan bir karakter silebiliyoruz. # Bu işlemi boş stringe uygulayınca boş bir string veriyor. # Bize bir k sayısı integer olarak veriliyor, iki de string, s ve t. # s stringine k sayısı kadar yukarıdaki iki işlem (append, delete) # uygulayarak t stringine dönüştürebilir miyiz tesbit etmemiz lazım. # Oluyorsa Yes, olmuyorsa No yazdırmamız lazım. # Örnekte s=[a,b,c], t=[d,e,f], k=6 # Önce s’nin tüm elemanlarını 3 hamlede siliyoruz, sonra t’nin elemanlarını # 3 hamlede ekliyoruz. Toplam 6 hamlede s’yi t’ye dönüştürmüş oluyoruz. # Complete the appendAndDelete function below. def appendAndDelete(s, t, k): count = 0 if len(s) > len(t): while True: s = s[:-1] count += 1 if s == t: break else: continue elif(len(t) > len(s)): while True: s = s[:-1] count += 1 if s == t: break else: continue print('count:',count) s = input() t = input() k = int(input()) result = appendAndDelete(s, t, k)
[ "50028976+zeydustaoglu@users.noreply.github.com" ]
50028976+zeydustaoglu@users.noreply.github.com
c6d3019ac05982a4660827f65e5cba66b0dac00d
6cde1148cc1ba6c1d704f64603a292440c73caac
/uploadfile_demo/front/views.py
2cb5c2e4bbd24e48b82784ab12be2a6cde0bcde3
[]
no_license
huanshenyi/django_text
09f33be02f0f9da33320af9b82e947d4ebed86ee
536e2eb329faf57edfb30f2299f4ba64592e6b78
refs/heads/master
2020-04-24T14:44:10.707414
2019-03-15T06:08:57
2019-03-15T06:08:57
172,033,822
0
0
null
null
null
null
UTF-8
Python
false
false
1,218
py
from django.shortcuts import render from django.views.generic import View from django.http import HttpResponse from .models import Article from .forms import ArticleForm """from方法""" class IndexView(View): def get(self, request): return render(request, 'index.html') def post(self, request): form = ArticleForm(request.POST, request.FILES) if form.is_valid(): form.save() return HttpResponse("success") else: print(form.errors.get_json_data()) return render(request, 'index.html', context={'form': form}) """一般方法""" # def post(self, request): # myfile = request.FILES.get('myfile') # with open('somefile.txt','wb') as fp: # for chunk in myfile.chunks(): # fp.write(chunk) # return HttpResponse('success') """モデル方法""" # def post(self, request): # title = request.POST.get('title') # content = request.POST.get('content') # file = request.FILES.get('myfile') # Article.objects.create(title=title, content=content, thumbnial=file) # return HttpResponse('success')
[ "noreply@github.com" ]
noreply@github.com
019819dd7bb1f8b0a2f2d4d7a7f3182ebe5a831e
7effd8ab6b78e9492f88203a8260689d045b7ee3
/userbase/migrations/0007_auto_20191217_0030.py
f516d21e3d35ea6b9ecb91c0002c2bcb96ce98d9
[]
no_license
atRobert/EzMoney
b0c04717e0c0ca6289341ba3fdacf14b6248d747
5d85096579bf791082a5feaf84d116fcdc966a6d
refs/heads/master
2022-12-23T19:23:07.104103
2019-12-27T10:17:15
2019-12-27T10:17:15
230,349,214
0
0
null
2022-12-08T01:50:38
2019-12-27T01:06:57
Python
UTF-8
Python
false
false
689
py
# Generated by Django 2.2.5 on 2019-12-17 08:30 import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('userbase', '0006_auto_20191216_2341'), ] operations = [ migrations.AddField( model_name='userprofile', name='goal_info', field=models.BooleanField(default=False), ), migrations.AlterField( model_name='usergoal', name='save_date', field=models.DateField(default=datetime.datetime(2020, 1, 16, 8, 30, 47, 939381, tzinfo=utc)), ), ]
[ "noreply@github.com" ]
noreply@github.com
1dbecf109308e5c666f2f1ddf9db1014bd895919
428bd139f8f51992a9e1382c54caccb1c6a0cf90
/mysqldb .py
8e02d457b639f2a33eeb8cfd0336b12fe481b19f
[]
no_license
EasonHe/mysqlbackup
b773185dcb11ff768b9a2e3aaef1f41bbc3bbc95
595d3b692f00a427a3998edbac4ca5255c1691f9
refs/heads/master
2021-01-21T06:46:41.692728
2017-10-27T05:34:38
2017-10-27T05:34:38
83,280,481
2
0
null
null
null
null
UTF-8
Python
false
false
2,425
py
import os import datetime import time import logging import re from shutil import copy2 user = 'root' passwd='123456' host='127.0.0.1' path='/data/backup/' tm=time.strftime( path +"/%Y-%m-%d.%H",time.localtime(time.time())) logpath = '/data/mydata/' def get_dbname(): cmd = "mysql -u" +user +' ' +"-h" +host +' '+"-p" +passwd+' '+ '-e'+' ' + "'show databases;'" database = os.popen(cmd) sdb=database.read() db=(sdb.split("\n")) db.remove('') db.remove('Database') db.remove('test') return db def log(info): logging.basicConfig(filename='mybak.log', level=logging.INFO) logging.info(info) def create(): # tm=time.strftime( path +"/%Y-%m-%d.%H",time.localtime(time.time())) if os.path.exists(tm) is not True: os.makedirs(tm) #else: # raise Exception('Permission denied or exist') def senmail(c): summ=len(get_dbname()) if c == summ: smail="curl http://172.18.13.191:4000/sender/mail"+' '+"-d" +' '+"'tos=hewei@raiyee.com&subject=mysqlbak&content=backups all successed'" os.system(smail) else: smail="curl http://172.18.13.191:4000/sender/mail"+' '+"-d" +' '+"'tos=hewei@raiyee.com&subject=mysqlbak&content=backups have false'" os.system(samil) def dump(): n=0 for i in get_dbname(): sqlcmd="mysqldump -u" +user +' '+ "-h"+host +' '+"--single-transaction"+' '+"--master-data=2" +' '+'-p'+passwd +' '+i +' ' "|" "gzip" +' ' +'>'+ tm+'/'+i +'_'"$(date +%F).sql.gz" starttime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') ret= os.system(sqlcmd) a=lambda x:'succeed'if ret ==0 else 'false' if a(ret) == 'succeed': n = n+1 stoptime =datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') inf= i+ ''+"at" +' '+ starttime +' '+ "starting"+' '+ "in"+' ' +stoptime+' '+ "bakup finishied"+' '+a(ret) log(inf) return n def flushlog(): cmdf="mysqladmin -u"+user +' ' +"-h"+host +' ' + "-p"+passwd + ' ' +"flush-logs" os.system(cmdf) def loadfile(logpath): return os.listdir(logpath) def cpfile(): m=[] for x in loadfile(logpath): regex=r'master-bin\..*' if re.match(regex,x): m.append(x) return m def action(): for i in cpfile(): path=logpath+i copy2(path,tm) if __name__ == '__main__': create() senmail(dump()) flushlog() action()
[ "noreply@github.com" ]
noreply@github.com
8c6a6c0b733bbdee80fb15a882a8ffc8e61d0f9b
1014136dc5a8fce4b1a17765930ee058085bf943
/jobs/migrations/0001_initial.py
e56180181c57c744269d0af958610dda327c2f64
[]
no_license
xjtuwj/hire-demo
732382f07e8a23515303fca7ecd22922f315b871
c733213c6602de5a2f7ebe9e989c3192ddcbad20
refs/heads/master
2023-01-13T22:18:20.029360
2020-11-16T13:20:00
2020-11-16T13:20:00
313,308,762
0
0
null
null
null
null
UTF-8
Python
false
false
1,436
py
# Generated by Django 3.1.1 on 2020-10-19 14:41 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Job', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('job_type', models.SmallIntegerField(choices=[(0, '运营类'), (1, '技术类'), (2, '设计类')], verbose_name='职位类型')), ('job_name', models.TextField(max_length=200)), ('job_city', models.SmallIntegerField(choices=[(0, '北京'), (1, '上海'), (2, '广州')], verbose_name='地点')), ('job_responsibility', models.TextField(max_length=1024, verbose_name='职位描述')), ('job_requirements', models.TextField(max_length=1024, verbose_name='职位要求')), ('created_at', models.DateTimeField(verbose_name='创建时间')), ('modified_at', models.DateTimeField(verbose_name='修改时间')), ('creator', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='创建人')), ], ), ]
[ "2473494870@qq.com" ]
2473494870@qq.com
86a5ee843327dded5b47c503b3349ce80300d1e5
7f2e43b9327545781a09c8acc94e80c1ece4fc17
/web_app/application.py
4414bf827d2fb2bc552f25ad338ab383099b1706
[]
no_license
macaodha/geo_prior
336bc34aece9dd609919d83564f84bc6adb0932d
b0c761712a0aeced56eba86dd19eda657fbe895a
refs/heads/master
2023-07-30T04:11:08.971867
2022-04-11T18:23:15
2022-04-11T18:23:15
202,809,348
23
8
null
2023-07-22T13:46:52
2019-08-16T22:58:33
Python
UTF-8
Python
false
false
4,254
py
from __future__ import print_function from flask import Flask, render_template, request, make_response, jsonify from io import BytesIO import base64 from PIL import Image import numpy as np import json import torch import config import sys sys.path.append('../') import geo_prior.grid_predictor as grid import geo_prior.models as models application = Flask(__name__) application.secret_key = config.SECRET_KEY # load class names with open(config.CLASS_META_FILE) as da: class_meta_data = json.load(da) class_names = [cc['our_name'] for cc in class_meta_data] class_names_joint = [cc['our_name'] + ' - ' + cc['preferred_common_name'] for cc in class_meta_data] default_class_index = class_names.index(config.DEFAULT_CLASS) # load background mask mask = np.load(config.MASK_PATH).astype(np.int) mask_lines = (np.gradient(mask)[0]**2 + np.gradient(mask)[1]**2) mask_lines[mask_lines > 0.0] = 1.0 mask_lines = 1.0 - mask_lines mask = mask.astype(np.uint8) # create placeholder image that will be displayed blank_im = np.zeros((mask.shape[0], mask.shape[1], 3), dtype=np.uint8) for cc in range(3): blank_im[:,:,cc] = (255*mask_lines).astype(np.uint8) # load model net_params = torch.load(config.MODEL_PATH, map_location='cpu') params = net_params['params'] params['device'] = 'cpu' model = models.FCNet(params['num_feats'], params['num_classes'], params['num_filts'], params['num_users']).to(params['device']) model.load_state_dict(net_params['state_dict']) model.eval() # grid predictor - for making dense predictions for each lon/lat location gp = grid.GridPredictor(mask, params, mask_only_pred=True) # generate features print('generating location features') feats = [] for time_step in np.linspace(0,1,config.NUM_TIME_STEPS+1)[:-1]: feats.append(gp.dense_prediction_masked_feats(model, time_step)) print('location features generated') def create_images(index_of_interest): images = [] for tt, time_step in enumerate(np.linspace(0,1,config.NUM_TIME_STEPS+1)[:-1]): with torch.no_grad(): pred = model.eval_single_class(feats[tt], index_of_interest) pred = torch.sigmoid(pred).data.cpu().numpy() # copy the prediction into an image for display im = blank_im.copy() im[:,:,0] = (255*(np.clip(mask_lines-gp.create_full_output(pred), 0, 1))).astype(np.uint8) # encode the image im_output = BytesIO() Image.fromarray(im).save(im_output, 'PNG') #Image.fromarray(im).save(im_output, "JPEG", quality=config.JPEG_QUALITY) im_data = base64.b64encode(im_output.getvalue()).decode('utf-8') im_output.close() images.append(im_data) return images @application.route('/') @application.route('/index') @application.route('/index', methods=['POST']) def index(): if request.method == 'POST': if request.form['submit_btn'] == 'random': index_of_interest = np.random.randint(len(class_names)) else: index_of_interest = int(request.form['class_of_interest']) else: index_of_interest = default_class_index class_data = class_meta_data[index_of_interest] print(class_data['our_id'], class_data['our_name']) # generate distribution maps for the species of interest images = create_images(index_of_interest) print('images created\n') return render_template('index.html', images=images, time_steps_txt=config.MONTHS, class_data=class_data, im_height=mask.shape[0]) @application.route('/autocomplete', methods=['GET']) def autocomplete(): query = request.args.get('query').lower() print(query) results = [(cc, class_names_joint[cc]) for cc in range(len(class_names_joint)) if query in class_names_joint[cc].lower()] num_return = min(len(results), config.MAX_NUM_QUERIES_RETURNED) matching_classes = [] for cc in range(num_return): matching_classes.append({'label':results[cc][1], 'idx':results[cc][0]}) return jsonify(matching_classes=matching_classes) if __name__ == '__main__': application.run(host='127.0.0.1', port=8000) #application.run()
[ "macaodha@gmail.com" ]
macaodha@gmail.com
3d10116efc8b712d664f8ab06348e03b4fbdd0bb
7acc83bfd833846f9246b47b7dc97bb7b780b3e6
/manage.py
9474e9413bf22b2645fb27ea6a9d9fb5d2503ba0
[]
no_license
pll513/Outsource_1
2602b28b4d525af978eccda3729b86ebbb528e74
20a0c439d678238a89df634fc326ed10bfb3a83d
refs/heads/master
2020-03-18T20:58:39.024994
2018-05-29T06:23:22
2018-05-29T06:23:22
135,250,469
1
0
null
null
null
null
UTF-8
Python
false
false
330
py
#! /usr/bin/env python3 import os import app import flask_script app = app.create_app('default') manager = flask_script.Manager(app) def make_shell_context(): return dict(app=app, db=app.db) manager.add_command("shell", flask_script.Shell(make_context=make_shell_context)) if __name__ == '__main__': manager.run()
[ "paf32@qq.com" ]
paf32@qq.com
06bbd98dbee5690b6588d3c7839bfa81580f468a
2235298f718d8fe1b6de38fc4b4e31dc85442b27
/CharacterSelection.py
0e151e1d056cf42b366face620bb837da1b34076
[]
no_license
qminh3g/NMCNTT-1
428c6476b4ccd3b2e32692f9374408a6a12f2441
22600dbd19ce973e44bb5123e94bc07649889737
refs/heads/main
2023-01-25T02:30:08.027470
2020-12-08T04:18:09
2020-12-08T04:18:09
316,904,099
0
0
null
2020-12-08T04:18:10
2020-11-29T08:08:04
Python
UTF-8
Python
false
false
1,034
py
from ImageAssets import * from StartRacing import * # Write code to get player name from here playerName = 'Noobmaster69' def TraceCharacterSelection(x, y): for i in range(6): CharList[i].speed(0) CharList[i].hideturtle() CharList[i].penup() CharList[i].shape(avatarsChose[i]) CharList[i].goto(x, y) CharList[i].showturtle() x = x + 100 # This whole block of code is used to assign playerName to Character's name, not efficient but it works # Once Character is selected it starts the game def PlayerAssign0(x, y): NameList[0] = playerName StartGame() def PlayerAssign1(x, y): NameList[1] = playerName StartGame() def PlayerAssign2(x, y): NameList[2] = playerName StartGame() def PlayerAssign3(x, y): NameList[3] = playerName StartGame() def PlayerAssign4(x, y): NameList[4] = playerName StartGame() def PlayerAssign5(x, y): NameList[5] = playerName StartGame()
[ "noreply@github.com" ]
noreply@github.com
0a67f3ec6d29543c7ac96382b84ac6eb04f15c82
26d34b969a073cf490e5879af719f94c9cb8eb99
/im2txt_attend/ops/image_embedding_test.py
295f42c548513bf785da020b09131ccd1bb1c7f3
[ "MIT" ]
permissive
brandontrabucco/im2txt_attend
dd526a27c60a460a959903a29ef8906a40da79f7
18305e14cd60c2e990bb9335968d91fa7857c2dc
refs/heads/master
2020-03-21T13:56:55.882355
2018-06-25T18:25:31
2018-06-25T18:25:31
137,283,116
0
0
null
null
null
null
UTF-8
Python
false
false
5,557
py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Tests for tensorflow_models.im2txt.ops.image_embedding.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from im2txt_attend.ops import image_embedding class InceptionV3Test(tf.test.TestCase): def setUp(self): super(InceptionV3Test, self).setUp() batch_size = 4 height = 299 width = 299 num_channels = 3 self._images = tf.placeholder(tf.float32, [batch_size, height, width, num_channels]) self._batch_size = batch_size def _countInceptionParameters(self): """Counts the number of parameters in the inception model at top scope.""" counter = {} for v in tf.global_variables(): name_tokens = v.op.name.split("/") if name_tokens[0] == "InceptionV3": name = "InceptionV3/" + name_tokens[1] num_params = v.get_shape().num_elements() assert num_params counter[name] = counter.get(name, 0) + num_params return counter def _verifyParameterCounts(self): """Verifies the number of parameters in the inception model.""" param_counts = self._countInceptionParameters() expected_param_counts = { "InceptionV3/Conv2d_1a_3x3": 960, "InceptionV3/Conv2d_2a_3x3": 9312, "InceptionV3/Conv2d_2b_3x3": 18624, "InceptionV3/Conv2d_3b_1x1": 5360, "InceptionV3/Conv2d_4a_3x3": 138816, "InceptionV3/Mixed_5b": 256368, "InceptionV3/Mixed_5c": 277968, "InceptionV3/Mixed_5d": 285648, "InceptionV3/Mixed_6a": 1153920, "InceptionV3/Mixed_6b": 1298944, "InceptionV3/Mixed_6c": 1692736, "InceptionV3/Mixed_6d": 1692736, "InceptionV3/Mixed_6e": 2143872, "InceptionV3/Mixed_7a": 1699584, "InceptionV3/Mixed_7b": 5047872, "InceptionV3/Mixed_7c": 6080064, } self.assertDictEqual(expected_param_counts, param_counts) def _assertCollectionSize(self, expected_size, collection): actual_size = len(tf.get_collection(collection)) if expected_size != actual_size: self.fail("Found %d items in collection %s (expected %d)." % (actual_size, collection, expected_size)) def testTrainableTrueIsTrainingTrue(self): embeddings = image_embedding.inception_v3( self._images, trainable=True, is_training=True) self.assertEqual([self._batch_size, 2048], embeddings.get_shape().as_list()) self._verifyParameterCounts() self._assertCollectionSize(376, tf.GraphKeys.GLOBAL_VARIABLES) self._assertCollectionSize(188, tf.GraphKeys.TRAINABLE_VARIABLES) self._assertCollectionSize(188, tf.GraphKeys.UPDATE_OPS) self._assertCollectionSize(94, tf.GraphKeys.REGULARIZATION_LOSSES) self._assertCollectionSize(0, tf.GraphKeys.LOSSES) self._assertCollectionSize(23, tf.GraphKeys.SUMMARIES) def testTrainableTrueIsTrainingFalse(self): embeddings = image_embedding.inception_v3( self._images, trainable=True, is_training=False) self.assertEqual([self._batch_size, 2048], embeddings.get_shape().as_list()) self._verifyParameterCounts() self._assertCollectionSize(376, tf.GraphKeys.GLOBAL_VARIABLES) self._assertCollectionSize(188, tf.GraphKeys.TRAINABLE_VARIABLES) self._assertCollectionSize(0, tf.GraphKeys.UPDATE_OPS) self._assertCollectionSize(94, tf.GraphKeys.REGULARIZATION_LOSSES) self._assertCollectionSize(0, tf.GraphKeys.LOSSES) self._assertCollectionSize(23, tf.GraphKeys.SUMMARIES) def testTrainableFalseIsTrainingTrue(self): embeddings = image_embedding.inception_v3( self._images, trainable=False, is_training=True) self.assertEqual([self._batch_size, 2048], embeddings.get_shape().as_list()) self._verifyParameterCounts() self._assertCollectionSize(376, tf.GraphKeys.GLOBAL_VARIABLES) self._assertCollectionSize(0, tf.GraphKeys.TRAINABLE_VARIABLES) self._assertCollectionSize(0, tf.GraphKeys.UPDATE_OPS) self._assertCollectionSize(0, tf.GraphKeys.REGULARIZATION_LOSSES) self._assertCollectionSize(0, tf.GraphKeys.LOSSES) self._assertCollectionSize(23, tf.GraphKeys.SUMMARIES) def testTrainableFalseIsTrainingFalse(self): embeddings = image_embedding.inception_v3( self._images, trainable=False, is_training=False) self.assertEqual([self._batch_size, 2048], embeddings.get_shape().as_list()) self._verifyParameterCounts() self._assertCollectionSize(376, tf.GraphKeys.GLOBAL_VARIABLES) self._assertCollectionSize(0, tf.GraphKeys.TRAINABLE_VARIABLES) self._assertCollectionSize(0, tf.GraphKeys.UPDATE_OPS) self._assertCollectionSize(0, tf.GraphKeys.REGULARIZATION_LOSSES) self._assertCollectionSize(0, tf.GraphKeys.LOSSES) self._assertCollectionSize(23, tf.GraphKeys.SUMMARIES) if __name__ == "__main__": tf.test.main()
[ "trabucco@br018.pvt.bridges.psc.edu" ]
trabucco@br018.pvt.bridges.psc.edu
8bc8e564f83521bfbdbfa7acd4722bc16fdd09b3
feb642a2141e5f52495e05ee186eb58032267f88
/Python/Basics/Day2/For Loop/for_loop_example5.py
a6efeb9ff2593c29734ec819886ca54d3ee8d6f3
[]
no_license
arpitpardesi/Advance-Analytics
51a065122725ef8f77bd61b974528f080acd9662
121a1211a0e6a2f065323c1b93c9d4ec510e1663
refs/heads/master
2022-12-23T20:11:59.689926
2020-09-27T13:53:19
2020-09-27T13:53:19
283,406,449
1
0
null
null
null
null
UTF-8
Python
false
false
421
py
""" Write a python program which take an input number from user, say n=3 Then, generate two lists a and b. where, a holds the squares of integers 0 to n-1; i.e if n is equal to 3, then a =[0, 1, 4]. And list b holds the cubes of integers 0 to n-1, so if n is equal to 3, then the list b = [0, 1, 8]. """ a=[] b=[] n = int(input("Enter: ")) for i in range(0,n): a.append(i**2) b.append(i**3) print(a) print(b)
[ "arpit.pardesi6@gmail.com" ]
arpit.pardesi6@gmail.com
ee5701690adab5c060d318ddf788e0bad0a28373
e859cae07ce14001ffb64a56e9b5d6713e91a0dc
/Build/Linux/SConstruct
3aa260a5fd99af18239ad50e02310656a17947fc
[ "MIT" ]
permissive
louishp/radeon_compute_profiler
f25a92067420e45da88217f3d7338c1e747f4529
daa40a72d73175b7e94c0a8fcf91c20ac55edec3
refs/heads/master
2022-10-28T21:42:03.517195
2019-10-11T18:17:02
2019-10-11T18:17:02
null
0
0
null
null
null
null
UTF-8
Python
false
false
4,554
# # CodeXL SConstruct Template # import os from CXL_init import * ################################################### # Initialize CXL command line variables # # Note: DO NOT MODIFY THIS SECTION. Please see CXL_init. # CXL_vars = Variables(None) # Initial CXL_vars scons construction variables initCXLVars(CXL_vars) ################################################### # # Additional SConstruct variables can be added here # # Note: * These variables can be configured from the commandline arguments. # * These will be included in the help "scons -h". # * Customizable # // Add more variables here ################################################### # Initialize CXL_env # # Note: DO NOT MODIFY THIS SECTION. Please see CXL_init. # CXL_env = Environment( variables = CXL_vars, ENV = {'PATH':os.environ['PATH']}) # CXL build initialization initCXLBuild (CXL_env) ################################################### # Initialize External library stuff # # Note: * This section is customizable. # initGtk (CXL_env) initTinyXml (CXL_env) #if (CXL_env['CXL_arch'] != 'x86'): # initQt4 (CXL_env) ################################################### # Specify Depe!h!,<Mouse>C!k!, # # Note: This section is customizable. # CXL_lib_common_amd_deps = ( ) initCommonLibAmd (CXL_env, CXL_lib_common_amd_deps) #if (CXL_env['CXL_arch'] != 'x86'): ################################################### # Any custom builders for this project # # UIC, MOC, RCC (for Qt) # Custom ones are required because the default Qt ones are for Qt3, and # there are no Qt4 ones which come with the scons rpm. # rgorton note (7-Aug-2012): # These need to be here - if they are in the CXL_init.py script, the values # of SOURCES and TARGET are null, I think because we are outside of scons # at that point. Spent multiple hours puzzling over that. # #uic_build = Builder(action = CXL_env['CXL_uic_tool'] + ' ${SOURCES[0]} -o $TARGET', # prefix='ui_', suffix='.h', src_suffix='.ui') #CXL_env.Append(BUILDERS = {'UicBld' : uic_build}) #moc_build = Builder(action = CXL_env['CXL_moc_tool'] + ' ${SOURCES[0]} -o $TARGET', # prefix='moc_', suffix='.cpp', src_suffix='.h') #CXL_env.Append(BUILDERS = {'MocBld' : moc_build}) #rcc_build = Builder(action = CXL_env['CXL_rcc_tool'] + ' ${SOURCES[0]} -o $TARGET', # prefix='rcc_', suffix='.cpp', src_suffix='.qrc') #CXL_env.Append(BUILDERS = {'RccBld' : rcc_build}) # # The documentation is generated from Doxygen # We do not have an effective way to use the Doxygen builder tool, so # we will sort of spoof it, and always run it # doxy_build = Builder(action = CXL_env['CXL_doxy_tool'] + ' ${SOURCES[0]}') # CXL_env.Append(BUILDERS = {'DoxyBld' : doxy_build}) ############################################################## # Print out all environment variables of CXL_env if verbose is specified if CXL_env['CXL_build_verbose'] != 0 : print CXL_env.Dump() ############################################################## # Export the CXL_env to all SConscripts Export( 'CXL_env ') ############################################################## # NOTE [Richard Gorton] : # Specifically express _dynamic_ dependencies here. It is possible to have # the individual components do this, but the relevant context would need to be # exported globally, and then consumed. That is, we would need to export the # BaseTools_Obj, via a global name, and then the downstream SCons files would # need to import it and write the dependency rules. # There is no need to write dependency rules for items which solely use the # promotion model. # No dynamic dependencies at all ############################################ # # Framework Section # FrameworkComponents = [] BaseTools_Obj = SConscript('../../../Common/Src/AMDTBaseTools/SConscript') FrameworkComponents += BaseTools_Obj #if (CXL_env['CXL_arch'] != 'x86'): # Assertion_Obj = SConscript('../../../Common/Src/AMDTAssertionHandlers/SConscript') # FrameworkComponents += Assertion_Obj OSWrappers_Obj = SConscript('../../../Common/Src/AMDTOSWrappers/SConscript') CXL_env.Depends(OSWrappers_Obj, BaseTools_Obj) FrameworkComponents += OSWrappers_Obj ActivityLogger_Obj = SConscript('../../../Common/Src/AMDTActivityLogger/SConscript') CXL_env.Depends(ActivityLogger_Obj, OSWrappers_Obj + BaseTools_Obj) FrameworkComponents += ActivityLogger_Obj CodeXL_Full = \ FrameworkComponents Default(CodeXL_Full) Alias( target='Framework' , source=(FrameworkComponents)) Alias( target='install' , source=(CodeXL_Full))
[ "christopher.hesik@amd.com" ]
christopher.hesik@amd.com
db250e02f55d9de447b572705b0b25888309a3e2
669aa5b4e90e2942e5dfe671ab1b0df42c1d1f84
/.vscode/kvad2.py
0d54839f32782b3609c28a1350e2550d650d14d4
[]
no_license
POTATIIS/prog1-ovn
7a7fd03bc784113dd2b13bef819d0c24abd44da7
c8960682fc6224010dbbdc859f093e99f359c8b7
refs/heads/master
2022-12-20T11:47:25.017734
2020-10-12T11:35:59
2020-10-12T11:35:59
291,701,305
0
0
null
null
null
null
UTF-8
Python
false
false
163
py
svar = input ('skriv ett tal: ') x = float(svar) y = x * x print (f'talet i kvadrat är{y:400.2f} ') i = 19 print(f'resultat:{i}') j = 107 print(f'resultat:{j:5}')
[ "alexander.martinsson@elev.ga.ntig.se" ]
alexander.martinsson@elev.ga.ntig.se
856bb58fa3a04845c0db86879d891f4d3b06777e
4857fc1590d9f1ef8ce5f652912762a729cdd24b
/StinoStarter.py
92f4c07e4482e3079cc817fd187f4ea86cfa0560
[ "MIT" ]
permissive
remcoder/Stino
2e54884c60bf0f29ce3427fca9e26be4b28734e0
728ad367383ea2136e32863c54d91e214e8ef19b
refs/heads/master
2021-01-18T04:43:24.743162
2013-09-15T09:40:06
2013-09-15T09:40:06
null
0
0
null
null
null
null
UTF-8
Python
false
false
22,887
py
#-*- coding: utf-8 -*- # StinoStarter.py import os import sublime import sublime_plugin st_version = int(sublime.version()) if st_version < 3000: import app else: from . import app class SketchListener(sublime_plugin.EventListener): def on_activated(self, view): pre_active_sketch = app.constant.global_settings.get('active_sketch', '') if not app.sketch.isInEditor(view): return app.active_file.setView(view) active_sketch = app.active_file.getSketchName() app.constant.global_settings.set('active_sketch', active_sketch) if app.active_file.isSrcFile(): app.active_serial_listener.start() temp_global = app.constant.global_settings.get('temp_global', False) if temp_global: app.constant.global_settings.set('global_settings', False) app.constant.global_settings.set('temp_global', False) global_settings = app.constant.global_settings.get('global_settings', True) if not global_settings: if not (active_sketch == pre_active_sketch): folder = app.active_file.getFolder() app.constant.sketch_settings.changeFolder(folder) app.arduino_info.refresh() app.main_menu.refresh() else: app.active_serial_listener.stop() global_settings = app.constant.global_settings.get('global_settings', True) if not global_settings: app.constant.global_settings.set('global_settings', True) app.constant.global_settings.set('temp_global', True) folder = app.constant.stino_root app.constant.sketch_settings.changeFolder(folder) app.arduino_info.refresh() app.main_menu.refresh() def on_close(self, view): if app.serial_monitor.isMonitorView(view): name = view.name() serial_port = name.split('-')[1].strip() if serial_port in app.constant.serial_in_use_list: cur_serial_monitor = app.constant.serial_monitor_dict[serial_port] cur_serial_monitor.stop() app.constant.serial_in_use_list.remove(serial_port) class ShowArduinoMenuCommand(sublime_plugin.WindowCommand): def run(self): show_arduino_menu = not app.constant.global_settings.get('show_arduino_menu', True) app.constant.global_settings.set('show_arduino_menu', show_arduino_menu) app.main_menu.refresh() def is_checked(self): state = app.constant.global_settings.get('show_arduino_menu', True) return state class NewSketchCommand(sublime_plugin.WindowCommand): def run(self): caption = app.i18n.translate('Name for New Sketch') self.window.show_input_panel(caption, '', self.on_done, None, None) def on_done(self, input_text): sketch_name = input_text if sketch_name: sketch_file = app.base.newSketch(sketch_name) print(sketch_file) if sketch_file: self.window.open_file(sketch_file) app.arduino_info.refresh() app.main_menu.refresh() else: app.output_console.printText('A sketch (or folder) named "%s" already exists. Could not create the sketch.\n' % sketch_name) class OpenSketchCommand(sublime_plugin.WindowCommand): def run(self, folder): app.sketch.openSketchFolder(folder) class ImportLibraryCommand(sublime_plugin.WindowCommand): def run(self, folder): view = app.active_file.getView() self.window.active_view().run_command('save') app.sketch.importLibrary(view, folder) def is_enabled(self): state = False if app.active_file.isSrcFile(): state = True return state class ShowSketchFolderCommand(sublime_plugin.WindowCommand): def run(self): folder = app.active_file.getFolder() url = 'file://' + folder sublime.run_command('open_url', {'url': url}) def is_enabled(self): state = False if app.active_file.isSrcFile(): state = True return state class SetExtraFlagCommand(sublime_plugin.WindowCommand): def run(self): extra_flag = app.constant.sketch_settings.get('extra_flag', '') caption = app.i18n.translate('Extra compilation flags:') self.window.show_input_panel(caption, extra_flag, self.on_done, None, None) def on_done(self, input_text): extra_flag = input_text stino.constant.sketch_settings.set('extra_flag', extra_flags) class CompileSketchCommand(sublime_plugin.WindowCommand): def run(self): self.window.active_view().run_command('save') cur_folder = app.active_file.getFolder() cur_project = app.sketch.Project(cur_folder) args = app.compiler.Args(cur_project, app.arduino_info) compiler = app.compiler.Compiler(app.arduino_info, cur_project, args) compiler.run() def is_enabled(self): state = False if app.active_file.isSrcFile(): state = True return state class UploadSketchCommand(sublime_plugin.WindowCommand): def run(self): self.window.active_view().run_command('save') cur_folder = app.active_file.getFolder() cur_project = app.sketch.Project(cur_folder) args = app.compiler.Args(cur_project, app.arduino_info) compiler = app.compiler.Compiler(app.arduino_info, cur_project, args) compiler.run() uploader = app.uploader.Uploader(args, compiler) uploader.run() def is_enabled(self): state = False if app.active_file.isSrcFile(): state = True return state class UploadUsingProgrammerCommand(sublime_plugin.WindowCommand): def run(self): self.window.active_view().run_command('save') cur_folder = app.active_file.getFolder() cur_project = app.sketch.Project(cur_folder) args = app.compiler.Args(cur_project, app.arduino_info) compiler = app.compiler.Compiler(app.arduino_info, cur_project, args) compiler.run() uploader = app.uploader.Uploader(args, compiler, mode = 'programmer') uploader.run() def is_enabled(self): state = False if app.active_file.isSrcFile(): platform_list = app.arduino_info.getPlatformList() platform_id = app.constant.sketch_settings.get('platform', -1) if (platform_id > 0) and (platform_id < len(platform_list)): platform = platform_list[platform_id] programmer_list = platform.getProgrammerList() if programmer_list: state = True return state class ChooseBoardCommand(sublime_plugin.WindowCommand): def run(self, platform, board): app.constant.sketch_settings.set('platform', platform) app.constant.sketch_settings.set('board', board) app.main_menu.refresh() app.constant.sketch_settings.set('full_compilation', True) def is_checked(self, platform, board): state = False chosen_platform = app.constant.sketch_settings.get('platform', -1) chosen_board = app.constant.sketch_settings.get('board', -1) if platform == chosen_platform and board == chosen_board: state = True return state class ChooseBoardOptionCommand(sublime_plugin.WindowCommand): def run(self, board_option, board_option_item): has_setted = False chosen_platform = app.constant.sketch_settings.get('platform') chosen_board = app.constant.sketch_settings.get('board') board_id = str(chosen_platform) + '.' + str(chosen_board) board_option_settings = app.constant.sketch_settings.get('board_option', {}) if board_id in board_option_settings: cur_board_option_setting = board_option_settings[board_id] if board_option < len(cur_board_option_setting): has_setted = True if not has_setted: platform_list = app.arduino_info.getPlatformList() cur_platform = platform_list[chosen_platform] board_list = cur_platform.getBoardList() cur_board = board_list[chosen_board] board_option_list = cur_board.getOptionList() board_option_list_number = len(board_option_list) cur_board_option_setting = [] for i in range(board_option_list_number): cur_board_option_setting.append(0) cur_board_option_setting[board_option] = board_option_item board_option_settings[board_id] = cur_board_option_setting app.constant.sketch_settings.set('board_option', board_option_settings) app.constant.sketch_settings.set('full_compilation', True) def is_checked(self, board_option, board_option_item): state = False chosen_platform = app.constant.sketch_settings.get('platform', -1) chosen_board = app.constant.sketch_settings.get('board', -1) board_id = str(chosen_platform) + '.' + str(chosen_board) board_option_settings = app.constant.sketch_settings.get('board_option', {}) if board_id in board_option_settings: cur_board_option_setting = board_option_settings[board_id] if board_option < len(cur_board_option_setting): chosen_board_option_item = cur_board_option_setting[board_option] if board_option_item == chosen_board_option_item: state = True return state class ChooseProgrammerCommand(sublime_plugin.WindowCommand): def run(self, platform, programmer): programmer_settings = app.constant.sketch_settings.get('programmer', {}) programmer_settings[str(platform)] = programmer app.constant.sketch_settings.set('programmer', programmer_settings) def is_checked(self, platform, programmer): state = False programmer_settings = app.constant.sketch_settings.get('programmer', {}) if str(platform) in programmer_settings: chosen_programmer = programmer_settings[str(platform)] if programmer == chosen_programmer: state = True return state class BurnBootloaderCommand(sublime_plugin.WindowCommand): def run(self): cur_folder = app.active_file.getFolder() cur_project = app.sketch.Project(cur_folder) args = app.compiler.Args(cur_project, app.arduino_info) bootloader = app.uploader.Bootloader(cur_project, args) bootloader.burn() def is_enabled(self): state = False if app.active_file.isSrcFile(): state = True return state class ChooseSerialPortCommand(sublime_plugin.WindowCommand): def run(self, serial_port): app.constant.sketch_settings.set('serial_port', serial_port) def is_checked(self, serial_port): state = False chosen_serial_port = app.constant.sketch_settings.get('serial_port', -1) if serial_port == chosen_serial_port: state = True return state class StartSerialMonitorCommand(sublime_plugin.WindowCommand): def run(self): serial_port_id = app.constant.sketch_settings.get('serial_port', 0) serial_port_list = app.serial.getSerialPortList() serial_port = serial_port_list[serial_port_id] if serial_port in app.constant.serial_in_use_list: cur_serial_monitor = app.constant.serial_monitor_dict[serial_port] else: cur_serial_monitor = app.serial_monitor.SerialMonitor(serial_port) app.constant.serial_in_use_list.append(serial_port) app.constant.serial_monitor_dict[serial_port] = cur_serial_monitor cur_serial_monitor.start() self.window.run_command('send_serial_text') def is_enabled(self): state = False serial_port_list = app.serial.getSerialPortList() if serial_port_list: serial_port_id = app.constant.sketch_settings.get('serial_port', 0) serial_port = serial_port_list[serial_port_id] if serial_port in app.constant.serial_in_use_list: cur_serial_monitor = app.constant.serial_monitor_dict[serial_port] if not cur_serial_monitor.isRunning(): state = True else: state = True return state class StopSerialMonitorCommand(sublime_plugin.WindowCommand): def run(self): serial_port_id = app.constant.sketch_settings.get('serial_port', 0) serial_port_list = app.serial.getSerialPortList() serial_port = serial_port_list[serial_port_id] cur_serial_monitor = app.constant.serial_monitor_dict[serial_port] cur_serial_monitor.stop() def is_enabled(self): state = False serial_port_list = app.serial.getSerialPortList() if serial_port_list: serial_port_id = app.constant.sketch_settings.get('serial_port', 0) serial_port = serial_port_list[serial_port_id] if serial_port in app.constant.serial_in_use_list: cur_serial_monitor = app.constant.serial_monitor_dict[serial_port] if cur_serial_monitor.isRunning(): state = True return state class SendSerialTextCommand(sublime_plugin.WindowCommand): def run(self): self.caption = 'Send' self.window.show_input_panel(self.caption, '', self.on_done, None, None) def on_done(self, input_text): serial_port_id = app.constant.sketch_settings.get('serial_port', 0) serial_port_list = app.serial.getSerialPortList() serial_port = serial_port_list[serial_port_id] cur_serial_monitor = app.constant.serial_monitor_dict[serial_port] cur_serial_monitor.send(input_text) self.window.show_input_panel(self.caption, '', self.on_done, None, None) def is_enabled(self): state = False serial_port_list = app.serial.getSerialPortList() if serial_port_list: serial_port_id = app.constant.sketch_settings.get('serial_port', 0) serial_port = serial_port_list[serial_port_id] if serial_port in app.constant.serial_in_use_list: cur_serial_monitor = app.constant.serial_monitor_dict[serial_port] if cur_serial_monitor.isRunning(): state = True return state class ChooseLineEndingCommand(sublime_plugin.WindowCommand): def run(self, line_ending): app.constant.sketch_settings.set('line_ending', line_ending) def is_checked(self, line_ending): state = False chosen_line_ending = app.constant.sketch_settings.get('line_ending', -1) if line_ending == chosen_line_ending: state = True return state class ChooseBaudrateCommand(sublime_plugin.WindowCommand): def run(self, baudrate): app.constant.sketch_settings.set('baudrate', baudrate) def is_checked(self, baudrate): state = False chosen_baudrate = app.constant.sketch_settings.get('baudrate', -1) if baudrate == chosen_baudrate: state = True return state def is_enabled(self): state = True serial_port_list = app.serial.getSerialPortList() if serial_port_list: serial_port_id = app.constant.sketch_settings.get('serial_port', 0) serial_port = serial_port_list[serial_port_id] if serial_port in app.constant.serial_in_use_list: cur_serial_monitor = app.constant.serial_monitor_dict[serial_port] if cur_serial_monitor.isRunning(): state = False return state class AutoFormatCommand(sublime_plugin.WindowCommand): def run(self): self.window.run_command('reindent', {'single_line': False}) def is_enabled(self): state = False if app.active_file.isSrcFile(): state = True return state class ArchiveSketchCommand(sublime_plugin.WindowCommand): def run(self): root_list = app.fileutil.getOSRootList() self.top_folder_list = root_list self.folder_list = self.top_folder_list self.level = 0 self.show_panel() def show_panel(self): folder_name_list = app.fileutil.getFolderNameList(self.folder_list) sublime.set_timeout(lambda: self.window.show_quick_panel(folder_name_list, self.on_done), 10) def on_done(self, index): is_finished = False if index == -1: return if self.level != 0 and index == 0: chosen_folder = self.folder_list[index] chosen_folder = chosen_folder.split('(')[1] chosen_folder = chosen_folder[:-1] source_folder = app.active_file.getFolder() sketch_name = app.active_file.getSketchName() zip_file_name = sketch_name + '.zip' zip_file = os.path.join(chosen_folder, zip_file_name) return_code = app.tools.archiveSketch(source_folder, zip_file) if return_code == 0: app.output_console.printText(app.i18n.translate('Writing {0} done.\n', [zip_file])) else: app.output_console.printText(app.i18n.translate('Writing {0} failed.\n', [zip_file])) else: (self.folder_list, self.level) = app.fileutil.enterNextLevel(index, self.folder_list, self.level, self.top_folder_list) self.show_panel() def is_enabled(self): state = False if app.active_file.isSrcFile(): state = True return state class ChooseArduinoFolderCommand(sublime_plugin.WindowCommand): def run(self): root_list = app.fileutil.getOSRootList() self.top_folder_list = root_list self.folder_list = self.top_folder_list self.level = 0 self.show_panel() def show_panel(self): folder_name_list = app.fileutil.getFolderNameList(self.folder_list) sublime.set_timeout(lambda: self.window.show_quick_panel(folder_name_list, self.on_done), 10) def on_done(self, index): is_finished = False if index == -1: return chosen_folder = self.folder_list[index] if app.base.isArduinoFolder(chosen_folder): app.output_console.printText(app.i18n.translate('Arduino Application is found at {0}.\n', [chosen_folder])) app.constant.sketch_settings.set('arduino_folder', chosen_folder) app.arduino_info.refresh() app.main_menu.refresh() app.output_console.printText('Arduino %s.\n' % app.arduino_info.getVersionText()) app.constant.sketch_settings.set('full_compilation', True) else: (self.folder_list, self.level) = app.fileutil.enterNextLevel(index, self.folder_list, self.level, self.top_folder_list) self.show_panel() class ChangeSketchbookFolderCommand(sublime_plugin.WindowCommand): def run(self): root_list = app.fileutil.getOSRootList() self.top_folder_list = root_list self.folder_list = self.top_folder_list self.level = 0 self.show_panel() def show_panel(self): folder_name_list = app.fileutil.getFolderNameList(self.folder_list) sublime.set_timeout(lambda: self.window.show_quick_panel(folder_name_list, self.on_done), 10) def on_done(self, index): is_finished = False if index == -1: return if self.level != 0 and index == 0: chosen_folder = self.folder_list[index] chosen_folder = chosen_folder.split('(')[1] chosen_folder = chosen_folder[:-1] app.output_console.printText(app.i18n.translate('Sketchbook is changed to {0}.\n', [chosen_folder])) app.constant.global_settings.set('sketchbook_folder', chosen_folder) app.arduino_info.refresh() app.main_menu.refresh() app.constant.sketch_settings.set('full_compilation', True) else: (self.folder_list, self.level) = app.fileutil.enterNextLevel(index, self.folder_list, self.level, self.top_folder_list) self.show_panel() class ChooseBuildFolderCommand(sublime_plugin.WindowCommand): def run(self): root_list = app.fileutil.getOSRootList() self.top_folder_list = root_list self.folder_list = self.top_folder_list self.level = 0 self.show_panel() def show_panel(self): folder_name_list = app.fileutil.getFolderNameList(self.folder_list) sublime.set_timeout(lambda: self.window.show_quick_panel(folder_name_list, self.on_done), 10) def on_done(self, index): is_finished = False if index == -1: return if self.level != 0 and index == 0: chosen_folder = self.folder_list[index] chosen_folder = chosen_folder.split('(')[1] chosen_folder = chosen_folder[:-1] app.output_console.printText(app.i18n.translate('Build folder is changed to {0}.\n', [chosen_folder])) app.constant.sketch_settings.set('build_folder', chosen_folder) app.constant.sketch_settings.set('full_compilation', True) else: (self.folder_list, self.level) = app.fileutil.enterNextLevel(index, self.folder_list, self.level, self.top_folder_list) self.show_panel() class ChooseLanguageCommand(sublime_plugin.WindowCommand): def run(self, language): pre_language = app.constant.global_settings.get('language', -1) if language != pre_language: app.constant.global_settings.set('language', language) app.i18n.refresh() app.main_menu.refresh() def is_checked(self, language): state = False chosen_language = app.constant.global_settings.get('language', -1) if language == chosen_language: state = True return state class SetGlobalSettingCommand(sublime_plugin.WindowCommand): def run(self): if app.active_file.isSrcFile(): global_settings = not app.constant.global_settings.get('global_settings', True) app.constant.global_settings.set('global_settings', global_settings) if global_settings: folder = app.constant.stino_root else: folder = app.active_file.getFolder() app.constant.sketch_settings.changeFolder(folder) app.arduino_info.refresh() app.main_menu.refresh() else: temp_global = not app.constant.global_settings.get('temp_global', False) app.constant.global_settings.set('temp_global', temp_global) def is_checked(self): state = app.constant.global_settings.get('global_settings', True) return state def is_enabled(self): state = False if app.active_file.isSrcFile(): state = True return state class SetFullCompilationCommand(sublime_plugin.WindowCommand): def run(self): full_compilation = not app.constant.sketch_settings.get('full_compilation', True) app.constant.sketch_settings.set('full_compilation', full_compilation) def is_checked(self): state = app.constant.sketch_settings.get('full_compilation', True) return state class ShowCompilationOutputCommand(sublime_plugin.WindowCommand): def run(self): show_compilation_output = not app.constant.sketch_settings.get('show_compilation_output', False) app.constant.sketch_settings.set('show_compilation_output', show_compilation_output) def is_checked(self): state = app.constant.sketch_settings.get('show_compilation_output', False) return state class ShowUploadOutputCommand(sublime_plugin.WindowCommand): def run(self): show_upload_output = not app.constant.sketch_settings.get('show_upload_output', False) app.constant.sketch_settings.set('show_upload_output', show_upload_output) def is_checked(self): state = app.constant.sketch_settings.get('show_upload_output', False) return state class VerifyCodeCommand(sublime_plugin.WindowCommand): def run(self): verify_code = not app.constant.sketch_settings.get('verify_code', False) app.constant.sketch_settings.set('verify_code', verify_code) def is_checked(self): state = app.constant.sketch_settings.get('verify_code', False) return state class OpenRefCommand(sublime_plugin.WindowCommand): def run(self, url): url = app.base.getUrl(url) sublime.run_command('open_url', {'url': url}) class FindInReferenceCommand(sublime_plugin.WindowCommand): def run(self): ref_list = [] keyword_ref_dict = app.arduino_info.getKeywordRefDict() view = app.active_file.getView() selected_word_list = app.base.getSelectedWordList(view) for selected_word in selected_word_list: if selected_word in keyword_ref_dict: ref = keyword_ref_dict[selected_word] if not ref in ref_list: ref_list.append(ref) for ref in ref_list: url = app.base.getUrl(ref) sublime.run_command('open_url', {'url': url}) def is_enabled(self): state = False if app.active_file.isSrcFile(): state = True return state class AboutStinoCommand(sublime_plugin.WindowCommand): def run(self): print('About Stino') class PanelOutputCommand(sublime_plugin.TextCommand): def run(self, edit, text): pos = self.view.size() self.view.insert(edit, pos, text) self.view.show(pos) class InsertIncludeCommand(sublime_plugin.TextCommand): def run(self, edit, include_text): view_size = self.view.size() region = sublime.Region(0, view_size) src_text = self.view.substr(region) include_list = app.preprocess.genIncludeList(src_text) if include_list: last_include = include_list[-1] index = src_text.index(last_include) + len(last_include) else: index = 0 self.view.insert(edit, index, include_text)
[ "robot.will.me@gmail.com" ]
robot.will.me@gmail.com
c074e3ff763766ee48d75b58f2afad18f6e77e2f
ec22c3c1bc19890779abfab8895f145b30b733e0
/backoffice/admin.py
73c1ca9f1b40c3e3d839fa008270d2193794553b
[]
no_license
csurbier/DjangoAdminEbook
31708145e7100d301aa4fa04de1866c9db19d928
f1ae0a6704c63612bd14f50925b5f1f07dd45411
refs/heads/main
2023-02-02T14:08:54.524279
2020-12-15T13:56:00
2020-12-15T13:56:00
321,682,583
2
0
null
null
null
null
UTF-8
Python
false
false
10,234
py
import csv import json from datetime import datetime, timedelta from django.contrib import admin from django.contrib.auth.models import User, Group from django.core.exceptions import ValidationError from django.core.serializers.json import DjangoJSONEncoder from django.db.models import Count from django.db.models.functions import TruncDay from django.forms import BaseInlineFormSet from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render from django.template.response import TemplateResponse from django.urls import path from django.utils.html import format_html from django.utils.safestring import mark_safe from backoffice.models import * from django.contrib import admin from backoffice.models import * from django.contrib.admin import AdminSite # Custom admin site class MyUltimateAdminSite(AdminSite): site_header = 'My Django Admin ultimate guide' site_title = 'My Django Admin ultimate guide Administration' index_title = 'Welcome to my backoffice' index_template = 'backoffice/templates/admin/my_index.html' login_template = 'backoffice/templates/admin/login.html' def get_urls(self): urls = super(MyUltimateAdminSite, self).get_urls() custom_urls = [ path('my_view/', self.admin_view(self.my_view), name="my_view"), ] return urls + custom_urls def my_view(self, request): # your business code context = dict( self.each_context(request), welcome="Welcome to my new view", ) return TemplateResponse(request, "admin/backoffice/custom_view.html", context) """ def get_app_list(self, request): # Return a sorted list of our models ordering = {"The Choices": 1, "The Questions": 2, "The Authors": 3} app_dict = self._build_app_dict(request) app_list = sorted(app_dict.values(), key=lambda x: x['name'].lower()) for app in app_list: app['models'].sort(key=lambda x: ordering[x['name']]) return app_list """ site = MyUltimateAdminSite() class QuestionFormSet(BaseInlineFormSet): def clean(self): super(QuestionFormSet, self).clean() for form in self.forms: if not form.is_valid(): return if form.cleaned_data and not form.cleaned_data.get('DELETE'): pub_date = form.cleaned_data['pub_date'] from datetime import date if pub_date.date() <= date.today(): raise ValidationError( "The publication date should be in the future %s" % form.cleaned_data["pub_date"]) class QuestionInline(admin.TabularInline): model = Question formset = QuestionFormSet def get_formset(self, request, obj=None, **kwargs): formset = super(QuestionInline, self).get_formset(request, obj, **kwargs) initial = [] for x in range(0,self.extra): initial.append({ 'question_text': '', 'pub_date': datetime.now(), 'refAuthor': '' }) from functools import partialmethod formset.__init__ = partialmethod(formset.__init__, initial=initial) return formset @admin.register(Author) class AuthorAdmin(admin.ModelAdmin): inlines = (QuestionInline,) empty_value_display = 'Unknown' fieldsets = [ ("Author information", {'fields': ['name', 'createdDate', 'updatedDate']}), ] list_display = ('name','createdDate','updatedDate',) list_per_page = 50 search_fields = ('name',) readonly_fields = ('createdDate', 'updatedDate',) def changelist_view(self, request, extra_context=None): # Aggregate new authors per day chart_data = ( Author.objects.annotate(date=TruncDay("updatedDate")) .values("date") .annotate(y=Count("id")) .order_by("-date") ) # Serialize and attach the chart data to the template context as_json = json.dumps(list(chart_data), cls=DjangoJSONEncoder) print("Json %s" % as_json) extra_context = extra_context or {"chart_data": as_json} # Call the superclass changelist_view to render the page return super().changelist_view(request, extra_context=extra_context) def change_view(self, request, object_id, form_url='', extra_context=None): nbQuestion = Question.objects.filter(refAuthor=object_id).count() response_data = [ nbQuestion ] extra_context = extra_context or {} # Serialize and attach the chart data to the template context as_json = json.dumps(response_data, cls=DjangoJSONEncoder) extra_context = extra_context or {"nbQuestion": as_json} return super().change_view( request, object_id, form_url, extra_context=extra_context, ) class QuestionPublishedListFilter(admin.SimpleListFilter): # Human-readable title which will be displayed in the # right admin sidebar just above the filter options. title = ('Published questions') # Parameter for the filter that will be used in the URL query. parameter_name = 'pub_date' def lookups(self, request, model_admin): """ Returns a list of tuples. The first element in each tuple is the coded value for the option that will appear in the URL query. The second element is the human-readable name for the option that will appear in the right sidebar. """ return ( ('Published', ('Published questions')), ('Unpublished', ('Unpublished questions')), ) def queryset(self, request, queryset): """ Returns the filtered queryset based on the value provided in the query string and retrievable via `self.value()`. """ if self.value() == 'Published': return queryset.filter(pub_date__lt=datetime.now()) if self.value() == 'Unpublished': return queryset.filter(pub_date__gte=datetime.now()) class QuestionsAuthorFilter(admin.SimpleListFilter): title = 'Author questions' parameter_name = 'refAuthor' def lookups(self, request, model_admin): if 'refAuthor__id__exact' in request.GET: id = request.GET['refAuthor__id__exact'] questions = model_admin.model.objects.all().filter(refAuthor=id) else: questions = model_admin.model.objects.all() return [(question.id, question.question_text) for question in questions] def queryset(self, request, queryset): if self.value(): return queryset.filter(id=self.value()) @admin.register(Question) class QuestionAdmin(admin.ModelAdmin): fieldsets = ( ("Question information", { 'fields': ('question_text',) }), ("Date", { 'fields': ('pub_date',) }), ('The author', { 'classes': ('collapse',), 'fields': ('refAuthor',), }), ) list_display = ('question_text', 'colored_question_text','goToChoices','refAuthor', 'has_been_published', 'pub_date', 'createdDate', 'updatedDate',) list_display_links = ('refAuthor',) #list_editable = ('question_text',) search_fields = ('refAuthor__name',) ordering = ('-pub_date',) date_hierarchy = 'pub_date' list_filter = (QuestionPublishedListFilter,QuestionsAuthorFilter,'refAuthor',) list_select_related = ('refAuthor',) autocomplete_fields = ['refAuthor'] def has_been_published(self, obj): present = datetime.now() return obj.pub_date.date() < present.date() has_been_published.boolean = True has_been_published.short_description = 'Published?' def colored_question_text(self, obj): return format_html( '<span style="color: #{};">{}</span>', "ff5733", obj.question_text, ) colored_question_text.short_description = 'Color?' @mark_safe def goToChoices(self, obj): return format_html( '<a class="button" href="/admin/backoffice/choice/?question__id__exact=%s" target="blank">Choices</a>&nbsp;'% obj.pk) goToChoices.short_description = 'Choices' goToChoices.allow_tags = True def make_published(modeladmin, request, queryset): queryset.update(pub_date=datetime.now() - timedelta(days=1)) make_published.short_description = "Mark selected questions as published" import csv from django.http import HttpResponse def export_to_csv(modeladmin, request, queryset): opts = modeladmin.model._meta response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachment; \ filename={}.csv'.format(opts.verbose_name) writer = csv.writer(response) fields = [field for field in opts.get_fields() if not field.many_to_many and not field.one_to_many] # Write a first row with header information writer.writerow([field.verbose_name for field in fields]) # Write data rows for obj in queryset: data_row = [] for field in fields: value = getattr(obj, field.name) if isinstance(value, datetime): value = value.strftime('%d/%m/%Y %H:%M') data_row.append(value) writer.writerow(data_row) return response export_to_csv.short_description = 'Export to CSV' def make_published_custom(self, request, queryset): if 'apply' in request.POST: # The user clicked submit on the intermediate form. # Perform our update action: queryset.update(pub_date=datetime.now() - timedelta(days=1)) # Redirect to our admin view after our update has # completed with a nice little info message saying # our models have been updated: self.message_user(request, "Changed to published on {} questions".format(queryset.count())) return HttpResponseRedirect(request.get_full_path()) return render(request, 'admin/backoffice/custom_makepublished.html', context={'questions': queryset}) make_published_custom.short_description = "Custom make published" actions = [make_published,export_to_csv,make_published_custom] @admin.register(Choice) class ChoiceAdmin(admin.ModelAdmin): list_display = ('question', 'choice_text','votes','createdDate', 'updatedDate',) #list_filter = ('question__refAuthor','question',) ordering = ('-createdDate',) list_select_related = ('question','question__refAuthor',) """ def formfield_for_foreignkey(self, db_field, request, **kwargs): try: if db_field.name == "question": kwargs["queryset"] = Question.objects.filter(refAuthor=1) return super(ChoiceAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs) except Exception as e: print(e) """ def get_form(self, request, obj=None, **kwargs): form = super(ChoiceAdmin, self).get_form(request, obj=obj, **kwargs) firstQuestion = Question.objects.all().last() form.base_fields['question'].initial = firstQuestion form.base_fields['choice_text'].initial = "my custom text" return form site.register(Author,AuthorAdmin) site.register(Question,QuestionAdmin) site.register(Choice,ChoiceAdmin) site.register(User) site.register(Group)
[ "csurbier@idevotion.fr" ]
csurbier@idevotion.fr
ecfea9cd7da02bde8788112740ae7a2c1adbfd3e
5245756672f66b71fb865fbefa44547dd8425805
/UserRoutes.py
58d5c9a529db46e023b72afd858748dbc20a8f03
[]
no_license
tsulim/App-Development
dc264e1605969303ddf2d95e8c4bab8abc6fa02e
9e0614065a0f43f3e06ee1f3342ec83eb25af509
refs/heads/master
2023-03-16T05:42:04.717254
2021-02-22T09:46:08
2021-02-22T09:46:08
326,149,537
0
0
null
null
null
null
UTF-8
Python
false
false
4,903
py
from flask import render_template, request, redirect, url_for, flash from Application import app, db, bcrypt from UserForms import RegistrationForm, LoginForm, UpdateAccountForm, DeleteUserForm from models import User from flask_login import login_user, current_user, logout_user import shelve @app.route("/register", methods=['GET', 'POST']) def register(): if current_user.is_authenticated: return redirect(url_for('home')) form = RegistrationForm() if form.validate_on_submit(): hashed_password = bcrypt.generate_password_hash(form.password.data).decode('utf-8') user = User(username=form.username.data, firstName=form.firstName.data, address=form.address.data ,email=form.email.data, password=hashed_password) db.session.add(user) db.session.commit() flash('Your account has been created! You are now able to log in', 'success') return redirect(url_for('login')) return render_template('register.html', title='Register', form=form) @app.route("/login", methods=['GET', 'POST']) def login(): if current_user.is_authenticated: return redirect(url_for('home')) form = LoginForm() if form.validate_on_submit(): user = User.query.filter_by(email=form.email.data).first() if user and bcrypt.check_password_hash(user.password, form.password.data): login_user(user, remember=form.remember.data) next_page = request.args.get('next') # Xiu Jia's Code - Move guest's cart into user's cart DictOngoingOrderDict = {} DictsaveforlaterDict = {} try: orderdb = shelve.open('orderstorage.db','w') except: print('Error in opening orderstorage.db') try: DictOngoingOrderDict = orderdb['OngoingOrder'] except: print('Error in retrieving from orderdb') ongoingorderDict = DictOngoingOrderDict.get(0) try: DictsaveforlaterDict = orderdb['SaveForLater'] except: print('Error in retrieving from orderdb') saveforlaterDict = DictsaveforlaterDict.get(0) if saveforlaterDict != {} or saveforlaterDict != None: usersaveforlater = DictsaveforlaterDict.get(current_user.id) if usersaveforlater == {} or usersaveforlater == None: DictsaveforlaterDict[current_user.id] = saveforlaterDict else: for key in saveforlaterDict: item = saveforlaterDict.get(key) usersaveforlater[key] = item DictsaveforlaterDict[current_user.id] = usersaveforlater saveforlaterDict = {} DictsaveforlaterDict[0] = saveforlaterDict orderdb['SaveForLater'] = DictsaveforlaterDict if ongoingorderDict == None or ongoingorderDict == {}: return redirect(next_page) if next_page else redirect(url_for('home')) else: DictOngoingOrderDict[current_user.id] = ongoingorderDict ongoingorderDict = {} DictOngoingOrderDict[0] = ongoingorderDict orderdb['OngoingOrder'] = DictOngoingOrderDict orderdb.close() return redirect(url_for('checkout')) else: flash('Login Unsuccessful. Please check email and password', 'danger') return render_template('login.html', title='Login', form=form) @app.route("/logout") def logout(): logout_user() return redirect(url_for('home')) @app.route("/settings", methods=['GET', 'POST']) def settings(): form = UpdateAccountForm() if form.validate_on_submit(): current_user.username = form.username.data current_user.email = form.email.data current_user.address = form.address.data db.session.commit() flash('Your account has been updated!', 'success') return redirect(url_for('settings')) elif request.method == 'GET': form.username.data = current_user.username form.email.data = current_user.email form.address.data = current_user.address return render_template('settings.html', title='settings', form=form) @app.route("/delete", methods=['GET', 'POST']) def delete(): form = DeleteUserForm() if form.validate_on_submit(): found_user = User.query.filter_by(email=form.email.data).first() if found_user: user = User.query.filter_by(id=found_user.id).first() db.session.delete(user) db.session.commit() logout_user() return redirect(url_for('home')) else: flash('Delete Unsuccessful. Please check email', 'danger') return render_template('Delete.html', title='Delete', form=form)
[ "limxiujia18@gmail.com" ]
limxiujia18@gmail.com
18887f3e51de4de36d83a68188e0ae3525d515b4
fe164274229f4c41ca806d5486be9f70c92b739a
/Copy_file_3.py
8f840db746d562dbcf4c0455942b86f4b9b5f6bf
[]
no_license
Aleksandr-Git/Copy
f98beb575b7c97460259d9e86611ce08b754a53b
6996dd0257d592f9781fdf77b305c91f053a9b5a
refs/heads/master
2020-04-05T15:39:27.689147
2019-04-29T18:35:10
2019-04-29T18:35:10
156,977,893
0
0
null
null
null
null
UTF-8
Python
false
false
1,921
py
import os import shutil import time path = '.\\pap_2' path_work = '' path_origin = '' path_copy = '' size = os.path.getsize(path) #files = os.listdir(path) total_size = 0 def fun(path): # определяет размер папки global total_size for i in os.listdir(path): if os.path.isdir(path + '\\' + i): fun(path + '\\' + i) else: s = os.path.getsize(path + '\\' + i) total_size += s return total_size / 1024 / 1024 #fun(path) print(str(total_size) + ' Мб') #fun_copy(path) cur_dir = os.getcwd() print(cur_dir) print(os.listdir('.\\pap_2')) ''' def copy_folder(): shutil.move('./pap_2' + '/' + os.listdir('./pap_2')[0], './pap_3') # перемещает файлы из первой папки во вторую и удаляет первую #os.rename('./pap_3/0', './pap_3/' + str(int(os.listdir('./pap_3')[-1]) + 1)) os.rename('./pap_3/0', './pap_3/' + str(int(len(os.listdir('./pap_3'))))) for i in os.listdir('./pap_2'): os.rename('./pap_2' + '/' + i, './pap_2' + '/' + str(int(i) - 1)) ''' def last_pap(): dir_list = [os.path.join(path, x) for x in os.listdir(path)] if dir_list: # Создадим список из путей к файлам и дат их создания. date_list = [[x, os.path.getctime(x)] for x in dir_list] # Отсортируем список по дате создания в прямом порядке sort_date_list = sorted(date_list, key=lambda x: x[1], reverse=False) return sort_date_list[0][0] def copy_folder(): shult.move(last_pap(), '\\pap_3') while True: total_size = 0 if fun('.\\pap_2') > 7: time.sleep(5) try: copy_folder() except Exception: continue print(str(total_size / 1024 / 1024) + ' Мб') print(os.listdir('.\\pap_2'))
[ "gavryukov@mail.ru" ]
gavryukov@mail.ru
a6716530fefa417ee61dac0ca29cbc6eae271006
02722d19d04cd3a84cd392e90de8485d032cef5b
/CastBoxOffice/casts_historical_box_office.py
663ee3f82b1b86e103e928b4d34d35fdb99f0576
[]
no_license
brightgems/drama-data-cralwer
50944995ad22c263078cdcf6aa762b9ba3c90653
51b2494b89e0e89145cd05f8797e42e847742254
refs/heads/master
2020-07-20T09:08:22.439197
2017-06-14T14:35:29
2017-06-14T14:35:29
94,339,505
0
0
null
null
null
null
UTF-8
Python
false
false
2,959
py
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'chenshini' import json import re import xlrd import xlutils import datetime import sys reload(sys) sys.setdefaultencoding('utf-8') def skip_genre_condition(genre): # if '动画' in genre: # return True # return False return False def build_cast_historical_box_office_dict(identity,movies): cast_box_office = {} for m in movies.values(): if skip_genre_condition(m['genre']): continue casts = m[identity] for idx,c in enumerate(casts): if c not in cast_box_office: cast_box_office[c] = [] h = {} h['title'] = m['title'] h['percent'] = m['percent'] h['rank'] = idx h['release'] = m['release'] cast_box_office[c].append(h) # for name,history in cast_box_office.items(): # print name # for h in history: # print h['title'],h['percent'],h['rank'] return cast_box_office def extract_year(date): p = re.compile(r'[0-9]{4}') y = p.match(date) if not y == None: return y.group() return 0 def skip_year_condition(date): y = extract_year(date) if y != '2014': return True else: return False def get_factor(identity,rank): if identity == 'directors': if rank == 0: return 1 else: return 0 if rank < 3: return 0.7 if rank < 6: return 0.3 return 0 def dete_compare(x,y): if y == "": return False return x > y def cal_movies_box_office_with_casts(identity,movies, cast_box_office_dict): for m in movies.values(): if skip_year_condition(m['release']) or skip_genre_condition(m['genre']): if identity+'_box_office' in m: del m[identity+'_box_office'] continue sum = 0 cnt = 0 release = m['release'] for c in m[identity]: history = cast_box_office_dict[c] for h in history: if dete_compare(release,h['release']): cnt += 1 sum += h['percent'] * get_factor(identity,h['rank']) m[identity+'_box_office'] = sum*1.0/max(cnt,1) print m['title'],m['percent'],m[identity+'_box_office'] return movies def export_cast_box_office(json_path,export_path): movies = json.load(file(json_path)) cast_box_office_dict = build_cast_historical_box_office_dict('actors',movies) movies = cal_movies_box_office_with_casts('actors', movies,cast_box_office_dict) director_box_office_dict = build_cast_historical_box_office_dict('directors',movies) movies = cal_movies_box_office_with_casts('directors', movies,director_box_office_dict) json.dump(movies, file(export_path, 'w'), indent=4, ensure_ascii=False) export_cast_box_office('../data/movies_with_date.json','../data/res.json')
[ "brightgems@live.cn" ]
brightgems@live.cn
9c0b5755bd03830f93fded39f854b1e51d9fe91e
50015e72ea35113ad40e13cb36c85116b0048aa9
/shop_paypal/modifiers.py
12daf8625068c27aa5c5550745293b3cf29d2b51
[ "MIT" ]
permissive
haricot/djangoshop-paypal
30085baf75d7712aa1b4c39eba7256d9b0f39ef5
f1c381b4a64201029dcfe60af6e0243dc43fe50c
refs/heads/master
2020-12-20T12:18:17.495255
2020-01-10T22:29:43
2020-01-10T22:29:43
236,073,186
0
1
MIT
2020-01-24T19:54:41
2020-01-24T19:54:40
null
UTF-8
Python
false
false
1,240
py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from shop.payment.modifiers import PaymentModifier as PaymentModifierBase from .payment import PayPalPayment class PaymentModifier(PaymentModifierBase): """ Cart modifier which handles payment through PayPal. """ payment_provider = PayPalPayment() commision_percentage = None def get_choice(self): return (self.identifier, "PayPal") def is_disabled(self, cart): return cart.total == 0 def add_extra_cart_row(self, cart, request): from decimal import Decimal from shop.serializers.cart import ExtraCartRow if not self.is_active(cart) or not self.commision_percentage: return amount = cart.total * Decimal(self.commision_percentage / 100.0) instance = {'label': _("plus {}% handling fees").format(self.commision_percentage), 'amount': amount} cart.extra_rows[self.identifier] = ExtraCartRow(instance) cart.total += amount def update_render_context(self, context): super(PaymentModifier, self).update_render_context(context) context['payment_modifiers']['paypal_payment'] = True
[ "jacob.rief@gmail.com" ]
jacob.rief@gmail.com