blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 3
616
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
112
| license_type
stringclasses 2
values | repo_name
stringlengths 5
115
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 777
values | visit_date
timestamp[us]date 2015-08-06 10:31:46
2023-09-06 10:44:38
| revision_date
timestamp[us]date 1970-01-01 02:38:32
2037-05-03 13:00:00
| committer_date
timestamp[us]date 1970-01-01 02:38:32
2023-09-06 01:08:06
| github_id
int64 4.92k
681M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us]date 2012-06-04 01:52:49
2023-09-14 21:59:50
⌀ | gha_created_at
timestamp[us]date 2008-05-22 07:58:19
2023-08-21 12:35:19
⌀ | gha_language
stringclasses 149
values | src_encoding
stringclasses 26
values | language
stringclasses 1
value | is_vendor
bool 2
classes | is_generated
bool 2
classes | length_bytes
int64 3
10.2M
| extension
stringclasses 188
values | content
stringlengths 3
10.2M
| authors
listlengths 1
1
| author_id
stringlengths 1
132
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
da902d2befb4663c420a37b3b99b524787e0a04d
|
dc51e4714820d991e7d0e94b3e9eac4dbc67eea7
|
/历史练习1120/host_management/utils/page.py
|
e26b17ffd6eb6a51666b153df1c3c5b40d4a2517
|
[] |
no_license
|
ruoxiaojie/Django
|
537d27abe9ebb85e0dfc69585f318a87e7514a70
|
92b88600953cd4ff743032cab3d4785437c949e0
|
refs/heads/master
| 2021-01-15T22:18:56.033883
| 2018-03-09T06:15:46
| 2018-03-09T06:15:46
| 99,894,862
| 0
| 1
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 3,071
|
py
|
#!/usr/bin/python
#Author:xiaojie
# -*- coding:utf-8 -*-
class Page(object):
def __init__(self,current_page,all_count,base_url,per_page=10,pager_page_count=11):
"""
分页初始化
:param current_page: 当前页码
:param per_page: 每页显示数据条数
:param all_count: 数据库中总条数
:param pager_page_count: 页面上最多显示的页码数量
"""
self.base_url = base_url
self.current_page = current_page
self.per_page = per_page
self.all_count = all_count
self.pager_page_count = pager_page_count
pager_count, b = divmod(all_count, per_page)
if b != 0:
pager_count += 1
self.pager_count = pager_count
half_pager_page_count = int(pager_page_count / 2)
self.half_pager_page_count = half_pager_page_count
@property
def start(self):
"""
数据获取值起始索引
:return:
"""
return (self.current_page - 1) * self.per_page
@property
def end(self):
"""
数据获取值结束索引
:return:
"""
return self.current_page * self.per_page
def page_html(self):
"""
生成HTML页码
:return:
"""
# 如果数据总页码pager_count<11 pager_page_count
if self.pager_count < self.pager_page_count:
pager_start = 1
pager_end = self.pager_count
else:
# 数据页码已经超过11
# 判断: 如果当前页 <= 5 half_pager_page_count
if self.current_page <= self.half_pager_page_count:
pager_start = 1
pager_end = self.pager_page_count
else:
# 如果: 当前页+5 > 总页码
if (self.current_page + self.half_pager_page_count) > self.pager_count:
pager_end = self.pager_count
pager_start = self.pager_count - self.pager_page_count + 1
else:
pager_start = self.current_page - self.half_pager_page_count
pager_end = self.current_page + self.half_pager_page_count
page_list = []
if self.current_page <= 1:
prev = '<a href="#">上一页</a>'
else:
prev = '<a href="%s?page=%s">上一页</a>' % (self.base_url,self.current_page - 1,)
page_list.append(prev)
for i in range(pager_start, pager_end + 1):
if self.current_page == i:
tpl = '<a class="active" href="%s?page=%s">%s</a>' % (self.base_url,i, i,)
else:
tpl = '<a href="%s?page=%s">%s</a>' % (self.base_url,i, i,)
page_list.append(tpl)
if self.current_page >= self.pager_count:
nex = '<a href="#">下一页</a>'
else:
nex = '<a href="%s?page=%s">下一页</a>' % (self.base_url,self.current_page + 1,)
page_list.append(nex)
page_str = "".join(page_list)
return page_str
|
[
"475030894@qq.com"
] |
475030894@qq.com
|
e407b72eb65308af08dd28299420bd5d09cf7c0e
|
9633b9314337bef7d2e3bfddb71cb2ea6da55a90
|
/websauna/system/devop/__init__.py
|
a460e6caf5975f54fcd952f3e12f1ddf7fcb6c2d
|
[
"MIT",
"Apache-2.0"
] |
permissive
|
rmoorman/websauna
|
c118e377b5f61886b581d66526bb567ed3fe8843
|
a0dc40da3f30ad26058f2583ac55ea0ff7055189
|
refs/heads/master
| 2021-01-14T08:30:48.313289
| 2016-01-17T17:28:38
| 2016-01-17T17:28:38
| 49,883,430
| 0
| 0
| null | 2016-01-18T14:50:46
| 2016-01-18T14:50:46
| null |
UTF-8
|
Python
| false
| false
| 116
|
py
|
"""This package contains various command line scripts and timed tasks to set up a site and run it in production."""
|
[
"mikko@opensourcehacker.com"
] |
mikko@opensourcehacker.com
|
e33e9cf7982165ee7ef95e0f9d59cf8b243ce4da
|
755e4e6e966433fe887f0f28f14916696b1588d7
|
/code/evaluation/video/BackgroundSubtractorDummy.py
|
8944c4aecc694c2070e8febb9edd136dc40f026e
|
[] |
no_license
|
phildue/FingerspellingRecognition
|
f18518a6e2e29b769d131e5b54846f00213f3ff1
|
1b5236142734d7b50f0f4161ecc533b7d10347b8
|
refs/heads/master
| 2021-03-24T10:40:24.507766
| 2017-07-03T09:33:09
| 2017-07-03T09:33:09
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 397
|
py
|
import cv2
from preprocessing.segmentation.BackgroundSubtractor import BackgroundSubtractor
class BackgroundSubtractorDummy(BackgroundSubtractor):
def __init__(self, diff_img, test_img):
super().__init__()
self.diff_img = diff_img
self.test_img = test_img
def get_background(self):
return cv2.cvtColor(self.test_img + self.diff_img, cv2.COLOR_RGB2GRAY)
|
[
"phild@protonmail.com"
] |
phild@protonmail.com
|
868c26a2e9f893d5fd16b107fda4605c130ececa
|
04803c70bb97012b7d500a177ac0240fb2ddbe38
|
/1heptane/pdep/network2715_1.py
|
8a34f6725e5eee89f902b49a8b1a7df8eaa1b37b
|
[] |
no_license
|
shenghuiqin/chpd
|
735e0415f6688d88579fc935459c1b0f53596d1d
|
396ba54629036e3f2be0b3fabe09b78c90d56939
|
refs/heads/master
| 2023-03-01T23:29:02.118150
| 2019-10-05T04:02:23
| 2019-10-05T04:02:23
| 192,084,217
| 0
| 0
| null | 2019-06-18T18:33:13
| 2019-06-15T13:52:28
|
HTML
|
UTF-8
|
Python
| false
| false
| 99,132
|
py
|
species(
label = 'CCCCC([O])O[CH]C=O(13350)',
structure = SMILES('CCCCC([O])OC=C[O]'),
E0 = (-298.704,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2750,2770,2790,2810,2830,2850,1425,1437.5,1450,1225,1250,1275,1270,1305,1340,700,750,800,300,350,400,2995,3025,975,1000,1300,1375,400,500,1630,1680,1380,1390,370,380,2900,435,2750,2800,2850,1350,1500,750,1050,1375,1000,200,800,933.333,1066.67,1200,1333.33,1466.67,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.6134,0.106355,-7.12485e-05,7.0584e-09,7.22993e-12,-35708.6,40.8551], Tmin=(100,'K'), Tmax=(1004.69,'K')), NASAPolynomial(coeffs=[25.914,0.0316472,-1.17974e-05,2.17269e-09,-1.54902e-13,-43000.6,-100.84], Tmin=(1004.69,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-298.704,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(507.183,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + radical(C=COJ) + radical(CCOJ)"""),
)
species(
label = 'OCHCHO(48)',
structure = SMILES('O=CC=O'),
E0 = (-225.3,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2782.5,750,1395,475,1775,1000,180,857.339,857.946,861.419,1717.87],'cm^-1')),
HinderedRotor(inertia=(0.00964493,'amu*angstrom^2'), symmetry=1, barrier=(5.0669,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (58.0361,'amu'),
collisionModel = TransportData(shapeIndex=2, epsilon=(3660.03,'J/mol'), sigma=(4.01,'angstroms'), dipoleMoment=(0,'De'), polarizability=(0,'angstroms^3'), rotrelaxcollnum=2.0, comment="""NOx2018"""),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[4.68412,0.000478013,4.26391e-05,-5.79018e-08,2.31669e-11,-27198.5,4.51187], Tmin=(200,'K'), Tmax=(1000,'K')), NASAPolynomial(coeffs=[8.72507,0.00633097,-2.35575e-06,3.89783e-10,-2.37487e-14,-29102.4,-20.3904], Tmin=(1000,'K'), Tmax=(6000,'K'))], Tmin=(200,'K'), Tmax=(6000,'K'), E0=(-225.3,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(128.874,'J/(mol*K)'), label="""OCHCHO""", comment="""Thermo library: Klippenstein_Glarborg2016"""),
)
species(
label = 'CCCCC=O(1733)',
structure = SMILES('CCCCC=O'),
E0 = (-250.884,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2750,2770,2790,2810,2830,2850,1425,1437.5,1450,1225,1250,1275,1270,1305,1340,700,750,800,300,350,400,2750,2800,2850,1350,1500,750,1050,1375,1000,2782.5,750,1395,475,1775,1000,198.883,199.064],'cm^-1')),
HinderedRotor(inertia=(0.00426375,'amu*angstrom^2'), symmetry=1, barrier=(0.119627,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.518882,'amu*angstrom^2'), symmetry=1, barrier=(14.5862,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.334975,'amu*angstrom^2'), symmetry=1, barrier=(9.40848,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.00310926,'amu*angstrom^2'), symmetry=1, barrier=(9.40929,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (86.1323,'amu'),
collisionModel = TransportData(shapeIndex=2, epsilon=(3428.95,'J/mol'), sigma=(5.98513,'angstroms'), dipoleMoment=(0,'C*m'), polarizability=(0,'angstroms^3'), rotrelaxcollnum=0, comment="""Epsilon & sigma estimated with Tc=535.59 K, Pc=36.29 bar (from Joback method)"""),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[1.63555,0.0520732,-2.77334e-05,6.90636e-09,-6.84311e-13,-30090.2,22.3653], Tmin=(100,'K'), Tmax=(2214.2,'K')), NASAPolynomial(coeffs=[15.0687,0.0278058,-1.12935e-05,1.95647e-09,-1.25427e-13,-36038.9,-53.1197], Tmin=(2214.2,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-250.884,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(365.837,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-(Cds-O2d)CsHH) + group(Cs-CsHHH) + group(Cds-OdCsH)"""),
)
species(
label = 'CCCCC1OC([CH][O])O1(14319)',
structure = SMILES('CCCCC1OC([CH][O])O1'),
E0 = (-150.237,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[0.129046,0.0907043,-6.16091e-05,2.08163e-08,-2.9584e-12,-17936,35.8743], Tmin=(100,'K'), Tmax=(1529.89,'K')), NASAPolynomial(coeffs=[14.5351,0.0530387,-2.46793e-05,4.72377e-09,-3.28707e-13,-22344,-39.7521], Tmin=(1529.89,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-150.237,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(511.34,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-CsCs) + group(O2s-CsCs) + group(O2s-CsH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsOsOsH) + group(Cs-CsOsHH) + group(Cs-CsHHH) + ring(Cyclobutane) + radical(CCsJOH) + radical(CCOJ)"""),
)
species(
label = 'H(3)',
structure = SMILES('[H]'),
E0 = (211.792,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (1.00794,'amu'),
collisionModel = TransportData(shapeIndex=0, epsilon=(1205.6,'J/mol'), sigma=(2.05,'angstroms'), dipoleMoment=(0,'C*m'), polarizability=(0,'angstroms^3'), rotrelaxcollnum=0.0, comment="""GRI-Mech"""),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[2.5,9.24385e-15,-1.3678e-17,6.66185e-21,-1.00107e-24,25472.7,-0.459566], Tmin=(100,'K'), Tmax=(3459.6,'K')), NASAPolynomial(coeffs=[2.5,9.20456e-12,-3.58608e-15,6.15199e-19,-3.92042e-23,25472.7,-0.459566], Tmin=(3459.6,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(211.792,'kJ/mol'), Cp0=(20.7862,'J/(mol*K)'), CpInf=(20.7862,'J/(mol*K)'), label="""H""", comment="""Thermo library: BurkeH2O2"""),
)
species(
label = 'CCCCC(=O)OC=C[O](14320)',
structure = SMILES('CCCCC(=O)OC=C[O]'),
E0 = (-490.376,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2750,2770,2790,2810,2830,2850,1425,1437.5,1450,1225,1250,1275,1270,1305,1340,700,750,800,300,350,400,2750,2800,2850,1350,1500,750,1050,1375,1000,2995,3025,975,1000,1300,1375,400,500,1630,1680,300,800,800,800,800,800,1600,1600,1600,1600,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 2,
opticalIsomers = 1,
molecularWeight = (143.16,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.60915,0.108033,-9.57128e-05,4.27172e-08,-7.51842e-12,-58763.9,38.6737], Tmin=(100,'K'), Tmax=(1376.79,'K')), NASAPolynomial(coeffs=[24.9018,0.0310116,-1.1799e-05,2.08499e-09,-1.40412e-13,-66063.9,-97.7034], Tmin=(1376.79,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-490.376,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(482.239,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-(Cds-O2d)(Cds-Cd)) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-(Cds-O2d)CsHH) + group(Cs-CsHHH) + group(Cds-OdCsOs) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + radical(C=COJ)"""),
)
species(
label = 'CCCCC([O])OC=C=O(14321)',
structure = SMILES('CCCCC([O])OC=C=O'),
E0 = (-258.69,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2750,2770,2790,2810,2830,2850,1425,1437.5,1450,1225,1250,1275,1270,1305,1340,700,750,800,300,350,400,2120,512.5,787.5,3010,987.5,1337.5,450,1655,1380,1390,370,380,2900,435,2750,2800,2850,1350,1500,750,1050,1375,1000,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 2,
opticalIsomers = 1,
molecularWeight = (143.16,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.02046,0.106431,-9.83904e-05,4.73406e-08,-9.20291e-12,-30929.3,38.1228], Tmin=(100,'K'), Tmax=(1229.39,'K')), NASAPolynomial(coeffs=[19.4995,0.0396671,-1.69311e-05,3.16768e-09,-2.20285e-13,-35974.7,-65.112], Tmin=(1229.39,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-258.69,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(482.239,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-(Cdd-O2d)OsH) + radical(CCOJ)"""),
)
species(
label = 'butyl_1(82)',
structure = SMILES('[CH2]CCC'),
E0 = (63.0573,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2750,2783.33,2816.67,2850,1425,1450,1225,1275,1270,1340,700,800,300,400,2750,2800,2850,1350,1500,750,1050,1375,1000,3000,3100,440,815,1455,1000,180],'cm^-1')),
HinderedRotor(inertia=(0.0977402,'amu*angstrom^2'), symmetry=1, barrier=(2.24724,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.0976865,'amu*angstrom^2'), symmetry=1, barrier=(2.246,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.0977534,'amu*angstrom^2'), symmetry=1, barrier=(2.24754,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 2,
opticalIsomers = 1,
molecularWeight = (57.1143,'amu'),
collisionModel = TransportData(shapeIndex=2, epsilon=(2968.28,'J/mol'), sigma=(5.176,'angstroms'), dipoleMoment=(0,'C*m'), polarizability=(0,'angstroms^3'), rotrelaxcollnum=1.0, comment="""GRI-Mech"""),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[2.25388,0.0316763,2.89994e-06,-1.98049e-08,8.20503e-12,7652.64,17.2725], Tmin=(100,'K'), Tmax=(1050.57,'K')), NASAPolynomial(coeffs=[7.59591,0.0260842,-1.01719e-05,1.85189e-09,-1.28169e-13,5716.37,-12.6366], Tmin=(1050.57,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(63.0573,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(295.164,'J/(mol*K)'), label="""butyl_1""", comment="""Thermo library: DFT_QCI_thermo"""),
)
species(
label = '[O]C=COC=O(830)',
structure = SMILES('[O]C=COC=O'),
E0 = (-361.529,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2995,3025,975,1000,1300,1375,400,500,1630,1680,2782.5,750,1395,475,1775,1000,180,180,180],'cm^-1')),
HinderedRotor(inertia=(1.40903,'amu*angstrom^2'), symmetry=1, barrier=(32.3963,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(1.41581,'amu*angstrom^2'), symmetry=1, barrier=(32.5523,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 2,
opticalIsomers = 1,
molecularWeight = (87.0541,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[1.64366,0.0361947,7.84074e-06,-4.97625e-08,2.51765e-11,-43382.7,18.8534], Tmin=(100,'K'), Tmax=(938.333,'K')), NASAPolynomial(coeffs=[19.2694,0.000634451,1.42126e-06,-2.52749e-10,9.92051e-15,-48432.8,-74.3425], Tmin=(938.333,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-361.529,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(199.547,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-(Cds-O2d)(Cds-Cd)) + group(O2s-(Cds-Cd)H) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + group(Cds-OdOsH) + radical(C=COJ)"""),
)
species(
label = '[O]C=C[O](2537)',
structure = SMILES('[O]C=C[O]'),
E0 = (-18.8461,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2995,3025,975,1000,1300,1375,400,500,1630,1680,714.947,715.113],'cm^-1')),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (58.0361,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[3.7018,-0.0027881,5.18222e-05,-5.96735e-08,2.03775e-11,-2247.83,13.3237], Tmin=(100,'K'), Tmax=(1035.3,'K')), NASAPolynomial(coeffs=[6.65087,0.0113883,-5.76543e-06,1.26602e-09,-9.87778e-14,-4228.83,-7.62441], Tmin=(1035.3,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-18.8461,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(174.604,'J/(mol*K)'), comment="""Thermo library: DFT_QCI_thermo + radical(C=COJ) + radical(C=COJ)"""),
)
species(
label = 'CCCC[C](O)OC=C[O](14322)',
structure = SMILES('CCCC[C](O)OC=C[O]'),
E0 = (-319.162,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.87049,0.10907,-6.69559e-05,-8.50944e-09,1.58149e-11,-38156.9,41.6036], Tmin=(100,'K'), Tmax=(959.214,'K')), NASAPolynomial(coeffs=[29.8822,0.0238033,-7.33964e-06,1.29491e-09,-9.47443e-14,-46417.2,-121.568], Tmin=(959.214,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-319.162,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + radical(Cs_P) + radical(C=COJ)"""),
)
species(
label = 'CCCCC([O])OC=[C]O(14323)',
structure = SMILES('CCCCC([O])OC=[C]O'),
E0 = (-200.422,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([3615,1277.5,1000,2750,2800,2850,1350,1500,750,1050,1375,1000,3010,987.5,1337.5,450,1655,1685,370,1380,1390,370,380,2900,435,2750,2770,2790,2810,2830,2850,1425,1437.5,1450,1225,1250,1275,1270,1305,1340,700,750,800,300,350,400,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-2.15925,0.118996,-0.000114489,5.53024e-08,-1.04231e-11,-23869.6,44.5414], Tmin=(100,'K'), Tmax=(1299.72,'K')), NASAPolynomial(coeffs=[27.2613,0.0284513,-9.99098e-06,1.70138e-09,-1.12881e-13,-31517.2,-105.108], Tmin=(1299.72,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-200.422,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + radical(CCOJ) + radical(C=CJO)"""),
)
species(
label = 'CCC[CH]C(O)OC=C[O](14324)',
structure = SMILES('CCC[CH]C(O)OC=C[O]'),
E0 = (-324.507,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([3615,1277.5,1000,3025,407.5,1350,352.5,2750,2800,2850,1350,1500,750,1050,1375,1000,2995,3025,975,1000,1300,1375,400,500,1630,1680,1380,1390,370,380,2900,435,2750,2783.33,2816.67,2850,1425,1450,1225,1275,1270,1340,700,800,300,400,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.71311,0.103122,-4.78773e-05,-3.02501e-08,2.40951e-11,-38802.9,42.8473], Tmin=(100,'K'), Tmax=(950.598,'K')), NASAPolynomial(coeffs=[30.6136,0.0218682,-6.09072e-06,1.05808e-09,-7.9636e-14,-47423.6,-124.489], Tmin=(950.598,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-324.507,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + radical(CCJCO) + radical(C=COJ)"""),
)
species(
label = 'CCCCC([O])O[C]=CO(14325)',
structure = SMILES('CCCCC([O])O[C]=CO'),
E0 = (-200.422,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([3615,1277.5,1000,2750,2800,2850,1350,1500,750,1050,1375,1000,3010,987.5,1337.5,450,1655,1685,370,1380,1390,370,380,2900,435,2750,2770,2790,2810,2830,2850,1425,1437.5,1450,1225,1250,1275,1270,1305,1340,700,750,800,300,350,400,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-2.15925,0.118996,-0.000114489,5.53024e-08,-1.04231e-11,-23869.6,44.5414], Tmin=(100,'K'), Tmax=(1299.72,'K')), NASAPolynomial(coeffs=[27.2613,0.0284513,-9.99098e-06,1.70138e-09,-1.12881e-13,-31517.2,-105.108], Tmin=(1299.72,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-200.422,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + radical(CCOJ) + radical(C=CJO)"""),
)
species(
label = 'CCCCC(O)O[C]=C[O](14326)',
structure = SMILES('CCCCC(O)O[C]=C[O]'),
E0 = (-284.665,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([3615,1277.5,1000,2750,2800,2850,1350,1500,750,1050,1375,1000,3010,987.5,1337.5,450,1655,1685,370,1380,1390,370,380,2900,435,2750,2770,2790,2810,2830,2850,1425,1437.5,1450,1225,1250,1275,1270,1305,1340,700,750,800,300,350,400,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.73544,0.110526,-8.4823e-05,1.97393e-08,3.37896e-12,-34016.9,43.56], Tmin=(100,'K'), Tmax=(995.936,'K')), NASAPolynomial(coeffs=[26.2369,0.0297389,-1.06782e-05,1.92432e-09,-1.35723e-13,-41153.8,-99.1342], Tmin=(995.936,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-284.665,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + radical(C=CJO) + radical(C=COJ)"""),
)
species(
label = 'CC[CH]CC(O)OC=C[O](14327)',
structure = SMILES('CC[CH]CC(O)OC=C[O]'),
E0 = (-329.95,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([3615,1277.5,1000,3025,407.5,1350,352.5,2750,2800,2850,1350,1500,750,1050,1375,1000,2995,3025,975,1000,1300,1375,400,500,1630,1680,1380,1390,370,380,2900,435,2750,2783.33,2816.67,2850,1425,1450,1225,1275,1270,1340,700,800,300,400,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.66169,0.108891,-8.06392e-05,1.546e-08,5.00806e-12,-39466.1,42.7305], Tmin=(100,'K'), Tmax=(985.575,'K')), NASAPolynomial(coeffs=[25.8927,0.0299387,-1.05166e-05,1.87509e-09,-1.31788e-13,-46494.3,-97.9041], Tmin=(985.575,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-329.95,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + radical(RCCJCC) + radical(C=COJ)"""),
)
species(
label = 'CCCCC(O)OC=[C][O](14328)',
structure = SMILES('CCCCC(O)OC=[C][O]'),
E0 = (-284.665,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([3615,1277.5,1000,2750,2800,2850,1350,1500,750,1050,1375,1000,3010,987.5,1337.5,450,1655,1685,370,1380,1390,370,380,2900,435,2750,2770,2790,2810,2830,2850,1425,1437.5,1450,1225,1250,1275,1270,1305,1340,700,750,800,300,350,400,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.73544,0.110526,-8.4823e-05,1.97393e-08,3.37896e-12,-34016.9,43.56], Tmin=(100,'K'), Tmax=(995.936,'K')), NASAPolynomial(coeffs=[26.2369,0.0297389,-1.06782e-05,1.92432e-09,-1.35723e-13,-41153.8,-99.1342], Tmin=(995.936,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-284.665,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + radical(C=COJ) + radical(C=CJO)"""),
)
species(
label = 'C[CH]CCC(O)OC=C[O](14329)',
structure = SMILES('C[CH]CCC(O)OC=C[O]'),
E0 = (-329.963,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.68584,0.108276,-7.5053e-05,6.73837e-09,8.89663e-12,-39465.5,42.9883], Tmin=(100,'K'), Tmax=(969.588,'K')), NASAPolynomial(coeffs=[26.8397,0.0282319,-9.4465e-06,1.66371e-09,-1.17556e-13,-46766.3,-102.873], Tmin=(969.588,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-329.963,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + radical(C=COJ) + radical(RCCJC)"""),
)
species(
label = 'CCCC[C]([O])OC=CO(14330)',
structure = SMILES('CCCCC(=O)O[CH][CH]O'),
E0 = (-322.067,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.4092,0.127752,-0.000171363,1.36128e-07,-4.47548e-11,-38549.2,40.8058], Tmin=(100,'K'), Tmax=(763.888,'K')), NASAPolynomial(coeffs=[11.666,0.0566088,-2.64062e-05,5.03276e-09,-3.4937e-13,-40468.7,-18.2418], Tmin=(763.888,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-322.067,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(498.868,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-O2d)) + group(O2s-CsH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-(Cds-O2d)CsHH) + group(Cs-CsOsHH) + group(Cs-CsOsHH) + group(Cs-CsHHH) + group(Cds-OdCsOs) + radical(CCsJOC(O)) + radical(CCsJOH)"""),
)
species(
label = 'CCC[CH]C([O])OC=CO(14331)',
structure = SMILES('CCC[CH]C([O])OC=CO'),
E0 = (-240.264,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([3615,1277.5,1000,3025,407.5,1350,352.5,2750,2800,2850,1350,1500,750,1050,1375,1000,2995,3025,975,1000,1300,1375,400,500,1630,1680,1380,1390,370,380,2900,435,2750,2783.33,2816.67,2850,1425,1450,1225,1275,1270,1340,700,800,300,400,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.80164,0.107801,-6.50982e-05,-9.56783e-09,1.60642e-11,-28670.3,42.6158], Tmin=(100,'K'), Tmax=(957.556,'K')), NASAPolynomial(coeffs=[29.412,0.0241967,-7.42081e-06,1.3001e-09,-9.46488e-14,-36792.9,-117.818], Tmin=(957.556,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-240.264,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + radical(CCOJ) + radical(CCJCO)"""),
)
species(
label = '[CH2]CCCC(O)OC=C[O](14332)',
structure = SMILES('[CH2]CCCC(O)OC=C[O]'),
E0 = (-319.162,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.87045,0.10907,-6.69544e-05,-8.51144e-09,1.58157e-11,-38156.9,42.7021], Tmin=(100,'K'), Tmax=(959.209,'K')), NASAPolynomial(coeffs=[29.882,0.0238035,-7.33976e-06,1.29493e-09,-9.47466e-14,-46417.2,-120.468], Tmin=(959.209,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-319.162,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + radical(C=COJ) + radical(RCCJ)"""),
)
species(
label = 'CC[CH]CC([O])OC=CO(14333)',
structure = SMILES('CC[CH]CC([O])OC=CO'),
E0 = (-245.708,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([3615,1277.5,1000,3025,407.5,1350,352.5,2750,2800,2850,1350,1500,750,1050,1375,1000,2995,3025,975,1000,1300,1375,400,500,1630,1680,1380,1390,370,380,2900,435,2750,2783.33,2816.67,2850,1425,1450,1225,1275,1270,1340,700,800,300,400,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.78744,0.113996,-9.92753e-05,3.78318e-08,-3.66438e-12,-29331.9,42.633], Tmin=(100,'K'), Tmax=(1023.03,'K')), NASAPolynomial(coeffs=[24.9368,0.0318571,-1.16133e-05,2.06253e-09,-1.42308e-13,-35969.4,-92.6209], Tmin=(1023.03,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-245.708,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + radical(RCCJCC) + radical(CCOJ)"""),
)
species(
label = 'C[CH]CCC([O])OC=CO(14334)',
structure = SMILES('C[CH]CCC([O])OC=CO'),
E0 = (-245.72,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([3615,1277.5,1000,3025,407.5,1350,352.5,2750,2800,2850,1350,1500,750,1050,1375,1000,2995,3025,975,1000,1300,1375,400,500,1630,1680,1380,1390,370,380,2900,435,2750,2783.33,2816.67,2850,1425,1450,1225,1275,1270,1340,700,800,300,400,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.79149,0.113153,-9.29456e-05,2.82421e-08,5.44348e-13,-29332.2,42.8182], Tmin=(100,'K'), Tmax=(990.119,'K')), NASAPolynomial(coeffs=[25.7406,0.030388,-1.0678e-05,1.88257e-09,-1.30657e-13,-36179.3,-96.7798], Tmin=(990.119,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-245.72,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + radical(CCOJ) + radical(RCCJC)"""),
)
species(
label = 'CCCC[CH][O](1728)',
structure = SMILES('CCCC[CH][O]'),
E0 = (78.0912,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2750,2770,2790,2810,2830,2850,1425,1437.5,1450,1225,1250,1275,1270,1305,1340,700,750,800,300,350,400,2750,2800,2850,1350,1500,750,1050,1375,1000,3025,407.5,1350,352.5,284.58,286.601,291.211,2078.87],'cm^-1')),
HinderedRotor(inertia=(0.00200967,'amu*angstrom^2'), symmetry=1, barrier=(0.119627,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.10398,'amu*angstrom^2'), symmetry=1, barrier=(6.1119,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.103299,'amu*angstrom^2'), symmetry=1, barrier=(6.13902,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.0993848,'amu*angstrom^2'), symmetry=1, barrier=(6.07184,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (86.1323,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[1.20776,0.0668884,-7.57546e-05,6.29928e-08,-2.32085e-11,9487.51,24.9863], Tmin=(100,'K'), Tmax=(767.626,'K')), NASAPolynomial(coeffs=[4.00991,0.045565,-2.09523e-05,3.99079e-09,-2.77682e-13,9255.35,13.4985], Tmin=(767.626,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(78.0912,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(365.837,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-CsH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsHH) + group(Cs-CsHHH) + radical(CCOJ) + radical(CCsJOH)"""),
)
species(
label = 'CHCHO(47)',
structure = SMILES('[CH]=C[O]'),
E0 = (245.848,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([3120,650,792.5,1650,3010,987.5,1337.5,450,1655],'cm^-1')),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (42.0367,'amu'),
collisionModel = TransportData(shapeIndex=2, epsilon=(3625.11,'J/mol'), sigma=(3.97,'angstroms'), dipoleMoment=(0,'De'), polarizability=(0,'angstroms^3'), rotrelaxcollnum=2.0, comment="""NOx2018"""),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[2.06864,0.0187233,-1.21319e-05,-3.33727e-10,2.32882e-12,29739.4,14.7866], Tmin=(200,'K'), Tmax=(1000,'K')), NASAPolynomial(coeffs=[5.96288,0.00799899,-4.30606e-06,1.11076e-09,-1.11415e-13,28725.6,-5.17392], Tmin=(1000,'K'), Tmax=(3000,'K'))], Tmin=(200,'K'), Tmax=(3000,'K'), E0=(245.848,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(108.088,'J/(mol*K)'), label="""CHCHO""", comment="""Thermo library: Klippenstein_Glarborg2016"""),
)
species(
label = 'CCCCC([O])[O](4945)',
structure = SMILES('CCCCC([O])[O]'),
E0 = (-76.7325,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2750,2770,2790,2810,2830,2850,1425,1437.5,1450,1225,1250,1275,1270,1305,1340,700,750,800,300,350,400,1380,1390,370,380,2900,435,2750,2800,2850,1350,1500,750,1050,1375,1000,200,800,1066.67,1333.33,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (102.132,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[2.91049,0.0514419,-2.35394e-05,4.03792e-09,-2.10455e-13,-9217.86,22.5095], Tmin=(100,'K'), Tmax=(2688.64,'K')), NASAPolynomial(coeffs=[41.7048,0.00470864,-3.59396e-06,6.11596e-10,-3.31305e-14,-34048.1,-210.401], Tmin=(2688.64,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-76.7325,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(390.78,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-CsH) + group(O2s-CsH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + radical(CCOJ) + radical(CCOJ)"""),
)
species(
label = 'CCCCC([O])OC1[CH]O1(14335)',
structure = SMILES('CCCCC([O])OC1[CH]O1'),
E0 = (-146.184,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-0.857042,0.106853,-0.000102151,5.60541e-08,-1.27901e-11,-17407,39.5807], Tmin=(100,'K'), Tmax=(1046.07,'K')), NASAPolynomial(coeffs=[14.1687,0.0493945,-1.97561e-05,3.54141e-09,-2.3962e-13,-20550.5,-33.5857], Tmin=(1046.07,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-146.184,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(507.183,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-CsCs) + group(O2s-CsCs) + group(O2s-CsH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsOsOsH) + group(Cs-CsOsHH) + group(Cs-CsHHH) + ring(Ethylene_oxide) + radical(CCOJ) + radical(CCsJO)"""),
)
species(
label = 'CCCCC1O[CH]C([O])O1(14336)',
structure = SMILES('CCCCC1O[CH]C([O])O1'),
E0 = (-237.232,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.47051,0.102478,-9.63531e-05,4.86815e-08,-9.50829e-12,-28320.2,37.7624], Tmin=(100,'K'), Tmax=(1410.8,'K')), NASAPolynomial(coeffs=[20.5116,0.0291387,-6.66644e-06,7.66791e-10,-3.69823e-14,-33426.6,-71.9691], Tmin=(1410.8,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-237.232,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(515.497,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-CsCs) + group(O2s-CsCs) + group(O2s-CsH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsOsOsH) + group(Cs-CsOsHH) + group(Cs-CsHHH) + ring(1,3-Dioxolane) + radical(CCOJ) + radical(CCsJOCs)"""),
)
species(
label = 'CCCCC(=O)OC=CO(14337)',
structure = SMILES('CCCCC(=O)OC=CO'),
E0 = (-631.839,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.76727,0.112261,-9.07416e-05,2.74965e-08,2.2478e-13,-75772.2,37.8161], Tmin=(100,'K'), Tmax=(1008.84,'K')), NASAPolynomial(coeffs=[25.4886,0.0315885,-1.15269e-05,2.06757e-09,-1.44275e-13,-82665.7,-100.827], Tmin=(1008.84,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-631.839,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-(Cds-O2d)(Cds-Cd)) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-(Cds-O2d)CsHH) + group(Cs-CsHHH) + group(Cds-OdCsOs) + group(Cds-CdsOsH) + group(Cds-CdsOsH)"""),
)
species(
label = 'CCCCC(O)OC=C=O(14338)',
structure = SMILES('CCCCC(O)OC=C=O'),
E0 = (-484.396,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.96355,0.115929,-0.000109314,5.19678e-08,-9.6837e-12,-58031.8,40.6535], Tmin=(100,'K'), Tmax=(1309.75,'K')), NASAPolynomial(coeffs=[26.1563,0.0300491,-1.09581e-05,1.90386e-09,-1.27559e-13,-65397.7,-102.596], Tmin=(1309.75,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-484.396,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-(Cdd-O2d)OsH)"""),
)
species(
label = 'CH2(S)(23)',
structure = SMILES('[CH2]'),
E0 = (419.862,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([1369.36,2789.41,2993.36],'cm^-1')),
],
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (14.0266,'amu'),
collisionModel = TransportData(shapeIndex=2, epsilon=(1197.29,'J/mol'), sigma=(3.8,'angstroms'), dipoleMoment=(0,'C*m'), polarizability=(0,'angstroms^3'), rotrelaxcollnum=0.0, comment="""GRI-Mech"""),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[4.19195,-0.00230793,8.0509e-06,-6.60123e-09,1.95638e-12,50484.3,-0.754589], Tmin=(200,'K'), Tmax=(1000,'K')), NASAPolynomial(coeffs=[2.28556,0.00460255,-1.97412e-06,4.09548e-10,-3.34695e-14,50922.4,8.67684], Tmin=(1000,'K'), Tmax=(3000,'K'))], Tmin=(200,'K'), Tmax=(3000,'K'), E0=(419.862,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(58.2013,'J/(mol*K)'), label="""CH2(S)""", comment="""Thermo library: Klippenstein_Glarborg2016"""),
)
species(
label = 'CCCC([O])OC=C[O](14339)',
structure = SMILES('CCCC([O])OC=C[O]'),
E0 = (-274.923,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2750,2783.33,2816.67,2850,1425,1450,1225,1275,1270,1340,700,800,300,400,2995,3025,975,1000,1300,1375,400,500,1630,1680,1380,1390,370,380,2900,435,2750,2800,2850,1350,1500,750,1050,1375,1000,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (130.142,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-0.865221,0.0903677,-5.31653e-05,-6.53957e-09,1.17478e-11,-32875.6,35.9247], Tmin=(100,'K'), Tmax=(981.152,'K')), NASAPolynomial(coeffs=[24.4567,0.0241458,-8.50815e-06,1.56434e-09,-1.13547e-13,-39626,-94.8357], Tmin=(981.152,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-274.923,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(436.51,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + radical(CCOJ) + radical(C=COJ)"""),
)
species(
label = 'CCCCC1OC=COO1(14117)',
structure = SMILES('CCCCC1OC=COO1'),
E0 = (-293.294,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-0.734331,0.0771546,1.98321e-05,-9.60573e-08,4.70203e-11,-35079.9,33.6501], Tmin=(100,'K'), Tmax=(933.045,'K')), NASAPolynomial(coeffs=[27.5978,0.0243059,-5.50994e-06,8.62468e-10,-6.53819e-14,-43353.5,-117.077], Tmin=(933.045,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-293.294,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(515.497,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-OsCs) + group(O2s-O2s(Cds-Cd)) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + ring(124trioxene)"""),
)
species(
label = 'CCCCC([O])C([O])C=O(13348)',
structure = SMILES('CCCCC([O])C([O])C=O'),
E0 = (-166.702,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-0.661814,0.0979899,-7.81315e-05,3.25977e-08,-5.59076e-12,-19878.4,42.8624], Tmin=(100,'K'), Tmax=(1361.31,'K')), NASAPolynomial(coeffs=[17.7238,0.0439669,-1.8605e-05,3.44622e-09,-2.37235e-13,-24884.1,-51.5089], Tmin=(1361.31,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-166.702,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(507.183,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-CsH) + group(O2s-CsH) + group(Cs-CsCsOsH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-(Cds-O2d)CsOsH) + group(Cs-CsCsHH) + group(Cs-CsHHH) + group(Cds-OdCsH) + radical(C=OCOJ) + radical(CC(C)OJ)"""),
)
species(
label = 'O(4)',
structure = SMILES('[O]'),
E0 = (243.005,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (15.9994,'amu'),
collisionModel = TransportData(shapeIndex=0, epsilon=(665.16,'J/mol'), sigma=(2.75,'angstroms'), dipoleMoment=(0,'C*m'), polarizability=(0,'angstroms^3'), rotrelaxcollnum=0.0, comment="""GRI-Mech"""),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[2.5,9.24385e-15,-1.3678e-17,6.66185e-21,-1.00107e-24,29226.7,5.11107], Tmin=(100,'K'), Tmax=(3459.6,'K')), NASAPolynomial(coeffs=[2.5,9.20456e-12,-3.58608e-15,6.15199e-19,-3.92042e-23,29226.7,5.11107], Tmin=(3459.6,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(243.005,'kJ/mol'), Cp0=(20.7862,'J/(mol*K)'), CpInf=(20.7862,'J/(mol*K)'), label="""O""", comment="""Thermo library: BurkeH2O2"""),
)
species(
label = 'CCCC[CH]OC=C[O](3924)',
structure = SMILES('CCCC[CH]OC=C[O]'),
E0 = (-130.25,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2750,2770,2790,2810,2830,2850,1425,1437.5,1450,1225,1250,1275,1270,1305,1340,700,750,800,300,350,400,2995,3025,975,1000,1300,1375,400,500,1630,1680,2750,2800,2850,1350,1500,750,1050,1375,1000,3025,407.5,1350,352.5,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (128.169,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.61297,0.102945,-5.67181e-05,-1.97147e-08,2.05495e-11,-15444.6,36.3062], Tmin=(100,'K'), Tmax=(942.128,'K')), NASAPolynomial(coeffs=[29.9344,0.0197237,-4.97191e-06,8.11328e-10,-6.03288e-14,-23640,-125.957], Tmin=(942.128,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-130.25,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(482.239,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-(Cds-Cd)H) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsHH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsOsH) + radical(C=COJ) + radical(CCsJOC(O))"""),
)
species(
label = '[CH]=COC([O])CCCC(13794)',
structure = SMILES('[CH]=COC([O])CCCC'),
E0 = (15.7225,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2750,2770,2790,2810,2830,2850,1425,1437.5,1450,1225,1250,1275,1270,1305,1340,700,750,800,300,350,400,3010,987.5,1337.5,450,1655,3120,650,792.5,1650,1380,1390,370,380,2900,435,2750,2800,2850,1350,1500,750,1050,1375,1000,200,800,1000,1200,1400,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (128.169,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-1.09256,0.101306,-8.67566e-05,3.79436e-08,-6.63358e-12,2083.14,38.1277], Tmin=(100,'K'), Tmax=(1370.13,'K')), NASAPolynomial(coeffs=[21.6743,0.0348386,-1.39888e-05,2.53656e-09,-1.72994e-13,-4155.52,-78.8786], Tmin=(1370.13,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(15.7225,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(482.239,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-Cd)) + group(O2s-CsH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-CdsOsH) + group(Cds-CdsHH) + radical(CCOJ) + radical(Cds_P)"""),
)
species(
label = 'CCCCC([O])OC[C]=O(14340)',
structure = SMILES('CCCCC([O])OC[C]=O'),
E0 = (-231.158,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2750,2764.29,2778.57,2792.86,2807.14,2821.43,2835.71,2850,1425,1433.33,1441.67,1450,1225,1241.67,1258.33,1275,1270,1293.33,1316.67,1340,700,733.333,766.667,800,300,333.333,366.667,400,1855,455,950,1380,1390,370,380,2900,435,2750,2800,2850,1350,1500,750,1050,1375,1000,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-0.270677,0.103146,-0.000105603,6.95749e-08,-2.07128e-11,-27656.2,39.9903], Tmin=(100,'K'), Tmax=(782.272,'K')), NASAPolynomial(coeffs=[7.32263,0.0643192,-3.11536e-05,6.12873e-09,-4.36778e-13,-28844.3,5.22142], Tmin=(782.272,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-231.158,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-CsCs) + group(O2s-CsH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cs-(Cds-O2d)OsHH) + group(Cds-OdCsH) + radical(CsCJ=O) + radical(CCOJ)"""),
)
species(
label = 'CCCC[C]([O])OCC=O(14341)',
structure = SMILES('CCCC[C]([O])OCC=O'),
E0 = (-180.582,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2750,2764.29,2778.57,2792.86,2807.14,2821.43,2835.71,2850,1425,1433.33,1441.67,1450,1225,1241.67,1258.33,1275,1270,1293.33,1316.67,1340,700,733.333,766.667,800,300,333.333,366.667,400,2782.5,750,1395,475,1775,1000,2750,2800,2850,1350,1500,750,1050,1375,1000,360,370,350,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-0.294573,0.103649,-0.000107036,7.10729e-08,-2.12653e-11,-21572.5,40.0846], Tmin=(100,'K'), Tmax=(779.741,'K')), NASAPolynomial(coeffs=[7.40469,0.0641514,-3.1052e-05,6.10555e-09,-4.34942e-13,-22773.2,4.85591], Tmin=(779.741,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-180.582,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-CsCs) + group(O2s-CsH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cs-(Cds-O2d)OsHH) + group(Cds-OdCsH) + radical(Cs_P) + radical(CCOJ)"""),
)
species(
label = 'CCC[CH]C([O])OCC=O(14342)',
structure = SMILES('CCC[CH]C([O])OCC=O'),
E0 = (-185.926,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2750,2770,2790,2810,2830,2850,1425,1437.5,1450,1225,1250,1275,1270,1305,1340,700,750,800,300,350,400,2782.5,750,1395,475,1775,1000,3025,407.5,1350,352.5,1380,1390,370,380,2900,435,2750,2800,2850,1350,1500,750,1050,1375,1000,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[0.0671256,0.0954039,-8.03761e-05,3.98629e-08,-8.95717e-12,-22227.6,40.5878], Tmin=(100,'K'), Tmax=(997.827,'K')), NASAPolynomial(coeffs=[8.54137,0.0614332,-2.93094e-05,5.74442e-09,-4.09025e-13,-23918.8,-0.277103], Tmin=(997.827,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-185.926,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-CsCs) + group(O2s-CsH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cs-(Cds-O2d)OsHH) + group(Cds-OdCsH) + radical(CCJCO) + radical(CCOJ)"""),
)
species(
label = 'CC[CH]CC([O])OCC=O(14343)',
structure = SMILES('CC[CH]CC([O])OCC=O'),
E0 = (-191.37,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2750,2770,2790,2810,2830,2850,1425,1437.5,1450,1225,1250,1275,1270,1305,1340,700,750,800,300,350,400,2782.5,750,1395,475,1775,1000,3025,407.5,1350,352.5,1380,1390,370,380,2900,435,2750,2800,2850,1350,1500,750,1050,1375,1000,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-0.446196,0.108288,-0.000140553,1.25767e-07,-4.78093e-11,-22866.6,42.4698], Tmin=(100,'K'), Tmax=(769.666,'K')), NASAPolynomial(coeffs=[4.08095,0.0690514,-3.3472e-05,6.49906e-09,-4.55999e-13,-23098.2,24.8366], Tmin=(769.666,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-191.37,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-CsCs) + group(O2s-CsH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-(Cds-O2d)OsHH) + group(Cs-CsHHH) + group(Cds-OdCsH) + radical(CCOJ) + radical(RCCJCC)"""),
)
species(
label = 'C[CH]CCC([O])OCC=O(14344)',
structure = SMILES('C[CH]CCC([O])OCC=O'),
E0 = (-191.382,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2750,2770,2790,2810,2830,2850,1425,1437.5,1450,1225,1250,1275,1270,1305,1340,700,750,800,300,350,400,2782.5,750,1395,475,1775,1000,3025,407.5,1350,352.5,1380,1390,370,380,2900,435,2750,2800,2850,1350,1500,750,1050,1375,1000,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-0.454232,0.10743,-0.000133851,1.15174e-07,-4.29219e-11,-22866.6,42.6729], Tmin=(100,'K'), Tmax=(752.799,'K')), NASAPolynomial(coeffs=[5.07228,0.0672837,-3.2373e-05,6.28191e-09,-4.41358e-13,-23393.2,19.6091], Tmin=(752.799,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-191.382,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-CsCs) + group(O2s-CsH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-(Cds-O2d)OsHH) + group(Cs-CsHHH) + group(Cds-OdCsH) + radical(CCOJ) + radical(RCCJC)"""),
)
species(
label = '[CH2]CCCC([O])OCC=O(14345)',
structure = SMILES('[CH2]CCCC([O])OCC=O'),
E0 = (-180.582,'kJ/mol'),
modes = [
HarmonicOscillator(frequencies=([2750,2764.29,2778.57,2792.86,2807.14,2821.43,2835.71,2850,1425,1433.33,1441.67,1450,1225,1241.67,1258.33,1275,1270,1293.33,1316.67,1340,700,733.333,766.667,800,300,333.333,366.667,400,2782.5,750,1395,475,1775,1000,1380,1390,370,380,2900,435,3000,3100,440,815,1455,1000,200,800,960,1120,1280,1440,1600],'cm^-1')),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
HinderedRotor(inertia=(0.156089,'amu*angstrom^2'), symmetry=1, barrier=(3.5888,'kJ/mol'), semiclassical=False),
],
spinMultiplicity = 3,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-0.294573,0.103649,-0.000107036,7.10729e-08,-2.12653e-11,-21572.5,41.1833], Tmin=(100,'K'), Tmax=(779.741,'K')), NASAPolynomial(coeffs=[7.40469,0.0641514,-3.1052e-05,6.10555e-09,-4.34942e-13,-22773.2,5.95452], Tmin=(779.741,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-180.582,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-CsCs) + group(O2s-CsH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-(Cds-O2d)OsHH) + group(Cs-CsHHH) + group(Cds-OdCsH) + radical(RCCJ) + radical(CCOJ)"""),
)
species(
label = 'CCCCC1O[CH][CH]OO1(14105)',
structure = SMILES('CCCCC1O[CH][CH]OO1'),
E0 = (-31.9057,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-2.89608,0.114184,-0.000101261,4.66228e-08,-8.0872e-12,-3556.71,41.7724], Tmin=(100,'K'), Tmax=(1678.94,'K')), NASAPolynomial(coeffs=[23.6703,0.0284596,-4.63269e-06,2.96308e-10,-4.09337e-15,-9315.89,-90.7456], Tmin=(1678.94,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-31.9057,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(515.497,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-CsCs) + group(O2s-OsCs) + group(O2s-OsCs) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsOsHH) + group(Cs-CsOsHH) + group(Cs-CsHHH) + ring(124trioxane) + radical(CCsJOOC) + radical(CCsJOCs)"""),
)
species(
label = 'CCCCC(=O)OCC=O(14346)',
structure = SMILES('CCCCC(=O)OCC=O'),
E0 = (-603.054,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[0.249971,0.0882007,-5.94421e-05,2.06804e-08,-3.09822e-12,-72401.4,35.3095], Tmin=(100,'K'), Tmax=(1437.21,'K')), NASAPolynomial(coeffs=[12.0539,0.0553485,-2.51548e-05,4.77587e-09,-3.31676e-13,-75794.4,-25.9191], Tmin=(1437.21,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-603.054,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(503.026,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-Cs(Cds-O2d)) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-(Cds-O2d)CsHH) + group(Cs-CsHHH) + group(Cs-(Cds-O2d)OsHH) + group(Cds-OdCsOs) + group(Cds-OdCsH)"""),
)
species(
label = 'CCCCC1OC(C=O)O1(13353)',
structure = SMILES('CCCCC1OC(C=O)O1'),
E0 = (-477.422,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (144.168,'amu'),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[-0.357864,0.0804436,-2.77623e-05,-1.35225e-08,8.233e-12,-57250.9,37.458], Tmin=(100,'K'), Tmax=(1152.06,'K')), NASAPolynomial(coeffs=[18.0133,0.0456121,-2.01095e-05,3.86383e-09,-2.73734e-13,-63405.3,-62.1119], Tmin=(1152.06,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-477.422,'kJ/mol'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(511.34,'J/(mol*K)'), comment="""Thermo group additivity estimation: group(O2s-CsCs) + group(O2s-CsCs) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsCsHH) + group(Cs-CsOsOsH) + group(Cs-CsOsOsH) + group(Cs-CsHHH) + group(Cds-OdCsH) + ring(Cyclobutane)"""),
)
species(
label = 'N2',
structure = SMILES('N#N'),
E0 = (-8.69489,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (28.0135,'amu'),
collisionModel = TransportData(shapeIndex=1, epsilon=(810.913,'J/mol'), sigma=(3.621,'angstroms'), dipoleMoment=(0,'C*m'), polarizability=(1.76,'angstroms^3'), rotrelaxcollnum=4.0, comment="""PrimaryTransportLibrary"""),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[3.61263,-0.00100893,2.49898e-06,-1.43376e-09,2.58636e-13,-1051.1,2.6527], Tmin=(100,'K'), Tmax=(1817.04,'K')), NASAPolynomial(coeffs=[2.9759,0.00164141,-7.19722e-07,1.25378e-10,-7.91526e-15,-1025.84,5.53757], Tmin=(1817.04,'K'), Tmax=(5000,'K'))], Tmin=(100,'K'), Tmax=(5000,'K'), E0=(-8.69489,'kJ/mol'), Cp0=(29.1007,'J/(mol*K)'), CpInf=(37.4151,'J/(mol*K)'), label="""N2""", comment="""Thermo library: BurkeH2O2"""),
)
species(
label = 'Ne',
structure = SMILES('[Ne]'),
E0 = (-6.19738,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
molecularWeight = (20.1797,'amu'),
collisionModel = TransportData(shapeIndex=0, epsilon=(1235.53,'J/mol'), sigma=(3.758e-10,'m'), dipoleMoment=(0,'C*m'), polarizability=(0,'angstroms^3'), rotrelaxcollnum=0, comment="""Epsilon & sigma estimated with fixed Lennard Jones Parameters. This is the fallback method! Try improving transport databases!"""),
energyTransferModel = SingleExponentialDown(alpha0=(3.5886,'kJ/mol'), T0=(300,'K'), n=0.85),
thermo = NASA(polynomials=[NASAPolynomial(coeffs=[2.5,0,0,0,0,-745.375,3.35532], Tmin=(200,'K'), Tmax=(1000,'K')), NASAPolynomial(coeffs=[2.5,0,0,0,0,-745.375,3.35532], Tmin=(1000,'K'), Tmax=(6000,'K'))], Tmin=(200,'K'), Tmax=(6000,'K'), E0=(-6.19738,'kJ/mol'), Cp0=(20.7862,'J/(mol*K)'), CpInf=(20.7862,'J/(mol*K)'), label="""Ne""", comment="""Thermo library: primaryThermoLibrary"""),
)
transitionState(
label = 'TS1',
E0 = (-298.704,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS2',
E0 = (-150.237,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS3',
E0 = (-232.079,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS4',
E0 = (-14.404,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS5',
E0 = (-270.439,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS6',
E0 = (-192.307,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS7',
E0 = (-140.667,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS8',
E0 = (-37.6429,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS9',
E0 = (-218.945,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS10',
E0 = (-50.0767,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS11',
E0 = (-160.951,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS12',
E0 = (-245.852,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS13',
E0 = (-240.367,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS14',
E0 = (-272.972,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS15',
E0 = (-210.421,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS16',
E0 = (-179.471,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS17',
E0 = (-205.191,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS18',
E0 = (-139.392,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS19',
E0 = (-139.405,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS20',
E0 = (59.2452,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS21',
E0 = (169.116,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS22',
E0 = (-116.911,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS23',
E0 = (-237.232,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS24',
E0 = (-273.73,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS25',
E0 = (-273.73,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS26',
E0 = (144.939,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS27',
E0 = (-291.172,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS28',
E0 = (15.0964,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS29',
E0 = (112.754,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS30',
E0 = (258.727,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS31',
E0 = (-125.452,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS32',
E0 = (-97.5836,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS33',
E0 = (-21.1721,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS34',
E0 = (-144.296,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS35',
E0 = (-164.488,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS36',
E0 = (-140.058,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS37',
E0 = (-70.1245,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS38',
E0 = (-31.9057,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS39',
E0 = (-209.735,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
transitionState(
label = 'TS40',
E0 = (-290.796,'kJ/mol'),
spinMultiplicity = 1,
opticalIsomers = 1,
)
reaction(
label = 'reaction1',
reactants = ['CCCCC([O])O[CH]C=O(13350)'],
products = ['OCHCHO(48)', 'CCCCC=O(1733)'],
transitionState = 'TS1',
kinetics = Arrhenius(A=(5e+12,'s^-1'), n=0, Ea=(0,'kJ/mol'), T0=(1,'K'), Tmin=(300,'K'), Tmax=(1500,'K'), comment="""Exact match found for rate rule [RJJ]
Euclidian distance = 0
family: 1,4_Linear_birad_scission"""),
)
reaction(
label = 'reaction2',
reactants = ['CCCCC([O])O[CH]C=O(13350)'],
products = ['CCCCC1OC([CH][O])O1(14319)'],
transitionState = 'TS2',
kinetics = Arrhenius(A=(2.724e+10,'s^-1','*|/',3), n=0.478, Ea=(148.467,'kJ/mol'), T0=(1,'K'), Tmin=(600,'K'), Tmax=(2000,'K'), comment="""Estimated using an average for rate rule [R5_SS_D;doublebond_intra;radadd_intra_O]
Euclidian distance = 0
family: Intra_R_Add_Exocyclic
Ea raised from 147.2 to 148.5 kJ/mol to match endothermicity of reaction."""),
)
reaction(
label = 'reaction3',
reactants = ['H(3)', 'CCCCC(=O)OC=C[O](14320)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS3',
kinetics = Arrhenius(A=(1.83701,'m^3/(mol*s)'), n=1.71338, Ea=(46.5052,'kJ/mol'), T0=(1,'K'), comment="""Estimated using average of templates [CO_O;HJ] + [CO-NdNd_O;YJ] for rate rule [CO-NdNd_O;HJ]
Euclidian distance = 1.0
family: R_Addition_MultipleBond"""),
)
reaction(
label = 'reaction4',
reactants = ['H(3)', 'CCCCC([O])OC=C=O(14321)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS4',
kinetics = Arrhenius(A=(1.54607e+06,'m^3/(mol*s)'), n=0.466452, Ea=(32.4943,'kJ/mol'), T0=(1,'K'), Tmin=(303.03,'K'), Tmax=(2000,'K'), comment="""From training reaction 188 used for Ck_O;HJ
Exact match found for rate rule [Ck_O;HJ]
Euclidian distance = 0
family: R_Addition_MultipleBond"""),
)
reaction(
label = 'reaction5',
reactants = ['butyl_1(82)', '[O]C=COC=O(830)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS5',
kinetics = Arrhenius(A=(7.94e+10,'cm^3/(mol*s)'), n=0, Ea=(28.0328,'kJ/mol'), T0=(1,'K'), Tmin=(333,'K'), Tmax=(363,'K'), comment="""Estimated using template [CO_O;CsJ-CsHH] for rate rule [CO-NdH_O;CsJ-CsHH]
Euclidian distance = 1.0
family: R_Addition_MultipleBond"""),
)
reaction(
label = 'reaction6',
reactants = ['CCCCC=O(1733)', '[O]C=C[O](2537)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS6',
kinetics = Arrhenius(A=(0.148573,'m^3/(mol*s)'), n=1.743, Ea=(77.4229,'kJ/mol'), T0=(1,'K'), comment="""Estimated using average of templates [CO_O;O_rad/OneDe] + [CO-CsH_O;OJ_sec] for rate rule [CO-CsH_O;O_rad/OneDe]
Euclidian distance = 2.0
Multiplied by reaction path degeneracy 2.0
family: R_Addition_MultipleBond"""),
)
reaction(
label = 'reaction7',
reactants = ['CCCCC([O])O[CH]C=O(13350)'],
products = ['CCCC[C](O)OC=C[O](14322)'],
transitionState = 'TS7',
kinetics = Arrhenius(A=(1.43381e+07,'s^-1'), n=1.70481, Ea=(158.036,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R2H_S;Y_rad_out;Cs_H_out_NonDe] for rate rule [R2H_S;O_rad_out;Cs_H_out_NDMustO]
Euclidian distance = 1.41421356237
family: intra_H_migration"""),
)
reaction(
label = 'reaction8',
reactants = ['CCCCC([O])OC=[C]O(14323)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS8',
kinetics = Arrhenius(A=(4.96519e+09,'s^-1'), n=1.05826, Ea=(162.779,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R2H_S;Cd_rad_out_Cd;XH_out] for rate rule [R2H_S;Cd_rad_out_Cd;O_H_out]
Euclidian distance = 1.0
family: intra_H_migration"""),
)
reaction(
label = 'reaction9',
reactants = ['CCC[CH]C(O)OC=C[O](14324)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS9',
kinetics = Arrhenius(A=(5.71,'s^-1'), n=3.021, Ea=(105.562,'kJ/mol'), T0=(1,'K'), Tmin=(300,'K'), Tmax=(2500,'K'), comment="""From training reaction 319 used for R3H_SS_Cs;C_rad_out_H/NonDeC;O_H_out
Exact match found for rate rule [R3H_SS_Cs;C_rad_out_H/NonDeC;O_H_out]
Euclidian distance = 0
family: intra_H_migration"""),
)
reaction(
label = 'reaction10',
reactants = ['CCCCC([O])O[C]=CO(14325)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS10',
kinetics = Arrhenius(A=(4.96975e+09,'s^-1'), n=0.933333, Ea=(150.345,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R3H_DS;Cd_rad_out_singleNd;XH_out] for rate rule [R3H_DS;Cd_rad_out_singleNd;O_H_out]
Euclidian distance = 1.0
family: intra_H_migration"""),
)
reaction(
label = 'reaction11',
reactants = ['CCCCC(O)O[C]=C[O](14326)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS11',
kinetics = Arrhenius(A=(1.3925e+09,'s^-1'), n=0.84206, Ea=(123.714,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R4H_SSS_O(Cs)Cs;Y_rad_out;XH_out] for rate rule [R4H_SSS_O(Cs)Cs;Cd_rad_out_Cd;O_H_out]
Euclidian distance = 3.16227766017
family: intra_H_migration"""),
)
reaction(
label = 'reaction12',
reactants = ['CC[CH]CC(O)OC=C[O](14327)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS12',
kinetics = Arrhenius(A=(2960,'s^-1'), n=2.11, Ea=(84.0984,'kJ/mol'), T0=(1,'K'), Tmin=(300,'K'), Tmax=(2500,'K'), comment="""From training reaction 323 used for R4H_SSS;C_rad_out_H/NonDeC;O_H_out
Exact match found for rate rule [R4H_SSS;C_rad_out_H/NonDeC;O_H_out]
Euclidian distance = 0
family: intra_H_migration"""),
)
reaction(
label = 'reaction13',
reactants = ['CCCCC(O)OC=[C][O](14328)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS13',
kinetics = Arrhenius(A=(380071,'s^-1'), n=1.62386, Ea=(44.2978,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R5H_RSSR;Y_rad_out;XH_out] for rate rule [R5H_DSSS;Cd_rad_out;O_H_out]
Euclidian distance = 2.44948974278
family: intra_H_migration"""),
)
reaction(
label = 'reaction14',
reactants = ['CCCCC([O])O[CH]C=O(13350)'],
products = ['C[CH]CCC(O)OC=C[O](14329)'],
transitionState = 'TS14',
kinetics = Arrhenius(A=(8e+10,'s^-1'), n=0, Ea=(25.7316,'kJ/mol'), T0=(1,'K'), Tmin=(200,'K'), Tmax=(1000,'K'), comment="""From training reaction 307 used for R5H_CCC;O_rad_out;Cs_H_out_H/NonDeC
Exact match found for rate rule [R5H_CCC;O_rad_out;Cs_H_out_H/NonDeC]
Euclidian distance = 0
Multiplied by reaction path degeneracy 2.0
family: intra_H_migration"""),
)
reaction(
label = 'reaction15',
reactants = ['CCCCC([O])O[CH]C=O(13350)'],
products = ['CCCC[C]([O])OC=CO(14330)'],
transitionState = 'TS15',
kinetics = Arrhenius(A=(126000,'s^-1'), n=1.85, Ea=(88.2824,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R5H_SMSS;Y_rad_out;XH_out] for rate rule [R5H_SMSS;O_rad_out;XH_out]
Euclidian distance = 1.0
family: intra_H_migration"""),
)
reaction(
label = 'reaction16',
reactants = ['CCC[CH]C([O])OC=CO(14331)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS16',
kinetics = Arrhenius(A=(46.1,'s^-1'), n=3.21, Ea=(60.7935,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R6H;C_rad_out_H/NonDeC;XH_out] for rate rule [R6H_RSSMS;C_rad_out_H/NonDeC;O_H_out]
Euclidian distance = 1.41421356237
family: intra_H_migration"""),
)
reaction(
label = 'reaction17',
reactants = ['CCCCC([O])O[CH]C=O(13350)'],
products = ['[CH2]CCCC(O)OC=C[O](14332)'],
transitionState = 'TS17',
kinetics = Arrhenius(A=(4.68e+09,'s^-1'), n=0, Ea=(93.5124,'kJ/mol'), T0=(1,'K'), Tmin=(300,'K'), Tmax=(1500,'K'), comment="""From training reaction 140 used for R6H_SSSSS;O_rad_out;Cs_H_out_2H
Exact match found for rate rule [R6H_SSSSS;O_rad_out;Cs_H_out_2H]
Euclidian distance = 0
Multiplied by reaction path degeneracy 3.0
family: intra_H_migration"""),
)
reaction(
label = 'reaction18',
reactants = ['CC[CH]CC([O])OC=CO(14333)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS18',
kinetics = Arrhenius(A=(423.689,'s^-1'), n=2.58367, Ea=(106.315,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [RnH;C_rad_out_H/NonDeC;O_H_out] for rate rule [R7H;C_rad_out_H/NonDeC;O_H_out]
Euclidian distance = 2.0
family: intra_H_migration"""),
)
reaction(
label = 'reaction19',
reactants = ['C[CH]CCC([O])OC=CO(14334)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS19',
kinetics = Arrhenius(A=(423.689,'s^-1'), n=2.58367, Ea=(106.315,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [RnH;C_rad_out_H/NonDeC;O_H_out] for rate rule [R8H;C_rad_out_H/NonDeC;O_H_out]
Euclidian distance = 2.0
family: intra_H_migration"""),
)
reaction(
label = 'reaction20',
reactants = ['CCCC[CH][O](1728)', '[O]C=C[O](2537)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS20',
kinetics = Arrhenius(A=(3.27681e+06,'m^3/(mol*s)'), n=0.151, Ea=(0,'kJ/mol'), T0=(1,'K'), comment="""Estimated using an average for rate rule [O_rad/OneDe;Y_rad]
Euclidian distance = 0
Multiplied by reaction path degeneracy 2.0
family: R_Recombination
Ea raised from -0.7 to 0 kJ/mol."""),
)
reaction(
label = 'reaction21',
reactants = ['CHCHO(47)', 'CCCCC([O])[O](4945)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS21',
kinetics = Arrhenius(A=(7.75733e+07,'m^3/(mol*s)'), n=-0.180109, Ea=(0,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [Y_rad;O_rad/NonDe] for rate rule [Cd_rad;O_rad/NonDe]
Euclidian distance = 1.0
Multiplied by reaction path degeneracy 2.0
family: R_Recombination
Ea raised from -0.2 to 0 kJ/mol."""),
)
reaction(
label = 'reaction22',
reactants = ['CCCCC([O])O[CH]C=O(13350)'],
products = ['CCCCC([O])OC1[CH]O1(14335)'],
transitionState = 'TS22',
kinetics = Arrhenius(A=(2.42595e+10,'s^-1'), n=0.7335, Ea=(181.793,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R3_D;doublebond_intra_pri;radadd_intra] for rate rule [R3_D;doublebond_intra_pri_HNd_O;radadd_intra_O]
Euclidian distance = 2.2360679775
family: Intra_R_Add_Endocyclic"""),
)
reaction(
label = 'reaction23',
reactants = ['CCCCC([O])O[CH]C=O(13350)'],
products = ['CCCCC1O[CH]C([O])O1(14336)'],
transitionState = 'TS23',
kinetics = Arrhenius(A=(1.66591e+07,'s^-1'), n=1.01661, Ea=(61.4715,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R5_SS_D;doublebond_intra_pri;radadd_intra] for rate rule [R5_SS_D;doublebond_intra_pri;radadd_intra_O]
Euclidian distance = 1.0
family: Intra_R_Add_Endocyclic
Ea raised from 59.1 to 61.5 kJ/mol to match endothermicity of reaction."""),
)
reaction(
label = 'reaction24',
reactants = ['CCCCC([O])O[CH]C=O(13350)'],
products = ['CCCCC(=O)OC=CO(14337)'],
transitionState = 'TS24',
kinetics = Arrhenius(A=(2.1261e+09,'s^-1'), n=0.137, Ea=(24.9733,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R5;Y_rad;XH_Rrad] for rate rule [R5radExo;Y_rad;XH_Rrad]
Euclidian distance = 1.0
family: Intra_Disproportionation"""),
)
reaction(
label = 'reaction25',
reactants = ['CCCCC([O])O[CH]C=O(13350)'],
products = ['CCCCC(O)OC=C=O(14338)'],
transitionState = 'TS25',
kinetics = Arrhenius(A=(2.1261e+09,'s^-1'), n=0.137, Ea=(24.9733,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R5;Y_rad;XH_Rrad] for rate rule [R5radExo;Y_rad;XH_Rrad]
Euclidian distance = 1.0
family: Intra_Disproportionation"""),
)
reaction(
label = 'reaction26',
reactants = ['CH2(S)(23)', 'CCCC([O])OC=C[O](14339)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS26',
kinetics = Arrhenius(A=(1.31021e+06,'m^3/(mol*s)'), n=0.189, Ea=(0,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [carbene;C_pri] for rate rule [carbene;C_pri/NonDeC]
Euclidian distance = 1.0
Multiplied by reaction path degeneracy 3.0
family: 1,2_Insertion_carbene
Ea raised from -1.5 to 0 kJ/mol."""),
)
reaction(
label = 'reaction27',
reactants = ['CCCCC([O])O[CH]C=O(13350)'],
products = ['CCCCC1OC=COO1(14117)'],
transitionState = 'TS27',
kinetics = Arrhenius(A=(2e+12,'s^-1'), n=0, Ea=(7.5312,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R6_SSSDS;Y_rad_out;Ypri_rad_out] for rate rule [R6_SSSDS;O_rad;Opri_rad]
Euclidian distance = 1.41421356237
family: Birad_recombination"""),
)
reaction(
label = 'reaction28',
reactants = ['CCCCC([O])O[CH]C=O(13350)'],
products = ['CCCCC([O])C([O])C=O(13348)'],
transitionState = 'TS28',
kinetics = Arrhenius(A=(7040,'s^-1'), n=2.66, Ea=(313.8,'kJ/mol'), T0=(1,'K'), Tmin=(300,'K'), Tmax=(1500,'K'), comment="""Estimated using an average for rate rule [R_ROR;R1_doublebond;R2_doublebond_H;R_O_C]
Euclidian distance = 0
family: ketoenol"""),
)
reaction(
label = 'reaction29',
reactants = ['O(4)', 'CCCC[CH]OC=C[O](3924)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS29',
kinetics = Arrhenius(A=(2085.55,'m^3/(mol*s)'), n=1.09077, Ea=(0,'kJ/mol'), T0=(1,'K'), Tmin=(303.03,'K'), Tmax=(2000,'K'), comment="""Estimated using template [Y_rad;O_birad] for rate rule [C_rad/H/CsO;O_birad]
Euclidian distance = 4.0
family: Birad_R_Recombination
Ea raised from -8.3 to 0 kJ/mol."""),
)
reaction(
label = 'reaction30',
reactants = ['O(4)', '[CH]=COC([O])CCCC(13794)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS30',
kinetics = Arrhenius(A=(2085.55,'m^3/(mol*s)'), n=1.09077, Ea=(0,'kJ/mol'), T0=(1,'K'), Tmin=(303.03,'K'), Tmax=(2000,'K'), comment="""Estimated using template [Y_rad;O_birad] for rate rule [Cd_pri_rad;O_birad]
Euclidian distance = 2.0
family: Birad_R_Recombination
Ea raised from -8.3 to 0 kJ/mol."""),
)
reaction(
label = 'reaction31',
reactants = ['OCHCHO(48)', 'CCCC[CH][O](1728)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS31',
kinetics = Arrhenius(A=(1.2635,'m^3/(mol*s)'), n=2.48, Ea=(21.7568,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [Od_CO-DeH;YJ] for rate rule [Od_CO-DeH;CJ]
Euclidian distance = 1.0
Multiplied by reaction path degeneracy 2.0
family: R_Addition_MultipleBond"""),
)
reaction(
label = 'reaction32',
reactants = ['CCCCC([O])OC[C]=O(14340)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS32',
kinetics = Arrhenius(A=(0.00141351,'s^-1'), n=4.515, Ea=(133.574,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R2H_S;Y_rad_out;Cs_H_out_H/NonDeO] for rate rule [R2H_S;CO_rad_out;Cs_H_out_H/NonDeO]
Euclidian distance = 1.0
Multiplied by reaction path degeneracy 2.0
family: intra_H_migration"""),
)
reaction(
label = 'reaction33',
reactants = ['CCCC[C]([O])OCC=O(14341)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS33',
kinetics = Arrhenius(A=(3.32e+07,'s^-1'), n=1.69, Ea=(159.41,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R3H_SS_O;Y_rad_out;Cs_H_out_H/OneDe] for rate rule [R3H_SS_O;Y_rad_out;Cs_H_out_H/CO]
Euclidian distance = 1.0
Multiplied by reaction path degeneracy 2.0
family: intra_H_migration"""),
)
reaction(
label = 'reaction34',
reactants = ['CCC[CH]C([O])OCC=O(14342)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS34',
kinetics = Arrhenius(A=(0.502,'s^-1'), n=3.86, Ea=(41.6308,'kJ/mol'), T0=(1,'K'), Tmin=(300,'K'), Tmax=(2500,'K'), comment="""Estimated using template [R4H_SSS;C_rad_out_H/NonDeC;Cs_H_out_H/OneDe] for rate rule [R4H_SSS;C_rad_out_H/NonDeC;Cs_H_out_H/CO]
Euclidian distance = 1.0
Multiplied by reaction path degeneracy 2.0
family: intra_H_migration"""),
)
reaction(
label = 'reaction35',
reactants = ['CC[CH]CC([O])OCC=O(14343)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS35',
kinetics = Arrhenius(A=(0.0756983,'s^-1'), n=3.26, Ea=(26.8822,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R5H_SSSS;C_rad_out_H/NonDeC;Cs_H_out_1H] for rate rule [R5H_SSSS;C_rad_out_H/NonDeC;Cs_H_out_H/CO]
Euclidian distance = 2.0
Multiplied by reaction path degeneracy 2.0
family: intra_H_migration"""),
)
reaction(
label = 'reaction36',
reactants = ['C[CH]CCC([O])OCC=O(14344)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS36',
kinetics = Arrhenius(A=(155.257,'s^-1'), n=2.02667, Ea=(51.3237,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R6H_SSSSS;C_rad_out_single;Cs_H_out_H/OneDe] for rate rule [R6H_SSSSS;C_rad_out_H/NonDeC;Cs_H_out_H/CO]
Euclidian distance = 2.2360679775
Multiplied by reaction path degeneracy 2.0
family: intra_H_migration"""),
)
reaction(
label = 'reaction37',
reactants = ['[CH2]CCCC([O])OCC=O(14345)'],
products = ['CCCCC([O])O[CH]C=O(13350)'],
transitionState = 'TS37',
kinetics = Arrhenius(A=(5.18e+08,'s^-1'), n=1.01, Ea=(110.458,'kJ/mol'), T0=(1,'K'), comment="""Estimated using template [R7H;C_rad_out_2H;Cs_H_out_H/OneDe] for rate rule [R7H;C_rad_out_2H;Cs_H_out_H/CO]
Euclidian distance = 1.0
Multiplied by reaction path degeneracy 2.0
family: intra_H_migration"""),
)
reaction(
label = 'reaction38',
reactants = ['CCCCC([O])O[CH]C=O(13350)'],
products = ['CCCCC1O[CH][CH]OO1(14105)'],
transitionState = 'TS38',
kinetics = Arrhenius(A=(4.39512e+11,'s^-1'), n=0.277081, Ea=(266.798,'kJ/mol'), T0=(1,'K'), comment="""Estimated using average of templates [R6plus;carbonyl_intra_H;radadd_intra] + [R6_linear;multiplebond_intra;radadd_intra] for rate rule [R6_linear;carbonyl_intra_H;radadd_intra_O]
Euclidian distance = 2.2360679775
family: Intra_R_Add_Endocyclic
Ea raised from 265.4 to 266.8 kJ/mol to match endothermicity of reaction."""),
)
reaction(
label = 'reaction39',
reactants = ['CCCCC([O])O[CH]C=O(13350)'],
products = ['CCCCC(=O)OCC=O(14346)'],
transitionState = 'TS39',
kinetics = Arrhenius(A=(2.6374e+09,'s^-1'), n=0.37, Ea=(88.9686,'kJ/mol'), T0=(1,'K'), comment="""Estimated using average of templates [R3;Y_rad_De;XH_Rrad] + [R3radExo;Y_rad;XH_Rrad] for rate rule [R3radExo;Y_rad_De;XH_Rrad]
Euclidian distance = 1.0
family: Intra_Disproportionation"""),
)
reaction(
label = 'reaction40',
reactants = ['CCCCC([O])O[CH]C=O(13350)'],
products = ['CCCCC1OC(C=O)O1(13353)'],
transitionState = 'TS40',
kinetics = Arrhenius(A=(1.8e+12,'s^-1'), n=-0.1525, Ea=(7.90776,'kJ/mol'), T0=(1,'K'), comment="""Estimated using average of templates [Rn;C_rad_out_H/OneDe;Ypri_rad_out] + [R4_SSS;C_rad_out_single;Ypri_rad_out] for rate rule [R4_SSS;C_rad_out_H/OneDe;Opri_rad]
Euclidian distance = 2.2360679775
family: Birad_recombination"""),
)
network(
label = '2715',
isomers = [
'CCCCC([O])O[CH]C=O(13350)',
],
reactants = [
('OCHCHO(48)', 'CCCCC=O(1733)'),
],
bathGas = {
'N2': 0.5,
'Ne': 0.5,
},
)
pressureDependence(
label = '2715',
Tmin = (300,'K'),
Tmax = (2000,'K'),
Tcount = 8,
Tlist = ([302.47,323.145,369.86,455.987,609.649,885.262,1353.64,1896.74],'K'),
Pmin = (0.01,'bar'),
Pmax = (100,'bar'),
Pcount = 5,
Plist = ([0.0125282,0.0667467,1,14.982,79.8202],'bar'),
maximumGrainSize = (0.5,'kcal/mol'),
minimumGrainCount = 250,
method = 'modified strong collision',
interpolationModel = ('Chebyshev', 6, 4),
activeKRotor = True,
activeJRotor = True,
rmgmode = True,
)
|
[
"qin.she@husky.neu.edu"
] |
qin.she@husky.neu.edu
|
4fbdf8557e5a9c34e48538a69f02f7ebb9a07e07
|
2daa3894e6d6929fd04145100d8a3be5eedbe21c
|
/tests/artificial/transf_pow3/trend_linear/cycle_0/ar_/test_artificial_128_pow3_linear_0__0.py
|
02a765a3634a574c09d19185e979246cdc9569dc
|
[
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
Henri-Lo/pyaf
|
a1f73a0cc807873bd7b79648fe51de9cfd6c126a
|
08c968425d85dcace974d90db7f07c845a0fe914
|
refs/heads/master
| 2021-07-01T12:27:31.600232
| 2017-09-21T11:19:04
| 2017-09-21T11:19:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 305
|
py
|
import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
dataset = tsds.generate_random_TS(N = 128 , FREQ = 'D', seed = 0, trendtype = "linear", cycle_length = 0, transform = "pow3", sigma = 0.0, exog_count = 0, ar_order = 0);
art.process_dataset(dataset);
|
[
"antoine.carme@laposte.net"
] |
antoine.carme@laposte.net
|
a3eec36289a9fd7c7473aad001070f60822c0b37
|
b5d0a6254b54c0a778181a67bcda14cc6663e871
|
/0-notes/job-search/Cracking the Coding Interview/C13Java/questions/13.3-question.py
|
c5d092a41c6e24953c6673c0cda130ad2dac0976
|
[
"MIT",
"LicenseRef-scancode-public-domain"
] |
permissive
|
Web-Dev-Collaborative/Lambda-Final-Backup
|
113e719a76a144b86d06f3a412afe4b02689cad7
|
e9ab84928faa8364bacd863009ae9aec01ff9d1e
|
refs/heads/master
| 2023-06-07T15:34:00.682815
| 2021-04-17T01:53:14
| 2021-04-17T01:53:14
| 358,899,122
| 0
| 0
|
MIT
| 2023-05-30T04:03:16
| 2021-04-17T14:24:53
|
JavaScript
|
UTF-8
|
Python
| false
| false
| 83
|
py
|
# 13.3 Final, etc.
# What is the difference between final, finally, and finalize?
|
[
"bryan.guner@gmail.com"
] |
bryan.guner@gmail.com
|
fb210f7f5afaf1f68f627a6e2dcde02c698f21ca
|
011a750fae8ade67f726a9749e05cc4afb8e360d
|
/Vivo_create case/test.py
|
e6a6e3b03328bade918031fabf7cb58627217543
|
[] |
no_license
|
MartinCarufel/PycharmProjects
|
c7e50b66a24d4a216b7a217192fcd446f5324d9f
|
aaa6c95b3e2e6525586fb6a03d1c9d484065899b
|
refs/heads/master
| 2023-07-05T22:40:38.650892
| 2023-06-26T13:55:13
| 2023-06-26T13:55:13
| 150,859,642
| 1
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 513
|
py
|
import pyautogui as pg
class Test_suite:
def __init__(self):
self.win_main = {
'win logo': 'win_logo.png',
'new case': 'new case.png'
}
pass
def test1(self):
# location = pg.locateCenterOnScreen('win_logo.png', confidence=0.9)
# print(location)
# pg.moveTo(pg.locateCenterOnScreen('win_logo.png', confidence=0.9))
pg.click(pg.locateCenterOnScreen(self.win_main['new case'], confidence=0.9))
t = Test_suite()
t.test1()
|
[
"maccam6@gmail.com"
] |
maccam6@gmail.com
|
6e5b0ee9ab79d06d5476373ffc2f7c284b0045e4
|
4c614f080633e6a4b372047191b3930f0a17c714
|
/blog/views.py
|
19719c7f9c1f81f3f0f3c4b208c80c72056e9356
|
[] |
no_license
|
Eimis/Blog
|
963d942d1ca8bcce62c14840906d89ec16fbbca1
|
92b61f5807dd28515c22efc7e300da16d8f9e33d
|
refs/heads/master
| 2020-04-06T05:03:38.029555
| 2014-03-09T21:35:03
| 2014-03-09T21:35:03
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 1,504
|
py
|
from django.http import HttpResponse
from django.shortcuts import render
from blog.models import Post
from blog.forms import ContactForm
from django.core.mail import send_mail
from django.http import HttpResponseRedirect
def Main(request):
lastest_posts = Post.objects.filter(display=True).order_by("-pub_date",) [:2]
return render(request, "main.html", {"lastest_posts": lastest_posts, })
def Posts(request): # list of Posts in blog
posts = Post.objects.all().order_by("-pub_date")
return render(request, "blog.html", {"posts" : posts,})
def post(request, slug):
post = Post.objects.get(slug=slug) ## Atvaizduoja atitinkama posta pagal slug.
## Apparently skirtinguose viewsuose galima
## naudoti vienodus vardus.
return render(request, "post.html", {"post" : post})
def About(request):
post = Post.objects.get(title = "About")
return render(request, "about.html", {"post" : post})
def Contact(request):
if request.method == 'POST':
form = ContactForm(request.POST)
if form.is_valid():
cd = form.cleaned_data
send_mail(
cd['subject'],
cd['message'],
cd.get('email', 'noreply@example.com'),
['eimantas.stonys@gmail.com'],
)
return HttpResponseRedirect('/contact/thanks/')
else:
form = ContactForm()
return render(request, 'contact.html', {'form': form})
def Thanks(request):
return render(request, "thanks.html",)
|
[
"eimantas.stonys@gmail.com"
] |
eimantas.stonys@gmail.com
|
ab8dedf977f6fb17bb98fb4a05ac19722ff1c918
|
4e5e65d7c07f1a4a85899f10a4eea4977a2ce9a9
|
/scripts/clock_deblur.py
|
f1ec2b5bbc551fd0f1de8cafae922033946d6086
|
[] |
no_license
|
stefanv/aims2014
|
6f5545c668269c1a5db8876fcc3d0735b5225aa7
|
384b9ee8d21dce6d9092ec4b8416859a90225bfc
|
refs/heads/master
| 2020-05-27T07:46:09.487556
| 2014-07-18T14:35:15
| 2014-07-18T14:35:15
| 21,921,085
| 1
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 1,565
|
py
|
import numpy as np
import matplotlib.pyplot as plt
from skimage import io, color
from skimage.viewer import ImageViewer
from skimage.viewer.widgets import Slider
from skimage.viewer.plugins.base import Plugin
image = io.imread('../images/clock_motion.png')
M, N = image.shape
## Should pad, but doesn't make much difference in this case
MM, NN = 2 * M + 1, 2 * N + 1
def hann(image):
wy = np.hanning(image.shape[0])[:, None]
wx = np.hanning(image.shape[1])
## Apply Hann window to prevent ringing
wy = np.hanning(M)[:, None]
wx = np.hanning(N)
f = np.zeros((MM, NN))
f[:M, :N] = wy * wx * image
F = np.fft.fft2(f)
v, u = np.ogrid[:MM, :NN]
v -= (MM - 1)/2
u -= (NN - 1)/2
def apply_inverse_filter(image, T, a, b, K=5, clip=500):
uavb = u * a + v * b
H = T * np.sinc(uavb) * np.exp(-1j * np.pi * uavb)
H = np.fft.fftshift(H)
HH = 1./H
HH[np.abs(HH) > K] = K
gg = np.abs(np.fft.ifft2(F * HH))
gg = gg[:M, :N]
gg = np.clip(gg, 0, clip)
gg -= gg.min()
gg /= gg.max()
return gg
viewer = ImageViewer(image)
plugin = Plugin(image_filter=apply_inverse_filter)
plugin += Slider('T', 0, 1, value=0.5, value_type='float', update_on='release')
plugin += Slider('a', -0.1, 0.1, value=0, value_type='float', update_on='release')
plugin += Slider('b', -0.1, 0.1, value=0, value_type='float', update_on='release')
plugin += Slider('K', 0, 100, value=15, value_type='float', update_on='release')
plugin += Slider('clip', 0, 1000, value=750, value_type='float', update_on='release')
viewer += plugin
viewer.show()
|
[
"stefan@sun.ac.za"
] |
stefan@sun.ac.za
|
6c0ef3d70e2d5bad70f88ff429e96d14cc060b77
|
4eb4f5c834e6448782ea11b23dd724551f8988a0
|
/media/documents/Cross Sections/Runway new/script.py
|
17aed56b9fad07affbf77397f9b070c32ce93fe0
|
[] |
no_license
|
Mohab25/Tubra_Django
|
c272736c56e970a918c174307babf7aeae85af25
|
97f422c6f0645ad8e87a247edf33a49921bde451
|
refs/heads/master
| 2023-08-13T16:29:59.504867
| 2021-09-19T14:24:44
| 2021-09-19T14:24:44
| 340,656,691
| 1
| 0
| null | 2021-07-13T06:49:36
| 2021-02-20T13:05:48
|
JavaScript
|
UTF-8
|
Python
| false
| false
| 151
|
py
|
import os
from pathlib import Path
for f in os.listdir():
#print(os.path.splitext(f))
if f.endswith('pdf'):
print(os.path.abspath(f))
|
[
"homab3@gmail.com"
] |
homab3@gmail.com
|
334291795d858fe938f874cc6ecda0da265926b5
|
7137161629a1003583744cc3bd0e5d3498e0a924
|
/airflow/api_connexion/endpoints/provider_endpoint.py
|
844dcd301495c6871f6f034a8d15bd189b6ef130
|
[
"Apache-2.0",
"BSD-3-Clause",
"MIT"
] |
permissive
|
jbampton/airflow
|
3fca85975854eb916f16143b659a9119af143963
|
dcfa14d60dade3fdefa001d10013466fe4d77f0d
|
refs/heads/master
| 2023-05-25T22:31:49.104069
| 2021-09-18T19:18:32
| 2021-09-18T19:18:32
| 247,645,744
| 3
| 0
|
Apache-2.0
| 2020-03-16T08:12:58
| 2020-03-16T08:12:57
| null |
UTF-8
|
Python
| false
| false
| 1,860
|
py
|
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import re
from typing import Dict, List
from airflow.api_connexion import security
from airflow.api_connexion.schemas.provider_schema import ProviderCollection, provider_collection_schema
from airflow.providers_manager import ProviderInfo, ProvidersManager
from airflow.security import permissions
def _remove_rst_syntax(value: str) -> str:
return re.sub("[`_<>]", "", value.strip(" \n."))
def _provider_mapper(provider: ProviderInfo) -> Dict:
return {
"package_name": provider[1]["package-name"],
"description": _remove_rst_syntax(provider[1]["description"]),
"version": provider[0],
}
@security.requires_access([(permissions.ACTION_CAN_READ, permissions.RESOURCE_PROVIDER)])
def get_providers():
"""Get providers"""
providers_info: List[ProviderInfo] = list(ProvidersManager().providers.values())
providers = [_provider_mapper(d) for d in providers_info]
total_entries = len(providers)
return provider_collection_schema.dump(
ProviderCollection(providers=providers, total_entries=total_entries)
)
|
[
"noreply@github.com"
] |
jbampton.noreply@github.com
|
ca7bf250ae56e722ce0dc3fac6cd5b4ef5bab44a
|
7357d367b0af4650ccc5b783b7a59090fdde47bb
|
/reviewboard/webapi/tests/test_api_token.py
|
3d593bfe820b220205713483c9c685fc11ca54bf
|
[
"MIT"
] |
permissive
|
BarracudaPff/code-golf-data-python
|
fb0cfc74d1777c4246d56a5db8525432bf37ab1a
|
42e8858c2ebc6a061012bcadb167d29cebb85c5e
|
refs/heads/main
| 2023-05-29T05:52:22.856551
| 2020-05-23T22:12:48
| 2020-05-23T22:12:48
| 378,832,634
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 6,613
|
py
|
def _compare_item(self, item_rsp, api_token):
self.assertEqual(item_rsp["id"], api_token.pk)
self.assertEqual(item_rsp["token"], api_token.token)
self.assertEqual(item_rsp["note"], api_token.note)
self.assertEqual(item_rsp["policy"], api_token.policy)
self.assertEqual(item_rsp["extra_data"], api_token.extra_data)
class APITokenTestsMixin(object):
token_data = {"note": "This is my new token.", "policy": '{"perms": "ro", "resources": {"*": {"allow": ["*"]}}}'}
@six.add_metaclass(BasicTestsMetaclass)
class ResourceListTests(SpyAgency, ExtraDataListMixin, BaseWebAPITestCase, APITokenTestsMixin):
"""Testing the APITokenResource list APIs."""
fixtures = ["test_users"]
sample_api_url = "users/<username>/api-tokens/"
resource = resources.api_token
test_api_token_access = False
test_oauth_token_access = False
compare_item = _compare_item
def setup_basic_get_test(self, user, with_local_site, local_site_name, populate_items):
if populate_items:
if not with_local_site:
LocalSite.objects.create(name=self.local_site_name)
items = list(user.webapi_tokens.all())
items.append(self.create_webapi_token(user, note="Token 1", with_local_site=with_local_site))
self.create_webapi_token(user, note="Token 2", with_local_site=not with_local_site)
else:
items = []
return (get_api_token_list_url(user, local_site_name), api_token_list_mimetype, items)
def test_get_with_api_token_auth_denied(self):
"""Testing the GET users/<username>/api-tokens/ API denies access
when using token-based authentication
"""
user = self._authenticate_basic_tests(with_webapi_token=True)
url = self.setup_basic_get_test(user, False, None, True)[0]
rsp = self.api_get(url, expected_status=403)
self.assertEqual(rsp["stat"], "fail")
self.assertEqual(rsp["err"]["code"], PERMISSION_DENIED.code)
def setup_basic_post_test(self, user, with_local_site, local_site_name, post_valid_data):
if post_valid_data:
post_data = self.token_data.copy()
else:
post_data = {}
return (get_api_token_list_url(user, local_site_name), api_token_item_mimetype, post_data, [local_site_name])
def check_post_result(self, user, rsp, local_site_name):
token_rsp = rsp["api_token"]
token = WebAPIToken.objects.get(pk=token_rsp["id"])
self.compare_item(token_rsp, token)
if local_site_name:
self.assertIsNotNone(token.local_site_id)
self.assertEqual(token.local_site.name, local_site_name)
else:
self.assertIsNone(token.local_site_id)
def test_post_with_generation_error(self):
"""Testing the POST users/<username>/api-tokens/ API
with Token Generation Failed error"""
def _generate_token(self, *args, **kwargs):
kwargs["max_attempts"] = 0
orig_generate_token(*args, **kwargs)
orig_generate_token = WebAPIToken.objects.generate_token
self.spy_on(WebAPIToken.objects.generate_token, call_fake=_generate_token)
rsp = self.api_post(get_api_token_list_url(self.user), self.token_data, expected_status=500)
self.assertEqual(rsp["stat"], "fail")
self.assertEqual(rsp["err"]["code"], TOKEN_GENERATION_FAILED.code)
self.assertEqual(rsp["err"]["msg"], "Could not create a unique API token. " "Please try again.")
def test_post_with_api_token_auth_denied(self):
"""Testing the POST users/<username>/api-tokens/ API denies access
when using token-based authentication
"""
user = self._authenticate_basic_tests(with_webapi_token=True)
url = self.setup_basic_post_test(user, False, None, True)[0]
rsp = self.api_get(url, expected_status=403)
self.assertEqual(rsp["stat"], "fail")
self.assertEqual(rsp["err"]["code"], PERMISSION_DENIED.code)
@six.add_metaclass(BasicTestsMetaclass)
class ResourceItemTests(ExtraDataItemMixin, BaseWebAPITestCase, APITokenTestsMixin):
"""Testing the APITokenResource item APIs."""
fixtures = ["test_users"]
sample_api_url = "users/<username>/api-tokens/<id>/"
resource = resources.api_token
test_api_token_access = False
test_oauth_token_access = False
compare_item = _compare_item
def setup_basic_delete_test(self, user, with_local_site, local_site_name):
token = self.create_webapi_token(user, with_local_site=with_local_site)
return (get_api_token_item_url(token, local_site_name), [token.pk])
def check_delete_result(self, user, token_id):
self.assertIsNone(get_object_or_none(WebAPIToken, pk=token_id))
def test_delete_with_api_token_auth_denied(self):
"""Testing the DELETE users/<username>/api-tokens/<id>/ API denies
access when using token-based authentication
"""
user = self._authenticate_basic_tests(with_webapi_token=True)
url = self.setup_basic_delete_test(user, False, None)[0]
rsp = self.api_get(url, expected_status=403)
self.assertEqual(rsp["stat"], "fail")
self.assertEqual(rsp["err"]["code"], PERMISSION_DENIED.code)
def setup_basic_get_test(self, user, with_local_site, local_site_name):
token = self.create_webapi_token(user, with_local_site=with_local_site)
return (get_api_token_item_url(token, local_site_name), api_token_item_mimetype, token)
def test_get_not_modified(self):
"""Testing the GET users/<username>/api-tokens/<id>/ API
with Not Modified response
"""
token = self.create_webapi_token(self.user)
self._testHttpCaching(get_api_token_item_url(token), check_last_modified=True)
def test_get_with_api_token_auth_denied(self):
"""Testing the GET users/<username>/api-tokens/<id>/ API denies access
when using token-based authentication
"""
user = self._authenticate_basic_tests(with_webapi_token=True)
url = self.setup_basic_get_test(user, False, None)[0]
rsp = self.api_get(url, expected_status=403)
self.assertEqual(rsp["stat"], "fail")
self.assertEqual(rsp["err"]["code"], PERMISSION_DENIED.code)
def setup_basic_put_test(self, user, with_local_site, local_site_name, put_valid_data):
token = self.create_webapi_token(user, with_local_site=with_local_site)
return (get_api_token_item_url(token, local_site_name), api_token_item_mimetype, self.token_data.copy(), token, [])
def check_put_result(self, user, item_rsp, token):
self.compare_item(item_rsp, WebAPIToken.objects.get(pk=token.pk))
def test_put_with_api_token_auth_denied(self):
"""Testing the PUT users/<username>/api-tokens/<id>/ API denies access
when using token-based authentication
"""
user = self._authenticate_basic_tests(with_webapi_token=True)
url = self.setup_basic_put_test(user, False, None, True)[0]
rsp = self.api_get(url, expected_status=403)
self.assertEqual(rsp["stat"], "fail")
self.assertEqual(rsp["err"]["code"], PERMISSION_DENIED.code)
|
[
"sokolov.yas@gmail.com"
] |
sokolov.yas@gmail.com
|
415b4b5ca762243855aa661b8bc21b3924351c99
|
47f1b125b401ac2b0d18b9ce685b5c3d13f68e3e
|
/stasis/events.py
|
13c680790a74cff9936789e4632311b3f44d75bf
|
[] |
no_license
|
fschulze/stasis
|
fb7473361c8be870851589e18a17682ebd06f92c
|
368d82b3927d365e1ca61e11600093652520b4d8
|
refs/heads/master
| 2020-05-18T02:20:49.456035
| 2014-03-18T07:18:12
| 2014-03-18T07:18:12
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 193
|
py
|
from stasis.interfaces import IPreBuild
from zope.interface import implementer
@implementer(IPreBuild)
class PreBuild(object):
def __init__(self, site):
self.site = site.registry
|
[
"florian.schulze@gmx.net"
] |
florian.schulze@gmx.net
|
e6753a2fe1b15385d615ae5728f98d265dc21c09
|
5fda498ef0bfc06962ad9b864d229193c45ccb4a
|
/Project1_Analyzing_the_NYC_Subway_Dataset/problem_sets2to5/problem_set5_mapreduce_on_subway_data/5_2_ridership_by_weather_reducer.py
|
9c13400465ec13fe64f0972326294c13776e3bbf
|
[] |
no_license
|
prabhurgit/Data_Aanlyst_Nanodegree_projects
|
7934869b63cae57cb2851e22a5023c6cbe3d18ba
|
a7a13d93c632cd1840ba3a00fff80a60a131b7f3
|
refs/heads/master
| 2021-05-31T18:47:48.669414
| 2016-03-30T04:08:39
| 2016-03-30T04:08:39
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 2,014
|
py
|
import sys
import logging
from util import reducer_logfile
logging.basicConfig(filename=reducer_logfile, format='%(message)s',
level=logging.INFO, filemode='w')
def reducer():
'''
Given the output of the mapper for this assignment, the reducer should
print one row per weather type, along with the average value of
ENTRIESn_hourly for that weather type, separated by a tab. You can assume
that the input to the reducer will be sorted by weather type, such that all
entries corresponding to a given weather type will be grouped together.
In order to compute the average value of ENTRIESn_hourly, you'll need to
keep track of both the total riders per weather type and the number of
hours with that weather type. That's why we've initialized the variable
riders and num_hours below. Feel free to use a different data structure in
your solution, though.
An example output row might look like this:
'fog-norain\t1105.32467557'
Since you are printing the output of your program, printing a debug
statement will interfere with the operation of the grader. Instead,
use the logging module, which we've configured to log to a file printed
when you click "Test Run". For example:
logging.info("My debugging message")
'''
riders = 0 # The number of total riders for this key
num_hours = 0 # The number of hours with this key
old_key = None
for line in sys.stdin:
data = line.strip().split("\t")
if len(data) != 2:
continue
this_key = data[0]
if old_key == this_key:
num_hours += 1.0
riders += float(data[1])
else:
if old_key != None and num_hours != 0:
print "{0}\t{1}".format(old_key, riders/num_hours)
num_hours = 1.0
riders = float(data[1])
old_key = this_key
# your code here
print "{0}\t{1}".format(old_key, riders/num_hours)
reducer()
|
[
"xiewisdom@gmail.com"
] |
xiewisdom@gmail.com
|
a11b54daac573504f8b596a4715a12396b6239a4
|
d5a32e532fe231c16e52149604f0db34c5f4d2f9
|
/binarysearch.io/balanced_brackets_II.py
|
562ba59830209f53abf53bc59e7af7b3cc668ba9
|
[
"MIT"
] |
permissive
|
mishrakeshav/Competitive-Programming
|
93705f63337639e8464c1d50f3394434b7422f15
|
00c1bd272646754ca4c260d57989304c8e323838
|
refs/heads/master
| 2023-07-06T07:32:23.042324
| 2023-06-29T15:27:24
| 2023-06-29T15:27:24
| 216,195,590
| 3
| 3
|
MIT
| 2020-10-03T07:55:18
| 2019-10-19T11:27:53
|
Python
|
UTF-8
|
Python
| false
| false
| 539
|
py
|
class Solution:
def solve(self, s):
# Write your code here
stack = []
string_open = ["(", "[", "{" ]
string_closed = [")", "]", "}"]
for i in s:
if i in string_open:
stack.append(i)
else:
if len(stack) == 0:
return False
if string_closed.index(i) != string_open.index(stack.pop()):
return False
return len(stack) == 0
|
[
"mishrakeshav@users.noreply.github.com"
] |
mishrakeshav@users.noreply.github.com
|
3cc2d219b945557f9b170857474e1e2c2f0bce18
|
94a16dc81580ba7fb8776775e479e097ffa07a2e
|
/Base/string_base.py
|
45835074661ad68f0cb5d0a8c28413bfbb81bb9d
|
[] |
no_license
|
lixiang007666/Algorithm_LanQiao
|
0cc0cf17056125c963e26cc4eb539716128410d7
|
9e70788fbab774956f61ceafb12ad98cb8d42c3a
|
refs/heads/master
| 2022-12-31T04:45:07.110726
| 2020-10-17T05:54:32
| 2020-10-17T05:54:32
| 304,841,096
| 2
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 511
|
py
|
import math
import cmath
import sys
import string
import heapq
import bisect
from queue import Queue,PriorityQueue,LifoQueue
from collections import Counter,deque
from itertools import permutations,combinations
from functools import cmp_to_key
s="rwegwe"
print(s.count("rw"))
print(s.endswith("e"))
print(s.startswith("r"))
print(s.find("1"))#-1
print(s.index("r"))
print(s.find("r"))
print(s.islower())
print(s.upper())
print(s.isupper())#return
print(s.replace("r","1"))
print(s)
print(s.replace("rw","1"))
|
[
"54010254+lixiang007666@users.noreply.github.com"
] |
54010254+lixiang007666@users.noreply.github.com
|
45e1218b30d8f3a3a0ad3e5c3d93c3244d83f9d2
|
809371376cda523a26a6198ddff097cef7c985e7
|
/tb/test_udp.py
|
a1e2da1a83aa89235e9334a4e588998b8026040e
|
[
"MIT"
] |
permissive
|
ethercat-fpga/verilog-ethernet
|
cfabcdabefc4cede40677a88a52341e9697d68a2
|
18d6aab16de8950f98824232213841138c8a82e3
|
refs/heads/master
| 2020-05-05T07:41:18.618994
| 2019-04-04T05:32:06
| 2019-04-04T05:32:06
| 179,834,085
| 1
| 1
| null | 2019-04-06T13:01:56
| 2019-04-06T13:01:56
| null |
UTF-8
|
Python
| false
| false
| 19,425
|
py
|
#!/usr/bin/env python
"""
Copyright (c) 2014-2018 Alex Forencich
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.
"""
from myhdl import *
import os
import eth_ep
import ip_ep
import udp_ep
module = 'udp'
testbench = 'test_%s' % module
srcs = []
srcs.append("../rtl/%s.v" % module)
srcs.append("../rtl/udp_checksum_gen.v")
srcs.append("../rtl/udp_ip_rx.v")
srcs.append("../rtl/udp_ip_tx.v")
srcs.append("../lib/axis/rtl/axis_fifo.v")
srcs.append("%s.v" % testbench)
src = ' '.join(srcs)
build_cmd = "iverilog -o %s.vvp %s" % (testbench, src)
def bench():
# Inputs
clk = Signal(bool(0))
rst = Signal(bool(0))
current_test = Signal(intbv(0)[8:])
s_ip_hdr_valid = Signal(bool(0))
s_ip_eth_dest_mac = Signal(intbv(0)[48:])
s_ip_eth_src_mac = Signal(intbv(0)[48:])
s_ip_eth_type = Signal(intbv(0)[16:])
s_ip_version = Signal(intbv(0)[4:])
s_ip_ihl = Signal(intbv(0)[4:])
s_ip_dscp = Signal(intbv(0)[6:])
s_ip_ecn = Signal(intbv(0)[2:])
s_ip_length = Signal(intbv(0)[16:])
s_ip_identification = Signal(intbv(0)[16:])
s_ip_flags = Signal(intbv(0)[3:])
s_ip_fragment_offset = Signal(intbv(0)[13:])
s_ip_ttl = Signal(intbv(0)[8:])
s_ip_protocol = Signal(intbv(0)[8:])
s_ip_header_checksum = Signal(intbv(0)[16:])
s_ip_source_ip = Signal(intbv(0)[32:])
s_ip_dest_ip = Signal(intbv(0)[32:])
s_ip_payload_axis_tdata = Signal(intbv(0)[8:])
s_ip_payload_axis_tvalid = Signal(bool(0))
s_ip_payload_axis_tlast = Signal(bool(0))
s_ip_payload_axis_tuser = Signal(bool(0))
s_udp_hdr_valid = Signal(bool(0))
s_udp_eth_dest_mac = Signal(intbv(0)[48:])
s_udp_eth_src_mac = Signal(intbv(0)[48:])
s_udp_eth_type = Signal(intbv(0)[16:])
s_udp_ip_version = Signal(intbv(0)[4:])
s_udp_ip_ihl = Signal(intbv(0)[4:])
s_udp_ip_dscp = Signal(intbv(0)[6:])
s_udp_ip_ecn = Signal(intbv(0)[2:])
s_udp_ip_identification = Signal(intbv(0)[16:])
s_udp_ip_flags = Signal(intbv(0)[3:])
s_udp_ip_fragment_offset = Signal(intbv(0)[13:])
s_udp_ip_ttl = Signal(intbv(0)[8:])
s_udp_ip_header_checksum = Signal(intbv(0)[16:])
s_udp_ip_source_ip = Signal(intbv(0)[32:])
s_udp_ip_dest_ip = Signal(intbv(0)[32:])
s_udp_source_port = Signal(intbv(0)[16:])
s_udp_dest_port = Signal(intbv(0)[16:])
s_udp_length = Signal(intbv(0)[16:])
s_udp_checksum = Signal(intbv(0)[16:])
s_udp_payload_axis_tdata = Signal(intbv(0)[8:])
s_udp_payload_axis_tvalid = Signal(bool(0))
s_udp_payload_axis_tlast = Signal(bool(0))
s_udp_payload_axis_tuser = Signal(bool(0))
m_ip_payload_axis_tready = Signal(bool(0))
m_ip_hdr_ready = Signal(bool(0))
m_udp_hdr_ready = Signal(bool(0))
m_udp_payload_axis_tready = Signal(bool(0))
# Outputs
s_ip_hdr_ready = Signal(bool(0))
s_ip_payload_axis_tready = Signal(bool(0))
s_udp_hdr_ready = Signal(bool(0))
s_udp_payload_axis_tready = Signal(bool(0))
m_ip_hdr_valid = Signal(bool(0))
m_ip_eth_dest_mac = Signal(intbv(0)[48:])
m_ip_eth_src_mac = Signal(intbv(0)[48:])
m_ip_eth_type = Signal(intbv(0)[16:])
m_ip_version = Signal(intbv(0)[4:])
m_ip_ihl = Signal(intbv(0)[4:])
m_ip_dscp = Signal(intbv(0)[6:])
m_ip_ecn = Signal(intbv(0)[2:])
m_ip_length = Signal(intbv(0)[16:])
m_ip_identification = Signal(intbv(0)[16:])
m_ip_flags = Signal(intbv(0)[3:])
m_ip_fragment_offset = Signal(intbv(0)[13:])
m_ip_ttl = Signal(intbv(0)[8:])
m_ip_protocol = Signal(intbv(0)[8:])
m_ip_header_checksum = Signal(intbv(0)[16:])
m_ip_source_ip = Signal(intbv(0)[32:])
m_ip_dest_ip = Signal(intbv(0)[32:])
m_ip_payload_axis_tdata = Signal(intbv(0)[8:])
m_ip_payload_axis_tvalid = Signal(bool(0))
m_ip_payload_axis_tlast = Signal(bool(0))
m_ip_payload_axis_tuser = Signal(bool(0))
m_udp_hdr_valid = Signal(bool(0))
m_udp_eth_dest_mac = Signal(intbv(0)[48:])
m_udp_eth_src_mac = Signal(intbv(0)[48:])
m_udp_eth_type = Signal(intbv(0)[16:])
m_udp_ip_version = Signal(intbv(0)[4:])
m_udp_ip_ihl = Signal(intbv(0)[4:])
m_udp_ip_dscp = Signal(intbv(0)[6:])
m_udp_ip_ecn = Signal(intbv(0)[2:])
m_udp_ip_length = Signal(intbv(0)[16:])
m_udp_ip_identification = Signal(intbv(0)[16:])
m_udp_ip_flags = Signal(intbv(0)[3:])
m_udp_ip_fragment_offset = Signal(intbv(0)[13:])
m_udp_ip_ttl = Signal(intbv(0)[8:])
m_udp_ip_protocol = Signal(intbv(0)[8:])
m_udp_ip_header_checksum = Signal(intbv(0)[16:])
m_udp_ip_source_ip = Signal(intbv(0)[32:])
m_udp_ip_dest_ip = Signal(intbv(0)[32:])
m_udp_source_port = Signal(intbv(0)[16:])
m_udp_dest_port = Signal(intbv(0)[16:])
m_udp_length = Signal(intbv(0)[16:])
m_udp_checksum = Signal(intbv(0)[16:])
m_udp_payload_axis_tdata = Signal(intbv(0)[8:])
m_udp_payload_axis_tvalid = Signal(bool(0))
m_udp_payload_axis_tlast = Signal(bool(0))
m_udp_payload_axis_tuser = Signal(bool(0))
rx_busy = Signal(bool(0))
tx_busy = Signal(bool(0))
rx_error_header_early_termination = Signal(bool(0))
rx_error_payload_early_termination = Signal(bool(0))
tx_error_payload_early_termination = Signal(bool(0))
# sources and sinks
ip_source_pause = Signal(bool(0))
ip_sink_pause = Signal(bool(0))
udp_source_pause = Signal(bool(0))
udp_sink_pause = Signal(bool(0))
ip_source = ip_ep.IPFrameSource()
ip_source_logic = ip_source.create_logic(
clk,
rst,
ip_hdr_ready=s_ip_hdr_ready,
ip_hdr_valid=s_ip_hdr_valid,
eth_dest_mac=s_ip_eth_dest_mac,
eth_src_mac=s_ip_eth_src_mac,
eth_type=s_ip_eth_type,
ip_version=s_ip_version,
ip_ihl=s_ip_ihl,
ip_dscp=s_ip_dscp,
ip_ecn=s_ip_ecn,
ip_length=s_ip_length,
ip_identification=s_ip_identification,
ip_flags=s_ip_flags,
ip_fragment_offset=s_ip_fragment_offset,
ip_ttl=s_ip_ttl,
ip_protocol=s_ip_protocol,
ip_header_checksum=s_ip_header_checksum,
ip_source_ip=s_ip_source_ip,
ip_dest_ip=s_ip_dest_ip,
ip_payload_tdata=s_ip_payload_axis_tdata,
ip_payload_tvalid=s_ip_payload_axis_tvalid,
ip_payload_tready=s_ip_payload_axis_tready,
ip_payload_tlast=s_ip_payload_axis_tlast,
ip_payload_tuser=s_ip_payload_axis_tuser,
pause=ip_source_pause,
name='ip_source'
)
ip_sink = ip_ep.IPFrameSink()
ip_sink_logic = ip_sink.create_logic(
clk,
rst,
ip_hdr_ready=m_ip_hdr_ready,
ip_hdr_valid=m_ip_hdr_valid,
eth_dest_mac=m_ip_eth_dest_mac,
eth_src_mac=m_ip_eth_src_mac,
eth_type=m_ip_eth_type,
ip_version=m_ip_version,
ip_ihl=m_ip_ihl,
ip_dscp=m_ip_dscp,
ip_ecn=m_ip_ecn,
ip_length=m_ip_length,
ip_identification=m_ip_identification,
ip_flags=m_ip_flags,
ip_fragment_offset=m_ip_fragment_offset,
ip_ttl=m_ip_ttl,
ip_protocol=m_ip_protocol,
ip_header_checksum=m_ip_header_checksum,
ip_source_ip=m_ip_source_ip,
ip_dest_ip=m_ip_dest_ip,
ip_payload_tdata=m_ip_payload_axis_tdata,
ip_payload_tvalid=m_ip_payload_axis_tvalid,
ip_payload_tready=m_ip_payload_axis_tready,
ip_payload_tlast=m_ip_payload_axis_tlast,
ip_payload_tuser=m_ip_payload_axis_tuser,
pause=ip_sink_pause,
name='ip_sink'
)
udp_source = udp_ep.UDPFrameSource()
udp_source_logic = udp_source.create_logic(
clk,
rst,
udp_hdr_ready=s_udp_hdr_ready,
udp_hdr_valid=s_udp_hdr_valid,
eth_dest_mac=s_udp_eth_dest_mac,
eth_src_mac=s_udp_eth_src_mac,
eth_type=s_udp_eth_type,
ip_version=s_udp_ip_version,
ip_ihl=s_udp_ip_ihl,
ip_dscp=s_udp_ip_dscp,
ip_ecn=s_udp_ip_ecn,
ip_identification=s_udp_ip_identification,
ip_flags=s_udp_ip_flags,
ip_fragment_offset=s_udp_ip_fragment_offset,
ip_ttl=s_udp_ip_ttl,
ip_header_checksum=s_udp_ip_header_checksum,
ip_source_ip=s_udp_ip_source_ip,
ip_dest_ip=s_udp_ip_dest_ip,
udp_source_port=s_udp_source_port,
udp_dest_port=s_udp_dest_port,
udp_length=s_udp_length,
udp_checksum=s_udp_checksum,
udp_payload_tdata=s_udp_payload_axis_tdata,
udp_payload_tvalid=s_udp_payload_axis_tvalid,
udp_payload_tready=s_udp_payload_axis_tready,
udp_payload_tlast=s_udp_payload_axis_tlast,
udp_payload_tuser=s_udp_payload_axis_tuser,
pause=udp_source_pause,
name='udp_source'
)
udp_sink = udp_ep.UDPFrameSink()
udp_sink_logic = udp_sink.create_logic(
clk,
rst,
udp_hdr_ready=m_udp_hdr_ready,
udp_hdr_valid=m_udp_hdr_valid,
eth_dest_mac=m_udp_eth_dest_mac,
eth_src_mac=m_udp_eth_src_mac,
eth_type=m_udp_eth_type,
ip_version=m_udp_ip_version,
ip_ihl=m_udp_ip_ihl,
ip_dscp=m_udp_ip_dscp,
ip_ecn=m_udp_ip_ecn,
ip_length=m_udp_ip_length,
ip_identification=m_udp_ip_identification,
ip_flags=m_udp_ip_flags,
ip_fragment_offset=m_udp_ip_fragment_offset,
ip_ttl=m_udp_ip_ttl,
ip_protocol=m_udp_ip_protocol,
ip_header_checksum=m_udp_ip_header_checksum,
ip_source_ip=m_udp_ip_source_ip,
ip_dest_ip=m_udp_ip_dest_ip,
udp_source_port=m_udp_source_port,
udp_dest_port=m_udp_dest_port,
udp_length=m_udp_length,
udp_checksum=m_udp_checksum,
udp_payload_tdata=m_udp_payload_axis_tdata,
udp_payload_tvalid=m_udp_payload_axis_tvalid,
udp_payload_tready=m_udp_payload_axis_tready,
udp_payload_tlast=m_udp_payload_axis_tlast,
udp_payload_tuser=m_udp_payload_axis_tuser,
pause=udp_sink_pause,
name='udp_sink'
)
# DUT
if os.system(build_cmd):
raise Exception("Error running build command")
dut = Cosimulation(
"vvp -m myhdl %s.vvp -lxt2" % testbench,
clk=clk,
rst=rst,
current_test=current_test,
s_ip_hdr_valid=s_ip_hdr_valid,
s_ip_hdr_ready=s_ip_hdr_ready,
s_ip_eth_dest_mac=s_ip_eth_dest_mac,
s_ip_eth_src_mac=s_ip_eth_src_mac,
s_ip_eth_type=s_ip_eth_type,
s_ip_version=s_ip_version,
s_ip_ihl=s_ip_ihl,
s_ip_dscp=s_ip_dscp,
s_ip_ecn=s_ip_ecn,
s_ip_length=s_ip_length,
s_ip_identification=s_ip_identification,
s_ip_flags=s_ip_flags,
s_ip_fragment_offset=s_ip_fragment_offset,
s_ip_ttl=s_ip_ttl,
s_ip_protocol=s_ip_protocol,
s_ip_header_checksum=s_ip_header_checksum,
s_ip_source_ip=s_ip_source_ip,
s_ip_dest_ip=s_ip_dest_ip,
s_ip_payload_axis_tdata=s_ip_payload_axis_tdata,
s_ip_payload_axis_tvalid=s_ip_payload_axis_tvalid,
s_ip_payload_axis_tready=s_ip_payload_axis_tready,
s_ip_payload_axis_tlast=s_ip_payload_axis_tlast,
s_ip_payload_axis_tuser=s_ip_payload_axis_tuser,
m_ip_hdr_valid=m_ip_hdr_valid,
m_ip_hdr_ready=m_ip_hdr_ready,
m_ip_eth_dest_mac=m_ip_eth_dest_mac,
m_ip_eth_src_mac=m_ip_eth_src_mac,
m_ip_eth_type=m_ip_eth_type,
m_ip_version=m_ip_version,
m_ip_ihl=m_ip_ihl,
m_ip_dscp=m_ip_dscp,
m_ip_ecn=m_ip_ecn,
m_ip_length=m_ip_length,
m_ip_identification=m_ip_identification,
m_ip_flags=m_ip_flags,
m_ip_fragment_offset=m_ip_fragment_offset,
m_ip_ttl=m_ip_ttl,
m_ip_protocol=m_ip_protocol,
m_ip_header_checksum=m_ip_header_checksum,
m_ip_source_ip=m_ip_source_ip,
m_ip_dest_ip=m_ip_dest_ip,
m_ip_payload_axis_tdata=m_ip_payload_axis_tdata,
m_ip_payload_axis_tvalid=m_ip_payload_axis_tvalid,
m_ip_payload_axis_tready=m_ip_payload_axis_tready,
m_ip_payload_axis_tlast=m_ip_payload_axis_tlast,
m_ip_payload_axis_tuser=m_ip_payload_axis_tuser,
s_udp_hdr_valid=s_udp_hdr_valid,
s_udp_hdr_ready=s_udp_hdr_ready,
s_udp_eth_dest_mac=s_udp_eth_dest_mac,
s_udp_eth_src_mac=s_udp_eth_src_mac,
s_udp_eth_type=s_udp_eth_type,
s_udp_ip_version=s_udp_ip_version,
s_udp_ip_ihl=s_udp_ip_ihl,
s_udp_ip_dscp=s_udp_ip_dscp,
s_udp_ip_ecn=s_udp_ip_ecn,
s_udp_ip_identification=s_udp_ip_identification,
s_udp_ip_flags=s_udp_ip_flags,
s_udp_ip_fragment_offset=s_udp_ip_fragment_offset,
s_udp_ip_ttl=s_udp_ip_ttl,
s_udp_ip_header_checksum=s_udp_ip_header_checksum,
s_udp_ip_source_ip=s_udp_ip_source_ip,
s_udp_ip_dest_ip=s_udp_ip_dest_ip,
s_udp_source_port=s_udp_source_port,
s_udp_dest_port=s_udp_dest_port,
s_udp_length=s_udp_length,
s_udp_checksum=s_udp_checksum,
s_udp_payload_axis_tdata=s_udp_payload_axis_tdata,
s_udp_payload_axis_tvalid=s_udp_payload_axis_tvalid,
s_udp_payload_axis_tready=s_udp_payload_axis_tready,
s_udp_payload_axis_tlast=s_udp_payload_axis_tlast,
s_udp_payload_axis_tuser=s_udp_payload_axis_tuser,
m_udp_hdr_valid=m_udp_hdr_valid,
m_udp_hdr_ready=m_udp_hdr_ready,
m_udp_eth_dest_mac=m_udp_eth_dest_mac,
m_udp_eth_src_mac=m_udp_eth_src_mac,
m_udp_eth_type=m_udp_eth_type,
m_udp_ip_version=m_udp_ip_version,
m_udp_ip_ihl=m_udp_ip_ihl,
m_udp_ip_dscp=m_udp_ip_dscp,
m_udp_ip_ecn=m_udp_ip_ecn,
m_udp_ip_length=m_udp_ip_length,
m_udp_ip_identification=m_udp_ip_identification,
m_udp_ip_flags=m_udp_ip_flags,
m_udp_ip_fragment_offset=m_udp_ip_fragment_offset,
m_udp_ip_ttl=m_udp_ip_ttl,
m_udp_ip_protocol=m_udp_ip_protocol,
m_udp_ip_header_checksum=m_udp_ip_header_checksum,
m_udp_ip_source_ip=m_udp_ip_source_ip,
m_udp_ip_dest_ip=m_udp_ip_dest_ip,
m_udp_source_port=m_udp_source_port,
m_udp_dest_port=m_udp_dest_port,
m_udp_length=m_udp_length,
m_udp_checksum=m_udp_checksum,
m_udp_payload_axis_tdata=m_udp_payload_axis_tdata,
m_udp_payload_axis_tvalid=m_udp_payload_axis_tvalid,
m_udp_payload_axis_tready=m_udp_payload_axis_tready,
m_udp_payload_axis_tlast=m_udp_payload_axis_tlast,
m_udp_payload_axis_tuser=m_udp_payload_axis_tuser,
rx_busy=rx_busy,
tx_busy=tx_busy,
rx_error_header_early_termination=rx_error_header_early_termination,
rx_error_payload_early_termination=rx_error_payload_early_termination,
tx_error_payload_early_termination=tx_error_payload_early_termination
)
@always(delay(4))
def clkgen():
clk.next = not clk
rx_error_header_early_termination_asserted = Signal(bool(0))
rx_error_payload_early_termination_asserted = Signal(bool(0))
tx_error_payload_early_termination_asserted = Signal(bool(0))
@always(clk.posedge)
def monitor():
if (rx_error_header_early_termination):
rx_error_header_early_termination_asserted.next = 1
if (rx_error_payload_early_termination):
rx_error_payload_early_termination_asserted.next = 1
if (tx_error_payload_early_termination):
tx_error_payload_early_termination_asserted.next = 1
@instance
def check():
yield delay(100)
yield clk.posedge
rst.next = 1
yield clk.posedge
rst.next = 0
yield clk.posedge
yield delay(100)
yield clk.posedge
yield clk.posedge
print("test 1: test UDP RX packet")
current_test.next = 1
test_frame = udp_ep.UDPFrame()
test_frame.eth_dest_mac = 0x5A5152535455
test_frame.eth_src_mac = 0xDAD1D2D3D4D5
test_frame.eth_type = 0x0800
test_frame.ip_version = 4
test_frame.ip_ihl = 5
test_frame.ip_dscp = 0
test_frame.ip_ecn = 0
test_frame.ip_length = None
test_frame.ip_identification = 0
test_frame.ip_flags = 2
test_frame.ip_fragment_offset = 0
test_frame.ip_ttl = 64
test_frame.ip_protocol = 0x11
test_frame.ip_header_checksum = None
test_frame.ip_source_ip = 0xc0a80165
test_frame.ip_dest_ip = 0xc0a80164
test_frame.udp_source_port = 1234
test_frame.udp_dest_port = 5678
test_frame.payload = bytearray(range(32))
test_frame.build()
ip_frame = test_frame.build_ip()
ip_source.send(ip_frame)
yield udp_sink.wait()
rx_frame = udp_sink.recv()
assert rx_frame == test_frame
assert ip_source.empty()
assert ip_sink.empty()
assert udp_source.empty()
assert udp_sink.empty()
yield delay(100)
yield clk.posedge
print("test 2: test UDP TX packet")
current_test.next = 2
test_frame = udp_ep.UDPFrame()
test_frame.eth_dest_mac = 0x5A5152535455
test_frame.eth_src_mac = 0xDAD1D2D3D4D5
test_frame.eth_type = 0x0800
test_frame.ip_version = 4
test_frame.ip_ihl = 5
test_frame.ip_dscp = 0
test_frame.ip_ecn = 0
test_frame.ip_length = None
test_frame.ip_identification = 0
test_frame.ip_flags = 2
test_frame.ip_fragment_offset = 0
test_frame.ip_ttl = 64
test_frame.ip_protocol = 0x11
test_frame.ip_header_checksum = None
test_frame.ip_source_ip = 0xc0a80165
test_frame.ip_dest_ip = 0xc0a80164
test_frame.udp_source_port = 1234
test_frame.udp_dest_port = 5678
test_frame.payload = bytearray(range(32))
test_frame.build()
udp_source.send(test_frame)
yield ip_sink.wait()
rx_frame = ip_sink.recv()
check_frame = udp_ep.UDPFrame()
check_frame.parse_ip(rx_frame)
assert check_frame == test_frame
assert ip_source.empty()
assert ip_sink.empty()
assert udp_source.empty()
assert udp_sink.empty()
yield delay(100)
raise StopSimulation
return instances()
def test_bench():
sim = Simulation(bench())
sim.run()
if __name__ == '__main__':
print("Running test...")
test_bench()
|
[
"alex@alexforencich.com"
] |
alex@alexforencich.com
|
422de43b4ef0122243bded337050617c53c4ebc2
|
8a42fc0a988ab3c03a8a74c6c75452acfe289b4d
|
/changing_ar.py
|
62306f64242aa45ea1c080f38186d983c1560c38
|
[] |
no_license
|
rw1993/PyAr
|
5c5d5fc4a90b08b9b4a6e0883141b491ccaf45da
|
a09bc8ba4cda11f4e4cccdc4b6575b61ae0f18e0
|
refs/heads/master
| 2021-01-17T17:39:30.240020
| 2017-05-04T06:51:48
| 2017-05-04T06:51:48
| 60,001,886
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 1,151
|
py
|
# -*- coding: utf-8 -*-
# author: rw
# E-mail: weiyanjie10@gmail.com
import random
import numpy
class AR(object, ):
def __init__(self, parameters, frequency, sd=0.3):
self.parameters = parameters
self.p = len(self.parameters[0])
self.frequency = frequency
self.group = len(self.parameters)
self._xs = [random.random() for i in range(self.p)]
self.sd = 0.3
@property
def noise(self):
return numpy.random.normal(scale=self.sd)
@property
def timeseries(self):
group_count = 0
while group_count < self.group:
group_count += 1
frequency_count = 0
parameter = numpy.array(self.parameters.pop())
while frequency_count < self.frequency:
past_p_xs = numpy.array(self._xs[-self.p:])
new_x = parameter.dot(past_p_xs)
new_x += self.noise
if new_x > 1.0:
new_x = 1.0
elif new_x < -1.0:
new_x = -1.0
self._xs.append(new_x)
frequency_count += 1
return self._xs
|
[
"470177412@qq.com"
] |
470177412@qq.com
|
e9988575c264c67dcbce4e890dcb51a309b29451
|
97e11c65903f583dfc4f51da13cae8236cc7180e
|
/bungie_d1_sdk_python/Model/Destiny/tier_type.py
|
d8adb485dd91c2ca861c648d845e99ad840f4b78
|
[] |
no_license
|
Yogarine/bungie-d1-sdk-python
|
7272566f017ecb29a22d8f3560cb8e61ce765f72
|
ca1f3562d5c343d2151abc88e98bdde678893780
|
refs/heads/master
| 2020-07-03T15:21:43.983126
| 2019-08-12T14:56:43
| 2019-08-12T14:56:43
| 201,950,279
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 2,561
|
py
|
# coding: utf-8
"""
Unofficial Bungie.net API for Destiny 1
These are legacy endpoints for Destiny 1 that are no longer supported officially by Bungie. # noqa: E501
OpenAPI spec version: 1.0.0
Contact: lowlines89@gmail.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class TierType(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
"""
allowed enum values
"""
TIER_TYPE__0 = "0"
TIER_TYPE__1 = "1"
TIER_TYPE__2 = "2"
TIER_TYPE__3 = "3"
TIER_TYPE__4 = "4"
TIER_TYPE__5 = "5"
TIER_TYPE__6 = "6"
"""
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 = {
}
attribute_map = {
}
def __init__(self): # noqa: E501
"""TierType - a model defined in OpenAPI""" # noqa: E501
self.discriminator = None
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, TierType):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
|
[
"alwin@garsi.de"
] |
alwin@garsi.de
|
6ce9552ca184f38e6e2d9c997408e19359780a15
|
fe0017ae33385d7a2857d0aa39fa8861b40c8a88
|
/env/lib/python3.8/site-packages/sklearn/linear_model/omp.py
|
e78001aa19b4c7faf0b95c9506bd156e52f47cdb
|
[] |
no_license
|
enriquemoncerrat/frasesback
|
eec60cc7f078f9d24d155713ca8aa86f401c61bf
|
e2c77f839c77f54e08a2f0930880cf423e66165b
|
refs/heads/main
| 2023-01-03T23:21:05.968846
| 2020-10-18T21:20:27
| 2020-10-18T21:20:27
| 305,198,286
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 563
|
py
|
# THIS FILE WAS AUTOMATICALLY GENERATED BY deprecated_modules.py
import sys
# mypy error: Module X has no attribute y (typically for C extensions)
from . import _omp # type: ignore
from ..externals._pep562 import Pep562
from ..utils.deprecation import _raise_dep_warning_if_not_pytest
deprecated_path = 'sklearn.linear_model.omp'
correct_import_path = 'sklearn.linear_model'
_raise_dep_warning_if_not_pytest(deprecated_path, correct_import_path)
def __getattr__(name):
return getattr(_omp, name)
if not sys.version_info >= (3, 7):
Pep562(__name__)
|
[
"enriquemoncerrat@gmail.com"
] |
enriquemoncerrat@gmail.com
|
fda825983d13f563814638eb165bc887ff748cc2
|
6e61b1711a0876eecf8d8f258b3f92c8bbcdf496
|
/yes/google-cloud-sdk/lib/surface/container/clusters/create.py
|
03f4fe09cacf2a2aa6e666c503c36d988f210c26
|
[
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] |
permissive
|
lupynua/language-school
|
661c49a075c5ecfb4814146bac7016c6b1ff7e09
|
9a9d37ed4cb000379d3d49296a17b7d648c18dba
|
refs/heads/develop
| 2021-01-16T22:08:24.485744
| 2017-11-06T16:26:16
| 2017-11-06T16:26:16
| 64,672,552
| 0
| 0
| null | 2016-08-01T14:12:39
| 2016-08-01T14:12:39
| null |
UTF-8
|
Python
| false
| false
| 10,937
|
py
|
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless 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.
"""Create cluster command."""
import argparse
import random
import string
from apitools.base.py import exceptions as apitools_exceptions
from googlecloudsdk.api_lib.compute import constants
from googlecloudsdk.api_lib.container import api_adapter
from googlecloudsdk.api_lib.container import kubeconfig as kconfig
from googlecloudsdk.api_lib.container import util
from googlecloudsdk.calliope import arg_parsers
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.command_lib.container import flags
from googlecloudsdk.core import log
def _Args(parser):
"""Register flags for this command.
Args:
parser: An argparse.ArgumentParser-like object. It is mocked out in order
to capture some information, but behaves like an ArgumentParser.
"""
parser.add_argument('name', help='The name of this cluster.')
# Timeout in seconds for operation
parser.add_argument(
'--timeout',
type=int,
default=1800,
help=argparse.SUPPRESS)
flags.AddClustersWaitAndAsyncFlags(parser)
parser.add_argument(
'--num-nodes',
type=arg_parsers.BoundedInt(1),
help='The number of nodes to be created in each of the cluster\'s zones.',
default=3)
parser.add_argument(
'--additional-zones',
type=arg_parsers.ArgList(min_length=1),
metavar='ZONE',
action=arg_parsers.FloatingListValuesCatcher(),
help="""\
The set of additional zones in which the specified node footprint should be
replicated. All zones must be in the same region as the cluster's primary zone.
If additional-zones is not specified, all nodes will be in the cluster's primary
zone.
Note that `NUM_NODES` nodes will be created in each zone, such that if you
specify `--num-nodes=4` and choose one additional zone, 8 nodes will be created.
Multiple locations can be specified, separated by commas. For example:
$ {{command}} example-cluster --zone us-central1-a --additional-zones us-central1-b,us-central1-c
""")
parser.add_argument(
'--machine-type', '-m',
help='The type of machine to use for nodes. Defaults to '
'server-specified')
parser.add_argument(
'--subnetwork',
help='The name of the Google Compute Engine subnetwork '
'(https://cloud.google.com/compute/docs/subnetworks) to which the '
'cluster is connected. If specified, the cluster\'s network must be a '
'"custom subnet" network. Specification of subnetworks is an '
'alpha feature, and requires that the '
'Google Compute Engine alpha API be enabled.')
parser.add_argument(
'--disable-addons',
type=arg_parsers.ArgList(
choices=[api_adapter.INGRESS, api_adapter.HPA]),
help='List of cluster addons to disable. Options are {0}'.format(
', '.join([api_adapter.INGRESS, api_adapter.HPA])))
parser.add_argument(
'--network',
help='The Compute Engine Network that the cluster will connect to. '
'Google Container Engine will use this network when creating routes '
'and firewalls for the clusters. Defaults to the \'default\' network.')
parser.add_argument(
'--cluster-ipv4-cidr',
help='The IP address range for the pods in this cluster in CIDR '
'notation (e.g. 10.0.0.0/14). Due to kube-proxy limitations, this range'
'must be a subset of the 10.0.0.0/8 space. Defaults to server-specified')
parser.add_argument(
'--password',
help='The password to use for cluster auth. Defaults to a '
'randomly-generated string.')
parser.add_argument(
'--scopes',
type=arg_parsers.ArgList(min_length=1),
metavar='SCOPE',
action=arg_parsers.FloatingListValuesCatcher(),
help="""\
Specifies scopes for the node instances. The project's default
service account is used. Examples:
$ {{command}} example-cluster --scopes https://www.googleapis.com/auth/devstorage.read_only
$ {{command}} example-cluster --scopes bigquery,storage-rw,compute-ro
Multiple SCOPEs can specified, separated by commas. The scopes
necessary for the cluster to function properly (compute-rw, storage-ro),
are always added, even if not explicitly specified.
SCOPE can be either the full URI of the scope or an alias.
Available aliases are:
[format="csv",options="header"]
|========
Alias,URI
{aliases}
|========
""".format(
aliases='\n'.join(
','.join(value) for value in
sorted(constants.SCOPES.iteritems()))))
parser.add_argument(
'--enable-cloud-endpoints',
action='store_true',
default=True,
help='Automatically enable Google Cloud Endpoints to take advantage of '
'API management features.')
parser.add_argument(
'--enable-cloud-logging',
action='store_true',
default=True,
help='Automatically send logs from the cluster to the '
'Google Cloud Logging API.')
parser.set_defaults(enable_cloud_logging=True)
parser.add_argument(
'--enable-cloud-monitoring',
action='store_true',
default=True,
help='Automatically send metrics from pods in the cluster to the '
'Google Cloud Monitoring API. VM metrics will be collected by Google '
'Compute Engine regardless of this setting.')
parser.set_defaults(enable_cloud_monitoring=True)
parser.add_argument(
'--disk-size',
type=int,
help='Size in GB for node VM boot disks. Defaults to 100GB.')
parser.add_argument(
'--username', '-u',
help='The user name to use for cluster auth.',
default='admin')
parser.add_argument(
'--max-nodes-per-pool',
type=arg_parsers.BoundedInt(100, api_adapter.MAX_NODES_PER_POOL),
help='The maximum number of nodes to allocate per default initial node '
'pool. Container engine will automatically create enough nodes pools '
'such that each node pool contains less than '
'--max-nodes-per-pool nodes. Defaults to {nodes} nodes, but can be set '
'as low as 100 nodes per pool on initial create.'.format(
nodes=api_adapter.MAX_NODES_PER_POOL))
parser.add_argument(
'--cluster-version',
help=argparse.SUPPRESS)
parser.add_argument(
'--tags',
help=argparse.SUPPRESS,
type=arg_parsers.ArgList(min_length=1),
metavar='TAGS',
action=arg_parsers.FloatingListValuesCatcher())
NO_CERTS_ERROR_FMT = '''\
Failed to get certificate data for cluster; the kubernetes
api may not be accessible. You can retry later by running
{command}'''
@base.ReleaseTracks(base.ReleaseTrack.GA)
class Create(base.Command):
"""Create a cluster for running containers."""
@staticmethod
def Args(parser):
_Args(parser)
flags.AddImageTypeFlag(parser, 'cluster', suppressed=True)
flags.AddClusterAutoscalingFlags(parser, suppressed=True)
flags.AddLocalSSDFlag(parser, suppressed=True)
def ParseCreateOptions(self, args):
if not args.scopes:
args.scopes = []
cluster_ipv4_cidr = args.cluster_ipv4_cidr
return api_adapter.CreateClusterOptions(
node_machine_type=args.machine_type,
scopes=args.scopes,
enable_cloud_endpoints=args.enable_cloud_endpoints,
num_nodes=args.num_nodes,
additional_zones=args.additional_zones,
user=args.username,
password=args.password,
cluster_version=args.cluster_version,
network=args.network,
subnetwork=args.subnetwork,
cluster_ipv4_cidr=cluster_ipv4_cidr,
node_disk_size_gb=args.disk_size,
enable_cloud_logging=args.enable_cloud_logging,
enable_cloud_monitoring=args.enable_cloud_monitoring,
disable_addons=args.disable_addons,
local_ssd_count=args.local_ssd_count,
tags=args.tags,
enable_autoscaling=args.enable_autoscaling,
max_nodes=args.max_nodes,
min_nodes=args.min_nodes,
image_type=args.image_type,
max_nodes_per_pool=args.max_nodes_per_pool)
def Collection(self):
return 'container.projects.zones.clusters'
def Format(self, args):
return self.ListFormat(args)
def Run(self, args):
"""This is what gets called when the user runs this command.
Args:
args: an argparse namespace. All the arguments that were provided to this
command invocation.
Returns:
Cluster message for the successfully created cluster.
Raises:
util.Error, if creation failed.
"""
util.CheckKubectlInstalled()
if not args.password:
args.password = ''.join(random.SystemRandom().choice(
string.ascii_letters + string.digits) for _ in range(16))
adapter = self.context['api_adapter']
if not args.scopes:
args.scopes = []
cluster_ref = adapter.ParseCluster(args.name)
options = self.ParseCreateOptions(args)
operation = None
try:
operation_ref = adapter.CreateCluster(cluster_ref, options)
if flags.GetAsyncValueFromAsyncAndWaitFlags(args.async, args.wait):
return adapter.GetCluster(cluster_ref)
operation = adapter.WaitForOperation(
operation_ref,
'Creating cluster {0}'.format(cluster_ref.clusterId),
timeout_s=args.timeout)
cluster = adapter.GetCluster(cluster_ref)
except apitools_exceptions.HttpError as error:
raise exceptions.HttpException(util.GetError(error))
log.CreatedResource(cluster_ref)
if operation.detail:
# Non-empty detail on a DONE create operation should be surfaced as
# a warning to end user.
log.warning(operation.detail)
try:
util.ClusterConfig.Persist(cluster, cluster_ref.projectId)
except kconfig.MissingEnvVarError as error:
log.warning(error.message)
return cluster
@base.ReleaseTracks(base.ReleaseTrack.BETA)
class CreateBeta(Create):
"""Create a cluster for running containers."""
@staticmethod
def Args(parser):
_Args(parser)
flags.AddImageTypeFlag(parser, 'cluster')
flags.AddClusterAutoscalingFlags(parser, suppressed=True)
flags.AddLocalSSDFlag(parser)
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class CreateAlpha(Create):
"""Create a cluster for running containers."""
@staticmethod
def Args(parser):
_Args(parser)
flags.AddImageTypeFlag(parser, 'cluster')
flags.AddClusterAutoscalingFlags(parser)
flags.AddLocalSSDFlag(parser)
|
[
"lupynua@gmail.com"
] |
lupynua@gmail.com
|
978d6a9822ebca983b471f3f966ade295f46cbe1
|
525dc175d55c2f5f33f87df6915f3633537da17c
|
/oas_dev/notebooks/global_comparisons/04_2d_rels/04-02_2d_histograms_diff.py
|
1a982138a4039f10e3beeafaef7b8e3161ff410a
|
[
"CC0-1.0"
] |
permissive
|
sarambl/OAS-DEV
|
1b4c020ff862075034536ea38f30a131968791fb
|
8dec6d29ef23dee8135bc937cd6ee1ef5b64d304
|
refs/heads/master
| 2023-04-09T07:59:31.051158
| 2021-10-26T12:20:04
| 2021-10-26T12:20:04
| 310,578,324
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 29,068
|
py
|
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.3.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %%
import matplotlib
from oas_dev.data_info import get_nice_name_case
from oas_dev.util.imports.import_fields_xr_v2 import import_constants
from oas_dev.util.imports.get_fld_fixed import get_field_fixed
from useful_scit.imps import (np, xr, plt, pd)
# load and autoreload
from IPython import get_ipython
# noinspection PyBroadException
from oas_dev.util.naming_conventions import var_info
from oas_dev.util.naming_conventions.var_info import get_fancy_var_name
try:
_ipython = get_ipython()
_magic = _ipython.magic
_magic('load_ext autoreload')
_magic('autoreload 2')
except:
pass
# %%
model = 'NorESM'
# %%
from oas_dev.constants import get_plotpath
from oas_dev.util.practical_functions import make_folders
plot_path = get_plotpath('comparison') + '/scatter/'
print(plot_path)
make_folders(plot_path)
# %%
from_time = '2008-01'
to_time = '2008-12'
pmin = 850. # minimum pressure level
avg_over_lev = True # True#True#False#True
pressure_adjust = False # Can only be false if avg_over_lev false. Plots particular hybrid sigma lev
#if avg_over_lev:
# pressure_adjust = True
p_levels = [1013.,900., 800., 700., 600.] # used if not avg
lev_lim =0.
# %%
cases_sec = ['SECTv21_ctrl_koagD']#, 'PD_SECT_CHC7_diurnal'] # Sect ac eq.20, corr NPF diam, fxdt, vdiam, 1.5xBVOC']
cases_orig = ['noSECTv21_ox_ricc_dd'] # , 'Original eq.18','Original eq.20, 1.5xBVOC','Original eq.20, rednuc']
#cases_orig = ['noSECTv21_default_dd'] # , 'Original eq.18','Original eq.20, 1.5xBVOC','Original eq.20, rednuc']
cases = cases_orig + cases_sec
# %%
var_subl = ['NCONC01', 'H2SO4','SOA_LV','N_AER','COAGNUCL','NUCLRATE','GR','PBLH']#,'SOA_NA','SO4_NA']
# %%
var1 = var_subl[0]
var2 = var_subl[1]
cases_dic ={}
for case in cases:
dummy = get_field_fixed(case,
var_subl,
from_time, to_time,
pressure_adjust=pressure_adjust)
print(dummy)
ds_constants = import_constants(case)
dummy = xr.merge([dummy, ds_constants])
cases_dic[case] = dummy.copy()
# %%
# select values close to surface:
for case in cases:
_ds = cases_dic[case]
_ds = _ds.sel(lev=slice(lev_lim,None))#sel(lev=slice(20,None))
cases_dic[case] = _ds
# %%
for var in ['H2SO4','SOA_LV']:
for case in cases:
_ds = cases_dic[case]
_ds.load()
if _ds[var].units=='mol/mol':
_ds[var] = _ds[var]*1e12
_ds[var].attrs['units']='ppt'
# %%
for case in cases:
_ds = cases_dic[case]
coagn = 'COAGNUCL'
if _ds[coagn].units=='/s':
_ds[coagn] = _ds[coagn]*60*60
_ds[coagn].attrs['units']='hour$^{-1}$'
print('hey')
var = var1
dummy
case_sec = cases_sec[0]
case_orig = cases_orig[0]
ds_diff = (cases_dic[case_sec]- cases_dic[case_orig])#.isel(lev=slice(20,None))
for var in var_subl:
ds_diff[var+'_'+case_sec] = cases_dic[case_sec][var]#.isel(lev=slice(20,None))
ds_diff[var+'_'+case_orig] = cases_dic[case_orig][var]#.isel(lev=slice(20,None))
ds_diff.load()
for var in var_subl:
for case in cases:
ds_diff[f'log{var}_{case}'] = np.log10(ds_diff[f'{var}_{case}'])#+'_'+ case_orig])
# %%
ds_diff['NCONC01'].mean('time').isel(lev=-1).plot()
plt.show()
# %%
import importlib as il
from useful_scit.util import conditional_stats
il.reload(conditional_stats)
def _plt_2dhist(ds_diff, xvar, yvar, nr_bins=40, yscale='symlog', xscale='log',
xlim = [1e-6,1e-2],ylim=[5.,1e3], ax=None):
"""
xvar = f'NUCLRATE_{case_orig}'
yvar='NCONC01'
xlim = [1e-6,1e-2]
ylim=[1,1e3]
nr_bins = 40
yscale='symlog'
xscale='log'
"""
print(xlim)
print(ylim)
varList = [xvar, yvar]#f'NUCLRATE_{case_orig}',f'logNUCLRATE_{case_orig}',f'logSOA_LV_{case_orig}',f'logH2SO4_{case_orig}',f'logNCONC01_{case_orig}',f'logN_AER_{case_orig}',f'N_AER_{case_orig}',f'H2SO4_{case_orig}','NCONC01']
dims = tuple(ds_diff[varList].dims)
_ds_s = ds_diff[varList].stack(ind=dims)#('lat','lon','lev','time'))
ybins = mk_bins(ylim[0], vmax = ylim[1], nr_bins=nr_bins, scale=yscale)
xbins = mk_bins(xlim[0],vmax=xlim[1], nr_bins=nr_bins, scale=xscale)
data=_ds_s.to_dataframe()
lim=0
#data = -data[(data['NCONC01']<lim)]# | (data['NCONC01']>=lim)]
x=data[xvar]#f'NUCLRATE_{case_orig}']
y=data[yvar]#'NCONC01']
if ax is None:
fig, ax = plt.subplots(1)
h =ax.hist2d(x,y,bins=[xbins,ybins], cmap='Reds')#,extent=[-3,3,-300,20],yscale='symlog')
plt.colorbar(h[3], ax=ax, format = OOMFormatter(4, mathText=False))
#cb = fig.colorbar(c, ax=ax)
if yscale =='symlog':
ax.set_yscale('symlog', linthreshy=ylim[0], linscaley=ylim[0]/10,subsy=[2,3,4,5,6,7,8,9])
yt = ax.get_yticks()
ml = np.abs(yt[yt!=0]).min()
ytl = yt
ytl[(yt==ml)|(yt==-ml)]=None
ax.set_yticks(ticks=yt)#[y for y in yt if y!=0])#,
ax.set_yticklabels(ytl)#[-1e2,-1e1,-1e0,1e0,1e1,1e2])
elif yscale =='log':
print('set log scale')
ax.set_yscale('log')#, linthreshy=ylim[0], linscaley=ylim[0]/10,subsy=[2,3,4,5,6,7,8,9])
#ax.set_yticks([y for y in yt if y!=0])#[-1e2,-1e1,-1e0,1e0,1e1,1e2])
ax.set_xscale('log')
return ax
#plt.show()
def mk_bins(v, vmax = 1e3, nr_bins=20, scale='symlog'):
if scale=='symlog':
ybins = np.geomspace(v, vmax, int(nr_bins)/2)
ybins = ybins - ybins[0]
ybins = [*-ybins[::-1], *ybins[1:]]
elif scale=='log':
ybins = np.geomspace(v, vmax, nr_bins)
elif scale=='neglog':
ybins = -np.geomspace(v, vmax, nr_bins)[::-1]
return ybins
class OOMFormatter(matplotlib.ticker.ScalarFormatter):
def __init__(self, order=0, fformat="%1.1f", offset=True, mathText=True):
self.oom = order
self.fformat = fformat
matplotlib.ticker.ScalarFormatter.__init__(self,useOffset=offset,useMathText=mathText)
def _set_order_of_magnitude(self):
self.orderOfMagnitude = self.oom
def _set_format(self, vmin=None, vmax=None):
self.format = self.fformat
if self._useMathText:
self.format = r'$\mathdefault{%s}$' % self.format
# %%
from useful_scit.plot.fig_manip import subp_insert_abc
# %%
def _plt_tmp(_ds,axs,var_xl, var_diff, xlims,ylim=[5.,1e3], yscale='symlog', case_base = case_orig, case_oth=case_sec):
for var,ax in zip(var_xl, axs.flatten()):
print(var)
xlim = xlims[var]
h = _plt_2dhist(_ds,f'{var}_{case_base}', var_diff,
nr_bins=40,
xlim=xlim, ax=ax,
ylim=ylim,
yscale=yscale)
uni = var_info.get_fancy_unit_xr(_ds[var],
var)
ax.set_xlabel(f'{get_fancy_var_name(var)} [{uni}]')
ax.plot(xlim,[0,0], linewidth=.5, c='k')
uni = var_info.get_fancy_unit_xr(_ds[var_diff],
var_diff)
fvar_diff = get_fancy_var_name(var_diff)
ylab = f'$\Delta${fvar_diff} [{uni}]'
for ax in axs[:,0]:
ax.set_ylabel(ylab)
subp_insert_abc(axs)
suptit =f'{get_nice_name_case(case_sec)}-{get_nice_name_case(case_base)} vs. '
suptit =f'{fvar_diff}$(m_1)-${fvar_diff}$(m_2)$ vs. $X(m_2)$ \n for $m_1=${get_nice_name_case(case_oth)}, $m_2=${get_nice_name_case(case_base)}'
fig.subplots_adjust(hspace=.5, wspace=0.1)#,top=0.8, )
stit = fig.suptitle(suptit, fontsize=12, y=.98)
return stit
# %%
def _plt_tmp_mv1v2(_ds,axs,var_xl, xlims, yscale='log', case_base = case_orig, case_oth = case_sec):
for var,ax in zip(var_xl, axs.flatten()):
print(var)
xlim = xlims[var]
h = _plt_2dhist(_ds,f'{var}_{case_base}', f'{var}_{case_oth}',
nr_bins=40,
xlim=xlim,
ax=ax,
ylim=xlim,
yscale=yscale)
uni = var_info.get_fancy_unit_xr(_ds[var],
var)
ax.set_xlabel(f'{get_fancy_var_name(var)},{get_nice_name_case(case_base)} [{uni}]')
ax.set_ylabel(f'{get_fancy_var_name(var)},{get_nice_name_case(case_oth)} [{uni}]')
#ax.plot(xlim,[0,0], linewidth=.5, c='k')
ax.set_ylim(xlim)
ax.set_ylim(xlim)
subp_insert_abc(axs)
suptit =f'{get_nice_name_case(case_sec)}-{get_nice_name_case(case_base)} vs. '
suptit =f'{fvar_diff}$(m_1)-${fvar_diff}$(m_2)$ vs. $X(m_2)$ \n for $m_1=${get_nice_name_case(case_sec)}, $m_2=${get_nice_name_case(case_base)}'
fig.subplots_adjust(hspace=.5, wspace=0.1)#,top=0.8, )
stit = fig.suptitle(suptit, fontsize=12, y=.98)
return stit
# %% [markdown]
# # Difference:
#
# %% [markdown]
# ## Main plot: below 100 hPa:
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=100.
_ds = ds_diff.sel(lev=slice(lev_min, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-5,.1],
}
stit = _plt_tmp(_ds,axs,var_xl, var_diff, xlims)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %% [markdown]
# ### Base case sectional
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=100.
_ds = ds_diff.sel(lev=slice(lev_min, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-5,.1],
}
stit = _plt_tmp(_ds,axs,var_xl, var_diff, xlims, case_base = case_sec, case_oth=case_orig)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %% [markdown]
# ## Surface layer
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=100.
_ds = ds_diff.isel(lev=-1)#slice(lev_min, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-5,.1],
}
_plt_tmp(_ds,axs,var_xl, var_diff, xlims)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %% [markdown]
# ## Up to 850 hPa
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=850.
_ds = ds_diff.sel(lev=slice(lev_min, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-5,.1],
}
_plt_tmp(_ds,axs,var_xl, var_diff, xlims)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %% [markdown]
# ## Above 850
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=850.
_ds = ds_diff.sel(lev=slice(None,lev_min))#, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-5,.1],
}
_plt_tmp(_ds,axs,var_xl, var_diff, xlims)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %% [markdown]
# ## Mask by N_AER?
# %%
ds_diff
# %%
v= 'logN_AER_noSECTv21_ox_ricc_dd'
mask_ = ds_diff[v] <ds_diff[v].quantile(.5)
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=850.
_ds = ds_diff.where(mask_)#sel(lev=slice(lev_min, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-8,1e-3],
}
_plt_tmp(_ds,axs,var_xl, var_diff, xlims)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %% [markdown]
# ## Oposite
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=850.
_ds = ds_diff.where(~mask_)#sel(lev=slice(lev_min, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-8,1e-3],
}
_plt_tmp(_ds,axs,var_xl, var_diff, xlims)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %% [markdown]
# ## Mask by CoagS?
# %%
ds_diff
# %%
v= 'COAGNUCL_noSECTv21_ox_ricc_dd'
mask_ = ds_diff[v] <ds_diff[v].quantile(.5)
#v= 'NCONC01_noSECTv21_ox_ricc_dd'
#mask_ = mask_ & (ds_diff[v] >10)#ds_diff[v].quantile(.1))
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=850.
_ds = ds_diff.where(mask_)#sel(lev=slice(lev_min, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-8,1e-3],
}
_plt_tmp(_ds,axs,var_xl, var_diff, xlims)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %% [markdown]
# ## Oposite
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=850.
_ds = ds_diff.where(~mask_)#sel(lev=slice(lev_min, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-8,1e-3],
}
_plt_tmp(_ds,axs,var_xl, var_diff, xlims)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %% [markdown]
# ## Ratio gr/coag
#
# %%
gr = ds_diff['GR_' + case_orig]
coag = ds_diff['COAGNUCL_' + case_orig]
ma = (gr/coag) > 38
# %%
(gr/coag).quantile([.05, .25,.5,.75,.84,.95])
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=850.
_ds = ds_diff.where(ma)#sel(lev=slice(lev_min, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-5,.1],
}
_plt_tmp(_ds,axs,var_xl, var_diff, xlims)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=850.
_ds = ds_diff.where(~ma)#sel(lev=slice(lev_min, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-5,.1],
}
_plt_tmp(_ds,axs,var_xl, var_diff, xlims)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %% [markdown]
# ## Mask by quantile NCONC01
# %%
ds_diff
# %%
v= 'logNCONC01_noSECTv21_ox_ricc_dd'
mask_ = ds_diff[v] <ds_diff[v].quantile(.25)
#v= 'NCONC01_noSECTv21_ox_ricc_dd'
#mask_ = mask_ & (ds_diff[v] >10)#ds_diff[v].quantile(.1))
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=850.
_ds = ds_diff.where(mask_)#sel(lev=slice(lev_min, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-8,1e-3],
}
_plt_tmp(_ds,axs,var_xl, var_diff, xlims)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %%
v= 'logNCONC01_noSECTv21_ox_ricc_dd'
mask_ = (ds_diff[v] >ds_diff[v].quantile(.25))&(ds_diff[v] <ds_diff[v].quantile(.50))
#v= 'NCONC01_noSECTv21_ox_ricc_dd'
#mask_ = mask_ & (ds_diff[v] >10)#ds_diff[v].quantile(.1))
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=850.
_ds = ds_diff.where(mask_)#sel(lev=slice(lev_min, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-8,1e-3],
}
_plt_tmp(_ds,axs,var_xl, var_diff, xlims)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %%
v= 'logNCONC01_noSECTv21_ox_ricc_dd'
mask_ = (ds_diff[v] >ds_diff[v].quantile(.50))&(ds_diff[v] <ds_diff[v].quantile(.75))
#v= 'NCONC01_noSECTv21_ox_ricc_dd'
#mask_ = mask_ & (ds_diff[v] >10)#ds_diff[v].quantile(.1))
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=850.
_ds = ds_diff.where(mask_)#sel(lev=slice(lev_min, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-8,1e-3],
}
_plt_tmp(_ds,axs,var_xl, var_diff, xlims)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %%
v= 'logNCONC01_noSECTv21_ox_ricc_dd'
mask_ = (ds_diff[v] >ds_diff[v].quantile(.75))#&(ds_diff[v] <ds_diff[v].quantile(.75))
#v= 'NCONC01_noSECTv21_ox_ricc_dd'
#mask_ = mask_ & (ds_diff[v] >10)#ds_diff[v].quantile(.1))
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=850.
_ds = ds_diff.where(mask_)#sel(lev=slice(lev_min, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-8,1e-3],
}
_plt_tmp(_ds,axs,var_xl, var_diff, xlims)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','N_AER','COAGNUCL']
lev_min=800.
_ds = ds_diff.sel(lev=slice(lev_min, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-8,1e-3],
}
for var,ax in zip(var_xl, axs.flatten()):
print(var)
xlim = xlims[var]
h = _plt_2dhist(_ds,f'{var}_{case_orig}', var_diff,
nr_bins=40,
xlim=xlim, ax=ax)
uni = var_info.get_fancy_unit_xr(_ds[var],
var)
ax.set_xlabel(f'{get_fancy_var_name(var)} [{uni}]')
ax.plot(xlim,[0,0], linewidth=.5, c='k')
uni = var_info.get_fancy_unit_xr(_ds[var_diff],
var_diff)
fvar_diff = get_fancy_var_name(var_diff)
ylab = f'$\Delta${fvar_diff} [{uni}]'
for ax in axs[:,0]:
ax.set_ylabel(ylab)
subp_insert_abc(axs)
suptit =f'{get_nice_name_case(case_sec)}-{get_nice_name_case(case_orig)} vs. '
suptit =f'{fvar_diff}$(m_1)-${fvar_diff}$(m_2)$ vs. $X(m_2)$ \n for $m_1=${get_nice_name_case(case_sec)}, $m_2=${get_nice_name_case(case_orig)}'
fig.subplots_adjust(hspace=.5, wspace=0.1)#,top=0.8, )
stit = fig.suptitle(suptit, fontsize=12, y=.98)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=800.
_ds = ds_diff.sel(lev=slice( None,lev_min))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-8,1e-3],
}
for var,ax in zip(var_xl, axs.flatten()):
print(var)
xlim = xlims[var]
h = _plt_2dhist(_ds,f'{var}_{case_orig}', var_diff,
nr_bins=40,
xlim=xlim, ax=ax)
uni = var_info.get_fancy_unit_xr(_ds[var],
var)
ax.set_xlabel(f'{get_fancy_var_name(var)} [{uni}]')
ax.plot(xlim,[0,0], linewidth=.5, c='k')
uni = var_info.get_fancy_unit_xr(_ds[var_diff],
var_diff)
fvar_diff = get_fancy_var_name(var_diff)
ylab = f'$\Delta${fvar_diff} [{uni}]'
for ax in axs[:,0]:
ax.set_ylabel(ylab)
subp_insert_abc(axs)
suptit =f'{get_nice_name_case(case_sec)}-{get_nice_name_case(case_orig)} vs. '
suptit =f'{fvar_diff}$(m_1)-${fvar_diff}$(m_2)$ vs. $X(m_2)$ \n for $m_1=${get_nice_name_case(case_sec)}, $m_2=${get_nice_name_case(case_orig)}'
fig.subplots_adjust(hspace=.5, wspace=0.1)#,top=0.8, )
stit = fig.suptitle(suptit, fontsize=12, y=.98)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','NCONC01','COAGNUCL']
lev_min=600.
_ds = ds_diff.sel(lev=slice( None,lev_min))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[5e-1,1e3],
'COAGNUCL':[1e-8,1e-3],
}
for var,ax in zip(var_xl, axs.flatten()):
print(var)
xlim = xlims[var]
h = _plt_2dhist(_ds,f'{var}_{case_orig}', var_diff,
nr_bins=40,
xlim=xlim, ax=ax)
uni = var_info.get_fancy_unit_xr(_ds[var],
var)
ax.set_xlabel(f'{get_fancy_var_name(var)} [{uni}]')
ax.plot(xlim,[0,0], linewidth=.5, c='k')
uni = var_info.get_fancy_unit_xr(_ds[var_diff],
var_diff)
fvar_diff = get_fancy_var_name(var_diff)
ylab = f'$\Delta${fvar_diff} [{uni}]'
for ax in axs[:,0]:
ax.set_ylabel(ylab)
subp_insert_abc(axs)
suptit =f'{get_nice_name_case(case_sec)}-{get_nice_name_case(case_orig)} vs. '
suptit =f'{fvar_diff}$(m_1)-${fvar_diff}$(m_2)$ vs. $X(m_2)$ \n for $m_1=${get_nice_name_case(case_sec)}, $m_2=${get_nice_name_case(case_orig)}'
fig.subplots_adjust(hspace=.5, wspace=0.1)#,top=0.8, )
stit = fig.suptitle(suptit, fontsize=12, y=.98)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
print(fn)
# %%
import seaborn as sns
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','N_AER','COAGNUCL']
lev_min=900
_ds = ds_diff#.sel(lev=slice( lev_min,None))
var_diff = 'SOA_LV'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[1e0,1e4],
'COAGNUCL':[1e-8,1e-4],
}
for var,ax in zip(var_xl, axs.flatten()):
print(var)
xlim = xlims[var]
_plt_2dhist(_ds,f'{var}_{case_orig}', var_diff,
nr_bins=40,
xlim=xlim, ax=ax, ylim=xlims[var_diff])
uni = var_info.get_fancy_unit_xr(_ds[var],
var)
ax.set_xlabel(f'{get_fancy_var_name(var)} [{uni}]')
uni = var_info.get_fancy_unit_xr(_ds[var_diff],
var_diff)
fvar_diff = get_fancy_var_name(var_diff)
ylab = f'$\Delta${fvar_diff} [{uni}]'
for ax in axs[:,0]:
ax.set_ylabel(ylab)
suptit =f'{get_nice_name_case(case_sec)}-{get_nice_name_case(case_orig)} vs. '
suptit =f'{fvar_diff}$(m_1)-${fvar_diff}$(m_2)$ vs. $X(m_2)$ \n for $m_1=${get_nice_name_case(case_sec)}, $m_2=${get_nice_name_case(case_orig)}'
fig.subplots_adjust(hspace=.5, wspace=0.1)#,top=0.8, )
stit = fig.suptitle(suptit, fontsize=12, y=.98)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
#fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
# %%
fig, axs = plt.subplots(3,2, figsize=[6.4,7.1], sharey=True)#, constrained_layout=True)
var_xl = ['NUCLRATE','GR','H2SO4','SOA_LV','N_AER','COAGNUCL']
lev_min=100.
_ds = ds_diff.sel(lev=slice(lev_min, None))
var_diff = 'NCONC01'
xlims = {
'NUCLRATE' : [1.e-6,10],
'H2SO4' : [1.e-3,1],
'SOA_LV' : [1.e-5,1],
'GR' : [1.e-3,1],
'N_AER':[1e0,1e4],
'NCONC01':[1e0,1e4],
'COAGNUCL':[1e-8,1e-4],
}
for var,ax in zip(var_xl, axs.flatten()):
print(var)
xlim = xlims[var]
_plt_2dhist(_ds,f'{var}_{case_orig}', var_diff,
nr_bins=40,
xlim=xlim, ax=ax)
uni = var_info.get_fancy_unit_xr(_ds[var],
var)
ax.set_xlabel(f'{get_fancy_var_name(var)} [{uni}]')
uni = var_info.get_fancy_unit_xr(_ds[var_diff],
var_diff)
fvar_diff = get_fancy_var_name(var_diff)
ylab = f'$\Delta${fvar_diff} [{uni}]'
for ax in axs[:,0]:
ax.set_ylabel(ylab)
suptit =f'{get_nice_name_case(case_sec)}-{get_nice_name_case(case_orig)} vs. '
suptit =f'{fvar_diff}$(m_1)-${fvar_diff}$(m_2)$ vs. $X(m_2)$ \n for $m_1=${get_nice_name_case(case_sec)}, $m_2=${get_nice_name_case(case_orig)}'
fig.subplots_adjust(hspace=.5, wspace=0.1)#,top=0.8, )
stit = fig.suptitle(suptit, fontsize=12, y=.98)
fn = plot_path + f'2dhist_{case_orig}_{case_sec}.'
fig.savefig(fn+'pdf',bbox_extra_artists=(stit,), bbox_inches='tight')
#fig.savefig(fn+'png',bbox_extra_artists=(stit,), bbox_inches='tight')
plt.show()
# %%
# %%
|
[
"samebr@gmail.com"
] |
samebr@gmail.com
|
d29a348904016924e690b825b758b20f51d24b6e
|
e82ba9700d831ddc884928eb2cc04173075561e1
|
/torba/torba/client/baseheader.py
|
339dd5e54e13fed55e625d277b9ebe4c5d76b3f3
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
raymondSeger/lbry-sdk
|
ee223d7fbfdd3495a66a457cfaf87e311eb22f44
|
bbc056eef066dfe35967b14f676b22792bbab40e
|
refs/heads/master
| 2022-02-04T11:58:03.309249
| 2019-07-19T15:26:50
| 2019-07-19T15:26:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 7,851
|
py
|
import os
import logging
from io import BytesIO
from typing import Optional, Iterator, Tuple
from binascii import hexlify
from torba.client.util import ArithUint256
from torba.client.hash import double_sha256
log = logging.getLogger(__name__)
class InvalidHeader(Exception):
def __init__(self, height, message):
super().__init__(message)
self.message = message
self.height = height
class BaseHeaders:
header_size: int
chunk_size: int
max_target: int
genesis_hash: Optional[bytes]
target_timespan: int
validate_difficulty: bool = True
def __init__(self, path) -> None:
if path == ':memory:':
self.io = BytesIO()
self.path = path
self._size: Optional[int] = None
async def open(self):
if self.path != ':memory:':
if not os.path.exists(self.path):
self.io = open(self.path, 'w+b')
else:
self.io = open(self.path, 'r+b')
async def close(self):
self.io.close()
@staticmethod
def serialize(header: dict) -> bytes:
raise NotImplementedError
@staticmethod
def deserialize(height, header):
raise NotImplementedError
def get_next_chunk_target(self, chunk: int) -> ArithUint256:
return ArithUint256(self.max_target)
@staticmethod
def get_next_block_target(chunk_target: ArithUint256, previous: Optional[dict],
current: Optional[dict]) -> ArithUint256:
return chunk_target
def __len__(self) -> int:
if self._size is None:
self._size = self.io.seek(0, os.SEEK_END) // self.header_size
return self._size
def __bool__(self):
return True
def __getitem__(self, height) -> dict:
assert not isinstance(height, slice), \
"Slicing of header chain has not been implemented yet."
return self.deserialize(height, self.get_raw_header(height))
def get_raw_header(self, height) -> bytes:
self.io.seek(height * self.header_size, os.SEEK_SET)
return self.io.read(self.header_size)
@property
def height(self) -> int:
return len(self)-1
@property
def bytes_size(self):
return len(self) * self.header_size
def hash(self, height=None) -> bytes:
return self.hash_header(
self.get_raw_header(height if height is not None else self.height)
)
@staticmethod
def hash_header(header: bytes) -> bytes:
if header is None:
return b'0' * 64
return hexlify(double_sha256(header)[::-1])
async def connect(self, start: int, headers: bytes) -> int:
added = 0
bail = False
for height, chunk in self._iterate_chunks(start, headers):
try:
# validate_chunk() is CPU bound and reads previous chunks from file system
self.validate_chunk(height, chunk)
except InvalidHeader as e:
bail = True
chunk = chunk[:(height-e.height)*self.header_size]
written = 0
if chunk:
self.io.seek(height * self.header_size, os.SEEK_SET)
written = self.io.write(chunk) // self.header_size
self.io.truncate()
# .seek()/.write()/.truncate() might also .flush() when needed
# the goal here is mainly to ensure we're definitely flush()'ing
self.io.flush()
self._size = None
added += written
if bail:
break
return added
def validate_chunk(self, height, chunk):
previous_hash, previous_header, previous_previous_header = None, None, None
if height > 0:
previous_header = self[height-1]
previous_hash = self.hash(height-1)
if height > 1:
previous_previous_header = self[height-2]
chunk_target = self.get_next_chunk_target(height // 2016 - 1)
for current_hash, current_header in self._iterate_headers(height, chunk):
block_target = self.get_next_block_target(chunk_target, previous_previous_header, previous_header)
self.validate_header(height, current_hash, current_header, previous_hash, block_target)
previous_previous_header = previous_header
previous_header = current_header
previous_hash = current_hash
def validate_header(self, height: int, current_hash: bytes,
header: dict, previous_hash: bytes, target: ArithUint256):
if previous_hash is None:
if self.genesis_hash is not None and self.genesis_hash != current_hash:
raise InvalidHeader(
height, "genesis header doesn't match: {} vs expected {}".format(
current_hash.decode(), self.genesis_hash.decode())
)
return
if header['prev_block_hash'] != previous_hash:
raise InvalidHeader(
height, "previous hash mismatch: {} vs expected {}".format(
header['prev_block_hash'].decode(), previous_hash.decode())
)
if self.validate_difficulty:
if header['bits'] != target.compact:
raise InvalidHeader(
height, "bits mismatch: {} vs expected {}".format(
header['bits'], target.compact)
)
proof_of_work = self.get_proof_of_work(current_hash)
if proof_of_work > target:
raise InvalidHeader(
height, "insufficient proof of work: {} vs target {}".format(
proof_of_work.value, target.value)
)
async def repair(self):
previous_header_hash = fail = None
self.io.seek(0)
batch_size = 10000
for start_height in range(0, self.height, batch_size):
headers = self.io.read(self.header_size*batch_size)
for header_hash, header in self._iterate_headers(start_height, headers):
height = header['block_height']
if height:
if header['prev_block_hash'] != previous_header_hash:
fail = True
else:
if header_hash != self.genesis_hash:
fail = True
if fail:
log.warning("Header file corrupted at height %s, truncating it.", height - 1)
self.io.seek((height - 1) * self.header_size, os.SEEK_SET)
self.io.truncate()
self.io.flush()
self._size = None
return
previous_header_hash = header_hash
@staticmethod
def get_proof_of_work(header_hash: bytes) -> ArithUint256:
return ArithUint256(int(b'0x' + header_hash, 16))
def _iterate_chunks(self, height: int, headers: bytes) -> Iterator[Tuple[int, bytes]]:
assert len(headers) % self.header_size == 0, f"{len(headers)} {len(headers)%self.header_size}"
start = 0
end = (self.chunk_size - height % self.chunk_size) * self.header_size
while start < end:
yield height + (start // self.header_size), headers[start:end]
start = end
end = min(len(headers), end + self.chunk_size * self.header_size)
def _iterate_headers(self, height: int, headers: bytes) -> Iterator[Tuple[bytes, dict]]:
assert len(headers) % self.header_size == 0
for idx in range(len(headers) // self.header_size):
start, end = idx * self.header_size, (idx + 1) * self.header_size
header = headers[start:end]
yield self.hash_header(header), self.deserialize(height+idx, header)
|
[
"lex@damoti.com"
] |
lex@damoti.com
|
5f347ed86ecc27ac757d1c17dd3cedf5c19f44d1
|
693d93174f43a81d8a65041553282a8872e3a6ff
|
/test/functional/wallet_listsinceblock.py
|
6f84b56fe519c7e9faaf4042414114d97bb2a807
|
[
"MIT"
] |
permissive
|
eleccoin/eleccoin
|
c075719d5ee676fc2bb9a21f3711d75d673655bd
|
963f6d4a069e40ab2e46217e5d49bc94adda2c5c
|
refs/heads/master
| 2022-11-13T02:38:36.662655
| 2022-10-30T08:56:57
| 2022-10-30T08:56:57
| 238,475,897
| 3
| 7
|
MIT
| 2022-01-10T07:29:19
| 2020-02-05T14:56:34
|
C++
|
UTF-8
|
Python
| false
| false
| 14,650
|
py
|
#!/usr/bin/env python3
# Copyright (c) 2020-2021 The Eleccoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the listsinceblock RPC."""
from test_framework.address import key_to_p2wpkh
from test_framework.blocktools import COINBASE_MATURITY
from test_framework.key import ECKey
from test_framework.test_framework import EleccoinTestFramework
from test_framework.messages import BIP125_SEQUENCE_NUMBER
from test_framework.util import (
assert_array_result,
assert_equal,
assert_raises_rpc_error,
)
from test_framework.wallet_util import bytes_to_wif
from decimal import Decimal
class ListSinceBlockTest(EleccoinTestFramework):
def set_test_params(self):
self.num_nodes = 4
self.setup_clean_chain = True
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
def run_test(self):
# All nodes are in IBD from genesis, so they'll need the miner (node2) to be an outbound connection, or have
# only one connection. (See fPreferredDownload in net_processing)
self.connect_nodes(1, 2)
self.nodes[2].generate(COINBASE_MATURITY + 1)
self.sync_all()
self.test_no_blockhash()
self.test_invalid_blockhash()
self.test_reorg()
self.test_double_spend()
self.test_double_send()
self.double_spends_filtered()
self.test_targetconfirmations()
def test_no_blockhash(self):
self.log.info("Test no blockhash")
txid = self.nodes[2].sendtoaddress(self.nodes[0].getnewaddress(), 1)
blockhash, = self.nodes[2].generate(1)
blockheight = self.nodes[2].getblockheader(blockhash)['height']
self.sync_all()
txs = self.nodes[0].listtransactions()
assert_array_result(txs, {"txid": txid}, {
"category": "receive",
"amount": 1,
"blockhash": blockhash,
"blockheight": blockheight,
"confirmations": 1,
})
assert_equal(
self.nodes[0].listsinceblock(),
{"lastblock": blockhash,
"removed": [],
"transactions": txs})
assert_equal(
self.nodes[0].listsinceblock(""),
{"lastblock": blockhash,
"removed": [],
"transactions": txs})
def test_invalid_blockhash(self):
self.log.info("Test invalid blockhash")
assert_raises_rpc_error(-5, "Block not found", self.nodes[0].listsinceblock,
"42759cde25462784395a337460bde75f58e73d3f08bd31fdc3507cbac856a2c4")
assert_raises_rpc_error(-5, "Block not found", self.nodes[0].listsinceblock,
"0000000000000000000000000000000000000000000000000000000000000000")
assert_raises_rpc_error(-8, "blockhash must be of length 64 (not 11, for 'invalid-hex')", self.nodes[0].listsinceblock,
"invalid-hex")
assert_raises_rpc_error(-8, "blockhash must be hexadecimal string (not 'Z000000000000000000000000000000000000000000000000000000000000000')", self.nodes[0].listsinceblock,
"Z000000000000000000000000000000000000000000000000000000000000000")
def test_targetconfirmations(self):
'''
This tests when the value of target_confirmations exceeds the number of
blocks in the main chain. In this case, the genesis block hash should be
given for the `lastblock` property. If target_confirmations is < 1, then
a -8 invalid parameter error is thrown.
'''
self.log.info("Test target_confirmations")
blockhash, = self.nodes[2].generate(1)
blockheight = self.nodes[2].getblockheader(blockhash)['height']
self.sync_all()
assert_equal(
self.nodes[0].getblockhash(0),
self.nodes[0].listsinceblock(blockhash, blockheight + 1)['lastblock'])
assert_equal(
self.nodes[0].getblockhash(0),
self.nodes[0].listsinceblock(blockhash, blockheight + 1000)['lastblock'])
assert_raises_rpc_error(-8, "Invalid parameter",
self.nodes[0].listsinceblock, blockhash, 0)
def test_reorg(self):
'''
`listsinceblock` did not behave correctly when handed a block that was
no longer in the main chain:
ab0
/ \
aa1 [tx0] bb1
| |
aa2 bb2
| |
aa3 bb3
|
bb4
Consider a client that has only seen block `aa3` above. It asks the node
to `listsinceblock aa3`. But at some point prior the main chain switched
to the bb chain.
Previously: listsinceblock would find height=4 for block aa3 and compare
this to height=5 for the tip of the chain (bb4). It would then return
results restricted to bb3-bb4.
Now: listsinceblock finds the fork at ab0 and returns results in the
range bb1-bb4.
This test only checks that [tx0] is present.
'''
self.log.info("Test reorg")
# Split network into two
self.split_network()
# send to nodes[0] from nodes[2]
senttx = self.nodes[2].sendtoaddress(self.nodes[0].getnewaddress(), 1)
# generate on both sides
nodes1_last_blockhash = self.nodes[1].generate(6)[-1]
nodes2_first_blockhash = self.nodes[2].generate(7)[0]
self.log.debug("nodes[1] last blockhash = {}".format(nodes1_last_blockhash))
self.log.debug("nodes[2] first blockhash = {}".format(nodes2_first_blockhash))
self.sync_all(self.nodes[:2])
self.sync_all(self.nodes[2:])
self.join_network()
# listsinceblock(nodes1_last_blockhash) should now include tx as seen from nodes[0]
# and return the block height which listsinceblock now exposes since a5e7795.
transactions = self.nodes[0].listsinceblock(nodes1_last_blockhash)['transactions']
found = next(tx for tx in transactions if tx['txid'] == senttx)
assert_equal(found['blockheight'], self.nodes[0].getblockheader(nodes2_first_blockhash)['height'])
def test_double_spend(self):
'''
This tests the case where the same UTXO is spent twice on two separate
blocks as part of a reorg.
ab0
/ \
aa1 [tx1] bb1 [tx2]
| |
aa2 bb2
| |
aa3 bb3
|
bb4
Problematic case:
1. User 1 receives ECC in tx1 from utxo1 in block aa1.
2. User 2 receives ECC in tx2 from utxo1 (same) in block bb1
3. User 1 sees 2 confirmations at block aa3.
4. Reorg into bb chain.
5. User 1 asks `listsinceblock aa3` and does not see that tx1 is now
invalidated.
Currently the solution to this is to detect that a reorg'd block is
asked for in listsinceblock, and to iterate back over existing blocks up
until the fork point, and to include all transactions that relate to the
node wallet.
'''
self.log.info("Test double spend")
self.sync_all()
# share utxo between nodes[1] and nodes[2]
eckey = ECKey()
eckey.generate()
privkey = bytes_to_wif(eckey.get_bytes())
address = key_to_p2wpkh(eckey.get_pubkey().get_bytes())
self.nodes[2].sendtoaddress(address, 10)
self.nodes[2].generate(6)
self.sync_all()
self.nodes[2].importprivkey(privkey)
utxos = self.nodes[2].listunspent()
utxo = [u for u in utxos if u["address"] == address][0]
self.nodes[1].importprivkey(privkey)
# Split network into two
self.split_network()
# send from nodes[1] using utxo to nodes[0]
change = '%.8f' % (float(utxo['amount']) - 1.0003)
recipient_dict = {
self.nodes[0].getnewaddress(): 1,
self.nodes[1].getnewaddress(): change,
}
utxo_dicts = [{
'txid': utxo['txid'],
'vout': utxo['vout'],
}]
txid1 = self.nodes[1].sendrawtransaction(
self.nodes[1].signrawtransactionwithwallet(
self.nodes[1].createrawtransaction(utxo_dicts, recipient_dict))['hex'])
# send from nodes[2] using utxo to nodes[3]
recipient_dict2 = {
self.nodes[3].getnewaddress(): 1,
self.nodes[2].getnewaddress(): change,
}
self.nodes[2].sendrawtransaction(
self.nodes[2].signrawtransactionwithwallet(
self.nodes[2].createrawtransaction(utxo_dicts, recipient_dict2))['hex'])
# generate on both sides
lastblockhash = self.nodes[1].generate(3)[2]
self.nodes[2].generate(4)
self.join_network()
self.sync_all()
# gettransaction should work for txid1
assert self.nodes[0].gettransaction(txid1)['txid'] == txid1, "gettransaction failed to find txid1"
# listsinceblock(lastblockhash) should now include txid1, as seen from nodes[0]
lsbres = self.nodes[0].listsinceblock(lastblockhash)
assert any(tx['txid'] == txid1 for tx in lsbres['removed'])
# but it should not include 'removed' if include_removed=false
lsbres2 = self.nodes[0].listsinceblock(blockhash=lastblockhash, include_removed=False)
assert 'removed' not in lsbres2
def test_double_send(self):
'''
This tests the case where the same transaction is submitted twice on two
separate blocks as part of a reorg. The former will vanish and the
latter will appear as the true transaction (with confirmations dropping
as a result).
ab0
/ \
aa1 [tx1] bb1
| |
aa2 bb2
| |
aa3 bb3 [tx1]
|
bb4
Asserted:
1. tx1 is listed in listsinceblock.
2. It is included in 'removed' as it was removed, even though it is now
present in a different block.
3. It is listed with a confirmation count of 2 (bb3, bb4), not
3 (aa1, aa2, aa3).
'''
self.log.info("Test double send")
self.sync_all()
# Split network into two
self.split_network()
# create and sign a transaction
utxos = self.nodes[2].listunspent()
utxo = utxos[0]
change = '%.8f' % (float(utxo['amount']) - 1.0003)
recipient_dict = {
self.nodes[0].getnewaddress(): 1,
self.nodes[2].getnewaddress(): change,
}
utxo_dicts = [{
'txid': utxo['txid'],
'vout': utxo['vout'],
}]
signedtxres = self.nodes[2].signrawtransactionwithwallet(
self.nodes[2].createrawtransaction(utxo_dicts, recipient_dict))
assert signedtxres['complete']
signedtx = signedtxres['hex']
# send from nodes[1]; this will end up in aa1
txid1 = self.nodes[1].sendrawtransaction(signedtx)
# generate bb1-bb2 on right side
self.nodes[2].generate(2)
# send from nodes[2]; this will end up in bb3
txid2 = self.nodes[2].sendrawtransaction(signedtx)
assert_equal(txid1, txid2)
# generate on both sides
lastblockhash = self.nodes[1].generate(3)[2]
self.nodes[2].generate(2)
self.join_network()
self.sync_all()
# gettransaction should work for txid1
tx1 = self.nodes[0].gettransaction(txid1)
assert_equal(tx1['blockheight'], self.nodes[0].getblockheader(tx1['blockhash'])['height'])
# listsinceblock(lastblockhash) should now include txid1 in transactions
# as well as in removed
lsbres = self.nodes[0].listsinceblock(lastblockhash)
assert any(tx['txid'] == txid1 for tx in lsbres['transactions'])
assert any(tx['txid'] == txid1 for tx in lsbres['removed'])
# find transaction and ensure confirmations is valid
for tx in lsbres['transactions']:
if tx['txid'] == txid1:
assert_equal(tx['confirmations'], 2)
# the same check for the removed array; confirmations should STILL be 2
for tx in lsbres['removed']:
if tx['txid'] == txid1:
assert_equal(tx['confirmations'], 2)
def double_spends_filtered(self):
'''
`listsinceblock` was returning conflicted transactions even if they
occurred before the specified cutoff blockhash
'''
self.log.info("Test spends filtered")
spending_node = self.nodes[2]
dest_address = spending_node.getnewaddress()
tx_input = dict(
sequence=BIP125_SEQUENCE_NUMBER, **next(u for u in spending_node.listunspent()))
rawtx = spending_node.createrawtransaction(
[tx_input], {dest_address: tx_input["amount"] - Decimal("0.00051000"),
spending_node.getrawchangeaddress(): Decimal("0.00050000")})
signedtx = spending_node.signrawtransactionwithwallet(rawtx)
orig_tx_id = spending_node.sendrawtransaction(signedtx["hex"])
original_tx = spending_node.gettransaction(orig_tx_id)
double_tx = spending_node.bumpfee(orig_tx_id)
# check that both transactions exist
block_hash = spending_node.listsinceblock(
spending_node.getblockhash(spending_node.getblockcount()))
original_found = False
double_found = False
for tx in block_hash['transactions']:
if tx['txid'] == original_tx['txid']:
original_found = True
if tx['txid'] == double_tx['txid']:
double_found = True
assert_equal(original_found, True)
assert_equal(double_found, True)
lastblockhash = spending_node.generate(1)[0]
# check that neither transaction exists
block_hash = spending_node.listsinceblock(lastblockhash)
original_found = False
double_found = False
for tx in block_hash['transactions']:
if tx['txid'] == original_tx['txid']:
original_found = True
if tx['txid'] == double_tx['txid']:
double_found = True
assert_equal(original_found, False)
assert_equal(double_found, False)
if __name__ == '__main__':
ListSinceBlockTest().main()
|
[
"unify@eleccoin.org"
] |
unify@eleccoin.org
|
810baa8d6990a13eb934f8ea0ba4fe2789267ac8
|
e5c687c17a96e80d4bda1d0887b8009bf2b3f776
|
/macropy/core_tests/macro_b.py
|
062de1f3d75a87a35d9eeda6cfcaf8ed36aeab67
|
[
"MIT"
] |
permissive
|
rcarmo/macropy
|
a50265d3a69a3d82dc377c715d3ed5a731ed5c5f
|
ca2d0eebfecafd6eb2e429c23be96a90bfbbeca7
|
refs/heads/master
| 2021-01-21T00:52:29.858749
| 2013-05-13T20:21:25
| 2013-05-13T20:21:25
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 102
|
py
|
from macropy.core.macros import *
macros = Macros()
@macros.expr
def g(tree):
return Num(n = 20)
|
[
"haoyi.sg@gmail.com"
] |
haoyi.sg@gmail.com
|
d9543dbbf9479d52cb98637c34019ef3f722181a
|
7db6c1865cf9102808824ff06cda747b6e572a21
|
/Python/Lib/ApiWsh/api/__init__.py
|
41aa17cca0eea053eef435c89f4e7a83a28b7316
|
[] |
no_license
|
hyteer/testing
|
1f6cabc1d2b67faa4533e6ad7eb5be8c13d542c9
|
1d8b47b3bbb2daf00e4f15b5d18e86111ea4e113
|
refs/heads/master
| 2020-05-21T16:19:08.243676
| 2017-01-03T01:25:17
| 2017-01-03T01:25:17
| 60,914,071
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 382
|
py
|
# encoding: utf-8
from init_session import InitSession
from shop import Shop
from common import Common
from marketing import Marketing
from utils import CommonUtils
from product import Product
from member import Member
from wexin import Weixin
__all__ = [
"InitSession",
"Common",
"Shop",
"Marketing",
"Product",
"Member",
"Weixin",
"CommonUtils"
]
|
[
"hyteer@qq.com"
] |
hyteer@qq.com
|
a6cfd0b621c47bbada59feb13b42ff40770c9170
|
c83e356d265a1d294733885c373d0a4c258c2d5e
|
/mayan/apps/announcements/views.py
|
8c1c80a96b85a9513f753a1ed3a35b6c541b84dc
|
[
"Apache-2.0"
] |
permissive
|
TrellixVulnTeam/fall-2021-hw2-451-unavailable-for-legal-reasons_6YX3
|
4160809d2c96707a196b8c94ea9e4df1a119d96a
|
0e4e919fd2e1ded6711354a0330135283e87f8c7
|
refs/heads/master
| 2023-08-21T23:36:41.230179
| 2021-10-02T03:51:12
| 2021-10-02T03:51:12
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 3,860
|
py
|
import logging
from django.template import RequestContext
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from mayan.apps.views.generics import (
MultipleObjectConfirmActionView, SingleObjectCreateView,
SingleObjectEditView, SingleObjectListView
)
from .icons import icon_announcement_list
from .links import link_announcement_create
from .models import Announcement
from .permissions import (
permission_announcement_create, permission_announcement_delete,
permission_announcement_edit, permission_announcement_view
)
logger = logging.getLogger(name=__name__)
class AnnouncementCreateView(SingleObjectCreateView):
fields = ('label', 'text', 'enabled', 'start_datetime', 'end_datetime')
model = Announcement
view_permission = permission_announcement_create
def get_extra_context(self):
return {
'title': _('Create announcement'),
}
def get_instance_extra_data(self):
return {
'_event_actor': self.request.user
}
class AnnouncementDeleteView(MultipleObjectConfirmActionView):
error_message = _(
'Error deleting announcement "%(instance)s"; %(exception)s'
)
model = Announcement
object_permission = permission_announcement_delete
pk_url_kwarg = 'announcement_id'
post_action_redirect = reverse_lazy(
viewname='announcements:announcement_list'
)
success_message_single = _(
'Announcement "%(object)s" deleted successfully.'
)
success_message_singular = _(
'%(count)d announcement deleted successfully.'
)
success_message_plural = _(
'%(count)d announcements deleted successfully.'
)
title_single = _('Delete announcement: %(object)s.')
title_singular = _('Delete the %(count)d selected announcement.')
title_plural = _('Delete the %(count)d selected announcements.')
def get_extra_context(self):
context = {
'delete_view': True,
}
if self.object_list.count() == 1:
context.update(
{
'object': self.object_list.first(),
}
)
return context
def object_action(self, instance, form=None):
instance.delete()
class AnnouncementEditView(SingleObjectEditView):
fields = ('label', 'text', 'enabled', 'start_datetime', 'end_datetime')
model = Announcement
object_permission = permission_announcement_edit
pk_url_kwarg = 'announcement_id'
post_action_redirect = reverse_lazy(
viewname='announcements:announcement_list'
)
def get_extra_context(self):
return {
'object': self.object,
'title': _('Edit announcement: %s') % self.object,
}
def get_instance_extra_data(self):
return {
'_event_actor': self.request.user
}
class AnnouncementListView(SingleObjectListView):
model = Announcement
object_permission = permission_announcement_view
def get_extra_context(self):
return {
'hide_link': True,
'hide_object': True,
'no_results_icon': icon_announcement_list,
'no_results_main_link': link_announcement_create.resolve(
context=RequestContext(request=self.request)
),
'no_results_text': _(
'Announcements are displayed in the login view. You can use '
'announcements to convery information about your organzation, '
'announcements or usage guidelines for your users.'
),
'no_results_title': _('No announcements available'),
'title': _('Announcements'),
}
|
[
"79801878+Meng87@users.noreply.github.com"
] |
79801878+Meng87@users.noreply.github.com
|
38e00c28fd10a054e3f45b1869c473b5a80aff1c
|
57dfd89d63b3b52eed144653c8264d50fa9fba6e
|
/consolidacion/urls.py
|
ccb88f7779bde647146b0913aaa142b06376d955
|
[] |
no_license
|
geovanniberdugo/siiom
|
c850620214a1a3b8b1fc83ab895c0601241da3b4
|
5e2b72aff7ac5e94a93b7575603114b4ea5f628a
|
refs/heads/main
| 2023-02-16T15:02:30.539674
| 2021-01-15T22:29:36
| 2021-01-15T22:29:36
| 330,036,242
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 499
|
py
|
from django.urls import re_path
from . import views
app_name = 'consolidacion'
urlpatterns = [
re_path(r'^asignar_grupo_visitas/$', views.asignar_grupo_visitas, name="asignar_grupo_visitas"),
re_path(r'^visitas/nueva/$', views.CrearVisitaView.as_view(), name="crear_visita"),
re_path(r'^visitas/editar/(?P<pk>\d+)/$', views.EditarVisitaView.as_view(), name="editar_visita"),
re_path(r'^api/visitas/asignar/$', views.asignar_grupo_visitas_ajax, name="asignar_grupo_visitas_ajax"),
]
|
[
"geovanni.berdugo@gmail.com"
] |
geovanni.berdugo@gmail.com
|
8d8428dc37777f73a06a488c972c3fc9cb65d1a0
|
68cec278ee55799811b3fd9643c31bab4460457d
|
/honcho/test/integration/test_run.py
|
7195e979d11c6e3137f9562611c873eb0f1cb441
|
[
"MIT"
] |
permissive
|
BoldBigflank/honcho
|
78d03da885172a14898bf2706ce14661c1c7047c
|
bbcb4d6b466c9008c85980307317603afd3bc101
|
refs/heads/master
| 2021-01-18T09:04:10.447029
| 2016-01-26T21:55:20
| 2016-01-26T21:55:20
| 50,392,809
| 0
| 0
| null | 2016-01-26T01:05:43
| 2016-01-26T01:05:43
| null |
UTF-8
|
Python
| false
| false
| 1,318
|
py
|
import sys
import textwrap
from ..helpers import TestCase
from ..helpers import TestEnv
python_bin = sys.executable
script = textwrap.dedent("""
from __future__ import print_function
import os
import sys
print(os.environ.get("ANIMAL", "elephant"))
print("error output", file=sys.stderr)
""")
class TestRun(TestCase):
def test_run(self):
with TestEnv({'test.py': script}) as env:
ret, out, err = env.run_honcho(['run', python_bin, 'test.py'])
self.assertEqual(ret, 0)
self.assertEqual(out, 'elephant\n')
self.assertTrue('error output\n' in err)
def test_run_env(self):
with TestEnv({'.env': 'ANIMAL=giraffe', 'test.py': script}) as env:
ret, out, err = env.run_honcho(['run', python_bin, 'test.py'])
self.assertEqual(ret, 0)
self.assertEqual(out, 'giraffe\n')
def test_run_args_before_command(self):
# Regression test for #122 -- ensure that common args can be given
# before the subcommand.
with TestEnv({'.env.x': 'ANIMAL=giraffe', 'test.py': script}) as env:
ret, out, err = env.run_honcho(['-e', '.env.x',
'run', python_bin, 'test.py'])
self.assertEqual(ret, 0)
self.assertEqual(out, 'giraffe\n')
|
[
"nick@whiteink.com"
] |
nick@whiteink.com
|
a39cb4a7ba8bcae6fe139e57c54bd5c6b056a517
|
f167dffa2f767a0419aa82bf434852069a8baeb8
|
/lib/youtube_dl/extractor/gigya.py
|
412178492fe1062ac83c554617034b6df61cbabd
|
[
"MIT"
] |
permissive
|
firsttris/plugin.video.sendtokodi
|
d634490b55149adfdcb62c1af1eb77568b8da3f5
|
1095c58e2bc21de4ab6fcb67a70e4f0f04febbc3
|
refs/heads/master
| 2023-08-18T10:10:39.544848
| 2023-08-15T17:06:44
| 2023-08-15T17:06:44
| 84,665,460
| 111
| 31
|
MIT
| 2022-11-11T08:05:21
| 2017-03-11T16:53:06
|
Python
|
UTF-8
|
Python
| false
| false
| 677
|
py
|
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
urlencode_postdata,
)
class GigyaBaseIE(InfoExtractor):
def _gigya_login(self, auth_data):
auth_info = self._download_json(
'https://accounts.eu1.gigya.com/accounts.login', None,
note='Logging in', errnote='Unable to log in',
data=urlencode_postdata(auth_data))
error_message = auth_info.get('errorDetails') or auth_info.get('errorMessage')
if error_message:
raise ExtractorError(
'Unable to login: %s' % error_message, expected=True)
return auth_info
|
[
"noreply@github.com"
] |
firsttris.noreply@github.com
|
7b39b19ccd500ec83103a1e07e89e55b108079df
|
7a6e2a3492b6e237a70b12d75fd05b7a77472af3
|
/py/corePy/13.1_object_intrudce.py
|
7cc7f9937ce8aebe920253080fa91f4d7131c4bb
|
[] |
no_license
|
timtingwei/prac
|
e44b7e4634a931d36ed7e09770447f5dba5f25e6
|
ae77fa781934226ab1e22d6aba6dba152dd15bfe
|
refs/heads/master
| 2020-05-21T17:53:07.144037
| 2017-10-10T14:55:52
| 2017-10-10T14:55:52
| 63,440,125
| 3
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 2,305
|
py
|
#13.1_object_intrudce.py
#/// instance and class
class MyData(object):
""""
def __init__(self):
self.x = 10
self.y = 20
"""
pass
mathObj = MyData()
mathObj.x = 4 #/// x是实例特有的属性,不是类的属性,是动态的
mathObj.y = 5
print (mathObj.x + mathObj.y)
#9
print (mathObj.x * mathObj.y)
#20
#/// method
class MyDataWithMethod(object): #定义类和方法
def printFoo(self):
print ('You invoked printFoo()!')
myObj = MyDataWithMethod() #创建实例
myObj.printFoo() #调用方法
#You invoked printFoo()!
#create a class
class AddrBookEntry(object):
'address book entry class'
def __init__(self,nm,ph): #///在实例化的时候被调用
self.name = nm
self.phone = ph
print ('Created instance for:',self.name) #打印出介绍,self被实例名替换
def updatePhone(self,newph):
self.phone = newph
print ('Updated phone # for: ',self.name)
#create instance
john = AddrBookEntry('John Doe','408-555-1212')
#Created instance for: John Doe
jane = AddrBookEntry('Jane Doe','650-555-1212')
#Created instance for: Jane Doe
print (john)
#<__main__.AddrBookEntry object at 0x028531D0>
print (john.name) #打印实例的名字
#John Doe
print (john.phone)
#408-555-1212
print (jane.name)
#Jane Doe
print (jane.phone)
#650-555-1212
#call method
john.updatePhone('415-555-1212')
#Updated phone # for: John Doe
print (john.phone)
#415-555-1212
#create subclass
class EmplAddrBookEntry(AddrBookEntry):
'Employee Address Book Entry class'
def __init__(self,nm,ph,id,em):
AddrBookEntry.__init__(self,nm,ph) #super().__init__(self)
self.empid = id
self.email = em
def updateEmail(self,newem):
self.email = newem
print ('Updated e-mail address for:',self.name)
john = EmplAddrBookEntry('John Doe','408-555-1212',42,'jogh@hotmail.com')
#Created instance for: John Doe
print (john)
#<__main__.EmplAddrBookEntry object at 0x02883490>
print (john.name) #John Doe
print (john.phone) #408-555-1212
print (john.email) #jogh@hotmail.com
john.updatePhone('415-555-1212') #Updated phone # for: John Doe
print (john.phone) #415-555-1212
john.updateEmail('john@doe.spam') #Updated e-mail address for: John Doe
print (john.email) #john@doe.spam
|
[
"timtingwei@gmail.com"
] |
timtingwei@gmail.com
|
691d455b00d64ff5f36b32c1a00b31fec450c885
|
b3ea7a2d723d432a65748e073cae25e83441580f
|
/dns_spoof.py
|
b1b224ca654ef3801acf63b08b9e01cf3b6380b1
|
[] |
no_license
|
jcohen66/htools
|
7622aa90465abb674e8f413bab7686b26b6a99fd
|
ba8bef2a540e1c58772143b9d3446fd8c30eade7
|
refs/heads/master
| 2023-02-15T04:13:23.419561
| 2020-02-01T19:16:50
| 2020-02-01T19:16:50
| 233,474,276
| 0
| 0
| null | 2023-01-20T23:39:22
| 2020-01-12T23:24:49
|
Python
|
UTF-8
|
Python
| false
| false
| 1,143
|
py
|
#!/usr/bin/env python
# iptables -I FORWARD -j NFQUEUE --queue-num 0
# iptables -I OUTPUT -j NFQUEUE --queue-num 0
# Must do when done: iptables fllush
import netfilterqueue
import scapy.all as scapy
def process_packet(packet):
scapy_packet = scapy.IP(packet.get_payload())
if scapy_packet.haslayer(scapy.DNSRR):
# target website
qname = scapy_packet[scapy.DNSQR].qname
# print(scapy_packet.show())
if 'www.bing.com' in qname:
print('[+] Spoofing target')
answer = scapy.DNSRR(rrname=qname, rdata='10.0.2.15')
scapy_packet[scapy.DNS].an = answer
scapy_packet[scapy.DNS].ancount = 1
# Remove fields so scapy can recalc..
del scapy_packet[scapy.IP].len
del scapy_packet[scapy.IP].chksum
del scapy_packet[scapy.UDP].len
del scapy_packet[scapy.UDP].chksum
# Convert packet to str and replace
# original payload.
packet.set_payload(str(scapy_packet))
packet.accept()
queue = netfilterqueue.NetfilterQueue()
queue.bind(0, process_packet)
queue.run()
|
[
"jcohen66@optonline.net"
] |
jcohen66@optonline.net
|
e3ee32f2248a6378906588b43cc58abefa8e0771
|
28d5174b51d43ade5e57dc6498473e8029356b1a
|
/src/openfermion/transforms/_bravyi_kitaev.py
|
2dacc68b00b30341aa27575a0b971c01ba5b5301
|
[
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] |
permissive
|
Strilanc/OpenFermion
|
2b350ae7ea464460e1f422a59c8d7033dc5774ef
|
3a0a57b8b545acd2a2ff6b61e88f7c8a8a4437c8
|
refs/heads/master
| 2021-01-25T13:59:21.177659
| 2018-03-02T15:47:22
| 2018-03-02T15:47:22
| 123,639,421
| 1
| 0
| null | 2018-03-02T22:55:29
| 2018-03-02T22:55:28
| null |
UTF-8
|
Python
| false
| false
| 4,691
|
py
|
# 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.
"""Bravyi-Kitaev transform on fermionic operators."""
from __future__ import absolute_import
from openfermion.ops import QubitOperator
from openfermion.transforms._fenwick_tree import FenwickTree
def bravyi_kitaev(operator, n_qubits=None):
"""Apply the Bravyi-Kitaev transform and return qubit operator.
Args:
operator (openfermion.ops.FermionOperator):
A FermionOperator to transform.
n_qubits (int|None):
Can force the number of qubits in the resulting operator above the
number that appear in the input operator.
Returns:
transformed_operator: An instance of the QubitOperator class.
Raises:
ValueError: Invalid number of qubits specified.
"""
# Compute the number of qubits.
from openfermion.utils import count_qubits
if n_qubits is None:
n_qubits = count_qubits(operator)
if n_qubits < count_qubits(operator):
raise ValueError('Invalid number of qubits specified.')
# Build the Fenwick tree.
fenwick_tree = FenwickTree(n_qubits)
# Compute transformed operator.
transformed_terms = (
_transform_operator_term(term=term,
coefficient=operator.terms[term],
fenwick_tree=fenwick_tree)
for term in operator.terms
)
return inline_sum(seed=QubitOperator(), summands=transformed_terms)
def _transform_operator_term(term, coefficient, fenwick_tree):
"""
Args:
term (list[tuple[int, int]]):
A list of (mode, raising-vs-lowering) ladder operator terms.
coefficient (float):
fenwick_tree (FenwickTree):
Returns:
QubitOperator:
"""
# Build the Bravyi-Kitaev transformed operators.
transformed_ladder_ops = (
_transform_ladder_operator(ladder_operator, fenwick_tree)
for ladder_operator in term
)
return inline_product(seed=QubitOperator((), coefficient),
factors=transformed_ladder_ops)
def _transform_ladder_operator(ladder_operator, fenwick_tree):
"""
Args:
ladder_operator (tuple[int, int]):
fenwick_tree (FenwickTree):
Returns:
QubitOperator:
"""
index = ladder_operator[0]
# Parity set. Set of nodes to apply Z to.
parity_set = [node.index for node in
fenwick_tree.get_parity_set(index)]
# Update set. Set of ancestors to apply X to.
ancestors = [node.index for node in
fenwick_tree.get_update_set(index)]
# The C(j) set.
ancestor_children = [node.index for node in
fenwick_tree.get_remainder_set(index)]
# Switch between lowering/raising operators.
d_coefficient = -.5j if ladder_operator[1] else .5j
# The fermion lowering operator is given by
# a = (c+id)/2 where c, d are the majoranas.
d_majorana_component = QubitOperator(
(((ladder_operator[0], 'Y'),) +
tuple((index, 'Z') for index in ancestor_children) +
tuple((index, 'X') for index in ancestors)),
d_coefficient)
c_majorana_component = QubitOperator(
(((ladder_operator[0], 'X'),) +
tuple((index, 'Z') for index in parity_set) +
tuple((index, 'X') for index in ancestors)),
0.5)
return c_majorana_component + d_majorana_component
def inline_sum(seed, summands):
"""Computes a sum, using the __iadd__ operator.
Args:
seed (T): The starting total. The zero value.
summands (iterable[T]): Values to add (with +=) into the total.
Returns:
T: The result of adding all the factors into the zero value.
"""
for r in summands:
seed += r
return seed
def inline_product(seed, factors):
"""Computes a product, using the __imul__ operator.
Args:
seed (T): The starting total. The unit value.
factors (iterable[T]): Values to multiply (with *=) into the total.
Returns:
T: The result of multiplying all the factors into the unit value.
"""
for r in factors:
seed *= r
return seed
|
[
"ryanbabbush@gmail.com"
] |
ryanbabbush@gmail.com
|
89c69e1d90ba66dd187d673e41bc6ef863d979f0
|
9efe15e39ffda8391abd5a63b95e441648ba57c2
|
/comments_service/app.py
|
551ddf03f80dc3fd17554f8b88ebd2fce2b36a9a
|
[] |
no_license
|
TechAcademy-Azerbaijan/mini_microservice_app
|
3af2f80047b9a945f07ac1d4c7dd5a01980169e0
|
b06c13a7feac4b9f46ab1d3bed19e36a7de3cd4e
|
refs/heads/master
| 2023-08-15T19:49:22.058966
| 2021-10-22T08:21:40
| 2021-10-22T08:21:40
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 171
|
py
|
from flask import Flask
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
from routers import *
if __name__ == '__main__':
app.run(port=5001, debug=True)
|
[
"idris.sabanli@gmail.com"
] |
idris.sabanli@gmail.com
|
5748c6c0f61c1e26cc0a69ccdc886b09d4c10206
|
fc58366ed416de97380df7040453c9990deb7faa
|
/tools/dockerize/webportal/usr/lib/python2.7/site-packages/daoliproxy/openstack/common/jsonutils.py
|
01f53842152b1abb35a68344d67a2fcf320558f4
|
[
"Apache-2.0"
] |
permissive
|
foruy/openflow-multiopenstack
|
eb51e37b2892074234ebdd5b501b24aa1f72fb86
|
74140b041ac25ed83898ff3998e8dcbed35572bb
|
refs/heads/master
| 2016-09-13T08:24:09.713883
| 2016-05-19T01:16:58
| 2016-05-19T01:16:58
| 58,977,485
| 1
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 6,410
|
py
|
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# 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.
'''
JSON related utilities.
This module provides a few things:
1) A handy function for getting an object down to something that can be
JSON serialized. See to_primitive().
2) Wrappers around loads() and dumps(). The dumps() wrapper will
automatically use to_primitive() for you if needed.
3) This sets up anyjson to use the loads() and dumps() wrappers if anyjson
is available.
'''
import datetime
import functools
import inspect
import itertools
import json
try:
import xmlrpclib
except ImportError:
# NOTE(jd): xmlrpclib is not shipped with Python 3
xmlrpclib = None
import six
from daoliproxy.openstack.common import gettextutils
from daoliproxy.openstack.common import importutils
from daoliproxy.openstack.common import timeutils
netaddr = importutils.try_import("netaddr")
_nasty_type_tests = [inspect.ismodule, inspect.isclass, inspect.ismethod,
inspect.isfunction, inspect.isgeneratorfunction,
inspect.isgenerator, inspect.istraceback, inspect.isframe,
inspect.iscode, inspect.isbuiltin, inspect.isroutine,
inspect.isabstract]
_simple_types = (six.string_types + six.integer_types
+ (type(None), bool, float))
def to_primitive(value, convert_instances=False, convert_datetime=True,
level=0, max_depth=3):
"""Convert a complex object into primitives.
Handy for JSON serialization. We can optionally handle instances,
but since this is a recursive function, we could have cyclical
data structures.
To handle cyclical data structures we could track the actual objects
visited in a set, but not all objects are hashable. Instead we just
track the depth of the object inspections and don't go too deep.
Therefore, convert_instances=True is lossy ... be aware.
"""
# handle obvious types first - order of basic types determined by running
# full tests on nova project, resulting in the following counts:
# 572754 <type 'NoneType'>
# 460353 <type 'int'>
# 379632 <type 'unicode'>
# 274610 <type 'str'>
# 199918 <type 'dict'>
# 114200 <type 'datetime.datetime'>
# 51817 <type 'bool'>
# 26164 <type 'list'>
# 6491 <type 'float'>
# 283 <type 'tuple'>
# 19 <type 'long'>
if isinstance(value, _simple_types):
return value
if isinstance(value, datetime.datetime):
if convert_datetime:
return timeutils.strtime(value)
else:
return value
# value of itertools.count doesn't get caught by nasty_type_tests
# and results in infinite loop when list(value) is called.
if type(value) == itertools.count:
return six.text_type(value)
# FIXME(vish): Workaround for LP bug 852095. Without this workaround,
# tests that raise an exception in a mocked method that
# has a @wrap_exception with a notifier will fail. If
# we up the dependency to 0.5.4 (when it is released) we
# can remove this workaround.
if getattr(value, '__module__', None) == 'mox':
return 'mock'
if level > max_depth:
return '?'
# The try block may not be necessary after the class check above,
# but just in case ...
try:
recursive = functools.partial(to_primitive,
convert_instances=convert_instances,
convert_datetime=convert_datetime,
level=level,
max_depth=max_depth)
if isinstance(value, dict):
return dict((k, recursive(v)) for k, v in six.iteritems(value))
elif isinstance(value, (list, tuple)):
return [recursive(lv) for lv in value]
# It's not clear why xmlrpclib created their own DateTime type, but
# for our purposes, make it a datetime type which is explicitly
# handled
if xmlrpclib and isinstance(value, xmlrpclib.DateTime):
value = datetime.datetime(*tuple(value.timetuple())[:6])
if convert_datetime and isinstance(value, datetime.datetime):
return timeutils.strtime(value)
elif isinstance(value, gettextutils.Message):
return value.data
elif hasattr(value, 'iteritems'):
return recursive(dict(value.iteritems()), level=level + 1)
elif hasattr(value, '__iter__'):
return recursive(list(value))
elif convert_instances and hasattr(value, '__dict__'):
# Likely an instance of something. Watch for cycles.
# Ignore class member vars.
return recursive(value.__dict__, level=level + 1)
elif netaddr and isinstance(value, netaddr.IPAddress):
return six.text_type(value)
else:
if any(test(value) for test in _nasty_type_tests):
return six.text_type(value)
return value
except TypeError:
# Class objects are tricky since they may define something like
# __iter__ defined but it isn't callable as list().
return six.text_type(value)
def dumps(value, default=to_primitive, **kwargs):
return json.dumps(value, default=default, **kwargs)
def loads(s):
return json.loads(s)
def load(s):
return json.load(s)
try:
import anyjson
except ImportError:
pass
else:
anyjson._modules.append((__name__, 'dumps', TypeError,
'loads', ValueError, 'load'))
anyjson.force_implementation(__name__)
|
[
"wenxiang.wang1204@gmail.com"
] |
wenxiang.wang1204@gmail.com
|
70ef375de4132592447a64d6c61315fdfb5dc366
|
da370ba0df9700519139e1da54f3e7f38e9b7f5f
|
/.nox/tests/lib/python3.7/site-packages/tensorflow_probability/python/distributions/batch_reshape.py
|
d20d580d3ab4234f741cbbdfce80905dbbd63a86
|
[
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] |
permissive
|
antonevenepoel/open_spiel
|
90e3c7c6611cf508f2872237412fd67cf6cd10e0
|
f2f0c786410018675fc40e9a5b82c40814555fa8
|
refs/heads/master
| 2021-03-15T20:57:00.562672
| 2020-05-15T16:10:23
| 2020-05-15T16:10:23
| 246,877,171
| 0
| 0
|
Apache-2.0
| 2020-03-12T16:07:42
| 2020-03-12T16:07:41
| null |
UTF-8
|
Python
| false
| false
| 18,080
|
py
|
# Copyright 2018 The TensorFlow Probability Authors.
#
# 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.
# ============================================================================
"""The BatchReshape distribution."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# Dependency imports
import numpy as np
import tensorflow.compat.v1 as tf1
import tensorflow.compat.v2 as tf
from tensorflow_probability.python.distributions import distribution as distribution_lib
from tensorflow_probability.python.internal import assert_util
from tensorflow_probability.python.internal import tensorshape_util
__all__ = [
"BatchReshape",
]
class BatchReshape(distribution_lib.Distribution):
"""The Batch-Reshaping distribution.
This "meta-distribution" reshapes the batch dimensions of another
distribution.
#### Examples
```python
tfd = tfp.distributions
dtype = np.float32
dims = 2
new_batch_shape = [1, 2, -1]
old_batch_shape = [6]
scale = np.ones(old_batch_shape + [dims], dtype)
mvn = tfd.MultivariateNormalDiag(scale_diag=scale)
reshape_mvn = tfd.BatchReshape(
distribution=mvn,
batch_shape=new_batch_shape,
validate_args=True)
reshape_mvn.batch_shape
# ==> [1, 2, 3]
x = reshape_mvn.sample(sample_shape=[4, 5])
x.shape
# ==> [4, 5, 1, 2, 3, 2] == sample_shape + new_batch_shape + [dims]
reshape_mvn.log_prob(x).shape
# ==> [4, 5, 1, 2, 3] == sample_shape + new_batch_shape
```
"""
def __init__(self,
distribution,
batch_shape,
validate_args=False,
allow_nan_stats=True,
name=None):
"""Construct BatchReshape distribution.
Args:
distribution: The base distribution instance to reshape. Typically an
instance of `Distribution`.
batch_shape: Positive `int`-like vector-shaped `Tensor` representing
the new shape of the batch dimensions. Up to one dimension may contain
`-1`, meaning the remainder of the batch size.
validate_args: Python `bool`, default `False`. When `True` distribution
parameters are checked for validity despite possibly degrading runtime
performance. When `False` invalid inputs may silently render incorrect
outputs.
allow_nan_stats: Python `bool`, default `True`. When `True`, statistics
(e.g., mean, mode, variance) use the value "`NaN`" to indicate the
result is undefined. When `False`, an exception is raised if one or
more of the statistic's batch members are undefined.
name: The name to give Ops created by the initializer.
Default value: `"BatchReshape" + distribution.name`.
Raises:
ValueError: if `batch_shape` is not a vector.
ValueError: if `batch_shape` has non-positive elements.
ValueError: if `batch_shape` size is not the same as a
`distribution.batch_shape` size.
"""
parameters = dict(locals())
name = name or "BatchReshape" + distribution.name
with tf.name_scope(name) as name:
# The unexpanded batch shape may contain up to one dimension of -1.
self._batch_shape_unexpanded = tf.convert_to_tensor(
value=batch_shape, dtype=tf.int32, name="batch_shape")
validate_init_args_statically(distribution, self._batch_shape_unexpanded)
batch_shape, batch_shape_static, runtime_assertions = calculate_reshape(
distribution.batch_shape_tensor(), self._batch_shape_unexpanded,
validate_args)
self._distribution = distribution
self._batch_shape_ = batch_shape
self._batch_shape_static = batch_shape_static
self._runtime_assertions = runtime_assertions
super(BatchReshape, self).__init__(
dtype=distribution.dtype,
reparameterization_type=distribution.reparameterization_type,
validate_args=validate_args,
allow_nan_stats=allow_nan_stats,
parameters=parameters,
graph_parents=(
[self._batch_shape_unexpanded] + distribution._graph_parents), # pylint: disable=protected-access
name=name)
@property
def distribution(self):
return self._distribution
def _batch_shape_tensor(self):
with tf.control_dependencies(self._runtime_assertions):
return tf.identity(self._batch_shape_)
def _batch_shape(self):
return self._batch_shape_static
def _event_shape_tensor(self):
with tf.control_dependencies(self._runtime_assertions):
return tf.identity(self.distribution.event_shape_tensor())
def _event_shape(self):
return self.distribution.event_shape
def _sample_n(self, n, seed=None, **kwargs):
with tf.control_dependencies(self._runtime_assertions):
x = self.distribution.sample(sample_shape=n, seed=seed, **kwargs)
new_shape = tf.concat(
[
[n],
self._batch_shape_unexpanded,
self.event_shape_tensor(),
],
axis=0)
return tf.reshape(x, new_shape)
def _log_prob(self, x, **kwargs):
return self._call_reshape_input_output(
self.distribution.log_prob, x, extra_kwargs=kwargs)
def _prob(self, x, **kwargs):
return self._call_reshape_input_output(
self.distribution.prob, x, extra_kwargs=kwargs)
def _log_cdf(self, x, **kwargs):
return self._call_reshape_input_output(
self.distribution.log_cdf, x, extra_kwargs=kwargs)
def _cdf(self, x, **kwargs):
return self._call_reshape_input_output(
self.distribution.cdf, x, extra_kwargs=kwargs)
def _log_survival_function(self, x, **kwargs):
return self._call_reshape_input_output(
self.distribution.log_survival_function, x, extra_kwargs=kwargs)
def _survival_function(self, x, **kwargs):
return self._call_reshape_input_output(
self.distribution.survival_function, x, extra_kwargs=kwargs)
def _entropy(self, **kwargs):
return self._call_and_reshape_output(
self.distribution.entropy,
[],
[tf.TensorShape([])],
extra_kwargs=kwargs)
def _mean(self, **kwargs):
return self._call_and_reshape_output(self.distribution.mean,
extra_kwargs=kwargs)
def _mode(self, **kwargs):
return self._call_and_reshape_output(self.distribution.mode,
extra_kwargs=kwargs)
def _stddev(self, **kwargs):
return self._call_and_reshape_output(self.distribution.stddev,
extra_kwargs=kwargs)
def _variance(self, **kwargs):
return self._call_and_reshape_output(self.distribution.variance,
extra_kwargs=kwargs)
def _covariance(self, **kwargs):
return self._call_and_reshape_output(
self.distribution.covariance,
[self.event_shape_tensor()]*2,
[self.event_shape]*2,
extra_kwargs=kwargs)
def _sample_shape(self, x):
"""Computes graph and static `sample_shape`."""
x_ndims = (
tf.rank(x) if tensorshape_util.rank(x.shape) is None else
tensorshape_util.rank(x.shape))
event_ndims = (
tf.size(input=self.event_shape_tensor())
if tensorshape_util.rank(self.event_shape) is None else
tensorshape_util.rank(self.event_shape))
batch_ndims = (
tf.size(input=self._batch_shape_unexpanded)
if tensorshape_util.rank(self.batch_shape) is None else
tensorshape_util.rank(self.batch_shape))
sample_ndims = x_ndims - batch_ndims - event_ndims
if isinstance(sample_ndims, int):
static_sample_shape = x.shape[:sample_ndims]
else:
static_sample_shape = tf.TensorShape(None)
if tensorshape_util.is_fully_defined(static_sample_shape):
sample_shape = np.int32(static_sample_shape)
else:
sample_shape = tf.shape(input=x)[:sample_ndims]
return sample_shape, static_sample_shape
def _call_reshape_input_output(self, fn, x, extra_kwargs=None):
"""Calls `fn`, appropriately reshaping its input `x` and output."""
# Note: we take `extra_kwargs` as a dict rather than `**extra_kwargs`
# because it is possible the user provided extra kwargs would itself
# have `fn` and/or `x` as a key.
with tf.control_dependencies(self._runtime_assertions +
self._validate_sample_arg(x)):
sample_shape, static_sample_shape = self._sample_shape(x)
old_shape = tf.concat(
[
sample_shape,
self.distribution.batch_shape_tensor(),
self.event_shape_tensor(),
],
axis=0)
x_reshape = tf.reshape(x, old_shape)
result = fn(x_reshape, **extra_kwargs) if extra_kwargs else fn(x_reshape)
new_shape = tf.concat(
[
sample_shape,
self._batch_shape_unexpanded,
], axis=0)
result = tf.reshape(result, new_shape)
if (tensorshape_util.rank(static_sample_shape) is not None and
tensorshape_util.rank(self.batch_shape) is not None):
new_shape = tensorshape_util.concatenate(static_sample_shape,
self.batch_shape)
tensorshape_util.set_shape(result, new_shape)
return result
def _call_and_reshape_output(
self,
fn,
event_shape_list=None,
static_event_shape_list=None,
extra_kwargs=None):
"""Calls `fn` and appropriately reshapes its output."""
# Note: we take `extra_kwargs` as a dict rather than `**extra_kwargs`
# because it is possible the user provided extra kwargs would itself
# have `fn`, `event_shape_list`, `static_event_shape_list` and/or
# `extra_kwargs` as keys.
with tf.control_dependencies(self._runtime_assertions):
if event_shape_list is None:
event_shape_list = [self._event_shape_tensor()]
if static_event_shape_list is None:
static_event_shape_list = [self.event_shape]
new_shape = tf.concat(
[self._batch_shape_unexpanded] + event_shape_list, axis=0)
result = tf.reshape(fn(**extra_kwargs) if extra_kwargs else fn(),
new_shape)
if (tensorshape_util.rank(self.batch_shape) is not None and
tensorshape_util.rank(self.event_shape) is not None):
event_shape = tf.TensorShape([])
for rss in static_event_shape_list:
event_shape = tensorshape_util.concatenate(event_shape, rss)
static_shape = tensorshape_util.concatenate(
self.batch_shape, event_shape)
tensorshape_util.set_shape(result, static_shape)
return result
def _validate_sample_arg(self, x):
"""Helper which validates sample arg, e.g., input to `log_prob`."""
with tf.name_scope("validate_sample_arg"):
x_ndims = (
tf.rank(x) if tensorshape_util.rank(x.shape) is None else
tensorshape_util.rank(x.shape))
event_ndims = (
tf.size(input=self.event_shape_tensor())
if tensorshape_util.rank(self.event_shape) is None else
tensorshape_util.rank(self.event_shape))
batch_ndims = (
tf.size(input=self._batch_shape_unexpanded)
if tensorshape_util.rank(self.batch_shape) is None else
tensorshape_util.rank(self.batch_shape))
expected_batch_event_ndims = batch_ndims + event_ndims
if (isinstance(x_ndims, int) and
isinstance(expected_batch_event_ndims, int)):
if x_ndims < expected_batch_event_ndims:
raise NotImplementedError(
"Broadcasting is not supported; too few batch and event dims "
"(expected at least {}, saw {}).".format(
expected_batch_event_ndims, x_ndims))
ndims_assertion = []
elif self.validate_args:
ndims_assertion = [
assert_util.assert_greater_equal(
x_ndims,
expected_batch_event_ndims,
message=("Broadcasting is not supported; too few "
"batch and event dims."),
name="assert_batch_and_event_ndims_large_enough"),
]
if (tensorshape_util.is_fully_defined(self.batch_shape) and
tensorshape_util.is_fully_defined(self.event_shape)):
expected_batch_event_shape = np.int32(
tensorshape_util.concatenate(self.batch_shape, self.event_shape))
else:
expected_batch_event_shape = tf.concat(
[
self.batch_shape_tensor(),
self.event_shape_tensor(),
], axis=0)
sample_ndims = x_ndims - expected_batch_event_ndims
if isinstance(sample_ndims, int):
sample_ndims = max(sample_ndims, 0)
if (isinstance(sample_ndims, int) and
tensorshape_util.is_fully_defined(x.shape[sample_ndims:])):
actual_batch_event_shape = np.int32(x.shape[sample_ndims:])
else:
sample_ndims = tf.maximum(sample_ndims, 0)
actual_batch_event_shape = tf.shape(input=x)[sample_ndims:]
if (isinstance(expected_batch_event_shape, np.ndarray) and
isinstance(actual_batch_event_shape, np.ndarray)):
if any(expected_batch_event_shape != actual_batch_event_shape):
raise NotImplementedError("Broadcasting is not supported; "
"unexpected batch and event shape "
"(expected {}, saw {}).".format(
expected_batch_event_shape,
actual_batch_event_shape))
# We need to set the final runtime-assertions to `ndims_assertion` since
# its possible this assertion was created. We could add a condition to
# only do so if `self.validate_args == True`, however this is redundant
# as `ndims_assertion` already encodes this information.
runtime_assertions = ndims_assertion
elif self.validate_args:
# We need to make the `ndims_assertion` a control dep because otherwise
# TF itself might raise an exception owing to this assertion being
# ill-defined, ie, one cannot even compare different rank Tensors.
with tf.control_dependencies(ndims_assertion):
shape_assertion = assert_util.assert_equal(
expected_batch_event_shape,
actual_batch_event_shape,
message=("Broadcasting is not supported; "
"unexpected batch and event shape."),
name="assert_batch_and_event_shape_same")
runtime_assertions = [shape_assertion]
else:
runtime_assertions = []
return runtime_assertions
def calculate_reshape(original_shape, new_shape, validate=False, name=None):
"""Calculates the reshaped dimensions (replacing up to one -1 in reshape)."""
batch_shape_static = tensorshape_util.constant_value_as_shape(new_shape)
if tensorshape_util.is_fully_defined(batch_shape_static):
return np.int32(batch_shape_static), batch_shape_static, []
with tf.name_scope(name or "calculate_reshape"):
original_size = tf.reduce_prod(input_tensor=original_shape)
implicit_dim = tf.equal(new_shape, -1)
size_implicit_dim = (
original_size // tf.maximum(1, -tf.reduce_prod(input_tensor=new_shape)))
new_ndims = tf.shape(input=new_shape)
expanded_new_shape = tf1.where( # Assumes exactly one `-1`.
implicit_dim, tf.fill(new_ndims, size_implicit_dim), new_shape)
validations = [] if not validate else [ # pylint: disable=g-long-ternary
assert_util.assert_rank(
original_shape, 1, message="Original shape must be a vector."),
assert_util.assert_rank(
new_shape, 1, message="New shape must be a vector."),
assert_util.assert_less_equal(
tf.math.count_nonzero(implicit_dim, dtype=tf.int32),
1,
message="At most one dimension can be unknown."),
assert_util.assert_positive(
expanded_new_shape, message="Shape elements must be >=-1."),
assert_util.assert_equal(
tf.reduce_prod(input_tensor=expanded_new_shape),
original_size,
message="Shape sizes do not match."),
]
return expanded_new_shape, batch_shape_static, validations
def validate_init_args_statically(distribution, batch_shape):
"""Helper to __init__ which makes or raises assertions."""
if tensorshape_util.rank(batch_shape.shape) is not None:
if tensorshape_util.rank(batch_shape.shape) != 1:
raise ValueError("`batch_shape` must be a vector "
"(saw rank: {}).".format(
tensorshape_util.rank(batch_shape.shape)))
batch_shape_static = tensorshape_util.constant_value_as_shape(batch_shape)
batch_size_static = tensorshape_util.num_elements(batch_shape_static)
dist_batch_size_static = tensorshape_util.num_elements(
distribution.batch_shape)
if batch_size_static is not None and dist_batch_size_static is not None:
if batch_size_static != dist_batch_size_static:
raise ValueError("`batch_shape` size ({}) must match "
"`distribution.batch_shape` size ({}).".format(
batch_size_static, dist_batch_size_static))
if tensorshape_util.dims(batch_shape_static) is not None:
if any(
tf.compat.dimension_value(dim) is not None and
tf.compat.dimension_value(dim) < 1 for dim in batch_shape_static):
raise ValueError("`batch_shape` elements must be >=-1.")
|
[
"36889203+antonevenepoel@users.noreply.github.com"
] |
36889203+antonevenepoel@users.noreply.github.com
|
ee60f854fdbc2887ebd1915348668d16c431906f
|
21590487701d2dcbe1a1c1dd81c6e983f7523cb6
|
/opentelemetry-sdk/tests/metrics/test_metric_reader_storage.py
|
97b5532feaebfb6fb7bbea2357f454d5d977cbef
|
[
"Apache-2.0"
] |
permissive
|
open-telemetry/opentelemetry-python
|
837199e541c03cff311cad075401791ee2a23583
|
d8490c5f557dd7005badeb800095cb51b553c98c
|
refs/heads/main
| 2023-08-26T06:47:23.837997
| 2023-08-17T22:35:13
| 2023-08-17T22:35:13
| 185,478,926
| 1,361
| 668
|
Apache-2.0
| 2023-09-14T20:48:40
| 2019-05-07T21:13:30
|
Python
|
UTF-8
|
Python
| false
| false
| 29,324
|
py
|
# Copyright The OpenTelemetry Authors
#
# 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 logging import WARNING
from unittest.mock import MagicMock, Mock, patch
from opentelemetry.sdk.metrics._internal.aggregation import (
_LastValueAggregation,
)
from opentelemetry.sdk.metrics._internal.instrument import (
_Counter,
_Histogram,
_ObservableCounter,
_UpDownCounter,
)
from opentelemetry.sdk.metrics._internal.measurement import Measurement
from opentelemetry.sdk.metrics._internal.metric_reader_storage import (
_DEFAULT_VIEW,
MetricReaderStorage,
)
from opentelemetry.sdk.metrics._internal.sdk_configuration import (
SdkConfiguration,
)
from opentelemetry.sdk.metrics.export import AggregationTemporality
from opentelemetry.sdk.metrics.view import (
DefaultAggregation,
DropAggregation,
ExplicitBucketHistogramAggregation,
SumAggregation,
View,
)
from opentelemetry.test.concurrency_test import ConcurrencyTestBase, MockFunc
def mock_view_matching(name, *instruments) -> Mock:
mock = Mock(name=name)
mock._match.side_effect = lambda instrument: instrument in instruments
return mock
def mock_instrument() -> Mock:
instr = Mock()
instr.attributes = {}
return instr
class TestMetricReaderStorage(ConcurrencyTestBase):
@patch(
"opentelemetry.sdk.metrics._internal"
".metric_reader_storage._ViewInstrumentMatch"
)
def test_creates_view_instrument_matches(
self, MockViewInstrumentMatch: Mock
):
"""It should create a MockViewInstrumentMatch when an instrument
matches a view"""
instrument1 = Mock(name="instrument1")
instrument2 = Mock(name="instrument2")
view1 = mock_view_matching("view_1", instrument1)
view2 = mock_view_matching("view_2", instrument1, instrument2)
storage = MetricReaderStorage(
SdkConfiguration(
resource=Mock(),
metric_readers=(),
views=(view1, view2),
),
MagicMock(
**{
"__getitem__.return_value": AggregationTemporality.CUMULATIVE
}
),
MagicMock(**{"__getitem__.return_value": DefaultAggregation()}),
)
# instrument1 matches view1 and view2, so should create two
# ViewInstrumentMatch objects
storage.consume_measurement(Measurement(1, instrument1))
self.assertEqual(
len(MockViewInstrumentMatch.call_args_list),
2,
MockViewInstrumentMatch.mock_calls,
)
# they should only be created the first time the instrument is seen
storage.consume_measurement(Measurement(1, instrument1))
self.assertEqual(len(MockViewInstrumentMatch.call_args_list), 2)
# instrument2 matches view2, so should create a single
# ViewInstrumentMatch
MockViewInstrumentMatch.call_args_list.clear()
with self.assertLogs(level=WARNING):
storage.consume_measurement(Measurement(1, instrument2))
self.assertEqual(len(MockViewInstrumentMatch.call_args_list), 1)
@patch(
"opentelemetry.sdk.metrics._internal."
"metric_reader_storage._ViewInstrumentMatch"
)
def test_forwards_calls_to_view_instrument_match(
self, MockViewInstrumentMatch: Mock
):
view_instrument_match1 = Mock(_aggregation=_LastValueAggregation({}))
view_instrument_match2 = Mock(_aggregation=_LastValueAggregation({}))
view_instrument_match3 = Mock(_aggregation=_LastValueAggregation({}))
MockViewInstrumentMatch.side_effect = [
view_instrument_match1,
view_instrument_match2,
view_instrument_match3,
]
instrument1 = Mock(name="instrument1")
instrument2 = Mock(name="instrument2")
view1 = mock_view_matching("view1", instrument1)
view2 = mock_view_matching("view2", instrument1, instrument2)
storage = MetricReaderStorage(
SdkConfiguration(
resource=Mock(),
metric_readers=(),
views=(view1, view2),
),
MagicMock(
**{
"__getitem__.return_value": AggregationTemporality.CUMULATIVE
}
),
MagicMock(**{"__getitem__.return_value": DefaultAggregation()}),
)
# Measurements from an instrument should be passed on to each
# ViewInstrumentMatch objects created for that instrument
measurement = Measurement(1, instrument1)
storage.consume_measurement(measurement)
view_instrument_match1.consume_measurement.assert_called_once_with(
measurement
)
view_instrument_match2.consume_measurement.assert_called_once_with(
measurement
)
view_instrument_match3.consume_measurement.assert_not_called()
measurement = Measurement(1, instrument2)
with self.assertLogs(level=WARNING):
storage.consume_measurement(measurement)
view_instrument_match3.consume_measurement.assert_called_once_with(
measurement
)
# collect() should call collect on all of its _ViewInstrumentMatch
# objects and combine them together
all_metrics = [Mock() for _ in range(6)]
view_instrument_match1.collect.return_value = all_metrics[:2]
view_instrument_match2.collect.return_value = all_metrics[2:4]
view_instrument_match3.collect.return_value = all_metrics[4:]
result = storage.collect()
view_instrument_match1.collect.assert_called_once()
view_instrument_match2.collect.assert_called_once()
view_instrument_match3.collect.assert_called_once()
self.assertEqual(
(
result.resource_metrics[0]
.scope_metrics[0]
.metrics[0]
.data.data_points[0]
),
all_metrics[0],
)
self.assertEqual(
(
result.resource_metrics[0]
.scope_metrics[0]
.metrics[0]
.data.data_points[1]
),
all_metrics[1],
)
self.assertEqual(
(
result.resource_metrics[0]
.scope_metrics[0]
.metrics[1]
.data.data_points[0]
),
all_metrics[2],
)
self.assertEqual(
(
result.resource_metrics[0]
.scope_metrics[0]
.metrics[1]
.data.data_points[1]
),
all_metrics[3],
)
self.assertEqual(
(
result.resource_metrics[0]
.scope_metrics[1]
.metrics[0]
.data.data_points[0]
),
all_metrics[4],
)
self.assertEqual(
(
result.resource_metrics[0]
.scope_metrics[1]
.metrics[0]
.data.data_points[1]
),
all_metrics[5],
)
@patch(
"opentelemetry.sdk.metrics._internal."
"metric_reader_storage._ViewInstrumentMatch"
)
def test_race_concurrent_measurements(self, MockViewInstrumentMatch: Mock):
mock_view_instrument_match_ctor = MockFunc()
MockViewInstrumentMatch.side_effect = mock_view_instrument_match_ctor
instrument1 = Mock(name="instrument1")
view1 = mock_view_matching(instrument1)
storage = MetricReaderStorage(
SdkConfiguration(
resource=Mock(),
metric_readers=(),
views=(view1,),
),
MagicMock(
**{
"__getitem__.return_value": AggregationTemporality.CUMULATIVE
}
),
MagicMock(**{"__getitem__.return_value": DefaultAggregation()}),
)
def send_measurement():
storage.consume_measurement(Measurement(1, instrument1))
# race sending many measurements concurrently
self.run_with_many_threads(send_measurement)
# _ViewInstrumentMatch constructor should have only been called once
self.assertEqual(mock_view_instrument_match_ctor.call_count, 1)
@patch(
"opentelemetry.sdk.metrics._internal."
"metric_reader_storage._ViewInstrumentMatch"
)
def test_default_view_enabled(self, MockViewInstrumentMatch: Mock):
"""Instruments should be matched with default views when enabled"""
instrument1 = Mock(name="instrument1")
instrument2 = Mock(name="instrument2")
storage = MetricReaderStorage(
SdkConfiguration(
resource=Mock(),
metric_readers=(),
views=(),
),
MagicMock(
**{
"__getitem__.return_value": AggregationTemporality.CUMULATIVE
}
),
MagicMock(**{"__getitem__.return_value": DefaultAggregation()}),
)
storage.consume_measurement(Measurement(1, instrument1))
self.assertEqual(
len(MockViewInstrumentMatch.call_args_list),
1,
MockViewInstrumentMatch.mock_calls,
)
storage.consume_measurement(Measurement(1, instrument1))
self.assertEqual(len(MockViewInstrumentMatch.call_args_list), 1)
MockViewInstrumentMatch.call_args_list.clear()
storage.consume_measurement(Measurement(1, instrument2))
self.assertEqual(len(MockViewInstrumentMatch.call_args_list), 1)
def test_drop_aggregation(self):
counter = _Counter("name", Mock(), Mock())
metric_reader_storage = MetricReaderStorage(
SdkConfiguration(
resource=Mock(),
metric_readers=(),
views=(
View(
instrument_name="name", aggregation=DropAggregation()
),
),
),
MagicMock(
**{
"__getitem__.return_value": AggregationTemporality.CUMULATIVE
}
),
MagicMock(**{"__getitem__.return_value": DefaultAggregation()}),
)
metric_reader_storage.consume_measurement(Measurement(1, counter))
self.assertEqual(
[],
(
metric_reader_storage.collect()
.resource_metrics[0]
.scope_metrics[0]
.metrics
),
)
def test_same_collection_start(self):
counter = _Counter("name", Mock(), Mock())
up_down_counter = _UpDownCounter("name", Mock(), Mock())
metric_reader_storage = MetricReaderStorage(
SdkConfiguration(
resource=Mock(),
metric_readers=(),
views=(View(instrument_name="name"),),
),
MagicMock(
**{
"__getitem__.return_value": AggregationTemporality.CUMULATIVE
}
),
MagicMock(**{"__getitem__.return_value": DefaultAggregation()}),
)
metric_reader_storage.consume_measurement(Measurement(1, counter))
metric_reader_storage.consume_measurement(
Measurement(1, up_down_counter)
)
actual = metric_reader_storage.collect()
self.assertEqual(
list(
actual.resource_metrics[0]
.scope_metrics[0]
.metrics[0]
.data.data_points
)[0].time_unix_nano,
list(
actual.resource_metrics[0]
.scope_metrics[1]
.metrics[0]
.data.data_points
)[0].time_unix_nano,
)
def test_conflicting_view_configuration(self):
observable_counter = _ObservableCounter(
"observable_counter",
Mock(),
[Mock()],
unit="unit",
description="description",
)
metric_reader_storage = MetricReaderStorage(
SdkConfiguration(
resource=Mock(),
metric_readers=(),
views=(
View(
instrument_name="observable_counter",
aggregation=ExplicitBucketHistogramAggregation(),
),
),
),
MagicMock(
**{
"__getitem__.return_value": AggregationTemporality.CUMULATIVE
}
),
MagicMock(**{"__getitem__.return_value": DefaultAggregation()}),
)
with self.assertLogs(level=WARNING):
metric_reader_storage.consume_measurement(
Measurement(1, observable_counter)
)
self.assertIs(
metric_reader_storage._instrument_view_instrument_matches[
observable_counter
][0]._view,
_DEFAULT_VIEW,
)
def test_view_instrument_match_conflict_0(self):
# There is a conflict between views and instruments.
observable_counter_0 = _ObservableCounter(
"observable_counter_0",
Mock(),
[Mock()],
unit="unit",
description="description",
)
observable_counter_1 = _ObservableCounter(
"observable_counter_1",
Mock(),
[Mock()],
unit="unit",
description="description",
)
metric_reader_storage = MetricReaderStorage(
SdkConfiguration(
resource=Mock(),
metric_readers=(),
views=(
View(instrument_name="observable_counter_0", name="foo"),
View(instrument_name="observable_counter_1", name="foo"),
),
),
MagicMock(
**{
"__getitem__.return_value": AggregationTemporality.CUMULATIVE
}
),
MagicMock(**{"__getitem__.return_value": DefaultAggregation()}),
)
with self.assertRaises(AssertionError):
with self.assertLogs(level=WARNING):
metric_reader_storage.consume_measurement(
Measurement(1, observable_counter_0)
)
with self.assertLogs(level=WARNING) as log:
metric_reader_storage.consume_measurement(
Measurement(1, observable_counter_1)
)
self.assertIn(
"will cause conflicting metrics",
log.records[0].message,
)
def test_view_instrument_match_conflict_1(self):
# There is a conflict between views and instruments.
observable_counter_foo = _ObservableCounter(
"foo",
Mock(),
[Mock()],
unit="unit",
description="description",
)
observable_counter_bar = _ObservableCounter(
"bar",
Mock(),
[Mock()],
unit="unit",
description="description",
)
observable_counter_baz = _ObservableCounter(
"baz",
Mock(),
[Mock()],
unit="unit",
description="description",
)
metric_reader_storage = MetricReaderStorage(
SdkConfiguration(
resource=Mock(),
metric_readers=(),
views=(
View(instrument_name="bar", name="foo"),
View(instrument_name="baz", name="foo"),
),
),
MagicMock(
**{
"__getitem__.return_value": AggregationTemporality.CUMULATIVE
}
),
MagicMock(**{"__getitem__.return_value": DefaultAggregation()}),
)
with self.assertRaises(AssertionError):
with self.assertLogs(level=WARNING):
metric_reader_storage.consume_measurement(
Measurement(1, observable_counter_foo)
)
with self.assertLogs(level=WARNING) as log:
metric_reader_storage.consume_measurement(
Measurement(1, observable_counter_bar)
)
self.assertIn(
"will cause conflicting metrics",
log.records[0].message,
)
with self.assertLogs(level=WARNING) as log:
metric_reader_storage.consume_measurement(
Measurement(1, observable_counter_baz)
)
self.assertIn(
"will cause conflicting metrics",
log.records[0].message,
)
for (
view_instrument_matches
) in (
metric_reader_storage._instrument_view_instrument_matches.values()
):
for view_instrument_match in view_instrument_matches:
self.assertEqual(view_instrument_match._name, "foo")
def test_view_instrument_match_conflict_2(self):
# There is no conflict because the metric streams names are different.
observable_counter_foo = _ObservableCounter(
"foo",
Mock(),
[Mock()],
unit="unit",
description="description",
)
observable_counter_bar = _ObservableCounter(
"bar",
Mock(),
[Mock()],
unit="unit",
description="description",
)
metric_reader_storage = MetricReaderStorage(
SdkConfiguration(
resource=Mock(),
metric_readers=(),
views=(
View(instrument_name="foo"),
View(instrument_name="bar"),
),
),
MagicMock(
**{
"__getitem__.return_value": AggregationTemporality.CUMULATIVE
}
),
MagicMock(**{"__getitem__.return_value": DefaultAggregation()}),
)
with self.assertRaises(AssertionError):
with self.assertLogs(level=WARNING):
metric_reader_storage.consume_measurement(
Measurement(1, observable_counter_foo)
)
with self.assertRaises(AssertionError):
with self.assertLogs(level=WARNING):
metric_reader_storage.consume_measurement(
Measurement(1, observable_counter_bar)
)
def test_view_instrument_match_conflict_3(self):
# There is no conflict because the aggregation temporality of the
# instruments is different.
counter_bar = _Counter(
"bar",
Mock(),
[Mock()],
unit="unit",
description="description",
)
observable_counter_baz = _ObservableCounter(
"baz",
Mock(),
[Mock()],
unit="unit",
description="description",
)
metric_reader_storage = MetricReaderStorage(
SdkConfiguration(
resource=Mock(),
metric_readers=(),
views=(
View(instrument_name="bar", name="foo"),
View(instrument_name="baz", name="foo"),
),
),
MagicMock(
**{
"__getitem__.return_value": AggregationTemporality.CUMULATIVE
}
),
MagicMock(**{"__getitem__.return_value": DefaultAggregation()}),
)
with self.assertRaises(AssertionError):
with self.assertLogs(level=WARNING):
metric_reader_storage.consume_measurement(
Measurement(1, counter_bar)
)
with self.assertRaises(AssertionError):
with self.assertLogs(level=WARNING):
metric_reader_storage.consume_measurement(
Measurement(1, observable_counter_baz)
)
def test_view_instrument_match_conflict_4(self):
# There is no conflict because the monotonicity of the instruments is
# different.
counter_bar = _Counter(
"bar",
Mock(),
[Mock()],
unit="unit",
description="description",
)
up_down_counter_baz = _UpDownCounter(
"baz",
Mock(),
[Mock()],
unit="unit",
description="description",
)
metric_reader_storage = MetricReaderStorage(
SdkConfiguration(
resource=Mock(),
metric_readers=(),
views=(
View(instrument_name="bar", name="foo"),
View(instrument_name="baz", name="foo"),
),
),
MagicMock(
**{
"__getitem__.return_value": AggregationTemporality.CUMULATIVE
}
),
MagicMock(**{"__getitem__.return_value": DefaultAggregation()}),
)
with self.assertRaises(AssertionError):
with self.assertLogs(level=WARNING):
metric_reader_storage.consume_measurement(
Measurement(1, counter_bar)
)
with self.assertRaises(AssertionError):
with self.assertLogs(level=WARNING):
metric_reader_storage.consume_measurement(
Measurement(1, up_down_counter_baz)
)
def test_view_instrument_match_conflict_5(self):
# There is no conflict because the instrument units are different.
observable_counter_0 = _ObservableCounter(
"observable_counter_0",
Mock(),
[Mock()],
unit="unit_0",
description="description",
)
observable_counter_1 = _ObservableCounter(
"observable_counter_1",
Mock(),
[Mock()],
unit="unit_1",
description="description",
)
metric_reader_storage = MetricReaderStorage(
SdkConfiguration(
resource=Mock(),
metric_readers=(),
views=(
View(instrument_name="observable_counter_0", name="foo"),
View(instrument_name="observable_counter_1", name="foo"),
),
),
MagicMock(
**{
"__getitem__.return_value": AggregationTemporality.CUMULATIVE
}
),
MagicMock(**{"__getitem__.return_value": DefaultAggregation()}),
)
with self.assertRaises(AssertionError):
with self.assertLogs(level=WARNING):
metric_reader_storage.consume_measurement(
Measurement(1, observable_counter_0)
)
with self.assertRaises(AssertionError):
with self.assertLogs(level=WARNING):
metric_reader_storage.consume_measurement(
Measurement(1, observable_counter_1)
)
def test_view_instrument_match_conflict_6(self):
# There is no conflict because the instrument data points are
# different.
observable_counter = _ObservableCounter(
"observable_counter",
Mock(),
[Mock()],
unit="unit",
description="description",
)
histogram = _Histogram(
"histogram",
Mock(),
[Mock()],
unit="unit",
description="description",
)
metric_reader_storage = MetricReaderStorage(
SdkConfiguration(
resource=Mock(),
metric_readers=(),
views=(
View(instrument_name="observable_counter", name="foo"),
View(instrument_name="histogram", name="foo"),
),
),
MagicMock(
**{
"__getitem__.return_value": AggregationTemporality.CUMULATIVE
}
),
MagicMock(**{"__getitem__.return_value": DefaultAggregation()}),
)
with self.assertRaises(AssertionError):
with self.assertLogs(level=WARNING):
metric_reader_storage.consume_measurement(
Measurement(1, observable_counter)
)
with self.assertRaises(AssertionError):
with self.assertLogs(level=WARNING):
metric_reader_storage.consume_measurement(
Measurement(1, histogram)
)
def test_view_instrument_match_conflict_7(self):
# There is a conflict between views and instruments because the
# description being different does not avoid a conflict.
observable_counter_0 = _ObservableCounter(
"observable_counter_0",
Mock(),
[Mock()],
unit="unit",
description="description_0",
)
observable_counter_1 = _ObservableCounter(
"observable_counter_1",
Mock(),
[Mock()],
unit="unit",
description="description_1",
)
metric_reader_storage = MetricReaderStorage(
SdkConfiguration(
resource=Mock(),
metric_readers=(),
views=(
View(instrument_name="observable_counter_0", name="foo"),
View(instrument_name="observable_counter_1", name="foo"),
),
),
MagicMock(
**{
"__getitem__.return_value": AggregationTemporality.CUMULATIVE
}
),
MagicMock(**{"__getitem__.return_value": DefaultAggregation()}),
)
with self.assertRaises(AssertionError):
with self.assertLogs(level=WARNING):
metric_reader_storage.consume_measurement(
Measurement(1, observable_counter_0)
)
with self.assertLogs(level=WARNING) as log:
metric_reader_storage.consume_measurement(
Measurement(1, observable_counter_1)
)
self.assertIn(
"will cause conflicting metrics",
log.records[0].message,
)
def test_view_instrument_match_conflict_8(self):
# There is a conflict because the histogram-matching view changes the
# default aggregation of the histogram to Sum aggregation which is the
# same aggregation as the default aggregation of the up down counter
# and also the temporality and monotonicity of the up down counter and
# the histogram are the same.
up_down_counter = _UpDownCounter(
"up_down_counter",
Mock(),
[Mock()],
unit="unit",
description="description",
)
histogram = _Histogram(
"histogram",
Mock(),
[Mock()],
unit="unit",
description="description",
)
metric_reader_storage = MetricReaderStorage(
SdkConfiguration(
resource=Mock(),
metric_readers=(),
views=(
View(instrument_name="up_down_counter", name="foo"),
View(
instrument_name="histogram",
name="foo",
aggregation=SumAggregation(),
),
),
),
MagicMock(
**{
"__getitem__.return_value": AggregationTemporality.CUMULATIVE
}
),
MagicMock(**{"__getitem__.return_value": DefaultAggregation()}),
)
with self.assertRaises(AssertionError):
with self.assertLogs(level=WARNING):
metric_reader_storage.consume_measurement(
Measurement(1, up_down_counter)
)
with self.assertLogs(level=WARNING) as log:
metric_reader_storage.consume_measurement(
Measurement(1, histogram)
)
self.assertIn(
"will cause conflicting metrics",
log.records[0].message,
)
|
[
"noreply@github.com"
] |
open-telemetry.noreply@github.com
|
7af313cb532b28b86bc8852a60562c3ee48988bc
|
3c72c3a75736278486a8dfd6bde16f461da165d5
|
/rest_framework_jwt/__init__.py
|
5e9e676c53af6481d16782f2d074bffd2ead4d69
|
[
"MIT"
] |
permissive
|
alikhan126/django-rest-framework-jwt
|
279db11dd4692d8237a2c8a882e2003a201a2ba4
|
69f363d54444d68b3567d2cc18034ad8020d2b68
|
refs/heads/master
| 2020-06-04T23:51:33.767947
| 2014-06-06T12:00:18
| 2014-06-06T12:00:18
| 192,240,088
| 1
| 0
|
MIT
| 2019-06-16T21:51:31
| 2019-06-16T21:51:31
| null |
UTF-8
|
Python
| false
| false
| 63
|
py
|
__version__ = '0.1.5'
# Version synonym
VERSION = __version__
|
[
"jpadilla@webapplicate.com"
] |
jpadilla@webapplicate.com
|
63f67629a5a7b16ce7fd1a19104293260e41bb86
|
1b81f2ac5e48b7d91949a6b71c4cc9f9b9f3f19c
|
/vera/params/models.py
|
83f99aecd67832508b05874797e90e7e02e8e836
|
[
"MIT"
] |
permissive
|
erick-otenyo/vera
|
b794d8caf9cb4e183ffbb5ac075122a1475d9cb1
|
bd6a7aed8bdafc8a3025aefa5d54616473f203a6
|
refs/heads/master
| 2020-08-30T07:13:18.258335
| 2017-09-14T15:44:18
| 2017-09-14T15:44:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 1,778
|
py
|
from django.db import models
from wq.db.patterns import models as patterns
import swapper
swapper.set_app_prefix('params', 'WQ')
# Base metadata classes (Site, ReportStatus, Parameter)
class BaseSite(patterns.IdentifiedModel):
@property
def valid_events(self):
events = self.event_set.filter(
report_set__status__is_valid=True
).values_list('pk', flat=True)
# FIXME: events may be duplicated
return self.event_set.filter(pk__in=events)
class Meta(patterns.IdentifiedModel.Meta):
abstract = True
class BaseReportStatus(patterns.IdentifiedModel):
is_valid = models.BooleanField(default=False)
class Meta(patterns.IdentifiedModel.Meta):
abstract = True
class BaseParameter(patterns.IdentifiedModel):
is_numeric = models.BooleanField(default=False)
units = models.CharField(max_length=50, null=True, blank=True)
wq_label_template = "{{name}}{{#units}} ({{units}}){{/units}}"
class Meta(patterns.IdentifiedModel.Meta):
abstract = True
# Default implementation of the above classes, can be swapped
class Site(BaseSite):
latitude = models.FloatField(null=True, blank=True)
longitude = models.FloatField(null=True, blank=True)
class Meta(BaseSite.Meta):
db_table = 'wq_site'
swappable = swapper.swappable_setting('params', 'Site')
class ReportStatus(BaseReportStatus):
class Meta(BaseReportStatus.Meta):
verbose_name_plural = 'report statuses'
db_table = 'wq_reportstatus'
swappable = swapper.swappable_setting('params', 'ReportStatus')
class Parameter(BaseParameter):
class Meta(BaseParameter.Meta):
db_table = 'wq_parameter'
swappable = swapper.swappable_setting('params', 'Parameter')
|
[
"andrew@wq.io"
] |
andrew@wq.io
|
d466f5bbc2de930da13d832fc7fac286b4311dea
|
d8fe3b5243bec2b61fd7907c4ff799b24bb617e5
|
/LeetCode/MajorityElement.py
|
f1235e14e87b3df2f12c928bee4c7e9c41e4d3f2
|
[
"Unlicense"
] |
permissive
|
SelvorWhim/competitive
|
b89ed252512d88d9346d168dc6b48e0a42a6142d
|
1c73a5c7b2d0dc1b6c4f3f06ace69cdf5c6a34c0
|
refs/heads/master
| 2023-04-13T01:02:52.083519
| 2023-04-11T10:14:38
| 2023-04-11T10:14:38
| 96,573,533
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 440
|
py
|
from collections import Counter
class Solution:
# lazy solution that works if majority element exists (not hard to check for one if necessary). Should be O(n) time, and anywhere from O(1) to O(k) space depending on most_common implementation, for k number of unique elements
def majorityElement(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
return Counter(nums).most_common(1)[0][0]
|
[
"Carmeverre@gmail.com"
] |
Carmeverre@gmail.com
|
6c5868e7dbe4f882d68893fb9771b13e4d45611d
|
c91f2ebbc7d808fea953249cb8baec35addb0c63
|
/AlgoTrading/examples/WindBasedStrategy.py
|
26e98b38c0ac13455fee9a1e8cd49ee9121c264f
|
[] |
no_license
|
wellengo/AlgoTrading
|
8644dc687ae1524f3b9778624b6fab6299d6336f
|
1d5925580f9fc4b9065df275f79873071742c61a
|
refs/heads/master
| 2021-12-13T22:18:07.413556
| 2017-04-13T04:33:12
| 2017-04-13T04:33:12
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 1,757
|
py
|
# -*- coding: utf-8 -*-
u"""
Created on 2015-9-23
@author: cheng.li
"""
import datetime as dt
from AlgoTrading.api import Strategy
from AlgoTrading.api import strategyRunner
from AlgoTrading.api import DataSource
from AlgoTrading.api import set_universe
from PyFin.api import MA
from PyFin.api import MAX
from PyFin.api import MIN
class MovingAverageCrossStrategy(Strategy):
def __init__(self):
filtering = (MAX(10, 'close') / MIN(10, 'close')) >= 1.00
indicator = MA(10, 'close') - MA(120, 'close')
self.signal = indicator[filtering]
def handle_data(self):
for s in self.universe:
amount = self.avaliableForSale(s)
if self.signal[s] > 0. and self.secPos[s] == 0:
self.order(s, 1, quantity=200)
if self.signal[s] < 0. and amount != 0:
self.order(s, -1, quantity=200)
def run_example():
universe = set_universe('000300.zicn', refDate='2015-01-01')[:200]
startDate = dt.datetime(2015, 1, 1)
endDate = dt.datetime(2017, 1, 1)
strategyRunner(userStrategy=MovingAverageCrossStrategy,
symbolList=universe,
startDate=startDate,
endDate=endDate,
benchmark='000300.zicn',
logLevel='info',
saveFile=True,
plot=True,
freq='D')
if __name__ == "__main__":
from VisualPortfolio.Env import Settings
from AlgoTrading.Env import Settings
Settings.set_source(DataSource.WIND)
startTime = dt.datetime.now()
print("Start: %s" % startTime)
run_example()
endTime = dt.datetime.now()
print("End : %s" % endTime)
print("Elapsed: %s" % (endTime - startTime))
|
[
"siqiao_xue@163.com"
] |
siqiao_xue@163.com
|
69b3a8a5656a6229d00db9a433b364d43faecb76
|
266947fd84eed629ed0c21f6d91134239512afd9
|
/BeginnerContest_B/070.py
|
44ab7e3e3b48dab05d40236c4d90574db6a44ef3
|
[] |
no_license
|
SkiMsyk/AtCoder
|
c86adeec4fa470ec14c1be7400c9fc8b3fb301cd
|
8102b99cf0fb6d7fa304edb942d21cf7016cba7d
|
refs/heads/master
| 2022-09-03T01:23:10.748038
| 2022-08-15T01:19:55
| 2022-08-15T01:19:55
| 239,656,752
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 163
|
py
|
# input
A, B, C, D = map(int, input().split())
# processing
# 0 -- A -- B ---...
# 0 ---- C ---- D ---...
res = max(min(B, D) - max(A, C), 0)
# output
print(res)
|
[
"sakaimasayuki@sakaimasayukinoMacBook-puro.local"
] |
sakaimasayuki@sakaimasayukinoMacBook-puro.local
|
f06cc6f2c9d30f0a1597c6703f19934298fd36c3
|
9e31cabea36b122be02fa778264a5c9a313a7a3c
|
/chapter_17/p17_4.py
|
01f1d2cde0b036ebaedf4b1335f016b631309473
|
[] |
no_license
|
anywhere1234/CTCI_python
|
b1c27997fe20d17f48b423e647fed600811ab015
|
6c7e71f4829708da397867dd9b2cec61a654d3f9
|
refs/heads/master
| 2023-02-09T14:02:29.710006
| 2021-01-06T00:04:58
| 2021-01-06T00:04:58
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 1,564
|
py
|
from typing import List
def get_bit(a: int, bit_nr: int) -> int:
shifted_a = a >> (bit_nr)
return shifted_a & 0b1
def find_mssing(arr: List[int], n: int) -> int:
return find_missing_helper(arr, list(range(len(arr))), 0, n)
def find_missing_helper(arr: List[int],
list_indexes: List[int],
bit_offset: int,
n: int) -> int:
if n == 0:
return 0
odds = []
evens = []
for i in list_indexes:
bit_now = get_bit(arr[i], bit_offset)
if bit_now:
odds.append(i)
else:
evens.append(i)
expected_odds = 0
expected_evens = 0
for i in range(n+1):
if i & 0b1:
expected_odds += 1
else:
expected_evens += 1
if len(evens) < expected_evens:
bit_now = 0
rest = find_missing_helper(arr, evens, bit_offset+1, n >> 1)
else:
bit_now = 1
rest = find_missing_helper(arr, odds, bit_offset+1, n >> 1)
# print(f"Bit now is {bit_now}, rest {rest},"
# f" evens: {evens} (expected {expected_evens}),"
# f" odds: {odds} (expected {expected_odds})")
return (rest << 1) | bit_now
# 11 # 1
# --- ->
# 10 # 0
# 01
# 00
if __name__ == "__main__":
exs = [
([0, 1, 2], 3),
([1, 2, 3, 4, 5, 6, 7, 8], 8),
([0, 1, 2, 3, 5], 5),
([1, 2, 3, 4, 5, 6, 7, 8, 0], 9)
]
for arr, n in exs:
print(f"In arr {arr}, with limit {n}, missing is {find_mssing(arr,n)}")
|
[
"bogdan.stoicescu95@gmail.com"
] |
bogdan.stoicescu95@gmail.com
|
db0a75c33b2d39ccd10641bc74430fa734206139
|
d305e9667f18127e4a1d4d65e5370cf60df30102
|
/tests/ut/cpp/python_input/gtest_input/pre_activate/fused_batch_norm_fusion_test.py
|
472e7a5d4be4cf0dc07a5047f721afdf0469bf6f
|
[
"Apache-2.0",
"MIT",
"Libpng",
"LicenseRef-scancode-proprietary-license",
"LGPL-2.1-only",
"AGPL-3.0-only",
"MPL-2.0-no-copyleft-exception",
"IJG",
"Zlib",
"MPL-1.1",
"BSD-3-Clause",
"BSD-3-Clause-Open-MPI",
"MPL-1.0",
"GPL-2.0-only",
"MPL-2.0",
"BSL-1.0",
"LicenseRef-scancode-unknown-license-reference",
"Unlicense",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] |
permissive
|
imyzx2017/mindspore_pcl
|
d8e5bd1f80458538d07ef0a8fc447b552bd87420
|
f548c9dae106879d1a83377dd06b10d96427fd2d
|
refs/heads/master
| 2023-01-13T22:28:42.064535
| 2020-11-18T11:15:41
| 2020-11-18T11:15:41
| 313,906,414
| 6
| 1
|
Apache-2.0
| 2020-11-18T11:25:08
| 2020-11-18T10:57:26
| null |
UTF-8
|
Python
| false
| false
| 4,398
|
py
|
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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 mindspore.common.dtype as mstype
from mindspore.common.tensor import Tensor
from mindspore.ops import Primitive
from mindspore.ops import operations as P
from mindspore.ops import functional as F
AssignSub = P.AssignSub()
Mul = P.Mul()
Sub = P.Sub()
make_tuple = Primitive('make_tuple')
tuple_getitem = Primitive('tuple_getitem')
BatchNorm = P.BatchNorm()
Cast = P.Cast()
BNTrainingReduce = Primitive('BNTrainingReduce')
BNTrainingUpdate = Primitive('BNTrainingUpdate')
constant0 = Tensor(0.1, mstype.float32)
constant1 = Tensor(0.1, mstype.float32)
class FnDict:
def __init__(self):
self.fnDict = {}
def __call__(self, fn):
self.fnDict[fn.__name__] = fn
def __getitem__(self, name):
return self.fnDict[name]
def test_fused_batch_norm_fusion(tag):
fns = FnDict()
@fns
def before(input0, input1, input2, input3, input4, var0, var1):
batch_norm = BatchNorm(input0, input1, input2, input3, input4)
sub0 = Sub(var0, tuple_getitem(batch_norm, 1))
sub1 = Sub(var1, tuple_getitem(batch_norm, 2))
mul0 = Mul(sub0, constant0)
mul1 = Mul(sub1, constant1)
assign_sub0 = AssignSub(var0, mul0)
assign_sub1 = AssignSub(var1, mul1)
depend0 = F.depend(tuple_getitem(batch_norm, 0), assign_sub0)
depend1 = F.depend(depend0, assign_sub1)
outputs = make_tuple(depend1, tuple_getitem(batch_norm, 3), tuple_getitem(batch_norm, 4))
output = tuple_getitem(outputs, 0)
return output
@fns
def before_mix_precision0(input0, input1, input2, input3, input4, var0, var1):
batch_norm = BatchNorm(input0, input1, input2, input3, input4)
sub0 = Sub(Cast(var0, mstype.float32), tuple_getitem(batch_norm, 1))
sub1 = Sub(Cast(var1, mstype.float32), tuple_getitem(batch_norm, 2))
mul0 = Mul(sub0, constant0)
mul1 = Mul(sub1, constant1)
assign_sub0 = AssignSub(var0, Cast(mul0, mstype.float32))
assign_sub1 = AssignSub(var1, Cast(mul1, mstype.float32))
depend0 = F.depend(tuple_getitem(batch_norm, 0), assign_sub0)
depend1 = F.depend(depend0, assign_sub1)
outputs = make_tuple(depend1, tuple_getitem(batch_norm, 3), tuple_getitem(batch_norm, 4))
output = tuple_getitem(outputs, 0)
return output
@fns
def before_mix_precision1(input0, input1, input2, input3, input4, var0, var1):
batch_norm = BatchNorm(input0, input1, input2, input3, input4)
sub0 = Sub(Cast(var0, mstype.float32), tuple_getitem(batch_norm, 1))
sub1 = Sub(Cast(var1, mstype.float32), tuple_getitem(batch_norm, 2))
mul0 = Mul(Cast(sub0, mstype.float32), constant0)
mul1 = Mul(Cast(sub1, mstype.float32), constant1)
assign_sub0 = AssignSub(var0, mul0)
assign_sub1 = AssignSub(var1, mul1)
depend0 = F.depend(tuple_getitem(batch_norm, 0), assign_sub0)
depend1 = F.depend(depend0, assign_sub1)
outputs = make_tuple(depend1, tuple_getitem(batch_norm, 3), tuple_getitem(batch_norm, 4))
output = tuple_getitem(outputs, 0)
return output
@fns
def after(input0, input1, input2, input3, input4, var0, var1):
bn_training_reduce = BNTrainingReduce(input0)
bn_training_update = BNTrainingUpdate(input0, tuple_getitem(bn_training_reduce, 0),
tuple_getitem(bn_training_reduce, 1), input1, input2, var0, var1)
outputs = make_tuple(tuple_getitem(bn_training_update, 0), tuple_getitem(bn_training_update, 3),
tuple_getitem(bn_training_update, 4))
output = tuple_getitem(outputs, 0)
return make_tuple(output)
return fns[tag]
|
[
"513344092@qq.com"
] |
513344092@qq.com
|
156a74067eb5fcfb827403fb746855c07b61a2b1
|
6cd690fb01e100f440289ea8fe7342bb58d37e78
|
/src/elemental/ability/abilities/rampage.py
|
5048dec0f9e2721eec09a8315b46108a732a6b0c
|
[] |
no_license
|
Hammerlord/Monbot
|
6db8308ae492d7cfbb6f1bdff909105129924269
|
fde8177d9170dddd958a89068a560008259d6e24
|
refs/heads/master
| 2020-03-07T16:43:20.019123
| 2019-08-29T03:08:33
| 2019-08-29T03:08:33
| 127,591,188
| 2
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 693
|
py
|
from src.core.elements import Elements, Category
from src.elemental.ability.ability import Ability
class Rampage(Ability):
def __init__(self):
super().__init__()
self.name = 'Rampage'
self._description = ("Strike the opponent in a fury over the next 3 turns. "
"During this time, no other action can be taken.")
self.element = Elements.EARTH
self.mana_cost = 8
self.attack_power = 12
self.category = Category.PHYSICAL
@property
def base_channel_time(self) -> int:
return 3
def get_recap(self, elemental_name: str) -> str:
return f"{elemental_name} has entered a rampage!"
|
[
"nepharus@gmail.com"
] |
nepharus@gmail.com
|
08044a78a4728393854b3cd465c9f38423aaa297
|
e10a6d844a286db26ef56469e31dc8488a8c6f0e
|
/milking_cowmask/main_semisup.py
|
953ccba0c869ab31d504fafe1c132d105c3682ee
|
[
"Apache-2.0",
"CC-BY-4.0"
] |
permissive
|
Jimmy-INL/google-research
|
54ad5551f97977f01297abddbfc8a99a7900b791
|
5573d9c5822f4e866b6692769963ae819cb3f10d
|
refs/heads/master
| 2023-04-07T19:43:54.483068
| 2023-03-24T16:27:28
| 2023-03-24T16:32:17
| 282,682,170
| 1
| 0
|
Apache-2.0
| 2020-07-26T15:50:32
| 2020-07-26T15:50:31
| null |
UTF-8
|
Python
| false
| false
| 10,838
|
py
|
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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.
"""Launch 'Milking CowMask for semi-supervised image classification'."""
import ast
from absl import app
from absl import flags
from absl import logging
import train_semisup
FLAGS = flags.FLAGS
flags.DEFINE_string(
'model_dir', default='checkpoint',
help=('Directory to store model data'))
flags.DEFINE_string(
'imagenet_subset_dir', default=None,
help=('Directory to store model data'))
flags.DEFINE_string(
'dataset', default='cifar10',
help=('Dataset to use (cifar10|cifar100|svhn|imagenet)'))
flags.DEFINE_integer(
'batch_size', default=256,
help=('Batch size for training.'))
flags.DEFINE_integer(
'eval_batch_size', default=1000,
help=('Batch size for evaluation.'))
flags.DEFINE_integer(
'num_epochs', default=300,
help=('Number of training epochs.'))
flags.DEFINE_float(
'learning_rate', default=0.05,
help=('The learning rate for the momentum optimizer.'))
flags.DEFINE_bool(
'aug_imagenet_apply_colour_jitter', default=False,
help=('ImageNet augmentation: apply colour jitter.'))
flags.DEFINE_float(
'aug_imagenet_greyscale_prob', default=0.0,
help=('ImageNet augmentation: probability to convert image to greyscale.'))
flags.DEFINE_float(
'sgd_momentum', default=0.9,
help=('The decay rate used for the momentum optimizer.'))
flags.DEFINE_bool(
'sgd_nesterov', default=True,
help=('Use Nesterov momentum.'))
flags.DEFINE_string(
'lr_schedule', default='stepped',
help=('Learning rate schedule type; (constant|stepped|cosine)'))
flags.DEFINE_string(
'lr_sched_steps', default='[[120, 0.2], [240, 0.04]]',
help=('Learning rate schedule steps as a Python list; '
'[[step1_epoch, step1_lr_scale], '
'[step2_epoch, step2_lr_scale], ...]'))
flags.DEFINE_integer(
'lr_sched_halfcoslength', default=300,
help=('Length of cosine learning rate annealing half-cycle'))
flags.DEFINE_float(
'lr_sched_warmup', default=0.0,
help=('Learning rate schedule warmup length in epochs.'))
flags.DEFINE_float(
'l2_reg', default=0.0005,
help=('The amount of L2-regularization to apply.'))
flags.DEFINE_float(
'weight_decay', default=0.0,
help=('The amount of weight decay to apply.'))
flags.DEFINE_string(
'architecture', default='wrn26_6_shakeshake',
help=('Network architecture (wrn20_10|wrn26_10|wrn26_2|wrn20_6_shakeshake'
'|wrn26_6_shakeshake|wrn26_2_shakeshake|pyramid|resnet50|resnet101'
'|resnet152|resnet50x2|resnet101x2|resnet152x2|resnet50x4'
'|resnet101x4|resnet152x4|resnext50_32x4d|resnext101_32x8d'
'|resnext152_32x4d).'))
flags.DEFINE_integer(
'n_val', default=0,
help=('Number of samples to split off the training set for validation.'))
flags.DEFINE_integer(
'n_sup', default=1000,
help=('Number of samples to be used for supervised loss (-1 for all).'))
flags.DEFINE_float(
'teacher_alpha', default=0.97,
help=('Teacher EMA alpha.'))
flags.DEFINE_bool(
'anneal_teacher_alpha', default=False,
help=('Anneal 1-teacher_alpha using the learning rate schedule '
'(no warmup).'))
flags.DEFINE_string(
'unsup_reg', default='none',
help=('Unsupervised/perturbation regularizer '
'(none|mt|aug|cutout|aug_cutout|cowout|aug_cowout).'))
flags.DEFINE_float(
'cons_weight', default=1.0,
help=('Consistency (perturbation) loss weight.'))
flags.DEFINE_float(
'conf_thresh', default=0.97,
help=('Consistency (perturbation) confidence threshold.'))
flags.DEFINE_bool(
'conf_avg', default=False,
help=('Consistency (perturbation) confidence mask averaging.'))
flags.DEFINE_float(
'cut_backg_noise', default=1.0,
help=('Consistency (perturbation) cut background noise (e.g. 1.0 for '
'RandErase).'))
flags.DEFINE_float(
'cut_prob', default=1.0,
help=('Consistency (perturbation) cut probability.'))
flags.DEFINE_string(
'box_reg_scale_mode', default='random_size',
help=('Consistency (perturbation), unsup_reg is cutout/aug_cutout: box '
'mask scaling (fixed|random_area|random_size).'))
flags.DEFINE_float(
'box_reg_scale', default=0.25,
help=('Consistency (perturbation), unsup_reg is cutout/aug_cutout: '
'fraction of the image to mask out when box scale mode is fixed.'))
flags.DEFINE_bool(
'box_reg_random_aspect_ratio', default=True,
help=('Consistency (perturbation), unsup_reg is cutout/aug_cutout: vary '
'the aspect ratio of the box'))
flags.DEFINE_string(
'cow_sigma_range', default='4.0:16.0',
help=('Consistency (perturbation), unsup_reg is cowout/aug_coowout: the '
'range of the Gaussian smoothing sigma that controls the scale of '
'CowMask'))
flags.DEFINE_string(
'cow_prop_range', default='0.25:1.0',
help=('Consistency (perturbation), unsup_reg is cowout/aug_coowout: the '
'range of proportion of the image to be masked out by CowMask'))
flags.DEFINE_string(
'mix_reg', default='cowmix',
help=('Mix regularizer '
'(none|ict|cutmix|cowmix).'))
flags.DEFINE_bool(
'mix_aug_separately', default=False,
help=('Mix regularization, use different augmentations for teacher '
'(unmixed) and student (mixed) paths'))
flags.DEFINE_bool(
'mix_logits', default=False,
help=('Mix regularization, mix pre-softmax logits rather than '
'post-softmax probabilities'))
flags.DEFINE_float(
'mix_weight', default=30.0,
help=('Mix regularization, mix consistency loss weight.'))
flags.DEFINE_float(
'mix_conf_thresh', default=0.6,
help=('Mix regularization, confidence threshold.'))
flags.DEFINE_bool(
'mix_conf_avg', default=True,
help=('Mix regularization, average confidence threshold masks'))
flags.DEFINE_string(
'mix_conf_mode', default='mix_conf',
help=('Mix either confidence or probabilities for confidence '
'thresholding (prob|conf).'))
flags.DEFINE_float(
'ict_alpha', default=0.1,
help=('Mix regularization, mix_reg=ict: ICT Beta distribution alpha '
'parameter.'))
flags.DEFINE_string(
'mix_box_reg_scale_mode', default='random_area',
help=('Mix regularization, mix_reg=cutmix: box '
'mask scaling (fixed|random_area|random_size).'))
flags.DEFINE_float(
'mix_box_reg_scale', default=0.25,
help=('Mix regularization, mix_reg=cutmixt: '
'fraction of the image to mask out when box scale mode is fixed.'))
flags.DEFINE_bool(
'mix_box_reg_random_aspect_ratio', default=True,
help=('Mix regularization, mix_reg=cutmix: vary '
'the aspect ratio of the box'))
flags.DEFINE_string(
'mix_cow_sigma_range', default='4.0:16.0',
help=('Mix regularization, mix_reg=cowmix: the '
'range of the Gaussian smoothing sigma that controls the scale of '
'CowMask'))
flags.DEFINE_string(
'mix_cow_prop_range', default='0.2:0.8',
help=('Mix regularization, mix_reg=cowmix: the '
'range of proportion of the image to be masked out by CowMask'))
flags.DEFINE_integer(
'subset_seed', default=12345,
help=('Random seed used to choose supervised samples (n_sup != -1).'))
flags.DEFINE_integer(
'val_seed', default=131,
help=('Random seed used to choose validation samples (when n_val > 0).'))
flags.DEFINE_integer(
'run_seed', default=None,
help=('Random seed used for network initialisation and training. If '
'run_seed = None then one will be generated using n_val '
'and subset_seed.'))
flags.DEFINE_string(
'checkpoints', default='on',
help=('Checkpointing after each epoch (none|on|retain); '
'disabled/enabled/retain'))
def _range_str_to_tuple(s):
xs = [x.strip() for x in s.split(':')]
return tuple([float(x) for x in xs])
def main(argv):
if len(argv) > 1:
raise app.UsageError('Too many command-line arguments.')
train_semisup.experiment(
model_dir=FLAGS.model_dir, imagenet_subset_dir=FLAGS.imagenet_subset_dir,
dataset=FLAGS.dataset, batch_size=FLAGS.batch_size,
eval_batch_size=FLAGS.eval_batch_size, num_epochs=FLAGS.num_epochs,
learning_rate=FLAGS.learning_rate,
aug_imagenet_apply_colour_jitter=FLAGS.aug_imagenet_apply_colour_jitter,
aug_imagenet_greyscale_prob=FLAGS.aug_imagenet_greyscale_prob,
sgd_momentum=FLAGS.sgd_momentum, sgd_nesterov=FLAGS.sgd_nesterov,
lr_schedule=FLAGS.lr_schedule,
lr_sched_steps=ast.literal_eval(FLAGS.lr_sched_steps),
lr_sched_halfcoslength=FLAGS.lr_sched_halfcoslength,
lr_sched_warmup=FLAGS.lr_sched_warmup, l2_reg=FLAGS.l2_reg,
weight_decay=FLAGS.weight_decay,
architecture=FLAGS.architecture, n_val=FLAGS.n_val, n_sup=FLAGS.n_sup,
teacher_alpha=FLAGS.teacher_alpha,
anneal_teacher_alpha=FLAGS.anneal_teacher_alpha,
unsupervised_regularizer=FLAGS.unsup_reg,
cons_weight=FLAGS.cons_weight, conf_thresh=FLAGS.conf_thresh,
conf_avg=FLAGS.conf_avg,
cut_backg_noise=FLAGS.cut_backg_noise, cut_prob=FLAGS.cut_prob,
box_reg_scale_mode=FLAGS.box_reg_scale_mode,
box_reg_scale=FLAGS.box_reg_scale,
box_reg_random_aspect_ratio=FLAGS.box_reg_random_aspect_ratio,
cow_sigma_range=_range_str_to_tuple(FLAGS.cow_sigma_range),
cow_prop_range=_range_str_to_tuple(FLAGS.cow_prop_range),
mix_regularizer=FLAGS.mix_reg,
mix_aug_separately=FLAGS.mix_aug_separately, mix_logits=FLAGS.mix_logits,
mix_weight=FLAGS.mix_weight, mix_conf_thresh=FLAGS.mix_conf_thresh,
mix_conf_avg=FLAGS.mix_conf_avg,
mix_conf_mode=FLAGS.mix_conf_mode,
ict_alpha=FLAGS.ict_alpha,
mix_box_reg_scale_mode=FLAGS.mix_box_reg_scale_mode,
mix_box_reg_scale=FLAGS.mix_box_reg_scale,
mix_box_reg_random_aspect_ratio=FLAGS.mix_box_reg_random_aspect_ratio,
mix_cow_sigma_range=_range_str_to_tuple(FLAGS.mix_cow_sigma_range),
mix_cow_prop_range=_range_str_to_tuple(FLAGS.mix_cow_prop_range),
subset_seed=FLAGS.subset_seed, val_seed=FLAGS.val_seed,
run_seed=FLAGS.run_seed,
log_fn=logging.info, checkpoints=FLAGS.checkpoints)
if __name__ == '__main__':
app.run(main)
|
[
"copybara-worker@google.com"
] |
copybara-worker@google.com
|
169a1fd5a957f93eb770569acd3dbba2aa737d62
|
2411e39691f02bec1cd03958a0bd5c2c850db457
|
/py/applets/teapot.py
|
43d30204e469053006ae47273dbd721402594e44
|
[] |
no_license
|
wielandgmeiner/javacard_playground
|
d9c2067901e3005b69cd69b17774f00f19a04c6e
|
758fb14418f6aa0079da794efa67384db512fafd
|
refs/heads/master
| 2022-09-21T15:32:28.194817
| 2020-05-31T19:16:54
| 2020-05-31T19:16:54
| 259,915,974
| 0
| 0
| null | 2020-04-29T12:13:25
| 2020-04-29T12:13:24
| null |
UTF-8
|
Python
| false
| false
| 336
|
py
|
from .core import AppletBase
class Teapot(AppletBase):
def __init__(self, connection=None):
super().__init__("B00B5111CA01", connection)
def get_data(self):
return self.request("B0A10000")
def put_data(self, d):
data = bytes([len(d)])+d.encode()
return self.request("B0A20000"+data.hex())
|
[
"snigirev.stepan@gmail.com"
] |
snigirev.stepan@gmail.com
|
c4eabefbb636b88c245f4eeddf235b3bf569d694
|
e6e57bf7d4eda37f1188ab72ff249675f40029ee
|
/algorithms_and_data_structures/arrays/Valid Sudoku.py
|
cd5a560608706499dcf3eb78cabfb8e53630207a
|
[] |
no_license
|
juanpedrovel/bomboclap
|
4e186331ef1c26c8522e44c21d6a33358471786b
|
99db02266c31dd14357ef6a575d35fcf55718617
|
refs/heads/master
| 2020-04-19T21:16:38.141830
| 2019-01-31T00:31:24
| 2019-01-31T00:31:24
| 168,436,881
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 1,638
|
py
|
class Solution:
def isValidSudoku(self, board):
"""
:type board: List[List[str]]
:rtype: bool
"""
def bx_numb(i, j):
box_number = 0
if j > 5:
box_number += 2
elif j > 2:
box_number += 1
if i > 5:
box_number += 6
elif i > 2:
box_number += 3
return box_number
column = []
row = []
box = []
for i in range(9):
column.append({})
row.append({})
box.append({})
for i in range(9):
for j in range(9):
cell = board[i][j]
if cell == '.':
continue
else:
box_number = bx_numb(i, j)
if cell not in column[i] and cell not in row[j] and cell not in box[box_number]:
column[i][cell] = 1
row[j][cell] = 1
box[box_number][cell] = 1
else:
return False
return True
s = [
["5","3",".",".","7",".",".",".","."],
["6",".",".","1","9","5",".",".","."],
[".","9","8",".",".",".",".","6","."],
["8",".",".",".","6",".",".",".","3"],
["4",".",".","8",".","3",".",".","1"],
["7",".",".",".","2",".",".",".","6"],
[".","6",".",".",".",".","2","8","."],
[".",".",".","4","1","9",".",".","5"],
[".",".",".",".","8",".",".","7","9"]
]
dict = [2,2]
d = Solution()
print(d.isValidSudoku(s))
|
[
"juanpedrovel@gmail.com"
] |
juanpedrovel@gmail.com
|
aa31b8c9159d61b6d1e959155f352b75a9a3f165
|
a7344ed009a8aefc0989a1236e423fd474d251ee
|
/GameManage/views/help/help.py
|
3b85a0183a8e03db17bb69916698bcdbd23799bf
|
[] |
no_license
|
lxngoddess5321/game_manage
|
e8b307fd44cda21ab0fdc4ac69b458f1c81d0a16
|
e6c93bce193abb6b6129a0373902724406deec13
|
refs/heads/master
| 2021-10-07T09:59:02.961797
| 2015-02-05T06:11:54
| 2015-02-05T06:11:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 10,168
|
py
|
#coding=utf-8
# Create your views here.
from django.db.models import Q
import re, os
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import Context, Template
from GameManage.models.help import Help, HelpCategory
from GameManage.views.base import mkdir
from GameManage.settings import TEMPLATE_DIRS, MEDIA_ROOT, STATIC_ROOT
################# 删除 #####################
def help_del(request, model_id=0):
model_id = int(model_id)
p = Help.objects.get(id=model_id)
p.delete()
return HttpResponseRedirect('/help/list/')
################ 修改 ################
def edit(request, model_id=0):
#修改信息
model_id = int(model_id)
if 0 == model_id:
model_id = int(request.GET.get('id', 0))
if model_id > 0:
model = Help.objects.get(id=model_id)
else:
model = Help()
model.id = model_id
model.order = 0
cgname = HelpCategory.objects.all()
return render_to_response('help/edit.html', {'model':model, 'cgname':cgname})
def save(request, model_id=0):
model_id = int(model_id)
if 0 == model_id:
model_id = int(request.GET.get('id', 0))
if model_id > 0:
model = Help.objects.get(id=model_id)
else:
model = Help()
order = request.POST.get('order', 0)
parent_id = request.POST.get('parent_id', 0)
erro_msg = ''
try:
order = int(order)
parent_id = int(parent_id)
except:
erro_msg = u'输入的排序格式错误'
if erro_msg == '':
model.title = request.POST.get('title', '')
model.order = order
model.filename = request.POST.get('filename', '')
model.parent_id = parent_id
model.content = request.POST.get('content', '')
model.save()
cgname = HelpCategory.objects.all()
return render_to_response('feedback.html', {'cgname':cgname, 'err_msg':erro_msg})
################ 修改 ################
def category_save(request, model_id=0):
model_id = int(model_id)
if 0 == model_id:
model_id = int(request.GET.get('id', 0))
if model_id > 0:
model = HelpCategory.objects.get(id=model_id)
else:
model = HelpCategory()
res = HelpCategory.objects.all()
err_msg = ''
try:
order = int(request.POST.get('order', '0'))
except:
err_msg = u'排序输入格式错误'
if '' == err_msg:
model.order = order
model.name = request.POST.get('name', '')
model.save()
return render_to_response('help/category_list.html', {'cg':res, 'err_msg':err_msg})
#
#def help_add(request):
# raise Exception, 123
# if request.method == 'POST':
# title = request.POST.get('title','')
# filename = request.POST.get('filename','')
# parent_id = request.POST.get('parent_id',0)
# content = request.POST.get('content','')
# p = Help(title=title,filename=filename,parent_id=parent_id,content=content)
# p.save()
# return HttpResponseRedirect('/add/')
# else:
# category_list = HelpCategory.objects.all()
# return render_to_response('help/add.html',{'cgname':category_list})
######## 分类 管理列表 ##########
def category_list(request):
# if request.method == 'POST':
# name = request.POST.get('name','')
# content = HelpCategory(name=name)
# content.save()
# return HttpResponseRedirect('/help/category/categorylist/')
# else:
if True:
title = '分类列表'
res = HelpCategory.objects.all()
return render_to_response('help/category_list.html', {'cg':res, 'title':title})
def category_del (request, model_id=0):
model_id = int(model_id)
if 0 == model_id:
model_id = int(request.GET.get('id', 0))
p = HelpCategory.objects.get(id=model_id)
p.delete()
return HttpResponseRedirect('/help/category/list/')
def view(request, file_name=''):
if file_name == '':
file_name = request.GET.get('filename', '')
if file_name=='' or file_name=='index.html':
data_list = []
cg = HelpCategory.objects.all()
for item in cg:
category = {}
helps = Help.objects.filter(parent_id=item.id)
category['name'] = item.name
category['helps'] = helps
data_list.append(category)
return render_to_response('help/index.html', {'data_list':data_list})
else:
file_name = file_name[:-5]
result = Help.objects.get(filename=file_name)
result.content = filter_content(result.content)
return render_to_response('help/content.html', {'title':result.title, 'content':result.content})
def help_list(request):
search_con = request.POST.get('title', '')
parent_id = int(request.POST.get('parent_id', 0))
if search_con == '' and parent_id == 0:
res = Help.objects.all().order_by('parent_id','order')
else:
query = Q()
if search_con != '':
query = query & (Q(title__contains=search_con) | Q(content__contains=search_con))
if 0 != parent_id :
query = query & Q(parent_id=parent_id)
res = Help.objects.filter(query)
cgname = HelpCategory.objects.all()
return render_to_response('help/list.html', {'res':res, 'cgname':cgname, 'search_con':search_con, 'parent_id':parent_id})
############# 生成静态页面 ###############
def file_create(request, help_id=0):
help_id = int(help_id)
if 0 == help_id:
help_id = int(request.GET.get('id', 0))
if help_id > 0:
res = Help.objects.filter(id=help_id)
else:
res = Help.objects.all()
file_tpl = open(r'%s/help/content.html' % TEMPLATE_DIRS[0], 'r')
tpl_content = file_tpl.read()
file_tpl.close()
t = Template(tpl_content)
save_path = r'%s/help' % MEDIA_ROOT
mkdir(save_path)
for item in res:
sign = '%s' % item.filename
title = item.title
content = filter_content(item.content)
static_file_path = r'%s/%s.html' % (save_path, sign)
delete_file(static_file_path)
fileHandle = open (static_file_path, 'w')
c = Context({"title":title, "content": content})
c = t.render(c)
fileHandle.write(c.encode('utf-8'))
fileHandle.close()
cgname = HelpCategory.objects.all()
if help_id == 0:
file_tpl = open(r'%s/help/index.html' % TEMPLATE_DIRS[0], 'r')
tpl_content = file_tpl.read()
file_tpl.close()
t = Template(tpl_content)
data_list = []
cg = HelpCategory.objects.all()
for item in cg:
category = {}
helps = Help.objects.filter(parent_id=item.id)
category['name'] = item.name
category['helps'] = helps
data_list.append(category)
index_html_path = r'%s/index.html' % (MEDIA_ROOT + '/help')
delete_file(index_html_path)
fileHandle = open (index_html_path, 'w')
c = Context({"data_list":data_list})
c = t.render(c)
fileHandle.write((c).encode('utf-8'))
fileHandle.close()
return render_to_response('help/list.html', {'res':res, 'cgname':cgname})
def filter_content(html):
html = re.sub('\s{2,}', '\n', html)
html = '<li>%s</li>' % ('</li><li>'.join(html.split('\n')))
html = html.replace('<li></li>', '')
return html
def delete_file(file_path):
if os.path.isfile(file_path):
#print 'delete:', file_path
os.remove(file_path)
def import_html_data(request):
clear_db()
fileHandle = open (r'%s/help/index.html' % (STATIC_ROOT), 'r')
index_content = fileHandle.read()
fileHandle.close()
regex = ur"<li>([\s\S]+?)</li>"
regex_span = ur"<span><b>\+</b>([\S\s]+?)</span>"
regex_href = ur"href=\"(.*)\" target=\"right\""
regex_title = ur"target=\"right\">([\S\s]+?)</a>"
regex_body = ur"<body>([\s\S]+?)</body>"
filter_regex = ur"<[\s\S]+?>"
match = re.findall(regex, index_content)
if match:
index = 1
for result in match:
mark_span = re.findall(regex_span, result)
category = HelpCategory()
category.id = index
category.order = index
category.name = mark_span[0].replace(" ", "")
category.save()
mark_href = re.findall(regex_href, result)
href_title = re.findall(regex_title, result)
#for i in range(mark_href.__len__()):
# print mark_href[i]
h_index = 0
for href in mark_href:
fileHandle_href = open (r'%s/help/%s' % (STATIC_ROOT, href), 'r')
fileHandle_href_content = fileHandle_href.read()
fileHandle_href.close()
model = Help()
model.parent_id = index
model.order = h_index
model.filename = href[:-5]
model.title = href_title[h_index]
content = re.findall(regex_body, fileHandle_href_content)[0]
content = re.sub(r'</\S+>', '\n', content)
content = re.sub(filter_regex, '', content)
#print content
model.content = content
model.save()
h_index = h_index + 1
index = index + 1
return render_to_response('feedback.html')
else :
return render_to_response('help/help_list.html')
def clear_db():
HelpCategory.objects.all().delete()
Help.objects.all().delete()
|
[
"root@localhost.localdomain"
] |
root@localhost.localdomain
|
b22195cecdaf5c8cf512f825dadae2c5286b19a2
|
2c97e11e13bfbabfdae8979385ba0957c7b11270
|
/ebl/tests/transliteration/test_normalized_akkadian.py
|
647d2b00a0572b7f4c97be63209b86160d835bb1
|
[
"MIT"
] |
permissive
|
ElectronicBabylonianLiterature/ebl-api
|
72a2a95291e502ec89a20ebe5c14447e63ac6d92
|
4910f6fbb57fa213fef55cbe9bc16215aebbaa27
|
refs/heads/master
| 2023-08-16T12:42:03.303042
| 2023-08-16T10:59:44
| 2023-08-16T10:59:44
| 135,266,736
| 11
| 3
|
MIT
| 2023-09-12T09:56:14
| 2018-05-29T08:39:58
|
Python
|
UTF-8
|
Python
| false
| false
| 5,532
|
py
|
import pytest
from ebl.dictionary.domain.word import WordId
from ebl.lemmatization.domain.lemmatization import LemmatizationToken
from ebl.tests.asserts import assert_token_serialization
from ebl.transliteration.application.token_schemas import OneOfTokenSchema
from ebl.transliteration.domain.atf import Flag
from ebl.transliteration.domain.enclosure_tokens import (
BrokenAway,
Emendation,
PerhapsBrokenAway,
)
from ebl.transliteration.domain.normalized_akkadian import (
AkkadianWord,
Caesura,
MetricalFootSeparator,
)
from ebl.transliteration.domain.tokens import Joiner, UnknownNumberOfSigns, ValueToken
@pytest.mark.parametrize(
"word,expected,lemmatizable",
[
(AkkadianWord.of((ValueToken.of("ibnû"),)), "ibnû", True),
(
AkkadianWord.of(
(ValueToken.of("ibnû"),), (Flag.UNCERTAIN, Flag.DAMAGE, Flag.CORRECTION)
),
"ibnû?#!",
True,
),
(AkkadianWord.of((BrokenAway.open(), ValueToken.of("ibnû"))), "[ibnû", True),
(
AkkadianWord.of(
(
BrokenAway.open(),
PerhapsBrokenAway.open(),
ValueToken.of("ib"),
PerhapsBrokenAway.close(),
ValueToken.of("nû"),
BrokenAway.close(),
)
),
"[(ib)nû]",
True,
),
(
AkkadianWord.of(
(
BrokenAway.open(),
PerhapsBrokenAway.open(),
Emendation.open(),
ValueToken.of("ib"),
PerhapsBrokenAway.close(),
ValueToken.of("nû"),
Emendation.close(),
BrokenAway.close(),
)
),
"[(<ib)nû>]",
True,
),
(
AkkadianWord.of(
(ValueToken.of("ibnû"), PerhapsBrokenAway.close(), BrokenAway.close()),
(Flag.UNCERTAIN,),
),
"ibnû?)]",
True,
),
(
AkkadianWord.of(
(ValueToken.of("ib"), UnknownNumberOfSigns.of(), ValueToken.of("nû"))
),
"ib...nû",
False,
),
(
AkkadianWord.of(
(ValueToken.of("ib"), Joiner.hyphen(), ValueToken.of("nû"))
),
"ib-nû",
True,
),
],
)
def test_akkadian_word(word: AkkadianWord, expected: str, lemmatizable: bool) -> None:
assert word.value == expected
assert word.clean_value == expected.translate(str.maketrans("", "", "[]()<>#?!"))
assert word.lemmatizable is lemmatizable
assert word.alignable is lemmatizable
serialized = {
"type": "AkkadianWord",
"parts": OneOfTokenSchema().dump(word.parts, many=True),
"modifiers": [modifier.value for modifier in word.modifiers],
"uniqueLemma": [],
"alignment": None,
"variant": None,
"lemmatizable": lemmatizable,
"alignable": lemmatizable,
"normalized": True,
"language": "AKKADIAN",
"hasVariantAlignment": word.has_variant_alignment,
"hasOmittedAlignment": word.has_omitted_alignment,
}
assert_token_serialization(word, serialized)
def test_akkadian_word_invalid_modifier() -> None:
with pytest.raises(ValueError): # pyre-ignore[16]
AkkadianWord.of((ValueToken.of("ibnû"),), (Flag.COLLATION,))
def test_set_unique_lemma() -> None:
word = AkkadianWord.of((ValueToken.of("bu"),))
lemma = LemmatizationToken("bu", (WordId("nu I"),))
expected = AkkadianWord.of((ValueToken.of("bu"),), unique_lemma=(WordId("nu I"),))
assert word.set_unique_lemma(lemma) == expected
def test_set_unique_lemma_empty() -> None:
word = AkkadianWord.of((ValueToken.of("bu"),), unique_lemma=(WordId("nu I"),))
lemma = LemmatizationToken("bu", tuple())
expected = AkkadianWord.of((ValueToken.of("bu"),))
assert word.set_unique_lemma(lemma) == expected
def test_set_alignment() -> None:
word = AkkadianWord.of((ValueToken.of("bu"),))
expected = AkkadianWord.of((ValueToken.of("bu"),), alignment=1)
assert word.set_alignment(1, None) == expected
def test_set_alignment_empty() -> None:
word = AkkadianWord.of((ValueToken.of("bu"),), alignment=1)
expected = AkkadianWord.of((ValueToken.of("bu"),))
assert word.set_alignment(None, None) == expected
@pytest.mark.parametrize(
"caesura,is_uncertain,value",
[(Caesura.certain(), False, "||"), (Caesura.uncertain(), True, "(||)")],
)
def test_caesura(caesura: Caesura, is_uncertain: bool, value: str) -> None:
assert caesura.value == value
assert caesura.is_uncertain == is_uncertain
serialized = {"type": "Caesura", "isUncertain": is_uncertain}
assert_token_serialization(caesura, serialized)
@pytest.mark.parametrize(
"separator,is_uncertain,value",
[
(MetricalFootSeparator.certain(), False, "|"),
(MetricalFootSeparator.uncertain(), True, "(|)"),
],
)
def test_metrical_foot_separator(
separator: MetricalFootSeparator, is_uncertain: bool, value: str
) -> None:
assert separator.value == value
assert separator.is_uncertain == is_uncertain
serialized = {"type": "MetricalFootSeparator", "isUncertain": is_uncertain}
assert_token_serialization(separator, serialized)
|
[
"noreply@github.com"
] |
ElectronicBabylonianLiterature.noreply@github.com
|
eaee55537bdde6b82b52cce268d4af3a8bb501a1
|
6610e8b7d715d28df179217b0222b6a74d7b01f3
|
/Contents/Libraries/Shared/resources/lib/resolvers/host_vidnode.py
|
3f10f938a34207ca65f56eef38d91a0af4c78c3d
|
[] |
no_license
|
BigmIkeX/FMoviesPlus.bundle
|
f479b96dabbda8a70944a7c44717a9b7a6abc5c0
|
7789e6137df8a86f6c9f9a78fc478ab89696e3d0
|
refs/heads/master
| 2020-05-22T09:39:12.049063
| 2019-05-09T20:54:25
| 2019-05-09T20:54:25
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 9,836
|
py
|
# -*- coding: utf-8 -*-
#########################################################################################################
#
# Vidnode scraper
#
# Coder Alpha
# https://github.com/coder-alpha
#
'''
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
'''
#########################################################################################################
import re,urllib,json,time
import os, sys, ast
from __builtin__ import eval
try:
from resources.lib.libraries import client
from resources.lib.libraries import control
except:
pass
hdr = {
'User-Agent': client.USER_AGENT,
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
'Accept-Encoding': 'none',
'Accept-Language': 'en-US,en;q=0.8',
'Connection': 'keep-alive'}
name = 'vidnode'
loggertxt = []
class host:
def __init__(self):
del loggertxt[:]
self.ver = '0.0.2'
self.update_date = 'Feb. 22, 2019'
log(type='INFO', method='init', err=' -- Initializing %s %s %s Start --' % (name, self.ver, self.update_date))
self.init = False
self.logo = 'https://i.imgur.com/IUyAW22.png'
self.name = name
self.host = ['vidnode.net']
self.netloc = ['vidnode.net']
self.quality = '1080p'
self.loggertxt = []
self.captcha = False
self.allowsDownload = True
self.resumeDownload = True
self.allowsStreaming = True
self.ac = False
self.pluginManagedPlayback = False
self.speedtest = 0
testResults = self.testWorking()
self.working = testResults[0]
self.msg = testResults[1]
if self.working == False:
self.captcha = True
self.working = True
self.resolver = self.testResolver()
self.init = True
log(type='INFO', method='init', err=' -- Initializing %s %s %s End --' % (name, self.ver, self.update_date))
def info(self):
return {
'name': self.name,
'ver': self.ver,
'date': self.update_date,
'class': self.name,
'speed': round(self.speedtest,3),
'netloc': self.netloc,
'host': self.host,
'quality': self.quality,
'logo': self.logo,
'working': self.working,
'resolver': self.resolver,
'captcha': self.captcha,
'msg': self.msg,
'playbacksupport': self.pluginManagedPlayback,
'a/c': self.ac,
'streaming' : self.allowsStreaming,
'downloading' : self.allowsDownload
}
def getLog(self):
self.loggertxt = loggertxt
return self.loggertxt
def testWorking(self):
try:
testUrls = self.testUrl()
bool = False
msg = ''
for testUrl in testUrls:
x1 = time.time()
bool = check(testUrl)
self.speedtest = time.time() - x1
if bool == True:
break
log(method='testWorking', err='%s online status: %s' % (self.name, bool))
return (bool, msg)
except Exception as e:
log(method='testWorking', err='%s online status: %s' % (self.name, bool))
log(type='ERROR', method='testWorking', err=e)
return False, msg
def testResolver(self):
try:
if control.setting('use_quick_init') == True:
log('INFO','testResolver', 'Disabled testing - Using Quick Init setting in Prefs.')
return False
testUrls = self.testUrl()
links = []
bool = False
for testUrl in testUrls:
links = self.createMeta(testUrl, 'Test', '', '720p', links, 'testing', 'BRRIP')
if len(links) > 0:
bool = True
break
except Exception as e:
log(type='ERROR', method='testResolver', err=e)
log(method='testResolver', err='%s parser status: %s' % (self.name, bool))
return bool
def testUrl(self):
return ['https://vidnode.net/streaming.php?id=MTc4ODc5']
def createMeta(self, url, provider, logo, quality, links, key, riptype, vidtype='Movie', lang='en', sub_url=None, txt='', file_ext = '.mp4', testing=False, poster=None, headers=None, page_url=None):
files_ret = []
orig_url = url
if testing == True:
links.append(url)
return links
if control.setting('Host-%s' % name) == False:
log('INFO','createMeta','Host Disabled by User')
return links
try:
ua = client.randomagent()
headers = {'Referer':'https://vidnode.net/','User-Agent':'Mozilla'}
urldata = client.b64encode(json.dumps('', encoding='utf-8'))
params = {'headers':headers,'cookie':None}
params = json.dumps(params, encoding='utf-8')
params = client.b64encode(params)
online = check(url, headers=headers)
vidurls, err, sub_url_t = getAllQuals(url, online)
if vidurls == None:
log(type='ERROR',method='createMeta-1', err=u'%s' % err)
return links
if sub_url_t != None:
sub_url = sub_url_t
seq = 0
for vv in vidurls:
durl = vv['page']
vidurl, r1, r2 = resolve(durl, online)
if vidurl == None:
log(type='ERROR',method='createMeta', err=u'%s' % r1)
else:
quality = vv['label']
try:
online = check(vidurl, headers=headers)
fs = client.getFileSize(vidurl)
fs = int(fs)
except:
fs = 0
try:
log(type='INFO',method='createMeta', err=u'durl:%s ; res:%s; fs:%s' % (vidurl,quality,fs))
files_ret.append({'source':self.name, 'maininfo':'', 'titleinfo':txt, 'quality':quality, 'vidtype':vidtype, 'rip':riptype, 'provider':provider, 'orig_url':orig_url, 'url':durl, 'durl':durl, 'urldata':urldata, 'params':params, 'logo':logo, 'online':online, 'allowsDownload':self.allowsDownload, 'resumeDownload':self.resumeDownload, 'allowsStreaming':self.allowsStreaming, 'key':key, 'enabled':True, 'fs':fs, 'file_ext':file_ext, 'ts':time.time(), 'lang':lang, 'poster':poster, 'sub_url':sub_url, 'subdomain':client.geturlhost(url), 'page_url':page_url, 'misc':{'player':'iplayer', 'gp':False}, 'seq':seq})
except Exception as e:
log(type='ERROR',method='createMeta', err=u'%s' % e)
files_ret.append({'source':urlhost, 'maininfo':'', 'titleinfo':txt, 'quality':quality, 'vidtype':vidtype, 'rip':'Unknown' ,'provider':provider, 'orig_url':orig_url, 'url':durl, 'durl':durl, 'urldata':urldata, 'params':params, 'logo':logo, 'online':online, 'allowsDownload':self.allowsDownload, 'resumeDownload':self.resumeDownload, 'allowsStreaming':self.allowsStreaming, 'key':key, 'enabled':True, 'fs':fs, 'file_ext':file_ext, 'ts':time.time(), 'lang':lang, 'sub_url':sub_url, 'poster':poster, 'subdomain':client.geturlhost(url), 'page_url':page_url, 'misc':{'player':'iplayer', 'gp':False}, 'seq':seq})
seq += 1
except Exception as e:
log('ERROR', 'createMeta', '%s' % e)
for fr in files_ret:
if fr != None and 'key' in fr.keys():
control.setPartialSource(fr,self.name)
links.append(fr)
if len(files_ret) > 0:
log('SUCCESS', 'createMeta', 'Successfully processed %s link >>> %s' % (provider, orig_url), dolog=self.init)
else:
log('FAIL', 'createMeta', 'Failed in processing %s link >>> %s' % (provider, orig_url), dolog=self.init)
log('INFO', 'createMeta', 'Completed', dolog=self.init)
return links
def resolve(self, url, online=None, page_url=None, **kwargs):
return resolve(url, online=online, page_url=page_url)
def resolveHostname(self, host):
return self.name
def testLink(self, url):
return check(url)
def resolve(url, online=None, page_url=None, **kwargs):
try:
if online == None:
if check(url) == False:
raise Exception('Video not available')
video_url = None
err = ''
try:
if '.mp4' in url.lower() or '.m3u8' in url.lower():
video_url = url
except Exception as e:
err = r
log('ERROR', 'resolve', 'link > %s : %s' % (url, e), dolog=self.init)
return (video_url, err, None)
except Exception as e:
e = '{}'.format(e)
return (None, e, None)
def getAllQuals(url, online=None):
try:
if online == None:
if check(url) == False:
raise Exception('Video not available')
video_url_a = []
page_data_string = client.request(url, httpsskip=True)
srcs = re.findall(r'{.*mp4.*}', page_data_string)[0]
srcs = srcs.replace("file","'file'").replace("label","'label'")
links = eval("{'file':'','label':''},"+srcs)
#print links
for link in links:
try:
#print link
page_link = link['file']
if page_link != None and len(page_link) > 0:
qs = link['label'].replace(' ','').lower()
if 'auto' in qs:
qs = '720p'
if 'hls' in qs:
pass
else:
f_i = {'label':qs, 'page':page_link}
video_url_a.append(f_i)
except:
pass
video_urlf = video_url_a
return (video_urlf, '', None)
except Exception as e:
e = '{}'.format(e)
return (None, e, None)
def check(url, headers=None, cookie=None):
try:
http_res, red_url = client.request(url=url, output='responsecodeext', followredirect=True, headers=headers, cookie=cookie)
if http_res not in client.HTTP_GOOD_RESP_CODES:
return False
return True
except:
return False
def test(url):
return resolve(url)
def log(type='INFO', method='undefined', err='', dolog=True, logToControl=False, doPrint=True):
try:
msg = '%s: %s > %s > %s : %s' % (time.ctime(time.time()), type, name, method, err)
if dolog == True:
loggertxt.append(msg)
if logToControl == True:
control.log(msg)
if control.doPrint == True and doPrint == True:
print msg
except Exception as e:
control.log('Error in Logging: %s >>> %s' % (msg,e))
|
[
"coderalphaakv@gmail.com"
] |
coderalphaakv@gmail.com
|
ab8f7035259fa98d9b0d12e248edfddb9335aab6
|
407ae3372e98442698332394a3da95f8f4c488a6
|
/results/mcmc_100chains/chains_fidsig_fidcov_nonuni_landyszalay/prep_corrmatrixDATAPARAMS/combine_dddr_78.py
|
1c845494911885a0a55f330c93ae926b4511b1ec
|
[] |
no_license
|
aszewciw/MW_Structure
|
0ce437627f4c43f776eae658aad8b98a280d6b06
|
ba25761aa9444ca5c04e3a4ad617b29d586ba4c8
|
refs/heads/master
| 2021-01-12T11:59:15.717154
| 2017-12-07T00:21:54
| 2017-12-07T00:21:54
| 68,852,501
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 2,417
|
py
|
'''
Produce files containing the indices of binned pairs. Here we do this for a
uniform sample.
'''
import mw_utilities_python as mwu
import sys, pickle, os
import numpy as np
def main():
Nmocks = 1000
star_factor = 10
dd_dir = '../../prep_fid_errors_DATAPARAMS/data/'
dr_dir = './data/'
out_dir = './data/'
# get directories of scripts, executables, and star files
cleaned_dir = mwu.get_path.get_cleandata_path()
scripts_dir = mwu.get_path.get_scripts_path()
if not os.path.isdir(out_dir):
sys.stderr.write('{} does not exist. Exiting...\n'.format(out_dir))
sys.exit(1)
if not os.path.isdir(dr_dir):
sys.stderr.write('{} does not exist. Exiting...\n'.format(dr_dir))
sys.exit(1)
if not os.path.isdir(dd_dir):
sys.stderr.write('{} does not exist. Exiting...\n'.format(dd_dir))
sys.exit(1)
# Load todo list
input_filename = cleaned_dir + 'todo_list.dat'
sys.stderr.write('Loading from file {} ...\n'.format(input_filename))
input_file = open(input_filename, 'rb')
todo_list = pickle.load(input_file)
input_file.close()
# Write command file
for i in range(Nmocks):
if i <700: continue
if i>799: continue
sys.stderr.write('On sample {}/{}\n'.format(i,Nmocks))
DD_dir = dd_dir + 'sample_' + str(i) + '/'
DR_dir = dr_dir + 'sample_' + str(i) + '/'
OUT_dir = out_dir + 'sample_' + str(i) + '/'
if not os.path.isdir(DD_dir):
sys.stderr.write('{} does not exist. Exiting...\n'.format(DD_dir))
sys.exit(1)
if not os.path.isdir(DR_dir):
sys.stderr.write('{} does not exist. Exiting...\n'.format(DR_dir))
sys.exit(1)
if not os.path.isdir(OUT_dir):
sys.stderr.write('{} does not exist. Exiting...\n'.format(OUT_dir))
sys.exit(1)
for p in todo_list:
N_rand = int(p.N_star * star_factor)
dr_file = DR_dir + 'dr_' + p.ID + '.dat'
dd_file = DD_dir + 'dd_' + p.ID + '.dat'
out_file = OUT_dir + 'DDm2DR_' + p.ID + '.dat'
dr = np.genfromtxt(dr_file, unpack=True, usecols=[4])
dd = np.genfromtxt(dd_file, unpack=True, usecols=[4])
ddm2dr = dd - 2.0*dr
np.savetxt(out_file, ddm2dr, fmt='%.6e')
if __name__ == '__main__':
main()
|
[
"aszewci@gmail.com"
] |
aszewci@gmail.com
|
03b93222dc4c00950cafabceaa0b78a0966de0bf
|
5c8139f1e57e06c7eaf603bd8fe74d9f22620513
|
/PartB/py图像的渲染.py
|
d38a444d1e9b9dacfe956cabdc89c130cf467422
|
[] |
no_license
|
madeibao/PythonAlgorithm
|
c8a11d298617d1abb12a72461665583c6a44f9d2
|
b4c8a75e724a674812b8a38c0202485776445d89
|
refs/heads/master
| 2023-04-03T07:18:49.842063
| 2021-04-11T12:02:40
| 2021-04-11T12:02:40
| 325,269,130
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 2,144
|
py
|
# 图片的渲染。
有一幅以二维整数数组表示的图画,每一个整数表示该图画的像素值大小,数值在 0 到 65535 之间。
给你一个坐标 (sr, sc) 表示图像渲染开始的像素值(行 ,列)和一个新的颜色值 newColor,让你重新上色这幅图像。
为了完成上色工作,从初始坐标开始,记录初始坐标的上下左右四个方向上像素值与初始坐标相同的相连像素点,接着再记录这四个方向上符合条件的像素点与他们对应四个方向上像素值与初始坐标相同的相连像素点,……,重复该过程。将所有有记录的像素点的颜色值改为新的颜色值。
最后返回经过上色渲染后的图像。
示例 1:
输入:
image = [[1,1,1],[1,1,0],[1,0,1]]
sr = 1, sc = 1, newColor = 2
输出: [[2,2,2],[2,2,0],[2,0,1]]
解析:
在图像的正中间,(坐标(sr,sc)=(1,1)),
在路径上所有符合条件的像素点的颜色都被更改成2。
注意,右下角的像素没有更改为2,
因为它不是在上下左右四个方向上与初始点相连的像素点。
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/flood-fill
著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
# ---------------------------------------------------------------------------------------- ----------------
from typing import List
class Solution:
def floodFill(self, image: List[List[int]], sr: int, sc: int, newColor: int) -> List[List[int]]:
color = image[sr][sc]
if color == newColor:
# 如果是没有染色的条件下,则直接的进行返回。
return image
def dfs(i, j):
if 0 > i or i >= len(image) or 0 > j or j >= len(image[0]) or image[i][j] != color:
return
image[i][j] = newColor
dfs(i+1, j)
dfs(i-1, j)
dfs(i, j+1)
dfs(i, j-1)
dfs(sr, sc)
return image
if __name__ == "__main__":
s = Solution()
list2= [[1,1,1],
[1,1,0],
[1,0,1]]
print(s.floodFill(list2))
|
[
"2901429479@qq.com"
] |
2901429479@qq.com
|
fbef0ac42b1bb39f82decca2b93a6e293889dbff
|
71e3c041cb4911df0fd9f4444d8e07fb4e17d38c
|
/component/__init__.py
|
0353ee565957d498d91d89695802ff295dc6e10a
|
[
"Apache-2.0"
] |
permissive
|
w1368027790/DeepRL
|
8e713da32e2465f20a4966cf7d7aeb69f35aa074
|
51f125c01eb013b77ebf3a78795ae87dc9ffb9f9
|
refs/heads/master
| 2021-07-08T06:23:41.095226
| 2017-10-08T03:23:02
| 2017-10-08T03:23:02
| 106,264,458
| 1
| 0
| null | 2017-10-09T09:38:19
| 2017-10-09T09:38:19
| null |
UTF-8
|
Python
| false
| false
| 117
|
py
|
from atari_wrapper import *
from policy import *
from replay import *
from task import *
from random_process import *
|
[
"zhangshangtong.cpp@icloud.com"
] |
zhangshangtong.cpp@icloud.com
|
1c0672167fdd543464f6bbd6c8ac7098353c0bea
|
d1ddb9e9e75d42986eba239550364cff3d8f5203
|
/google-cloud-sdk/lib/googlecloudsdk/command_lib/billing/utils.py
|
718213de8b0203d284f7c2d410fd64d0ab94b416
|
[
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] |
permissive
|
bopopescu/searchparty
|
8ecd702af0d610a7ad3a8df9c4d448f76f46c450
|
afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6
|
refs/heads/master
| 2022-11-19T14:44:55.421926
| 2017-07-28T14:55:43
| 2017-07-28T14:55:43
| 282,495,798
| 0
| 0
|
Apache-2.0
| 2020-07-25T17:48:53
| 2020-07-25T17:48:52
| null |
UTF-8
|
Python
| false
| false
| 1,117
|
py
|
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless 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.
"""Utilities for billing commands."""
from googlecloudsdk.core import resources
PROJECTS_COLLECTION = 'cloudbilling.projects'
ACCOUNTS_COLLECTION = 'cloudbilling.billingAccounts'
def GetRegistry():
registry = resources.REGISTRY.Clone()
registry.RegisterApiByName('cloudbilling', 'v1')
return registry
def ParseProject(project_id):
return GetRegistry().Parse(project_id, collection=PROJECTS_COLLECTION)
def ParseAccount(account_id):
return GetRegistry().Parse(account_id, collection=ACCOUNTS_COLLECTION)
|
[
"vinvivo@users.noreply.github.com"
] |
vinvivo@users.noreply.github.com
|
83e04af598a29f1f5bb89e074965a329449c3d81
|
bc1928bb2742ad96bceb725e4bca65abd9bdbcaf
|
/NinjaGold/venv/bin/pip2
|
c23e2d6f7d0480927da64b475980713b2e1817b2
|
[] |
no_license
|
waterFlowin/Python-Projects
|
767ad675be902739cea0119e554ed3501eeba793
|
1503bc0c236295c53c38f8fbc5189f4a9b7ba1f1
|
refs/heads/master
| 2021-01-20T00:21:08.155024
| 2017-04-23T03:48:20
| 2017-04-23T03:48:20
| 89,115,581
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 262
|
#!/Users/waterFlow/Documents/PythonAssignments/NinjaGold/venv/bin/python2.7
# -*- coding: utf-8 -*-
import re
import sys
from pip import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
|
[
"johndoe@example.com"
] |
johndoe@example.com
|
|
5c9c45a5bbfac836a6957791a648c100d07822db
|
dfaf6f7ac83185c361c81e2e1efc09081bd9c891
|
/k8sdeployment/k8sstat/python/kubernetes/client/models/v1beta1_local_subject_access_review.py
|
0010ecb23188972522b0f3c64241b7f6a494e26f
|
[
"Apache-2.0",
"MIT"
] |
permissive
|
JeffYFHuang/gpuaccounting
|
d754efac2dffe108b591ea8722c831d979b68cda
|
2c63a63c571240561725847daf1a7f23f67e2088
|
refs/heads/master
| 2022-08-09T03:10:28.185083
| 2022-07-20T00:50:06
| 2022-07-20T00:50:06
| 245,053,008
| 0
| 0
|
MIT
| 2021-03-25T23:44:50
| 2020-03-05T02:44:15
|
JavaScript
|
UTF-8
|
Python
| false
| false
| 7,366
|
py
|
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.6
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V1beta1LocalSubjectAccessReview(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 = {
'api_version': 'str',
'kind': 'str',
'metadata': 'V1ObjectMeta',
'spec': 'V1beta1SubjectAccessReviewSpec',
'status': 'V1beta1SubjectAccessReviewStatus'
}
attribute_map = {
'api_version': 'apiVersion',
'kind': 'kind',
'metadata': 'metadata',
'spec': 'spec',
'status': 'status'
}
def __init__(self, api_version=None, kind=None, metadata=None, spec=None, status=None): # noqa: E501
"""V1beta1LocalSubjectAccessReview - a model defined in OpenAPI""" # noqa: E501
self._api_version = None
self._kind = None
self._metadata = None
self._spec = None
self._status = None
self.discriminator = None
if api_version is not None:
self.api_version = api_version
if kind is not None:
self.kind = kind
if metadata is not None:
self.metadata = metadata
self.spec = spec
if status is not None:
self.status = status
@property
def api_version(self):
"""Gets the api_version of this V1beta1LocalSubjectAccessReview. # noqa: E501
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources # noqa: E501
:return: The api_version of this V1beta1LocalSubjectAccessReview. # noqa: E501
:rtype: str
"""
return self._api_version
@api_version.setter
def api_version(self, api_version):
"""Sets the api_version of this V1beta1LocalSubjectAccessReview.
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources # noqa: E501
:param api_version: The api_version of this V1beta1LocalSubjectAccessReview. # noqa: E501
:type: str
"""
self._api_version = api_version
@property
def kind(self):
"""Gets the kind of this V1beta1LocalSubjectAccessReview. # noqa: E501
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds # noqa: E501
:return: The kind of this V1beta1LocalSubjectAccessReview. # noqa: E501
:rtype: str
"""
return self._kind
@kind.setter
def kind(self, kind):
"""Sets the kind of this V1beta1LocalSubjectAccessReview.
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds # noqa: E501
:param kind: The kind of this V1beta1LocalSubjectAccessReview. # noqa: E501
:type: str
"""
self._kind = kind
@property
def metadata(self):
"""Gets the metadata of this V1beta1LocalSubjectAccessReview. # noqa: E501
:return: The metadata of this V1beta1LocalSubjectAccessReview. # noqa: E501
:rtype: V1ObjectMeta
"""
return self._metadata
@metadata.setter
def metadata(self, metadata):
"""Sets the metadata of this V1beta1LocalSubjectAccessReview.
:param metadata: The metadata of this V1beta1LocalSubjectAccessReview. # noqa: E501
:type: V1ObjectMeta
"""
self._metadata = metadata
@property
def spec(self):
"""Gets the spec of this V1beta1LocalSubjectAccessReview. # noqa: E501
:return: The spec of this V1beta1LocalSubjectAccessReview. # noqa: E501
:rtype: V1beta1SubjectAccessReviewSpec
"""
return self._spec
@spec.setter
def spec(self, spec):
"""Sets the spec of this V1beta1LocalSubjectAccessReview.
:param spec: The spec of this V1beta1LocalSubjectAccessReview. # noqa: E501
:type: V1beta1SubjectAccessReviewSpec
"""
if spec is None:
raise ValueError("Invalid value for `spec`, must not be `None`") # noqa: E501
self._spec = spec
@property
def status(self):
"""Gets the status of this V1beta1LocalSubjectAccessReview. # noqa: E501
:return: The status of this V1beta1LocalSubjectAccessReview. # noqa: E501
:rtype: V1beta1SubjectAccessReviewStatus
"""
return self._status
@status.setter
def status(self, status):
"""Sets the status of this V1beta1LocalSubjectAccessReview.
:param status: The status of this V1beta1LocalSubjectAccessReview. # noqa: E501
:type: V1beta1SubjectAccessReviewStatus
"""
self._status = status
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, V1beta1LocalSubjectAccessReview):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
|
[
"JeffYFHuang@github.com"
] |
JeffYFHuang@github.com
|
40e963c4b3b5b9e68d8105b83d2b6b6c606d607d
|
04cfd073ca0ce0e55a437ea6c1fd6536873d7553
|
/ex45.py
|
37c91b8eb307fd86a3ac004192e82bea6f32e679
|
[] |
no_license
|
randy-wittorp/ex
|
5a682be54cf72404349fe397e4c7b3357d2b32d8
|
f8c22f0507609e69dadaf8a847dd7d8c4aad304f
|
refs/heads/master
| 2016-09-05T09:57:14.924825
| 2015-05-11T02:37:28
| 2015-05-11T02:37:28
| 35,258,942
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 1,960
|
py
|
from sys import argv
script, filename = argv
print "=" * 40, '\n\n'
print "Let's make up a bunch of different types of rooms for a game."
print "At anytime, enter [Q] to quit.\n\n"
target = open(filename, 'w')
game_rooms = []
while True:
room = {}
# get the name of a room
print "First, what type of room is it? Let's give it a name."
room['name'] = raw_input("> ").lower().capitalize()
if room['name'].lower() == 'q':
break
print "Great! %s is a great room type.\n" % room['name']
# get the description of a room
print "Write a short description of a %s" % room['name']
room['description'] = raw_input("> ")
if room['description'].lower() == 'q':
break
print "\nWe're making great progress! So far we have this:"
print "%s:" % room['name'], room['description']
# get the greeting for the player as he enters
print "\nWhat would you like the player to read as he enters the %s?" % room['name']
room['greeting'] = raw_input("> ")
if room['greeting'].lower() == 'q':
break
# add it to the list!!!!
game_rooms.append(room)
print "\n\n", "That room's done! Let's do another! \n", "=" * 40
print "Remember, [Q]uit will get you out of here.\n\n"
# print game_rooms
for room in game_rooms:
print """class %s(Room):
\"\"\"%s\"\"\"
def __init__(self)
self.greeting = \"%s\"
""" % (room['name'], room['description'], room['greeting'])
#need to write a Dungeon/Room class that has coord mgmt system
#Dungeon.__init__ should take two integers for a width and height. Rooms could be created at random, and the Room class could determine available directions to move
#Each Specific type of room should have a short puzzle to overcome, then give the available paths (N, S, E, W)
#Dungeon will store a two dimensional list of rooms
#will need to import random to generate random rooms
|
[
"="
] |
=
|
789a17b497fcabc2aa2f1afd85c5bd55ffaf58a1
|
6af81c1e3853255f064ce58e848b34211decdd23
|
/test/top/api/rest/DeliveryTemplateDeleteRequest.py
|
ed625006af2c7cf18003711289ed9a7a170cdc58
|
[] |
no_license
|
dacy413/TBAutoTool
|
d472445f54f0841f2cd461d48ec6181ae2182d92
|
ca7da4638d38dd58e38c680ee03aaccf575bce7b
|
refs/heads/master
| 2016-09-06T16:13:01.633177
| 2015-02-01T00:04:50
| 2015-02-01T00:04:50
| 29,625,228
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 328
|
py
|
'''
Created by auto_sdk on 2015-01-20 12:36:26
'''
from top.api.base import RestApi
class DeliveryTemplateDeleteRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.template_id = None
def getapiname(self):
return 'taobao.delivery.template.delete'
|
[
"1656505353@qq.com"
] |
1656505353@qq.com
|
fa3a4ad9a1fb7ac12f9eeee873960f975fe4b561
|
083b3f5b0d23c269c6a9ff1ea413e70fb799a497
|
/Leetcode Challenge/09_September_2020/Python/Week 1/4_Partition Labels.py
|
d7760779eeaf21e4b1358e275335701835e975b5
|
[] |
no_license
|
HectorIGH/Competitive-Programming
|
b2e02dff140d9ebb06c646f7be0b53ea0afe90c9
|
467058c63e8a7e76805feebe3020bac4d20516a6
|
refs/heads/master
| 2022-12-31T18:32:46.824626
| 2020-10-16T20:38:33
| 2020-10-16T20:38:33
| 279,733,136
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 1,275
|
py
|
#A string S of lowercase English letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one part, and return a list of integers representing the size of these parts.
#
#
#
#Example 1:
#
#Input: S = "ababcbacadefegdehijhklij"
#Output: [9,7,8]
#Explanation:
#The partition is "ababcbaca", "defegde", "hijhklij".
#This is a partition so that each letter appears in at most one part.
#A partition like "ababcbacadefegde", "hijhklij" is incorrect, because it splits S into less parts.
#
#
#Note:
#
#S will have length in range [1, 500].
#S will consist of lowercase English letters ('a' to 'z') only.
#
#
# Hide Hint #1
#Try to greedily choose the smallest partition that includes the first letter. If you have something like "abaccbdeffed", then you might need to add b. You can use an map like "last['b'] = 5" to help you expand the width of your partition.
class Solution:
def partitionLabels(self, S: str) -> List[int]:
last = {c: i for i, c in enumerate(S)}
j = 0
anchor = 0
ans = []
for i, c in enumerate(S):
j = max(j, last[c])
if i == j:
ans.append(i - anchor + 1)
anchor = i + 1
return ans
|
[
"HectorIGH@users.noreply.github.com"
] |
HectorIGH@users.noreply.github.com
|
bd38508a4ddf2cb90bdd31c649292c99a7e7cbf3
|
b343b5101e453fff9d59a1644ba54f77ead0bad2
|
/face_test/metric-distance.py
|
a951870b8795d33ac57810c90c148f74b0b74e86
|
[] |
no_license
|
BarshaGuha/face-detect-recognize
|
cb0643f9297d803d3b05ae1f7036757c8ba43d0b
|
d193669c3a68b645d9cce30378c20d225d0fef7f
|
refs/heads/master
| 2020-04-10T16:04:12.846940
| 2018-10-31T07:21:22
| 2018-10-31T07:21:22
| 161,132,045
| 1
| 1
| null | 2018-12-10T07:05:46
| 2018-12-10T07:05:46
| null |
UTF-8
|
Python
| false
| false
| 2,869
|
py
|
#python
#similarity distance
今天一个偶然的机会体会到了python数据运算的强大。求一个数组各样本之间的距离仅简单的几句代码就行。看来真的技术改变世界啊。废话不多说,记下来怕以后忘记。
[python] view plain copy
from scipy.spatial.distance import pdist, squareform
下面结合API文档标注一下具体用法:
[python] view plain copy
1.X = pdist(X, 'euclidean')
计算数组X样本之间的欧式距离 返回值为 Y 为压缩距离元组或矩阵(以下等同)
[python] view plain copy
2. X = pdist(X, 'minkowski', p)
计算数组样本之间的明氏距离
[python] view plain copy
3. Y = pdist(X, 'cityblock')
计算数组样本之间的曼哈顿距离
[python] view plain copy
4. X = pdist(X, 'seuclidean', V=None)
计算数组样本之间的标准化欧式距离 ,v是方差向量,表示 v[i]表示第i个分量的方差,如果缺失。默认自动计算。
[python] view plain copy
5. X = pdist(X, 'sqeuclidean')
计算数组样本之间欧式距离的平方
[python] view plain copy
6. X = pdist(X, 'cosine')
计算数组样本之间余弦距离 公式为:
[python] view plain copy
7. X = pdist(X, 'correlation')
计算数组样本之间的相关距离。
[python] view plain copy
8.X = pdist(X, 'hamming')
计算数据样本之间的汉明距离
[python] view plain copy
9. X = pdist(X, 'jaccard')
计算数据样本之间的杰卡德距离
[python] view plain copy
10. X = pdist(X, 'chebyshev')
计算数组样本之间的切比雪夫距离
[python] view plain copy
11. X = pdist(X, 'canberra')
[python] view plain copy
计算数组样本之间的堪培拉距离
[python] view plain copy
12. X = pdist(X, 'mahalanobis', VI=None)
[python] view plain copy
计算数据样本之间的马氏距离
还有好多不常用的距离就不一一写出了,如果想查阅可以点 点我,点我
[python] view plain copy
除了对指定的距离计算该函数还可以穿lmbda表达式进行计算,如下
[python] view plain copy
dm = pdist(X, lambda u, v: np.sqrt(((u-v)**2).sum()))
二、得到压缩矩阵后还需下一步即:
[python] view plain copy
Y=scipy.spatial.distance.squareform(X, force='no', checks=True)
[python] view plain copy
其中,X就是上文提到的压缩矩阵Y,force 如同MATLAB一样,如果force等于‘tovector’ or ‘tomatrix’,输入就会被当做距离矩阵或距离向量。
[python] view plain copy
cheak当X-X.T比较小或diag(X)接近于零,是是有必要设成True的,<span style="font-family: Arial, Helvetica, sans-serif;">返回值Y为一个距离矩阵Y[i,j]表示样本i与样本j的距离。</span>
|
[
"lixiaoyu283284@163.com"
] |
lixiaoyu283284@163.com
|
39569cf295296908556488db4b1939a139e7dd20
|
037a97b5de833dfdd6b9489e776cf6be651c2703
|
/fpraktikum/migrations/0013_auto_20170913_1402.py
|
d86db83742caf7dadcea2f1acefe1883b435a415
|
[
"MIT"
] |
permissive
|
PhysikOnline/fpraktikum_backend
|
6fc6ec521749f92387e7b99873b27a73b255d46a
|
b040aef86dba6137f1c5d0fd936143a48b4f9c13
|
refs/heads/master
| 2021-04-18T19:46:24.019906
| 2020-03-15T15:43:16
| 2020-03-15T15:43:16
| 126,201,619
| 2
| 1
|
MIT
| 2020-06-05T17:37:58
| 2018-03-21T15:38:11
|
Python
|
UTF-8
|
Python
| false
| false
| 2,404
|
py
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-13 14:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fpraktikum', '0012_auto_20170912_1105'),
]
operations = [
migrations.AlterModelOptions(
name='fpwaitlist',
options={'verbose_name': 'Waitlist', 'verbose_name_plural': 'Waitlists'},
),
migrations.RenameField(
model_name='fpwaitlist',
old_name='user_snumber',
new_name='user_login',
),
migrations.AddField(
model_name='fpuserpartner',
name='user_matrikel',
field=models.CharField(blank=True, max_length=100, null=True, verbose_name='Matrikelnumber'),
),
migrations.AddField(
model_name='fpuserregistrant',
name='user_matrikel',
field=models.CharField(blank=True, max_length=100, null=True, verbose_name='Matrikelnumber'),
),
migrations.AddField(
model_name='fpwaitlist',
name='user_firstname',
field=models.CharField(max_length=100, null=True, verbose_name='user firstname'),
),
migrations.AddField(
model_name='fpwaitlist',
name='user_lastname',
field=models.CharField(max_length=100, null=True, verbose_name='user lastname'),
),
migrations.AddField(
model_name='fpwaitlist',
name='user_matrikel',
field=models.CharField(blank=True, max_length=100, null=True, verbose_name='Matrikelnummer'),
),
migrations.AlterUniqueTogether(
name='fpuserpartner',
unique_together=set([('user_firstname', 'user_lastname', 'user_email', 'user_login', 'user_matrikel')]),
),
migrations.AlterUniqueTogether(
name='fpuserregistrant',
unique_together=set([('user_firstname', 'user_lastname', 'user_email', 'user_login', 'user_matrikel')]),
),
migrations.RemoveField(
model_name='fpwaitlist',
name='user_name',
),
migrations.AlterUniqueTogether(
name='fpwaitlist',
unique_together=set([('user_firstname', 'user_lastname', 'user_email', 'user_login', 'user_matrikel')]),
),
]
|
[
"chgad.games@gmail.com"
] |
chgad.games@gmail.com
|
d421307da7fd37864161ea2092ae764586add0c4
|
c1a0c19b236a7291d1ab510611206ff8946b8655
|
/run.py
|
d5a367baaa99410b1277617e4727f2711ff0be6c
|
[] |
no_license
|
LeeHuangChen/2018_03_22_MosaicFinderResultAnalysis
|
5e211e5d3a931ae8030ac0a8b907f99863262f98
|
dcf0de140a3385ac2f5b4f3efc08fa84c890af26
|
refs/heads/master
| 2021-04-15T13:06:05.928299
| 2018-03-22T22:53:13
| 2018-03-22T22:53:13
| 126,397,794
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 4,783
|
py
|
import Configurations as conf
import os
from cPickle import load
from src import util
def readResultFile(folder, filename):
fusedDict = {}
familyDict = {}
with open(os.path.join(folder, filename)) as f:
for i, line in enumerate(f):
if i > 0:
# reference:
# 0 1 2 3 4
# gene_id fusion_event family_number start_med_align1 end_med_align1
# 5 6 7
# start_med_align2 end_med_align2 break_point
arr = line.split("\t")
# family proteins only have 3 values
pid = arr[0]
fEvent = arr[1]
familyNumMF = arr[2]
if pid[0] == 'f':
# print line
splitInfo = pid.split("_")
if len(splitInfo) > 3:
familyNumber = -2
else:
familyNumber = int(splitInfo[0][1:])
if fEvent in familyDict.keys():
subDict = familyDict[fEvent]
if type(subDict[1]) != list:
subDict[1] = []
subDict[2] = []
subDict[3] = []
subDict[int(familyNumMF)].append(familyNumber)
else:
familyDict[fEvent] = {0: [], 1: [], 2: [], 3: []}
familyDict[fEvent][int(familyNumMF)].append(familyNumber)
else:
# print line, len(arr)
splitInfo = pid.split("_")
if len(splitInfo) <= 2:
f1 = -1
f2 = -1
else:
# id = splitInfo[1]
f1 = int(splitInfo[3])
f2 = int(splitInfo[5])
# g = int(splitInfo[7])
# split = int(splitInfo[9])
fusedDict[pid] = [fEvent, f1, f2]
return fusedDict, familyDict
def main():
filenames = os.listdir(conf.inputFolder)
util.generateDirectories(conf.resultFolder)
with open(os.path.join(conf.resultFolder, "Results.txt"), "w") as wf:
wf.write("TEvo\tNFam\tNFusions\tavgConf\tnumProt\n")
for filename in filenames:
# reference:
# 0 1 2 3 4 5 6 7 8 9 10 11 12
# M_mjtt_SeqL_1000_NFam_2_NFusions_2_TEvo_1.5_NGen_5_ BorderInformation
parsed = filename.split("_")
# model = parsed[1]
# seqLen = parsed[3]
NFam = parsed[5]
NFusions = parsed[7]
TEvo = parsed[9]
# NGen = parsed[11]
fusedDict, familyDict = readResultFile(conf.inputFolder, filename)
confidenceArr = []
for pid in fusedDict.keys():
fEvent, f1, f2 = fusedDict[pid]
mf1s = familyDict[fEvent][1]
mf2s = familyDict[fEvent][2]
success = 0
totalAssigns = len(mf1s) + len(mf2s)
print pid
print mf1s
print mf2s
#print familyDict[fEvent][3]
success1 = 0
success2 = 0
for f in mf1s:
if f == f1:
success1 += 1
for f in mf2s:
if f == f1:
success2 += 1
if success1 > success2:
mf1 = mf1s
mf2 = mf2s
else:
mf1 = mf2s
mf2 = mf1s
for f in mf1:
if f == f1:
success1 += 1
for f in mf2:
if f == f2:
success2 += 1
# if totalAssigns == 0:
# confi = 0
# else:
# confi = float(success)/totalAssigns
if success1 > 0 and success2 > 0:
confi = 1
elif success1 == 0 and success2 == 0:
confi = 0
else:
confi = .5
confidenceArr.append(confi)
print confi, success, totalAssigns
avgConf = reduce(lambda x, y: x + y, confidenceArr)/float(len(confidenceArr))
wf.write(str(TEvo) + "\t" + str(NFam) + "\t" + str(NFusions) + "\t")
wf.write(str(avgConf) + "\t" + str(len(fusedDict.keys())) + "\n")
if __name__ == '__main__':
main()
|
[
"lhc1@rice.edu"
] |
lhc1@rice.edu
|
ba073293648a25847d17dc772cd96e10004f5085
|
2c1e06ff5fc659188735bba84707d07ab1578f58
|
/backend/deposits/helpers/banks.py
|
9cd234c213c944457aa8ac2d9acf51c35b5db110
|
[] |
no_license
|
aviaryan/deposits-app
|
b15db26d4fe79d5934b36167d2edfa70c1f009f2
|
dc6e4e93749aa2001feba35b461b4c1168a893a1
|
refs/heads/master
| 2021-03-30T21:26:24.923656
| 2018-05-11T09:06:40
| 2018-05-11T09:06:40
| 124,782,433
| 3
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 1,013
|
py
|
# bank = https://tin.tin.nsdl.com/tan/Bank.html
BANKS = """
Allahabad Bank
Andhra Bank
Axis Bank
Bank of Bahrain and Kuwait
Bank of Baroda - Corporate Banking
Bank of Baroda - Retail Banking
Bank of India
Bank of Maharashtra
Canara Bank
Central Bank of India
City Union Bank
Corporation Bank
Deutsche Bank
Development Credit Bank
Dhanlaxmi Bank
Federal Bank
ICICI Bank
IDBI Bank
Indian Bank
Indian Overseas Bank
IndusInd Bank
ING Vysya Bank
Jammu and Kashmir Bank
Karnataka Bank Ltd
Karur Vysya Bank
Kotak Bank
Laxmi Vilas Bank
Oriental Bank of Commerce
Punjab National Bank - Corporate Banking
Punjab National Bank - Retail Banking
Punjab & Sind Bank
Shamrao Vitthal Co-operative Bank
South Indian Bank
State Bank of Bikaner & Jaipur
State Bank of Hyderabad
State Bank of India
State Bank of Mysore
State Bank of Patiala
State Bank of Travancore
Syndicate Bank
Tamilnad Mercantile Bank Ltd.
UCO Bank
Union Bank of India
United Bank of India
Vijaya Bank
Yes Bank Ltd
"""
BANKS = list(BANKS.strip().split('\n'))
|
[
"avi.aryan123@gmail.com"
] |
avi.aryan123@gmail.com
|
2e37aa5d9e2825c50325ba060540a1765c2d14f7
|
0475a5b592a4f9d9bff229dc4308ab6a5e6f1ba9
|
/pyalysis/_compat.py
|
c839af6cebaec9d4342a3128f85843d17b9f8a3a
|
[
"BSD-3-Clause"
] |
permissive
|
DasIch/pyalysis
|
5f7cf7ff188739e117136315a79e1cb8a6aa9734
|
314fd86c268b9b0fd61bf4ab2dbf10810e77a8bf
|
refs/heads/master
| 2016-09-06T05:51:00.478360
| 2014-02-26T02:54:49
| 2014-02-26T02:54:49
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 1,772
|
py
|
# coding: utf-8
"""
pyalysis._compat
~~~~~~~~~~~~~~~~
:copyright: 2014 by Daniel Neuhäuser and Contributors
"""
import sys
import codecs
try:
import __pypy__
del __pypy__
PYPY = True
except ImportError:
PYPY = False
PY2 = sys.version_info[0] == 2
if PY2:
text_type = unicode
def implements_iterator(cls):
cls.next = cls.__next__
del cls.__next__
return cls
stdout = codecs.lookup(
sys.stdout.encoding or 'utf-8'
).streamwriter(sys.stdout)
stderr = codecs.lookup(
sys.stderr.encoding or 'utf-8'
).streamwriter(sys.stderr)
else:
text_type = str
def implements_iterator(cls):
return cls
stdout = sys.stdout
stderr = sys.stderr
# copied from Flask: flask/_compat.py
# copyright 2014 by Armin Ronacher
# licensed under BSD
#
def with_metaclass(meta, *bases):
# This requires a bit of explanation: the basic idea is to make a
# dummy metaclass for one level of class instantiation that replaces
# itself with the actual metaclass. Because of internal type checks
# we also need to make sure that we downgrade the custom metaclass
# for one level to something closer to type (that's why __call__ and
# __init__ comes back from type etc.).
#
# This has the advantage over six.with_metaclass in that it does not
# introduce dummy classes into the final MRO.
class metaclass(meta):
__call__ = type.__call__
__init__ = type.__init__
def __new__(cls, name, this_bases, d):
if this_bases is None:
return type.__new__(cls, name, (), d)
return meta(name, bases, d)
return metaclass('temporary_class', None, {})
|
[
"dasdasich@gmail.com"
] |
dasdasich@gmail.com
|
14935b76244e1588351e41945ab39bd8eda80882
|
18a79067223932c2f7aa6ff6b81d0b3f36169db2
|
/atcoder/abc198/A.py
|
3a9ccde63436d9b2a4c9eedca30aad16300ec6a6
|
[] |
no_license
|
aadiupadhyay/CodeForces
|
894b0e5faef73bfd55a28c2058fb0ca6f43c69f9
|
76dac4aa29a2ea50a89b3492387febf6515cf43e
|
refs/heads/master
| 2023-04-12T17:58:52.733861
| 2021-05-07T20:08:00
| 2021-05-11T20:07:11
| 330,149,645
| 1
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 591
|
py
|
# aadiupadhyay
import os.path
from math import gcd, floor, ceil, factorial
from collections import *
import sys
mod = 1000000007
INF = float('inf')
def st(): return list(sys.stdin.readline().strip())
def li(): return list(map(int, sys.stdin.readline().split()))
def mp(): return map(int, sys.stdin.readline().split())
def inp(): return int(sys.stdin.readline())
def pr(n): return sys.stdout.write(str(n)+"\n")
def prl(n): return sys.stdout.write(str(n)+" ")
if os.path.exists('input.txt'):
sys.stdin = open('input.txt', 'r')
sys.stdout = open('output.txt', 'w')
n = inp()
pr(n-1)
|
[
"upadhyay.aaditya2001@gmail.com"
] |
upadhyay.aaditya2001@gmail.com
|
56d5ba5271e24ce0b3cba44c3f85cb51a3403840
|
aac418419c2ef4d10c5c4ceb607d3d8329a5f395
|
/Algorithms/Miscellaneous/Gcd.py
|
bd88fe1c2e7a751961f75b187fda83c809005b18
|
[] |
no_license
|
sudhirshahu51/projects
|
bb13395227355ff84933b6d3a0f158ee42bcdceb
|
b2d8331d14d2163b20535368a60c81f6c8bc2c8f
|
refs/heads/master
| 2021-01-01T17:09:18.654060
| 2017-04-24T10:46:15
| 2017-04-24T10:46:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 129
|
py
|
# To find the greatest common divisor
def gcd(x,y):
if x == 0:
return y
else:
return gcd(y%x, x)
|
[
"deveshaggrawal19@gmail.com"
] |
deveshaggrawal19@gmail.com
|
2ebe4b45268b5fbc1b7af9b11f7786c3d33e1429
|
9743d5fd24822f79c156ad112229e25adb9ed6f6
|
/xai/brain/wordbase/nouns/_nick.py
|
08c83ac70115fc28cd22074d9bc50429622e92b8
|
[
"MIT"
] |
permissive
|
cash2one/xai
|
de7adad1758f50dd6786bf0111e71a903f039b64
|
e76f12c9f4dcf3ac1c7c08b0cc8844c0b0a104b6
|
refs/heads/master
| 2021-01-19T12:33:54.964379
| 2017-01-28T02:00:50
| 2017-01-28T02:00:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 373
|
py
|
#calss header
class _NICK():
def __init__(self,):
self.name = "NICK"
self.definitions = [u'a small cut in a surface or an edge: ', u'prison: ', u'a stated condition, especially of health: ']
self.parents = []
self.childen = []
self.properties = []
self.jsondata = {}
self.specie = 'nouns'
def run(self, obj1 = [], obj2 = []):
return self.jsondata
|
[
"xingwang1991@gmail.com"
] |
xingwang1991@gmail.com
|
c4b133fa991cff40fc6033efcd8249daadb5c8d7
|
7dc05dc9ba548cc97ebe96ed1f0dab8dfe8d8b81
|
/tags/pida-0.3-beta/pida/utils/vim/vimcom.py
|
f6031dfe254889af96d35a70706ca8045d36f984
|
[] |
no_license
|
BackupTheBerlios/pida-svn
|
b68da6689fa482a42f5dee93e2bcffb167a83b83
|
739147ed21a23cab23c2bba98f1c54108f8c2516
|
refs/heads/master
| 2020-05-31T17:28:47.927074
| 2006-05-18T21:42:32
| 2006-05-18T21:42:32
| 40,817,392
| 1
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 25,519
|
py
|
# -*- coding: utf-8 -*-
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
#Copyright (c) 2005 Ali Afshar aafshar@gmail.com
#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.
"""
A library to control vim -g using its X protocol interface (with gdk).
== How it works ==
=== General Communication ===
The Vim client/server protocol communicates by sending messages to and from an
X communication window. The details are explained in the Vim source.
Essentially, Vim understands two sorts of messages over this interface.
;asynchronous key sends : that are exactly equivalent to to the user of the
remote Vim typing commands.
;synchronous expression evaluations : these are Vim expressions that are
evaluated by the remote Vim, and an answer is replied with the result over the
same protocol.
Although the synchronous messages are called synchronous, the reply itself, in
programming terms is entirely asynchronous, in that there is no way of knowing
when a reply will be received, and one cannot block for it.
Thus, this library allows you to make both of these calls to remote Vims.
Synchronous expressions must provide a call back function that will be called
when the message is replied to.
=== The Server List ===
(It has been an utter nightmare.)
The primary problem is that GTK does not actually know accurately whether
a window with a given window ID has been destroyed. This is how Vim does
it (using the X libraries) after checking an attribute for registered Vim
sessions with the X root window. This way each Vim doesn't need to
unregister itself with the X root window on dying, it just assumes that
any other client attempting to connect to it will know that the window
has been destroyed. As mentioned, GTK totally fails to do what the X
library does, and ascertain whether the window is alive. It succeeds
sometimes, but not at others. The result is a GDK window that appears
alive, and ready to communicate with, but which causes an uncatchable and
fatal application error.
Step in other potential methods of getting an accurate list of servers.
Firstly, and most obviously, one can call the command 'vim --serverlist'
on a simple system pipe and read the list off. This is entirely reliable,
and effective, but the cost of forking a process and starting Vim each
time is not fun, and effectively blocks.
Another option is to force users to start Vim through Pida and keep an
account of the child processes. This would work very effectively, but it
restricts the user, and the entire system.
The final, and current solution is to start Vim itself on a
pseudoterminal as a hidden instance, and then communicate with that over
the Vim protocol. The reason this can be reliably done, is that since the
process is a child, it can be polled to check whether it is alive. This
is performed each time the serverlist is requested, and if the hidden
instance has been destroyed (eg by the user) a new one is spawned, thus
preventing an attempt to communicate with an already-destroyed GDK
window.
The cost of this solution is that we spawn an extra Vim process. I
believe that the added solidity it brings to the entire system is easily
worth it, and it ensures that Pida can communicate with Vim it started
and Vim it didn't start.
"""
# Gtk imports
import gtk
import gobject
import gtk.gdk as gdk
# System imports
import os
import pty
import sys
import time
class poller(object):
"""
An instance of Vim on a pseudoterminal which can be reliably polled.
This class is used to provide an instance of Vim which can be communicated
with using the Vim client/server protocol, in order to retrieve an accurate
and current server list, and also which can be polled accurately as to
whether it is alive before communicating with it.
This method is much cheaper in resources than running vim --serverlist each
time, and much more accurate than using the root window's VimRegistry
property, and also more accurate than using GDK methods for assessing
whether a window is alive.
"""
def __init__(self):
"""
Constructor.
Create a temporary and unique name for use as the servername, and
initialise the instance variables.
@param cb: An instance of the main application class.
@type cb: pida.main.Application.
"""
# Prefacing with '__' means it will be ignored in the internal server
# list.
self.name = '__%s_PIDA_HIDDEN' % time.time()
# Checked to evaluate False on starting.
self.pid = None
def start(self):
"""
Start the Vim instance if it is not already running.
This command forks in a pseudoterminal, and starts Vim, if Vim is not
already running. The pid is stored for later use.
"""
if not self.pid:
# Get the console vim executable path
#command = self.prop_main_registry.commands.vim.value()
command = 'gvim'
# Fork using pty.fork to prevent Vim taking the terminal
sock = gtk.Socket()
w = gtk.Window()
w.realize()
w.add(sock)
xid = sock.get_id()
pid, fd = pty.fork()
if pid == 0:
# Child, execute Vim with the correct servername argument
os.execvp(command, ['gvim', '-f', '--servername', self.name,
'--socketid', '%s' % xid])
#'-v'])
# os.system('%s -v --servername %s' % (command, self.name))
else:
# Parent, store the pid, and file descriptor for later.
self.pid = pid
self.childfd = fd
#self.do_action('accountfork', self.pid)
def is_alive(self):
"""
Check if the Vim instance is alive.
This method uses os.waitpid, with no blocking to determine whether the
process is still alive. If it is not, it sets the internal pid
attribute to None, so that it may be restarted.
@returns: alive
@rtype alive: boolean
"""
if self.pid:
try:
# call os.waitpid, returns 0 if the pid is alive
pid, sts = os.waitpid(self.pid, os.WNOHANG)
except OSError:
# might still be starting up
return False
if pid == self.pid:
# has shut down
self.pid = None
return False
else:
# is still alive
return True
else:
# Not started yet
return False
class communication_window(gtk.Window):
"""
A GTK window that can communicate with any number Vim instances.
This is an actual GTK window (which it must be to accurately detect
property events inside the GTK main loop) but has its GDK window correctly
set to receive such events. This is notably the "Vim" property which must
be present and set to a version string, in this case "6.0" is used.
"""
def __init__(self, cb):
"""
Constructor.
The Window is instantiated, the properties are correctly set, the event
mask is modified, and the instance variables are initialized.
@param cb: An instance of the main Application class.
@type cb: pida.main.Application.
"""
gtk.Window.__init__(self)
self.cb = cb
# Window needs to be realized to do anything useful with it. Realizing
# does not show the window to the user, so we can use it, but not have
# an ugly blank frame while it loads.
self.realize()
# The "Vim" property
self.window.property_change("Vim", gdk.SELECTION_TYPE_STRING, 8,
gdk.PROP_MODE_REPLACE, "6.0")
# Set the correct event mask and connect the notify event
self.add_events(gtk.gdk.PROPERTY_CHANGE_MASK)
self.connect('property-notify-event', self.cb_notify)
# The serial number used for sending synchronous messages
self.serial = 1
# A dictionary of callbacks for synchronous messages. The key is the
# serial number, and the value is a callable that will be called with
# the result of the synchronous evaluation.
self.callbacks = {}
# A dictionary to store the working directories for each Vim so they
# only have to be fetched once.
self.server_cwds = {}
# A list of the last fetched server list, used todecide whther to feed
# the most recent server list to the client.
self.oldservers = None
# An instance of the root window, so it only has to be fetched once.
self.root_window = gdk.get_default_root_window()
# Instantiate and start the hidden communication window, used for
# fetching accurate and reliable server lists.
self.vim_hidden = poller()
self.vim_hidden.start()
# Start the timer for fetching the server list at the specified number
# of milliseconds (500).
gobject.timeout_add(1000, self.fetch_serverlist)
def fetch_serverlist(self):
"""
Fetch the serverlist, and if it has changed, feed it to the client.
The serverlist is requested asynchrnously, and passed the gotservers
function as a callback. The gotservers function is then called with the
server list, gets the appropriate working directory (if required) and
feeds the new server list to the client if it has changed.
"""
def gotservers(serverlist):
"""
Called back on receiving the serverlist.
Fetch working directories for new Vim instances, and feed the
server list to the client if it has changed.
"""
for server in serverlist:
# Check if we already have the working directory.
if server not in self.server_cwds:
# We don't, fetch it
self.fetch_cwd(server)
# Check if the server list has changed
if serverlist != self.oldservers:
self.oldservers = serverlist
# A ew serverlist to feed to the client.
self.feed_serverlist(serverlist)
# Fetch the server list from the hidden vim instance with the
# gotservers function as a callback.
self.get_hidden_serverlist(gotservers)
# Return True so that the timer continues
return True
def get_rootwindow_serverlist(self):
"""
Get the X root window's version of the current Vim serverlist.
On starting with the client-server feature, GVim or Vim with the
--servername option registers its server name and X window id as part
of the "VimRegistry" parameter on the X root window.
This method extracts and parses that property, and returns the server
list.
Note: Vim does not actually unregister itself with the root window on
dying, so the presence of a server in the root window list is no
gurantee that it is alive.
@return: servers
@rtype servers: dict of ("server", "window id") key, value
"""
servers = {}
# Read the property
vimregistry = self.root_window.property_get("VimRegistry")
# If it exists
if vimregistry:
# Get the list of servers by splitting with '\0'
vimservers = vimregistry[-1].split('\0')
# Parse each individual server and add to the results list
for rawserver in vimservers:
# Sometimes blank servers exist in the list
if rawserver:
# split the raw value for the name and id
name_id = rawserver.split()
# Set the value in the results dict, remembering to convert
# the window id to a long int.
servers[name_id[1]] = long(int(name_id[0], 16))
# return the list of resuts
return servers
def get_shell_serverlist(self):
"""
Get the server list by starting console Vim on a Pipe.
This blocks, so we don't use it. It is one of the alternative methods
of retrieving an accurate serverlist. It is slow, and expensive.
"""
vimcom = prop_main_registry.commands.vim_console.value()
p = os.popen('%s --serverlist' % vimcom)
servers = p.read()
p.close()
return servers.splitlines()
def get_hidden_serverlist(self, callbackfunc):
"""
Get the serverlist from the hidden Vim instance and call the callback
function with the results.
This method checks first whther the Vim instance is alive, and then
evaluates the serverlist() function remotely in it, with a local call
back function which parses the result and calls the user-provided
callback function.
@param callbackfunc: The call back function to be called with the
server list.
@type callbackfunc: callable
"""
def cb(serverstring):
"""
Called back with the raw server list.
Parse the lines and call the call back function, ignoring any
instances starting with "__" which represent hidden instances. If
the hidden Vim instance is not alive, it is restarted.
"""
servers = serverstring.splitlines()
# Call the callback function
callbackfunc([svr for svr in servers if not svr.startswith('__')])
# Check if the hidden Vim is alive.
if self.vim_hidden.is_alive():
# It is alive, get the serverlist.
self.send_expr(self.vim_hidden.name, 'serverlist()', cb)
else:
# It is not alive, restart it.
self.vim_hidden.start()
def get_server_wid(self, servername):
"""
Get the X Window id for a named Vim server.
This function returns the id from the root window server list, if it
exists, or None if it does not.
@param servername: The name of the server
@type servername: str
@return: wid
@rtype wid: long
"""
try:
# get the window id from the root window
wid = self.get_rootwindow_serverlist()[servername]
except KeyError:
# The server is not registered in the root window so return None
wid = None
# Return wid if it is not none, or None
return wid and long(wid) or None
def get_server_window(self, wid):
"""
Create and return a GDK window for a given window ID.
This method simply calls gdk.window_foreign_new, which should return
None if the window has been destroyed, but does not, in some cases.
@param wid: The window ID.
@type wid: long
"""
return gtk.gdk.window_foreign_new(wid)
def feed_serverlist(self, serverlist):
"""
Feed the given list of servers to the client.
This is achieved by calling the clients serverlist event. In Pida, this
event is passed on to all the plugins.
@param serverlist: The list of servers.
@type serverlist: list
"""
# Call the event.
#self.do_evt('serverlist', serverlist)
self.cb.vim_new_serverlist(serverlist)
def init_server(self, servername):
self.send_ex(servername, '%s' % VIMSCRIPT)
def fetch_cwd(self, servername):
"""
Fetch the working directory for a named server and store the result.
"""
def gotcwd(cwd):
"""
Called back on receiving the working directory, store it for later
use.
"""
self.server_cwds[servername] = cwd
# Evaluate the expression with the gotcwd callback
self.send_expr(servername, "getcwd()", gotcwd)
def get_cwd(self, server):
if server in self.server_cwds:
return self.server_cwds[server]
def abspath(self, servername, filename):
"""
Return the absolute path of a buffer name in the context of the named
server.
"""
# Only alter non-absolute paths
if not filename.startswith('/'):
try:
# Try to find the current working directory
cwd = self.server_cwds[servername]
except KeyError:
# The working directory is not set
# Use a sane default, and fetch it
cwd = os.path.expanduser('~')
self.fetch_cwd(servername)
filename = os.path.join(cwd, filename)
return filename
def generate_message(self, server, cork, message, sourceid):
"""
Generate a message.
"""
# Increment the serial number used for synchronous messages
if cork:
self.serial = self.serial + 1
# Pick an arbitrary number where we recycle.
if self.serial > 65530:
self.serial = 1
# return the generated string
return '\0%s\0-n %s\0-s %s\0-r %x %s\0' % (cork,
server,
message,
sourceid,
self.serial)
def parse_message(self, message):
"""
Parse a received message and return the message atributes as a
dictionary.
"""
messageattrs = {}
for t in [s.split(' ') for s in message.split('\0')]:
if t and len(t[0]):
if t[0].startswith('-'):
#attributes start with a '-', strip it and set the value
if len(t) > 1:
messageattrs[t[0][1:]] = t[1]
else:
# Otherwise set the t attribute
messageattrs['t'] = t[0]
return messageattrs
def send_message(self, servername, message, asexpr, callback):
wid = self.get_server_wid(servername)
if wid:
cork = (asexpr and 'c') or 'k'
sw = self.get_server_window(wid)
if sw and sw.property_get("Vim"):
mp = self.generate_message(servername, cork, message,
self.window.xid)
sw.property_change("Comm", gdk.TARGET_STRING, 8,
gdk.PROP_MODE_APPEND, mp)
if asexpr and callback:
self.callbacks['%s' % (self.serial)] = callback
def send_expr(self, server, message, callback):
self.send_message(server, message, True, callback)
def send_keys(self, server, message):
self.send_message(server, message, False, False)
def send_esc(self, server):
self.send_keys(server, '<C-\><C-N>')
def send_ret(self, server):
self.send_keys(server, '<RETURN>')
def send_ex(self, server, message):
self.send_esc(server)
self.send_keys(server, ':%s' % message)
self.send_ret(server)
def get_option(self, server, option, callbackfunc):
self.send_expr(server, '&%s' % option, callbackfunc)
def foreground(self, server):
def cb(*args):
pass
self.send_expr(server, 'foreground()', cb)
def change_buffer(self, server, filename):
self.send_ex(server, "exe 'b!'.bufnr('%s')" % filename)
def close_buffer(self, server, buffername):
self.send_ex(server, "exe 'confirm bw'.bufnr('%s')" % buffername)
def close_current_buffer(self, server):
self.send_ex(server, 'confirm bw')
def change_cursor(self, server, x, y):
self.send_message(server, 'cursor(%s, %s)' % (y, x), True, False)
self.send_esc(server)
def save_session(self, name):
self.send_ex('mks %s' % name)
def escape_filename(self, name):
for s in ['\\', '?', '*', ' ', "'", '"', '[', ' ', '$', '{', '}']:
name = name.replace (s, '\\%s' % s)
return name
def open_file(self, server, name):
self.send_ex(server, 'confirm e %s' % self.escape_filename(name))
def goto_line(self, server, linenumber):
self.send_ex(server, '%s' % linenumber)
self.send_esc(server)
self.send_keys(server, 'zv')
def revert(self, server):
self.send_ex(server, 'e')
def preview_file(self, server, fn):
self.send_ex(server, 'pc')
self.send_ex(server, 'set nopreviewwindow')
self.send_ex(server, 'pedit %s' % fn)
def get_bufferlist(self, server):
def cb(bl):
if bl:
l = [i.split(':') for i in bl.strip(';').split(';')]
L = []
for n in l:
if not n[0].startswith('E'):
L.append([n[0], self.abspath(server, n[1])])
self.do_evt('bufferlist', L)
#self.get_cwd(server)
self.send_expr(server, 'Bufferlist()', cb)
def get_current_buffer(self, server):
def cb(bs):
bn = bs.split(',')
bn[1] = self.abspath(server, bn[1])
self.do_evt('bufferchange', *bn)
#self.get_cwd(server)
self.send_expr(server, "bufnr('%').','.bufname('%')", cb)
def save(self, server):
self.send_ex(server, 'w')
def undo(self, server):
self.send_esc(server)
self.send_keys(server, 'u')
def redo(self, server):
self.send_esc(server)
self.send_keys(server, '<C-r>')
def cut(self, server):
self.send_keys(server, '"+x')
def copy(self, server):
self.send_keys(server, '"+y')
def paste(self, server):
self.send_esc(server)
self.send_keys(server, 'p')
def set_colorscheme(self, server, colorscheme):
self.send_ex(server, 'colorscheme %s' % colorscheme)
def quit(self, server):
self.send_ex(server, 'q')
def cb_notify(self, *a):
win, ev = a
if hasattr(ev, 'atom'):
if ev.atom == 'Comm':
message = self.window.property_get('Comm', pdelete=True)
if message:
self.cb_reply(message[-1])
return True
def cb_reply(self, data):
mdict = self.parse_message(data)
if mdict['t'] == 'r':
if mdict['s'] in self.callbacks:
self.callbacks[mdict['s']](mdict['r'])
else:
s = [t for t in data.split('\0') if t.startswith('-n')].pop()[3:]
self.cb_reply_async(s)
def cb_reply_async(self, data):
if data.count(':'):
server, data = data.split(':', 1)
else:
server = None
if data.count(','):
evt, d = data.split(',', 1)
self.vim_event(server, evt, d)
else:
print 'bad async reply', data
def vim_event(self, server, evt, d):
funcname = 'vim_%s' % evt
if hasattr(self.cb, funcname):
getattr(self.cb, funcname)(server, *d.split(','))
else:
print 'unhandled event', evt
NMAP_COM = '%smap %s :call %s<lt>CR>'
UNMAP_COM = '%sun %s'
VIMSCRIPT = ''':silent function! Bufferlist()
let i = 1
let max = bufnr('$') + 1
let lis = ""
while i < max
if bufexists(i)
let lis = lis.";".i.":".bufname(i)
endif
let i = i + 1
endwhile
return lis
endfunction
:silent function! Yank_visual()
y
return @"
endfunction
:silent function! Async_event(e)
let c = "call server2client('".expand('<client>')."', '".a:e."')"
try
exec c
catch /.*/
echo c
endtry
endfunction
:silent augroup pida
:set guioptions-=T
:set guioptions-=m
:silent au! pida
:silent au pida BufEnter * call Async_event(v:servername.":bufferchange,".getcwd().",".bufname('%'))
:silent au pida BufDelete * call Async_event(v:servername.":bufferunload,".expand('<amatch>'))
:silent au pida VimLeave * call Async_event(v:servername.":shutdown,")
:silent au pida VimEnter * call Async_event(v:servername.":started,")
:silent au pida BufWritePost * call Async_event(v:servername.":filesave,")
:echo "PIDA connected"
'''
|
[
"aafshar@ef0b12da-61f9-0310-ba38-b2629ec279a7"
] |
aafshar@ef0b12da-61f9-0310-ba38-b2629ec279a7
|
40f2752d77ccabe27f319e292703ae57571be5d9
|
7a3c194356437db110671ad163f03df1344a5e87
|
/code/utils/debug/processinfo.py
|
7eb8cf32210c745af00544bfa293ec2de1123e71
|
[
"MIT"
] |
permissive
|
dmytrov/gaussianprocess
|
6b181afdb989415ec929197cdb20efee571ebbcc
|
7044bd2d66f44e10656fee17e94fdee0c24c70bb
|
refs/heads/master
| 2022-12-08T22:23:11.850861
| 2020-09-14T19:37:33
| 2020-09-14T19:37:33
| 295,513,701
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 1,303
|
py
|
import os
import psutil
_proc_status = '/proc/%d/status' % os.getpid()
_scale = {'kB': 1024.0, 'mB': 1024.0*1024.0,
'KB': 1024.0, 'MB': 1024.0*1024.0}
def _VmB(VmKey):
'''Private.
'''
global _proc_status, _scale
# get pseudo file /proc/<pid>/status
try:
t = open(_proc_status)
v = t.read()
t.close()
except:
return 0.0 # non-Linux?
# get VmKey line e.g. 'VmRSS: 9999 kB\n ...'
i = v.index(VmKey)
v = v[i:].split(None, 3) # whitespace
if len(v) < 3:
return 0.0 # invalid format?
# convert Vm value to bytes
return float(v[1]) * _scale[v[2]]
def memory(since=0.0):
'''Return memory usage in bytes.
'''
return _VmB('VmSize:') - since
def resident(since=0.0):
'''Return resident memory usage in bytes.
'''
return _VmB('VmRSS:') - since
def stacksize(since=0.0):
'''Return stack size in bytes.
'''
return _VmB('VmStk:') - since
def print_meminfo(message=""):
'''Prints memory useage
'''
process = psutil.Process(os.getpid())
mem = process.memory_info()
print("|{} |PID: {} |rss: {}MB |vms: {}MB |".format(
message, process.pid, mem.rss / float(2**20), mem.vms / float(2**20)))
if __name__ == "__main__":
print_meminfo()
|
[
"dmytro.velychko@gmail.com"
] |
dmytro.velychko@gmail.com
|
ceb9352b0878dace0d3cd48be46ad14679a4847b
|
aec4fcd0361b9292c48178e5e77cab5df17f8f44
|
/DRL/Base.py
|
f90397ddb2603f156ecb04afe07cb33123db724e
|
[
"Apache-2.0"
] |
permissive
|
kbehouse/ezDRL
|
99bf2d1b37fceaa219651264c2f865ef3c70b146
|
1f8e5675780700d8e66f753fceac17c2b36fa56b
|
refs/heads/master
| 2021-08-24T12:39:48.804699
| 2017-12-05T09:05:53
| 2017-12-05T09:05:53
| 110,926,129
| 2
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 533
|
py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: DRL.py
# Description: Abstract Class For DRL Methods
# Author: Kartic <kbehouse@gmail.com>
import six
from abc import ABCMeta,abstractmethod
@six.add_metaclass(ABCMeta)
class RL(object):
@abstractmethod
def choose_action(self, state):
pass
@abstractmethod
def train(self, states, actions, rewards, next_state, done):
pass
@six.add_metaclass(ABCMeta)
class DRL(RL):
@abstractmethod
def _build_net(self, msg):
pass
|
[
"kbehouse@gmail.com"
] |
kbehouse@gmail.com
|
c858313d78d4f1f97702e366a93be4fd43b773ca
|
22f1c0d8406be377e588ac0eaeea7bd19385156c
|
/src/zeep/wsdl/attachments.py
|
6a85312813d7e7288a0ade3ed9b22b4bc7827ab0
|
[
"BSD-3-Clause",
"MIT"
] |
permissive
|
mbehrle/python-zeep
|
999be22a91f6df04b995b823dc68ae83953fb046
|
5921b047d4fda2d87d9ab178fd37ef77d70d1a1f
|
refs/heads/master
| 2021-01-23T08:04:47.801530
| 2017-01-31T11:39:47
| 2017-01-31T11:39:47
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 1,727
|
py
|
"""Basic implementation to support SOAP-Attachments
See https://www.w3.org/TR/SOAP-attachments
"""
import base64
from cached_property import cached_property
from requests.structures import CaseInsensitiveDict
class MessagePack(object):
def __init__(self, parts):
self._parts = parts
def __repr__(self):
return '<MessagePack(attachments=[%s])>' % (
', '.join(repr(a) for a in self.attachments))
@property
def root(self):
return self._root
def _set_root(self, root):
self._root = root
@cached_property
def attachments(self):
return [Attachment(part) for part in self._parts]
def get_by_content_id(self, content_id):
for attachment in self.attachments:
if attachment.content_id == content_id:
return attachment
class Attachment(object):
def __init__(self, part):
self.headers = CaseInsensitiveDict({
k.decode(part.encoding): v.decode(part.encoding)
for k, v in part.headers.items()
})
self.content_type = self.headers.get('Content-Type', None)
self.content_id = self.headers.get('Content-ID', None)
self.content_location = self.headers.get('Content-Location', None)
self._part = part
def __repr__(self):
return '<Attachment(%r, %r)>' % (self.content_id, self.content_type)
@cached_property
def content(self):
encoding = self.headers.get('Content-Transfer-Encoding', None)
content = self._part.content
if encoding == 'base64':
return base64.b64decode(content)
elif encoding == 'binary':
return content
else:
return content
|
[
"michael@mvantellingen.nl"
] |
michael@mvantellingen.nl
|
c0f1f52cd692bb07290aa056b772de8af1130bde
|
6e1aa6cfe11a93740cdbc9503d992769ced8879b
|
/tests/test_column_inclusion_and_exclusion.py
|
c58313a1b040dd81981afb2faf5082b2e5c0d84b
|
[] |
no_license
|
dtheodor/sqlalchemy-continuum
|
04008d03209a1df930037e324e3f666a10a8abfc
|
22dbc811ac3a67d883da6b47584992d6dd22b20c
|
refs/heads/master
| 2021-01-22T16:32:22.137475
| 2014-10-23T09:55:15
| 2014-10-23T09:55:15
| 17,176,669
| 1
| 1
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 3,756
|
py
|
from datetime import datetime
from pytest import mark
import sqlalchemy as sa
from sqlalchemy_utils import TSVectorType
from sqlalchemy_continuum import version_class
from tests import TestCase
class TestDateTimeColumnExclusion(TestCase):
def create_models(self):
class Article(self.Model):
__tablename__ = 'article'
__versioned__ = {}
id = sa.Column(sa.Integer, autoincrement=True, primary_key=True)
name = sa.Column(sa.Unicode(255))
created_at = sa.Column(sa.DateTime, default=datetime.now)
creation_date = sa.Column(
sa.Date, default=lambda: datetime.now().date
)
is_deleted = sa.Column(sa.Boolean, default=False)
self.Article = Article
def test_datetime_columns_with_defaults_excluded_by_default(self):
assert (
'created_at' not in
version_class(self.Article).__table__.c
)
def test_date_columns_with_defaults_excluded_by_default(self):
assert (
'creation_date' not in
version_class(self.Article).__table__.c
)
def test_datetime_exclusion_only_applies_to_datetime_types(self):
assert (
'is_deleted' in
version_class(self.Article).__table__.c
)
@mark.skipif("os.environ.get('DB') != 'postgres'")
class TestTSVectorTypeColumnExclusion(TestCase):
def create_models(self):
class Article(self.Model):
__tablename__ = 'article'
__versioned__ = {}
id = sa.Column(sa.Integer, autoincrement=True, primary_key=True)
name = sa.Column(sa.Unicode(255))
search_vector = sa.Column(TSVectorType)
self.Article = Article
def test_tsvector_typed_columns_excluded_by_default(self):
assert (
'search_vector' not in
version_class(self.Article).__table__.c
)
class TestDateTimeColumnInclusion(TestCase):
def create_models(self):
class Article(self.Model):
__tablename__ = 'article'
__versioned__ = {
'include': 'created_at'
}
id = sa.Column(sa.Integer, autoincrement=True, primary_key=True)
name = sa.Column(sa.Unicode(255))
created_at = sa.Column(sa.DateTime, default=datetime.now)
self.Article = Article
def test_datetime_columns_with_defaults_excluded_by_default(self):
assert (
'created_at' in
version_class(self.Article).__table__.c
)
class TestColumnExclusion(TestCase):
def create_models(self):
class TextItem(self.Model):
__tablename__ = 'text_item'
__versioned__ = {
'exclude': ['content']
}
id = sa.Column(sa.Integer, autoincrement=True, primary_key=True)
name = sa.Column(sa.Unicode(255))
content = sa.Column(sa.UnicodeText)
self.TextItem = TextItem
def test_excluded_columns_not_included_in_version_class(self):
cls = version_class(self.TextItem)
manager = cls._sa_class_manager
assert 'content' not in manager.keys()
def test_versioning_with_column_exclusion(self):
item = self.TextItem(name=u'Some textitem', content=u'Some content')
self.session.add(item)
self.session.commit()
assert item.versions[0].name == u'Some textitem'
def test_does_not_create_record_if_only_excluded_column_updated(self):
item = self.TextItem(name=u'Some textitem')
self.session.add(item)
self.session.commit()
item.content = u'Some content'
self.session.commit()
assert item.versions.count() == 1
|
[
"konsta.vesterinen@gmail.com"
] |
konsta.vesterinen@gmail.com
|
e7ddcd552498cbe765297207ca4a34a3c67db2fb
|
ca7aa979e7059467e158830b76673f5b77a0f5a3
|
/Python_codes/p02701/s242297727.py
|
e7da1f305d5ad6905547828c4e9054a527b18b00
|
[] |
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
| 96
|
py
|
n=int(input())
l=[]
for i in range(n):
s=str(input())
l.append(s)
k=set(l)
print(len(k))
|
[
"66529651+Aastha2104@users.noreply.github.com"
] |
66529651+Aastha2104@users.noreply.github.com
|
200adc49c9d7032f1d19d9caec3133ac4ebf1673
|
54f352a242a8ad6ff5516703e91da61e08d9a9e6
|
/Source Codes/AtCoder/arc098/C/3270864.py
|
5c62ff7a855a8056aab79c2b97f8d36d0b122b1f
|
[] |
no_license
|
Kawser-nerd/CLCDSA
|
5cbd8a4c3f65173e4e8e0d7ed845574c4770c3eb
|
aee32551795763b54acb26856ab239370cac4e75
|
refs/heads/master
| 2022-02-09T11:08:56.588303
| 2022-01-26T18:53:40
| 2022-01-26T18:53:40
| 211,783,197
| 23
| 9
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 802
|
py
|
from collections import defaultdict
N, K, Q = map(int, input().split())
A = list(map(int, input().split()))
A_sorted = sorted(A)
ans = float("inf")
ap = 0
for i, a in enumerate(A_sorted):
if a==ap:
continue
ap = a
L = [0]
d = defaultdict(list)
for aa in A:
if aa < a:
if L[-1]==0:
continue
else:
L.append(0)
else:
L[-1]+=1
d[aa].append(len(L)-1)
cnt = 0
aap = 0
for aa in A_sorted[i:]:
if aap==aa: continue
aap = aa
for v in d[aa]:
if L[v] >= K:
L[v] -= 1
cnt += 1
if cnt >= Q:
break
else:
break
ans = min(ans, aa-a)
print(ans)
|
[
"kwnafi@yahoo.com"
] |
kwnafi@yahoo.com
|
3a735af93117f64efe81849413af4f3138ba8356
|
9cb7670c64c13f09abee315f85f1f6b67b8eb1ad
|
/ptp/components/language/sentence_one_hot_encoder.py
|
3996236c4d9b703946b38c4f4760c5c9e33b0c2a
|
[
"Apache-2.0"
] |
permissive
|
ConnectionMaster/pytorchpipe
|
057325a5d4e8e6ce2198a953a705721388531add
|
9cb17271666061cb19fe24197ecd5e4c8d32c5da
|
refs/heads/develop
| 2023-04-07T17:46:26.451692
| 2019-11-05T23:36:13
| 2019-11-05T23:36:13
| 183,084,219
| 1
| 0
|
Apache-2.0
| 2023-04-03T23:18:43
| 2019-04-23T19:38:29
|
Python
|
UTF-8
|
Python
| false
| false
| 4,091
|
py
|
# Copyright (C) tkornuta, IBM Corporation 2019
#
# 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.
__author__ = "Tomasz Kornuta"
import torch
from ptp.components.component import Component
from ptp.components.mixins.word_mappings import WordMappings
from ptp.data_types.data_definition import DataDefinition
class SentenceOneHotEncoder(Component, WordMappings):
"""
Class responsible for encoding of samples being sequences of words using 1-hot encoding.
"""
def __init__(self, name, config):
"""
Initializes the component.
:param name: Component name (read from configuration file).
:type name: str
:param config: Dictionary of parameters (read from the configuration ``.yaml`` file).
:type config: :py:class:`ptp.configuration.ConfigInterface`
"""
# Call constructor(s) of parent class(es) - in the right order!
Component.__init__(self, name, SentenceOneHotEncoder, config)
WordMappings.__init__(self)
# Set key mappings.
self.key_inputs = self.stream_keys["inputs"]
self.key_outputs = self.stream_keys["outputs"]
def input_data_definitions(self):
"""
Function returns a dictionary with definitions of input data that are required by the component.
:return: dictionary containing input data definitions (each of type :py:class:`ptp.utils.DataDefinition`).
"""
return {
self.key_inputs: DataDefinition([-1, -1, 1], [list, list, str], "Batch of sentences, each represented as a list of words [BATCH_SIZE] x [SEQ_LENGTH] x [string]"),
}
def output_data_definitions(self):
"""
Function returns a dictionary with definitions of output data produced the component.
:return: dictionary containing output data definitions (each of type :py:class:`ptp.utils.DataDefinition`).
"""
return {
self.key_outputs: DataDefinition([-1, -1, len(self.word_to_ix)], [list, list, torch.Tensor], "Batch of sentences, each represented as a list of vectors [BATCH_SIZE] x [SEQ_LENGTH] x [VOCABULARY_SIZE]"),
}
def __call__(self, data_streams):
"""
Encodes "inputs" in the format of list of tokens (for a single sample)
Stores result in "encoded_inputs" field of in data_streams.
:param data_streams: :py:class:`ptp.utils.DataStreams` object containing (among others):
- "inputs": expected input field containing list of words [BATCH_SIZE] x [SEQ_SIZE] x [string]
- "encoded_targets": added output field containing list of indices [BATCH_SIZE] x [SEQ_SIZE] x [VOCABULARY_SIZE1]
"""
# Get inputs to be encoded.
inputs = data_streams[self.key_inputs]
outputs_list = []
# Process samples 1 by one.
for sample in inputs:
assert isinstance(sample, (list,)), 'This encoder requires input sample to contain a list of words'
# Process list.
output_sample = []
# Encode sample (list of words)
for token in sample:
# Create empty vector.
output_token = torch.zeros(len(self.word_to_ix)).type(self.app_state.FloatTensor)
# Add one for given word
output_token[self.word_to_ix[token]] += 1
# Add to outputs.
output_sample.append( output_token )
outputs_list.append(output_sample)
# Create the returned dict.
data_streams.publish({self.key_outputs: outputs_list})
|
[
"tkornut@us.ibm.com"
] |
tkornut@us.ibm.com
|
ff6ed44e73bac7a6b62db504dd1009a7c10746ca
|
2e682fd72e3feaa70e3f7bf2a3b83c50d783ec02
|
/PyTorch/contrib/cv/video/I3D/mmaction/datasets/__init__.py
|
f04440bfbd5b1cb1aa81e8b37daed35a0a8f87cc
|
[
"GPL-1.0-or-later",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
Ascend/ModelZoo-PyTorch
|
4c89414b9e2582cef9926d4670108a090c839d2d
|
92acc188d3a0f634de58463b6676e70df83ef808
|
refs/heads/master
| 2023-07-19T12:40:00.512853
| 2023-07-17T02:48:18
| 2023-07-17T02:48:18
| 483,502,469
| 23
| 6
|
Apache-2.0
| 2022-10-15T09:29:12
| 2022-04-20T04:11:18
|
Python
|
UTF-8
|
Python
| false
| false
| 1,922
|
py
|
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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 .activitynet_dataset import ActivityNetDataset
from .audio_dataset import AudioDataset
from .audio_feature_dataset import AudioFeatureDataset
from .audio_visual_dataset import AudioVisualDataset
from .ava_dataset import AVADataset
from .base import BaseDataset
from .blending_utils import (BaseMiniBatchBlending, CutmixBlending,
MixupBlending)
from .builder import (BLENDINGS, DATASETS, PIPELINES, build_dataloader,
build_dataset)
from .dataset_wrappers import RepeatDataset
from .hvu_dataset import HVUDataset
from .image_dataset import ImageDataset
from .pose_dataset import PoseDataset
from .rawframe_dataset import RawframeDataset
from .rawvideo_dataset import RawVideoDataset
from .ssn_dataset import SSNDataset
from .video_dataset import VideoDataset
__all__ = [
'VideoDataset', 'build_dataloader', 'build_dataset', 'RepeatDataset',
'RawframeDataset', 'BaseDataset', 'ActivityNetDataset', 'SSNDataset',
'HVUDataset', 'AudioDataset', 'AudioFeatureDataset', 'ImageDataset',
'RawVideoDataset', 'AVADataset', 'AudioVisualDataset',
'BaseMiniBatchBlending', 'CutmixBlending', 'MixupBlending', 'DATASETS',
'PIPELINES', 'BLENDINGS', 'PoseDataset'
]
|
[
"wangjiangben@huawei.com"
] |
wangjiangben@huawei.com
|
d8751d6aed8551800d5fa2b4ca68e98c118d9357
|
284b8949a5e8a65d791bc8b6531fb4029100f798
|
/02281043.py
|
511423569a2e60d8b6f61d89283604c871259bad
|
[] |
no_license
|
Yanl05/Crawler
|
3ce19be3a041b9db0a2fa5e340f4e9aa37593e4c
|
af1c34b9e28b24740e090415a45c0ee808d058ab
|
refs/heads/master
| 2020-04-09T16:35:22.272829
| 2018-12-05T04:25:39
| 2018-12-05T04:25:39
| 160,457,052
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 146
|
py
|
class Car:
color = ''
def run(self):
print('go go go!!')
bmw = Car()
bmw.color = 'red'
print(bmw.color)
bmw.run()
print(bmw.run)
|
[
"756593069@qq.com"
] |
756593069@qq.com
|
eeeff347b088cf7928a142ac122aa3e6ebe54d89
|
6f5b8fa3693be70f258e1a74f4874d02fdb105a6
|
/asdl/__init__.py
|
5dde4913227376aa52bf3e5eb64c1cadab4fcc40
|
[
"Apache-2.0"
] |
permissive
|
ionutzzu12/external-knowledge-codegen
|
fb02823516e14f19d171928d88588623631d2963
|
3f96ee7c4a50cdd8649e564115dbe96bff059d87
|
refs/heads/master
| 2023-02-24T12:22:55.962963
| 2020-06-06T08:34:54
| 2020-06-06T08:34:54
| 262,047,517
| 0
| 0
|
Apache-2.0
| 2020-06-06T08:34:55
| 2020-05-07T12:43:54
|
Python
|
UTF-8
|
Python
| false
| false
| 334
|
py
|
import six
from .lang.lambda_dcs.lambda_dcs_transition_system import LambdaCalculusTransitionSystem
from .lang.prolog.prolog_transition_system import PrologTransitionSystem
if six.PY2:
from .lang.py.py_transition_system import PythonTransitionSystem
else:
from .lang.py3.py3_transition_system import Python3TransitionSystem
|
[
"frankxu2004@gmail.com"
] |
frankxu2004@gmail.com
|
f096db4e0465a06313aac4158d17fc71858461ba
|
9c6522db2db8c4c075e23f2953776384973891a8
|
/cn.ao/py.ori.fmt/c0240.bin.py
|
b84a47f24b78588d5c96576409ea5e614e5939ed
|
[] |
no_license
|
ZhenjianYang/ZeroAoVoiceScripts
|
b388c28b498049d7d4277b8344cdc098488fd258
|
7e0b696d743912739b855acb4306f1dcf564d6c0
|
refs/heads/master
| 2021-05-18T08:58:59.482674
| 2021-02-19T08:22:19
| 2021-02-19T08:22:19
| 94,624,272
| 12
| 5
| null | 2021-02-19T08:22:20
| 2017-06-17T13:06:15
|
Python
|
UTF-8
|
Python
| false
| false
| 111,926
|
py
|
from ScenarioHelper import *
def main():
CreateScenaFile(
"c0240.bin", # FileName
"c0240", # MapName
"c0240", # Location
0x000F, # MapIndex
"ed7150",
0x00002000, # Flags
("", "", "", "", "", ""), # include
0x00, # PlaceNameNumber
0x00, # PreInitFunctionIndex
b'\x00\xff\xff', # Unknown_51
# Information
[0, 0, -1000, 0, 0, 0, 24000, 500, 30, 45, 0, 360, 0, 0, 0, 0, 0, 1, 15, 0, 3, 0, 4],
)
BuildStringList((
"c0240", # 0
"萨米", # 1
"金德尔", # 2
"布里吉塔", # 3
"卢威克老人", # 4
"奥丽加夫人", # 5
"伊莉娅", # 6
"修利", # 7
"阿鲁姆", # 8
"艾娅莉", # 9
"庞斯", # 10
))
AddCharChip((
"chr/ch25600.itc", # 00
"chr/ch21800.itc", # 01
"chr/ch21802.itc", # 02
"chr/ch20300.itc", # 03
"chr/ch21600.itc", # 04
"chr/ch21602.itc", # 05
"chr/ch20100.itc", # 06
"chr/ch20102.itc", # 07
"chr/ch05100.itc", # 08
"chr/ch10002.itc", # 09
"chr/ch46300.itc", # 0A
"chr/ch46200.itc", # 0B
"chr/ch20200.itc", # 0C
))
DeclNpc(9060, 10000, 18000, 45, 261, 0x0, 0, 0, 0, 0, 0, 0, 5, 255, 0)
DeclNpc(-2009, 1149, 60479, 270, 261, 0x0, 0, 1, 0, 0, 0, 0, 6, 255, 0)
DeclNpc(8470, 1019, 62380, 0, 261, 0x0, 0, 3, 0, 0, 0, 0, 7, 255, 0)
DeclNpc(-45650, 1019, 60169, 180, 261, 0x0, 0, 4, 0, 0, 2, 0, 8, 255, 0)
DeclNpc(7030, 150, 6969, 180, 261, 0x0, 0, 6, 0, 0, 0, 0, 10, 255, 0)
DeclNpc(54020, 1019, 60490, 270, 261, 0x0, 0, 8, 0, 0, 0, 0, 16, 255, 0)
DeclNpc(52540, 1149, 60540, 270, 261, 0x0, 0, 9, 0, 255, 255, 0, 15, 255, 0)
DeclNpc(-45360, 1029, 61159, 135, 389, 0x0, 0, 10, 0, 0, 0, 0, 11, 255, 0)
DeclNpc(-46959, 1049, 60360, 180, 389, 0x0, 0, 11, 0, 0, 0, 0, 12, 255, 0)
DeclNpc(-15119, 0, 5829, 270, 389, 0x0, 0, 12, 0, 0, 0, 0, 14, 255, 0)
DeclActor(-340, 10000, 20320, 1200, -340, 11500, 20320, 0x007C, 0, 18, 0x0000)
ChipFrameInfo(596, 0) # 0
ScpFunction((
"Function_0_254", # 00, 0
"Function_1_304", # 01, 1
"Function_2_32F", # 02, 2
"Function_3_35A", # 03, 3
"Function_4_731", # 04, 4
"Function_5_7DC", # 05, 5
"Function_6_17AC", # 06, 6
"Function_7_2653", # 07, 7
"Function_8_3093", # 08, 8
"Function_9_380D", # 09, 9
"Function_10_38F7", # 0A, 10
"Function_11_40DC", # 0B, 11
"Function_12_4110", # 0C, 12
"Function_13_4160", # 0D, 13
"Function_14_430E", # 0E, 14
"Function_15_4370", # 0F, 15
"Function_16_449F", # 10, 16
"Function_17_4631", # 11, 17
"Function_18_4F89", # 12, 18
"Function_19_5276", # 13, 19
))
def Function_0_254(): pass
label("Function_0_254")
Switch(
(scpexpr(EXPR_RAND), scpexpr(EXPR_PUSH_LONG, 0x8), scpexpr(EXPR_IMOD), scpexpr(EXPR_END)),
(0, "loc_28C"),
(1, "loc_298"),
(2, "loc_2A4"),
(3, "loc_2B0"),
(4, "loc_2BC"),
(5, "loc_2C8"),
(6, "loc_2D4"),
(SWITCH_DEFAULT, "loc_2E0"),
)
label("loc_28C")
OP_A0(0xFE, 1450, 0x0, 0xFB)
Jump("loc_2EC")
label("loc_298")
OP_A0(0xFE, 1550, 0x0, 0xFB)
Jump("loc_2EC")
label("loc_2A4")
OP_A0(0xFE, 1600, 0x0, 0xFB)
Jump("loc_2EC")
label("loc_2B0")
OP_A0(0xFE, 1400, 0x0, 0xFB)
Jump("loc_2EC")
label("loc_2BC")
OP_A0(0xFE, 1650, 0x0, 0xFB)
Jump("loc_2EC")
label("loc_2C8")
OP_A0(0xFE, 1350, 0x0, 0xFB)
Jump("loc_2EC")
label("loc_2D4")
OP_A0(0xFE, 1500, 0x0, 0xFB)
Jump("loc_2EC")
label("loc_2E0")
OP_A0(0xFE, 1500, 0x0, 0xFB)
Jump("loc_2EC")
label("loc_2EC")
Jc((scpexpr(EXPR_PUSH_LONG, 0x1), scpexpr(EXPR_END)), "loc_303")
OP_A0(0xFE, 1500, 0x0, 0xFB)
Jump("loc_2EC")
label("loc_303")
Return()
# Function_0_254 end
def Function_1_304(): pass
label("Function_1_304")
Jc((scpexpr(EXPR_PUSH_LONG, 0x1), scpexpr(EXPR_END)), "loc_32E")
OP_94(0xFE, 0xFFFFF858, 0x2A44, 0x866, 0x311A, 0x3E8)
Sleep(300)
Jump("Function_1_304")
label("loc_32E")
Return()
# Function_1_304 end
def Function_2_32F(): pass
label("Function_2_32F")
Jc((scpexpr(EXPR_PUSH_LONG, 0x1), scpexpr(EXPR_END)), "loc_359")
OP_94(0xFE, 0xFFFF4C46, 0xE4C0, 0xFFFF592A, 0xF078, 0x3E8)
Sleep(300)
Jump("Function_2_32F")
label("loc_359")
Return()
# Function_2_32F end
def Function_3_35A(): pass
label("Function_3_35A")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x1A7, 1)), scpexpr(EXPR_END)), "loc_38A")
SetChrChipByIndex(0x9, 0x2)
SetChrSubChip(0x9, 0x0)
EndChrThread(0x9, 0x0)
SetChrBattleFlags(0x9, 0x4)
SetChrChipByIndex(0xC, 0x7)
SetChrSubChip(0xC, 0x0)
EndChrThread(0xC, 0x0)
SetChrBattleFlags(0xC, 0x4)
Jump("loc_730")
label("loc_38A")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x1A5, 3)), scpexpr(EXPR_END)), "loc_3E1")
SetChrChipByIndex(0x9, 0x2)
SetChrSubChip(0x9, 0x0)
EndChrThread(0x9, 0x0)
SetChrBattleFlags(0x9, 0x4)
SetChrChipByIndex(0xC, 0x7)
SetChrSubChip(0xC, 0x0)
EndChrThread(0xC, 0x0)
SetChrBattleFlags(0xC, 0x4)
SetChrPos(0x8, 2310, 0, 1000, 225)
ClearChrFlags(0x11, 0x80)
SetChrPos(0x11, 1570, 0, 1740, 225)
Jump("loc_730")
label("loc_3E1")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x182, 1)), scpexpr(EXPR_END)), "loc_416")
SetChrChipByIndex(0x9, 0x2)
SetChrSubChip(0x9, 0x0)
EndChrThread(0x9, 0x0)
SetChrBattleFlags(0x9, 0x4)
SetChrFlags(0xB, 0x80)
SetChrPos(0xC, -39810, 1030, 62640, 0)
Jump("loc_730")
label("loc_416")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x180, 2)), scpexpr(EXPR_END)), "loc_446")
SetChrChipByIndex(0x9, 0x2)
SetChrSubChip(0x9, 0x0)
EndChrThread(0x9, 0x0)
SetChrBattleFlags(0x9, 0x4)
SetChrChipByIndex(0xC, 0x7)
SetChrSubChip(0xC, 0x0)
EndChrThread(0xC, 0x0)
SetChrBattleFlags(0xC, 0x4)
Jump("loc_730")
label("loc_446")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x165, 5)), scpexpr(EXPR_END)), "loc_485")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 1)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_45E")
SetChrFlags(0x9, 0x10)
label("loc_45E")
SetChrChipByIndex(0x9, 0x2)
SetChrSubChip(0x9, 0x0)
EndChrThread(0x9, 0x0)
SetChrBattleFlags(0x9, 0x4)
SetChrChipByIndex(0xC, 0x7)
SetChrSubChip(0xC, 0x0)
EndChrThread(0xC, 0x0)
SetChrBattleFlags(0xC, 0x4)
Jump("loc_730")
label("loc_485")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x164, 0)), scpexpr(EXPR_END)), "loc_4EF")
SetChrChipByIndex(0x9, 0x2)
SetChrSubChip(0x9, 0x0)
EndChrThread(0x9, 0x0)
SetChrBattleFlags(0x9, 0x4)
SetChrChipByIndex(0xC, 0x7)
SetChrSubChip(0xC, 0x0)
EndChrThread(0xC, 0x0)
SetChrBattleFlags(0xC, 0x4)
ClearChrFlags(0xF, 0x80)
ClearChrFlags(0x10, 0x80)
SetChrPos(0xB, -44550, 1020, 59150, 315)
BeginChrThread(0xB, 0, 0, 0)
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 3)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_4EA")
SetChrFlags(0xF, 0x10)
SetChrFlags(0x10, 0x10)
SetChrFlags(0xB, 0x10)
label("loc_4EA")
Jump("loc_730")
label("loc_4EF")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x162, 5)), scpexpr(EXPR_END)), "loc_52E")
SetChrChipByIndex(0x9, 0x2)
SetChrSubChip(0x9, 0x0)
EndChrThread(0x9, 0x0)
SetChrBattleFlags(0x9, 0x4)
SetChrFlags(0xA, 0x10)
SetChrPos(0xA, 5740, 1000, 62320, 0)
SetChrFlags(0xB, 0x80)
SetChrFlags(0xC, 0x80)
Jump("loc_730")
label("loc_52E")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x162, 0)), scpexpr(EXPR_END)), "loc_568")
SetChrPos(0x8, -52720, 1000, 63170, 0)
SetChrChipByIndex(0x9, 0x2)
SetChrSubChip(0x9, 0x0)
EndChrThread(0x9, 0x0)
SetChrBattleFlags(0x9, 0x4)
SetChrFlags(0xB, 0x80)
SetChrFlags(0xC, 0x80)
Jump("loc_730")
label("loc_568")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x160, 0)), scpexpr(EXPR_END)), "loc_598")
SetChrChipByIndex(0x9, 0x2)
SetChrSubChip(0x9, 0x0)
EndChrThread(0x9, 0x0)
SetChrBattleFlags(0x9, 0x4)
SetChrChipByIndex(0xC, 0x7)
SetChrSubChip(0xC, 0x0)
EndChrThread(0xC, 0x0)
SetChrBattleFlags(0xC, 0x4)
Jump("loc_730")
label("loc_598")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x141, 5)), scpexpr(EXPR_END)), "loc_5C8")
SetChrChipByIndex(0x9, 0x2)
SetChrSubChip(0x9, 0x0)
EndChrThread(0x9, 0x0)
SetChrBattleFlags(0x9, 0x4)
SetChrChipByIndex(0xC, 0x7)
SetChrSubChip(0xC, 0x0)
EndChrThread(0xC, 0x0)
SetChrBattleFlags(0xC, 0x4)
Jump("loc_730")
label("loc_5C8")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x141, 0)), scpexpr(EXPR_END)), "loc_635")
SetChrChipByIndex(0x9, 0x2)
SetChrSubChip(0x9, 0x0)
EndChrThread(0x9, 0x0)
SetChrBattleFlags(0x9, 0x4)
SetChrChipByIndex(0xB, 0x5)
SetChrSubChip(0xB, 0x0)
EndChrThread(0xB, 0x0)
SetChrBattleFlags(0xB, 0x4)
SetChrFlags(0xB, 0x10)
SetChrPos(0xB, -48700, 1200, 60400, 270)
SetChrChipByIndex(0xC, 0x7)
SetChrSubChip(0xC, 0x0)
EndChrThread(0xC, 0x0)
SetChrBattleFlags(0xC, 0x4)
SetChrFlags(0xC, 0x10)
SetChrPos(0xC, -51460, 1200, 60400, 90)
Jump("loc_730")
label("loc_635")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x140, 4)), scpexpr(EXPR_END)), "loc_68F")
SetChrFlags(0x9, 0x80)
SetChrChipByIndex(0xC, 0x7)
SetChrSubChip(0xC, 0x0)
EndChrThread(0xC, 0x0)
SetChrBattleFlags(0xC, 0x4)
SetChrPos(0xC, -51460, 1200, 60400, 90)
SetChrFlags(0xB, 0x80)
ClearChrFlags(0xD, 0x80)
ClearChrFlags(0xE, 0x80)
SetChrChipByIndex(0xE, 0x9)
SetChrSubChip(0xE, 0x0)
EndChrThread(0xE, 0x0)
SetChrBattleFlags(0xE, 0x4)
SetChrFlags(0xE, 0x10)
Jump("loc_730")
label("loc_68F")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x140, 0)), scpexpr(EXPR_END)), "loc_6BF")
SetChrChipByIndex(0x9, 0x2)
SetChrSubChip(0x9, 0x0)
EndChrThread(0x9, 0x0)
SetChrBattleFlags(0x9, 0x4)
SetChrChipByIndex(0xC, 0x7)
SetChrSubChip(0xC, 0x0)
EndChrThread(0xC, 0x0)
SetChrBattleFlags(0xC, 0x4)
Jump("loc_730")
label("loc_6BF")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x128, 1)), scpexpr(EXPR_END)), "loc_6EF")
SetChrChipByIndex(0x9, 0x2)
SetChrSubChip(0x9, 0x0)
EndChrThread(0x9, 0x0)
SetChrBattleFlags(0x9, 0x4)
SetChrChipByIndex(0xC, 0x7)
SetChrSubChip(0xC, 0x0)
EndChrThread(0xC, 0x0)
SetChrBattleFlags(0xC, 0x4)
Jump("loc_730")
label("loc_6EF")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x126, 1)), scpexpr(EXPR_END)), "loc_730")
SetChrChipByIndex(0x9, 0x2)
SetChrSubChip(0x9, 0x0)
EndChrThread(0x9, 0x0)
SetChrBattleFlags(0x9, 0x4)
SetChrFlags(0xB, 0x80)
SetChrChipByIndex(0xC, 0x7)
SetChrSubChip(0xC, 0x0)
EndChrThread(0xC, 0x0)
SetChrBattleFlags(0xC, 0x4)
SetChrPos(0xC, -51460, 1200, 60400, 90)
label("loc_730")
Return()
# Function_3_35A end
def Function_4_731(): pass
label("Function_4_731")
ClearMapObjFlags(0x2, 0x10)
OP_66(0x0, 0x1)
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x141, 0)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x140, 4)), scpexpr(EXPR_NEQUZ_I64), scpexpr(EXPR_END)), "loc_753")
OP_65(0x0, 0x1)
SetMapObjFlags(0x2, 0x10)
label("loc_753")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x164, 0)), scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x165, 2)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_NEQUZ_I64), scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x128, 1)), scpexpr(EXPR_PUSH_VALUE_INDEX, 0x4), scpexpr(EXPR_PUSH_LONG, 0x1), scpexpr(EXPR_EQU), scpexpr(EXPR_NEQUZ_I64), scpexpr(EXPR_OR), scpexpr(EXPR_END)), "loc_79C")
SetMapObjFrame(0xFF, "hikari00_add", 0x0, 0x1)
SetMapObjFrame(0xFF, "hikari01_add", 0x0, 0x1)
Sound(128, 1, 50, 0)
label("loc_79C")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x1A7, 1)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x1A5, 2)), scpexpr(EXPR_NEQUZ_I64), scpexpr(EXPR_END)), "loc_7DB")
OP_7D(0xD2, 0xD2, 0xE6, 0x0, 0x0)
SetMapObjFrame(0xFF, "hikari00_add", 0x0, 0x1)
SetMapObjFrame(0xFF, "hikari01_add", 0x0, 0x1)
label("loc_7DB")
Return()
# Function_4_731 end
def Function_5_7DC(): pass
label("Function_5_7DC")
TalkBegin(0xFE)
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x1A7, 1)), scpexpr(EXPR_END)), "loc_925")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 0)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_8B7")
#C0001
ChrTalk(
0xFE,
(
"湿地竟然出现了那种东西……\x01",
"虽然感觉很不安,\x01",
"但还是要认真完成工作。\x02",
)
)
CloseMessageWindow()
#C0002
ChrTalk(
0xFE,
(
"修利好像\x01",
"一直在彩虹剧团\x01",
"努力练习呢!\x02",
)
)
CloseMessageWindow()
#C0003
ChrTalk(
0xFE,
(
"为了迎接伊莉娅小姐归来的那一天,\x01",
"我也得好好努力,把公寓认真打扫干净。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 0)
Jump("loc_920")
label("loc_8B7")
#C0004
ChrTalk(
0xFE,
(
"修利好像\x01",
"一直在彩虹剧团\x01",
"努力练习呢!\x02",
)
)
CloseMessageWindow()
#C0005
ChrTalk(
0xFE,
(
"为了迎接伊莉娅小姐归来的那一天,\x01",
"我得把公寓认真打扫干净。\x02",
)
)
CloseMessageWindow()
label("loc_920")
Jump("loc_17A8")
label("loc_925")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x1A5, 3)), scpexpr(EXPR_END)), "loc_997")
#C0006
ChrTalk(
0xFE,
(
"啊,怎么办呢……\x01",
"市里竟然发生了这种事。\x02",
)
)
CloseMessageWindow()
#C0007
ChrTalk(
0xFE,
(
"总、总之,必须要通知\x01",
"房间里的各位,让他们别出门。\x02",
)
)
CloseMessageWindow()
Jump("loc_17A8")
label("loc_997")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x182, 1)), scpexpr(EXPR_END)), "loc_A07")
#C0008
ChrTalk(
0xFE,
(
"听说那起袭击事件的\x01",
"幕后黑手是帝国呢。\x02",
)
)
CloseMessageWindow()
#C0009
ChrTalk(
0xFE,
(
"绝对饶不了他们。\x01",
"伊莉娅小姐就是因为那起事件才……\x02",
)
)
CloseMessageWindow()
Jump("loc_17A8")
label("loc_A07")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x180, 2)), scpexpr(EXPR_END)), "loc_B12")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 0)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_ABC")
#C0010
ChrTalk(
0xFE,
(
"住在这间公寓\x01",
"三楼的人原来\x01",
"是伊莉娅小姐……\x02",
)
)
CloseMessageWindow()
#C0011
ChrTalk(
0xFE,
(
"看到修利\x01",
"来收拾东西,\x01",
"我才察觉到。\x02",
)
)
CloseMessageWindow()
#C0012
ChrTalk(
0xFE,
(
"……这原本是件值得高兴的事,\x01",
"但伊莉娅小姐\x01",
"却遭遇了那种事……\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 0)
Jump("loc_B0D")
label("loc_ABC")
#C0013
ChrTalk(
0xFE,
(
"修利一直是一副\x01",
"无精打采的样子。\x01",
"真可怜……\x02",
)
)
CloseMessageWindow()
#C0014
ChrTalk(
0xFE,
(
"唉,希望她能\x01",
"尽快恢复精神。\x02",
)
)
CloseMessageWindow()
label("loc_B0D")
Jump("loc_17A8")
label("loc_B12")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x165, 5)), scpexpr(EXPR_END)), "loc_C30")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 0)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_BCA")
#C0015
ChrTalk(
0xFE,
(
"『金之太阳、银之月』的\x01",
"新版……\x01",
"终于要在今晚公演了。\x02",
)
)
CloseMessageWindow()
#C0016
ChrTalk(
0xFE,
(
"遗憾的是,\x01",
"我没能买到票……\x01",
"但我会在这里给他们加油的。\x02",
)
)
CloseMessageWindow()
#C0017
ChrTalk(
0xFE,
(
"唉,真想亲眼目睹\x01",
"修利的英姿啊……\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 0)
Jump("loc_C2B")
label("loc_BCA")
#C0018
ChrTalk(
0xFE,
(
"『金之太阳、银之月』的\x01",
"新版……\x01",
"终于要在今晚公演了。\x02",
)
)
CloseMessageWindow()
#C0019
ChrTalk(
0xFE,
(
"唉,真想亲眼目睹\x01",
"修利的英姿啊……\x02",
)
)
CloseMessageWindow()
label("loc_C2B")
Jump("loc_17A8")
label("loc_C30")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x164, 0)), scpexpr(EXPR_END)), "loc_E79")
Jc((scpexpr(EXPR_EXEC_OP, "OP_2A(0x8D, 0x0, 0x10)"), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_D1A")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 0)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_CD0")
#C0020
ChrTalk(
0xFE,
(
"修利今天一大早\x01",
"就出门了。\x02",
)
)
CloseMessageWindow()
#C0021
ChrTalk(
0xFE,
(
"她最近的情绪\x01",
"好像很紧张……\x01",
"让我有些担心呢。\x02",
)
)
CloseMessageWindow()
#C0022
ChrTalk(
0xFE,
(
"新版舞剧的公演\x01",
"让她很有压力吧……\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 0)
Jump("loc_D15")
label("loc_CD0")
#C0023
ChrTalk(
0xFE,
(
"新版舞剧的\x01",
"公演让修利\x01",
"很有压力吧……\x02",
)
)
CloseMessageWindow()
#C0024
ChrTalk(
0xFE,
(
"我一定要\x01",
"全力支持她。\x02",
)
)
CloseMessageWindow()
label("loc_D15")
Jump("loc_E74")
label("loc_D1A")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 0)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_E05")
#C0025
ChrTalk(
0xFE,
(
"刚、刚才……\x01",
"伊莉娅小姐从修利的\x01",
"房间里出来了!\x02",
)
)
CloseMessageWindow()
#C0026
ChrTalk(
0xFE,
(
"她、她还和我打了招呼……\x01",
"我高兴得都快哭出来了!\x02",
)
)
CloseMessageWindow()
#C0027
ChrTalk(
0xFE,
(
"伊莉娅小姐是来\x01",
"找修利玩的吧?\x01",
"呼,真羡慕修利啊……\x02",
)
)
CloseMessageWindow()
#C0028
ChrTalk(
0x101,
(
"#00006F(不,那本来就是\x01",
" 伊莉娅小姐的房间啊……)\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 0)
Jump("loc_E74")
label("loc_E05")
#C0029
ChrTalk(
0xFE,
(
"真羡慕修利啊……\x01",
"伊莉娅小姐竟然会来找她玩。\x02",
)
)
CloseMessageWindow()
#C0030
ChrTalk(
0xFE,
(
"呼,算了……\x01",
"能够近距离见到伊莉娅小姐,\x01",
"已经非常幸运了。\x02",
)
)
CloseMessageWindow()
label("loc_E74")
Jump("loc_17A8")
label("loc_E79")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x162, 5)), scpexpr(EXPR_END)), "loc_EDD")
#C0031
ChrTalk(
0xFE,
(
"卢威克先生那里的\x01",
"扫除已经做完了……\x02",
)
)
CloseMessageWindow()
#C0032
ChrTalk(
0xFE,
(
"嗯,接下来是三楼了。\x01",
"大概又会很乱吧……\x02",
)
)
CloseMessageWindow()
Jump("loc_17A8")
label("loc_EDD")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x162, 0)), scpexpr(EXPR_END)), "loc_FF1")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 0)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_F6E")
#C0033
ChrTalk(
0xFE,
(
"卢威克先生\x01",
"好像带着夫人\x01",
"去兜风了。\x02",
)
)
CloseMessageWindow()
#C0034
ChrTalk(
0xFE,
(
"听说要把车开到\x01",
"边境大门附近去。\x02",
)
)
CloseMessageWindow()
#C0035
ChrTalk(
0xFE,
(
"真是悠闲自在的老年生活啊。\x01",
"好羡慕~\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 0)
Jump("loc_FEC")
label("loc_F6E")
#C0036
ChrTalk(
0xFE,
(
"咦,说起来……\x01",
"我记得卢威克先生之前好像和\x01",
"他的夫人吵过架……\x02",
)
)
CloseMessageWindow()
#C0037
ChrTalk(
0xFE,
(
"……呼,不管了。\x01",
"总之,得赶快把委托我的\x01",
"扫除工作做完。\x02",
)
)
CloseMessageWindow()
label("loc_FEC")
Jump("loc_17A8")
label("loc_FF1")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x160, 0)), scpexpr(EXPR_END)), "loc_10D7")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 0)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_1084")
#C0038
ChrTalk(
0xFE,
(
"在彩虹剧团这次的\x01",
"新版舞剧中……\x02",
)
)
CloseMessageWindow()
#C0039
ChrTalk(
0xFE,
(
"住在三楼的修利\x01",
"被破格提拔为\x01",
"次要主角之一了!\x02",
)
)
CloseMessageWindow()
#C0040
ChrTalk(
0xFE,
(
"呀,好厉害啊!\x01",
"真想去看!!\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 0)
Jump("loc_10D2")
label("loc_1084")
#C0041
ChrTalk(
0xFE,
(
"啊……\x01",
"好想去看修利的\x01",
"重要演出……!\x02",
)
)
CloseMessageWindow()
#C0042
ChrTalk(
0xFE,
(
"……但是我没有\x01",
"买到票。\x01",
"唉……\x02",
)
)
CloseMessageWindow()
label("loc_10D2")
Jump("loc_17A8")
label("loc_10D7")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x141, 5)), scpexpr(EXPR_END)), "loc_11E0")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 0)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_1177")
#C0043
ChrTalk(
0xFE,
(
"卢威克先生好像\x01",
"和他的夫人吵架了。\x02",
)
)
CloseMessageWindow()
#C0044
ChrTalk(
0xFE,
(
"我去收钱的时候,\x01",
"气氛非常压抑……\x02",
)
)
CloseMessageWindow()
#C0045
ChrTalk(
0xFE,
(
"唉,我虽然不是当事人,\x01",
"但也不由自主得紧张起来了。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 0)
Jump("loc_11DB")
label("loc_1177")
#C0046
ChrTalk(
0xFE,
(
"卢威克先生和奥丽加夫人\x01",
"好像正在吵架呢。\x02",
)
)
CloseMessageWindow()
#C0047
ChrTalk(
0xFE,
(
"唉,真希望他们早点和好,\x01",
"这样会让我也很紧张的……\x02",
)
)
CloseMessageWindow()
label("loc_11DB")
Jump("loc_17A8")
label("loc_11E0")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x141, 0)), scpexpr(EXPR_END)), "loc_12A8")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 0)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_1270")
#C0048
ChrTalk(
0xFE,
(
"听说各国首脑\x01",
"今天将会去观看\x01",
"彩虹剧团的演出。\x02",
)
)
CloseMessageWindow()
#C0049
ChrTalk(
0xFE,
(
"唔,他们肯定是坐在\x01",
"很棒的位置享受演出吧。\x02",
)
)
CloseMessageWindow()
#C0050
ChrTalk(
0xFE,
"唔~真羡慕啊!\x02",
)
CloseMessageWindow()
SetScenarioFlags(0x0, 0)
Jump("loc_12A3")
label("loc_1270")
#C0051
ChrTalk(
0xFE,
(
"我最后也没有买到\x01",
"新版舞剧的门票。\x02",
)
)
CloseMessageWindow()
#C0052
ChrTalk(
0xFE,
"唉……\x02",
)
CloseMessageWindow()
label("loc_12A3")
Jump("loc_17A8")
label("loc_12A8")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x140, 4)), scpexpr(EXPR_END)), "loc_1394")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 0)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_132A")
#C0053
ChrTalk(
0xFE,
(
"喂,你听说了吗?\x01",
"据说那部『金之太阳、银之月』\x01",
"要推出新版呢。\x02",
)
)
CloseMessageWindow()
#C0054
ChrTalk(
0xFE,
(
"唔~真期待啊。\x01",
"我得赶快去买票!\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 0)
Jump("loc_138F")
label("loc_132A")
#C0055
ChrTalk(
0xFE,
(
"听说彩虹剧团的\x01",
"『金之太阳、银之月』\x01",
"要推出新版呢。\x02",
)
)
CloseMessageWindow()
#C0056
ChrTalk(
0xFE,
(
"这可绝对不能错过啊……\x01",
"我得赶快去买票!\x02",
)
)
CloseMessageWindow()
label("loc_138F")
Jump("loc_17A8")
label("loc_1394")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x140, 0)), scpexpr(EXPR_END)), "loc_14C9")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 0)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_1467")
#C0057
ChrTalk(
0xFE,
(
"住在一楼的卢威克先生\x01",
"向我提出想要改造\x01",
"公寓。\x02",
)
)
CloseMessageWindow()
#C0058
ChrTalk(
0xFE,
(
"还说钱全都\x01",
"由他来出,\x01",
"最后被他的夫人制止了。\x02",
)
)
CloseMessageWindow()
#C0059
ChrTalk(
0xFE,
(
"哎呀,吓了我一跳呢。\x01",
"话说回来,我只是公寓的管理员,\x01",
"这种事情和我说也没用啊……\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 0)
Jump("loc_14C4")
label("loc_1467")
#C0060
ChrTalk(
0xFE,
(
"卢威克先生以前是议员,\x01",
"非常富有呢。\x02",
)
)
CloseMessageWindow()
#C0061
ChrTalk(
0xFE,
(
"但即使如此,\x01",
"一般人也不会有\x01",
"改造公寓的想法吧。\x02",
)
)
CloseMessageWindow()
label("loc_14C4")
Jump("loc_17A8")
label("loc_14C9")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x128, 1)), scpexpr(EXPR_END)), "loc_16C3")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 0)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_163A")
#C0062
ChrTalk(
0xFE,
(
"因为时机的问题,\x01",
"我之前一直遇不到\x01",
"住在三楼的人……\x02",
)
)
CloseMessageWindow()
#C0063
ChrTalk(
0xFE,
(
"但今天早上终于遇到了,\x01",
"还打了招呼。\x02",
)
)
CloseMessageWindow()
#C0064
ChrTalk(
0xFE,
(
"住在那里的是个叫\x01",
"修利的女孩子,\x01",
"她正在彩虹剧团见习呢!\x02",
)
)
CloseMessageWindow()
#C0065
ChrTalk(
0xFE,
(
"呵呵,虽然现在还默默无闻,\x01",
"但今后可要多关注她了。\x02",
)
)
CloseMessageWindow()
#C0066
ChrTalk(
0x101,
(
"#00005F(修利好像\x01",
" 借住在伊莉娅\x01",
" 小姐的房间吧……?)\x02",
)
)
CloseMessageWindow()
#C0067
ChrTalk(
0x102,
(
"#00100F(她好像一直都没发现\x01",
" 住在三楼的人\x01",
" 是伊莉娅小姐呢。)\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 0)
Jump("loc_16BE")
label("loc_163A")
#C0068
ChrTalk(
0xFE,
(
"话说回来,彩虹剧团\x01",
"果然薪酬丰厚啊~\x02",
)
)
CloseMessageWindow()
#C0069
ChrTalk(
0xFE,
(
"连见习的孩子都能\x01",
"租住这么大的公寓。\x02",
)
)
CloseMessageWindow()
#C0070
ChrTalk(
0x101,
(
"#00006F(那其实是伊莉娅\x01",
" 小姐的房间啊……)\x02",
)
)
CloseMessageWindow()
label("loc_16BE")
Jump("loc_17A8")
label("loc_16C3")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x126, 1)), scpexpr(EXPR_END)), "loc_17A8")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 0)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_1767")
#C0071
ChrTalk(
0xFE,
(
"我是这所\x01",
"公寓的\x01",
"管理员……\x02",
)
)
CloseMessageWindow()
#C0072
ChrTalk(
0xFE,
(
"这里真是\x01",
"又宽敞又漂亮。\x01",
"我也好想住在这样的地方啊。\x02",
)
)
CloseMessageWindow()
#C0073
ChrTalk(
0xFE,
(
"……但实在是太过宽敞了,\x01",
"扫除时有点辛苦呢。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 0)
Jump("loc_17A8")
label("loc_1767")
#C0074
ChrTalk(
0xFE,
(
"唔,接下来,\x01",
"还得打扫中庭……\x02",
)
)
CloseMessageWindow()
#C0075
ChrTalk(
0xFE,
"呼,当管理员也不容易啊。\x02",
)
CloseMessageWindow()
label("loc_17A8")
TalkEnd(0xFE)
Return()
# Function_5_7DC end
def Function_6_17AC(): pass
label("Function_6_17AC")
TalkBegin(0xFE)
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x1A7, 1)), scpexpr(EXPR_END)), "loc_18E5")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 1)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_187C")
#C0076
ChrTalk(
0xFE,
(
"听说总统在兰花塔的内部\x01",
"建造了古怪的设施。\x02",
)
)
CloseMessageWindow()
#C0077
ChrTalk(
0xFE,
(
"兰花塔的外观是由我负责设计的,\x01",
"但他竟然在里面动手脚,\x01",
"而且还用来作恶……\x02",
)
)
CloseMessageWindow()
#C0078
ChrTalk(
0xFE,
(
"我们全都被他欺骗了。\x01",
"哎呀呀,实在是不可饶恕啊。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 1)
Jump("loc_18E0")
label("loc_187C")
#C0079
ChrTalk(
0xFE,
(
"听说总统在兰花塔的内部\x01",
"建造了古怪的设施。\x02",
)
)
CloseMessageWindow()
#C0080
ChrTalk(
0xFE,
(
"我们全都被他欺骗了。\x01",
"哎呀呀,实在是不可饶恕啊。\x02",
)
)
CloseMessageWindow()
label("loc_18E0")
Jump("loc_264F")
label("loc_18E5")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x1A5, 3)), scpexpr(EXPR_END)), "loc_19AF")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 1)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_1981")
#C0081
ChrTalk(
0xFE,
(
"可、可恶的总统……\x01",
"没想到他居然这么过分!\x02",
)
)
CloseMessageWindow()
#C0082
ChrTalk(
0xFE,
(
"虽然我很感谢他将\x01",
"兰花塔的外观设计\x01",
"工作交给我……\x02",
)
)
CloseMessageWindow()
#C0083
ChrTalk(
0xFE,
"但已经不能再相信他了。\x02",
)
CloseMessageWindow()
SetScenarioFlags(0x0, 1)
Jump("loc_19AA")
label("loc_1981")
#C0084
ChrTalk(
0xFE,
(
"可恶的总统……\x01",
"已经不能再相信他了。\x02",
)
)
CloseMessageWindow()
label("loc_19AA")
Jump("loc_264F")
label("loc_19AF")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x182, 1)), scpexpr(EXPR_END)), "loc_1A20")
#C0085
ChrTalk(
0xFE,
(
"在如今这种状况下,\x01",
"我也无法接受帝国和\x01",
"共和国的工作了……\x02",
)
)
CloseMessageWindow()
#C0086
ChrTalk(
0xFE,
(
"唔,至少要把\x01",
"手头的工作完成……\x02",
)
)
CloseMessageWindow()
Jump("loc_264F")
label("loc_1A20")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x180, 2)), scpexpr(EXPR_END)), "loc_1B65")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 1)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_1AFD")
#C0087
ChrTalk(
0xFE,
(
"多亏亚里欧斯先生,\x01",
"兰花塔才能\x01",
"幸免于难……\x02",
)
)
CloseMessageWindow()
#C0088
ChrTalk(
0xFE,
(
"但IBC大楼真让人痛惜啊。\x01",
"那也是克洛斯贝尔的\x01",
"象征之一,如今却……\x02",
)
)
CloseMessageWindow()
#C0089
ChrTalk(
0xFE,
(
"那些袭击犯的行为就相当于\x01",
"侮辱克洛斯贝尔的历史。\x01",
"绝不能饶恕他们……!\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 1)
Jump("loc_1B60")
label("loc_1AFD")
#C0090
ChrTalk(
0xFE,
(
"IBC大楼是克洛斯贝尔的\x01",
"标志性建筑物,如今却被他们……\x02",
)
)
CloseMessageWindow()
#C0091
ChrTalk(
0xFE,
"可恶的袭击犯,真是不可饶恕……!\x02",
)
CloseMessageWindow()
label("loc_1B60")
Jump("loc_264F")
label("loc_1B65")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x165, 5)), scpexpr(EXPR_END)), "loc_1D62")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 1)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_1D0F")
#C0092
ChrTalk(
0xFE,
(
"………………………………\x01",
"…………………………啊。\x02",
)
)
CloseMessageWindow()
OP_52(0x0, 0x5, (scpexpr(EXPR_GET_CHR_WORK, 0xFE, 0x4), scpexpr(EXPR_STUB), scpexpr(EXPR_END)))
OP_52(0xFE, 0x5, (scpexpr(EXPR_GET_CHR_WORK, 0xFE, 0x4), scpexpr(EXPR_STUB), scpexpr(EXPR_END)))
ClearChrFlags(0xFE, 0x10)
TurnDirection(0xFE, 0x0, 0)
OP_52(0xFE, 0x4, (scpexpr(EXPR_GET_CHR_WORK, 0xFE, 0x4), scpexpr(EXPR_PUSH_LONG, 0x168), scpexpr(EXPR_ADD), scpexpr(EXPR_PUSH_LONG, 0x168), scpexpr(EXPR_IMOD), scpexpr(EXPR_STUB), scpexpr(EXPR_END)))
OP_52(0xFE, 0x4, (scpexpr(EXPR_GET_CHR_WORK, 0xFE, 0x4), scpexpr(EXPR_PUSH_LONG, 0x168), scpexpr(EXPR_ADD), scpexpr(EXPR_GET_CHR_WORK, 0xFE, 0x5), scpexpr(EXPR_SUB), scpexpr(EXPR_STUB), scpexpr(EXPR_END)))
OP_52(0xFE, 0x5, (scpexpr(EXPR_GET_CHR_WORK, 0xFE, 0x4), scpexpr(EXPR_PUSH_LONG, 0xB4), scpexpr(EXPR_IDIV), scpexpr(EXPR_STUB), scpexpr(EXPR_END)))
Jc((scpexpr(EXPR_GET_CHR_WORK, 0xFE, 0x4), scpexpr(EXPR_PUSH_LONG, 0x2D), scpexpr(EXPR_LEQ), scpexpr(EXPR_GET_CHR_WORK, 0xFE, 0x4), scpexpr(EXPR_PUSH_LONG, 0x13B), scpexpr(EXPR_GE), scpexpr(EXPR_GET_CHR_WORK, 0xFE, 0x4), scpexpr(EXPR_PUSH_LONG, 0x195), scpexpr(EXPR_LEQ), scpexpr(EXPR_NEQUZ_I64), scpexpr(EXPR_OR), scpexpr(EXPR_GET_CHR_WORK, 0xFE, 0x4), scpexpr(EXPR_PUSH_LONG, 0x2A3), scpexpr(EXPR_GE), scpexpr(EXPR_OR), scpexpr(EXPR_END)), "loc_1C40")
Jump("loc_1C8A")
label("loc_1C40")
Jc((scpexpr(EXPR_GET_CHR_WORK, 0xFE, 0x5), scpexpr(EXPR_PUSH_LONG, 0x1), scpexpr(EXPR_LSS), scpexpr(EXPR_END)), "loc_1C60")
OP_52(0xFE, 0x8, (scpexpr(EXPR_PUSH_LONG, 0x2), scpexpr(EXPR_STUB), scpexpr(EXPR_END)))
Jump("loc_1C8A")
label("loc_1C60")
Jc((scpexpr(EXPR_GET_CHR_WORK, 0xFE, 0x5), scpexpr(EXPR_PUSH_LONG, 0x2), scpexpr(EXPR_GTR), scpexpr(EXPR_END)), "loc_1C80")
OP_52(0xFE, 0x8, (scpexpr(EXPR_PUSH_LONG, 0x1), scpexpr(EXPR_STUB), scpexpr(EXPR_END)))
Jump("loc_1C8A")
label("loc_1C80")
OP_52(0xFE, 0x8, (scpexpr(EXPR_GET_CHR_WORK, 0xFE, 0x5), scpexpr(EXPR_STUB), scpexpr(EXPR_END)))
label("loc_1C8A")
OP_52(0xFE, 0x4, (scpexpr(EXPR_GET_CHR_WORK, 0x0, 0x5), scpexpr(EXPR_STUB), scpexpr(EXPR_END)))
OP_52(0x0, 0x5, (scpexpr(EXPR_PUSH_LONG, 0x0), scpexpr(EXPR_STUB), scpexpr(EXPR_END)))
OP_52(0xFE, 0x5, (scpexpr(EXPR_PUSH_LONG, 0x0), scpexpr(EXPR_STUB), scpexpr(EXPR_END)))
SetChrFlags(0xFE, 0x10)
#C0093
ChrTalk(
0xFE,
"……有什么事吗?\x02",
)
CloseMessageWindow()
#C0094
ChrTalk(
0xFE,
(
"我正在集中精神画设计图呢,\x01",
"不好意思,请不要打扰我。\x02",
)
)
CloseMessageWindow()
SetChrSubChip(0xFE, 0x0)
ClearChrFlags(0x9, 0x10)
SetScenarioFlags(0x0, 1)
Jump("loc_1D5D")
label("loc_1D0F")
#C0095
ChrTalk(
0xFE,
(
"最近我可以集中精神\x01",
"投入工作了。\x02",
)
)
CloseMessageWindow()
#C0096
ChrTalk(
0xFE,
(
"但缺点就是几乎\x01",
"察觉不到周围的情况。\x02",
)
)
CloseMessageWindow()
label("loc_1D5D")
Jump("loc_264F")
label("loc_1D62")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x164, 0)), scpexpr(EXPR_END)), "loc_1DB9")
#C0097
ChrTalk(
0xFE,
(
"雨声为何\x01",
"能让人感到\x01",
"如此惬意呢?\x02",
)
)
CloseMessageWindow()
#C0098
ChrTalk(
0xFE,
(
"似乎连画设计图\x01",
"都更加顺畅了。\x02",
)
)
CloseMessageWindow()
Jump("loc_264F")
label("loc_1DB9")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x162, 5)), scpexpr(EXPR_END)), "loc_1E15")
#C0099
ChrTalk(
0xFE,
(
"唔……\x01",
"外面真吵闹啊。\x02",
)
)
CloseMessageWindow()
#C0100
ChrTalk(
0xFE,
(
"而且还有警笛的声音……\x01",
"难道发生了什么事故吗?\x02",
)
)
CloseMessageWindow()
Jump("loc_264F")
label("loc_1E15")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x162, 0)), scpexpr(EXPR_END)), "loc_1EE6")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 1)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_1E9F")
#C0101
ChrTalk(
0xFE,
(
"我的祖父是一位伟大的建筑家,\x01",
"我与他之间的差距有没有缩短些呢……\x02",
)
)
CloseMessageWindow()
#C0102
ChrTalk(
0xFE,
"……唔,不管怎么说,现在要专心工作。\x02",
)
CloseMessageWindow()
SetScenarioFlags(0x0, 1)
Jump("loc_1EE1")
label("loc_1E9F")
#C0103
ChrTalk(
0xFE,
(
"对了,还有帝国客户\x01",
"委托我画的设计图……\x01",
"就从这项工作开始吧。\x02",
)
)
CloseMessageWindow()
label("loc_1EE1")
Jump("loc_264F")
label("loc_1EE6")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x160, 0)), scpexpr(EXPR_END)), "loc_1F58")
#C0104
ChrTalk(
0xFE,
(
"自从兰花塔正式亮相之后,\x01",
"我肩上的担子就卸下来了。\x02",
)
)
CloseMessageWindow()
#C0105
ChrTalk(
0xFE,
(
"我今后要转换心情,\x01",
"参与多种多样的工作。\x02",
)
)
CloseMessageWindow()
Jump("loc_264F")
label("loc_1F58")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x141, 5)), scpexpr(EXPR_END)), "loc_2097")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 1)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_2027")
#C0106
ChrTalk(
0xFE,
(
"我虽然参与了\x01",
"兰花塔的外观设计工作,\x01",
"但对导力网络方面的知识却没什么了解。\x02",
)
)
CloseMessageWindow()
#C0107
ChrTalk(
0xFE,
(
"所以内部设计工作就交给\x01",
"市长推荐的其他建筑家了。\x02",
)
)
CloseMessageWindow()
#C0108
ChrTalk(
0xFE,
(
"呵呵,真是亲身体会到了\x01",
"与别人合作的重要性。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 1)
Jump("loc_2092")
label("loc_2027")
#C0109
ChrTalk(
0xFE,
(
"兰花塔内部的设计工作\x01",
"由市长推荐的其他建筑家\x01",
"负责完成。\x02",
)
)
CloseMessageWindow()
#C0110
ChrTalk(
0xFE,
(
"这次真是亲身体会到了\x01",
"与别人合作的重要性。\x02",
)
)
CloseMessageWindow()
label("loc_2092")
Jump("loc_264F")
label("loc_2097")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x141, 0)), scpexpr(EXPR_END)), "loc_2211")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 1)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_2182")
#C0111
ChrTalk(
0xFE,
(
"兰花塔这种规模的建筑物\x01",
"能以如此惊人的速度完工,\x01",
"导力网络绝对功不可没。\x02",
)
)
CloseMessageWindow()
#C0112
ChrTalk(
0xFE,
(
"在工作过程中,\x01",
"技术人员都是通过导力网络\x01",
"来收发设计图等资料的。\x02",
)
)
CloseMessageWindow()
#C0113
ChrTalk(
0xFE,
(
"这使工作效率\x01",
"有了明显提升……\x01",
"科学技术的进步真令人赞叹啊。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 1)
Jump("loc_220C")
label("loc_2182")
#C0114
ChrTalk(
0xFE,
(
"在兰花塔的建设过程中,\x01",
"技术人员都是通过导力网络\x01",
"而收发设计图等资料的。\x02",
)
)
CloseMessageWindow()
#C0115
ChrTalk(
0xFE,
(
"我总算理解市长为何\x01",
"要为了普及导力网络\x01",
"而专门修改法律了。\x02",
)
)
CloseMessageWindow()
label("loc_220C")
Jump("loc_264F")
label("loc_2211")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x140, 4)), scpexpr(EXPR_END)), "loc_221F")
Jump("loc_264F")
label("loc_221F")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x140, 0)), scpexpr(EXPR_END)), "loc_2316")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 1)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_22B4")
#C0116
ChrTalk(
0xFE,
(
"由我负责设计外观的\x01",
"『兰花塔』终于要在\x01",
"明天初次亮相了。\x02",
)
)
CloseMessageWindow()
#C0117
ChrTalk(
0xFE,
(
"呼……\x01",
"虽然都已经这么大年纪了,\x01",
"但还是不由自主地紧张啊。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 1)
Jump("loc_2311")
label("loc_22B4")
#C0118
ChrTalk(
0xFE,
(
"『兰花塔』终于要在\x01",
"明天正式亮相了……\x02",
)
)
CloseMessageWindow()
#C0119
ChrTalk(
0xFE,
(
"揭幕式结束之后,\x01",
"去和建设人员们\x01",
"打个招呼吧。\x02",
)
)
CloseMessageWindow()
label("loc_2311")
Jump("loc_264F")
label("loc_2316")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x128, 1)), scpexpr(EXPR_END)), "loc_24E9")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 1)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_244E")
#C0120
ChrTalk(
0xFE,
(
"市政厅……\x01",
"不,现在已经是市民会馆了。\x01",
"那座建筑物是我祖父设计的。\x02",
)
)
CloseMessageWindow()
#C0121
ChrTalk(
0xFE,
(
"祖父是一位伟大的建筑家,\x01",
"克洛斯贝尔过去的公共设施\x01",
"几乎都是他设计的。\x02",
)
)
CloseMessageWindow()
#C0122
ChrTalk(
0xFE,
(
"我也是追随着祖父的脚步,\x01",
"才会立志成为建筑家的……\x02",
)
)
CloseMessageWindow()
#C0123
ChrTalk(
0xFE,
(
"而如今,身为他孙子的我,\x01",
"设计了新市政厅大楼的外观……\x01",
"呵呵,人生真是耐人寻味啊。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 1)
Jump("loc_24E4")
label("loc_244E")
#C0124
ChrTalk(
0xFE,
(
"我的祖父是一位伟大的建筑家,\x01",
"现在的市民会馆\x01",
"就是他设计的。\x02",
)
)
CloseMessageWindow()
#C0125
ChrTalk(
0xFE,
(
"而如今,身为他孙子的我,\x01",
"设计了新市政厅大楼的外观……\x01",
"呵呵,人生真是耐人寻味啊。\x02",
)
)
CloseMessageWindow()
label("loc_24E4")
Jump("loc_264F")
label("loc_24E9")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x126, 1)), scpexpr(EXPR_END)), "loc_264F")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 1)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_25E9")
#C0126
ChrTalk(
0xFE,
(
"克洛斯贝尔的新市政厅大楼\x01",
"终于落成了。\x02",
)
)
CloseMessageWindow()
#C0127
ChrTalk(
0xFE,
(
"多亏新市长大力支持\x01",
"建设计划,\x01",
"才能走到如今这一步。\x02",
)
)
CloseMessageWindow()
#C0128
ChrTalk(
0xFE,
(
"由于预算冻结等原因,建设工作\x01",
"曾停滞不前,连能否完工都成了问题……\x02",
)
)
CloseMessageWindow()
#C0129
ChrTalk(
0xFE,
(
"如今彻底竣工,负责设计外观的我\x01",
"总算也可以松一口气了。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 1)
Jump("loc_264F")
label("loc_25E9")
#C0130
ChrTalk(
0xFE,
(
"我作为一名建筑家,\x01",
"参与了新市政厅的外观设计。\x02",
)
)
CloseMessageWindow()
#C0131
ChrTalk(
0xFE,
(
"这项工作已经接近尾声……\x01",
"真是令人感慨万千啊。\x02",
)
)
CloseMessageWindow()
label("loc_264F")
TalkEnd(0xFE)
Return()
# Function_6_17AC end
def Function_7_2653(): pass
label("Function_7_2653")
TalkBegin(0xFE)
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x1A7, 1)), scpexpr(EXPR_END)), "loc_27CC")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 2)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_2747")
#C0132
ChrTalk(
0xFE,
(
"我老公虽然对总统感到愤怒,\x01",
"但还是着手于下一项工作了。\x02",
)
)
CloseMessageWindow()
#C0133
ChrTalk(
0xFE,
(
"市里发生了那样的事情,\x01",
"所以各公司纷纷前来委托\x01",
"防盗、警备方面的改装工程……\x02",
)
)
CloseMessageWindow()
#C0134
ChrTalk(
0xFE,
(
"在这种时候,希望他专心做好现在的工作,\x01",
"不要再对兰花塔的事情耿耿于怀。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 2)
Jump("loc_27C7")
label("loc_2747")
#C0135
ChrTalk(
0xFE,
(
"各公司纷纷前来委托\x01",
"防盗、警备方面的改装工程……\x02",
)
)
CloseMessageWindow()
#C0136
ChrTalk(
0xFE,
(
"在这种时候,希望他专心做好现在的工作,\x01",
"不要再对兰花塔的事情耿耿于怀。\x02",
)
)
CloseMessageWindow()
label("loc_27C7")
Jump("loc_308F")
label("loc_27CC")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x1A5, 3)), scpexpr(EXPR_END)), "loc_281B")
#C0137
ChrTalk(
0xFE,
(
"虽然外面的怪物\x01",
"似乎无意进入室内……\x02",
)
)
CloseMessageWindow()
#C0138
ChrTalk(
0xFE,
"但还是很可怕啊……\x02",
)
CloseMessageWindow()
Jump("loc_308F")
label("loc_281B")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x182, 1)), scpexpr(EXPR_END)), "loc_2876")
#C0139
ChrTalk(
0xFE,
(
"要冻结两大国资金的\x01",
"宣言真是让我\x01",
"大吃一惊。\x02",
)
)
CloseMessageWindow()
#C0140
ChrTalk(
0xFE,
(
"这、这么做\x01",
"没关系吗……\x02",
)
)
CloseMessageWindow()
Jump("loc_308F")
label("loc_2876")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x180, 2)), scpexpr(EXPR_END)), "loc_297A")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 2)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_2923")
#C0141
ChrTalk(
0xFE,
(
"城市竟然遭到暴徒的袭击,\x01",
"真是可怕的事件啊。\x02",
)
)
CloseMessageWindow()
#C0142
ChrTalk(
0xFE,
(
"虽然这一带没有遭受\x01",
"太大的损失,\x01",
"但还是很担心今后的状况……\x02",
)
)
CloseMessageWindow()
#C0143
ChrTalk(
0xFE,
(
"希望不要再发生\x01",
"这种事了……\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 2)
Jump("loc_2975")
label("loc_2923")
#C0144
ChrTalk(
0xFE,
(
"城市竟然遭到暴徒的袭击,\x01",
"真是可怕的事件啊。\x02",
)
)
CloseMessageWindow()
#C0145
ChrTalk(
0xFE,
(
"希望不要再发生\x01",
"这种事了……\x02",
)
)
CloseMessageWindow()
label("loc_2975")
Jump("loc_308F")
label("loc_297A")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x165, 5)), scpexpr(EXPR_END)), "loc_29C8")
#C0146
ChrTalk(
0xFE,
(
"最近这段时间\x01",
"似乎事件不断。\x02",
)
)
CloseMessageWindow()
#C0147
ChrTalk(
0xFE,
(
"不久之前都还\x01",
"很平静呢……\x02",
)
)
CloseMessageWindow()
Jump("loc_308F")
label("loc_29C8")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x164, 0)), scpexpr(EXPR_END)), "loc_2A95")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 2)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_2A34")
#C0148
ChrTalk(
0xFE,
(
"真讨厌啊……\x01",
"我今天本打算\x01",
"去百货商店购物。\x02",
)
)
CloseMessageWindow()
#C0149
ChrTalk(
0xFE,
(
"真没办法啊,\x01",
"必须要打伞……\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 2)
Jump("loc_2A90")
label("loc_2A34")
#C0150
ChrTalk(
0xFE,
(
"进口杂货店那里\x01",
"有很好的咖啡豆。\x02",
)
)
CloseMessageWindow()
#C0151
ChrTalk(
0xFE,
(
"如果受了潮,会有损它的风味,\x01",
"所以下雨会很麻烦呢。\x02",
)
)
CloseMessageWindow()
label("loc_2A90")
Jump("loc_308F")
label("loc_2A95")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x162, 5)), scpexpr(EXPR_END)), "loc_2AD0")
#C0152
ChrTalk(
0xFE,
(
"唔,我老公喜欢的\x01",
"利贝尔产咖啡是放在……\x02",
)
)
CloseMessageWindow()
Jump("loc_308F")
label("loc_2AD0")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x162, 0)), scpexpr(EXPR_END)), "loc_2BF3")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 2)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_2B90")
#C0153
ChrTalk(
0xFE,
(
"我老公以前一直活在\x01",
"自己祖父的阴影下,\x01",
"总是很自卑。\x02",
)
)
CloseMessageWindow()
#C0154
ChrTalk(
0xFE,
(
"不过,自从参与了兰花塔的\x01",
"外观设计工作之后,\x01",
"他好像就乐观积极多了。\x02",
)
)
CloseMessageWindow()
#C0155
ChrTalk(
0xFE,
(
"看来这份工作\x01",
"让他找到了自信呢。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 2)
Jump("loc_2BEE")
label("loc_2B90")
#C0156
ChrTalk(
0xFE,
(
"我老公已经\x01",
"渐渐走出了\x01",
"祖父的阴影。\x02",
)
)
CloseMessageWindow()
#C0157
ChrTalk(
0xFE,
(
"设计兰花塔外观的\x01",
"这件工作好像\x01",
"让他找到了自信呢。\x02",
)
)
CloseMessageWindow()
label("loc_2BEE")
Jump("loc_308F")
label("loc_2BF3")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x160, 0)), scpexpr(EXPR_END)), "loc_2C67")
#C0158
ChrTalk(
0xFE,
(
"为了让老公更顺利的工作,\x01",
"我来给他煮杯咖啡吧。\x02",
)
)
CloseMessageWindow()
#C0159
ChrTalk(
0xFE,
(
"今天煮的是利贝尔产的咖啡豆,\x01",
"一定会很香醇的。\x02",
)
)
CloseMessageWindow()
Jump("loc_308F")
label("loc_2C67")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x141, 5)), scpexpr(EXPR_END)), "loc_2CDD")
#C0160
ChrTalk(
0xFE,
(
"今天早上,\x01",
"又接到了不少\x01",
"新工作。\x02",
)
)
CloseMessageWindow()
#C0161
ChrTalk(
0xFE,
(
"虽然兰花塔的工作\x01",
"已经结束了,\x01",
"但我老公还是没什么时间休息呢。\x02",
)
)
CloseMessageWindow()
Jump("loc_308F")
label("loc_2CDD")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x141, 0)), scpexpr(EXPR_END)), "loc_2D70")
#C0162
ChrTalk(
0xFE,
(
"我老公啊,即使我什么都没问,\x01",
"他也会兴致勃勃地\x01",
"给我讲很多兰花塔方面的事情。\x02",
)
)
CloseMessageWindow()
#C0163
ChrTalk(
0xFE,
(
"呵呵,他白天参加揭幕式的\x01",
"兴奋劲似乎还没消退呢。\x02",
)
)
CloseMessageWindow()
Jump("loc_308F")
label("loc_2D70")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x140, 4)), scpexpr(EXPR_END)), "loc_2DE7")
#C0164
ChrTalk(
0xFE,
(
"我老公参与了\x01",
"兰花塔的设计工作,\x01",
"今天还出席了揭幕式。\x02",
)
)
CloseMessageWindow()
#C0165
ChrTalk(
0xFE,
(
"他现在大概正沉浸在\x01",
"大功告成的喜悦感中吧。\x02",
)
)
CloseMessageWindow()
Jump("loc_308F")
label("loc_2DE7")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x140, 0)), scpexpr(EXPR_END)), "loc_2E49")
#C0166
ChrTalk(
0xFE,
(
"这次的工作格外重要,\x01",
"我老公好像很紧张呢。\x02",
)
)
CloseMessageWindow()
#C0167
ChrTalk(
0xFE,
(
"给他煮杯咖啡,\x01",
"让他定下心来吧。\x02",
)
)
CloseMessageWindow()
Jump("loc_308F")
label("loc_2E49")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x128, 1)), scpexpr(EXPR_END)), "loc_2F84")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 2)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_2EF6")
#C0168
ChrTalk(
0xFE,
(
"我经常听老公\x01",
"讲他祖父的事情。\x02",
)
)
CloseMessageWindow()
#C0169
ChrTalk(
0xFE,
(
"老公的祖父是一位非常优秀的\x01",
"建筑家,也是他永远的目标。\x02",
)
)
CloseMessageWindow()
#C0170
ChrTalk(
0xFE,
(
"但在某种程度上,\x01",
"似乎也让他产生了\x01",
"些许自卑感。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 2)
Jump("loc_2F7F")
label("loc_2EF6")
#C0171
ChrTalk(
0xFE,
(
"我老公的祖父是一位\x01",
"非常优秀的建筑家,\x01",
"这似乎让他产生了一些自卑感。\x02",
)
)
CloseMessageWindow()
#C0172
ChrTalk(
0xFE,
(
"不过,我老公在工作上一直非常努力,\x01",
"我觉得这样不就很好了吗?\x02",
)
)
CloseMessageWindow()
label("loc_2F7F")
Jump("loc_308F")
label("loc_2F84")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x126, 1)), scpexpr(EXPR_END)), "loc_308F")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 2)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_303D")
#C0173
ChrTalk(
0xFE,
(
"我老公参与了\x01",
"新市政厅大楼的设计工作。\x02",
)
)
CloseMessageWindow()
#C0174
ChrTalk(
0xFE,
(
"这是一项重要的工作,\x01",
"所以他这个月一直\x01",
"都在集中精力拼命工作。\x02",
)
)
CloseMessageWindow()
#C0175
ChrTalk(
0xFE,
(
"不过,工作似乎已经告一段落了,\x01",
"我也放心了。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 2)
Jump("loc_308F")
label("loc_303D")
#C0176
ChrTalk(
0xFE,
(
"我们的家就是\x01",
"设计事务所。\x02",
)
)
CloseMessageWindow()
#C0177
ChrTalk(
0xFE,
(
"最近一直都在忙着完成\x01",
"新市政厅大楼的设计工作。\x02",
)
)
CloseMessageWindow()
label("loc_308F")
TalkEnd(0xFE)
Return()
# Function_7_2653 end
def Function_8_3093(): pass
label("Function_8_3093")
TalkBegin(0xFE)
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x1A7, 1)), scpexpr(EXPR_END)), "loc_30FC")
#C0178
ChrTalk(
0xFE,
(
"这个世道真是\x01",
"越来越不太平了啊。\x02",
)
)
CloseMessageWindow()
#C0179
ChrTalk(
0xFE,
(
"要不要挖个地下避难所,\x01",
"和老婆子一起藏起来呢?\x02",
)
)
CloseMessageWindow()
Jump("loc_3809")
label("loc_30FC")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x1A5, 3)), scpexpr(EXPR_END)), "loc_315E")
#C0180
ChrTalk(
0xFE,
(
"唔,不知我停在外面的车\x01",
"会不会有事。\x02",
)
)
CloseMessageWindow()
#C0181
ChrTalk(
0xFE,
(
"要是划伤了的话,\x01",
"我一定会去要求赔偿。\x02",
)
)
CloseMessageWindow()
Jump("loc_3809")
label("loc_315E")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x182, 1)), scpexpr(EXPR_END)), "loc_316C")
Jump("loc_3809")
label("loc_316C")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x180, 2)), scpexpr(EXPR_END)), "loc_32DA")
Jc((scpexpr(EXPR_EXEC_OP, "OP_2A(0x90, 0x0, 0x2)"), scpexpr(EXPR_EXEC_OP, "OP_2A(0x90, 0x0, 0x10)"), scpexpr(EXPR_EQUZ), scpexpr(EXPR_NEQUZ_I64), scpexpr(EXPR_EXEC_OP, "OP_2A(0x90, 0x0, 0x40)"), scpexpr(EXPR_EQUZ), scpexpr(EXPR_NEQUZ_I64), scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x19A, 7)), scpexpr(EXPR_NEQUZ_I64), scpexpr(EXPR_END)), "loc_320B")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x19B, 0)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_31A8")
Call(0, 19)
Return()
label("loc_31A8")
#C0182
ChrTalk(
0xFE,
(
"盖巴尔现在应该在\x01",
"阿尔摩利卡村。\x02",
)
)
CloseMessageWindow()
#C0183
ChrTalk(
0xFE,
(
"你们过去找找,应该能找到,\x01",
"具体情况就问他本人好了。\x02",
)
)
CloseMessageWindow()
Jump("loc_32D5")
label("loc_320B")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 3)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_32A8")
#C0184
ChrTalk(
0xFE,
(
"我在慈善活动的会场\x01",
"把卖掉旧家具的钱\x01",
"捐出去了。\x02",
)
)
CloseMessageWindow()
#C0185
ChrTalk(
0xFE,
(
"比起我自己花掉,\x01",
"这样应该\x01",
"更有意义。\x02",
)
)
CloseMessageWindow()
#C0186
ChrTalk(
0xFE,
(
"现在大家都不容易,\x01",
"我们必须互相帮助啊。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 3)
Jump("loc_32D5")
label("loc_32A8")
#C0187
ChrTalk(
0xFE,
(
"现在大家都不容易,\x01",
"我们必须互相帮助啊。\x02",
)
)
CloseMessageWindow()
label("loc_32D5")
Jump("loc_3809")
label("loc_32DA")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x165, 5)), scpexpr(EXPR_END)), "loc_33E1")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 3)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_3381")
#C0188
ChrTalk(
0xFE,
(
"武装集团居然占领了矿山镇,\x01",
"这真是前所未闻。\x02",
)
)
CloseMessageWindow()
#C0189
ChrTalk(
0xFE,
(
"如果我当时去玛因兹\x01",
"那边兜风,\x01",
"说不定就被牵连进去了……\x02",
)
)
CloseMessageWindow()
#C0190
ChrTalk(
0xFE,
(
"啊,真可怕。\x01",
"(发抖)……\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 3)
Jump("loc_33DC")
label("loc_3381")
#C0191
ChrTalk(
0xFE,
(
"如果我当时去玛因兹\x01",
"那边兜风,\x01",
"说不定就被牵连进去了……\x02",
)
)
CloseMessageWindow()
#C0192
ChrTalk(
0xFE,
(
"啊,真可怕。\x01",
"(发抖)……\x02",
)
)
CloseMessageWindow()
label("loc_33DC")
Jump("loc_3809")
label("loc_33E1")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x164, 0)), scpexpr(EXPR_END)), "loc_344C")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 3)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_33FC")
Call(0, 13)
Jump("loc_3447")
label("loc_33FC")
#C0193
ChrTalk(
0xFE,
(
"(唔……阿鲁姆那孩子\x01",
" 已经长这么大了……)\x02",
)
)
CloseMessageWindow()
#C0194
ChrTalk(
0xFE,
"(但那个蠢材却……)\x02",
)
CloseMessageWindow()
label("loc_3447")
Jump("loc_3809")
label("loc_344C")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x162, 5)), scpexpr(EXPR_END)), "loc_345A")
Jump("loc_3809")
label("loc_345A")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x162, 0)), scpexpr(EXPR_END)), "loc_3468")
Jump("loc_3809")
label("loc_3468")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x160, 0)), scpexpr(EXPR_END)), "loc_34CF")
#C0195
ChrTalk(
0xFE,
(
"我明天打算开车\x01",
"兜风,这次准备\x01",
"邀请老婆子一起。\x02",
)
)
CloseMessageWindow()
#C0196
ChrTalk(
0xFE,
(
"希望这样能让\x01",
"她的心情好一些……\x02",
)
)
CloseMessageWindow()
Jump("loc_3809")
label("loc_34CF")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x141, 5)), scpexpr(EXPR_END)), "loc_35D5")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 3)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_3576")
#C0197
ChrTalk(
0xFE,
(
"我和老婆子从昨天\x01",
"就开始闹别扭……\x02",
)
)
CloseMessageWindow()
#C0198
ChrTalk(
0xFE,
(
"唔唔,住在一起的两个人\x01",
"持续这种冷战状态,\x01",
"还真是不好受啊。\x02",
)
)
CloseMessageWindow()
#C0199
ChrTalk(
0xFE,
(
"唔,怎么才能\x01",
"跟老婆子和好呢……\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 3)
Jump("loc_35D0")
label("loc_3576")
#C0200
ChrTalk(
0xFE,
(
"怎么才能\x01",
"跟老婆子和好呢……\x02",
)
)
CloseMessageWindow()
#C0201
ChrTalk(
0xFE,
(
"不然就买瓶高级葡萄酒……?\x01",
"不行不行,这应该行不通。\x02",
)
)
CloseMessageWindow()
label("loc_35D0")
Jump("loc_3809")
label("loc_35D5")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x141, 0)), scpexpr(EXPR_END)), "loc_3659")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 3)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_35F0")
Call(0, 9)
Jump("loc_3654")
label("loc_35F0")
#C0202
ChrTalk(
0xFE,
(
"我难得想和老婆子一起喝酒,\x01",
"特意买了瓶高级葡萄酒,可她却……\x02",
)
)
CloseMessageWindow()
#C0203
ChrTalk(
0xFE,
(
"哼,算了,\x01",
"我一个人喝就是了。\x02",
)
)
CloseMessageWindow()
label("loc_3654")
Jump("loc_3809")
label("loc_3659")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x140, 4)), scpexpr(EXPR_END)), "loc_3667")
Jump("loc_3809")
label("loc_3667")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x140, 0)), scpexpr(EXPR_END)), "loc_370D")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 3)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_36E5")
#C0204
ChrTalk(
0xFE,
(
"我原本很想要个车库,\x01",
"免得导力车\x01",
"遭受风吹雨打……\x02",
)
)
CloseMessageWindow()
#C0205
ChrTalk(
0xFE,
(
"但老婆子发了那么大的火,\x01",
"也只能放弃了。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 3)
Jump("loc_3708")
label("loc_36E5")
#C0206
ChrTalk(
0xFE,
(
"呼,但也用不着\x01",
"那么生气吧……\x02",
)
)
CloseMessageWindow()
label("loc_3708")
Jump("loc_3809")
label("loc_370D")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x128, 1)), scpexpr(EXPR_END)), "loc_3800")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 3)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_3795")
#C0207
ChrTalk(
0xFE,
(
"唔,停在外面的导力车\x01",
"会被雨淋湿的。\x02",
)
)
CloseMessageWindow()
#C0208
ChrTalk(
0xFE,
(
"我真想要\x01",
"一个车库啊……\x02",
)
)
CloseMessageWindow()
#C0209
ChrTalk(
0xFE,
(
"呼,算了,明天好好\x01",
"洗洗车就是了。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 3)
Jump("loc_37FB")
label("loc_3795")
#C0210
ChrTalk(
0xFE,
(
"但把导力车一直\x01",
"放在外面风吹日晒,\x01",
"终究不是办法啊。\x02",
)
)
CloseMessageWindow()
#C0211
ChrTalk(
0xFE,
(
"住公寓就不能\x01",
"建造车库,\x01",
"真是让人受不了。\x02",
)
)
CloseMessageWindow()
label("loc_37FB")
Jump("loc_3809")
label("loc_3800")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x126, 1)), scpexpr(EXPR_END)), "loc_3809")
label("loc_3809")
TalkEnd(0xFE)
Return()
# Function_8_3093 end
def Function_9_380D(): pass
label("Function_9_380D")
OP_4B(0xB, 0xFF)
OP_4B(0xC, 0xFF)
#C0212
ChrTalk(
0xB,
(
"啊,这瓶葡萄酒\x01",
"果然很好喝,\x01",
"真是买对了。\x02",
)
)
CloseMessageWindow()
#C0213
ChrTalk(
0xB,
(
"老婆子既然不想喝,\x01",
"我就一个人喝掉吧。\x02",
)
)
CloseMessageWindow()
#C0214
ChrTalk(
0xC,
"……嗯,随你高兴吧。\x02",
)
CloseMessageWindow()
#C0215
ChrTalk(
0xC,
(
"反正你就是为了自己享受\x01",
"才花了那么多钱的吧?\x02",
)
)
CloseMessageWindow()
#C0216
ChrTalk(
0xB,
(
"……哼!\x01",
"(咕嘟咕嘟咕嘟咕嘟)。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 3)
SetScenarioFlags(0x0, 4)
ClearChrFlags(0xB, 0x10)
ClearChrFlags(0xC, 0x10)
OP_4C(0xB, 0xFF)
OP_4C(0xC, 0xFF)
Return()
# Function_9_380D end
def Function_10_38F7(): pass
label("Function_10_38F7")
TalkBegin(0xFE)
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x1A7, 1)), scpexpr(EXPR_END)), "loc_397C")
#C0217
ChrTalk(
0xFE,
(
"老头子可真是的,\x01",
"我们哪有建造地下避难所的钱啊。\x02",
)
)
CloseMessageWindow()
#C0218
ChrTalk(
0xFE,
(
"他这个老毛病总是改不掉,\x01",
"遇到什么问题都想通过花钱来解决。\x02",
)
)
CloseMessageWindow()
Jump("loc_40D8")
label("loc_397C")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x1A5, 3)), scpexpr(EXPR_END)), "loc_39B7")
#C0219
ChrTalk(
0xFE,
(
"真是的,老头子在\x01",
"这种时候还在担心车……\x02",
)
)
CloseMessageWindow()
Jump("loc_40D8")
label("loc_39B7")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x182, 1)), scpexpr(EXPR_END)), "loc_3A3E")
#C0220
ChrTalk(
0xFE,
(
"我听了演讲……\x01",
"看来帝国和共和国一直在\x01",
"克洛斯贝尔进行暗斗啊。\x02",
)
)
CloseMessageWindow()
#C0221
ChrTalk(
0xFE,
(
"身为克洛斯贝尔的居民,\x01",
"无论如何也无法原谅他们……\x02",
)
)
CloseMessageWindow()
Jump("loc_40D8")
label("loc_3A3E")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x180, 2)), scpexpr(EXPR_END)), "loc_3AC3")
#C0222
ChrTalk(
0xFE,
(
"为了城市的复兴,\x01",
"我家老头子去捐了款。\x02",
)
)
CloseMessageWindow()
#C0223
ChrTalk(
0xFE,
(
"我原以为他是个挥霍成性的人,\x01",
"只会为自己而花钱,\x01",
"这下可对他有些改观了。\x02",
)
)
CloseMessageWindow()
Jump("loc_40D8")
label("loc_3AC3")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x165, 5)), scpexpr(EXPR_END)), "loc_3B15")
#C0224
ChrTalk(
0xFE,
(
"没想到会发生\x01",
"这么严重的事件……\x02",
)
)
CloseMessageWindow()
#C0225
ChrTalk(
0xFE,
(
"希望警备队\x01",
"能够设法解决。\x02",
)
)
CloseMessageWindow()
Jump("loc_40D8")
label("loc_3B15")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x164, 0)), scpexpr(EXPR_END)), "loc_3B75")
#C0226
ChrTalk(
0xFE,
(
"阿鲁姆带着家人\x01",
"来克洛斯贝尔了呢。\x02",
)
)
CloseMessageWindow()
#C0227
ChrTalk(
0xFE,
(
"呵呵,他好像过得\x01",
"很幸福,真是太好了。\x02",
)
)
CloseMessageWindow()
Jump("loc_40D8")
label("loc_3B75")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x162, 5)), scpexpr(EXPR_END)), "loc_3B83")
Jump("loc_40D8")
label("loc_3B83")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x162, 0)), scpexpr(EXPR_END)), "loc_3B91")
Jump("loc_40D8")
label("loc_3B91")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x160, 0)), scpexpr(EXPR_END)), "loc_3C09")
#C0228
ChrTalk(
0xFE,
(
"不知道吹的\x01",
"什么风……\x01",
"老头子竟然邀请我去兜风。\x02",
)
)
CloseMessageWindow()
#C0229
ChrTalk(
0xFE,
(
"真是的……\x01",
"他难道以为这样\x01",
"就能让我的心情转好吗?\x02",
)
)
CloseMessageWindow()
Jump("loc_40D8")
label("loc_3C09")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x141, 5)), scpexpr(EXPR_END)), "loc_3C6E")
#C0230
ChrTalk(
0xFE,
(
"我决定一段\x01",
"时间之内不和\x01",
"老头子说话了。\x02",
)
)
CloseMessageWindow()
#C0231
ChrTalk(
0xFE,
(
"除非他向我道歉,\x01",
"不然我才不会原谅他。\x02",
)
)
CloseMessageWindow()
Jump("loc_40D8")
label("loc_3C6E")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x141, 0)), scpexpr(EXPR_END)), "loc_3CB5")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 4)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_3C89")
Call(0, 9)
Jump("loc_3CB0")
label("loc_3C89")
#C0232
ChrTalk(
0xFE,
(
"……哼,我才懒得管\x01",
"那个老头子呢。\x02",
)
)
CloseMessageWindow()
label("loc_3CB0")
Jump("loc_40D8")
label("loc_3CB5")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x140, 4)), scpexpr(EXPR_END)), "loc_3D87")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 4)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_3D3E")
#C0233
ChrTalk(
0xFE,
(
"老头子瞒着我,\x01",
"买了陈年高级\x01",
"葡萄酒。\x02",
)
)
CloseMessageWindow()
#C0234
ChrTalk(
0xFE,
(
"上次因为车库的事情,\x01",
"我刚发过那么大的火……\x01",
"他完全没有反省呢。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 4)
Jump("loc_3D82")
label("loc_3D3E")
#C0235
ChrTalk(
0xFE,
(
"老头子可真是的……\x01",
"他难道以为这种挥霍式的\x01",
"消费可以让我开心吗?\x02",
)
)
CloseMessageWindow()
label("loc_3D82")
Jump("loc_40D8")
label("loc_3D87")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x140, 0)), scpexpr(EXPR_END)), "loc_3EB1")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 4)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_3E46")
#C0236
ChrTalk(
0xFE,
(
"老头子可真是的,竟然想在\x01",
"公寓内部建造车库。\x02",
)
)
CloseMessageWindow()
#C0237
ChrTalk(
0xFE,
(
"虽然我总算说服了他,\x01",
"但萨米小姐真是\x01",
"被他惊得目瞪口呆呢。\x02",
)
)
CloseMessageWindow()
#C0238
ChrTalk(
0xFE,
(
"唉,他那浪费的坏习惯\x01",
"已经到了无可救药的程度了。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 4)
Jump("loc_3EAC")
label("loc_3E46")
#C0239
ChrTalk(
0xFE,
(
"老头子可真是的,竟然想在\x01",
"公寓内部建造车库。\x02",
)
)
CloseMessageWindow()
#C0240
ChrTalk(
0xFE,
(
"唉,他那浪费的坏习惯\x01",
"已经到了无可救药的程度了。\x02",
)
)
CloseMessageWindow()
label("loc_3EAC")
Jump("loc_40D8")
label("loc_3EB1")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x128, 1)), scpexpr(EXPR_END)), "loc_3FD5")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 4)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_3F6A")
#C0241
ChrTalk(
0xFE,
(
"在这种下雨的日子,\x01",
"就要专心做自己喜欢做的事。\x02",
)
)
CloseMessageWindow()
#C0242
ChrTalk(
0xFE,
(
"顺便一说,我的兴趣是手工,\x01",
"最近尤其喜欢\x01",
"拼缀布艺。\x02",
)
)
CloseMessageWindow()
#C0243
ChrTalk(
0xFE,
(
"(缝个不停)……\x01",
"这门手艺相当深奥,很有趣呢。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 4)
Jump("loc_3FD0")
label("loc_3F6A")
#C0244
ChrTalk(
0xFE,
(
"我的兴趣是手工,\x01",
"最近尤其喜欢\x01",
"拼缀布艺。\x02",
)
)
CloseMessageWindow()
#C0245
ChrTalk(
0xFE,
(
"老头子要是也像我这样,\x01",
"找些不会\x01",
"花钱的兴趣就好了。\x02",
)
)
CloseMessageWindow()
label("loc_3FD0")
Jump("loc_40D8")
label("loc_3FD5")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x126, 1)), scpexpr(EXPR_END)), "loc_40D8")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 4)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_407E")
#C0246
ChrTalk(
0xFE,
"老头子挥霍成性,真让人头疼啊。\x02",
)
CloseMessageWindow()
#C0247
ChrTalk(
0xFE,
(
"家具明明还没必要更换,\x01",
"他就非要买新的,\x01",
"一直都是如此……\x02",
)
)
CloseMessageWindow()
#C0248
ChrTalk(
0xFE,
(
"不久前,\x01",
"他还买了导力车呢。\x01",
"真是的……\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 4)
Jump("loc_40D8")
label("loc_407E")
#C0249
ChrTalk(
0xFE,
(
"都不跟我说一声,\x01",
"就擅自买了导力车……\x02",
)
)
CloseMessageWindow()
#C0250
ChrTalk(
0xFE,
(
"老头子那挥霍成性的坏习惯\x01",
"真是让人头疼啊。\x02",
)
)
CloseMessageWindow()
label("loc_40D8")
TalkEnd(0xFE)
Return()
# Function_10_38F7 end
def Function_11_40DC(): pass
label("Function_11_40DC")
TalkBegin(0xFE)
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 3)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_40F1")
Call(0, 13)
Jump("loc_410C")
label("loc_40F1")
#C0251
ChrTalk(
0xFE,
(
"好~今天就去\x01",
"医院吧。\x02",
)
)
CloseMessageWindow()
label("loc_410C")
TalkEnd(0xFE)
Return()
# Function_11_40DC end
def Function_12_4110(): pass
label("Function_12_4110")
TalkBegin(0xFE)
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 3)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_4125")
Call(0, 13)
Jump("loc_415C")
label("loc_4125")
#C0252
ChrTalk(
0xFE,
(
"呵呵,虽然进展不快,\x01",
"但我们确实在一步步接近他呢⊥\x02",
)
)
CloseMessageWindow()
label("loc_415C")
TalkEnd(0xFE)
Return()
# Function_12_4110 end
def Function_13_4160(): pass
label("Function_13_4160")
OP_4B(0xB, 0xFF)
OP_4B(0xF, 0xFF)
OP_4B(0x10, 0xFF)
#C0253
ChrTalk(
0xF,
(
"原来如此,他在几个月之前\x01",
"就离开了乌尔斯拉医院……\x02",
)
)
CloseMessageWindow()
#C0254
ChrTalk(
0xB,
(
"是的,我也不清楚\x01",
"他之后的去向……\x02",
)
)
CloseMessageWindow()
#C0255
ChrTalk(
0xB,
(
"你们专程前来,\x01",
"我却只能告诉你们这些,\x01",
"真是不好意思啊。\x02",
)
)
CloseMessageWindow()
#C0256
ChrTalk(
0x10,
(
"不,哪里的话,\x01",
"这对我们很有帮助。\x02",
)
)
CloseMessageWindow()
TurnDirection(0x10, 0xF, 500)
#C0257
ChrTalk(
0x10,
"对吧?亲爱的⊥\x02",
)
CloseMessageWindow()
TurnDirection(0xF, 0x10, 500)
#C0258
ChrTalk(
0xF,
(
"是啊,艾娅莉。\x01",
"这是我们一家三口的大胜利!\x02",
)
)
CloseMessageWindow()
#N0259
NpcTalk(
0x10,
"婴儿",
"呀呀¤\x02",
)
CloseMessageWindow()
OP_63(0xF, 0x0, 2000, 0xA, 0xB, 0xFA, 0x2)
Sound(27, 0, 100, 0)
OP_63(0x10, 0x0, 2000, 0xA, 0xB, 0xFA, 0x2)
Sound(27, 0, 100, 0)
Sleep(1200)
#C0260
ChrTalk(
0xB,
(
"哈哈,你们真是\x01",
"很亲密啊。\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 3)
OP_93(0xF, 0x87, 0x0)
OP_93(0x10, 0xB4, 0x0)
ClearChrFlags(0xB, 0x10)
ClearChrFlags(0xF, 0x10)
ClearChrFlags(0x10, 0x10)
OP_4C(0xB, 0xFF)
OP_4C(0xF, 0xFF)
OP_4C(0x10, 0xFF)
Return()
# Function_13_4160 end
def Function_14_430E(): pass
label("Function_14_430E")
TalkBegin(0xFE)
#C0261
ChrTalk(
0xFE,
(
"完、完全没想到\x01",
"会发生这种事。\x02",
)
)
CloseMessageWindow()
#C0262
ChrTalk(
0xFE,
(
"总、总之……\x01",
"要尽量多拍些照片,\x01",
"记录下现在的情况。\x02",
)
)
CloseMessageWindow()
TalkEnd(0xFE)
Return()
# Function_14_430E end
def Function_15_4370(): pass
label("Function_15_4370")
TalkBegin(0xFE)
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x14C, 5)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_4385")
Call(0, 17)
Jump("loc_449B")
label("loc_4385")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 6)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_446E")
OP_4B(0xD, 0xFF)
#C0263
ChrTalk(
0xE,
(
"#04206F呼……呼……\x02\x03",
"#04201F我说,伊莉娅小姐,\x01",
"已经够了吧?\x02",
)
)
CloseMessageWindow()
#C0264
ChrTalk(
0xD,
(
"#01703F嗯~你好像还是有些紧张,\x01",
"再多给你按摩一会吧。\x02\x03",
"#01702F总之,你就安静一些,\x01",
"乖乖听我的话吧。\x02",
)
)
CloseMessageWindow()
#C0265
ChrTalk(
0xE,
(
"#04206F呜呜……\x01",
"到底还要多久啊?\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 6)
OP_4C(0xD, 0xFF)
Jump("loc_449B")
label("loc_446E")
#C0266
ChrTalk(
0xE,
(
"#04206F呜呜……\x01",
"怎样都好,\x01",
"赶快结束吧。\x02",
)
)
CloseMessageWindow()
label("loc_449B")
TalkEnd(0xFE)
Return()
# Function_15_4370 end
def Function_16_449F(): pass
label("Function_16_449F")
TalkBegin(0xFE)
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x14C, 5)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_44B4")
Call(0, 17)
Jump("loc_462D")
label("loc_44B4")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 5)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_4598")
#C0267
ChrTalk(
0xD,
(
"#01700F呵呵,警察弟弟,\x01",
"不然我也给你们按摩一下吧~\x02\x03",
"#01709F不过,我的原则\x01",
"还是女性优先⊥\x02",
)
)
CloseMessageWindow()
#C0268
ChrTalk(
0x102,
"#00102F啊、啊哈哈……\x02",
)
CloseMessageWindow()
#C0269
ChrTalk(
0x109,
"#10106F还、还是不用了。\x02",
)
CloseMessageWindow()
#C0270
ChrTalk(
0xE,
(
"#04206F(唉,还没喝酒就这样,\x01",
" 真是让人没办法啊……)\x02",
)
)
CloseMessageWindow()
SetScenarioFlags(0x0, 5)
Jump("loc_462D")
label("loc_4598")
#C0271
ChrTalk(
0xD,
(
"#01700F为了晚上的公演,必须让\x01",
"修利的身体彻底放松下来。\x02\x03",
"#01709F这就叫有备无患……\x01",
"女孩子就应该接受我的按摩哦⊥\x02",
)
)
CloseMessageWindow()
#C0272
ChrTalk(
0xE,
"#04206F(莫、莫名其妙……)\x02",
)
CloseMessageWindow()
label("loc_462D")
TalkEnd(0xFE)
Return()
# Function_16_449F end
def Function_17_4631(): pass
label("Function_17_4631")
EventBegin(0x0)
FadeToDark(500, 0, -1)
OP_0D()
LoadChrToIndex("apl/ch51814.itc", 0x1E)
OP_68(51500, 2300, 59170, 0)
MoveCamera(58, 18, 0, 0)
OP_6E(440, 0)
SetCameraDistance(19700, 0)
SetChrPos(0x101, 51430, 1050, 58470, 45)
SetChrPos(0x102, 50280, 1050, 58640, 45)
SetChrPos(0x104, 51460, 1000, 57280, 45)
SetChrPos(0x109, 49800, 1050, 57410, 45)
SetChrPos(0x105, 50350, 1000, 56530, 45)
ClearChrFlags(0x4, 0x80)
ClearChrBattleFlags(0x4, 0x8000)
OP_4B(0xD, 0xFF)
TurnDirection(0xD, 0x101, 0)
SetChrSubChip(0xE, 0x1)
FadeToBright(1000, 0)
OP_0D()
#C0273
ChrTalk(
0xD,
"#11P#01709F啊,警察弟弟☆\x02",
)
CloseMessageWindow()
#C0274
ChrTalk(
0xE,
(
"#04205F#5P你、你们好……\x02\x03",
"#04206F……疼疼疼!\x02",
)
)
CloseMessageWindow()
#C0275
ChrTalk(
0x101,
"#12P#00005F您、您在做什么?\x02",
)
CloseMessageWindow()
#C0276
ChrTalk(
0xD,
(
"#11P#01704F呵呵,今天晚上,\x01",
"各国首脑会到\x01",
"彩虹剧团观看演出……\x02\x03",
"#01702F修利也要在演出中\x01",
"担任配角呢。\x02\x03",
"#01709F现在是按摩时间,\x01",
"目的是让她的身体更加柔韧……嘿!\x02",
)
)
CloseMessageWindow()
TurnDirection(0xD, 0xE, 500)
Sleep(50)
SetChrSubChip(0xE, 0x0)
def lambda_4813():
OP_A6(0xFE, 0x0, 0x1E, 0x190, 0x7D0)
ExitThread()
QueueWorkItem(0xE, 2, lambda_4813)
WaitChrThread(0xE, 2)
Sleep(500)
OP_82(0x64, 0x0, 0xBB8, 0x12C)
#C0277
ChrTalk(
0xE,
"#04212F#11P#4S好疼啊!!\x02",
)
CloseMessageWindow()
OP_63(0x101, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
OP_63(0x102, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
OP_63(0x104, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
OP_63(0x109, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
OP_63(0x105, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
Sleep(1000)
#C0278
ChrTalk(
0x102,
"#6P#00102F原、原来如此……\x02",
)
CloseMessageWindow()
#C0279
ChrTalk(
0x109,
(
"#6P#10105F那、那个,真的没问题吗?\x02\x03",
"#10106F听说外行人按摩肌肉,\x01",
"也许会起到反效果的……\x02",
)
)
CloseMessageWindow()
TurnDirection(0xD, 0x101, 500)
#C0280
ChrTalk(
0xD,
(
"#11P#01704F呵呵,不用担心。\x02\x03",
"#01702F我以前向专业按摩师\x01",
"认真学习过,\x01",
"现在已经非常精通了呢。\x02\x03",
"在练习间隙,舒展身体的时候,\x01",
"我也经常给莉夏按摩呢~\x02",
)
)
CloseMessageWindow()
#C0281
ChrTalk(
0x105,
(
"#12P#10302F原来如此,为了舞台表演,\x01",
"无论哪个领域的知识\x01",
"都要吸收并化为己用啊。\x02",
)
)
CloseMessageWindow()
#C0282
ChrTalk(
0x104,
"#12P#00309F哎呀~真不愧是伊莉娅小姐!\x02",
)
CloseMessageWindow()
SetChrSubChip(0xE, 0x1)
Sleep(100)
#C0283
ChrTalk(
0xE,
(
"#04206F#5P可、可是……\x01",
"不管怎么说,也还是很疼啊!!\x02\x03",
"#04201F伊、伊莉娅小姐,\x01",
"真的不要紧吗!?\x02",
)
)
CloseMessageWindow()
#C0284
ChrTalk(
0xD,
(
"#11P#01706F我不是说过好几次了嘛,\x01",
"肯定不会有事的。\x02\x03",
"#01700F你之所以会这么疼,是因为今天晚上的表演\x01",
"让你很紧张,所以身体非常僵硬。\x02\x03",
"#01709F放心好啦,只要继续下去,\x01",
"就会渐渐舒服起来啦⊥\x02",
)
)
CloseMessageWindow()
#C0285
ChrTalk(
0xE,
"#04207F#5P别、别说那种会引起误会的话!\x02",
)
CloseMessageWindow()
#C0286
ChrTalk(
0xD,
(
"#11P#01701F真是的,你太啰嗦了。\x01",
"如果不老实待着……就会这样!\x02",
)
)
CloseMessageWindow()
SetChrChipByIndex(0xD, 0x1E)
SetChrSubChip(0xD, 0x2)
SetChrFlags(0xD, 0x2)
SetChrPos(0xD, 53710, 1200, 60530, 270)
OP_A6(0xD, 0x0, 0x14, 0x190, 0x1388)
SetChrChipByIndex(0xE, 0x1E)
SetChrSubChip(0xE, 0x0)
SetChrFlags(0xE, 0x2)
OP_63(0xE, 0x0, 1700, 0x28, 0x2B, 0x64, 0x0)
Sleep(1000)
OP_82(0x1F4, 0x0, 0xBB8, 0x3E8)
#C0287
ChrTalk(
0xE,
"#5P#04212F#5S哇哇哇哇哇!?\x02",
)
CloseMessageWindow()
Sleep(300)
#C0288
ChrTalk(
0xE,
"#5P#04207F你、你你你……你在摸哪里啊!?\x02",
)
CloseMessageWindow()
OP_64(0xE)
SetChrSubChip(0xE, 0x1)
#C0289
ChrTalk(
0xD,
(
"#11P#01709F呵呵呵,放心吧,\x01",
"这也是效果很好的按摩方法。\x02",
)
)
CloseMessageWindow()
#C0290
ChrTalk(
0xE,
(
"#04207F#5P骗、骗人!!\x02\x03",
"#04209F啊哈哈,好、好痒……\x02",
)
)
CloseMessageWindow()
#C0291
ChrTalk(
0xD,
(
"#11P#01709F嗯嗯,身体还在发育呢⊥\x01",
"你将来也许会很有前途哦~\x02",
)
)
CloseMessageWindow()
#C0292
ChrTalk(
0xE,
"#04212F#5P谁、谁关心那些!!\x02",
)
CloseMessageWindow()
OP_63(0x101, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
OP_63(0x102, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
OP_63(0x104, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
OP_63(0x109, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
OP_63(0x105, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
Sleep(1000)
#C0293
ChrTalk(
0x102,
(
"#6P#00113F这、这种情景\x01",
"实在是有点……\x02",
)
)
CloseMessageWindow()
#C0294
ChrTalk(
0x105,
"#12P#10309F呵呵,不是很有情趣嘛。\x02",
)
CloseMessageWindow()
#C0295
ChrTalk(
0x101,
(
"#12P#00012F哈哈,不管怎么说,\x01",
"修利好像已经完全\x01",
"融入彩虹剧团了呢。\x02",
)
)
CloseMessageWindow()
OP_63(0xE, 0x0, 1700, 0x28, 0x2B, 0x64, 0x0)
Sleep(1000)
OP_64(0xE)
#C0296
ChrTalk(
0xE,
(
"#5P#04207F不、不用做那种总结性发言,\x01",
"快来救救我啊!!\x02",
)
)
CloseMessageWindow()
#C0297
ChrTalk(
0xD,
"#11P#01709F喂喂,别想逃跑~\x02",
)
CloseMessageWindow()
FadeToDark(1000, 0, -1)
OP_0D()
SetChrChipByIndex(0xD, 0x8)
SetChrSubChip(0xD, 0x0)
ClearChrFlags(0xD, 0x2)
SetChrPos(0xD, 54020, 1020, 60490, 270)
SetChrChipByIndex(0xE, 0x9)
SetChrSubChip(0xE, 0x0)
ClearChrFlags(0xE, 0x2)
OP_4C(0xD, 0xFF)
OP_93(0xD, 0x10E, 0x0)
SetChrPos(0x0, 50040, 1050, 57020, 180)
SetChrFlags(0x4, 0x80)
SetChrBattleFlags(0x4, 0x8000)
SetScenarioFlags(0x14C, 5)
OP_50(0x6F, (scpexpr(EXPR_PUSH_LONG, 0x2), scpexpr(EXPR_ADD_SAVE), scpexpr(EXPR_END)))
EventEnd(0x5)
Return()
# Function_17_4631 end
def Function_18_4F89(): pass
label("Function_18_4F89")
TalkBegin(0xFF)
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x141, 0)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x140, 4)), scpexpr(EXPR_NEQUZ_I64), scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x14C, 5)), scpexpr(EXPR_NEQUZ_I64), scpexpr(EXPR_END)), "loc_5255")
Jc((scpexpr(EXPR_TEST_SCENA_FLAGS, MakeScenarioFlags(0x0, 7)), scpexpr(EXPR_EQUZ), scpexpr(EXPR_END)), "loc_512F")
SetChrName("")
#A0298
AnonymousTalk(
0xFF,
(
scpstr(SCPSTR_CODE_COLOR, 0x5),
"从门内传来了\x01",
"伊莉娅和修利的\x01",
"嬉闹声。\x07\x00\x02",
)
)
CloseMessageWindow()
OP_57(0x0)
OP_5A()
SetMessageWindowPos(130, 20, -1, -1)
SetChrName("修利的声音")
#A0299
AnonymousTalk(
0xFF,
(
scpstr(SCPSTR_CODE_COLOR, 0x5),
"啊、啊哈哈哈……\x01",
"都说过不是那里了啊!\x02\x03",
"呼……呼……\x01",
"伊莉娅小姐,\x01",
"你根本就是故意的吧?\x02",
)
)
CloseMessageWindow()
SetChrName("伊莉娅的声音")
#A0300
AnonymousTalk(
0xFF,
(
scpstr(SCPSTR_CODE_COLOR, 0x5),
"没有啦,只是你的错觉⊥\x02",
)
)
CloseMessageWindow()
OP_63(0x0, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
OP_63(0x1, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
OP_63(0x2, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
OP_63(0x3, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
Sleep(1000)
#C0301
ChrTalk(
0x101,
"#00012F伊莉娅小姐好像相当乐在其中呢。\x02",
)
CloseMessageWindow()
#C0302
ChrTalk(
0x102,
"#00106F修利……真可怜。\x02",
)
CloseMessageWindow()
Sleep(50)
SetScenarioFlags(0x0, 7)
Jump("loc_5250")
label("loc_512F")
SetChrName("")
#A0303
AnonymousTalk(
0xFF,
(
scpstr(SCPSTR_CODE_COLOR, 0x5),
"从门内传来了\x01",
"伊莉娅和修利的\x01",
"嬉闹声。\x07\x00\x02",
)
)
CloseMessageWindow()
OP_57(0x0)
OP_5A()
SetMessageWindowPos(130, 20, -1, -1)
SetChrName("修利的声音")
#A0304
AnonymousTalk(
0xFF,
(
scpstr(SCPSTR_CODE_COLOR, 0x5),
"呼……呼……\x01",
"到底还要多久啊?\x02",
)
)
CloseMessageWindow()
SetMessageWindowPos(130, 20, -1, -1)
SetChrName("伊莉娅的声音")
#A0305
AnonymousTalk(
0xFF,
(
scpstr(SCPSTR_CODE_COLOR, 0x5),
"这个嘛……如果你\x01",
"能老实点,\x01",
"说不定可以早点结束哦⊥\x02",
)
)
CloseMessageWindow()
OP_63(0x0, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
OP_63(0x1, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
OP_63(0x2, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
OP_63(0x3, 0x0, 2000, 0x10, 0x13, 0xFA, 0x1)
Sound(23, 0, 100, 0)
Sleep(1000)
label("loc_5250")
Jump("loc_5272")
label("loc_5255")
Sound(807, 0, 100, 0)
SetChrName("")
#A0306
AnonymousTalk(
0xFF,
(
scpstr(SCPSTR_CODE_COLOR, 0x5),
"门上了锁。\x02",
)
)
CloseMessageWindow()
OP_57(0x0)
OP_5A()
label("loc_5272")
TalkEnd(0xFF)
Return()
# Function_18_4F89 end
def Function_19_5276(): pass
label("Function_19_5276")
EventBegin(0x0)
Fade(500)
OP_68(-42750, 2270, 60900, 0)
MoveCamera(58, 28, 0, 0)
OP_6E(440, 0)
SetCameraDistance(23950, 0)
SetChrPos(0xB, -40610, 1030, 60630, 270)
SetChrPos(0x101, -42710, 1020, 61350, 90)
SetChrPos(0x102, -42900, 1020, 60110, 90)
SetChrPos(0x103, -44070, 1020, 61440, 90)
SetChrPos(0x104, -44470, 1020, 60240, 90)
SetChrPos(0x109, -45710, 1020, 61170, 90)
SetChrPos(0x105, -45790, 1020, 59690, 90)
ClearChrFlags(0x4, 0x80)
ClearChrBattleFlags(0x4, 0x8000)
ClearChrFlags(0x5, 0x80)
ClearChrBattleFlags(0x5, 0x8000)
OP_4B(0xB, 0xFF)
OP_0D()
#C0307
ChrTalk(
0xB,
(
"#2P哎呀,你们……\x01",
"找我有什么事吗?\x02",
)
)
CloseMessageWindow()
#C0308
ChrTalk(
0x101,
(
"#00004F突然拜访,\x01",
"真是不好意思……\x02\x03",
"#00000F请问您对盖巴尔\x01",
"这个名字有印象吗?\x02",
)
)
CloseMessageWindow()
OP_63(0xB, 0x0, 2000, 0x26, 0x26, 0xFA, 0x1)
Sleep(1000)
#C0309
ChrTalk(
0xB,
"#2P嗯?你们认识盖巴尔吗?\x02",
)
CloseMessageWindow()
#C0310
ChrTalk(
0xB,
(
"#2P在他担当议员的时候,\x01",
"我曾经照顾过他……\x02",
)
)
CloseMessageWindow()
#C0311
ChrTalk(
0x105,
"#10300F呵呵,似乎找对地方了。\x02",
)
CloseMessageWindow()
#C0312
ChrTalk(
0x102,
"#00100F其实是这样……\x02",
)
CloseMessageWindow()
SetChrName("")
#A0313
AnonymousTalk(
0xFF,
(
scpstr(SCPSTR_CODE_COLOR, 0x5),
"罗伊德等人向对方解释了\x01",
"盖巴尔的儿子儿媳正在找他的情况。\x07\x00\x02",
)
)
CloseMessageWindow()
OP_57(0x0)
OP_5A()
#C0314
ChrTalk(
0xB,
(
"#2P嗯,原来如此,\x01",
"你们是受他们所托……\x02",
)
)
CloseMessageWindow()
#C0315
ChrTalk(
0xB,
(
"#2P其实……在不久之前,\x01",
"盖巴尔曾来找过我,\x01",
"希望我帮他『在克洛斯贝尔隐居生活』。\x02",
)
)
CloseMessageWindow()
#C0316
ChrTalk(
0xB,
(
"#2P哎呀呀,真是个蠢材……\x01",
"有那么好的儿子和儿媳,\x01",
"为什么要逃跑呢?\x02",
)
)
CloseMessageWindow()
#C0317
ChrTalk(
0x103,
(
"#00205F您果然知道\x01",
"盖巴尔先生的行踪啊。\x02",
)
)
CloseMessageWindow()
#C0318
ChrTalk(
0x104,
(
"#00305F不过,所谓的『隐居』\x01",
"又是怎么回事呢?\x02\x03",
"#00303F我们完全搞不懂理由……\x02",
)
)
CloseMessageWindow()
#C0319
ChrTalk(
0x109,
(
"#10101F是、是啊!\x01",
"阿鲁姆先生一家特意\x01",
"过来见他……\x02",
)
)
CloseMessageWindow()
#C0320
ChrTalk(
0xB,
(
"#2P唔,在外人看来,\x01",
"这个原因或许很无聊……\x02",
)
)
CloseMessageWindow()
#C0321
ChrTalk(
0xB,
(
"#2P……不,这件事情\x01",
"不应该由我来说。\x02",
)
)
CloseMessageWindow()
OP_63(0x101, 0x0, 2000, 0x0, 0x1, 0xFA, 0x2)
Sound(29, 0, 100, 0)
Sleep(50)
OP_63(0x102, 0x0, 2000, 0x0, 0x1, 0xFA, 0x2)
Sound(29, 0, 100, 0)
Sleep(50)
OP_63(0x103, 0x0, 2000, 0x0, 0x1, 0xFA, 0x2)
Sound(29, 0, 100, 0)
Sleep(50)
OP_63(0x104, 0x0, 2000, 0x0, 0x1, 0xFA, 0x2)
Sound(29, 0, 100, 0)
Sleep(50)
OP_63(0x109, 0x0, 2000, 0x0, 0x1, 0xFA, 0x2)
Sound(29, 0, 100, 0)
Sleep(50)
OP_63(0x105, 0x0, 2000, 0x0, 0x1, 0xFA, 0x2)
Sound(29, 0, 100, 0)
Sleep(1000)
#C0322
ChrTalk(
0xB,
(
"#2P……那家伙现在应该在\x01",
"阿尔摩利卡村。\x02",
)
)
CloseMessageWindow()
#C0323
ChrTalk(
0xB,
(
"#2P你们过去找找,应该能找到,\x01",
"具体情况就问他本人好了。\x02",
)
)
CloseMessageWindow()
#C0324
ChrTalk(
0x101,
(
"#00003F明白了……\x01",
"非常感谢。\x02\x03",
"#00000F我们这就去\x01",
"阿尔摩利卡村吧。\x02",
)
)
CloseMessageWindow()
#C0325
ChrTalk(
0x102,
"#00100F嗯,出发吧。\x02",
)
CloseMessageWindow()
OP_57(0x0)
OP_5A()
FadeToDark(1000, 0, -1)
OP_0D()
OP_29(0x90, 0x1, 0x2)
SetScenarioFlags(0x19B, 0)
OP_4C(0xB, 0xFF)
OP_69(0xFF, 0x0)
SetChrPos(0x0, -49950, 1000, 56930, 180)
SetChrFlags(0x4, 0x80)
SetChrBattleFlags(0x4, 0x8000)
SetChrFlags(0x5, 0x80)
SetChrBattleFlags(0x5, 0x8000)
EventEnd(0x5)
Return()
# Function_19_5276 end
SaveToFile()
Try(main)
|
[
"zj.yang@qq.com"
] |
zj.yang@qq.com
|
a27bda39e27fe7722257c069bf1ba6f0904bd697
|
d42cdbf5f8188c63e4df000680d7cd81dab54c12
|
/test/__init__.py
|
c1fd301df0a1a190692f7a51cb6c3a730ab76ebc
|
[
"BSD-2-Clause",
"LicenseRef-scancode-warranty-disclaimer"
] |
permissive
|
openafs-contrib/afsutil
|
d7b30c172eac02577bd0f74f5a55d0eff5a3e9ab
|
05c5cf9be3d7d1b82701049d56e8404b7a2cf8cb
|
refs/heads/master
| 2021-07-19T10:24:40.111759
| 2021-07-08T12:23:50
| 2021-07-08T13:20:06
| 119,130,429
| 1
| 4
|
NOASSERTION
| 2021-07-08T13:20:07
| 2018-01-27T03:54:38
|
Python
|
UTF-8
|
Python
| false
| false
| 122
|
py
|
from test.test_system import SystemTest
from test.test_keytab import KeytabTest
from test.test_package import PackageTest
|
[
"mmeffie@sinenomine.net"
] |
mmeffie@sinenomine.net
|
583929ad0765fe89d9a7f1fc8b3f321c8cb5bdbe
|
6b78bd7f62f7f407bf11d877cc4d91e7db3b62fe
|
/csc/python/week-3-ds/src/day3/lru_cache/lru_cache.py
|
b8009b5e6480947a1769a37d0687614b451baee4
|
[] |
no_license
|
PascalUlor/code-challenges
|
b85efacd4bc5999a0748d1fa1e84f503be09dc94
|
6488d0a6d2729bd50b106573f16488479fd6e264
|
refs/heads/master
| 2023-03-03T17:50:18.413127
| 2023-02-21T13:10:02
| 2023-02-21T13:10:02
| 212,979,719
| 1
| 0
| null | 2023-02-15T22:59:13
| 2019-10-05T10:14:29
|
Python
|
UTF-8
|
Python
| false
| false
| 2,759
|
py
|
from doubly_linked_list import DoublyLinkedList
class LRUCache:
"""
Our LRUCache class keeps track of the max number of nodes it
can hold, the current number of nodes it is holding, a doubly-
linked list that holds the key-value entries in the correct
order, as well as a storage dict that provides fast access
to every node stored in the cache.
"""
def __init__(self, limit=10):
self.limit = limit
self.size = 0
self.order = DoublyLinkedList()
self.storage = dict()
"""
Retrieves the value associated with the given key. Also
needs to move the key-value pair to the end of the order
such that the pair is considered most-recently used.
Returns the value associated with the key or None if the
key-value pair doesn't exist in the cache.
"""
def get(self, key):
# if the key exists in the storage
if key in self.storage:
# set the node to the item at the key in storage
node = self.storage[key]
# move the node to end of order
self.order.move_to_end(node)
# return the nodes value
return node.value[1]
# otherwise
else:
# return None
return None
"""
Adds the given key-value pair to the cache. The newly-
added pair should be considered the most-recently used
entry in the cache. If the cache is already at max capacity
before this entry is added, then the oldest entry in the
cache needs to be removed to make room. Additionally, in the
case that the key already exists in the cache, we simply
want to overwrite the old value associated with the key with
the newly-specified value.
"""
def set(self, key, value):
# if key exists in storage
if key in self.storage:
# set the node to the storage at the key
node = self.storage[key]
# set the nodes value to the key value pair
node.value = (key, value)
# move the node to the end and
self.order.move_to_end(node)
# return to caller
return
# if the size is reaching the limit
if self.size == self.limit:
# delete the item at the head of the storage order
del self.storage[self.order.head.value[0]]
# remove node from head of the order
self.order.remove_from_head()
# decrement the size
self.size -= 1
# add the key value pair to the orders tail
self.order.add_to_tail((key, value))
# set the storage at key to the orders tail
self.storage[key] = self.order.tail
# increment size
self.size += 1
|
[
"pascalulor@yahoo.com"
] |
pascalulor@yahoo.com
|
5f9cd7cd2d9cea9cc9a1f16b39eca20fbfb64326
|
8cbe8ff380e170312a36a0213dfaddd71f0d8bf7
|
/accounts/admin.py
|
f619a6fecfd446404431f7a8e26f82aa010f4708
|
[] |
no_license
|
Gemy-star/bauhaus_new
|
60926aa9907b2b619a620d3ca0324ed7d99d08d1
|
270663f918c8965e9760ef547b89d3c8d7967120
|
refs/heads/main
| 2023-02-12T09:58:51.939396
| 2021-01-12T21:17:03
| 2021-01-12T21:17:03
| 321,507,414
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 3,099
|
py
|
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from .models import User
class AddUserForm(forms.ModelForm):
"""
New User Form. Requires password confirmation.
"""
password1 = forms.CharField(
label='Password', widget=forms.PasswordInput
)
password2 = forms.CharField(
label='Confirm password', widget=forms.PasswordInput
)
class Meta:
model = User
fields = (
'email', 'first_name', 'last_name', 'phone', 'is_engineer', 'is_outdoor_engineer', 'is_admin',
'is_customer',
'is_superuser',
'profile_pic', 'is_active', 'is_staff', 'user_type')
def clean_password2(self):
# Check that the two password entries match
password1 = self.cleaned_data.get("password1")
password2 = self.cleaned_data.get("password2")
if password1 and password2 and password1 != password2:
raise forms.ValidationError("Passwords do not match")
return password2
def save(self, commit=True):
# Save the provided password in hashed format
user = super().save(commit=False)
user.set_password(self.cleaned_data["password1"])
if commit:
user.save()
return user
class UpdateUserForm(forms.ModelForm):
"""
Update User Form. Doesn't allow changing password in the Admin.
"""
password = ReadOnlyPasswordHashField()
class Meta:
model = User
fields = (
'email', 'first_name', 'last_name', 'phone', 'is_engineer', 'is_outdoor_engineer', 'is_admin',
'is_customer',
'is_superuser',
'profile_pic', 'is_active', 'is_staff', 'user_type')
def clean_password(self):
# Password can't be changed in the admin
return self.initial["password"]
class UserAdmin(BaseUserAdmin):
form = UpdateUserForm
add_form = AddUserForm
list_display = ('email', 'first_name', 'last_name', 'is_staff', 'timestamp')
list_filter = ('is_staff',)
fieldsets = (
(None, {'fields': ('email', 'password')}),
('Personal info', {'fields': ('first_name', 'last_name', 'phone', 'address', 'profile_pic')}),
('Permissions', {'fields': (
'is_active', 'is_engineer', 'is_admin', 'is_customer', 'is_outdoor_engineer', 'user_type', 'is_staff')}),
)
add_fieldsets = (
(
None,
{
'classes': ('wide',),
'fields': (
'email', 'first_name', 'last_name', 'password1', 'profile_pic', 'password2',
'user_type', 'phone', 'address',
'is_active', 'is_engineer', 'is_admin', 'is_outdoor_engineer', 'is_customer'
)
}
),
)
search_fields = ('email', 'first_name', 'last_name')
ordering = ('email', 'first_name', 'last_name')
filter_horizontal = ()
admin.site.register(User, UserAdmin)
|
[
"m.yassen.93@gmail.com"
] |
m.yassen.93@gmail.com
|
375ca61df7f3c090b6cae7b47334f507cdcba96b
|
cb4ab4584c4feda3bb1826aafadfea462ecdbf42
|
/AIs/AI_PlanC/__init__.py
|
d40f31db6ffa0b9f248c9431ab20f861a8eab6c4
|
[
"MIT"
] |
permissive
|
rimpo/coding-world-cup
|
15660a570ca400c82f0966f302b9b4a7a8968c77
|
964e3b58637f768f6dc5976bf729d993d63b46ab
|
refs/heads/master
| 2020-12-02T22:49:53.789544
| 2017-09-11T15:47:24
| 2017-09-11T15:47:24
| 30,821,540
| 0
| 0
| null | 2015-02-21T01:56:31
| 2015-02-15T07:56:10
|
C#
|
UTF-8
|
Python
| false
| false
| 231
|
py
|
from .coding_worldcup_api import CodingWorldCupAPI
from .js_object import JSObject
from .goh_ai import GohAI
from .position import Position
from .vector import Vector
from .classes import MarginFactors, DirectionType, GoalType
|
[
"richard.s.shepherd@gmail.com"
] |
richard.s.shepherd@gmail.com
|
db8283120c322835780a8040b991fc6cd6140f64
|
8fa3634da0f827c57480051fab280903501fa007
|
/setup.py
|
4553dd8663c4ff0091c6649a2c32f26918cf3d92
|
[
"Apache-2.0"
] |
permissive
|
ahnan4arch/seldom-pytest
|
519a30cbe31edc57ab804088acfa6a9f72c6b681
|
40e252c686118d137927592d6749313470ea0481
|
refs/heads/main
| 2023-07-24T04:49:26.858053
| 2021-09-07T15:28:45
| 2021-09-07T15:28:45
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 1,328
|
py
|
import re
import ast
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('pytest_seldom/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))
setuptools.setup(
name="pytest-seldom",
version=version,
author="bugmaster",
author_email="fnngj@126.com",
description="A pytest wrapper with fixtures for Seldom to automate web browsers",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/seldomQA/seldom-pytest",
packages=["pytest_seldom"],
include_package_data=True,
install_requires=[
"pytest-html>=3.0.0",
"poium>=1.0.2",
"pytest",
"pytest-base-url",
],
entry_points={"pytest11": ["seldom = pytest_seldom.pytest_seldom"]},
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Framework :: Pytest",
],
python_requires=">=3.7",
setup_requires=["setuptools_scm"],
)
|
[
"defnngj@gmail.com"
] |
defnngj@gmail.com
|
0bb090af3d10eb68ea43ef977148e2339967fdfc
|
2c926b4847a44c7f831d47ed0160751d3248e8f4
|
/venv/lib/python3.8/site-packages/hubspot/crm/tickets/configuration.py
|
443c7cd845ef66e0d3a63f4179b7ba7d705fbfb7
|
[] |
no_license
|
Women-in-Tech-Society/WITS_Site
|
c42cd2c9abe1b5515b80be82dc876a6c3842e42a
|
5dbf22f5ee5a36358f6f279af4c13d86d31653c5
|
refs/heads/main
| 2023-05-11T02:34:05.531902
| 2021-06-01T01:05:12
| 2021-06-01T01:05:12
| 278,658,100
| 0
| 5
| null | 2022-11-22T18:41:35
| 2020-07-10T14:43:28
|
Python
|
UTF-8
|
Python
| false
| false
| 13,761
|
py
|
# coding: utf-8
"""
Tickets
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v3
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import copy
import logging
import multiprocessing
import sys
import urllib3
import six
from six.moves import http_client as httplib
class Configuration(object):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
:param host: Base url
:param api_key: Dict to store API key(s).
Each entry in the dict specifies an API key.
The dict key is the name of the security scheme in the OAS specification.
The dict value is the API key secret.
:param api_key_prefix: Dict to store API prefix (e.g. Bearer)
The dict key is the name of the security scheme in the OAS specification.
The dict value is an API key prefix when generating the auth data.
:param username: Username for HTTP basic authentication
:param password: Password for HTTP basic authentication
:param discard_unknown_keys: Boolean value indicating whether to discard
unknown properties. A server may send a response that includes additional
properties that are not known by the client in the following scenarios:
1. The OpenAPI document is incomplete, i.e. it does not match the server
implementation.
2. The client was generated using an older version of the OpenAPI document
and the server has been upgraded since then.
If a schema in the OpenAPI document defines the additionalProperties attribute,
then all undeclared properties received by the server are injected into the
additional properties map. In that case, there are undeclared properties, and
nothing to discard.
:Example:
API Key Authentication Example.
Given the following security scheme in the OpenAPI specification:
components:
securitySchemes:
cookieAuth: # name for the security scheme
type: apiKey
in: cookie
name: JSESSIONID # cookie name
You can programmatically set the cookie:
conf = hubspot.crm.tickets.Configuration(
api_key={'cookieAuth': 'abc123'}
api_key_prefix={'cookieAuth': 'JSESSIONID'}
)
The following cookie will be added to the HTTP request:
Cookie: JSESSIONID abc123
"""
_default = None
def __init__(
self,
host="https://api.hubapi.com",
api_key=None,
api_key_prefix=None,
username=None,
password=None,
discard_unknown_keys=False,
):
"""Constructor"""
self.host = host
"""Default Base url
"""
self.temp_folder_path = None
"""Temp file folder for downloading files
"""
# Authentication Settings
self.api_key = {}
if api_key:
self.api_key = api_key
"""dict to store API key(s)
"""
self.api_key_prefix = {}
if api_key_prefix:
self.api_key_prefix = api_key_prefix
"""dict to store API prefix (e.g. Bearer)
"""
self.refresh_api_key_hook = None
"""function hook to refresh API key if expired
"""
self.username = username
"""Username for HTTP basic authentication
"""
self.password = password
"""Password for HTTP basic authentication
"""
self.discard_unknown_keys = discard_unknown_keys
self.access_token = None
"""access token for OAuth/Bearer
"""
self.logger = {}
"""Logging Settings
"""
self.logger["package_logger"] = logging.getLogger("hubspot.crm.tickets")
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
self.logger_format = "%(asctime)s %(levelname)s %(message)s"
"""Log format
"""
self.logger_stream_handler = None
"""Log stream handler
"""
self.logger_file_handler = None
"""Log file handler
"""
self.logger_file = None
"""Debug file location
"""
self.debug = False
"""Debug switch
"""
self.verify_ssl = True
"""SSL/TLS verification
Set this to false to skip verifying SSL certificate when calling API
from https server.
"""
self.ssl_ca_cert = None
"""Set this to customize the certificate file to verify the peer.
"""
self.cert_file = None
"""client certificate file
"""
self.key_file = None
"""client key file
"""
self.assert_hostname = None
"""Set this to True/False to enable/disable SSL hostname verification.
"""
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
"""urllib3 connection pool's maximum number of connections saved
per pool. urllib3 uses 1 connection as default value, but this is
not the best value when you are making a lot of possibly parallel
requests to the same host, which is often the case here.
cpu_count * 5 is used as default value to increase performance.
"""
self.proxy = None
"""Proxy URL
"""
self.proxy_headers = None
"""Proxy headers
"""
self.safe_chars_for_path_param = ""
"""Safe chars for path_param
"""
self.retries = None
"""Adding retries to override urllib3 default value 3
"""
# Disable client side validation
self.client_side_validation = False
def __deepcopy__(self, memo):
cls = self.__class__
result = cls.__new__(cls)
memo[id(self)] = result
for k, v in self.__dict__.items():
if k not in ("logger", "logger_file_handler"):
setattr(result, k, copy.deepcopy(v, memo))
# shallow copy of loggers
result.logger = copy.copy(self.logger)
# use setters to configure loggers
result.logger_file = self.logger_file
result.debug = self.debug
return result
def __setattr__(self, name, value):
object.__setattr__(self, name, value)
@classmethod
def set_default(cls, default):
"""Set default instance of configuration.
It stores default configuration, which can be
returned by get_default_copy method.
:param default: object of Configuration
"""
cls._default = copy.deepcopy(default)
@classmethod
def get_default_copy(cls):
"""Return new instance of configuration.
This method returns newly created, based on default constructor,
object of Configuration class or returns a copy of default
configuration passed by the set_default method.
:return: The configuration object.
"""
if cls._default is not None:
return copy.deepcopy(cls._default)
return Configuration()
@property
def logger_file(self):
"""The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
"""
return self.__logger_file
@logger_file.setter
def logger_file(self, value):
"""The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
"""
self.__logger_file = value
if self.__logger_file:
# If set logging file,
# then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter)
for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_file_handler)
@property
def debug(self):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
return self.__debug
@debug.setter
def debug(self, value):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.DEBUG)
# turn on httplib debug
httplib.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.WARNING)
# turn off httplib debug
httplib.HTTPConnection.debuglevel = 0
@property
def logger_format(self):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
return self.__logger_format
@logger_format.setter
def logger_format(self, value):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
self.__logger_format = value
self.logger_formatter = logging.Formatter(self.__logger_format)
def get_api_key_with_prefix(self, identifier):
"""Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
:return: The token for api key authentication.
"""
if self.refresh_api_key_hook is not None:
self.refresh_api_key_hook(self)
key = self.api_key.get(identifier)
if key:
prefix = self.api_key_prefix.get(identifier)
if prefix:
return "%s %s" % (prefix, key)
else:
return key
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
username = ""
if self.username is not None:
username = self.username
password = ""
if self.password is not None:
password = self.password
return urllib3.util.make_headers(basic_auth=username + ":" + password).get(
"authorization"
)
def auth_settings(self):
"""Gets Auth Settings dict for api client.
:return: The Auth Settings information dict.
"""
auth = {}
if "hapikey" in self.api_key:
auth["hapikey"] = {
"type": "api_key",
"in": "query",
"key": "hapikey",
"value": self.get_api_key_with_prefix("hapikey"),
}
if self.access_token is not None:
auth["oauth2"] = {
"type": "oauth2",
"in": "header",
"key": "Authorization",
"value": "Bearer " + self.access_token,
}
return auth
def to_debug_report(self):
"""Gets the essential information for debugging.
:return: The report for debugging.
"""
return (
"Python SDK Debug Report:\n"
"OS: {env}\n"
"Python Version: {pyversion}\n"
"Version of the API: v3\n"
"SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version)
)
def get_host_settings(self):
"""Gets an array of host settings
:return: An array of host settings
"""
return [
{
"url": "https://api.hubapi.com/",
"description": "No description provided",
}
]
def get_host_from_settings(self, index, variables=None):
"""Gets host URL based on the index and variables
:param index: array index of the host settings
:param variables: hash of variable and the corresponding value
:return: URL based on host settings
"""
variables = {} if variables is None else variables
servers = self.get_host_settings()
try:
server = servers[index]
except IndexError:
raise ValueError(
"Invalid index {0} when selecting the host settings. "
"Must be less than {1}".format(index, len(servers))
)
url = server["url"]
# go through variables and replace placeholders
for variable_name, variable in server["variables"].items():
used_value = variables.get(variable_name, variable["default_value"])
if "enum_values" in variable and used_value not in variable["enum_values"]:
raise ValueError(
"The variable `{0}` in the host URL has invalid value "
"{1}. Must be {2}.".format(
variable_name, variables[variable_name], variable["enum_values"]
)
)
url = url.replace("{" + variable_name + "}", used_value)
return url
|
[
"mhuda@uwo.ca"
] |
mhuda@uwo.ca
|
c1d05b21f21eda71db21e7fb3630c69eb6861bcd
|
460e920c18fe887cb2b07ca57fe2ad422ce7d0ce
|
/blog/admin.py
|
73067696a3e0be1372d1b776763f378177638aa8
|
[] |
no_license
|
acid-n/mydjangoBlog
|
893a4c1c7027c79fde3df5dd5c0feb82d8c252f6
|
e1f62b4f1504ecc13dfbd56a1c5be6b28951ba40
|
refs/heads/master
| 2020-09-12T19:14:44.187413
| 2019-11-18T19:07:17
| 2019-11-18T19:07:17
| 222,522,745
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 696
|
py
|
from django.contrib import admin
from .models import Post, Comment
# Register your models here.
@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
list_display = ('title', 'slug', 'author', 'publish', 'status')
list_filter = ('status', 'created', 'publish', 'author')
search_fields = ('title', 'body')
prepopulated_fields = {'slug': ('title',)}
raw_id_fields = ('author',)
date_hierarchy = 'publish'
ordering = ('status', 'publish')
@admin.register(Comment)
class CommentAdmin(admin.ModelAdmin):
list_display = ('name', 'email', 'post', 'created', 'active')
list_filter = ('active', 'created', 'updated')
search_fields = ('name', 'email', 'body')
|
[
"acid_n@mail.ru"
] |
acid_n@mail.ru
|
019c0ed062113a64f1e603810b203815292dd381
|
de24f83a5e3768a2638ebcf13cbe717e75740168
|
/moodledata/vpl_data/428/usersdata/283/107193/submittedfiles/jogoDaVelha_BIB.py
|
e2b4bef73c9efc099c931cc3a9bb86ef4b724633
|
[] |
no_license
|
rafaelperazzo/programacao-web
|
95643423a35c44613b0f64bed05bd34780fe2436
|
170dd5440afb9ee68a973f3de13a99aa4c735d79
|
refs/heads/master
| 2021-01-12T14:06:25.773146
| 2017-12-22T16:05:45
| 2017-12-22T16:05:45
| 69,566,344
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 10,021
|
py
|
# -*- coding: utf-8 -*-
# COLOQUE SUA BIBLIOTECA A PARTIR DAQUI
def sorteio(x,y):
import random
sort=random.randint(0,2)
if sort==0:
return(0)
if sort==2:
return(2)
def sorteio2(x,y):
import random
sort=random.randint(0,2)
if sort==0:
return(0)
elif sort==2:
return(2)
else:
return(1)
def verificar_vitoria(x):
cont=0
#analise linha
if x[0][0]==x[0][1] and x[0][1]==x[0][2] and x[0][1]!=' ':
cont+=1
elif x[1][0]==x[1][1] and x[1][1]==x[1][2] and x[1][1]!=' ':
cont+=1
elif x[2][0]==x[2][1] and x[2][1]==x[2][2] and x[2][1]!=' ':
cont+=1
#Vitoria na coluna
elif x[0][0]==x[1][0] and x[1][0]==x[2][0] and x[0][0]!=' ':
cont+=1
elif x[0][1]==x[1][1] and x[1][1]==x[2][1] and x[2][1]!=' ':
cont+=1
elif x[0][2]==x[1][2] and x[1][2]==x[2][2] and x[2][2]!=' ':
cont+=1
#vitoria diagonal
elif x[0][0]==x[1][1] and x[1][1]==x[2][2] and x[1][1]!=' ':
cont+=1
elif x[2][0]==x[1][1] and x[1][1]==x[0][2] and x[1][1]!=' ':
cont+=1
if cont==0:
return False
else:
return True
def mostrar_tabuleiro(tabuleiro):
return print('',tabuleiro[0][0],'|',tabuleiro[0][1],'|',tabuleiro[0][2],'\n',tabuleiro[1][0],'|',tabuleiro[1][1],'|',tabuleiro[1][2],'\n',tabuleiro[2][0],'|',tabuleiro[2][1],'|',tabuleiro[2][2])
def maquinainteligente(x):
from jogoDaVelha_BIB import sorteio2
cont=0
#analise linha
#primeira
if x[0][0]!=x[0][1] and x[0][1]==x[0][2] and x[0][0]==' ':
return '00'
elif x[0][0]==x[0][1] and x[0][1]!=x[0][2] and x[0][2]==' ':
return '02'
elif x[0][0]==x[0][2] and x[0][1]!=x[0][2] and x[0][1]==' ':
return '01'
#segunda
elif x[1][0]!=x[1][1] and x[1][1]==x[1][2] and x[1][0]==' ':
return '10'
elif x[1][0]==x[1][1] and x[1][1]!=x[1][2] and x[1][2]==' ':
return '12'
elif x[1][0]==x[1][2] and x[1][1]!=x[1][2] and x[1][1]==' ':
return '11'
#terceira
elif x[2][0]!=x[2][1] and x[2][1]==x[2][2] and x[2][0]==' ':
return '20'
elif x[2][0]==x[2][1] and x[2][1]!=x[2][2] and x[2][2]==' ':
return '22'
elif x[2][0]==x[2][2] and x[2][1]!=x[2][2] and x[2][1]==' ':
return '21'
#coluna
#primeira
elif x[0][0]!=x[1][0] and x[1][0]==x[2][0] and x[0][0]==' ':
return '00'
elif x[0][0]==x[1][0] and x[1][0]!=x[2][0] and x[2][0]==' ':
return '20'
elif x[0][0]==x[2][0] and x[1][0]!=x[2][0] and x[1][0]==' ':
return '10'
#segunda
elif x[0][1]!=x[1][1] and x[1][1]==x[2][1] and x[0][1]==' ':
return '01'
elif x[0][1]==x[1][1] and x[1][1]!=x[2][1] and x[2][1]==' ':
return '21'
elif x[0][1]==x[2][1] and x[1][1]!=x[2][1] and x[1][1]==' ':
return '11'
#terceira
elif x[0][2]!=x[1][2] and x[1][2]==x[2][2] and x[0][2]==' ':
return '02'
elif x[0][2]==x[1][2] and x[1][2]!=x[2][2] and x[2][2]==' ':
return '22'
elif x[0][2]==x[2][2] and x[1][2]!=x[2][2] and x[1][2]==' ':
return '12'
#vitoria diagonal
elif x[0][0]!=x[1][1] and x[1][1]==x[2][2] and x[0][0]==' ':
return '00'
elif x[0][0]==x[1][1] and x[1][1]!=x[2][2] and x[2][2]==' ':
return '22'
elif x[0][0]==x[2][2] and x[1][1]!=x[2][2] and x[1][1]==' ':
return '11'
elif x[2][0]!=x[1][1] and x[1][1]==x[0][2] and x[2][0]==' ':
return '20'
elif x[2][0]==x[1][1] and x[1][1]!=x[0][2] and x[0][2]==' ':
return '02'
elif x[2][0]==x[0][2] and x[1][1]!=x[0][2] and x[1][1]==' ':
return '11'
else:
return(str(sorteio2(0,2))+str(sorteio2(0,2)))
def maquinainteligente2(x,s2):
from jogoDaVelha_BIB import sorteio2
#analise linha
#primeira
if x[0][0]!=x[0][1] and x[0][1]==s2 and x[0][1]==x[0][2] and x[0][0]==' ':
return '00'
elif x[0][0]==x[0][1] and x[0][1]==s2 and x[0][1]!=x[0][2] and x[0][2]==' ':
return '02'
elif x[0][0]==x[0][2] and x[0][2]==s2 and x[0][1]!=x[0][2] and x[0][1]==' ':
return '01'
#segunda
elif x[1][0]!=x[1][1] and x[1][1]==s2 and x[1][1]==x[1][2] and x[1][0]==' ':
return '10'
elif x[1][0]==x[1][1] and x[1][1]==s2 and x[1][1]!=x[1][2] and x[1][2]==' ':
return '12'
elif x[1][0]==x[1][2] and x[1][2]==s2 and x[1][1]!=x[1][2] and x[1][1]==' ':
return '11'
#terceira
elif x[2][0]!=x[2][1] and x[2][1]==s2 and x[2][1]==x[2][2] and x[2][0]==' ':
return '20'
elif x[2][0]==x[2][1] and x[2][1]==s2 and x[2][1]!=x[2][2] and x[2][2]==' ':
return '22'
elif x[2][0]==x[2][2] and x[2][2]==s2 and x[2][1]!=x[2][2] and x[2][1]==' ':
return '21'
#coluna
#primeira
elif x[0][0]!=x[1][0] and x[1][0]==s2 and x[1][0]==x[2][0] and x[0][0]==' ':
return '00'
elif x[0][0]==x[1][0] and x[0][0]==s2 and x[1][0]!=x[2][0] and x[2][0]==' ':
return '20'
elif x[0][0]==x[2][0] and x[0][0]==s2 and x[1][0]!=x[2][0] and x[1][0]==' ':
return '10'
#segunda
elif x[0][1]!=x[1][1] and x[1][1]==s2 and x[1][1]==x[2][1] and x[0][1]==' ':
return '01'
elif x[0][1]==x[1][1] and x[0][1]==s2 and x[1][1]!=x[2][1] and x[2][1]==' ':
return '21'
elif x[0][1]==x[2][1] and x[0][1]==s2 and x[1][1]!=x[2][1] and x[1][1]==' ':
return '11'
#terceira
elif x[0][2]!=x[1][2] and x[2][2]==s2 and x[1][2]==x[2][2] and x[0][2]==' ':
return '02'
elif x[0][2]==x[1][2] and x[0][2]==s2 and x[1][2]!=x[2][2] and x[2][2]==' ':
return '22'
elif x[0][2]==x[2][2] and x[0][2]==s2 and x[1][2]!=x[2][2] and x[1][2]==' ':
return '12'
#vitoria diagonal
elif x[0][0]!=x[1][1] and x[1][1]==s2 and x[1][1]==x[2][2] and x[0][0]==' ':
return '00'
elif x[0][0]==x[1][1] and x[1][1]==s2 and x[1][1]!=x[2][2] and x[2][2]==' ':
return '22'
elif x[0][0]==x[2][2] and x[0][0]==s2 and x[1][1]!=x[2][2] and x[1][1]==' ':
return '11'
elif x[2][0]!=x[1][1] and x[1][1]==s2 and x[1][1]==x[0][2] and x[2][0]==' ':
return '20'
elif x[2][0]==x[1][1] and x[1][1]==s2 and x[1][1]!=x[0][2] and x[0][2]==' ':
return '02'
elif x[2][0]==x[0][2] and x[0][2]==s2 and x[1][1]!=x[0][2] and x[1][1]==' ':
return '11'
elif x[0][0]!=x[0][1] and x[0][1]==x[0][2] and x[0][0]==' ':
return '00'
elif x[0][0]==x[0][1] and x[0][1]!=x[0][2] and x[0][2]==' ':
return '02'
elif x[0][0]==x[0][2] and x[0][1]!=x[0][2] and x[0][1]==' ':
return '01'
#segunda
elif x[1][0]!=x[1][1] and x[1][1]==x[1][2] and x[1][0]==' ':
return '10'
elif x[1][0]==x[1][1] and x[1][1]!=x[1][2] and x[1][2]==' ':
return '12'
elif x[1][0]==x[1][2] and x[1][1]!=x[1][2] and x[1][1]==' ':
return '11'
#terceira
elif x[2][0]!=x[2][1] and x[2][1]==x[2][2] and x[2][0]==' ':
return '20'
elif x[2][0]==x[2][1] and x[2][1]!=x[2][2] and x[2][2]==' ':
return '22'
elif x[2][0]==x[2][2] and x[2][1]!=x[2][2] and x[2][1]==' ':
return '21'
#coluna
#primeira
elif x[0][0]!=x[1][0] and x[1][0]==x[2][0] and x[0][0]==' ':
return '00'
elif x[0][0]==x[1][0] and x[1][0]!=x[2][0] and x[2][0]==' ':
return '20'
elif x[0][0]==x[2][0] and x[1][0]!=x[2][0] and x[1][0]==' ':
return '10'
#segunda
elif x[0][1]!=x[1][1] and x[1][1]==x[2][1] and x[0][1]==' ':
return '01'
elif x[0][1]==x[1][1] and x[1][1]!=x[2][1] and x[2][1]==' ':
return '21'
elif x[0][1]==x[2][1] and x[1][1]!=x[2][1] and x[1][1]==' ':
return '11'
#terceira
elif x[0][2]!=x[1][2] and x[1][2]==x[2][2] and x[0][2]==' ':
return '02'
elif x[0][2]==x[1][2] and x[1][2]!=x[2][2] and x[2][2]==' ':
return '22'
elif x[0][2]==x[2][2] and x[1][2]!=x[2][2] and x[1][2]==' ':
return '12'
#vitoria diagonal
elif x[0][0]!=x[1][1] and x[1][1]==x[2][2] and x[0][0]==' ':
return '00'
elif x[0][0]==x[1][1] and x[1][1]!=x[2][2] and x[2][2]==' ':
return '22'
elif x[0][0]==x[2][2] and x[1][1]!=x[2][2] and x[1][1]==' ':
return '11'
elif x[2][0]!=x[1][1] and x[1][1]==x[0][2] and x[2][0]==' ':
return '20'
elif x[2][0]==x[1][1] and x[1][1]!=x[0][2] and x[0][2]==' ':
return '02'
elif x[2][0]==x[0][2] and x[1][1]!=x[0][2] and x[1][1]==' ':
return '11'
else:
if x[1][1]==' ':
return '11'
#diagonal principal
elif x[0][0]==x[1][1] and x[0][1]==' ':
return '01'
elif x[1][1]==x[2][2] and x[2][1]==' ':
return '21'
#diagonal secundária
elif x[2][0]==x[1][1] and x[2][1]==' ':
return '21'
elif x[0][2]==x[1][1] and x[0][1]==' ':
return '01'
else:
return(str(sorteio2(0,2))+str(sorteio2(0,2)))
def jogadausuario(nome1,tabuleiro,s1):
jogada=str(input('Qual a sua jogada, '+nome1+'?'))
while True:
if jogada in '000102101112202122':
break
else:
x==str(input('Qual a sua jogada, '+nome1+'?'))
continue
i=jogada[0]
j=jogada[1]
i=int(i)
j=int(j)
while tabuleiro[i][j]!=" ":
print('Jogada inválida')
jogada=str(input('Qual a sua jogada, '+nome1+'?'))
i=jogada[0]
j=jogada[1]
i=int(i)
j=int(j)
tabuleiro[i][j]=s1
return tabuleiro
def simbolo(nome1):
s1=str(input('Qual símbolo você deseja utilizar,'+nome1+'?[X/O]'))
while s1!='O' and s1!='X':
print('Símbolo inválido')
s1=simbolo(nome1)
return s1
|
[
"rafael.mota@ufca.edu.br"
] |
rafael.mota@ufca.edu.br
|
fccad511ed6b1da264dece544d72513fcfa263c0
|
16bcda63a6bba61af0c835aabd73b0467696be4a
|
/SymmetricDifference/main.py
|
e1c9af5ac1b754656877c686ed64ee3aaaab231e
|
[] |
no_license
|
ZirvedaAytimur/HackerRank_Python
|
8ea7d629e75b4db31e04c64d102bf7a0a0b5632b
|
175017ed3d8ff11385e12e926b94da97797fc094
|
refs/heads/master
| 2023-03-13T13:00:42.225364
| 2021-03-10T20:36:18
| 2021-03-10T20:36:18
| 288,210,152
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 249
|
py
|
n = int(input())
a = set(map(int, input().split()))
m = int(input())
b = set(map(int, input().split()))
differenceAB = a.difference(b)
differenceBA = b.difference(a)
result = sorted(differenceAB.union(differenceBA))
for i in result:
print(i)
|
[
"zirvedaytimur@gmail.com"
] |
zirvedaytimur@gmail.com
|
eceba96f45693fbccf22d2a2e037432f1a9a458c
|
05caf48bd067c050666026b75686f23d02327378
|
/weekly-contest-141/shortest-path-in-binary-matrix.py
|
b7a5d64bbebde05852b1100a7d86ae4af78e79ec
|
[
"MIT"
] |
permissive
|
elfgzp/Leetcode
|
3b6fa307c699fd5a1ba5ea88988c324c33a83eb7
|
964c6574d310a9a6c486bf638487fd2f72b83b3f
|
refs/heads/master
| 2023-08-21T23:11:38.265884
| 2020-10-17T11:55:45
| 2020-10-17T11:55:45
| 168,635,331
| 3
| 0
|
MIT
| 2023-07-21T03:50:43
| 2019-02-01T03:14:49
|
Python
|
UTF-8
|
Python
| false
| false
| 898
|
py
|
from collections import deque
class Solution:
def shortestPathBinaryMatrix(self, grid: List[List[int]]) -> int:
n = len(grid)
if grid[0][0] == 1 or grid[-1][-1] == 1:
return -1
queue = deque([((0,0), 1)])
visited = {(0, 0)}
drs = [-1, 0, 1]
dcs = [-1, 0, 1]
while queue:
cur, step = queue.popleft()
r0, c0 = cur
if r0 == n - 1 and c0 == n - 1:
return step
for dr in drs:
for dc in dcs:
r, c = r0 + dr, c0 + dc
if 0 <= r < n and 0 <= c < n and grid[r][c] == 0 and (r, c) not in visited:
visited.add((r, c))
queue.append(((r, c), step + 1))
return -1
|
[
"741424975@qq.com"
] |
741424975@qq.com
|
04079eb6b97a903bfedd18ebb106ac3da4b525a1
|
bed92adc6d81e86f5345f2ce58f7e6ccb46bcd97
|
/实验室数据分析/病毒学相关/TCID50-4.0.py
|
a2a653e48b300cb7c3134200022e7330a84f31a0
|
[] |
no_license
|
huoweikong/vscode-python-kiton
|
45b359075ebdc4ab278ce4ee25f901ffc10528b8
|
47d6bb78ba810fd82f8eb003ecb439f32b48a0ee
|
refs/heads/master
| 2023-01-19T17:50:47.208244
| 2020-11-26T09:22:03
| 2020-11-26T09:22:03
| 313,870,114
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 24,138
|
py
|
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'TCID50-4.0.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1122, 787)
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(12)
MainWindow.setFont(font)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.groupBox = QtWidgets.QGroupBox(self.centralwidget)
self.groupBox.setGeometry(QtCore.QRect(30, 20, 1041, 411))
self.groupBox.setAutoFillBackground(False)
self.groupBox.setObjectName("groupBox")
self.lineEdit_10 = QtWidgets.QLineEdit(self.groupBox)
self.lineEdit_10.setGeometry(QtCore.QRect(340, 280, 51, 31))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.lineEdit_10.setFont(font)
self.lineEdit_10.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_10.setObjectName("lineEdit_10")
self.label_2 = QtWidgets.QLabel(self.groupBox)
self.label_2.setGeometry(QtCore.QRect(40, 180, 281, 51))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.label_2.setFont(font)
self.label_2.setObjectName("label_2")
self.comboBox = QtWidgets.QComboBox(self.groupBox)
self.comboBox.setGeometry(QtCore.QRect(340, 190, 81, 31))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.comboBox.setFont(font)
self.comboBox.setObjectName("comboBox")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.label_4 = QtWidgets.QLabel(self.groupBox)
self.label_4.setGeometry(QtCore.QRect(40, 280, 251, 31))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.label_4.setFont(font)
self.label_4.setObjectName("label_4")
self.label_6 = QtWidgets.QLabel(self.groupBox)
self.label_6.setGeometry(QtCore.QRect(40, 330, 341, 61))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(18)
self.label_6.setFont(font)
self.label_6.setObjectName("label_6")
self.lineEdit_9 = QtWidgets.QLineEdit(self.groupBox)
self.lineEdit_9.setGeometry(QtCore.QRect(340, 240, 71, 31))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.lineEdit_9.setFont(font)
self.lineEdit_9.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_9.setObjectName("lineEdit_9")
self.label_7 = QtWidgets.QLabel(self.groupBox)
self.label_7.setGeometry(QtCore.QRect(480, 350, 71, 21))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(16)
self.label_7.setFont(font)
self.label_7.setObjectName("label_7")
self.label_5 = QtWidgets.QLabel(self.groupBox)
self.label_5.setGeometry(QtCore.QRect(420, 280, 121, 21))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.label_5.setFont(font)
self.label_5.setObjectName("label_5")
self.horizontalLayoutWidget = QtWidgets.QWidget(self.groupBox)
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(40, 80, 971, 71))
self.horizontalLayoutWidget.setMinimumSize(QtCore.QSize(0, 40))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(18)
self.horizontalLayoutWidget.setFont(font)
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.lineEdit = QtWidgets.QLineEdit(self.horizontalLayoutWidget)
self.lineEdit.setMinimumSize(QtCore.QSize(0, 40))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(18)
self.lineEdit.setFont(font)
self.lineEdit.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit.setObjectName("lineEdit")
self.horizontalLayout.addWidget(self.lineEdit)
spacerItem = QtWidgets.QSpacerItem(60, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.lineEdit_2 = QtWidgets.QLineEdit(self.horizontalLayoutWidget)
self.lineEdit_2.setMinimumSize(QtCore.QSize(0, 40))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(18)
self.lineEdit_2.setFont(font)
self.lineEdit_2.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_2.setObjectName("lineEdit_2")
self.horizontalLayout.addWidget(self.lineEdit_2)
spacerItem1 = QtWidgets.QSpacerItem(60, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem1)
self.lineEdit_3 = QtWidgets.QLineEdit(self.horizontalLayoutWidget)
self.lineEdit_3.setMinimumSize(QtCore.QSize(0, 40))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(18)
self.lineEdit_3.setFont(font)
self.lineEdit_3.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_3.setObjectName("lineEdit_3")
self.horizontalLayout.addWidget(self.lineEdit_3)
spacerItem2 = QtWidgets.QSpacerItem(60, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem2)
self.lineEdit_4 = QtWidgets.QLineEdit(self.horizontalLayoutWidget)
self.lineEdit_4.setMinimumSize(QtCore.QSize(0, 40))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(18)
self.lineEdit_4.setFont(font)
self.lineEdit_4.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_4.setObjectName("lineEdit_4")
self.horizontalLayout.addWidget(self.lineEdit_4)
spacerItem3 = QtWidgets.QSpacerItem(60, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem3)
self.lineEdit_5 = QtWidgets.QLineEdit(self.horizontalLayoutWidget)
self.lineEdit_5.setMinimumSize(QtCore.QSize(0, 40))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(18)
self.lineEdit_5.setFont(font)
self.lineEdit_5.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_5.setObjectName("lineEdit_5")
self.horizontalLayout.addWidget(self.lineEdit_5)
spacerItem4 = QtWidgets.QSpacerItem(60, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem4)
self.lineEdit_6 = QtWidgets.QLineEdit(self.horizontalLayoutWidget)
self.lineEdit_6.setMinimumSize(QtCore.QSize(0, 40))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(18)
self.lineEdit_6.setFont(font)
self.lineEdit_6.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_6.setObjectName("lineEdit_6")
self.horizontalLayout.addWidget(self.lineEdit_6)
spacerItem5 = QtWidgets.QSpacerItem(60, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem5)
self.lineEdit_7 = QtWidgets.QLineEdit(self.horizontalLayoutWidget)
self.lineEdit_7.setMinimumSize(QtCore.QSize(0, 40))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(18)
self.lineEdit_7.setFont(font)
self.lineEdit_7.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_7.setObjectName("lineEdit_7")
self.horizontalLayout.addWidget(self.lineEdit_7)
spacerItem6 = QtWidgets.QSpacerItem(60, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem6)
self.lineEdit_8 = QtWidgets.QLineEdit(self.horizontalLayoutWidget)
self.lineEdit_8.setMinimumSize(QtCore.QSize(0, 40))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(18)
self.lineEdit_8.setFont(font)
self.lineEdit_8.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_8.setObjectName("lineEdit_8")
self.horizontalLayout.addWidget(self.lineEdit_8)
self.label = QtWidgets.QLabel(self.groupBox)
self.label.setGeometry(QtCore.QRect(40, 50, 571, 21))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.label.setFont(font)
self.label.setObjectName("label")
self.pushButton = QtWidgets.QPushButton(self.groupBox)
self.pushButton.setGeometry(QtCore.QRect(730, 310, 131, 71))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
font.setBold(True)
font.setWeight(75)
self.pushButton.setFont(font)
self.pushButton.setObjectName("pushButton")
self.lineEdit_11 = QtWidgets.QLineEdit(self.groupBox)
self.lineEdit_11.setGeometry(QtCore.QRect(380, 320, 91, 31))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.lineEdit_11.setFont(font)
self.lineEdit_11.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_11.setObjectName("lineEdit_11")
self.pushButton_2 = QtWidgets.QPushButton(self.groupBox)
self.pushButton_2.setGeometry(QtCore.QRect(860, 160, 111, 51))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
font.setBold(True)
font.setWeight(75)
self.pushButton_2.setFont(font)
self.pushButton_2.setObjectName("pushButton_2")
self.label_3 = QtWidgets.QLabel(self.groupBox)
self.label_3.setGeometry(QtCore.QRect(40, 240, 261, 31))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.label_3.setFont(font)
self.label_3.setObjectName("label_3")
self.groupBox_2 = QtWidgets.QGroupBox(self.centralwidget)
self.groupBox_2.setGeometry(QtCore.QRect(30, 450, 891, 281))
self.groupBox_2.setObjectName("groupBox_2")
self.label_8 = QtWidgets.QLabel(self.groupBox_2)
self.label_8.setGeometry(QtCore.QRect(480, 60, 71, 21))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(16)
self.label_8.setFont(font)
self.label_8.setText("")
self.label_8.setObjectName("label_8")
self.lineEdit_12 = QtWidgets.QLineEdit(self.groupBox_2)
self.lineEdit_12.setGeometry(QtCore.QRect(340, 20, 91, 31))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.lineEdit_12.setFont(font)
self.lineEdit_12.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_12.setObjectName("lineEdit_12")
self.label_9 = QtWidgets.QLabel(self.groupBox_2)
self.label_9.setGeometry(QtCore.QRect(40, 40, 311, 31))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(18)
self.label_9.setFont(font)
self.label_9.setObjectName("label_9")
self.label_10 = QtWidgets.QLabel(self.groupBox_2)
self.label_10.setGeometry(QtCore.QRect(440, 50, 71, 21))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(16)
self.label_10.setFont(font)
self.label_10.setObjectName("label_10")
self.label_12 = QtWidgets.QLabel(self.groupBox_2)
self.label_12.setGeometry(QtCore.QRect(40, 180, 131, 21))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.label_12.setFont(font)
self.label_12.setObjectName("label_12")
self.label_13 = QtWidgets.QLabel(self.groupBox_2)
self.label_13.setGeometry(QtCore.QRect(270, 180, 371, 21))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.label_13.setFont(font)
self.label_13.setObjectName("label_13")
self.lineEdit_13 = QtWidgets.QLineEdit(self.groupBox_2)
self.lineEdit_13.setGeometry(QtCore.QRect(180, 170, 71, 31))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.lineEdit_13.setFont(font)
self.lineEdit_13.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_13.setObjectName("lineEdit_13")
self.label_14 = QtWidgets.QLabel(self.groupBox_2)
self.label_14.setGeometry(QtCore.QRect(40, 120, 131, 21))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.label_14.setFont(font)
self.label_14.setObjectName("label_14")
self.lineEdit_14 = QtWidgets.QLineEdit(self.groupBox_2)
self.lineEdit_14.setGeometry(QtCore.QRect(160, 120, 51, 31))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.lineEdit_14.setFont(font)
self.lineEdit_14.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_14.setObjectName("lineEdit_14")
self.lineEdit_15 = QtWidgets.QLineEdit(self.groupBox_2)
self.lineEdit_15.setGeometry(QtCore.QRect(270, 100, 41, 31))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.lineEdit_15.setFont(font)
self.lineEdit_15.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_15.setObjectName("lineEdit_15")
self.label_15 = QtWidgets.QLabel(self.groupBox_2)
self.label_15.setGeometry(QtCore.QRect(320, 130, 21, 21))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.label_15.setFont(font)
self.label_15.setObjectName("label_15")
self.lineEdit_22 = QtWidgets.QLineEdit(self.groupBox_2)
self.lineEdit_22.setGeometry(QtCore.QRect(530, 170, 81, 31))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.lineEdit_22.setFont(font)
self.lineEdit_22.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_22.setObjectName("lineEdit_22")
self.label_22 = QtWidgets.QLabel(self.groupBox_2)
self.label_22.setGeometry(QtCore.QRect(620, 180, 21, 21))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.label_22.setFont(font)
self.label_22.setObjectName("label_22")
self.label_23 = QtWidgets.QLabel(self.groupBox_2)
self.label_23.setGeometry(QtCore.QRect(220, 130, 51, 21))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.label_23.setFont(font)
self.label_23.setObjectName("label_23")
self.pushButton_3 = QtWidgets.QPushButton(self.groupBox_2)
self.pushButton_3.setGeometry(QtCore.QRect(690, 180, 111, 51))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
font.setBold(True)
font.setWeight(75)
self.pushButton_3.setFont(font)
self.pushButton_3.setObjectName("pushButton_3")
self.label_24 = QtWidgets.QLabel(self.groupBox_2)
self.label_24.setGeometry(QtCore.QRect(40, 230, 241, 21))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.label_24.setFont(font)
self.label_24.setObjectName("label_24")
self.lineEdit_16 = QtWidgets.QLineEdit(self.groupBox_2)
self.lineEdit_16.setGeometry(QtCore.QRect(270, 220, 61, 31))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.lineEdit_16.setFont(font)
self.lineEdit_16.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_16.setObjectName("lineEdit_16")
self.label_25 = QtWidgets.QLabel(self.groupBox_2)
self.label_25.setGeometry(QtCore.QRect(340, 230, 21, 21))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
self.label_25.setFont(font)
self.label_25.setObjectName("label_25")
self.pushButton_4 = QtWidgets.QPushButton(self.groupBox_2)
self.pushButton_4.setGeometry(QtCore.QRect(690, 40, 91, 51))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
font.setBold(True)
font.setWeight(75)
self.pushButton_4.setFont(font)
self.pushButton_4.setObjectName("pushButton_4")
self.label_26 = QtWidgets.QLabel(self.groupBox_2)
self.label_26.setGeometry(QtCore.QRect(150, 200, 121, 21))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(10)
self.label_26.setFont(font)
self.label_26.setObjectName("label_26")
self.label_27 = QtWidgets.QLabel(self.groupBox_2)
self.label_27.setGeometry(QtCore.QRect(270, 250, 71, 21))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(10)
self.label_27.setFont(font)
self.label_27.setObjectName("label_27")
self.label_28 = QtWidgets.QLabel(self.groupBox_2)
self.label_28.setGeometry(QtCore.QRect(360, 130, 191, 21))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(10)
self.label_28.setFont(font)
self.label_28.setObjectName("label_28")
self.pushButton_6 = QtWidgets.QPushButton(self.groupBox_2)
self.pushButton_6.setGeometry(QtCore.QRect(500, 30, 51, 31))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(10)
font.setBold(True)
font.setWeight(75)
self.pushButton_6.setFont(font)
self.pushButton_6.setLayoutDirection(QtCore.Qt.LeftToRight)
self.pushButton_6.setAutoFillBackground(False)
self.pushButton_6.setAutoExclusive(False)
self.pushButton_6.setObjectName("pushButton_6")
self.pushButton_5 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_5.setGeometry(QtCore.QRect(950, 590, 91, 51))
font = QtGui.QFont()
font.setFamily("等线")
font.setPointSize(14)
font.setBold(True)
font.setWeight(75)
self.pushButton_5.setFont(font)
self.pushButton_5.setObjectName("pushButton_5")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1122, 24))
self.menubar.setObjectName("menubar")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
self.pushButton_4.clicked.connect(self.lineEdit_12.clear)
self.pushButton_4.clicked.connect(self.lineEdit_13.clear)
self.pushButton_4.clicked.connect(self.lineEdit_22.clear)
self.pushButton_4.clicked.connect(self.lineEdit_16.clear)
self.pushButton_2.clicked.connect(self.lineEdit.clear)
self.pushButton_2.clicked.connect(self.lineEdit_2.clear)
self.pushButton_2.clicked.connect(self.lineEdit_3.clear)
self.pushButton_2.clicked.connect(self.lineEdit_4.clear)
self.pushButton_2.clicked.connect(self.lineEdit_5.clear)
self.pushButton_2.clicked.connect(self.lineEdit_6.clear)
self.pushButton_2.clicked.connect(self.lineEdit_7.clear)
self.pushButton_2.clicked.connect(self.lineEdit_8.clear)
self.pushButton_5.clicked.connect(MainWindow.close)
self.pushButton_6.clicked.connect(self.lineEdit_12.show)
self.pushButton.clicked.connect(self.lineEdit_11.show)
self.pushButton_3.clicked.connect(self.lineEdit_22.show)
self.pushButton_3.clicked.connect(self.lineEdit_16.show)
self.pushButton_3.clicked.connect(self.lineEdit_13.show)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.groupBox.setTitle(_translate("MainWindow", "TCID50 计算"))
self.lineEdit_10.setText(_translate("MainWindow", "-1"))
self.label_2.setText(_translate("MainWindow", "稀释梯度为10倍,每孔上液量为"))
self.comboBox.setItemText(0, _translate("MainWindow", "100uL"))
self.comboBox.setItemText(1, _translate("MainWindow", "200uL"))
self.comboBox.setItemText(2, _translate("MainWindow", "1mL"))
self.label_4.setText(_translate("MainWindow", "最低稀释倍数的lg负对数为:"))
self.label_6.setText(_translate("MainWindow", "待检原液的TCID50的值为: 10"))
self.lineEdit_9.setText(_translate("MainWindow", "8"))
self.label_7.setText(_translate("MainWindow", "/mL"))
self.label_5.setText(_translate("MainWindow", "(如-2, -4)"))
self.lineEdit.setText(_translate("MainWindow", "8"))
self.lineEdit_2.setText(_translate("MainWindow", "8"))
self.lineEdit_3.setText(_translate("MainWindow", "7"))
self.lineEdit_4.setText(_translate("MainWindow", "3"))
self.lineEdit_5.setText(_translate("MainWindow", "1"))
self.lineEdit_6.setText(_translate("MainWindow", "0"))
self.lineEdit_7.setText(_translate("MainWindow", "0"))
self.lineEdit_8.setText(_translate("MainWindow", "0"))
self.label.setText(_translate("MainWindow", "请填写各稀释度的病变孔数(从低稀释倍数开始填)(自然数)"))
self.pushButton.setText(_translate("MainWindow", "计算 TCID50"))
self.pushButton_2.setText(_translate("MainWindow", "清除数据"))
self.label_3.setText(_translate("MainWindow", "每个稀释度重复数为:"))
self.groupBox_2.setTitle(_translate("MainWindow", "MOI 计算"))
self.lineEdit_12.setText(_translate("MainWindow", "-6"))
self.label_9.setText(_translate("MainWindow", "原液的TCID50的值为: 10"))
self.label_10.setText(_translate("MainWindow", "/mL"))
self.label_12.setText(_translate("MainWindow", "要计算MOI为"))
self.label_13.setText(_translate("MainWindow", "时,需要加入的病毒液的量为"))
self.lineEdit_13.setText(_translate("MainWindow", "1"))
self.label_14.setText(_translate("MainWindow", "细胞数量为:"))
self.lineEdit_14.setText(_translate("MainWindow", "2"))
self.lineEdit_15.setText(_translate("MainWindow", "6"))
self.label_15.setText(_translate("MainWindow", "个"))
self.lineEdit_22.setText(_translate("MainWindow", "100"))
self.label_22.setText(_translate("MainWindow", "uL"))
self.label_23.setText(_translate("MainWindow", "X 10"))
self.pushButton_3.setText(_translate("MainWindow", "计算 MOI"))
self.label_24.setText(_translate("MainWindow", "此时,感染的细胞比例为:"))
self.lineEdit_16.setText(_translate("MainWindow", "90"))
self.label_25.setText(_translate("MainWindow", "%"))
self.pushButton_4.setText(_translate("MainWindow", "清除"))
self.label_26.setText(_translate("MainWindow", "(PFU / cell_count)"))
self.label_27.setText(_translate("MainWindow", "(0-99.99)"))
self.label_28.setText(_translate("MainWindow", "(六孔板一般为:2x10^6个细胞)"))
self.pushButton_6.setText(_translate("MainWindow", "填充"))
self.pushButton_5.setText(_translate("MainWindow", "退出"))
|
[
"1154282938@qq.com"
] |
1154282938@qq.com
|
af3d51a8c6651d6a849e9cf2e188cdf5e8176eaf
|
99e1a15d8f605be456f17608843c309dd8a3260f
|
/src/Pokemon/Abilities/resist_type_ability.py
|
7ae249538edcd5eca1ceabf4685a1ace3dbf6a34
|
[] |
no_license
|
sgtnourry/Pokemon-Project
|
e53604096dcba939efca358e4177374bffcf0b38
|
3931eee5fd04e18bb1738a0b27a4c6979dc4db01
|
refs/heads/master
| 2021-01-17T23:02:25.910738
| 2014-04-12T17:46:27
| 2014-04-12T17:46:27
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 631
|
py
|
from Pokemon.Abilities.ability import Ability
class ResistTypeAbility(Ability):
""" An Ability with modified effectivensses """
def __init__(self, name, types):
""" """
Ability.__init__(self, name)
self.types = types
def effectivenessOnDefense(self, attackType, target):
""" Returns the effectiveness of the attack when the Pokemon with this ability is defending """
if attackType in self.types:
return self.types[attackType]['effectiveness'], self.types[attackType]['message'].format(header=target.getHeader())
return 1, None
|
[
"cloew123@gmail.com"
] |
cloew123@gmail.com
|
7d774683866c6af78ba7b94d7359d40e6dbccb5d
|
2d4af29250dca8c72b74e190e74d92f1467120a0
|
/TaobaoSdk/Request/UdpItemGetRequest.py
|
bfddef49a7fac36e4655c5d8ba9f31734b80b15e
|
[] |
no_license
|
maimiaolmc/TaobaoOpenPythonSDK
|
2c671be93c40cf487c0d7d644479ba7e1043004c
|
d349aa8ed6229ce6d76a09f279a0896a0f8075b3
|
refs/heads/master
| 2020-04-06T03:52:46.585927
| 2014-06-09T08:58:27
| 2014-06-09T08:58:27
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 10,383
|
py
|
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim: set ts=4 sts=4 sw=4 et:
## @brief 商品指标查询
# @author wuliang@maimiaotech.com
# @date 2013-09-22 16:52:38
# @version: 0.0.0
import os
import sys
import time
def __getCurrentPath():
return os.path.normpath(os.path.join(os.path.realpath(__file__), os.path.pardir))
__modulePath = os.path.join(__getCurrentPath(), os.path.pardir)
__modulePath = os.path.normpath(__modulePath)
if __modulePath not in sys.path:
sys.path.insert(0, __modulePath)
## @brief <SPAN style="font-size:16px; font-family:'宋体','Times New Roman',Georgia,Serif;">商品指标查询</SPAN>
# <UL>
# </UL>
class UdpItemGetRequest(object):
def __init__(self):
super(self.__class__, self).__init__()
## @brief <SPAN style="font-size:16px; font-family:'宋体','Times New Roman',Georgia,Serif;">获取API名称</SPAN>
# <UL>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Type</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">str</SPAN>
# </LI>
# </UL>
self.method = "taobao.udp.item.get"
## @brief <SPAN style="font-size:16px; font-family:'宋体','Times New Roman',Georgia,Serif;">时间戳,如果不设置,发送请求时将使用当时的时间</SPAN>
# <UL>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Type</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">int</SPAN>
# </LI>
# </UL>
self.timestamp = int(time.time())
## @brief <SPAN style="font-size:16px; font-family:'宋体','Times New Roman',Georgia,Serif;">地区ID</SPAN>
# <UL>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Type</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">Number</SPAN>
# </LI>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Required</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">optional</SPAN>
# </LI>
# </UL>
self.area = None
## @brief <SPAN style="font-size:16px; font-family:'宋体','Times New Roman',Georgia,Serif;">开始时间</SPAN>
# <UL>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Type</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">Date</SPAN>
# </LI>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Required</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">required</SPAN>
# </LI>
# </UL>
self.begin_time = None
## @brief <SPAN style="font-size:16px; font-family:'宋体','Times New Roman',Georgia,Serif;">结束时间</SPAN>
# <UL>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Type</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">Date</SPAN>
# </LI>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Required</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">required</SPAN>
# </LI>
# </UL>
self.end_time = None
## @brief <SPAN style="font-size:16px; font-family:'宋体','Times New Roman',Georgia,Serif;">指标ID(参阅指标编号)</SPAN>
# <UL>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Type</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">Number</SPAN>
# </LI>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Required</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">required</SPAN>
# </LI>
# </UL>
self.fields = None
## @brief <SPAN style="font-size:16px; font-family:'宋体','Times New Roman',Georgia,Serif;">商品ID</SPAN>
# <UL>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Type</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">Number</SPAN>
# </LI>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Required</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">optional</SPAN>
# </LI>
# </UL>
self.itemid = None
## @brief <SPAN style="font-size:16px; font-family:'宋体','Times New Roman',Georgia,Serif;">多个宝贝列表</SPAN>
# <UL>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Type</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">Number</SPAN>
# </LI>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Required</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">optional</SPAN>
# </LI>
# </UL>
self.items = None
## @brief <SPAN style="font-size:16px; font-family:'宋体','Times New Roman',Georgia,Serif;">排序指标</SPAN>
# <UL>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Type</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">String</SPAN>
# </LI>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Required</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">optional</SPAN>
# </LI>
# </UL>
self.order_by = None
## @brief <SPAN style="font-size:16px; font-family:'宋体','Times New Roman',Georgia,Serif;">排序规则</SPAN>
# <UL>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Type</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">String</SPAN>
# </LI>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Required</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">optional</SPAN>
# </LI>
# </UL>
self.order_rule = None
## @brief <SPAN style="font-size:16px; font-family:'宋体','Times New Roman',Georgia,Serif;">查询页码,0为第一页</SPAN>
# <UL>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Type</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">Number</SPAN>
# </LI>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Required</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">optional</SPAN>
# </LI>
# </UL>
self.page_no = None
## @brief <SPAN style="font-size:16px; font-family:'宋体','Times New Roman',Georgia,Serif;">每页记录数</SPAN>
# <UL>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Type</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">Number</SPAN>
# </LI>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Required</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">optional</SPAN>
# </LI>
# </UL>
self.page_size = None
## @brief <SPAN style="font-size:16px; font-family:'宋体','Times New Roman',Georgia,Serif;">备用</SPAN>
# <UL>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Type</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">String</SPAN>
# </LI>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Required</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">optional</SPAN>
# </LI>
# </UL>
self.parameters = None
## @brief <SPAN style="font-size:16px; font-family:'宋体','Times New Roman',Georgia,Serif;">来源ID</SPAN>
# <UL>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Type</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">Number</SPAN>
# </LI>
# <LI>
# <SPAN style="color:DarkRed; font-size:18px; font-family:'Times New Roman',Georgia,Serif;">Required</SPAN>: <SPAN style="color:DarkMagenta; font-size:16px; font-family:'Times New Roman','宋体',Georgia,Serif;">optional</SPAN>
# </LI>
# </UL>
self.source = None
|
[
"chenke@maimiaotech.com"
] |
chenke@maimiaotech.com
|
bf5555989d86fa4f6bcf35bcbad1fc8472065722
|
1dacbf90eeb384455ab84a8cf63d16e2c9680a90
|
/pkgs/astropy-1.1.2-np110py27_0/lib/python2.7/site-packages/astropy/utils/compat/misc.py
|
9b56940a7d85a04a5497f9b2f99abf3c2480f150
|
[
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-unknown"
] |
permissive
|
wangyum/Anaconda
|
ac7229b21815dd92b0bd1c8b7ec4e85c013b8994
|
2c9002f16bb5c265e0d14f4a2314c86eeaa35cb6
|
refs/heads/master
| 2022-10-21T15:14:23.464126
| 2022-10-05T12:10:31
| 2022-10-05T12:10:31
| 76,526,728
| 11
| 10
|
Apache-2.0
| 2022-10-05T12:10:32
| 2016-12-15T05:26:12
|
Python
|
UTF-8
|
Python
| false
| false
| 3,556
|
py
|
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Simple utility functions and bug fixes for compatibility with all supported
versions of Python. This module should generally not be used directly, as
everything in `__all__` will be imported into `astropy.utils.compat` and can
be accessed from there.
Includes the following fixes:
* The `contextlib.ignored` context manager, which is only available in Python
3.4 or greater.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from ...extern import six
import functools
import sys
__all__ = ['invalidate_caches', 'override__dir__', 'ignored',
'possible_filename']
def possible_filename(filename):
"""
Determine if the ``filename`` argument is an allowable type for a filename.
In Python 3.3 use of non-unicode filenames on system calls such as
`os.stat` and others that accept a filename argument was deprecated (and
may be removed outright in the future).
Therefore this returns `True` in all cases except for `bytes` strings in
Windows on Python >= 3.3.
"""
if isinstance(filename, six.text_type):
return True
elif isinstance(filename, six.binary_type):
return not (sys.platform == 'win32' and
sys.version_info[:2] >= (3, 3))
return False
# Python 3.3's importlib caches filesystem reads for faster imports in the
# general case. But sometimes it's necessary to manually invalidate those
# caches so that the import system can pick up new generated files. See
# https://github.com/astropy/astropy/issues/820
if sys.version_info[:2] >= (3, 3):
from importlib import invalidate_caches
else:
invalidate_caches = lambda: None
def override__dir__(f):
"""
When overriding a __dir__ method on an object, you often want to
include the "standard" members on the object as well. This
decorator takes care of that automatically, and all the wrapped
function needs to do is return a list of the "special" members
that wouldn't be found by the normal Python means.
Example
-------
@override__dir__
def __dir__(self):
return ['special_method1', 'special_method2']
"""
if sys.version_info[:2] < (3, 3):
# There was no straightforward way to do this until Python 3.3, so
# we have this complex monstrosity
@functools.wraps(f)
def override__dir__wrapper(self):
members = set()
for cls in self.__class__.mro():
members.update(dir(cls))
members.update(six.iterkeys(self.__dict__))
members.update(f(self))
return sorted(members)
else:
# http://bugs.python.org/issue12166
@functools.wraps(f)
def override__dir__wrapper(self):
members = set(object.__dir__(self))
members.update(f(self))
return sorted(members)
return override__dir__wrapper
try:
from contextlib import ignored
except ImportError:
from contextlib import contextmanager
@contextmanager
def ignored(*exceptions):
"""A context manager for ignoring exceptions. Equivalent to::
try:
<body>
except exceptions:
pass
Example::
>>> import os
>>> with ignored(OSError):
... os.remove('file-that-does-not-exist')
"""
try:
yield
except exceptions:
pass
|
[
"wgyumg@mgail.com"
] |
wgyumg@mgail.com
|
147cf4364b9e0ec4c97c14d9487f7650af798832
|
0767d96d7d389d0c76b9915f33d19e910f5e3ae2
|
/changingthefoodchain/organizations/management/commands/loadorganizations.py
|
75cf04100d16dd9dbbdd0ba537a4b680f88c6ab4
|
[] |
no_license
|
ebrelsford/changingthefoodchain-back
|
3d7b68aadd97339910a98ea6da0f66ce2af46979
|
58d093ff4f4f211c1e83de099f4bf3981d598588
|
refs/heads/master
| 2021-01-22T09:05:20.114067
| 2016-01-15T02:33:10
| 2016-01-15T02:33:10
| 21,173,480
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 2,099
|
py
|
import csv
from django.contrib.gis.geos import Point
from django.core.management.base import BaseCommand
from organizations.models import Organization, Sector, Type
class Command(BaseCommand):
args = 'filename'
help = 'Load the organizations in the given CSV'
type_abbreviations = {
'a': 'advocacy group',
's': 'service organization',
'u': 'union',
'wc': 'workers center',
}
def get_sectors(self, raw):
sectors = [sector.strip() for sector in raw.lower().split('/')]
return [Sector.objects.get_or_create(name=s)[0] for s in sectors]
def get_type(self, name):
fullname = self.type_abbreviations[name.lower()]
type, created = Type.objects.get_or_create(name=fullname)
return type
def get_types(self, raw):
types = [t.strip() for t in raw.lower().split('/')]
return [self.get_type(t) for t in types]
def handle(self, filename, *args, **options):
for row in csv.DictReader(open(filename, 'r')):
try:
point = Point(float(row['longitude']), float(row['latitude']),
srid=4326)
except:
self.stdout.write(u'Failed to get point for %s' % row['Name'])
point = None
organization = Organization(
name=row['Name'],
address_line1=row['Address'],
city=row['City'],
state_province=row['State'],
postal_code=row['Zip'],
email=row['Email'],
phone=row['Phone #'],
site_url=row['website'] or None,
mission=row['Mission'] or None,
centroid=point,
)
try:
organization.save()
organization.sectors.add(*self.get_sectors(row['Food Sector(s)']))
organization.types.add(*self.get_types(row['Organization Type']))
except Exception:
print 'Failed to save organization %s' % organization.name
continue
|
[
"ebrelsford@gmail.com"
] |
ebrelsford@gmail.com
|
c1abfa1d38d1a7389e9f65eaf991440fc0579afd
|
f6fca4fe9923e82bdd69fbca661a4e7df16660cb
|
/kws_streaming/layers/sub_spectral_normalization.py
|
10b924a1b0189041f860da536ea4105cd6ad8052
|
[
"Apache-2.0",
"CC-BY-4.0"
] |
permissive
|
zdeagle/google-research
|
85664eae969cbeff3012bc5b0beb94c557030f9c
|
249751dfe7cb6e0b5be5c2e301d0aed71ab15ff2
|
refs/heads/master
| 2023-09-03T06:44:06.126169
| 2021-11-01T01:44:43
| 2021-11-01T02:11:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 2,133
|
py
|
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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.
"""Sub spectral normalization layer."""
from kws_streaming.layers.compat import tf
class SubSpectralNormalization(tf.keras.layers.Layer):
"""Sub spectral normalization layer.
It is based on paper:
"SUBSPECTRAL NORMALIZATION FOR NEURAL AUDIO DATA PROCESSING"
https://arxiv.org/pdf/2103.13620.pdf
"""
def __init__(self, sub_groups, **kwargs):
super(SubSpectralNormalization, self).__init__(**kwargs)
self.sub_groups = sub_groups
def call(self, inputs):
# expected input: [N, Time, Frequency, Channels]
if inputs.shape.rank != 4:
raise ValueError('input_shape.rank:%d must be 4' % inputs.shape.rank)
input_shape = inputs.shape.as_list()
if input_shape[2] % self.sub_groups:
raise ValueError('input_shape[2]: %d must be divisible by '
'self.sub_groups %d ' %
(input_shape[2], self.sub_groups))
net = inputs
if self.sub_groups == 1:
net = tf.keras.layers.BatchNormalization()(net)
else:
target_shape = [
input_shape[1], input_shape[2] // self.sub_groups,
input_shape[3] * self.sub_groups
]
net = tf.keras.layers.Reshape(target_shape)(net)
net = tf.keras.layers.BatchNormalization()(net)
net = tf.keras.layers.Reshape(input_shape[1:])(net)
return net
def get_config(self):
config = {'sub_groups': self.sub_groups}
base_config = super(SubSpectralNormalization, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
|
[
"copybara-worker@google.com"
] |
copybara-worker@google.com
|
41f97e277f906e0452fb33ce4ea04de915867d9e
|
a8d55aa06c84ba592207d3e784cb449987dbf73d
|
/python/HI/dijet_analysis/pPb8TeV/Pythia8_Dijet120_pp_TuneCUETP8M1_8160GeV_cff.py
|
9d359c1099dc989d03f935217c82f54be254fca2
|
[] |
no_license
|
CmsHI/genproductions
|
1a38e6d00a286ca485cc01f89c476d888a947b7f
|
bda8af4537f692677eafe10148cd17a7d364ebf8
|
refs/heads/master
| 2023-03-07T10:33:28.844648
| 2023-02-03T12:54:52
| 2023-02-03T12:54:52
| 15,395,480
| 0
| 5
| null | 2020-03-21T21:33:13
| 2013-12-23T12:58:04
|
Python
|
UTF-8
|
Python
| false
| false
| 1,075
|
py
|
import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import *
generator = cms.EDFilter("Pythia8GeneratorFilter",
PythiaParameters = cms.PSet(
pythia8CommonSettingsBlock,
pythia8CUEP8M1SettingsBlock,
parameterSets = cms.vstring('pythia8CommonSettings',
'pythia8CUEP8M1Settings',
'processParameters'),
processParameters = cms.vstring('HardQCD:all = on',
'PhaseSpace:pTHatMin = 120.',
'PhaseSpace:pTHatMax = 9999.'),
),
comEnergy = cms.double(8160.0),
filterEfficiency = cms.untracked.double(1.0),
maxEventsToPrint = cms.untracked.int32(0),
pythiaHepMCVerbosity = cms.untracked.bool(False),
pythiaPylistVerbosity = cms.untracked.int32(0)
)
configurationMetadata = cms.untracked.PSet(
annotation = cms.untracked.string('PYTHIA 8 (unquenched) dijets in NN (pt-hat > 120 GeV) at sqrt(s) = 8.16 TeV')
)
ProductionFilterSequence = cms.Sequence(generator)
|
[
"marta.verweij@cern.ch"
] |
marta.verweij@cern.ch
|
913972683869049d67d35ad24c16ab8a76fb8aea
|
380372bbec9b77df14bb96fc32aca7061cca0635
|
/covid/calc/italy/sird_out.py
|
0839b65487e1954ded6ee16c860c90ae410488da
|
[] |
no_license
|
IchiroYoshida/python_public
|
d3c42dc31b3206db3a520a007ea4fb4ce6c1a6fd
|
37ccadb1d3d42a38561c7708391f4c11836f5360
|
refs/heads/master
| 2023-08-16T17:19:07.278554
| 2023-08-13T21:29:51
| 2023-08-13T21:29:51
| 77,261,682
| 2
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 944
|
py
|
'''
SIRD/Optuna1 model simulation Plot
2020-03-28
'''
import numpy as np
from scipy.integrate import odeint
import matplotlib.pylab as plt
from matplotlib.pylab import rcParams
plt.style.use('seaborn-colorblind')
N = 60480000 # community size
t_max = 200
tspan = np.linspace(0.0, t_max, t_max + 1)
# parameters to fit
alpha = 0.623 # 感染率
beta = 0.0505 # 回復率
fatalityrate= 0.03 # 死亡率
I0 = 9995 # Init Infected patients
def sird(v,t):
global alpha, beta,fatalityrate
# v = [S, I, R, D]
x = alpha *v[0] *v[2] / N # infected rate of the day
y = beta * v[1]
dS = -x # S:Susceptible
dI = x - y # I:Infected
dR = y # R:Recovered or Dead
dD = fatalityrate * y
return np.array([dS, dI, dR, dD])
ini_state = [N-I0, I0, 0, 0]
ode_int = odeint(sird, ini_state, tspan)
num = len(ode_int)
for d in range(num):
print(d,ode_int[d])
|
[
"yoshida.ichi@gmail.com"
] |
yoshida.ichi@gmail.com
|
7a09e0bbbfb0ff3a03a00cbce4ceef84c246cfae
|
163bbb4e0920dedd5941e3edfb2d8706ba75627d
|
/Code/CodeRecords/2177/60760/320775.py
|
e9baa7cea28a2c72ead4bdca35056de12a8b98dc
|
[] |
no_license
|
AdamZhouSE/pythonHomework
|
a25c120b03a158d60aaa9fdc5fb203b1bb377a19
|
ffc5606817a666aa6241cfab27364326f5c066ff
|
refs/heads/master
| 2022-11-24T08:05:22.122011
| 2020-07-28T16:21:24
| 2020-07-28T16:21:24
| 259,576,640
| 2
| 1
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 561
|
py
|
n=int(input())
res=n
if res==11:
print(12)
print("6 7 5 8 4 9 3 10 2 11 1 12",end=" ")
elif res==1:
print(2)
print("1 2",end=" ")
elif res==9:
print(10)
print("5 6 4 7 3 8 2 9 1 10",end=" ")
elif res==13:
print(14)
print("7 8 6 9 5 10 4 11 3 12 2 13 1 14",end=" ")
elif res==35:
print(36)
print("18 19 17 20 16 21 15 22 14 23 13 24 12 25 11 26 10 27 9 28 8 29 7 30 6 31 5 32 4 33 3 34 2 35 1 36",end=" ")
elif res==16:
print(17)
print("9 8 10 7 11 6 12 5 13 4 14 3 15 2 16 1 17",end=" ")
else:
print(res)
|
[
"1069583789@qq.com"
] |
1069583789@qq.com
|
09179808823e6090a2772bb6dfde9ff15c641ee6
|
86ce7710dfb1a4598d02a8006ebb3077c9101f29
|
/nekidblog/postsapp/models.py
|
a434d6e5778917beda41daf69fd0ec3cfb6c1931
|
[] |
no_license
|
spoliv/test_task_nekidaem_ru
|
33b9fe8db54bf9d588834963fa3c1b9a5ae02159
|
3fa29a95cce5e2eb698827c0e3b8e89177022ab6
|
refs/heads/main
| 2023-01-30T04:48:25.101257
| 2020-12-10T15:45:16
| 2020-12-10T15:45:16
| 318,528,386
| 0
| 0
| null | null | null | null |
UTF-8
|
Python
| false
| false
| 819
|
py
|
from django.db import models
from django.contrib.auth.models import User
class Blog(models.Model):
class Meta:
verbose_name = 'Блог'
verbose_name_plural = 'Блоги'
author = models.ForeignKey(User, on_delete=models.CASCADE)
blog_theme = models.CharField(verbose_name='тема блога', max_length=50)
class Post(models.Model):
class Meta:
verbose_name = 'Пост'
verbose_name_plural = 'Посты'
blog = models.ForeignKey(Blog, on_delete=models.CASCADE)
post_title = models.CharField(verbose_name='заголовок поста', max_length=50)
post_body = models.TextField(verbose_name='текст поста', blank=True)
date_created = models.DateTimeField(verbose_name='создан', auto_now_add=True)
# Create your models here.
|
[
"spoliv@rambler.ru"
] |
spoliv@rambler.ru
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.